From 334eb09839ee92e634693c51e041a80287cecd3e Mon Sep 17 00:00:00 2001 From: JeongHunHui Date: Fri, 6 Sep 2024 23:19:06 +0900 Subject: [PATCH 001/120] =?UTF-8?q?[SBL-121]=20FingerPrintJS=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 31 ++----------------------------- package.json | 1 - src/app/s/[surveyId]/p/page.tsx | 13 +++---------- src/providers/FpjsProvider.tsx | 23 ----------------------- src/providers/Providers.tsx | 13 +++++-------- 5 files changed, 10 insertions(+), 71 deletions(-) delete mode 100644 src/providers/FpjsProvider.tsx diff --git a/package-lock.json b/package-lock.json index 1e5c13b..2139663 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,6 @@ "name": "sulmun2yong", "version": "0.1.0", "dependencies": { - "@fingerprintjs/fingerprintjs-pro-react": "^2.6.3", "@next/third-parties": "^14.2.5", "@tanstack/react-query": "^5.50.1", "@tanstack/react-query-devtools": "^5.50.1", @@ -112,33 +111,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@fingerprintjs/fingerprintjs-pro": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/@fingerprintjs/fingerprintjs-pro/-/fingerprintjs-pro-3.10.1.tgz", - "integrity": "sha512-4GJ4gfxIEmyRO59TAHqsizBGLh4T5mzzbm+R7yx4YIqrGp7/mnlI4t7IpylnLBqLiPhaVThRFz4SEA08zTDfNA==", - "dependencies": { - "tslib": "^2.4.1" - } - }, - "node_modules/@fingerprintjs/fingerprintjs-pro-react": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/@fingerprintjs/fingerprintjs-pro-react/-/fingerprintjs-pro-react-2.6.3.tgz", - "integrity": "sha512-/axCq/cfjZkIM+WFZM/05FQvqtNfdKbIFKU6b2yrwPKlgT8BqWkAq8XvFX6JCPlq8/udVLJjFEDCK+1JQh1L6g==", - "hasInstallScript": true, - "dependencies": { - "@fingerprintjs/fingerprintjs-pro-spa": "^1.3.1", - "fast-deep-equal": "3.1.3" - } - }, - "node_modules/@fingerprintjs/fingerprintjs-pro-spa": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@fingerprintjs/fingerprintjs-pro-spa/-/fingerprintjs-pro-spa-1.3.1.tgz", - "integrity": "sha512-1k+85IYh1bBDJY/syHzBmTzKKaPGQkpq8GO9+vf7MHdqlmIiLAcutaHMUXey9DxylKm93qCHRY/1fCOOQ/LiTA==", - "dependencies": { - "@fingerprintjs/fingerprintjs-pro": "^3.9.2", - "tslib": "^2.6.2" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -2556,7 +2528,8 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true }, "node_modules/fast-diff": { "version": "1.3.0", diff --git a/package.json b/package.json index 8a8335e..05d761f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "prepare": "husky install" }, "dependencies": { - "@fingerprintjs/fingerprintjs-pro-react": "^2.6.3", "@next/third-parties": "^14.2.5", "@tanstack/react-query": "^5.50.1", "@tanstack/react-query-devtools": "^5.50.1", diff --git a/src/app/s/[surveyId]/p/page.tsx b/src/app/s/[surveyId]/p/page.tsx index 8298b7c..06157ae 100644 --- a/src/app/s/[surveyId]/p/page.tsx +++ b/src/app/s/[surveyId]/p/page.tsx @@ -2,7 +2,6 @@ import { useEffect, useMemo, useState } from 'react'; import { useRouter } from 'next/navigation'; -import { useVisitorData } from '@fingerprintjs/fingerprintjs-pro-react'; import { useForm } from '@/components/survey-p/hooks/useForm'; import { useSurveysProgress, useSurveysResponse } from '@/services/surveys'; import { @@ -42,11 +41,6 @@ export default function Page({ params }: { params: { surveyId: string } }) { }); const [userResponse, setUserResponse] = useState(null); - const { - isLoading: visitorLoading, - error: visitorError, - data: visitorData, - } = useVisitorData({ extendedResult: true }, { immediate: true }); useEffect(() => { if (!survey) return; @@ -69,7 +63,7 @@ export default function Page({ params }: { params: { surveyId: string } }) { return ; } - if (isError || visitorError) { + if (isError) { return ( ; } @@ -131,11 +125,10 @@ export default function Page({ params }: { params: { surveyId: string } }) { const onSubmit = () => { if (!userResponse) return; - const visitorId = visitorData?.visitorId || undefined; setIsSubmitting(true); mutation.mutate( - { ...userResponse, visitorId }, + { ...userResponse }, { onSuccess: (data) => { clearInteractions(surveyId); diff --git a/src/providers/FpjsProvider.tsx b/src/providers/FpjsProvider.tsx deleted file mode 100644 index 40dc1fa..0000000 --- a/src/providers/FpjsProvider.tsx +++ /dev/null @@ -1,23 +0,0 @@ -'use client'; - -import { FpjsProvider as Provider, FingerprintJSPro } from '@fingerprintjs/fingerprintjs-pro-react'; - -export default function FpjsProvider({ children }: React.PropsWithChildren) { - const apiKey = process.env.NEXT_PUBLIC_CREDENTIAL_API_KEY!; - const credentialServerUrl = process.env.NEXT_PUBLIC_CREDENTIAL_SERVER_URL!; - - return ( - //loader_v.js`, - FingerprintJSPro.defaultScriptUrlPattern, - ], - region: 'ap', - }}> - {children} - - ); -} diff --git a/src/providers/Providers.tsx b/src/providers/Providers.tsx index 3695f78..a028f20 100644 --- a/src/providers/Providers.tsx +++ b/src/providers/Providers.tsx @@ -4,7 +4,6 @@ import AuthProvider from './auth/AuthProvider'; import type { User } from './auth/types'; import ToastProvider from './ToastProvider'; import ReactQueryClientProvider from './ReactQueryClientProvider'; -import FpjsProvider from './FpjsProvider'; interface Props { init: { @@ -16,12 +15,10 @@ export default function Providers({ children, init }: React.PropsWithChildren - - - {children} - - - + + + {children} + + ); } From 1936e19f24967f874735bb269f4002d91c1db1ea Mon Sep 17 00:00:00 2001 From: JeongHunHui Date: Fri, 6 Sep 2024 23:20:20 +0900 Subject: [PATCH 002/120] =?UTF-8?q?[SBL-121]=20=EC=A6=89=EC=8B=9C=20?= =?UTF-8?q?=EC=B6=94=EC=B2=A8=EC=9D=B4=20=EC=95=84=EB=8B=8C=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20=EC=84=A4=EB=AC=B8=20=EC=9D=91=EB=8B=B5=20=EC=A0=9C?= =?UTF-8?q?=EC=B6=9C=20=ED=9B=84=20=EC=84=A4=EB=AC=B8=20=EC=83=81=EC=84=B8?= =?UTF-8?q?=20=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/s/[surveyId]/p/page.tsx | 9 +++++++-- src/services/surveys/types.ts | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/s/[surveyId]/p/page.tsx b/src/app/s/[surveyId]/p/page.tsx index 06157ae..56f57c3 100644 --- a/src/app/s/[surveyId]/p/page.tsx +++ b/src/app/s/[surveyId]/p/page.tsx @@ -132,8 +132,13 @@ export default function Page({ params }: { params: { surveyId: string } }) { { onSuccess: (data) => { clearInteractions(surveyId); - setSurveyState(surveyId, data.participantId); - nextRouter.push(`/s/${surveyId}/draw?pid=${data.participantId}`); + if (data.isImmediateDraw) { + setSurveyState(surveyId, data.participantId); + nextRouter.push(`/s/${surveyId}/draw?pid=${data.participantId}`); + } else { + setSurveyState(surveyId, '$'); + nextRouter.push(`/s/${surveyId}`); + } }, onError: (error) => { showToast('error', (error.cause as ErrorCause).message); diff --git a/src/services/surveys/types.ts b/src/services/surveys/types.ts index 446e731..285cab1 100644 --- a/src/services/surveys/types.ts +++ b/src/services/surveys/types.ts @@ -87,6 +87,7 @@ interface SurveysResponseParams { interface SurveysResponseResponse { participantId: string; + isImmediateDraw: boolean; } export type { From 1dd8ee29d6f8411cd950dd5d90388fd78a3b4a6c Mon Sep 17 00:00:00 2001 From: JeongHunHui Date: Fri, 6 Sep 2024 23:21:37 +0900 Subject: [PATCH 003/120] =?UTF-8?q?[SBL-121]=20=EC=84=A4=EB=AC=B8=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C,=20=EC=84=A4=EB=AC=B8?= =?UTF-8?q?=20=EC=83=81=EC=84=B8=20=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=20=EC=8B=9C=20=EB=A6=AC=EC=9B=8C=EB=93=9C=EA=B0=80=200?= =?UTF-8?q?=EA=B0=9C=EA=B1=B0=EB=82=98,=20targetParticipant=EA=B0=80=20nul?= =?UTF-8?q?l=EC=9D=B8=20=EA=B2=BD=EC=9A=B0=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=EB=A5=BC=20=EB=9E=9C=EB=8D=94=EB=A7=81=20?= =?UTF-8?q?=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/survey-finder/item/Item.tsx | 16 +++++---- src/components/survey-details/index.tsx | 36 ++++++++++--------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/components/main/survey-finder/item/Item.tsx b/src/components/main/survey-finder/item/Item.tsx index 7e331b5..3a951c3 100644 --- a/src/components/main/survey-finder/item/Item.tsx +++ b/src/components/main/survey-finder/item/Item.tsx @@ -29,12 +29,16 @@ export default function ListItem({ survey }: { survey: Survey }) {
-
- {rewardCount} -
-
- {targetParticipants} -
+ {rewardCount > 0 && ( +
+ {rewardCount} +
+ )} + {targetParticipants !== null && ( +
+ {targetParticipants} +
+ )}
diff --git a/src/components/survey-details/index.tsx b/src/components/survey-details/index.tsx index c409c84..466b7d2 100644 --- a/src/components/survey-details/index.tsx +++ b/src/components/survey-details/index.tsx @@ -108,24 +108,28 @@ export default function DetailsViewer({ data, surveyId, state }: Props) { {finishedAt.year}년 {finishedAt.month}월 {finishedAt.date}일 {finishedAt.hour}시 자동 마감 -
- -
-
{currentParticipants}명 응답 완료
-
/ 최대 {targetParticipants}명 응답 가능
+ {targetParticipants != null && ( +
+ +
+
{currentParticipants}명 응답 완료
+
/ 최대 {targetParticipants}명 응답 가능
+
-
-
- -
- {rewards.map((reward) => ( -
-
{reward.item}
-
x {reward.count}
-
- ))} + )} + {rewards.length > 0 && ( +
+ +
+ {rewards.map((reward) => ( +
+
{reward.item}
+
x {reward.count}
+
+ ))} +
-
+ )}
  • * 설문 조사자가 지급을 약속한 리워드와 수량입니다.
  • * 리워드는 추첨을 퉁해 지급되며, 낙첨된 경우 지급되지 않습니다.
  • From 7251acc5f9f3a47f63b0d1a96747d6f54f5107c3 Mon Sep 17 00:00:00 2001 From: JeongHunHui Date: Fri, 6 Sep 2024 23:22:10 +0900 Subject: [PATCH 004/120] =?UTF-8?q?[SBL-121]=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EB=A5=BC=20=EC=9C=84=ED=95=B4=20=EB=84=A3=EC=97=88=EB=8D=98=20?= =?UTF-8?q?=EC=9E=84=EC=8B=9C=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/survey-result/index.tsx | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/components/survey-result/index.tsx b/src/components/survey-result/index.tsx index bcc621d..fa7b29c 100644 --- a/src/components/survey-result/index.tsx +++ b/src/components/survey-result/index.tsx @@ -17,23 +17,6 @@ export default function SurveyResult({ surveyId, reward }: Props) { 📅 2024년 8월 19일까지 리워드를 지급할 예정입니다.
)} - {surveyId === 'c7b29789-54e9-46b6-a896-5ab29e5a30a6' && ( - <> -
-
-

설문이용 이용 경험에 대해 이야기해주세요!

- - https://forms.gle/zrCakugWRjredYq89 - -

- 위 설문까지 답변해 주신 분들 중 세 분을 추첨해 -
- 가장 많은 선택을 받은 치킨 기프티콘을 드립니다. -

-
-
- - )}
설문조사 첫 페이지로 설문이용 메인으로 From 0aa12e36ea203ecb7f85004d50c59c6f4b8b1101 Mon Sep 17 00:00:00 2001 From: yooshnn Date: Sat, 7 Sep 2024 00:22:59 +0900 Subject: [PATCH 005/120] =?UTF-8?q?[SBL-113]=20workbench=EC=9D=98=20?= =?UTF-8?q?=EC=84=A4=EB=AC=B8=20=EC=9E=91=EC=84=B1=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=A4=91=20=EC=9C=A0=ED=98=95=20=EB=B3=80=EA=B2=BD=20=EC=99=B8?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.json | 3 +- next.config.mjs | 5 +- package-lock.json | 219 +++++++++++++++- package.json | 7 +- src/app/(main)/workbench/[surveyId]/page.tsx | 22 -- src/app/workbench/[id]/layout.module.css | 3 + src/app/workbench/[id]/layout.tsx | 11 + src/app/workbench/[id]/page.module.css | 21 ++ src/app/workbench/[id]/page.tsx | 117 +++++++++ src/components/workbench/Canvas.module.css | 11 + src/components/workbench/Canvas.tsx | 64 +++++ src/components/workbench/Field.module.css | 236 ++++++++++++++++++ src/components/workbench/Field.tsx | 227 +++++++++++++++++ src/components/workbench/Header.module.css | 100 ++++++++ src/components/workbench/Header.tsx | 52 ++++ src/components/workbench/Section.module.css | 83 ++++++ src/components/workbench/Section.tsx | 98 ++++++++ src/components/workbench/Svg.tsx | 22 ++ src/components/workbench/Toolbar.module.css | 31 +++ src/components/workbench/Toolbar.tsx | 61 +++++ .../workbench/basic-info/BasicInfo.module.css | 44 ---- .../workbench/basic-info/BasicInfo.tsx | 29 --- .../basic-info/inputs/CloseDate.module.css | 53 ---- .../workbench/basic-info/inputs/CloseDate.tsx | 70 ------ .../inputs/FinishMessage.module.css | 33 --- .../basic-info/inputs/FinishMessage.tsx | 15 -- .../inputs/ParticipantionLimit.module.css | 33 --- .../basic-info/inputs/ParticipationLimit.tsx | 35 --- .../basic-info/inputs/Rewards.module.css | 21 -- .../workbench/basic-info/inputs/Rewards.tsx | 15 -- .../basic-info/inputs/Title.module.css | 37 --- .../workbench/basic-info/inputs/Title.tsx | 24 -- src/components/workbench/nav/Nav.module.css | 67 ----- src/components/workbench/nav/Nav.tsx | 35 --- src/store/index.ts | 235 +++++++++++++++++ src/store/types.ts | 63 +++++ 36 files changed, 1657 insertions(+), 545 deletions(-) delete mode 100644 src/app/(main)/workbench/[surveyId]/page.tsx create mode 100644 src/app/workbench/[id]/layout.module.css create mode 100644 src/app/workbench/[id]/layout.tsx create mode 100644 src/app/workbench/[id]/page.module.css create mode 100644 src/app/workbench/[id]/page.tsx create mode 100644 src/components/workbench/Canvas.module.css create mode 100644 src/components/workbench/Canvas.tsx create mode 100644 src/components/workbench/Field.module.css create mode 100644 src/components/workbench/Field.tsx create mode 100644 src/components/workbench/Header.module.css create mode 100644 src/components/workbench/Header.tsx create mode 100644 src/components/workbench/Section.module.css create mode 100644 src/components/workbench/Section.tsx create mode 100644 src/components/workbench/Svg.tsx create mode 100644 src/components/workbench/Toolbar.module.css create mode 100644 src/components/workbench/Toolbar.tsx delete mode 100644 src/components/workbench/basic-info/BasicInfo.module.css delete mode 100644 src/components/workbench/basic-info/BasicInfo.tsx delete mode 100644 src/components/workbench/basic-info/inputs/CloseDate.module.css delete mode 100644 src/components/workbench/basic-info/inputs/CloseDate.tsx delete mode 100644 src/components/workbench/basic-info/inputs/FinishMessage.module.css delete mode 100644 src/components/workbench/basic-info/inputs/FinishMessage.tsx delete mode 100644 src/components/workbench/basic-info/inputs/ParticipantionLimit.module.css delete mode 100644 src/components/workbench/basic-info/inputs/ParticipationLimit.tsx delete mode 100644 src/components/workbench/basic-info/inputs/Rewards.module.css delete mode 100644 src/components/workbench/basic-info/inputs/Rewards.tsx delete mode 100644 src/components/workbench/basic-info/inputs/Title.module.css delete mode 100644 src/components/workbench/basic-info/inputs/Title.tsx delete mode 100644 src/components/workbench/nav/Nav.module.css delete mode 100644 src/components/workbench/nav/Nav.tsx create mode 100644 src/store/index.ts create mode 100644 src/store/types.ts diff --git a/.eslintrc.json b/.eslintrc.json index bfaedaa..530db29 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -31,6 +31,7 @@ "@typescript-eslint/camelcase": "off", "no-console": "warn", "react/require-default-props": "off", - "import/prefer-default-export": "off" + "import/prefer-default-export": "off", + "react/jsx-props-no-spreading": "off" } } diff --git a/next.config.mjs b/next.config.mjs index 4678774..a5079f6 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,7 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + reactStrictMode: false, + swcMinify: false, +}; export default nextConfig; diff --git a/package-lock.json b/package-lock.json index 1e5c13b..2b14a46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,21 +9,26 @@ "version": "0.1.0", "dependencies": { "@fingerprintjs/fingerprintjs-pro-react": "^2.6.3", + "@hello-pangea/dnd": "^16.6.0", "@next/third-parties": "^14.2.5", "@tanstack/react-query": "^5.50.1", "@tanstack/react-query-devtools": "^5.50.1", "cookies-next": "^4.2.1", + "immer": "^10.1.1", "ky": "^1.5.0", "next": "14.2.4", "react": "^18", "react-dom": "^18", "react-icons": "^5.2.1", - "react-toastify": "^10.0.5" + "react-toastify": "^10.0.5", + "uuid": "^10.0.0", + "zustand": "^4.5.5" }, "devDependencies": { "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^7.15.0", "@typescript-eslint/parser": "^7.15.0", "eslint": "^8.57.0", @@ -56,6 +61,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@babel/runtime": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.6.tgz", + "integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -139,6 +155,24 @@ "tslib": "^2.6.2" } }, + "node_modules/@hello-pangea/dnd": { + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/@hello-pangea/dnd/-/dnd-16.6.0.tgz", + "integrity": "sha512-vfZ4GydqbtUPXSLfAvKvXQ6xwRzIjUSjVU0Sx+70VOhc2xx6CdmJXJ8YhH70RpbTUGjxctslQTHul9sIOxCfFQ==", + "dependencies": { + "@babel/runtime": "^7.24.1", + "css-box-model": "^1.2.1", + "memoize-one": "^6.0.0", + "raf-schd": "^4.0.3", + "react-redux": "^8.1.3", + "redux": "^4.2.1", + "use-memo-one": "^1.1.3" + }, + "peerDependencies": { + "react": "^16.8.5 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.5 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -558,6 +592,15 @@ "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==" }, + "node_modules/@types/hoist-non-react-statics": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", + "integrity": "sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==", + "dependencies": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -576,14 +619,12 @@ "node_modules/@types/prop-types": { "version": "15.7.12", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", - "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==", - "dev": true + "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" }, "node_modules/@types/react": { "version": "18.3.3", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz", "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==", - "dev": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -593,11 +634,22 @@ "version": "18.3.0", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", - "dev": true, + "devOptional": true, "dependencies": { "@types/react": "*" } }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", + "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==" + }, + "node_modules/@types/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", + "dev": true + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "7.15.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.15.0.tgz", @@ -1465,6 +1517,14 @@ "node": ">= 8" } }, + "node_modules/css-box-model": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.1.tgz", + "integrity": "sha512-a7Vr4Q/kd/aw96bnJG332W9V9LkJO69JRcaCYDUqjp6/z0w6VcZjgAcTbgFxEPfBgdnAwlh3iwu+hLopa+flJw==", + "dependencies": { + "tiny-invariant": "^1.0.6" + } + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -1480,8 +1540,7 @@ "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/damerau-levenshtein": { "version": "1.0.8", @@ -3039,6 +3098,14 @@ "node": ">= 0.4" } }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "dependencies": { + "react-is": "^16.7.0" + } + }, "node_modules/human-signals": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", @@ -3072,6 +3139,15 @@ "node": ">= 4" } }, + "node_modules/immer": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/immer/-/immer-10.1.1.tgz", + "integrity": "sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -4032,6 +4108,11 @@ "node": "14 || >=16.14" } }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -4829,6 +4910,11 @@ } ] }, + "node_modules/raf-schd": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/raf-schd/-/raf-schd-4.0.3.tgz", + "integrity": "sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==" + }, "node_modules/react": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", @@ -4863,8 +4949,50 @@ "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, + "node_modules/react-redux": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.3.tgz", + "integrity": "sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==", + "dependencies": { + "@babel/runtime": "^7.12.1", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/use-sync-external-store": "^0.0.3", + "hoist-non-react-statics": "^3.3.2", + "react-is": "^18.0.0", + "use-sync-external-store": "^1.0.0" + }, + "peerDependencies": { + "@types/react": "^16.8 || ^17.0 || ^18.0", + "@types/react-dom": "^16.8 || ^17.0 || ^18.0", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0", + "react-native": ">=0.59", + "redux": "^4 || ^5.0.0-beta.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + }, + "redux": { + "optional": true + } + } + }, + "node_modules/react-redux/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" }, "node_modules/react-toastify": { "version": "10.0.5", @@ -4899,6 +5027,14 @@ "node": ">=8.10.0" } }, + "node_modules/redux": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", + "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", + "dependencies": { + "@babel/runtime": "^7.9.2" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", @@ -4920,6 +5056,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -5689,6 +5830,11 @@ "resolved": "https://registry.npmjs.org/third-party-capital/-/third-party-capital-1.0.20.tgz", "integrity": "sha512-oB7yIimd8SuGptespDAZnNkzIz+NWaJCu2RMsbs4Wmp9zSDUM8Nhi3s2OOcqYuv3mN4hitXc8DVx+LyUmbUDiA==" }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -5876,12 +6022,40 @@ "punycode": "^2.1.0" } }, + "node_modules/use-memo-one": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/use-memo-one/-/use-memo-one-1.1.3.tgz", + "integrity": "sha512-g66/K7ZQGYrI6dy8GLpVcMsBp4s17xNkYJVSMvTEevGy3nDxHOfE6z8BVE22+5G5x7t3+bhzrlTDB7ObrEE0cQ==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", + "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6108,6 +6282,33 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zustand": { + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.5.tgz", + "integrity": "sha512-+0PALYNJNgK6hldkgDq2vLrw5f6g/jCInz52n9RTpropGgeAf/ioFUCdtsjCqu4gNhW9D01rUQBROoRjdzyn2Q==", + "dependencies": { + "use-sync-external-store": "1.2.2" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0.6", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } } } } diff --git a/package.json b/package.json index 8a8335e..783f71b 100644 --- a/package.json +++ b/package.json @@ -11,21 +11,26 @@ }, "dependencies": { "@fingerprintjs/fingerprintjs-pro-react": "^2.6.3", + "@hello-pangea/dnd": "^16.6.0", "@next/third-parties": "^14.2.5", "@tanstack/react-query": "^5.50.1", "@tanstack/react-query-devtools": "^5.50.1", "cookies-next": "^4.2.1", + "immer": "^10.1.1", "ky": "^1.5.0", "next": "14.2.4", "react": "^18", "react-dom": "^18", "react-icons": "^5.2.1", - "react-toastify": "^10.0.5" + "react-toastify": "^10.0.5", + "uuid": "^10.0.0", + "zustand": "^4.5.5" }, "devDependencies": { "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^7.15.0", "@typescript-eslint/parser": "^7.15.0", "eslint": "^8.57.0", diff --git a/src/app/(main)/workbench/[surveyId]/page.tsx b/src/app/(main)/workbench/[surveyId]/page.tsx deleted file mode 100644 index 41fafb7..0000000 --- a/src/app/(main)/workbench/[surveyId]/page.tsx +++ /dev/null @@ -1,22 +0,0 @@ -'use client'; - -import { useState } from 'react'; -import { Nav } from '@/components/workbench/nav/Nav'; -import { BasicInfo } from '@/components/workbench/basic-info/BasicInfo'; -import { useWorkbenchSurvey } from '@/services/workbench'; - -export default function Page({ params }: { params: { surveyId: string } }) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { surveyId } = params; - - const [activeNav, setActiveNav] = useState(0); - const { data } = useWorkbenchSurvey(surveyId); - - return ( - <> -