From b6b64d4c61ce00b6ee673c9ed19a326fbaf821a5 Mon Sep 17 00:00:00 2001 From: rbgksqkr Date: Sat, 9 Nov 2024 15:12:05 +0000 Subject: [PATCH] deploy: 7f23a8c217f645c611d235bd7e0e2ec712976e21 --- storybook/129.f4eb18b4.iframe.bundle.js | 1 - storybook/468.05c76329.iframe.bundle.js | 1 + storybook/507.090472e8.iframe.bundle.js | 1 - storybook/579.9585a80b.iframe.bundle.js | 1 - ...f49b1b.iframe.bundle.js => 58.61dadb3d.iframe.bundle.js} | 6 +++--- storybook/58.61dadb3d.iframe.bundle.js.map | 1 + ...1a415.iframe.bundle.js => 763.f9a7705e.iframe.bundle.js} | 4 ++-- storybook/763.f9a7705e.iframe.bundle.js.map | 1 + storybook/803.79f4b08e.iframe.bundle.js | 1 + storybook/845.fbe2e83e.iframe.bundle.js | 1 + storybook/864.14d1a415.iframe.bundle.js.map | 1 - storybook/941.3ff2bb29.iframe.bundle.js | 1 - storybook/941.ad998aaf.iframe.bundle.js | 1 + storybook/961.75f49b1b.iframe.bundle.js.map | 1 - ...-AlertModal-AlertModal-stories.11df13e1.iframe.bundle.js | 1 + ...nviteModal-InviteModal-stories.3e36ce07.iframe.bundle.js | 1 + ...-ReadyMembersContainer-stories.1045e401.iframe.bundle.js | 1 - ...oomSetting-RoomSetting-stories.cc4be260.iframe.bundle.js | 1 - ...odal-RoomSettingModal-stories.664f966c.iframe.bundle.js} | 2 +- ...tContainer-Timer-Timer-stories.a88b6252.iframe.bundle.js | 1 - ...ectOption-SelectOption-stories.edc08058.iframe.bundle.js | 1 - ...er-Countdown-Countdown-stories.0b1d4c82.iframe.bundle.js | 1 - ...er-TabContentContainer-stories.65593744.iframe.bundle.js | 1 - ...-AlertModal-AlertModal-stories.b71108f4.iframe.bundle.js | 1 - ...nviteModal-InviteModal-stories.e583aea4.iframe.bundle.js | 1 - storybook/iframe.html | 4 ++-- storybook/index.json | 2 +- ...e323.iframe.bundle.js => main.aa1f4ddd.iframe.bundle.js} | 4 ++-- ...ame.bundle.js.map => main.aa1f4ddd.iframe.bundle.js.map} | 2 +- ...ages-GamePage-GamePage-stories.16c393fc.iframe.bundle.js | 1 + ...ages-GamePage-GamePage-stories.187d2499.iframe.bundle.js | 1 - ...ectOption-SelectOption-stories.e9f480a3.iframe.bundle.js | 1 + ...tContainer-Timer-Timer-stories.81c5065d.iframe.bundle.js | 1 + ...es-ReadyPage-ReadyPage-stories.53bb575a.iframe.bundle.js | 1 - ...es-ReadyPage-ReadyPage-stories.588a9464.iframe.bundle.js | 1 + ...-ReadyMembersContainer-stories.6b9574a6.iframe.bundle.js | 1 + ...oomSetting-RoomSetting-stories.3abaa671.iframe.bundle.js | 1 + ...er-Countdown-Countdown-stories.0ab370a4.iframe.bundle.js | 1 + ...er-TabContentContainer-stories.45e57f58.iframe.bundle.js | 1 + storybook/project.json | 2 +- storybook/runtime~main.56383c9e.iframe.bundle.js | 1 - storybook/runtime~main.69435c63.iframe.bundle.js | 1 + 42 files changed, 30 insertions(+), 30 deletions(-) delete mode 100644 storybook/129.f4eb18b4.iframe.bundle.js create mode 100644 storybook/468.05c76329.iframe.bundle.js delete mode 100644 storybook/507.090472e8.iframe.bundle.js delete mode 100644 storybook/579.9585a80b.iframe.bundle.js rename storybook/{961.75f49b1b.iframe.bundle.js => 58.61dadb3d.iframe.bundle.js} (59%) create mode 100644 storybook/58.61dadb3d.iframe.bundle.js.map rename storybook/{864.14d1a415.iframe.bundle.js => 763.f9a7705e.iframe.bundle.js} (87%) create mode 100644 storybook/763.f9a7705e.iframe.bundle.js.map create mode 100644 storybook/803.79f4b08e.iframe.bundle.js create mode 100644 storybook/845.fbe2e83e.iframe.bundle.js delete mode 100644 storybook/864.14d1a415.iframe.bundle.js.map delete mode 100644 storybook/941.3ff2bb29.iframe.bundle.js create mode 100644 storybook/941.ad998aaf.iframe.bundle.js delete mode 100644 storybook/961.75f49b1b.iframe.bundle.js.map create mode 100644 storybook/components-AlertModal-AlertModal-stories.11df13e1.iframe.bundle.js create mode 100644 storybook/components-InviteModal-InviteModal-stories.3e36ce07.iframe.bundle.js delete mode 100644 storybook/components-ReadyMembersContainer-ReadyMembersContainer-stories.1045e401.iframe.bundle.js delete mode 100644 storybook/components-RoomSetting-RoomSetting-stories.cc4be260.iframe.bundle.js rename storybook/{components-common-RoomSettingModal-RoomSettingModal-stories.d76c4c12.iframe.bundle.js => components-RoomSettingModal-RoomSettingModal-stories.664f966c.iframe.bundle.js} (75%) delete mode 100644 storybook/components-SelectContainer-Timer-Timer-stories.a88b6252.iframe.bundle.js delete mode 100644 storybook/components-SelectOption-SelectOption-stories.edc08058.iframe.bundle.js delete mode 100644 storybook/components-StartButtonContainer-Countdown-Countdown-stories.0b1d4c82.iframe.bundle.js delete mode 100644 storybook/components-TabContentContainer-TabContentContainer-stories.65593744.iframe.bundle.js delete mode 100644 storybook/components-common-AlertModal-AlertModal-stories.b71108f4.iframe.bundle.js delete mode 100644 storybook/components-common-InviteModal-InviteModal-stories.e583aea4.iframe.bundle.js rename storybook/{main.b156e323.iframe.bundle.js => main.aa1f4ddd.iframe.bundle.js} (74%) rename storybook/{main.b156e323.iframe.bundle.js.map => main.aa1f4ddd.iframe.bundle.js.map} (95%) create mode 100644 storybook/pages-GamePage-GamePage-stories.16c393fc.iframe.bundle.js delete mode 100644 storybook/pages-GamePage-GamePage-stories.187d2499.iframe.bundle.js create mode 100644 storybook/pages-GamePage-components-SelectContainer-SelectOption-SelectOption-stories.e9f480a3.iframe.bundle.js create mode 100644 storybook/pages-GamePage-components-SelectContainer-Timer-Timer-stories.81c5065d.iframe.bundle.js delete mode 100644 storybook/pages-ReadyPage-ReadyPage-stories.53bb575a.iframe.bundle.js create mode 100644 storybook/pages-ReadyPage-ReadyPage-stories.588a9464.iframe.bundle.js create mode 100644 storybook/pages-ReadyPage-components-ReadyMembersContainer-ReadyMembersContainer-stories.6b9574a6.iframe.bundle.js create mode 100644 storybook/pages-ReadyPage-components-RoomSetting-RoomSetting-stories.3abaa671.iframe.bundle.js create mode 100644 storybook/pages-ReadyPage-components-StartButtonContainer-Countdown-Countdown-stories.0ab370a4.iframe.bundle.js create mode 100644 storybook/pages-RoundResultPage-components-RoundVoteContainer-TabContentContainer-TabContentContainer-stories.45e57f58.iframe.bundle.js delete mode 100644 storybook/runtime~main.56383c9e.iframe.bundle.js create mode 100644 storybook/runtime~main.69435c63.iframe.bundle.js diff --git a/storybook/129.f4eb18b4.iframe.bundle.js b/storybook/129.f4eb18b4.iframe.bundle.js deleted file mode 100644 index 4687288a8..000000000 --- a/storybook/129.f4eb18b4.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[129],{"./src/components/ReadyMembersContainer/ReadyMembersContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>ReadyMembersContainer_ReadyMembersContainer});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const readyMembersContainerLayout={name:"ch4q08",styles:"display:flex;flex-direction:column;gap:2rem;width:100%"},membersContainer=(0,emotion_react_browser_esm.AH)("position:relative;height:25rem;padding:2rem 3rem 0;border-radius:2rem;background-color:",Theme.S.color.peanut300,";font-weight:600;font-size:1rem;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}",""),totalNumber={name:"eu54mg",styles:"display:flex;justify-content:space-between;align-items:center;padding-left:2rem;font-weight:900;font-size:2rem"},memberList={name:"10zw2ye",styles:"display:flex;flex-direction:column;gap:2rem"},inviteButton=(0,emotion_react_browser_esm.AH)("width:12rem;height:4rem;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";font-weight:700;",""),memberItem={name:"15umcqw",styles:"display:flex;align-items:center;gap:2rem"},profileBox={name:"1bezcfz",styles:"display:flex;justify-content:center;align-items:center;width:3.6rem;height:3.6rem;border-radius:50%;background-color:white"},profileImage={name:"xjt14x",styles:"width:60%"},memberStatus={name:"mk4uq1",styles:"display:flex;flex:1;justify-content:space-between;align-items:center"};var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx");const crownIcon_namespaceObject=__webpack_require__.p+"static/media/crownIcon.1ef721d9.webp";var sillyDdangkongMedium=__webpack_require__("./src/assets/images/sillyDdangkongMedium.webp"),InviteModal=__webpack_require__("./src/components/common/InviteModal/InviteModal.tsx"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts"),useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const ReadyMembersContainer=()=>{const{members,master}=(0,useGetRoomInfo.$)(),{show}=(0,useModal.A)(),queryClient=(0,QueryClientProvider.jE)(),returnFocusRef=(0,react.useRef)(null),memberCountMessage=`총 인원 ${members.length}명`;return(0,react.useEffect)((()=>{queryClient.invalidateQueries({queryKey:[queryKeys.e.getUserInfo]})}),[master.memberId]),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:readyMembersContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:totalNumber,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{role:"status",children:memberCountMessage}),(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:inviteButton,onClick:()=>{show(InviteModal.A,{returnFocusRef})},ref:returnFocusRef,children:"초대하기"})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("section",{css:membersContainer,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:memberList,children:members.map((member=>(0,emotion_react_jsx_runtime_browser_esm.FD)("li",{css:memberItem,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:`${member.isMaster?"방장":""} ${member.nickname}`}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:profileBox,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:sillyDdangkongMedium,alt:"",css:profileImage})}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:memberStatus,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{"aria-hidden":!0,children:member.nickname}),member.isMaster&&(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:crownIcon_namespaceObject,alt:""})]})]},member.memberId)))})})]})},ReadyMembersContainer_ReadyMembersContainer=ReadyMembersContainer;ReadyMembersContainer.__docgenInfo={description:"",methods:[],displayName:"ReadyMembersContainer"}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}},"./src/assets/images/sillyDdangkongMedium.webp":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/sillyDdangkongMedium.9937535c.webp"}}]); \ No newline at end of file diff --git a/storybook/468.05c76329.iframe.bundle.js b/storybook/468.05c76329.iframe.bundle.js new file mode 100644 index 000000000..1edbc7f70 --- /dev/null +++ b/storybook/468.05c76329.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[468],{"./src/components/InviteModal/InviteModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>InviteModal_InviteModal});var lib=__webpack_require__("./node_modules/react-qr-code/lib/index.js"),react=__webpack_require__("./node_modules/react/index.js");const hooks_useClipBoard=()=>{const[isCopied,setIsCopied]=(0,react.useState)(!1);return{isCopied,copyToClipboard:async text=>{await navigator.clipboard.writeText(text),setIsCopied(!0),setTimeout((()=>setIsCopied(!1)),2e3)}}};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const inviteModalLayout=(0,emotion_react_browser_esm.AH)("background-color:",Theme.S.color.peanut300,";",""),inviteModalTitle={name:"arzv6g",styles:"font-size:1.6rem;text-align:center"},inviteModalUl={name:"zmgl3t",styles:"display:flex;flex-direction:column;justify-content:center;gap:2rem"},qrcodeWrapper=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:100%;height:20rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:white;",""),inviteModalLi=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;gap:0.8rem;padding:0.8rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:#ffff;",""),inviteModalLinkButton={name:"gfehpl",styles:"width:100%;padding:1.6rem 0.4rem;background:none;border:none;cursor:pointer"},inviteModalLinkButtonInfoWrapper={name:"1eoy87d",styles:"display:flex;justify-content:space-between"},inviteModalText={name:"1l7fe3o",styles:"overflow:hidden;width:95%;font-size:1.4rem;text-overflow:ellipsis"},inviteModalCopyIcon={name:"1p82uuh",styles:"width:10%"};var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx");const copyIcon_namespaceObject=__webpack_require__.p+"static/media/copyIcon.d9b466b1.png";var url=__webpack_require__("./src/constants/url.ts"),useGetUserInfo=__webpack_require__("./src/hooks/useGetUserInfo.ts"),ToastProvider=__webpack_require__("./src/providers/ToastProvider/ToastProvider.tsx");const hooks_useToast=()=>{const toast=(0,react.useContext)(ToastProvider.$);if(!toast)throw new Error("ToastContext를 찾을 수 없습니다.");return toast};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const InviteModal=({isOpen,onClose,returnFocusRef})=>{const{roomUuid}=(0,useGetUserInfo.A)(),inviteUrl=(0,url.MY)(roomUuid),{copyToClipboard}=hooks_useClipBoard(),{show}=hooks_useToast();return(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,css:inviteModalLayout,returnFocusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:inviteModalTitle,children:"초대하기"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("ul",{css:inviteModalUl,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:qrcodeWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)(lib.Ay,{style:{width:"50%",height:"50%"},value:inviteUrl})})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{css:inviteModalLi,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{copyToClipboard(inviteUrl),show("링크가 복사되었습니다!")},css:inviteModalLinkButton,children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:inviteModalLinkButtonInfoWrapper,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:inviteModalText,children:"초대 링크 복사"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:copyIcon_namespaceObject,alt:"복사하기 이미지",css:inviteModalCopyIcon})]})})})]})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{buttonWidth:"100%",onClick:onClose,children:"닫기"})})]})},InviteModal_InviteModal=InviteModal;InviteModal.__docgenInfo={description:"",methods:[],displayName:"InviteModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},returnFocusRef:{required:!1,tsType:{name:"RefObject",elements:[{name:"HTMLElement"}],raw:"RefObject"},description:""}}}},"./src/hooks/useGetUserInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=()=>{const{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.I)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.getUserInfo],queryFn:_apis_room__WEBPACK_IMPORTED_MODULE_0__.ug,staleTime:72e5});return{roomId:data?.roomId||0,roomUuid:data?.roomUuid||"",member:{memberId:data?.member?.memberId||0,nickname:data?.member?.nickname||"",isMaster:data?.member?.isMaster||!1}}}}}]); \ No newline at end of file diff --git a/storybook/507.090472e8.iframe.bundle.js b/storybook/507.090472e8.iframe.bundle.js deleted file mode 100644 index b5ff4daac..000000000 --- a/storybook/507.090472e8.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[507],{"./node_modules/@tanstack/react-query/build/modern/useMutation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{n:()=>useMutation});var react=__webpack_require__("./node_modules/react/index.js"),mutation=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/mutation.js"),notifyManager=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/notifyManager.js"),subscribable=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/subscribable.js"),utils=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/utils.js"),MutationObserver=class extends subscribable.Q{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super(),this.#client=client,this.setOptions(options),this.bindMethods(),this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options),(0,utils.f8)(this.options,prevOptions)||this.#client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#currentMutation,observer:this}),prevOptions?.mutationKey&&this.options.mutationKey&&(0,utils.EN)(prevOptions.mutationKey)!==(0,utils.EN)(this.options.mutationKey)?this.reset():"pending"===this.#currentMutation?.state.status&&this.#currentMutation.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult(),this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this),this.#currentMutation=void 0,this.#updateResult(),this.#notify()}mutate(variables,options){return this.#mutateOptions=options,this.#currentMutation?.removeObserver(this),this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options),this.#currentMutation.addObserver(this),this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??(0,mutation.$)();this.#currentResult={...state,isPending:"pending"===state.status,isSuccess:"success"===state.status,isError:"error"===state.status,isIdle:"idle"===state.status,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.j.batch((()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables,context=this.#currentResult.context;"success"===action?.type?(this.#mutateOptions.onSuccess?.(action.data,variables,context),this.#mutateOptions.onSettled?.(action.data,null,variables,context)):"error"===action?.type&&(this.#mutateOptions.onError?.(action.error,variables,context),this.#mutateOptions.onSettled?.(void 0,action.error,variables,context))}this.listeners.forEach((listener=>{listener(this.#currentResult)}))}))}},QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),modern_utils=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/utils.js");function useMutation(options,queryClient){const client=(0,QueryClientProvider.jE)(queryClient),[observer]=react.useState((()=>new MutationObserver(client,options)));react.useEffect((()=>{observer.setOptions(options)}),[observer,options]);const result=react.useSyncExternalStore(react.useCallback((onStoreChange=>observer.subscribe(notifyManager.j.batchCalls(onStoreChange))),[observer]),(()=>observer.getCurrentResult()),(()=>observer.getCurrentResult())),mutate=react.useCallback(((variables,mutateOptions)=>{observer.mutate(variables,mutateOptions).catch(modern_utils.l)}),[observer]);if(result.error&&(0,modern_utils.G)(observer.options.throwOnError,[result.error]))throw result.error;return{...result,mutate,mutateAsync:result.mutate}}},"./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{U:()=>useSuspenseQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js"),_suspense_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/suspense.js");function useSuspenseQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)({...options,enabled:!0,suspense:!0,throwOnError:_suspense_js__WEBPACK_IMPORTED_MODULE_1__.R3,placeholderData:void 0},_tanstack_query_core__WEBPACK_IMPORTED_MODULE_2__.$,queryClient)}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>apis_fetcher});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",INVALID_NICKNAME:"닉네임은 최소 1글자 이상 최대 12글자 이하여야 합니다.",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 10초, 15초, 30초, 60초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!",NOT_FOUND_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!",INVALID_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}const apis_fetcher={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers,credentials:"include"});if(!response.ok){const apiError=await response.json();throw new CustomError({...apiError,status:response.status})}return response}catch(error){if(error instanceof CustomError)throw error;throw new NetworkError}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/apis/room.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gn:()=>exitRoom,ew:()=>applyRoomSetting,qE:()=>getRoomInfo,rm:()=>getCategoryList,ug:()=>getUserInfo,zj:()=>startGame});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const getRoomInfo=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.getRoomInfo(roomId)});return await res.json()},startGame=async roomId=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.startGame(roomId)})},getCategoryList=async()=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.categoryList});return await res.json()},applyRoomSetting=async(roomId,roomSetting)=>{const{totalRound,timeLimit,category}=roomSetting;await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.applyRoomSetting(roomId),headers:{"Content-Type":"application/json"},body:{totalRound,timeLimit,category}})},exitRoom=async(roomId,memberId)=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.delete({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.deleteRoom(roomId,memberId)})},getUserInfo=async()=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.getUserInfo});return await res.json()}},"./src/components/common/RoomSettingModal/RoomSettingModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>RoomSettingModal_RoomSettingModal});var react=__webpack_require__("./node_modules/react/index.js");const emptyLayout={name:"nbsemk",styles:"height:3.6rem"};var Dropdown=__webpack_require__("./src/components/common/Dropdown/Dropdown.tsx"),useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),dist=__webpack_require__("./node_modules/react-router/dist/index.js"),room=__webpack_require__("./src/apis/room.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useCategoryListQuery=()=>{const{roomId}=(0,dist.g)(),categoryListQuery=(0,useQuery.I)({queryKey:[queryKeys.e.categoryList,Number(roomId)],queryFn:async()=>await(0,room.rm)()});return{...categoryListQuery,categoryList:categoryListQuery.data?.categories}};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const CategoryDropdown=({category,handleClickOption})=>{const{categoryList,isLoading}=hooks_useCategoryListQuery();return isLoading?(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:emptyLayout}):categoryList&&category?(0,emotion_react_jsx_runtime_browser_esm.Y)(Dropdown.A,{text:category,optionList:categoryList,handleClickOption}):(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{children:"카테고리가 없습니다."})},CategoryDropdown_CategoryDropdown=CategoryDropdown;CategoryDropdown.__docgenInfo={description:"",methods:[],displayName:"CategoryDropdown",props:{category:{required:!1,tsType:{name:"string"},description:""},handleClickOption:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.MouseEvent) => void",signature:{arguments:[{type:{name:"ReactMouseEvent",raw:"React.MouseEvent",elements:[{name:"HTMLButtonElement"}]},name:"e"}],return:{name:"void"}}},description:""}}};var QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),useMutation=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js");const hooks_useApplyRoomSetting=roomId=>{const queryClient=(0,QueryClientProvider.jE)();return(0,useMutation.n)({mutationFn:async roomSetting=>await(0,room.ew)(roomId,roomSetting),onSuccess:()=>{queryClient.invalidateQueries({queryKey:[queryKeys.e.roomMembers,Number(roomId)]})}})},hooks_useCategoryDropdown=selectedCategory=>{const[category,setCategory]=(0,react.useState)(selectedCategory);return(0,react.useEffect)((()=>{setCategory(selectedCategory)}),[selectedCategory]),{category,handleClickOption:e=>{const target=e.target,clickedCategoryValue=target.value,clickedCategoryLabel=target.textContent;clickedCategoryValue&&setCategory({value:clickedCategoryValue,label:clickedCategoryLabel})}}},useTimerPerRound=selectedTimeLimit=>{const[timeLimitPerRound,setTimeLimitPerRound]=(0,react.useState)(selectedTimeLimit);return(0,react.useEffect)((()=>{setTimeLimitPerRound(selectedTimeLimit)}),[selectedTimeLimit]),{timeLimitPerRound,handleClickTimeLimit:e=>{const target=e.target;setTimeLimitPerRound(Number(target.value))}}},hooks_useTotalRound=selectedTotalRound=>{const[totalRound,setTotalRound]=(0,react.useState)(selectedTotalRound);return(0,react.useEffect)((()=>{setTotalRound(selectedTotalRound)}),[selectedTotalRound]),{totalRound,handleClickRound:e=>{const target=e.target;setTotalRound(Number(target.textContent))}}};var useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts");const hooks_useRoomSetting=({onClose})=>{const{roomId}=(0,dist.g)(),{mutate:applyRoomSetting}=hooks_useApplyRoomSetting(Number(roomId)),{roomSetting:selectedRoomSetting}=(0,useGetRoomInfo.$)(),{category,handleClickOption}=hooks_useCategoryDropdown(selectedRoomSetting?.category),{totalRound,handleClickRound}=hooks_useTotalRound(selectedRoomSetting?.totalRound),{timeLimitPerRound,handleClickTimeLimit}=useTimerPerRound(selectedRoomSetting?.timeLimit);return{roomSetting:{category,totalRound,timeLimitPerRound},handleClickOption,handleClickRound,handleClickTimeLimit,handleClickApply:()=>{category&&totalRound&&timeLimitPerRound&&(applyRoomSetting({category:category.value,totalRound,timeLimit:timeLimitPerRound}),onClose())}}};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const roomSettingTitleContainer={name:"1d4iner",styles:"display:flex;flex-direction:column;align-items:center;gap:1rem"},roomSettingTitleWrapper={name:"zl1inp",styles:"display:flex;justify-content:center"},roomSettingTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.body2,";font-weight:700;",""),roomSettingButtonContainer={name:"e4w4z7",styles:"display:flex;justify-content:center;gap:1.6rem"},RoomSettingContainer=({children,title})=>(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingTitleContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:roomSettingTitleWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingTitle,children:title})}),"카테고리"===title?children:(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:roomSettingButtonContainer,role:"radiogroup",children})]}),RoomSettingContainer_RoomSettingContainer=RoomSettingContainer;RoomSettingContainer.__docgenInfo={description:"",methods:[],displayName:"RoomSettingContainer",props:{title:{required:!0,tsType:{name:"union",raw:"'카테고리' | '총 라운드' | '제한 시간'",elements:[{name:"literal",value:"'카테고리'"},{name:"literal",value:"'총 라운드'"},{name:"literal",value:"'제한 시간'"}]},description:""}}};const roomSettingModalLayout=(0,emotion_react_browser_esm.AH)("background-color:",Theme.S.color.peanut300,";",""),roomSettingModalTitle={name:"1kymkw5",styles:"font-size:1.6rem"},roomSettingContainer=(0,emotion_react_browser_esm.AH)("display:flex;flex-direction:column;justify-content:space-around;gap:2.4rem;padding:1.6rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:white;",""),roomSettingButton=isSelected=>(0,emotion_react_browser_esm.AH)("width:4rem;height:4rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:",isSelected?Theme.S.color.peanut500:Theme.S.color.peanut300,";transition:background-color 0.3s;","");var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),config=__webpack_require__("./src/constants/config.ts");const TOTAL_ROUND_LIST=[5,7,10],TIMER_PER_ROUND_LIST=[1e4,15e3,3e4,6e4],RoomSettingModal=({isOpen,onClose,returnFocusRef})=>{const{roomSetting,handleClickOption,handleClickRound,handleClickTimeLimit,handleClickApply}=hooks_useRoomSetting({onClose}),{category,totalRound,timeLimitPerRound}=roomSetting;return(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,returnFocusRef,css:roomSettingModalLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:roomSettingModalTitle,children:"방 설정"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"카테고리",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(CategoryDropdown_CategoryDropdown,{category:category?.label,handleClickOption})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"총 라운드",children:TOTAL_ROUND_LIST.map((round=>(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{role:"radio",onClick:handleClickRound,"aria-checked":totalRound===round,css:roomSettingButton(totalRound===round),children:round})},round)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"제한 시간",children:TIMER_PER_ROUND_LIST.map((timeLimit=>(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("button",{role:"radio",onClick:handleClickTimeLimit,value:timeLimit,"aria-checked":timeLimitPerRound===timeLimit,css:roomSettingButton(timeLimitPerRound===timeLimit),children:[timeLimit/config.S2,"초"]})},timeLimit)))})]})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:handleClickApply,children:"적용"})})]})},RoomSettingModal_RoomSettingModal=RoomSettingModal;RoomSettingModal.__docgenInfo={description:"",methods:[],displayName:"RoomSettingModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},returnFocusRef:{required:!1,tsType:{name:"RefObject",elements:[{name:"HTMLElement"}],raw:"RefObject"},description:""}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList",getUserInfo:"getUserInfo"}},"./src/hooks/useGetRoomInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>useGetRoomInfo});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-router/dist/index.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_config__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/constants/config.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const useGetRoomInfo=()=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.g)(),{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.roomMembers,Number(roomId)],queryFn:()=>(0,_apis_room__WEBPACK_IMPORTED_MODULE_0__.qE)(Number(roomId)),refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=_constants_config__WEBPACK_IMPORTED_MODULE_4__.A3)&&_constants_config__WEBPACK_IMPORTED_MODULE_4__.S2,refetchIntervalInBackground:!0,gcTime:0});return{members:data?.members,roomSetting:data?.roomSetting,master:data?.master,isGameStart:data?.isGameStart}}}}]); \ No newline at end of file diff --git a/storybook/579.9585a80b.iframe.bundle.js b/storybook/579.9585a80b.iframe.bundle.js deleted file mode 100644 index b0b72339f..000000000 --- a/storybook/579.9585a80b.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[579],{"./src/components/common/InviteModal/InviteModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>InviteModal_InviteModal});var lib=__webpack_require__("./node_modules/react-qr-code/lib/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const inviteModalLayout=(0,emotion_react_browser_esm.AH)("background-color:",Theme.S.color.peanut300,";",""),inviteModalTitle={name:"arzv6g",styles:"font-size:1.6rem;text-align:center"},inviteModalUl={name:"zmgl3t",styles:"display:flex;flex-direction:column;justify-content:center;gap:2rem"},qrcodeWrapper=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:100%;height:20rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:white;",""),inviteModalLi=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;gap:0.8rem;padding:0.8rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:#ffff;",""),inviteModalLinkButton={name:"gfehpl",styles:"width:100%;padding:1.6rem 0.4rem;background:none;border:none;cursor:pointer"},inviteModalLinkButtonInfoWrapper={name:"1eoy87d",styles:"display:flex;justify-content:space-between"},inviteModalText={name:"1l7fe3o",styles:"overflow:hidden;width:95%;font-size:1.4rem;text-overflow:ellipsis"},inviteModalCopyIcon={name:"1p82uuh",styles:"width:10%"};var react=__webpack_require__("./node_modules/react/index.js");const InviteModal_useClipBoard=()=>{const[isCopied,setIsCopied]=(0,react.useState)(!1);return{isCopied,copyToClipboard:async text=>{await navigator.clipboard.writeText(text),setIsCopied(!0),setTimeout((()=>setIsCopied(!1)),2e3)}}};var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx");const copyIcon_namespaceObject=__webpack_require__.p+"static/media/copyIcon.d9b466b1.png";var url=__webpack_require__("./src/constants/url.ts"),useGetUserInfo=__webpack_require__("./src/hooks/useGetUserInfo.ts"),ToastProvider=__webpack_require__("./src/providers/ToastProvider/ToastProvider.tsx");const hooks_useToast=()=>{const toast=(0,react.useContext)(ToastProvider.$);if(!toast)throw new Error("ToastContext를 찾을 수 없습니다.");return toast};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const InviteModal=({isOpen,onClose,returnFocusRef})=>{const{roomUuid}=(0,useGetUserInfo.A)(),inviteUrl=(0,url.MY)(roomUuid),{copyToClipboard}=InviteModal_useClipBoard(),{show}=hooks_useToast();return(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,css:inviteModalLayout,returnFocusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:inviteModalTitle,children:"초대하기"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("ul",{css:inviteModalUl,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:qrcodeWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)(lib.Ay,{style:{width:"50%",height:"50%"},value:inviteUrl})})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{css:inviteModalLi,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{copyToClipboard(inviteUrl),show("링크가 복사되었습니다!")},css:inviteModalLinkButton,children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:inviteModalLinkButtonInfoWrapper,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:inviteModalText,children:"초대 링크 복사"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:copyIcon_namespaceObject,alt:"복사하기 이미지",css:inviteModalCopyIcon})]})})})]})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{buttonWidth:"100%",onClick:onClose,children:"닫기"})})]})},InviteModal_InviteModal=InviteModal;InviteModal.__docgenInfo={description:"",methods:[],displayName:"InviteModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},returnFocusRef:{required:!1,tsType:{name:"RefObject",elements:[{name:"HTMLElement"}],raw:"RefObject"},description:""}}}},"./src/hooks/useGetUserInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=()=>{const{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.I)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.getUserInfo],queryFn:_apis_room__WEBPACK_IMPORTED_MODULE_0__.ug,staleTime:72e5});return{roomId:data?.roomId||0,roomUuid:data?.roomUuid||"",member:{memberId:data?.member?.memberId||0,nickname:data?.member?.nickname||"",isMaster:data?.member?.isMaster||!1}}}}}]); \ No newline at end of file diff --git a/storybook/961.75f49b1b.iframe.bundle.js b/storybook/58.61dadb3d.iframe.bundle.js similarity index 59% rename from storybook/961.75f49b1b.iframe.bundle.js rename to storybook/58.61dadb3d.iframe.bundle.js index ee11eaeb9..0c6d47127 100644 --- a/storybook/961.75f49b1b.iframe.bundle.js +++ b/storybook/58.61dadb3d.iframe.bundle.js @@ -1,4 +1,4 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[961],{"./src/components/SelectContainer/Timer/Timer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Timer_Timer});var dist=__webpack_require__("./node_modules/react-router/dist/index.js"),react=__webpack_require__("./node_modules/react/index.js"),config=__webpack_require__("./src/constants/config.ts");const hooks_useTimer=({timeLimit,isSelectedOption,isVoted,vote})=>{const[leftRoundTime,setLeftRoundTime]=(0,react.useState)(timeLimit),isVoteTimeout=leftRoundTime<=0,isAlmostFinished=leftRoundTime<=config.cZ,timeout=(0,react.useRef)();return(0,react.useEffect)((()=>{isVoteTimeout&&(isSelectedOption&&!isVoted&&vote(),clearInterval(timeout.current))}),[isVoteTimeout,isSelectedOption,isVoted,vote]),(0,react.useEffect)((()=>(timeout.current=setInterval((()=>{setLeftRoundTime((prev=>prev-1))}),config.S2),()=>{clearInterval(timeout.current)})),[timeLimit]),{leftRoundTime,isAlmostFinished}};var Timer_util=__webpack_require__("./src/components/SelectContainer/Timer/Timer.util.ts"),SelectButton_hook=__webpack_require__("./src/components/common/SelectButton/SelectButton.hook.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts");const hooks_useVoteTimer=({roomId,selectedId,isVoted,completeSelection})=>{const{balanceContent}=(0,useBalanceContentQuery.A)(roomId),timeLimit=(0,Timer_util.Nc)(balanceContent.timeLimit)||10,{mutate:vote}=(0,SelectButton_hook.A)({selectedId,contentId:balanceContent.contentId,completeSelection}),{leftRoundTime,isAlmostFinished}=hooks_useTimer({timeLimit,isSelectedOption:Boolean(selectedId),isVoted,vote});return{leftRoundTime,isAlmostFinished,timeLimit}};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const shake=emotion_react_browser_esm.i7` +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[58],{"./src/pages/GamePage/components/SelectButton/SelectButton.hook.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-router/dist/index.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_hooks_useGetUserInfo__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/hooks/useGetUserInfo.ts");const __WEBPACK_DEFAULT_EXPORT__=({selectedId,contentId,completeSelection})=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.g)(),{member:{memberId}}=(0,_hooks_useGetUserInfo__WEBPACK_IMPORTED_MODULE_1__.A)();return(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.n)({mutationFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");return await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.sl)({roomId:Number(roomId),optionId:selectedId,contentId,memberId:Number(memberId)})},onSuccess:()=>{completeSelection()}})}},"./src/pages/GamePage/components/SelectContainer/Timer/Timer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Timer_Timer});var dist=__webpack_require__("./node_modules/react-router/dist/index.js"),react=__webpack_require__("./node_modules/react/index.js"),config=__webpack_require__("./src/constants/config.ts");const hooks_useTimer=({timeLimit,isSelectedOption,isVoted,vote})=>{const[leftRoundTime,setLeftRoundTime]=(0,react.useState)(timeLimit),isVoteTimeout=leftRoundTime<=0,isAlmostFinished=leftRoundTime<=config.cZ,timeout=(0,react.useRef)();return(0,react.useEffect)((()=>{isVoteTimeout&&(isSelectedOption&&!isVoted&&vote(),clearInterval(timeout.current))}),[isVoteTimeout,isSelectedOption,isVoted,vote]),(0,react.useEffect)((()=>(timeout.current=setInterval((()=>{setLeftRoundTime((prev=>prev-1))}),config.S2),()=>{clearInterval(timeout.current)})),[timeLimit]),{leftRoundTime,isAlmostFinished}};var SelectButton_hook=__webpack_require__("./src/pages/GamePage/components/SelectButton/SelectButton.hook.ts"),Timer_util=__webpack_require__("./src/pages/GamePage/components/SelectContainer/Timer/Timer.util.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts");const hooks_useVoteTimer=({roomId,selectedId,isVoted,completeSelection})=>{const{balanceContent}=(0,useBalanceContentQuery.A)(roomId),timeLimit=(0,Timer_util.Nc)(balanceContent.timeLimit)||10,{mutate:vote}=(0,SelectButton_hook.A)({selectedId,contentId:balanceContent.contentId,completeSelection}),{leftRoundTime,isAlmostFinished}=hooks_useTimer({timeLimit,isSelectedOption:Boolean(selectedId),isVoted,vote});return{leftRoundTime,isAlmostFinished,timeLimit}};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const shake=emotion_react_browser_esm.i7` 0%{ transform: rotate(0deg); } @@ -37,5 +37,5 @@ 100%{ transform: translateX(-95%); } -`,timerLayout=(0,emotion_react_browser_esm.AH)("display:flex;position:relative;align-items:center;width:100%;height:3.2rem;padding:0 1rem;border-radius:",Theme.S.borderRadius.radius30,";background-color:",Theme.S.color.peanut200,";box-sizing:border-box;",""),timerInnerLayout=timeLimit=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:100%;height:60%;border-radius:",Theme.S.borderRadius.radius30,";background-color:",Theme.S.color.peanut500,";transform-origin:left;animation:",progress," ",timeLimit+1,"s linear;",""),timerWrapper=timeLimit=>(0,emotion_react_browser_esm.AH)("display:flex;position:absolute;flex-direction:column;justify-content:center;align-items:flex-end;width:100%;height:4rem;animation:",timerTransition," ",timeLimit+1,"s linear;",""),timerIcon={name:"ryq21y",styles:"position:absolute;width:4.8rem;height:4.8rem"},timerIconShake=(0,emotion_react_browser_esm.AH)("animation:",shake," 1s linear infinite;",""),timerText=isAlmostFinished=>(0,emotion_react_browser_esm.AH)("position:absolute;top:5.2rem;color:",isAlmostFinished?"red":"black",";font-weight:bold;font-size:1.6rem;","");var useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),balanceContent=__webpack_require__("./src/apis/balanceContent.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useVoteIsFinishedQuery=({contentId,enabled})=>{const{roomId}=(0,dist.g)(),voteIsFinishedQuery=(0,useQuery.I)({queryKey:[queryKeys.e.roundIsFinished,Number(roomId),contentId],queryFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");return await(0,balanceContent.jd)({roomId:Number(roomId),contentId})},enabled,refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=config.A3)&&config.S2,refetchIntervalInBackground:!0,gcTime:0});return{...voteIsFinishedQuery,isFinished:voteIsFinishedQuery.data?.isFinished}};var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useVoteIsFinished=({contentId,isFetching})=>{const navigate=(0,dist.Zp)(),{roomId}=(0,dist.g)(),{isFinished}=hooks_useVoteIsFinishedQuery({contentId,enabled:!!contentId&&!isFetching});return(0,react.useEffect)((()=>{isFinished&&!isFetching&&navigate(routes.b.roundResult(Number(roomId)),{replace:!0})}),[isFinished,navigate,roomId,isFetching]),{isFinished}},ddangkongTimer_namespaceObject=__webpack_require__.p+"static/media/ddangkongTimer.096a16e3.webp";var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Timer=({selectedId,isVoted,completeSelection})=>{const{roomId}=(0,dist.g)(),{balanceContent,isFetching}=(0,useBalanceContentQuery.A)(Number(roomId)),{leftRoundTime,isAlmostFinished,timeLimit}=hooks_useVoteTimer({roomId:Number(roomId),selectedId,isVoted,completeSelection}),screenReaderLeftRoundTime=`${leftRoundTime}초 남았습니다.`;return hooks_useVoteIsFinished({contentId:balanceContent.contentId,isFetching}),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:timerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:timerInnerLayout(timeLimit)}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:timerWrapper(timeLimit),children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{css:[timerIcon,isAlmostFinished&&timerIconShake,"",""],src:ddangkongTimer_namespaceObject,alt:""}),(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{role:"alert","aria-live":(0,Timer_util.wk)(leftRoundTime,timeLimit)&&"assertive",children:screenReaderLeftRoundTime}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:timerText(isAlmostFinished),"aria-hidden":!0,children:(0,Timer_util.qE)(leftRoundTime)})]})]})},Timer_Timer=Timer;Timer.__docgenInfo={description:"",methods:[],displayName:"Timer",props:{selectedId:{required:!0,tsType:{name:"number"},description:""},isVoted:{required:!0,tsType:{name:"boolean"},description:""},completeSelection:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}}},"./src/components/common/SelectButton/SelectButton.hook.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-router/dist/index.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_hooks_useGetUserInfo__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/hooks/useGetUserInfo.ts");const __WEBPACK_DEFAULT_EXPORT__=({selectedId,contentId,completeSelection})=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.g)(),{member:{memberId}}=(0,_hooks_useGetUserInfo__WEBPACK_IMPORTED_MODULE_1__.A)();return(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.n)({mutationFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");return await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.sl)({roomId:Number(roomId),optionId:selectedId,contentId,memberId:Number(memberId)})},onSuccess:()=>{completeSelection()}})}}}]); -//# sourceMappingURL=961.75f49b1b.iframe.bundle.js.map \ No newline at end of file +`,timerLayout=(0,emotion_react_browser_esm.AH)("display:flex;position:relative;align-items:center;width:100%;height:3.2rem;padding:0 1rem;border-radius:",Theme.S.borderRadius.radius30,";background-color:",Theme.S.color.peanut200,";box-sizing:border-box;",""),timerInnerLayout=timeLimit=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:100%;height:60%;border-radius:",Theme.S.borderRadius.radius30,";background-color:",Theme.S.color.peanut500,";transform-origin:left;animation:",progress," ",timeLimit+1,"s linear;",""),timerWrapper=timeLimit=>(0,emotion_react_browser_esm.AH)("display:flex;position:absolute;flex-direction:column;justify-content:center;align-items:flex-end;width:100%;height:4rem;animation:",timerTransition," ",timeLimit+1,"s linear;",""),timerIcon={name:"ryq21y",styles:"position:absolute;width:4.8rem;height:4.8rem"},timerIconShake=(0,emotion_react_browser_esm.AH)("animation:",shake," 1s linear infinite;",""),timerText=isAlmostFinished=>(0,emotion_react_browser_esm.AH)("position:absolute;top:5.2rem;color:",isAlmostFinished?"red":"black",";font-weight:bold;font-size:1.6rem;","");var useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),balanceContent=__webpack_require__("./src/apis/balanceContent.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useVoteIsFinishedQuery=({contentId,enabled})=>{const{roomId}=(0,dist.g)(),voteIsFinishedQuery=(0,useQuery.I)({queryKey:[queryKeys.e.roundIsFinished,Number(roomId),contentId],queryFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");return await(0,balanceContent.jd)({roomId:Number(roomId),contentId})},enabled,refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=config.A3)&&config.S2,refetchIntervalInBackground:!0,gcTime:0});return{...voteIsFinishedQuery,isFinished:voteIsFinishedQuery.data?.isFinished}};var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useVoteIsFinished=({contentId,isFetching})=>{const navigate=(0,dist.Zp)(),{roomId}=(0,dist.g)(),{isFinished}=hooks_useVoteIsFinishedQuery({contentId,enabled:!!contentId&&!isFetching});return(0,react.useEffect)((()=>{isFinished&&!isFetching&&navigate(routes.b.roundResult(Number(roomId)),{replace:!0})}),[isFinished,navigate,roomId,isFetching]),{isFinished}},ddangkongTimer_namespaceObject=__webpack_require__.p+"static/media/ddangkongTimer.096a16e3.webp";var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Timer=({selectedId,isVoted,completeSelection})=>{const{roomId}=(0,dist.g)(),{balanceContent,isFetching}=(0,useBalanceContentQuery.A)(Number(roomId)),{leftRoundTime,isAlmostFinished,timeLimit}=hooks_useVoteTimer({roomId:Number(roomId),selectedId,isVoted,completeSelection}),screenReaderLeftRoundTime=`${leftRoundTime}초 남았습니다.`;return hooks_useVoteIsFinished({contentId:balanceContent.contentId,isFetching}),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:timerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:timerInnerLayout(timeLimit)}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:timerWrapper(timeLimit),children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{css:[timerIcon,isAlmostFinished&&timerIconShake,"",""],src:ddangkongTimer_namespaceObject,alt:""}),(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{role:"alert","aria-live":(0,Timer_util.wk)(leftRoundTime,timeLimit)&&"assertive",children:screenReaderLeftRoundTime}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:timerText(isAlmostFinished),"aria-hidden":!0,children:(0,Timer_util.qE)(leftRoundTime)})]})]})},Timer_Timer=Timer;Timer.__docgenInfo={description:"",methods:[],displayName:"Timer",props:{selectedId:{required:!0,tsType:{name:"number"},description:""},isVoted:{required:!0,tsType:{name:"boolean"},description:""},completeSelection:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}}}}]); +//# sourceMappingURL=58.61dadb3d.iframe.bundle.js.map \ No newline at end of file diff --git a/storybook/58.61dadb3d.iframe.bundle.js.map b/storybook/58.61dadb3d.iframe.bundle.js.map new file mode 100644 index 000000000..ee605f31a --- /dev/null +++ b/storybook/58.61dadb3d.iframe.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"58.61dadb3d.iframe.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;;;;;;;AASA;;;;;;;AASA","sources":["webpack://ddangkong-frontend/./src/pages/GamePage/components/SelectContainer/Timer/Timer.styled.ts"],"sourcesContent":["import { css, keyframes } from '@emotion/react';\n\nimport { Theme } from '@/styles/Theme';\n\nconst shake = keyframes`\n 0%{\n transform: rotate(0deg);\n }\n 10%{\n transform: scale(1.5) rotate(45deg);\n }\n 20%{\n transform: scale(1.5) rotate(-45deg);\n }\n 30%{\n transform: rotate(30deg);\n }\n 40%{\n transform: rotate(-30deg);\n }\n 50%{\n transform: rotate(10deg);\n }\n 60%{\n transform: rotate(-10deg);\n }\n 100%{\n transform: rotate(0deg);\n }\n`;\n\nconst progress = keyframes`\n 0% {\n transform: scaleX(1);\n }\n 100% {\n transform: scaleX(0);\n }\n`;\n\nconst timerTransition = keyframes`\n 0% {\n transform: translateX(0);\n }\n 100%{\n transform: translateX(-95%);\n }\n`;\n\nexport const timerLayout = css`\n display: flex;\n position: relative;\n align-items: center;\n width: 100%;\n height: 3.2rem;\n padding: 0 1rem;\n border-radius: ${Theme.borderRadius.radius30};\n\n background-color: ${Theme.color.peanut200};\n box-sizing: border-box;\n`;\n\nexport const timerInnerLayout = (timeLimit: number) => css`\n display: flex;\n justify-content: center;\n align-items: center;\n\n width: 100%;\n height: 60%;\n border-radius: ${Theme.borderRadius.radius30};\n\n background-color: ${Theme.color.peanut500};\n\n transform-origin: left;\n\n animation: ${progress} ${timeLimit + 1}s linear;\n`;\n\nexport const timerWrapper = (timeLimit: number) => css`\n display: flex;\n position: absolute;\n flex-direction: column;\n justify-content: center;\n align-items: flex-end;\n\n width: 100%;\n height: 4rem;\n\n animation: ${timerTransition} ${timeLimit + 1}s linear;\n`;\n\nexport const timerIcon = css`\n position: absolute;\n width: 4.8rem;\n height: 4.8rem;\n`;\n\nexport const timerIconShake = css`\n animation: ${shake} 1s linear infinite;\n`;\n\nexport const timerText = (isAlmostFinished: boolean) => css`\n position: absolute;\n top: 5.2rem;\n\n color: ${isAlmostFinished ? 'red' : 'black'};\n font-weight: bold;\n font-size: 1.6rem;\n`;\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/storybook/864.14d1a415.iframe.bundle.js b/storybook/763.f9a7705e.iframe.bundle.js similarity index 87% rename from storybook/864.14d1a415.iframe.bundle.js rename to storybook/763.f9a7705e.iframe.bundle.js index b918369d2..0e3f1ff5b 100644 --- a/storybook/864.14d1a415.iframe.bundle.js +++ b/storybook/763.f9a7705e.iframe.bundle.js @@ -1,4 +1,4 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[864],{"./src/components/StartButtonContainer/Countdown/Countdown.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Countdown_Countdown});var react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const glowAnimation=emotion_react_browser_esm.i7` +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[763],{"./src/pages/ReadyPage/components/StartButtonContainer/Countdown/Countdown.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Countdown_Countdown});var react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const glowAnimation=emotion_react_browser_esm.i7` 0% { text-shadow: 0 0 5px ${Theme.S.color.peanut200}, 0 0 15px ${Theme.S.color.peanut300}, @@ -64,4 +64,4 @@ opacity: 0; } `,countdownLayout=(0,emotion_react_browser_esm.AH)("display:flex;position:fixed;z-index:1;flex-direction:column;justify-content:center;align-items:center;gap:2.4rem;color:",Theme.S.color.peanut500,";inset:0;",""),dimmed={name:"7a5s1c",styles:"position:fixed;width:100vw;height:100vh;background-color:rgb(0 0 0 / 50%)"},countdown=(0,emotion_react_browser_esm.AH)(Theme.S.typography.countdown,";animation:",countdownAnimation," 1s ease-in-out infinite,",glowAnimation," 1s infinite;",""),imageContainer={name:"11ktkxh",styles:"display:flex;justify-content:center;align-items:center;gap:2.4rem;height:10.8rem"},peanut=idx=>(0,emotion_react_browser_esm.AH)("width:",2.4*idx,"rem;height:",3.6*idx,"rem;animation:",peanutAnimation," 1s ease-in-out infinite;","");var spinDdangkong=__webpack_require__("./src/assets/images/spinDdangkong.webp"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const imageCountMapper={3:1,2:2,1:3},Countdown=({goToGame})=>{const[count,setCount]=(0,react.useState)(3),timeout=(0,react.useRef)();return(0,react.useEffect)((()=>{count<=0&&(clearInterval(timeout.current),goToGame())}),[count]),(0,react.useEffect)((()=>(timeout.current=setInterval((()=>{setCount((prev=>prev-1))}),1e3),()=>clearInterval(timeout.current))),[]),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:countdownLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:dimmed}),count>0&&(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:countdown,"aria-label":`게임 시작 ${count}초 전`,"aria-live":"polite",children:count}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:imageContainer,children:imageCountMapper[count]&&Array.from({length:imageCountMapper[count]},((_,idx)=>(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:spinDdangkong,css:peanut(idx+1),alt:`${idx+1}번째 카운트다운 땅콩`},idx+1)))})]})},Countdown_Countdown=Countdown;Countdown.__docgenInfo={description:"",methods:[],displayName:"Countdown",props:{goToGame:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}}},"./src/assets/images/spinDdangkong.webp":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/spinDdangkong.f92ff614.webp"}}]); -//# sourceMappingURL=864.14d1a415.iframe.bundle.js.map \ No newline at end of file +//# sourceMappingURL=763.f9a7705e.iframe.bundle.js.map \ No newline at end of file diff --git a/storybook/763.f9a7705e.iframe.bundle.js.map b/storybook/763.f9a7705e.iframe.bundle.js.map new file mode 100644 index 000000000..0ff0d6372 --- /dev/null +++ b/storybook/763.f9a7705e.iframe.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"763.f9a7705e.iframe.bundle.js","mappings":";;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAIA;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;;;AAmBA","sources":["webpack://ddangkong-frontend/./src/pages/ReadyPage/components/StartButtonContainer/Countdown/Countdown.styled.ts"],"sourcesContent":["import { css, keyframes } from '@emotion/react';\n\nimport { Theme } from '@/styles/Theme';\n\n// 텍스트 글로우 애니메이션\nconst glowAnimation = keyframes`\n0% {\n text-shadow: 0 0 5px ${Theme.color.peanut200}, \n 0 0 15px ${Theme.color.peanut300}, \n 0 0 25px ${Theme.color.peanut300}, \n 0 0 35px ${Theme.color.peanut300}, \n 0 0 45px ${Theme.color.peanut400}, \n 0 0 55px ${Theme.color.peanut400}, \n 0 0 65px ${Theme.color.peanut500};\n }\n 30% {\n text-shadow: 0 0 10px ${Theme.color.peanut200}, \n 0 0 20px ${Theme.color.peanut300}, \n 0 0 30px ${Theme.color.peanut300}, \n 0 0 40px ${Theme.color.peanut300}, \n 0 0 50px ${Theme.color.peanut400}, \n 0 0 60px ${Theme.color.peanut400}, \n 0 0 70px ${Theme.color.peanut500};\n }\n 70% {\n text-shadow: 0 0 10px ${Theme.color.peanut200}, \n 0 0 20px ${Theme.color.peanut300}, \n 0 0 60px ${Theme.color.peanut400}, \n 0 0 70px ${Theme.color.peanut500};\n }\n 100% {\n text-shadow: 0 0 10px ${Theme.color.peanut200}, \n 0 0 20px ${Theme.color.peanut300}, \n 0 0 60px ${Theme.color.peanut400}, \n 0 0 70px ${Theme.color.peanut500};\n }\n`;\n\nexport const countdownAnimation = keyframes`\n 0% {\n transform: scale(0);\n opacity: 0;\n }\n 30% {\n transform: scale(1.5);\n opacity: 1;\n }\n 70% {\n transform: scale(1.5);\n opacity: 1;\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n`;\n\nexport const peanutAnimation = keyframes`\n 0% {\n transform: scale(0);\n opacity: 0;\n }\n 30% {\n transform: scale(1) rotate(20deg);\n opacity: 1;\n }\n 70% {\n transform: scale(1) rotate(-20deg);\n opacity: 1;\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n`;\n\nexport const countdownLayout = css`\n display: flex;\n position: fixed;\n z-index: 1;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 2.4rem;\n\n color: ${Theme.color.peanut500};\n inset: 0;\n`;\n\nexport const dimmed = css`\n position: fixed;\n width: 100vw;\n height: 100vh;\n\n background-color: rgb(0 0 0 / 50%);\n`;\n\nexport const countdown = css`\n ${Theme.typography.countdown};\n animation:\n ${countdownAnimation} 1s ease-in-out infinite,\n ${glowAnimation} 1s infinite;\n`;\n\nexport const imageContainer = css`\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 2.4rem;\n height: 10.8rem;\n`;\n\nexport const peanut = (idx: number) => css`\n width: ${2.4 * idx}rem;\n height: ${3.6 * idx}rem;\n\n animation: ${peanutAnimation} 1s ease-in-out infinite;\n`;\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/storybook/803.79f4b08e.iframe.bundle.js b/storybook/803.79f4b08e.iframe.bundle.js new file mode 100644 index 000000000..8dd400262 --- /dev/null +++ b/storybook/803.79f4b08e.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[803],{"./node_modules/@tanstack/react-query/build/modern/useMutation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{n:()=>useMutation});var react=__webpack_require__("./node_modules/react/index.js"),mutation=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/mutation.js"),notifyManager=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/notifyManager.js"),subscribable=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/subscribable.js"),utils=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/utils.js"),MutationObserver=class extends subscribable.Q{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super(),this.#client=client,this.setOptions(options),this.bindMethods(),this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options),(0,utils.f8)(this.options,prevOptions)||this.#client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#currentMutation,observer:this}),prevOptions?.mutationKey&&this.options.mutationKey&&(0,utils.EN)(prevOptions.mutationKey)!==(0,utils.EN)(this.options.mutationKey)?this.reset():"pending"===this.#currentMutation?.state.status&&this.#currentMutation.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult(),this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this),this.#currentMutation=void 0,this.#updateResult(),this.#notify()}mutate(variables,options){return this.#mutateOptions=options,this.#currentMutation?.removeObserver(this),this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options),this.#currentMutation.addObserver(this),this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??(0,mutation.$)();this.#currentResult={...state,isPending:"pending"===state.status,isSuccess:"success"===state.status,isError:"error"===state.status,isIdle:"idle"===state.status,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.j.batch((()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables,context=this.#currentResult.context;"success"===action?.type?(this.#mutateOptions.onSuccess?.(action.data,variables,context),this.#mutateOptions.onSettled?.(action.data,null,variables,context)):"error"===action?.type&&(this.#mutateOptions.onError?.(action.error,variables,context),this.#mutateOptions.onSettled?.(void 0,action.error,variables,context))}this.listeners.forEach((listener=>{listener(this.#currentResult)}))}))}},QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),modern_utils=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/utils.js");function useMutation(options,queryClient){const client=(0,QueryClientProvider.jE)(queryClient),[observer]=react.useState((()=>new MutationObserver(client,options)));react.useEffect((()=>{observer.setOptions(options)}),[observer,options]);const result=react.useSyncExternalStore(react.useCallback((onStoreChange=>observer.subscribe(notifyManager.j.batchCalls(onStoreChange))),[observer]),(()=>observer.getCurrentResult()),(()=>observer.getCurrentResult())),mutate=react.useCallback(((variables,mutateOptions)=>{observer.mutate(variables,mutateOptions).catch(modern_utils.l)}),[observer]);if(result.error&&(0,modern_utils.G)(observer.options.throwOnError,[result.error]))throw result.error;return{...result,mutate,mutateAsync:result.mutate}}},"./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{U:()=>useSuspenseQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js"),_suspense_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/suspense.js");function useSuspenseQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)({...options,enabled:!0,suspense:!0,throwOnError:_suspense_js__WEBPACK_IMPORTED_MODULE_1__.R3,placeholderData:void 0},_tanstack_query_core__WEBPACK_IMPORTED_MODULE_2__.$,queryClient)}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>apis_fetcher});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",INVALID_NICKNAME:"닉네임은 최소 1글자 이상 최대 12글자 이하여야 합니다.",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 10초, 15초, 30초, 60초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!",NOT_FOUND_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!",INVALID_COOKIE:"사용자 정보가 있어야 방에 참여할 수 있어요. 홈화면으로 이동하여 방을 새로 만들어주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}const apis_fetcher={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers,credentials:"include"});if(!response.ok){const apiError=await response.json();throw new CustomError({...apiError,status:response.status})}return response}catch(error){if(error instanceof CustomError)throw error;throw new NetworkError}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/apis/room.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gn:()=>exitRoom,ew:()=>applyRoomSetting,qE:()=>getRoomInfo,rm:()=>getCategoryList,ug:()=>getUserInfo,zj:()=>startGame});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const getRoomInfo=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.getRoomInfo(roomId)});return await res.json()},startGame=async roomId=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.startGame(roomId)})},getCategoryList=async()=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.categoryList});return await res.json()},applyRoomSetting=async(roomId,roomSetting)=>{const{totalRound,timeLimit,category}=roomSetting;await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.applyRoomSetting(roomId),headers:{"Content-Type":"application/json"},body:{totalRound,timeLimit,category}})},exitRoom=async(roomId,memberId)=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.delete({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.deleteRoom(roomId,memberId)})},getUserInfo=async()=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.getUserInfo});return await res.json()}},"./src/components/RoomSettingModal/RoomSettingModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>RoomSettingModal_RoomSettingModal});var react=__webpack_require__("./node_modules/react/index.js");const emptyLayout={name:"nbsemk",styles:"height:3.6rem"};var useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),dist=__webpack_require__("./node_modules/react-router/dist/index.js"),room=__webpack_require__("./src/apis/room.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useCategoryListQuery=()=>{const{roomId}=(0,dist.g)(),categoryListQuery=(0,useQuery.I)({queryKey:[queryKeys.e.categoryList,Number(roomId)],queryFn:async()=>await(0,room.rm)()});return{...categoryListQuery,categoryList:categoryListQuery.data?.categories}};var Dropdown=__webpack_require__("./src/components/common/Dropdown/Dropdown.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const CategoryDropdown=({category,handleClickOption})=>{const{categoryList,isLoading}=hooks_useCategoryListQuery();return isLoading?(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:emptyLayout}):categoryList&&category?(0,emotion_react_jsx_runtime_browser_esm.Y)(Dropdown.A,{text:category,optionList:categoryList,handleClickOption}):(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{children:"카테고리가 없습니다."})},CategoryDropdown_CategoryDropdown=CategoryDropdown;CategoryDropdown.__docgenInfo={description:"",methods:[],displayName:"CategoryDropdown",props:{category:{required:!1,tsType:{name:"string"},description:""},handleClickOption:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.MouseEvent) => void",signature:{arguments:[{type:{name:"ReactMouseEvent",raw:"React.MouseEvent",elements:[{name:"HTMLButtonElement"}]},name:"e"}],return:{name:"void"}}},description:""}}};var QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),useMutation=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js");const hooks_useApplyRoomSetting=roomId=>{const queryClient=(0,QueryClientProvider.jE)();return(0,useMutation.n)({mutationFn:async roomSetting=>await(0,room.ew)(roomId,roomSetting),onSuccess:()=>{queryClient.invalidateQueries({queryKey:[queryKeys.e.roomMembers,Number(roomId)]})}})},hooks_useCategoryDropdown=selectedCategory=>{const[category,setCategory]=(0,react.useState)(selectedCategory);return(0,react.useEffect)((()=>{setCategory(selectedCategory)}),[selectedCategory]),{category,handleClickOption:e=>{const target=e.target,clickedCategoryValue=target.value,clickedCategoryLabel=target.textContent;clickedCategoryValue&&setCategory({value:clickedCategoryValue,label:clickedCategoryLabel})}}},useTimerPerRound=selectedTimeLimit=>{const[timeLimitPerRound,setTimeLimitPerRound]=(0,react.useState)(selectedTimeLimit);return(0,react.useEffect)((()=>{setTimeLimitPerRound(selectedTimeLimit)}),[selectedTimeLimit]),{timeLimitPerRound,handleClickTimeLimit:e=>{const target=e.target;setTimeLimitPerRound(Number(target.value))}}},hooks_useTotalRound=selectedTotalRound=>{const[totalRound,setTotalRound]=(0,react.useState)(selectedTotalRound);return(0,react.useEffect)((()=>{setTotalRound(selectedTotalRound)}),[selectedTotalRound]),{totalRound,handleClickRound:e=>{const target=e.target;setTotalRound(Number(target.textContent))}}};var useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts");const hooks_useRoomSetting=({onClose})=>{const{roomId}=(0,dist.g)(),{mutate:applyRoomSetting}=hooks_useApplyRoomSetting(Number(roomId)),{roomSetting:selectedRoomSetting}=(0,useGetRoomInfo.$)(),{category,handleClickOption}=hooks_useCategoryDropdown(selectedRoomSetting?.category),{totalRound,handleClickRound}=hooks_useTotalRound(selectedRoomSetting?.totalRound),{timeLimitPerRound,handleClickTimeLimit}=useTimerPerRound(selectedRoomSetting?.timeLimit);return{roomSetting:{category,totalRound,timeLimitPerRound},handleClickOption,handleClickRound,handleClickTimeLimit,handleClickApply:()=>{category&&totalRound&&timeLimitPerRound&&(applyRoomSetting({category:category.value,totalRound,timeLimit:timeLimitPerRound}),onClose())}}};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const roomSettingTitleContainer={name:"1d4iner",styles:"display:flex;flex-direction:column;align-items:center;gap:1rem"},roomSettingTitleWrapper={name:"zl1inp",styles:"display:flex;justify-content:center"},roomSettingTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.body2,";font-weight:700;",""),roomSettingButtonContainer={name:"e4w4z7",styles:"display:flex;justify-content:center;gap:1.6rem"},RoomSettingContainer=({children,title})=>(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingTitleContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:roomSettingTitleWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingTitle,children:title})}),"카테고리"===title?children:(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:roomSettingButtonContainer,role:"radiogroup",children})]}),RoomSettingContainer_RoomSettingContainer=RoomSettingContainer;RoomSettingContainer.__docgenInfo={description:"",methods:[],displayName:"RoomSettingContainer",props:{title:{required:!0,tsType:{name:"union",raw:"'카테고리' | '총 라운드' | '제한 시간'",elements:[{name:"literal",value:"'카테고리'"},{name:"literal",value:"'총 라운드'"},{name:"literal",value:"'제한 시간'"}]},description:""}}};const roomSettingModalLayout=(0,emotion_react_browser_esm.AH)("background-color:",Theme.S.color.peanut300,";",""),roomSettingModalTitle={name:"1kymkw5",styles:"font-size:1.6rem"},roomSettingContainer=(0,emotion_react_browser_esm.AH)("display:flex;flex-direction:column;justify-content:space-around;gap:2.4rem;padding:1.6rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:white;",""),roomSettingButton=isSelected=>(0,emotion_react_browser_esm.AH)("width:4rem;height:4rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:",isSelected?Theme.S.color.peanut500:Theme.S.color.peanut300,";transition:background-color 0.3s;","");var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),config=__webpack_require__("./src/constants/config.ts");const TOTAL_ROUND_LIST=[5,7,10],TIMER_PER_ROUND_LIST=[1e4,15e3,3e4,6e4],RoomSettingModal=({isOpen,onClose,returnFocusRef})=>{const{roomSetting,handleClickOption,handleClickRound,handleClickTimeLimit,handleClickApply}=hooks_useRoomSetting({onClose}),{category,totalRound,timeLimitPerRound}=roomSetting;return(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,returnFocusRef,css:roomSettingModalLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:roomSettingModalTitle,children:"방 설정"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"카테고리",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(CategoryDropdown_CategoryDropdown,{category:category?.label,handleClickOption})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"총 라운드",children:TOTAL_ROUND_LIST.map((round=>(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{role:"radio",onClick:handleClickRound,"aria-checked":totalRound===round,css:roomSettingButton(totalRound===round),children:round})},round)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"제한 시간",children:TIMER_PER_ROUND_LIST.map((timeLimit=>(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("button",{role:"radio",onClick:handleClickTimeLimit,value:timeLimit,"aria-checked":timeLimitPerRound===timeLimit,css:roomSettingButton(timeLimitPerRound===timeLimit),children:[timeLimit/config.S2,"초"]})},timeLimit)))})]})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:handleClickApply,children:"적용"})})]})},RoomSettingModal_RoomSettingModal=RoomSettingModal;RoomSettingModal.__docgenInfo={description:"",methods:[],displayName:"RoomSettingModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},returnFocusRef:{required:!1,tsType:{name:"RefObject",elements:[{name:"HTMLElement"}],raw:"RefObject"},description:""}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList",getUserInfo:"getUserInfo"}},"./src/hooks/useGetRoomInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>useGetRoomInfo});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-router/dist/index.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_config__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/constants/config.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const useGetRoomInfo=()=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.g)(),{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.roomMembers,Number(roomId)],queryFn:()=>(0,_apis_room__WEBPACK_IMPORTED_MODULE_0__.qE)(Number(roomId)),refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=_constants_config__WEBPACK_IMPORTED_MODULE_4__.A3)&&_constants_config__WEBPACK_IMPORTED_MODULE_4__.S2,refetchIntervalInBackground:!0,gcTime:0});return{members:data?.members,roomSetting:data?.roomSetting,master:data?.master,isGameStart:data?.isGameStart}}}}]); \ No newline at end of file diff --git a/storybook/845.fbe2e83e.iframe.bundle.js b/storybook/845.fbe2e83e.iframe.bundle.js new file mode 100644 index 000000000..c94f1859b --- /dev/null +++ b/storybook/845.fbe2e83e.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[845],{"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./src/pages/ReadyPage/components/ReadyMembersContainer/ReadyMembersContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>ReadyMembersContainer_ReadyMembersContainer});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const readyMembersContainerLayout={name:"ch4q08",styles:"display:flex;flex-direction:column;gap:2rem;width:100%"},membersContainer=(0,emotion_react_browser_esm.AH)("position:relative;height:25rem;padding:2rem 3rem 0;border-radius:2rem;background-color:",Theme.S.color.peanut300,";font-weight:600;font-size:1rem;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}",""),totalNumber={name:"eu54mg",styles:"display:flex;justify-content:space-between;align-items:center;padding-left:2rem;font-weight:900;font-size:2rem"},memberList={name:"10zw2ye",styles:"display:flex;flex-direction:column;gap:2rem"},inviteButton=(0,emotion_react_browser_esm.AH)("width:12rem;height:4rem;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";font-weight:700;",""),memberItem={name:"15umcqw",styles:"display:flex;align-items:center;gap:2rem"},profileBox={name:"1bezcfz",styles:"display:flex;justify-content:center;align-items:center;width:3.6rem;height:3.6rem;border-radius:50%;background-color:white"},profileImage={name:"xjt14x",styles:"width:60%"},memberStatus={name:"mk4uq1",styles:"display:flex;flex:1;justify-content:space-between;align-items:center"},crownIcon_namespaceObject=__webpack_require__.p+"static/media/crownIcon.1ef721d9.webp";var sillyDdangkongMedium=__webpack_require__("./src/assets/images/sillyDdangkongMedium.webp"),A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),InviteModal=__webpack_require__("./src/components/InviteModal/InviteModal.tsx"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts"),useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const ReadyMembersContainer=()=>{const{members,master}=(0,useGetRoomInfo.$)(),{show}=(0,useModal.A)(),queryClient=(0,QueryClientProvider.jE)(),returnFocusRef=(0,react.useRef)(null),memberCountMessage=`총 인원 ${members.length}명`;return(0,react.useEffect)((()=>{queryClient.invalidateQueries({queryKey:[queryKeys.e.getUserInfo]})}),[master.memberId]),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:readyMembersContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:totalNumber,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{role:"status",children:memberCountMessage}),(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:inviteButton,onClick:()=>{show(InviteModal.A,{returnFocusRef})},ref:returnFocusRef,children:"초대하기"})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("section",{css:membersContainer,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:memberList,children:members.map((member=>(0,emotion_react_jsx_runtime_browser_esm.FD)("li",{css:memberItem,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:`${member.isMaster?"방장":""} ${member.nickname}`}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:profileBox,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:sillyDdangkongMedium,alt:"",css:profileImage})}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:memberStatus,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{"aria-hidden":!0,children:member.nickname}),member.isMaster&&(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:crownIcon_namespaceObject,alt:""})]})]},member.memberId)))})})]})},ReadyMembersContainer_ReadyMembersContainer=ReadyMembersContainer;ReadyMembersContainer.__docgenInfo={description:"",methods:[],displayName:"ReadyMembersContainer"}},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}},"./src/assets/images/sillyDdangkongMedium.webp":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/sillyDdangkongMedium.9937535c.webp"}}]); \ No newline at end of file diff --git a/storybook/864.14d1a415.iframe.bundle.js.map b/storybook/864.14d1a415.iframe.bundle.js.map deleted file mode 100644 index eb1f3b01e..000000000 --- a/storybook/864.14d1a415.iframe.bundle.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"864.14d1a415.iframe.bundle.js","mappings":";;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAIA;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;;;AAmBA","sources":["webpack://ddangkong-frontend/./src/components/StartButtonContainer/Countdown/Countdown.styled.ts"],"sourcesContent":["import { css, keyframes } from '@emotion/react';\n\nimport { Theme } from '@/styles/Theme';\n\n// 텍스트 글로우 애니메이션\nconst glowAnimation = keyframes`\n0% {\n text-shadow: 0 0 5px ${Theme.color.peanut200}, \n 0 0 15px ${Theme.color.peanut300}, \n 0 0 25px ${Theme.color.peanut300}, \n 0 0 35px ${Theme.color.peanut300}, \n 0 0 45px ${Theme.color.peanut400}, \n 0 0 55px ${Theme.color.peanut400}, \n 0 0 65px ${Theme.color.peanut500};\n }\n 30% {\n text-shadow: 0 0 10px ${Theme.color.peanut200}, \n 0 0 20px ${Theme.color.peanut300}, \n 0 0 30px ${Theme.color.peanut300}, \n 0 0 40px ${Theme.color.peanut300}, \n 0 0 50px ${Theme.color.peanut400}, \n 0 0 60px ${Theme.color.peanut400}, \n 0 0 70px ${Theme.color.peanut500};\n }\n 70% {\n text-shadow: 0 0 10px ${Theme.color.peanut200}, \n 0 0 20px ${Theme.color.peanut300}, \n 0 0 60px ${Theme.color.peanut400}, \n 0 0 70px ${Theme.color.peanut500};\n }\n 100% {\n text-shadow: 0 0 10px ${Theme.color.peanut200}, \n 0 0 20px ${Theme.color.peanut300}, \n 0 0 60px ${Theme.color.peanut400}, \n 0 0 70px ${Theme.color.peanut500};\n }\n`;\n\nexport const countdownAnimation = keyframes`\n 0% {\n transform: scale(0);\n opacity: 0;\n }\n 30% {\n transform: scale(1.5);\n opacity: 1;\n }\n 70% {\n transform: scale(1.5);\n opacity: 1;\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n`;\n\nexport const peanutAnimation = keyframes`\n 0% {\n transform: scale(0);\n opacity: 0;\n }\n 30% {\n transform: scale(1) rotate(20deg);\n opacity: 1;\n }\n 70% {\n transform: scale(1) rotate(-20deg);\n opacity: 1;\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n`;\n\nexport const countdownLayout = css`\n display: flex;\n position: fixed;\n z-index: 1;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 2.4rem;\n\n color: ${Theme.color.peanut500};\n inset: 0;\n`;\n\nexport const dimmed = css`\n position: fixed;\n width: 100vw;\n height: 100vh;\n\n background-color: rgb(0 0 0 / 50%);\n`;\n\nexport const countdown = css`\n ${Theme.typography.countdown};\n animation:\n ${countdownAnimation} 1s ease-in-out infinite,\n ${glowAnimation} 1s infinite;\n`;\n\nexport const imageContainer = css`\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 2.4rem;\n height: 10.8rem;\n`;\n\nexport const peanut = (idx: number) => css`\n width: ${2.4 * idx}rem;\n height: ${3.6 * idx}rem;\n\n animation: ${peanutAnimation} 1s ease-in-out infinite;\n`;\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/storybook/941.3ff2bb29.iframe.bundle.js b/storybook/941.3ff2bb29.iframe.bundle.js deleted file mode 100644 index 400d13c1e..000000000 --- a/storybook/941.3ff2bb29.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[941],{"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/components/SelectContainer/Timer/Timer.util.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Nc:()=>convertMsecToSecond,qE:()=>formatLeftRoundTime,wk:()=>isAlertTimer});var _constants_config__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/constants/config.ts");const formatLeftRoundTime=leftRoundTime=>{const minutes=Math.floor(leftRoundTime/60),seconds=leftRoundTime%60;return`${String(minutes).padStart(2,"0")}:${String(seconds).padStart(2,"0")}`},convertMsecToSecond=msec=>msec/_constants_config__WEBPACK_IMPORTED_MODULE_0__.S2,isAlertTimer=(leftRoundTime,timeLimit)=>leftRoundTime===Math.floor(timeLimit/2)||leftRoundTime===_constants_config__WEBPACK_IMPORTED_MODULE_0__.cZ},"./src/components/common/AlertModal/AlertModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>AlertModal_AlertModal});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const alertModalTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.headline3,";",""),messageContainer={name:"1azakc",styles:"text-align:center"},alertText={name:"255c6r",styles:"word-break:keep-all"};var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const AlertModal=({isOpen,onClose,onConfirm,message,title,returnFocusRef})=>(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,returnFocusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:alertModalTitle,children:title||"알림"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{css:messageContainer,children:message&&message.split("\n").map((text=>(0,emotion_react_jsx_runtime_browser_esm.FD)(react.Fragment,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:alertText,children:text}),(0,emotion_react_jsx_runtime_browser_esm.Y)("br",{})]},text)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:()=>{onConfirm&&onConfirm(),onClose()},buttonWidth:"60%",children:"확인"})})]}),AlertModal_AlertModal=AlertModal;AlertModal.__docgenInfo={description:"",methods:[],displayName:"AlertModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onConfirm:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},message:{required:!1,tsType:{name:"string"},description:""},title:{required:!1,tsType:{name:"string"},description:""},returnFocusRef:{required:!1,tsType:{name:"RefObject",elements:[{name:"HTMLElement"}],raw:"RefObject"},description:""}}}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/components/layout/Header/Header.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{tT:()=>BackHeader,il:()=>GameHeader,v4:()=>RoomSettingHeader,vc:()=>RoundResultHeader,Ub:()=>TitleHeader,Ay:()=>Header_Header});var react=__webpack_require__("./node_modules/react/index.js"),dist=__webpack_require__("./node_modules/react-router/dist/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const headerLayout=isCenter=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:",isCenter?"center":"space-between",";align-items:center;height:12vh;padding:0 2.4rem;:focus{outline:none;}",""),roundText={name:"1icein2",styles:"display:flex;align-items:center;width:2.4rem;height:2.4rem;font-weight:bold;font-size:1.6rem"},buttonWrapper={name:"1ocs895",styles:"display:flex;justify-content:center;align-items:center;width:2rem;height:2rem"},gameTitle={name:"1anrxxk",styles:"font-weight:bold;font-size:2rem"},iconImage={name:"fmrzco",styles:"display:flex;align-items:center;width:2.4rem;height:2.4rem"},MatchingResultHeaderContainer={name:"19iqmqi",styles:"display:flex;flex-direction:column;align-items:center;gap:1.2rem"},matchingResultTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.slogan,";",""),matchingResultCaption={name:"ywz92v",styles:"font-weight:bold;font-size:1.2rem"};var useMutation=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js"),room=__webpack_require__("./src/apis/room.ts"),useGetUserInfo=__webpack_require__("./src/hooks/useGetUserInfo.ts");__webpack_require__("./node_modules/core-js/modules/esnext.iterator.constructor.js"),__webpack_require__("./node_modules/core-js/modules/esnext.iterator.for-each.js");const useExit=()=>{const{member:{memberId}}=(0,useGetUserInfo.A)(),navigate=(0,dist.Zp)(),{roomId}=(0,dist.g)(),exitRoomMutation=(0,useMutation.n)({mutationFn:({roomId,memberId})=>(0,room.Gn)(roomId,memberId),onSettled:()=>{document.cookie.split(";").forEach((cookie=>{document.cookie=cookie.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date(0).toUTCString()+";path=/")})),navigate("/")}});return{handleExit:()=>{exitRoomMutation.mutate({roomId:Number(roomId),memberId:Number(memberId)})}}};var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useRoutePath=()=>{const location=(0,dist.zy)(),{roomId}=(0,dist.g)(),currentPath={isNicknamePage:location.pathname.startsWith(routes.b.nickname),isReadyPage:location.pathname===routes.b.ready(Number(roomId)),isRoundResultPage:location.pathname===routes.b.roundResult(Number(roomId)),isMatchingResultPage:location.pathname===routes.b.gameResult(Number(roomId))};return{isNicknamePage:currentPath.isNicknamePage,isReadyPage:currentPath.isReadyPage,isRoundResultPage:currentPath.isRoundResultPage,isMatchingResultPage:currentPath.isMatchingResultPage}},arrowLeft_namespaceObject=__webpack_require__.p+"static/media/arrowLeft.d6435a9d.svg",exitIcon_namespaceObject=__webpack_require__.p+"static/media/exitIcon.58b68e72.svg",settingIcon_namespaceObject=__webpack_require__.p+"static/media/settingIcon.489dd149.svg";var A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),AlertModal=__webpack_require__("./src/components/common/AlertModal/AlertModal.tsx"),RoomSettingModal=__webpack_require__("./src/components/common/RoomSettingModal/RoomSettingModal.tsx"),Timer_util=__webpack_require__("./src/components/SelectContainer/Timer/Timer.util.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),useFocus=__webpack_require__("./src/hooks/useFocus.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Header=()=>{const{isNicknamePage,isReadyPage,isRoundResultPage,isMatchingResultPage}=hooks_useRoutePath();return(0,react.useEffect)((()=>{const handleKeyDown=event=>{("F5"===event.key||event.ctrlKey&&"r"===event.key)&&event.preventDefault()};window.addEventListener("keydown",handleKeyDown);const handleBeforeUnload=event=>{event.preventDefault(),alert("새로고침 시 게임에서 나가질 수 있습니다")};return window.addEventListener("beforeunload",handleBeforeUnload),()=>{window.removeEventListener("keydown",handleKeyDown),window.removeEventListener("beforeunload",handleBeforeUnload)}}),[]),isNicknamePage?(0,emotion_react_jsx_runtime_browser_esm.Y)(TitleHeader,{title:"닉네임 설정"}):isReadyPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingHeader,{title:"밸런스 게임"}):isRoundResultPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(RoundResultHeader,{}):isMatchingResultPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(MatchingResultHeader,{title:"매칭 결과"}):void 0},MatchingResultHeader=({title})=>{const focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.Y)("header",{css:headerLayout(!0),tabIndex:0,ref:focusRef,children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:MatchingResultHeaderContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:matchingResultTitle,children:title}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:matchingResultCaption,children:"매칭도를 통해 당신과 가장 잘 맞는 사람을 알아보세요😊"})]})})},TitleHeader=({title})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("header",{css:headerLayout(!0),children:(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title})}),RoomSettingHeader=({title})=>{const{show}=(0,useModal.A)(),{member:{isMaster}}=(0,useGetUserInfo.A)(),{handleExit}=useExit(),returnFocusRef=(0,react.useRef)(null),focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{show(AlertModal.A,{message:"정말로 나가시겠습니까?",onConfirm:handleExit})},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:exitIcon_namespaceObject,alt:"방 나가기",css:iconImage})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title}),isMaster?(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{ref:returnFocusRef,onClick:()=>{show(RoomSettingModal.A,{returnFocusRef})},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:settingIcon_namespaceObject,alt:"방 설정",css:iconImage})}):(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText})]})},RoundResultHeader=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),screenReaderRoundResult=`${balanceContent.totalRound}라운드 중. ${balanceContent.currentRound}라운드. 투표 결과 페이지`,focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderRoundResult}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:roundText,"aria-hidden":!0,children:[balanceContent.currentRound,"/",balanceContent.totalRound]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,"aria-hidden":!0,children:"투표 결과"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText,"aria-hidden":!0})]})},GameHeader=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{totalRound,currentRound,timeLimit}=balanceContent,screenReaderHeader=`${totalRound}라운드.중.${currentRound}라운드. 밸런스 게임 페이지. 제한 시간 ${(0,Timer_util.Nc)(timeLimit)}초.`,focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderHeader}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:roundText,"aria-hidden":!0,children:[currentRound,"/",totalRound]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,"aria-hidden":!0,children:"밸런스 게임"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText,"aria-hidden":!0})]})},BackHeader=({title})=>{const navigate=(0,dist.Zp)(),focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{navigate(-1)},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:arrowLeft_namespaceObject,alt:"뒤로 가기"})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText})]})},Header_Header=Header;MatchingResultHeader.__docgenInfo={description:"",methods:[],displayName:"MatchingResultHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},TitleHeader.__docgenInfo={description:"",methods:[],displayName:"TitleHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},RoomSettingHeader.__docgenInfo={description:"",methods:[],displayName:"RoomSettingHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},RoundResultHeader.__docgenInfo={description:"",methods:[],displayName:"RoundResultHeader"},GameHeader.__docgenInfo={description:"",methods:[],displayName:"GameHeader"},BackHeader.__docgenInfo={description:"",methods:[],displayName:"BackHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},Header.__docgenInfo={description:"",methods:[],displayName:"Header"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/hooks/useGetUserInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=()=>{const{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.I)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.getUserInfo],queryFn:_apis_room__WEBPACK_IMPORTED_MODULE_0__.ug,staleTime:72e5});return{roomId:data?.roomId||0,roomUuid:data?.roomUuid||"",member:{memberId:data?.member?.memberId||0,nickname:data?.member?.nickname||"",isMaster:data?.member?.isMaster||!1}}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./node_modules/core-js/modules/esnext.iterator.for-each.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),iterate=__webpack_require__("./node_modules/core-js/internals/iterate.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js");$({target:"Iterator",proto:!0,real:!0},{forEach:function forEach(fn){anObject(this),aCallable(fn);var record=getIteratorDirect(this),counter=0;iterate(record,(function(value){fn(value,counter++)}),{IS_RECORD:!0})}})}}]); \ No newline at end of file diff --git a/storybook/941.ad998aaf.iframe.bundle.js b/storybook/941.ad998aaf.iframe.bundle.js new file mode 100644 index 000000000..1b091d577 --- /dev/null +++ b/storybook/941.ad998aaf.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[941],{"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/components/AlertModal/AlertModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>AlertModal_AlertModal});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const alertModalTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.headline3,";",""),messageContainer={name:"1azakc",styles:"text-align:center"},alertText={name:"255c6r",styles:"word-break:keep-all"};var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const AlertModal=({isOpen,onClose,onConfirm,message,title,returnFocusRef})=>(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,returnFocusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:alertModalTitle,children:title||"알림"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{css:messageContainer,children:message&&message.split("\n").map((text=>(0,emotion_react_jsx_runtime_browser_esm.FD)(react.Fragment,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:alertText,children:text}),(0,emotion_react_jsx_runtime_browser_esm.Y)("br",{})]},text)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:()=>{onConfirm&&onConfirm(),onClose()},buttonWidth:"60%",children:"확인"})})]}),AlertModal_AlertModal=AlertModal;AlertModal.__docgenInfo={description:"",methods:[],displayName:"AlertModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onConfirm:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},message:{required:!1,tsType:{name:"string"},description:""},title:{required:!1,tsType:{name:"string"},description:""},returnFocusRef:{required:!1,tsType:{name:"RefObject",elements:[{name:"HTMLElement"}],raw:"RefObject"},description:""}}}},"./src/components/common/a11yOnly/A11yOnly.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>a11yOnly_A11yOnly});const a11yOnlyLayout={name:"90pyz3",styles:"overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;clip:rect(0, 0, 0, 0)"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const A11yOnly=({as,children,...props})=>{const Component=as||"span";return(0,emotion_react_jsx_runtime_browser_esm.Y)(Component,{css:a11yOnlyLayout,...props,children})},a11yOnly_A11yOnly=A11yOnly;A11yOnly.__docgenInfo={description:"",methods:[],displayName:"A11yOnly",props:{as:{required:!1,tsType:{name:"T"},description:""},role:{required:!1,tsType:{name:"AriaRole"},description:""}}}},"./src/components/layout/Header/Header.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{tT:()=>BackHeader,il:()=>GameHeader,v4:()=>RoomSettingHeader,vc:()=>RoundResultHeader,Ub:()=>TitleHeader,Ay:()=>Header_Header});var react=__webpack_require__("./node_modules/react/index.js"),dist=__webpack_require__("./node_modules/react-router/dist/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const headerLayout=isCenter=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:",isCenter?"center":"space-between",";align-items:center;height:12vh;padding:0 2.4rem;:focus{outline:none;}",""),roundText={name:"1icein2",styles:"display:flex;align-items:center;width:2.4rem;height:2.4rem;font-weight:bold;font-size:1.6rem"},buttonWrapper={name:"1ocs895",styles:"display:flex;justify-content:center;align-items:center;width:2rem;height:2rem"},gameTitle={name:"1anrxxk",styles:"font-weight:bold;font-size:2rem"},iconImage={name:"fmrzco",styles:"display:flex;align-items:center;width:2.4rem;height:2.4rem"},MatchingResultHeaderContainer={name:"19iqmqi",styles:"display:flex;flex-direction:column;align-items:center;gap:1.2rem"},matchingResultTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.slogan,";",""),matchingResultCaption={name:"ywz92v",styles:"font-weight:bold;font-size:1.2rem"};var useMutation=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js"),room=__webpack_require__("./src/apis/room.ts"),useGetUserInfo=__webpack_require__("./src/hooks/useGetUserInfo.ts");__webpack_require__("./node_modules/core-js/modules/esnext.iterator.constructor.js"),__webpack_require__("./node_modules/core-js/modules/esnext.iterator.for-each.js");const useExit=()=>{const{member:{memberId}}=(0,useGetUserInfo.A)(),navigate=(0,dist.Zp)(),{roomId}=(0,dist.g)(),exitRoomMutation=(0,useMutation.n)({mutationFn:({roomId,memberId})=>(0,room.Gn)(roomId,memberId),onSettled:()=>{document.cookie.split(";").forEach((cookie=>{document.cookie=cookie.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date(0).toUTCString()+";path=/")})),navigate("/")}});return{handleExit:()=>{exitRoomMutation.mutate({roomId:Number(roomId),memberId:Number(memberId)})}}};var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useRoutePath=()=>{const location=(0,dist.zy)(),{roomId}=(0,dist.g)(),currentPath={isNicknamePage:location.pathname.startsWith(routes.b.nickname),isReadyPage:location.pathname===routes.b.ready(Number(roomId)),isRoundResultPage:location.pathname===routes.b.roundResult(Number(roomId)),isMatchingResultPage:location.pathname===routes.b.gameResult(Number(roomId))};return{isNicknamePage:currentPath.isNicknamePage,isReadyPage:currentPath.isReadyPage,isRoundResultPage:currentPath.isRoundResultPage,isMatchingResultPage:currentPath.isMatchingResultPage}},arrowLeft_namespaceObject=__webpack_require__.p+"static/media/arrowLeft.d6435a9d.svg",exitIcon_namespaceObject=__webpack_require__.p+"static/media/exitIcon.58b68e72.svg",settingIcon_namespaceObject=__webpack_require__.p+"static/media/settingIcon.489dd149.svg";var AlertModal=__webpack_require__("./src/components/AlertModal/AlertModal.tsx"),A11yOnly=__webpack_require__("./src/components/common/a11yOnly/A11yOnly.tsx"),RoomSettingModal=__webpack_require__("./src/components/RoomSettingModal/RoomSettingModal.tsx"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),useFocus=__webpack_require__("./src/hooks/useFocus.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),Timer_util=__webpack_require__("./src/pages/GamePage/components/SelectContainer/Timer/Timer.util.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Header=()=>{const{isNicknamePage,isReadyPage,isRoundResultPage,isMatchingResultPage}=hooks_useRoutePath();return(0,react.useEffect)((()=>{const handleKeyDown=event=>{("F5"===event.key||event.ctrlKey&&"r"===event.key)&&event.preventDefault()};window.addEventListener("keydown",handleKeyDown);const handleBeforeUnload=event=>{event.preventDefault(),alert("새로고침 시 게임에서 나가질 수 있습니다")};return window.addEventListener("beforeunload",handleBeforeUnload),()=>{window.removeEventListener("keydown",handleKeyDown),window.removeEventListener("beforeunload",handleBeforeUnload)}}),[]),isNicknamePage?(0,emotion_react_jsx_runtime_browser_esm.Y)(TitleHeader,{title:"닉네임 설정"}):isReadyPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingHeader,{title:"밸런스 게임"}):isRoundResultPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(RoundResultHeader,{}):isMatchingResultPage?(0,emotion_react_jsx_runtime_browser_esm.Y)(MatchingResultHeader,{title:"매칭 결과"}):void 0},MatchingResultHeader=({title})=>{const focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.Y)("header",{css:headerLayout(!0),tabIndex:0,ref:focusRef,children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:MatchingResultHeaderContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:matchingResultTitle,children:title}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:matchingResultCaption,children:"매칭도를 통해 당신과 가장 잘 맞는 사람을 알아보세요😊"})]})})},TitleHeader=({title})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("header",{css:headerLayout(!0),children:(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title})}),RoomSettingHeader=({title})=>{const{show}=(0,useModal.A)(),{member:{isMaster}}=(0,useGetUserInfo.A)(),{handleExit}=useExit(),returnFocusRef=(0,react.useRef)(null),focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{show(AlertModal.A,{message:"정말로 나가시겠습니까?",onConfirm:handleExit})},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:exitIcon_namespaceObject,alt:"방 나가기",css:iconImage})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title}),isMaster?(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{ref:returnFocusRef,onClick:()=>{show(RoomSettingModal.A,{returnFocusRef})},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:settingIcon_namespaceObject,alt:"방 설정",css:iconImage})}):(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText})]})},RoundResultHeader=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),screenReaderRoundResult=`${balanceContent.totalRound}라운드 중. ${balanceContent.currentRound}라운드. 투표 결과 페이지`,focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderRoundResult}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:roundText,"aria-hidden":!0,children:[balanceContent.currentRound,"/",balanceContent.totalRound]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,"aria-hidden":!0,children:"투표 결과"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText,"aria-hidden":!0})]})},GameHeader=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{totalRound,currentRound,timeLimit}=balanceContent,screenReaderHeader=`${totalRound}라운드.중.${currentRound}라운드. 밸런스 게임 페이지. 제한 시간 ${(0,Timer_util.Nc)(timeLimit)}초.`,focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(A11yOnly.A,{children:screenReaderHeader}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:roundText,"aria-hidden":!0,children:[currentRound,"/",totalRound]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,"aria-hidden":!0,children:"밸런스 게임"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText,"aria-hidden":!0})]})},BackHeader=({title})=>{const navigate=(0,dist.Zp)(),focusRef=(0,useFocus.A)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:headerLayout(),tabIndex:0,ref:focusRef,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{onClick:()=>{navigate(-1)},css:buttonWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:arrowLeft_namespaceObject,alt:"뒤로 가기"})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:gameTitle,children:title}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roundText})]})},Header_Header=Header;MatchingResultHeader.__docgenInfo={description:"",methods:[],displayName:"MatchingResultHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},TitleHeader.__docgenInfo={description:"",methods:[],displayName:"TitleHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},RoomSettingHeader.__docgenInfo={description:"",methods:[],displayName:"RoomSettingHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},RoundResultHeader.__docgenInfo={description:"",methods:[],displayName:"RoundResultHeader"},GameHeader.__docgenInfo={description:"",methods:[],displayName:"GameHeader"},BackHeader.__docgenInfo={description:"",methods:[],displayName:"BackHeader",props:{title:{required:!0,tsType:{name:"string"},description:""}}},Header.__docgenInfo={description:"",methods:[],displayName:"Header"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/hooks/useGetUserInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=()=>{const{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.I)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.getUserInfo],queryFn:_apis_room__WEBPACK_IMPORTED_MODULE_0__.ug,staleTime:72e5});return{roomId:data?.roomId||0,roomUuid:data?.roomUuid||"",member:{memberId:data?.member?.memberId||0,nickname:data?.member?.nickname||"",isMaster:data?.member?.isMaster||!1}}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/providers/ModalProvider/ModalProvider.tsx");const __WEBPACK_DEFAULT_EXPORT__=()=>{const dispatch=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_providers_ModalProvider_ModalProvider__WEBPACK_IMPORTED_MODULE_1__.L);if(null===dispatch)throw new Error("ModalDispatchContext가 존재하지 않습니다.");return dispatch}},"./src/pages/GamePage/components/SelectContainer/Timer/Timer.util.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Nc:()=>convertMsecToSecond,qE:()=>formatLeftRoundTime,wk:()=>isAlertTimer});var _constants_config__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/constants/config.ts");const formatLeftRoundTime=leftRoundTime=>{const minutes=Math.floor(leftRoundTime/60),seconds=leftRoundTime%60;return`${String(minutes).padStart(2,"0")}:${String(seconds).padStart(2,"0")}`},convertMsecToSecond=msec=>msec/_constants_config__WEBPACK_IMPORTED_MODULE_0__.S2,isAlertTimer=(leftRoundTime,timeLimit)=>leftRoundTime===Math.floor(timeLimit/2)||leftRoundTime===_constants_config__WEBPACK_IMPORTED_MODULE_0__.cZ},"./node_modules/core-js/modules/esnext.iterator.for-each.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),iterate=__webpack_require__("./node_modules/core-js/internals/iterate.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js");$({target:"Iterator",proto:!0,real:!0},{forEach:function forEach(fn){anObject(this),aCallable(fn);var record=getIteratorDirect(this),counter=0;iterate(record,(function(value){fn(value,counter++)}),{IS_RECORD:!0})}})}}]); \ No newline at end of file diff --git a/storybook/961.75f49b1b.iframe.bundle.js.map b/storybook/961.75f49b1b.iframe.bundle.js.map deleted file mode 100644 index b26eafe7c..000000000 --- a/storybook/961.75f49b1b.iframe.bundle.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"961.75f49b1b.iframe.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;;;;;;;AASA;;;;;;;AASA","sources":["webpack://ddangkong-frontend/./src/components/SelectContainer/Timer/Timer.styled.ts"],"sourcesContent":["import { css, keyframes } from '@emotion/react';\n\nimport { Theme } from '@/styles/Theme';\n\nconst shake = keyframes`\n 0%{\n transform: rotate(0deg);\n }\n 10%{\n transform: scale(1.5) rotate(45deg);\n }\n 20%{\n transform: scale(1.5) rotate(-45deg);\n }\n 30%{\n transform: rotate(30deg);\n }\n 40%{\n transform: rotate(-30deg);\n }\n 50%{\n transform: rotate(10deg);\n }\n 60%{\n transform: rotate(-10deg);\n }\n 100%{\n transform: rotate(0deg);\n }\n`;\n\nconst progress = keyframes`\n 0% {\n transform: scaleX(1);\n }\n 100% {\n transform: scaleX(0);\n }\n`;\n\nconst timerTransition = keyframes`\n 0% {\n transform: translateX(0);\n }\n 100%{\n transform: translateX(-95%);\n }\n`;\n\nexport const timerLayout = css`\n display: flex;\n position: relative;\n align-items: center;\n width: 100%;\n height: 3.2rem;\n padding: 0 1rem;\n border-radius: ${Theme.borderRadius.radius30};\n\n background-color: ${Theme.color.peanut200};\n box-sizing: border-box;\n`;\n\nexport const timerInnerLayout = (timeLimit: number) => css`\n display: flex;\n justify-content: center;\n align-items: center;\n\n width: 100%;\n height: 60%;\n border-radius: ${Theme.borderRadius.radius30};\n\n background-color: ${Theme.color.peanut500};\n\n transform-origin: left;\n\n animation: ${progress} ${timeLimit + 1}s linear;\n`;\n\nexport const timerWrapper = (timeLimit: number) => css`\n display: flex;\n position: absolute;\n flex-direction: column;\n justify-content: center;\n align-items: flex-end;\n\n width: 100%;\n height: 4rem;\n\n animation: ${timerTransition} ${timeLimit + 1}s linear;\n`;\n\nexport const timerIcon = css`\n position: absolute;\n width: 4.8rem;\n height: 4.8rem;\n`;\n\nexport const timerIconShake = css`\n animation: ${shake} 1s linear infinite;\n`;\n\nexport const timerText = (isAlmostFinished: boolean) => css`\n position: absolute;\n top: 5.2rem;\n\n color: ${isAlmostFinished ? 'red' : 'black'};\n font-weight: bold;\n font-size: 1.6rem;\n`;\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/storybook/components-AlertModal-AlertModal-stories.11df13e1.iframe.bundle.js b/storybook/components-AlertModal-AlertModal-stories.11df13e1.iframe.bundle.js new file mode 100644 index 000000000..18e9fb770 --- /dev/null +++ b/storybook/components-AlertModal-AlertModal-stories.11df13e1.iframe.bundle.js @@ -0,0 +1 @@ +(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[399],{"./src/components/AlertModal/AlertModal.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,알림_모달:()=>알림_모달});var _storybook_test__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/test/dist/index.mjs"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js"),_AlertModal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/AlertModal/AlertModal.tsx"),_common_Button_Button__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/common/Button/Button.tsx"),_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const __WEBPACK_DEFAULT_EXPORT__={title:"modal/AlertModal",component:_AlertModal__WEBPACK_IMPORTED_MODULE_2__.A,argTypes:{isOpen:{control:"boolean",default:!0,description:"모달이 열렸는지 여부를 나타냅니다.",table:{type:{summary:"boolean"}}},onClose:{description:"모달을 닫기 위한 핸들러 함수입니다."},onConfirm:{description:"확인을 통해 다음 동작을 수행하는 핸들러 함수입니다."}},args:{onClose:(0,_storybook_test__WEBPACK_IMPORTED_MODULE_0__.fn)(),onConfirm:(0,_storybook_test__WEBPACK_IMPORTED_MODULE_0__.fn)()}},알림_모달={parameters:{docs:{description:{story:"안내 모달"}}},render:()=>{const[isOpen,setIsOpen]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1);return(0,_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.FD)(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.FK,{children:[(0,_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Y)(_common_Button_Button__WEBPACK_IMPORTED_MODULE_3__.A,{text:"알림 모달 열기",onClick:()=>setIsOpen(!0)}),(0,_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Y)(_AlertModal__WEBPACK_IMPORTED_MODULE_2__.A,{isOpen,onClose:()=>setIsOpen(!1),title:"알림 모달 제목",message:"대화를 충분히 나누셨나요?\n확인을 누르면 다음 라운드로 진행됩니다 :)"})]})}},__namedExportsOrder=["알림_모달"];알림_모달.parameters={...알림_모달.parameters,docs:{...알림_모달.parameters?.docs,source:{originalSource:"{\n parameters: {\n docs: {\n description: {\n story: '안내 모달'\n }\n }\n },\n render: () => {\n const [isOpen, setIsOpen] = useState(false);\n return <>\n