From ef949a6242c2710c73d68c7f6286f9fd912edf05 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 10 Dec 2025 16:24:49 +0900 Subject: [PATCH] =?UTF-8?q?251210=5F01=5FENH=20:=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=20=EC=88=98=EC=A0=95,=20=EC=97=90=EB=94=94?= =?UTF-8?q?=ED=84=B0=20=EA=B5=AC=ED=98=84=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 5 +- .env.local | 5 +- .env.production | 5 +- package-lock.json | 981 +++++++- package.json | 22 +- src/app/(pages)/(main)/ProjectTableColumn.tsx | 53 + src/app/(pages)/(main)/layout.tsx | 10 +- src/app/(pages)/(main)/list/manage/page.tsx | 18 +- .../(main)/manage/user/UserTableColumn.tsx | 11 +- src/app/(pages)/(main)/manage/user/page.tsx | 52 +- src/app/(pages)/(main)/page.tsx | 244 +- .../(main)/project/ProjectTableColumn.tsx | 0 src/app/(pages)/(main)/project/info/page.tsx | 482 +++- src/app/(pages)/login/page.tsx | 6 +- src/app/(pages)/logout/page.tsx | 5 +- src/app/api/assign/[[...slug]]/route.ts | 46 + src/app/api/external/[[...slug]]/route.ts | 1 + src/app/api/intranet/[[...slug]]/route.ts | 35 + src/app/api/kart/[[...slug]]/route.ts | 28 + src/app/api/logout/[[...slug]]/route.ts | 1 - src/app/api/project/[[...slug]]/route.ts | 62 +- src/app/api/user/[[...slug]]/route.ts | 9 +- src/app/layout.tsx | 2 + src/components/common/KriAutoComplete.tsx | 232 +- src/components/common/LoadingOverlay.tsx | 4 +- src/components/data-table/DataTable.tsx | 43 +- src/components/data-table/DataTable.type.ts | 8 +- .../data-table/hooks/usePreventClickOnDrag.ts | 48 + src/components/dialog/ProjectCreateDialog.tsx | 269 +++ src/components/dialog/ResultCodeDialog.tsx | 325 +++ src/components/dialog/UserUpsertDialog.tsx | 10 +- src/components/layout/BodyTitle.tsx | 2 +- src/components/layout/Header.tsx | 12 +- src/components/layout/MainLayout.tsx | 43 +- src/components/layout/ProjectTitle.tsx | 17 + src/components/layout/Sidebar.tsx | 16 +- .../layout/SidebarProjectSearch .tsx | 63 + src/components/ui/multi-select.tsx | 2076 +++++++++-------- src/components/ui/tabs.tsx | 66 + src/config/commonConst.ts | 12 - src/const/commonConst.ts | 8 + src/const/projectConst.ts | 62 + src/const/userConst.ts | 8 + src/hooks/useDebouncedValue.ts | 12 + src/hooks/useFontSize.ts | 6 +- src/hooks/useItrntUserList.ts | 109 + src/hooks/useMounted.ts | 7 + src/lib/env.server.ts | 3 + src/lib/http-util.ts | 6 +- src/lib/server-api.ts | 18 +- src/lib/utils.ts | 15 + src/store/jotai/dialog.ts | 9 +- src/store/jotai/project.ts | 9 +- src/store/storage/storage-keys.ts | 2 + src/types/common.ts | 14 +- src/types/project.ts | 70 + src/types/user.ts | 19 +- 57 files changed, 4459 insertions(+), 1247 deletions(-) create mode 100644 src/app/(pages)/(main)/ProjectTableColumn.tsx delete mode 100644 src/app/(pages)/(main)/project/ProjectTableColumn.tsx create mode 100644 src/app/api/assign/[[...slug]]/route.ts create mode 100644 src/app/api/external/[[...slug]]/route.ts create mode 100644 src/app/api/intranet/[[...slug]]/route.ts create mode 100644 src/app/api/kart/[[...slug]]/route.ts create mode 100644 src/components/data-table/hooks/usePreventClickOnDrag.ts create mode 100644 src/components/dialog/ProjectCreateDialog.tsx create mode 100644 src/components/dialog/ResultCodeDialog.tsx create mode 100644 src/components/layout/ProjectTitle.tsx create mode 100644 src/components/layout/SidebarProjectSearch .tsx create mode 100644 src/components/ui/tabs.tsx delete mode 100644 src/config/commonConst.ts create mode 100644 src/const/commonConst.ts create mode 100644 src/const/projectConst.ts create mode 100644 src/const/userConst.ts create mode 100644 src/hooks/useDebouncedValue.ts create mode 100644 src/hooks/useItrntUserList.ts create mode 100644 src/hooks/useMounted.ts create mode 100644 src/types/project.ts diff --git a/.env.development b/.env.development index 8e65165..7ad87b6 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,7 @@ NEXT_PUBLIC_ENV=dev NEXT_PUBLIC_API_BASE=http://localhost:3000/api ENV=dev -API_CONTACT_SERVER=http://localhost:4001/api/v1 \ No newline at end of file +API_CONTACT_SERVER=http://localhost:4001/api/v1 +API_INTRANET_SERVER=http://localhost:3031/api/v1 +API_KART_SERVER=https://rapi.kric.com/api/v1 +KART_API_KEY=4B726963-436F6E74616374-46726F6E74-402531213230 \ No newline at end of file diff --git a/.env.local b/.env.local index 1e16a78..db36704 100644 --- a/.env.local +++ b/.env.local @@ -2,4 +2,7 @@ NEXT_PUBLIC_ENV=local NEXT_PUBLIC_API_BASE=http://localhost:3000/api ENV=local -API_CONTACT_SERVER=http://localhost:4001/api/v1 \ No newline at end of file +API_CONTACT_SERVER=http://localhost:4001/api/v1 +API_INTRANET_SERVER=http://localhost:3031/api/v1 +API_KART_SERVER=https://rapi.kric.com/api/v1 +KART_API_KEY=4B726963-436F6E74616374-46726F6E74-402531213230 \ No newline at end of file diff --git a/.env.production b/.env.production index a685e76..82d6537 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,7 @@ NEXT_PUBLIC_ENV=prod NEXT_PUBLIC_API_BASE=http://localhost:3000/api ENV=prod -API_CONTACT_SERVER=http://localhost:4001/api/v1 \ No newline at end of file +API_CONTACT_SERVER=http://localhost:4001/api/v1 +API_INTRANET_SERVER=http://localhost:3031/api/v1 +API_KART_SERVER=https://rapi.kric.com/api/v1 +KART_API_KEY=4B726963-436F6E74616374-46726F6E74-402531213230 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e150bbe..5c3a5e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,21 @@ "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-separator": "^1.1.8", "@radix-ui/react-slot": "^1.2.4", + "@radix-ui/react-tabs": "^1.1.13", "@tanstack/react-table": "^8.21.3", + "@tiptap/extension-color": "^3.12.0", + "@tiptap/extension-image": "^3.12.0", + "@tiptap/extension-link": "^3.13.0", + "@tiptap/extension-placeholder": "^3.12.0", + "@tiptap/extension-table": "^3.13.0", + "@tiptap/extension-table-cell": "^3.13.0", + "@tiptap/extension-table-header": "^3.13.0", + "@tiptap/extension-table-row": "^3.13.0", + "@tiptap/extension-text-align": "^3.13.0", + "@tiptap/extension-text-style": "^3.12.0", + "@tiptap/extension-underline": "^3.12.0", + "@tiptap/react": "^3.12.0", + "@tiptap/starter-kit": "^3.12.0", "@types/lodash": "^4.17.21", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", @@ -25,10 +39,10 @@ "jotai": "^2.15.1", "lodash": "^4.17.21", "lucide-react": "^0.553.0", - "next": "16.0.2", + "next": "^16.0.7", "next-themes": "^0.4.6", - "react": "19.2.0", - "react-dom": "19.2.0", + "react": "^19.2.1", + "react-dom": "^19.2.1", "sonner": "^2.0.7", "tailwind-merge": "^3.4.0" }, @@ -40,7 +54,7 @@ "@types/react-dom": "^19", "babel-plugin-react-compiler": "1.0.0", "eslint": "^9", - "eslint-config-next": "16.0.2", + "eslint-config-next": "^16.0.7", "tailwindcss": "^4", "tw-animate-css": "^1.4.0", "typescript": "^5" @@ -1027,23 +1041,23 @@ } }, "node_modules/@next/env": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/env/-/env-16.0.2.tgz", - "integrity": "sha512-V2e9ITU6Ts9kxtTBX60qtWlKV+AeBNlz/hgAt0gkGA8aPgX27cRLjp7OEUMzYq4cY0QzOkOQ4CI/8IJh6kW/iw==" + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/env/-/env-16.0.7.tgz", + "integrity": "sha512-gpaNgUh5nftFKRkRQGnVi5dpcYSKGcZZkQffZ172OrG/XkrnS7UBTQ648YY+8ME92cC4IojpI2LqTC8sTDhAaw==" }, "node_modules/@next/eslint-plugin-next": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.0.2.tgz", - "integrity": "sha512-xYPCH5pE0QOhQ9AFM4itZgO3YtZz/0/h37L0cbZ2a3s/ePVN9VsZqpDYaZvxH33Vejp//fdvE1Iv8Ra6DUqjjA==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.0.7.tgz", + "integrity": "sha512-hFrTNZcMEG+k7qxVxZJq3F32Kms130FAhG8lvw2zkKBgAcNOJIxlljNiCjGygvBshvaGBdf88q2CqWtnqezDHA==", "dev": true, "dependencies": { "fast-glob": "3.3.1" } }, "node_modules/@next/swc-darwin-arm64": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.0.2.tgz", - "integrity": "sha512-E6rxUdkZX5sZjLduXphiMuRJAmvsxWi5IivD0kRLLX5cjNLOs2PjlSyda+dtT3iqE6vxaRGV3oQMnQiJU8F+Ig==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.0.7.tgz", + "integrity": "sha512-LlDtCYOEj/rfSnEn/Idi+j1QKHxY9BJFmxx7108A6D8K0SB+bNgfYQATPk/4LqOl4C0Wo3LACg2ie6s7xqMpJg==", "cpu": [ "arm64" ], @@ -1056,9 +1070,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.0.2.tgz", - "integrity": "sha512-QNXdjXVFtb35vImDJtXqYlhq8A2mHLroqD8q4WCwO+IVnVoQshhcEVWJlP9UB/dOC6Wh782BbTHqGzKQwlCSkQ==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.0.7.tgz", + "integrity": "sha512-rtZ7BhnVvO1ICf3QzfW9H3aPz7GhBrnSIMZyr4Qy6boXF0b5E3QLs+cvJmg3PsTCG2M1PBoC+DANUi4wCOKXpA==", "cpu": [ "x64" ], @@ -1071,9 +1085,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.0.2.tgz", - "integrity": "sha512-dM9yEB35GZAW3r+w88iGEz7OkJjSYSd4pKyl4KwSXx8cLWMpWaX1WW42dCAKXCWWQhVUXUZAEx38yfpEZ1/IJg==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.0.7.tgz", + "integrity": "sha512-mloD5WcPIeIeeZqAIP5c2kdaTa6StwP4/2EGy1mUw8HiexSHGK/jcM7lFuS3u3i2zn+xH9+wXJs6njO7VrAqww==", "cpu": [ "arm64" ], @@ -1086,9 +1100,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.0.2.tgz", - "integrity": "sha512-hiNysPK1VeK5MGNmuKLnj3Y4lkaffvAlXin404QpxYkNCBms/Bk0msZHey5lUNq8FV50PY6I9CgY+c/NK+xeLg==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.0.7.tgz", + "integrity": "sha512-+ksWNrZrthisXuo9gd1XnjHRowCbMtl/YgMpbRvFeDEqEBd523YHPWpBuDjomod88U8Xliw5DHhekBC3EOOd9g==", "cpu": [ "arm64" ], @@ -1101,9 +1115,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.0.2.tgz", - "integrity": "sha512-hAhhobw4tHOCzZ5sm5W/EsQPxS3NbZl6rqzmA0GTV9etE8sPHmsV6OopP12TeeoXA/NjXKD2mcz8hcVWLe4jkg==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.0.7.tgz", + "integrity": "sha512-4WtJU5cRDxpEE44Ana2Xro1284hnyVpBb62lIpU5k85D8xXxatT+rXxBgPkc7C1XwkZMWpK5rXLXTh9PFipWsA==", "cpu": [ "x64" ], @@ -1116,9 +1130,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.0.2.tgz", - "integrity": "sha512-s0LUsoeRky95aTS6IfYnJOn6F5kbs+gjiVUQK0JmsJ/ZCXaply20kDoJ8/zHwMz5cyOVg7GrQJdMvyO9FLD9Bw==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.0.7.tgz", + "integrity": "sha512-HYlhqIP6kBPXalW2dbMTSuB4+8fe+j9juyxwfMwCe9kQPPeiyFn7NMjNfoFOfJ2eXkeQsoUGXg+O2SE3m4Qg2w==", "cpu": [ "x64" ], @@ -1131,9 +1145,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.0.2.tgz", - "integrity": "sha512-TMWE1h44d0WRyq0yQI/0W5A7nZUoiwE2Sdg43wt2Q1IoadU5Ky00G3cJ2mSnbetwL7+eFyM7BQgx+Fonpz6T8w==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.0.7.tgz", + "integrity": "sha512-EviG+43iOoBRZg9deGauXExjRphhuYmIOJ12b9sAPy0eQ6iwcPxfED2asb/s2/yiLYOdm37kPaiZu8uXSYPs0Q==", "cpu": [ "arm64" ], @@ -1146,9 +1160,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.0.2.tgz", - "integrity": "sha512-+8SqzDhau/PNsWdcagnoz6ltOM9IcsqagdTFsEELNOty0+lNh5hwO5oUFForPOywTbM+d3tPLo5m20VdEBDf3Q==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.0.7.tgz", + "integrity": "sha512-gniPjy55zp5Eg0896qSrf3yB1dw4F/3s8VK1ephdsZZ129j2n6e1WqCbE2YgcKhW9hPB9TVZENugquWJD5x0ug==", "cpu": [ "x64" ], @@ -1876,6 +1890,35 @@ } } }, + "node_modules/@radix-ui/react-tabs": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.13.tgz", + "integrity": "sha512-7xdcatg7/U+7+Udyoj2zodtI9H/IIopqo+YOIcZOq1nJwXWBZ9p8xiu5llXlekDbZkca79a/fozEYQXIA4sW6A==", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-presence": "1.1.5", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-roving-focus": "1.1.11", + "@radix-ui/react-use-controllable-state": "1.2.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-use-callback-ref": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.1.tgz", @@ -2031,6 +2074,11 @@ "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.1.tgz", "integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==" }, + "node_modules/@remirror/core-constants": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@remirror/core-constants/-/core-constants-3.0.0.tgz", + "integrity": "sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==" + }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", @@ -2332,6 +2380,521 @@ "url": "https://github.com/sponsors/tannerlinsley" } }, + "node_modules/@tiptap/core": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-3.13.0.tgz", + "integrity": "sha512-iUelgiTMgPVMpY5ZqASUpk8mC8HuR9FWKaDzK27w9oWip9tuB54Z8mePTxNcQaSPb6ErzEaC8x8egrRt7OsdGQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-blockquote": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-3.12.0.tgz", + "integrity": "sha512-4azSdQodLIuQu+AvaDw7bCwLO2b5rFdL9hoqye8RNVckEiuZnLi8bRQ0Oiz7FMJp7OvuqHvl6+mRt1D7S8Bd/A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-bold": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-3.12.0.tgz", + "integrity": "sha512-XH6BaC2HRkPaM7QdpThVtqlLDsWgjOjRc20JKBQIhH6+KFcSb4KiyRExVUdKqueTcSZwSGlu9/4uaecu3Ref4g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-bubble-menu": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.12.0.tgz", + "integrity": "sha512-l6PleGtsN8Nk6CS2DX9AWET2vf1eD97bzUpmF8rcF2XNRDJIcLnductBxmdm0t/Icr6sgxEBnJ4E2kIB9IeX4w==", + "optional": true, + "dependencies": { + "@floating-ui/dom": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0", + "@tiptap/pm": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-bullet-list": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-3.12.0.tgz", + "integrity": "sha512-mNwu2TJOBjQjfxe2uW7hCjHei9XfH6irvvN/F09biv6QcNt7lG3PL15f8IEpAJD86yshIGH184BOvWM3RLYI+Q==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-code": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-3.12.0.tgz", + "integrity": "sha512-6e5tAIfBBfA693VkHyGSEdIwGv59l9zIsajguJqON9En6bd9L6UFKaCZV8NUZtMxc64Yr3rMtdwBacsrhX2BoQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-code-block": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-3.12.0.tgz", + "integrity": "sha512-NYZ2EbcHgxsOvxNqAFnkQTDMyJeMZFgPq9WUxD71vzXjHCRjWvWI2rtbaNGpQcYV6h4gXgOeOTgYWycrQDbHew==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0", + "@tiptap/pm": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-color": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-color/-/extension-color-3.12.0.tgz", + "integrity": "sha512-QyxZCrd48SV/iB9ZjKmyEmII1IBm/SpDjXeQXmM8H5pORqMEgJ3MdF/I88SGeKRYWNjBA9hkt6ZWv/sVYvFz8Q==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-text-style": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-document": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-3.12.0.tgz", + "integrity": "sha512-dxRXot8sC9gBKGs99ehSS1UfWAH48mBrFMF8xlayPKuc75IO8GRen78uU8h73FLlKip5TDqRZUpBU3/d3WlBxQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-dropcursor": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-3.12.0.tgz", + "integrity": "sha512-bmCe0Sg7FkbNsJ/xea6iOgWY4MNkWe0U7Mq4C4eWW2gUfCfkXUKKpsPizwc7knduAy+/HqrpM2wr+VdKiIf7tA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extensions": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-floating-menu": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-3.12.0.tgz", + "integrity": "sha512-0aSUvJbO8H2DeiDYV5eC90JjM89RVs7nK+ljpGwy0W3W11Ho2uMGS1eznCfR4sLZW4HKTNIjyHIxq18ESIKSGQ==", + "optional": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@floating-ui/dom": "^1.0.0", + "@tiptap/core": "^3.12.0", + "@tiptap/pm": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-gapcursor": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-3.12.0.tgz", + "integrity": "sha512-A3sjuiqnzqPOOvkgkeKs1vP4YsTC7e6ThbVBNhcP4sOD++CFERUh9nxFw0iEEbDR1BnITaKpC3v06SkdjS94oQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extensions": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-hard-break": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-3.12.0.tgz", + "integrity": "sha512-vSkdduLS8XKFl6rLQphxtIz8Qr4xlIKwVTvE39jsTLxuMAlxWWdJgSQtMSL1udLNOVZjHN7nNf8F3qmzOp7QBQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-heading": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-3.12.0.tgz", + "integrity": "sha512-lXpamseuGEiLWjjVxT5HXgDem/sjVuqiRPOs+BcG+p+545Dig0sehxmD/2ZYBe0lgoWlh3R9iIwaYCQfrmrwtw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-horizontal-rule": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-3.12.0.tgz", + "integrity": "sha512-OGbkDNqZPhxG0EpGa6I8l2Fy98Tuccr+nLoeAazxu5YzlUma34KtTNGZdo+38VU7giddr7zIHRJKJNt0hrOz5g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0", + "@tiptap/pm": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-image": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-3.12.0.tgz", + "integrity": "sha512-E+nQmMaHdR5SFDuIZUEdfaaNmRuO47V2KQIIOUT6BIxXkArixaKIIz/BKtzYq4pKySkHWL1niYe5lfZWVmEXaw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-italic": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-3.12.0.tgz", + "integrity": "sha512-duCzXPP4PeQbNdGvKQT0V10/2LNEn3qpwlJraGl5M+7s2samADK4rQ7buv4EaO9BgmVlg8iHlGPwXoKWmoSOfQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-link": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-link/-/extension-link-3.13.0.tgz", + "integrity": "sha512-LuFPJ5GoL12GHW4A+USsj60O90pLcwUPdvEUSWewl9USyG6gnLnY/j5ZOXPYH7LiwYW8+lhq7ABwrDF2PKyBbA==", + "dependencies": { + "linkifyjs": "^4.3.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-list": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list/-/extension-list-3.12.0.tgz", + "integrity": "sha512-RCQb3MPsTsKZZ8Wf0maMnfcICcmYEbMfWJMUNwVUJCfEv1hGiA5J7jMEJWr7z6kH2ULDHmrkhg6BYCdLrJap/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0", + "@tiptap/pm": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-list-item": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-3.12.0.tgz", + "integrity": "sha512-8I/NLZ34Yy/gpmSk95GjAmNhgxIFuCl6FRTYVHahtoUVUkHlWK0TJJqK0ykpz94GzNTvmpXGe5GUXIO8avf5Cw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-list-keymap": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-keymap/-/extension-list-keymap-3.12.0.tgz", + "integrity": "sha512-gDTecgWgztBfPjUzLYosHQYoyMw3gAEEJ3Yd67dHiijuaarjJ0buWdKg+uJ/ZnD15bP2D4ug4M9zgnPDq5llzQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-ordered-list": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-3.12.0.tgz", + "integrity": "sha512-5oRfBW5F89b4EKE/N0FiXF2n2eyWXB6uGpMkXdowMmPUVjWPVnmf+dTIW/XM8qQxyInh7m0eXPFXYkt9vdB+Vg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-paragraph": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-3.12.0.tgz", + "integrity": "sha512-J8HPJajgV0cIkA4wK7wBNJSpiNmi5Vd/Ii94hi6wpCbIdMMkfj8ngeXzVjVO/6Hpm2Xyr21OPbv2g3I6pgVAGA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-placeholder": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-placeholder/-/extension-placeholder-3.12.0.tgz", + "integrity": "sha512-fYG48/nQ384BSVdfGm+GZW5Jly8Ey/XBjsFTAmNiOi77zhqGpifNBFEMi3PrkxyQSKNm5Mkif8ZuJDQmQ9MmwA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extensions": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-strike": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-3.12.0.tgz", + "integrity": "sha512-OSR9SB3ycrKH0gCUkCWdd0IoNCp15xpbV0h7D8ElQBZ249c/FZrm6kGwB25fzdyA8ZlTpWrfwnoHxmMcOCMVIg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-table": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-table/-/extension-table-3.13.0.tgz", + "integrity": "sha512-LcH9KE4QBUJ6IPwt1Uo5iU7zatFjUUvXbctIu2fKQ9nqJ7nNSFxRhkNyporVFkTWYH7/rb0qMoF1VxSUGefG5w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-table-cell": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-table-cell/-/extension-table-cell-3.13.0.tgz", + "integrity": "sha512-dBOPeLe2NqymZI8reS2yZRIcgfIYHudCq4lDWZBJ5NiMvoy0b/fVe1qYSP4EcfBQMpfgAP0E05bMB3C7p1kmkw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-table": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-table-header": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-table-header/-/extension-table-header-3.13.0.tgz", + "integrity": "sha512-ZA5lhcek0VlKupqj3WFgE6bj5vNRmxcpDqjYc6RWaxuva4dYfEQSqdlG+3a53Sr53le0grfBpolM8zJFCVYrcw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-table": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-table-row": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-table-row/-/extension-table-row-3.13.0.tgz", + "integrity": "sha512-FdsMTIBNleZtWJEhXE/PBxkB8L9YJtnKs7YZNesLKqLn6/sWZl+X5e5SAAN/N3DLOEAwNCa/m0C3A1DWGNz/tw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-table": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-text": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-3.12.0.tgz", + "integrity": "sha512-7AlIYbmEeT3zAYCWrPTunaZkyIWriJtEAmUzURlQVVKmNv6kCTyJcqX7N0Db8z8Z19UFHaVAODL8yXYde4QB/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-text-align": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-3.13.0.tgz", + "integrity": "sha512-hebIus9tdXWb+AmhO+LTeUxZLdb0tqwdeaL/0wYxJQR5DeCTlJe6huXacMD/BkmnlEpRhxzQH0FrmXAd0d4Wgg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-text-style": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text-style/-/extension-text-style-3.12.0.tgz", + "integrity": "sha512-VjA7p34EKivogIW8z4EWCMu+1iDrzPcf1oUWPBMdD2OTISY2iNJT2RLmZTMtRSdlZHz4vCWlbBwfKHoFT/ba5g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extension-underline": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-3.12.0.tgz", + "integrity": "sha512-Woh/nk1/7c31D14dIaU5i9d4NMK06TBeEA+uBidhZp+JAXVGMeQGm0K2iJxBXNvNrc6aKGlZ57W1o3CPUWOlWQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0" + } + }, + "node_modules/@tiptap/extensions": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/extensions/-/extensions-3.12.0.tgz", + "integrity": "sha512-N5ahZfeTBWROTNHFLmTW7sa6ZrZwvp/jJHyH7tcetXT+509vHVhX7yPoiLDt0fnXIDW7JrWI7jbRRmcKf79I2w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0", + "@tiptap/pm": "^3.12.0" + } + }, + "node_modules/@tiptap/pm": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-3.13.0.tgz", + "integrity": "sha512-WKR4ucALq+lwx0WJZW17CspeTpXorbIOpvKv5mulZica6QxqfMhn8n1IXCkDws/mCoLRx4Drk5d377tIjFNsvQ==", + "dependencies": { + "prosemirror-changeset": "^2.3.0", + "prosemirror-collab": "^1.3.1", + "prosemirror-commands": "^1.6.2", + "prosemirror-dropcursor": "^1.8.1", + "prosemirror-gapcursor": "^1.3.2", + "prosemirror-history": "^1.4.1", + "prosemirror-inputrules": "^1.4.0", + "prosemirror-keymap": "^1.2.2", + "prosemirror-markdown": "^1.13.1", + "prosemirror-menu": "^1.2.4", + "prosemirror-model": "^1.24.1", + "prosemirror-schema-basic": "^1.2.3", + "prosemirror-schema-list": "^1.5.0", + "prosemirror-state": "^1.4.3", + "prosemirror-tables": "^1.6.4", + "prosemirror-trailing-node": "^3.0.0", + "prosemirror-transform": "^1.10.2", + "prosemirror-view": "^1.38.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + } + }, + "node_modules/@tiptap/react": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/react/-/react-3.12.0.tgz", + "integrity": "sha512-ZKKOg8fjRg7dIkctve3OE2Sf19yIj6rf1aMd9mNLtOvv2HYd0MdtDJ8Bl3dMIOf2/OhafhvGSVEVGt76ye3W4Q==", + "dependencies": { + "@types/use-sync-external-store": "^0.0.6", + "fast-equals": "^5.3.3", + "use-sync-external-store": "^1.4.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "optionalDependencies": { + "@tiptap/extension-bubble-menu": "^3.12.0", + "@tiptap/extension-floating-menu": "^3.12.0" + }, + "peerDependencies": { + "@tiptap/core": "^3.12.0", + "@tiptap/pm": "^3.12.0", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "@types/react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@tiptap/starter-kit": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-3.12.0.tgz", + "integrity": "sha512-7MdEUl87JfIPM48kIJwijL1X12RRMhGms1d7m0faYZvgn+CAKC5uWx4650E/aTqTItqWTmQZGoLyKDiXqR7Nxw==", + "dependencies": { + "@tiptap/core": "^3.12.0", + "@tiptap/extension-blockquote": "^3.12.0", + "@tiptap/extension-bold": "^3.12.0", + "@tiptap/extension-bullet-list": "^3.12.0", + "@tiptap/extension-code": "^3.12.0", + "@tiptap/extension-code-block": "^3.12.0", + "@tiptap/extension-document": "^3.12.0", + "@tiptap/extension-dropcursor": "^3.12.0", + "@tiptap/extension-gapcursor": "^3.12.0", + "@tiptap/extension-hard-break": "^3.12.0", + "@tiptap/extension-heading": "^3.12.0", + "@tiptap/extension-horizontal-rule": "^3.12.0", + "@tiptap/extension-italic": "^3.12.0", + "@tiptap/extension-link": "^3.12.0", + "@tiptap/extension-list": "^3.12.0", + "@tiptap/extension-list-item": "^3.12.0", + "@tiptap/extension-list-keymap": "^3.12.0", + "@tiptap/extension-ordered-list": "^3.12.0", + "@tiptap/extension-paragraph": "^3.12.0", + "@tiptap/extension-strike": "^3.12.0", + "@tiptap/extension-text": "^3.12.0", + "@tiptap/extension-underline": "^3.12.0", + "@tiptap/extensions": "^3.12.0", + "@tiptap/pm": "^3.12.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + } + }, "node_modules/@tybys/wasm-util": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", @@ -2366,11 +2929,30 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==" + }, "node_modules/@types/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-FOvQ0YPD5NOfPgMzJihoT+Za5pdkDJWcbpuj1DjaKZIr/gxodQjY/uWEFlTNqW2ugXHUiL8lRQgw63dzKHZdeQ==" }, + "node_modules/@types/markdown-it": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", + "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", + "dependencies": { + "@types/linkify-it": "^5", + "@types/mdurl": "^2" + } + }, + "node_modules/@types/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==" + }, "node_modules/@types/node": { "version": "20.19.25", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.25.tgz", @@ -2384,7 +2966,6 @@ "version": "19.2.4", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.4.tgz", "integrity": "sha512-tBFxBp9Nfyy5rsmefN+WXc1JeW/j2BpBHFdLZbEVfs9wn3E3NRFxwV0pJg8M1qQAexFpvz73hJXFofV0ZAu92A==", - "devOptional": true, "dependencies": { "csstype": "^3.0.2" } @@ -2393,11 +2974,15 @@ "version": "19.2.3", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", - "devOptional": true, "peerDependencies": { "@types/react": "^19.2.0" } }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", + "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.46.4", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.4.tgz", @@ -2988,8 +3573,7 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/aria-hidden": { "version": "1.2.6", @@ -3450,6 +4034,11 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "devOptional": true }, + "node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==" + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -3472,8 +4061,7 @@ "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "devOptional": true + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/damerau-levenshtein": { "version": "1.0.8", @@ -3654,6 +4242,17 @@ "node": ">=10.13.0" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/es-abstract": { "version": "1.24.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", @@ -3836,7 +4435,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, "engines": { "node": ">=10" }, @@ -3904,12 +4502,12 @@ } }, "node_modules/eslint-config-next": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-16.0.2.tgz", - "integrity": "sha512-Qwa5u3dURmIz92heWj9tMWAra6Z2gFXAkd7Uy1xjyAsFByABDvHwk7OS9D24FHe3ZN+vzJlIE83YT39tCiysjg==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-16.0.7.tgz", + "integrity": "sha512-WubFGLFHfk2KivkdRGfx6cGSFhaQqhERRfyO8BRx+qiGPGp7WLKcPvYC4mdx1z3VhVRcrfFzczjjTrbJZOpnEQ==", "dev": true, "dependencies": { - "@next/eslint-plugin-next": "16.0.2", + "@next/eslint-plugin-next": "16.0.7", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.32.0", @@ -4253,6 +4851,14 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-equals": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.3.3.tgz", + "integrity": "sha512-/boTcHZeIAQ2r/tL11voclBHDeP9WPxLt+tyAbVSyyXuUFyh0Tne7gJZTqGbxnvj79TjLdCXLOY7UIPhyG5MTw==", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/fast-glob": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", @@ -5538,6 +6144,19 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, + "node_modules/linkifyjs": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.3.2.tgz", + "integrity": "sha512-NT1CJtq3hHIreOianA8aSXn6Cw0JzYOuDQbOrSPe7gqFnCpKP++MQe3ODgO3oh2GJFORkAAdqredOa60z63GbA==" + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -5602,6 +6221,22 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -5611,6 +6246,11 @@ "node": ">= 0.4" } }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==" + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -5699,11 +6339,11 @@ "dev": true }, "node_modules/next": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/next/-/next-16.0.2.tgz", - "integrity": "sha512-zL8+UBf+xUIm8zF0vYGJYJMYDqwaBrRRe7S0Kob6zo9Kf+BdqFLEECMI+B6cNIcoQ+el9XM2fvUExwhdDnXjtw==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/next/-/next-16.0.7.tgz", + "integrity": "sha512-3mBRJyPxT4LOxAJI6IsXeFtKfiJUbjCLgvXO02fV8Wy/lIhPvP94Fe7dGhUgHXcQy4sSuYwQNcOLhIfOm0rL0A==", "dependencies": { - "@next/env": "16.0.2", + "@next/env": "16.0.7", "@swc/helpers": "0.5.15", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", @@ -5716,14 +6356,14 @@ "node": ">=20.9.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "16.0.2", - "@next/swc-darwin-x64": "16.0.2", - "@next/swc-linux-arm64-gnu": "16.0.2", - "@next/swc-linux-arm64-musl": "16.0.2", - "@next/swc-linux-x64-gnu": "16.0.2", - "@next/swc-linux-x64-musl": "16.0.2", - "@next/swc-win32-arm64-msvc": "16.0.2", - "@next/swc-win32-x64-msvc": "16.0.2", + "@next/swc-darwin-arm64": "16.0.7", + "@next/swc-darwin-x64": "16.0.7", + "@next/swc-linux-arm64-gnu": "16.0.7", + "@next/swc-linux-arm64-musl": "16.0.7", + "@next/swc-linux-x64-gnu": "16.0.7", + "@next/swc-linux-x64-musl": "16.0.7", + "@next/swc-win32-arm64-msvc": "16.0.7", + "@next/swc-win32-x64-msvc": "16.0.7", "sharp": "^0.34.4" }, "peerDependencies": { @@ -5923,6 +6563,11 @@ "node": ">= 0.8.0" } }, + "node_modules/orderedmap": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-2.1.1.tgz", + "integrity": "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g==" + }, "node_modules/own-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", @@ -6080,6 +6725,183 @@ "react-is": "^16.13.1" } }, + "node_modules/prosemirror-changeset": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/prosemirror-changeset/-/prosemirror-changeset-2.3.1.tgz", + "integrity": "sha512-j0kORIBm8ayJNl3zQvD1TTPHJX3g042et6y/KQhZhnPrruO8exkTgG8X+NRpj7kIyMMEx74Xb3DyMIBtO0IKkQ==", + "dependencies": { + "prosemirror-transform": "^1.0.0" + } + }, + "node_modules/prosemirror-collab": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/prosemirror-collab/-/prosemirror-collab-1.3.1.tgz", + "integrity": "sha512-4SnynYR9TTYaQVXd/ieUvsVV4PDMBzrq2xPUWutHivDuOshZXqQ5rGbZM84HEaXKbLdItse7weMGOUdDVcLKEQ==", + "dependencies": { + "prosemirror-state": "^1.0.0" + } + }, + "node_modules/prosemirror-commands": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz", + "integrity": "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w==", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.10.2" + } + }, + "node_modules/prosemirror-dropcursor": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.2.tgz", + "integrity": "sha512-CCk6Gyx9+Tt2sbYk5NK0nB1ukHi2ryaRgadV/LvyNuO3ena1payM2z6Cg0vO1ebK8cxbzo41ku2DE5Axj1Zuiw==", + "dependencies": { + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0", + "prosemirror-view": "^1.1.0" + } + }, + "node_modules/prosemirror-gapcursor": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/prosemirror-gapcursor/-/prosemirror-gapcursor-1.4.0.tgz", + "integrity": "sha512-z00qvurSdCEWUIulij/isHaqu4uLS8r/Fi61IbjdIPJEonQgggbJsLnstW7Lgdk4zQ68/yr6B6bf7sJXowIgdQ==", + "dependencies": { + "prosemirror-keymap": "^1.0.0", + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-view": "^1.0.0" + } + }, + "node_modules/prosemirror-history": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.5.0.tgz", + "integrity": "sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg==", + "dependencies": { + "prosemirror-state": "^1.2.2", + "prosemirror-transform": "^1.0.0", + "prosemirror-view": "^1.31.0", + "rope-sequence": "^1.3.0" + } + }, + "node_modules/prosemirror-inputrules": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/prosemirror-inputrules/-/prosemirror-inputrules-1.5.1.tgz", + "integrity": "sha512-7wj4uMjKaXWAQ1CDgxNzNtR9AlsuwzHfdFH1ygEHA2KHF2DOEaXl1CJfNPAKCg9qNEh4rum975QLaCiQPyY6Fw==", + "dependencies": { + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.0.0" + } + }, + "node_modules/prosemirror-keymap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.3.tgz", + "integrity": "sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw==", + "dependencies": { + "prosemirror-state": "^1.0.0", + "w3c-keyname": "^2.2.0" + } + }, + "node_modules/prosemirror-markdown": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.13.2.tgz", + "integrity": "sha512-FPD9rHPdA9fqzNmIIDhhnYQ6WgNoSWX9StUZ8LEKapaXU9i6XgykaHKhp6XMyXlOWetmaFgGDS/nu/w9/vUc5g==", + "dependencies": { + "@types/markdown-it": "^14.0.0", + "markdown-it": "^14.0.0", + "prosemirror-model": "^1.25.0" + } + }, + "node_modules/prosemirror-menu": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/prosemirror-menu/-/prosemirror-menu-1.2.5.tgz", + "integrity": "sha512-qwXzynnpBIeg1D7BAtjOusR+81xCp53j7iWu/IargiRZqRjGIlQuu1f3jFi+ehrHhWMLoyOQTSRx/IWZJqOYtQ==", + "dependencies": { + "crelt": "^1.0.0", + "prosemirror-commands": "^1.0.0", + "prosemirror-history": "^1.0.0", + "prosemirror-state": "^1.0.0" + } + }, + "node_modules/prosemirror-model": { + "version": "1.25.4", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.25.4.tgz", + "integrity": "sha512-PIM7E43PBxKce8OQeezAs9j4TP+5yDpZVbuurd1h5phUxEKIu+G2a+EUZzIC5nS1mJktDJWzbqS23n1tsAf5QA==", + "dependencies": { + "orderedmap": "^2.0.0" + } + }, + "node_modules/prosemirror-schema-basic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/prosemirror-schema-basic/-/prosemirror-schema-basic-1.2.4.tgz", + "integrity": "sha512-ELxP4TlX3yr2v5rM7Sb70SqStq5NvI15c0j9j/gjsrO5vaw+fnnpovCLEGIcpeGfifkuqJwl4fon6b+KdrODYQ==", + "dependencies": { + "prosemirror-model": "^1.25.0" + } + }, + "node_modules/prosemirror-schema-list": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz", + "integrity": "sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q==", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.7.3" + } + }, + "node_modules/prosemirror-state": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.4.tgz", + "integrity": "sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw==", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-transform": "^1.0.0", + "prosemirror-view": "^1.27.0" + } + }, + "node_modules/prosemirror-tables": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.8.1.tgz", + "integrity": "sha512-DAgDoUYHCcc6tOGpLVPSU1k84kCUWTWnfWX3UDy2Delv4ryH0KqTD6RBI6k4yi9j9I8gl3j8MkPpRD/vWPZbug==", + "dependencies": { + "prosemirror-keymap": "^1.2.2", + "prosemirror-model": "^1.25.0", + "prosemirror-state": "^1.4.3", + "prosemirror-transform": "^1.10.3", + "prosemirror-view": "^1.39.1" + } + }, + "node_modules/prosemirror-trailing-node": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-3.0.0.tgz", + "integrity": "sha512-xiun5/3q0w5eRnGYfNlW1uU9W6x5MoFKWwq/0TIRgt09lv7Hcser2QYV8t4muXbEr+Fwo0geYn79Xs4GKywrRQ==", + "dependencies": { + "@remirror/core-constants": "3.0.0", + "escape-string-regexp": "^4.0.0" + }, + "peerDependencies": { + "prosemirror-model": "^1.22.1", + "prosemirror-state": "^1.4.2", + "prosemirror-view": "^1.33.8" + } + }, + "node_modules/prosemirror-transform": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.10.5.tgz", + "integrity": "sha512-RPDQCxIDhIBb1o36xxwsaeAvivO8VLJcgBtzmOwQ64bMtsVFh5SSuJ6dWSxO1UsHTiTXPCgQm3PDJt7p6IOLbw==", + "dependencies": { + "prosemirror-model": "^1.21.0" + } + }, + "node_modules/prosemirror-view": { + "version": "1.41.4", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.41.4.tgz", + "integrity": "sha512-WkKgnyjNncri03Gjaz3IFWvCAE94XoiEgvtr0/r2Xw7R8/IjK3sKLSiDoCHWcsXSAinVaKlGRZDvMCsF1kbzjA==", + "dependencies": { + "prosemirror-model": "^1.20.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -6089,6 +6911,14 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "engines": { + "node": ">=6" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -6110,22 +6940,22 @@ ] }, "node_modules/react": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", - "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", + "version": "19.2.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.1.tgz", + "integrity": "sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==", "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", - "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", + "version": "19.2.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.1.tgz", + "integrity": "sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==", "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { - "react": "^19.2.0" + "react": "^19.2.1" } }, "node_modules/react-is": { @@ -6290,6 +7120,11 @@ "node": ">=0.10.0" } }, + "node_modules/rope-sequence": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz", + "integrity": "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==" + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -7041,6 +7876,11 @@ "typescript": ">=4.8.4 <6.0.0" } }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==" + }, "node_modules/unbox-primitive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", @@ -7179,6 +8019,19 @@ } } }, + "node_modules/use-sync-external-store": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", + "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==" + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index db3cb01..6ae6fb5 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,21 @@ "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-separator": "^1.1.8", "@radix-ui/react-slot": "^1.2.4", + "@radix-ui/react-tabs": "^1.1.13", "@tanstack/react-table": "^8.21.3", + "@tiptap/extension-color": "^3.12.0", + "@tiptap/extension-image": "^3.12.0", + "@tiptap/extension-link": "^3.13.0", + "@tiptap/extension-placeholder": "^3.12.0", + "@tiptap/extension-table": "^3.13.0", + "@tiptap/extension-table-cell": "^3.13.0", + "@tiptap/extension-table-header": "^3.13.0", + "@tiptap/extension-table-row": "^3.13.0", + "@tiptap/extension-text-align": "^3.13.0", + "@tiptap/extension-text-style": "^3.12.0", + "@tiptap/extension-underline": "^3.12.0", + "@tiptap/react": "^3.12.0", + "@tiptap/starter-kit": "^3.12.0", "@types/lodash": "^4.17.21", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", @@ -26,10 +40,10 @@ "jotai": "^2.15.1", "lodash": "^4.17.21", "lucide-react": "^0.553.0", - "next": "16.0.2", + "next": "^16.0.7", "next-themes": "^0.4.6", - "react": "19.2.0", - "react-dom": "19.2.0", + "react": "^19.2.1", + "react-dom": "^19.2.1", "sonner": "^2.0.7", "tailwind-merge": "^3.4.0" }, @@ -41,7 +55,7 @@ "@types/react-dom": "^19", "babel-plugin-react-compiler": "1.0.0", "eslint": "^9", - "eslint-config-next": "16.0.2", + "eslint-config-next": "^16.0.7", "tailwindcss": "^4", "tw-animate-css": "^1.4.0", "typescript": "^5" diff --git a/src/app/(pages)/(main)/ProjectTableColumn.tsx b/src/app/(pages)/(main)/ProjectTableColumn.tsx new file mode 100644 index 0000000..8fe2fb3 --- /dev/null +++ b/src/app/(pages)/(main)/ProjectTableColumn.tsx @@ -0,0 +1,53 @@ +import {ProjectInfo} from "@/types/project"; +import {ColumnDef} from "@tanstack/react-table"; +import {Badge} from "@/components/ui/badge"; +import {cn, formatKst} from "@/lib/utils"; +import {PROJECT_STATUS_CLASS, PROJECT_STATUS_LABEL} from "@/const/projectConst"; +import {ItrntUserInfo} from "@/types/user"; + +export const getProjectColumns = (users:ItrntUserInfo[]): ColumnDef[] => [ + { + accessorKey: "prjctIdx", + header: "No", + enableSorting: true, + }, + { + accessorKey: "prjctCd", + header: "프로젝트 코드", + enableSorting: true, + }, + { + accessorKey: "prjctName", + header: "프로젝트 명", + enableSorting: true, + }, + { + accessorKey: "prjctStatus", + header: "진행 상태", + cell: ({row}) => ( + + {PROJECT_STATUS_LABEL[row.original.prjctStatus]} + + ) , + enableSorting: true, + }, + { + accessorKey: "ownerDept", + header: "담당 그룹", + enableSorting: true, + }, + { + accessorKey: "ownerFw", + header: "담당 실사", + enableSorting: true, + cell: ({row}) => ( + users.find(u => u.userId === row.original.ownerFw)?.userNm ?? "" + ) , + }, + { + accessorKey: "regDt", + header: "등록일", + cell: ({row}) => (formatKst(row.original.regDt ?? "", "date")), + enableSorting: true, + } +]; \ No newline at end of file diff --git a/src/app/(pages)/(main)/layout.tsx b/src/app/(pages)/(main)/layout.tsx index 3b66147..5b0cd18 100644 --- a/src/app/(pages)/(main)/layout.tsx +++ b/src/app/(pages)/(main)/layout.tsx @@ -2,17 +2,17 @@ import MainLayout from "@/components/layout/MainLayout"; import { cookies } from "next/headers"; import { redirect } from "next/navigation"; import {CookieKeys} from "@/store/cookie/cookie-keys"; -import commonConst from "@/config/commonConst"; +import {FONT_SIZE} from "@/const/commonConst"; function parseFontSize(raw: string | undefined | null) { - if (!raw) return commonConst.fontSizeMin; + if (!raw) return FONT_SIZE.MIN; const parsed = parseInt(raw, 10); - if (Number.isNaN(parsed)) return commonConst.fontSizeMin; + if (Number.isNaN(parsed)) return FONT_SIZE.MIN; return Math.min( - commonConst.fontSizeMax, - Math.max(commonConst.fontSizeMin, parsed), + FONT_SIZE.MAX, + Math.max(FONT_SIZE.MIN, parsed), ); } diff --git a/src/app/(pages)/(main)/list/manage/page.tsx b/src/app/(pages)/(main)/list/manage/page.tsx index b46d16e..d60be54 100644 --- a/src/app/(pages)/(main)/list/manage/page.tsx +++ b/src/app/(pages)/(main)/list/manage/page.tsx @@ -1,19 +1,23 @@ "use client"; import {useFontSizeValue} from "@/hooks/useFontSize"; -import {useEffect, useState} from "react"; +import {useMounted} from "@/hooks/useMounted"; +import {LoadingOverlay} from "@/components/common/LoadingOverlay"; +import BodyTitle from "@/components/layout/BodyTitle"; +import {useSelectedProject} from "@/hooks/useSelectedProject"; +import ProjectTitle from "@/components/layout/ProjectTitle"; const ListManagePage = () => { const fontSize = useFontSizeValue(); + const mounted = useMounted(); - const [mounted, setMounted] = useState(false); - - useEffect(() => setMounted(true), []); - if (!mounted) return null; + if (!mounted) return ; return ( -
- This is Manage List Page {fontSize} +
+
+ This is Manage List Page {fontSize} +
); }; diff --git a/src/app/(pages)/(main)/manage/user/UserTableColumn.tsx b/src/app/(pages)/(main)/manage/user/UserTableColumn.tsx index 6b579c1..fba8414 100644 --- a/src/app/(pages)/(main)/manage/user/UserTableColumn.tsx +++ b/src/app/(pages)/(main)/manage/user/UserTableColumn.tsx @@ -1,7 +1,9 @@ import {ColumnDef} from "@tanstack/react-table"; import {Button} from "@/components/ui/button"; import {Pencil, Trash2} from "lucide-react"; -import {UserTableInfo} from "@/types/user"; +import {UserInfo} from "@/types/user"; +import {formatKst} from "@/lib/utils"; +import {MultiSelectOption} from "@/components/ui/multi-select"; @@ -10,7 +12,7 @@ export type UserColumnsActions = { onDelete: (userId: string) => void } -export const getUserColumns = (actions: UserColumnsActions): ColumnDef[] => [ +export const getUserColumns = (actions: UserColumnsActions, userRoleArray:MultiSelectOption[]): ColumnDef[] => [ { accessorKey: "userId", header: "아이디", @@ -29,11 +31,16 @@ export const getUserColumns = (actions: UserColumnsActions): ColumnDef { + const role = userRoleArray.filter((r) => r.value === String(row.original.userRole)); + return role.length > 0 ? role[0].label : String(row.original.userRole); + }, enableSorting: true, }, { accessorKey: "regDt", header: "등록일", + cell: ({row}) => (formatKst(row.original.regDt ?? "", "date")), enableSorting: true, }, { diff --git a/src/app/(pages)/(main)/manage/user/page.tsx b/src/app/(pages)/(main)/manage/user/page.tsx index cbe79e2..f38684c 100644 --- a/src/app/(pages)/(main)/manage/user/page.tsx +++ b/src/app/(pages)/(main)/manage/user/page.tsx @@ -1,4 +1,5 @@ 'use client' + import {useEffect, useState} from "react"; import {Button} from "@/components/ui/button"; import {Input} from "@/components/ui/input"; @@ -7,7 +8,7 @@ import { DataTable } from "@/components/data-table/DataTable"; import { getUserColumns } from "./UserTableColumn"; import _ from "lodash"; import UserUpsertDialog from "@/components/dialog/UserUpsertDialog"; -import {UserInfo, UserInfoSaveRequest, UserTableInfo, UserUploadResponse} from "@/types/user"; +import {UserInfo, UserInfoSaveRequest, UserUploadResponse} from "@/types/user"; import UserUploadDialog from "@/components/dialog/UserUploadDialog"; import {useDialog} from "@/hooks/useDialog"; import {downloadBase64File, downloadFile, formatKst} from "@/lib/utils"; @@ -17,19 +18,21 @@ import {RoleInfo} from "@/types/role"; import {DataVerification} from "@/types/common"; import {apiError} from "@/lib/http-util"; import {KriMultiSelect} from "@/components/common/KriAutoComplete"; -import commonConst from "@/config/commonConst"; import {useAuth} from "@/hooks/useAuth"; import {MultiSelectOption} from "@/components/ui/multi-select"; +import {useMounted} from "@/hooks/useMounted"; +import {LoadingOverlay} from "@/components/common/LoadingOverlay"; +import {DEFAULT_COMPANY_NAME, EXTERNAL_USER_ROLE} from "@/const/userConst"; const UserManagePage = () => { const { showDialog } = useDialog(); + const mounted = useMounted(); const { withLoadingAsync } = useLoading(); const { auth } = useAuth(); - const [mounted, setMounted] = useState(false); - const [userList, setUserList] = useState([]); - const [viewList, setViewList] = useState([]); - const [selectedUserArray, setSelectedUserArray] = useState([]); + const [userList, setUserList] = useState([]); + const [viewList, setViewList] = useState([]); + const [selectedUserArray, setSelectedUserArray] = useState([]); const [userCmpnArray, setUserCmpnArray] = useState([]); const [userRoleArray, setUserRoleArray] = useState([]); @@ -52,19 +55,7 @@ const UserManagePage = () => { const cmpnList = await nextApi.get("/user/cmpn"); setUserCmpnArray(cmpnList); - const userData: UserTableInfo[] = (await nextApi.get("/user")).map((user) => { - const role = roleList.filter((r) => r.roleCd === user.userRole); - const roleName = role.length > 0 ? role[0].roleNm : String(user.userRole); - return { - userId: user.userId, - userCmpn: user.userCmpn, - userName: user.userName, - userRole: roleName, - regDt: formatKst(user.regDt ?? "", "date"), - memo: user.memo ?? "", - } - }); - + const userData = await nextApi.get("/user"); setUserList(userData); const cmpnArray = Array.from( @@ -159,14 +150,16 @@ const UserManagePage = () => { } } - const columns = getUserColumns({ - onEdit: handleEdit, - onDelete: handleDelete - }); + const columns = getUserColumns( + { + onEdit: handleEdit, + onDelete: handleDelete + }, + userRoleArray + ); useEffect(() => { withLoadingAsync(setUserData); - setMounted(true); }, []); useEffect(() => { @@ -183,7 +176,7 @@ const UserManagePage = () => { } if(searchRole.length > 0){ - tempData = tempData.filter((row) => searchRole.includes(row.userRole)); + tempData = tempData.filter((row) => searchRole.includes(String(row.userRole))); } setViewList(tempData); @@ -192,9 +185,11 @@ const UserManagePage = () => { const isInternal = mounted && auth.user?.userRole != null && - auth.user.userRole < commonConst.externalUserRole + auth.user.userRole < EXTERNAL_USER_ROLE - const userCmpn = auth.user?.userCmpn ?? commonConst.defaultCmpn; + const userCmpn = auth.user?.userCmpn ?? DEFAULT_COMPANY_NAME; + + if (!mounted) return ; return (
@@ -223,7 +218,7 @@ const UserManagePage = () => { items={userRoleArray} value={searchRole} onChange={setSearchRole} - getValue={(item) => item.label} + getValue={(item) => item.value} getLabel={(item) => item.label} placeholder="사용자 권한" widthClassName="w-70" @@ -250,7 +245,6 @@ const UserManagePage = () => { data={viewList} isClient={true} selectMode='single' - enableRowClickSelection={true} onRowSelectionChange={setSelectedUserArray} defaultPageSize={10} pageSizeOptions={[10, 20, 30, 50]} diff --git a/src/app/(pages)/(main)/page.tsx b/src/app/(pages)/(main)/page.tsx index 31f8cfb..3a84a69 100644 --- a/src/app/(pages)/(main)/page.tsx +++ b/src/app/(pages)/(main)/page.tsx @@ -1,8 +1,244 @@ -const MainPage = () => { - //const url = buildUrlWithParams("/login", searchParams, { ref: "root" }); - //redirect(url); +'use client' +import {useEffect, useRef, useState} from "react"; +import BodyTitle from "@/components/layout/BodyTitle"; +import {Button} from "@/components/ui/button"; +import {DataTable} from "@/components/data-table/DataTable"; +import {getProjectColumns} from "./ProjectTableColumn"; +import { + ProjectCreateRequest, + ProjectInfo, + ProjectListQuery, + ProjectListRequest, ProjectOwnerResponse, +} from "@/types/project"; +import {Input} from "@/components/ui/input"; +import {KriMultiSelect} from "@/components/common/KriAutoComplete"; +import {MultiSelectOption} from "@/components/ui/multi-select"; +import {PaginationState, SortingState} from "@tanstack/react-table"; +import {PageResponse} from "@/types/common"; +import ProjectCreateDialog from "@/components/dialog/ProjectCreateDialog"; +import {useDialog} from "@/hooks/useDialog"; +import {useLoading} from "@/hooks/useLoading"; +import {useAuth} from "@/hooks/useAuth"; +import {nextApi} from "@/lib/http-client"; +import {useSelectedProject} from "@/hooks/useSelectedProject"; +import {SelectedProject} from "@/store/jotai/project"; +import {useMounted} from "@/hooks/useMounted"; +import {LoadingOverlay} from "@/components/common/LoadingOverlay"; +import {FW_USER_ROLE} from "@/const/userConst"; +import {ProjectStatus} from "@/const/projectConst"; +import {useItrntUserList} from "@/hooks/useItrntUserList"; - return (
Hello, Next.JS
) +const MainPage = () => { + const { users, isLoading } = useItrntUserList(); + const { showDialog } = useDialog(); + const { withLoadingAsync } = useLoading(); + const mounted = useMounted(); + const { auth } = useAuth(); + const { clearSelectedProject, setSelectedProject } = useSelectedProject(); + + const [statusArray, setStatusArray] = useState([]); + const [deptArray, setDeptArray] = useState([]); + const [fwArray, setFwArray] = useState([]); + + const [searchText, setSearchText] = useState(''); + const [searchStatus, setSearchStatus] = useState([]); + const [searchDept, setSearchDept] = useState([]); + const [searchFw, setSearchFw] = useState([]); + + const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: 10 }); + const [sorting, setSorting] = useState([]); + const [query, setQuery] = useState(); + + const [viewList, setViewList] = useState([]); + const [pageCount, setPageCount] = useState(0); + const [totalCount, setTotalCount] = useState(0); + + const columns = getProjectColumns(users); + const userId = auth.user?.userId ?? ""; + const userRole = auth.user?.userRole ?? FW_USER_ROLE; + + const handleSearchClick = () => { + const searchStatusCode:ProjectStatus[] = searchStatus + .map((value) => Number(value)) + .filter((v): v is ProjectStatus => v !== undefined); + + setQuery({ + prjctText: searchText, + prjctStatusList: searchStatusCode, + ownerDeptList: searchDept, + ownerFwList: searchFw, + }); + + setPagination(prev => ({ ...prev, pageIndex: 0 })) + } + + const handleCreateClick = () => { + showDialog('projectCreateDialog'); + } + + const handleSubmit = async (data:ProjectCreateRequest): Promise => { + const projectInfo = await nextApi.put("/project", data); + setSelectedProject({ + prjctIdx: projectInfo.prjctIdx, + prjctCd: projectInfo.prjctCd, + prjctName: projectInfo.prjctName, + ownerDept: projectInfo.ownerDept, + ownerFw: projectInfo.ownerFw, + } as SelectedProject); + + window.location.href = `/project/info`; + } + + const handleClick = (projectInfo:ProjectInfo) => { + setSelectedProject({ + prjctIdx: projectInfo.prjctIdx, + prjctCd: projectInfo.prjctCd, + prjctName: projectInfo.prjctName, + ownerDept: projectInfo.ownerDept, + ownerFw: projectInfo.ownerFw, + } as SelectedProject); + + window.location.href = `/list/manage`; + } + + // 중복 호출 방지(초기 mount에서 pagination/sorting 콜백이 각각 한번씩 날아오는 케이스 방어) + const lastReqKeyRef = useRef(""); + + useEffect(() => { + const reqKey = JSON.stringify({ query, pagination, sorting}); + if (lastReqKeyRef.current === reqKey) return; + lastReqKeyRef.current = reqKey; + + const sort = sorting?.[0]; + const searchBody: ProjectListRequest = { + prjctText: query?.prjctText || "", + prjctStatusList: query?.prjctStatusList || [], + ownerDeptList: query?.ownerDeptList || [], + ownerFwList: query?.ownerFwList || [], + pageIndex: pagination.pageIndex, + pageSize: pagination.pageSize, + sortBy: sort?.id ?? "prjctIdx", + sortDir: sort?.desc ? "desc" : "asc" + } + + withLoadingAsync(() => + nextApi.post>("/project/list", searchBody) + .then((r) => { + setViewList(r.content); + setTotalCount(r.totalElements); + setPageCount(r.totalPages); + }) + .catch(() => { + setViewList([]); + setTotalCount(0); + setPageCount(0); + }) + ); + + }, [query, pagination, sorting]); + + useEffect(() => { + clearSelectedProject(); + + const options: MultiSelectOption[] = Object.entries(ProjectStatus) + .sort(([a], [b]) => Number(a) - Number(b)) + .map(([key, label]) => ({ value: key, label: String(label) })); + + setStatusArray(options); + + nextApi.get("/project/owner-list") + .then((res) => { + setDeptArray(res.ownerDeptList); + setFwArray(res.ownerFwList); + }); + }, []); + + if (!mounted || isLoading) return ; + + return ( +
+ + +
+
+ setSearchText(e.target.value)} + onKeyDown={(e) => { + if (e.key === "Enter") { + handleSearchClick(); + } + }} + /> + { + userRole < FW_USER_ROLE && + item.value} + getLabel={(item) => item.label} + placeholder="진행 상태" + widthClassName="w-60" + heightClassName="h-9" + /> + } + + + +
+ +
+ +
+ row.prjctCd} // row.id = userId + /> +
+ + +
+ ) } export default MainPage; \ No newline at end of file diff --git a/src/app/(pages)/(main)/project/ProjectTableColumn.tsx b/src/app/(pages)/(main)/project/ProjectTableColumn.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/(pages)/(main)/project/info/page.tsx b/src/app/(pages)/(main)/project/info/page.tsx index 83eb3bd..d523919 100644 --- a/src/app/(pages)/(main)/project/info/page.tsx +++ b/src/app/(pages)/(main)/project/info/page.tsx @@ -1,8 +1,480 @@ -const ProjectInfoPage = () => { - //const url = buildUrlWithParams("/login", searchParams, { ref: "root" }); - //redirect(url); +'use client' - return (
This is Project Info Page
) +import {useEffect, useState} from 'react' +import BodyTitle from '@/components/layout/BodyTitle' +import {Button} from '@/components/ui/button' +import {Input} from '@/components/ui/input' +import {Label} from '@/components/ui/label' +import {RadioGroup, RadioGroupItem} from '@/components/ui/radio-group' +import {Checkbox} from '@/components/ui/checkbox' +import {Tabs, TabsContent, TabsList, TabsTrigger} from '@/components/ui/tabs' +import {KriMultiSelect, KriSingleSelect} from '@/components/common/KriAutoComplete' +import {useDialog} from '@/hooks/useDialog' +import ResultCodeDialog from '@/components/dialog/ResultCodeDialog' +import {useMounted} from '@/hooks/useMounted' +import {LoadingOverlay} from '@/components/common/LoadingOverlay' +import {KonKiwiProjectInfo, ProjectInfo} from "@/types/project"; +import { + PROJECT_STATUS_LABEL, + PROJECT_STATUS_ORDER, + ProjectStatus, + SURVEY_TYPE_LABEL, + SURVEY_TYPE_ORDER, + SurveyType +} from "@/const/projectConst"; +import {MultiSelectOption} from "@/components/ui/multi-select"; +import {FW_TEAM} from "@/const/userConst"; +import {useItrntUserList} from "@/hooks/useItrntUserList"; +import {nextApi} from "@/lib/http-client"; +import {useSelectedProject} from "@/hooks/useSelectedProject"; +import {UserInfo} from "@/types/user"; +import {useDebouncedValue} from "@/hooks/useDebouncedValue"; +import {useAuth} from "@/hooks/useAuth"; +import {KriEditor} from "@/components/kri-editor"; + + +const defaultProjectInfo: Partial = { + prjctCd: '', + prjctName: '', + prjctStatus: 0, + ownerDept: '', + ownerFw: '', + surveyTy: 0, + surveyPrjctCd: '', + surveyUrl: '', + ff: false, + useContactSenario: false, + contactSenario: '', } -export default ProjectInfoPage; \ No newline at end of file +type ExternalTab = 'redirect' | 'api' + +const ProjectInfoPage = () => { + const mounted = useMounted(); + const { selectedProject } = useSelectedProject(); + const { isDialogOpen, showDialog, hideDialog } = useDialog(); + const { users, isLoading } = useItrntUserList(); + const { auth } = useAuth(); + + const [projectInfo, setProjectInfo] = useState>(defaultProjectInfo); + const [outsourceUserArray, setOutsourceUserArray] = useState([]); + + const [outsourceOptionArray, setOutsourceOptionArray] = useState([]); + const [deptArray, setDeptArray] = useState([]); + const [fwArray, setFwArray] = useState([]); + + const [surveyKeyword, setSurveyKeyword] = useState(''); + const debouncedKeyword = useDebouncedValue(surveyKeyword, 500); + const [surveyProjectArray, setSurveyProjectArray] = useState([]); + + const [externalTab, setExternalTab] = useState('redirect') + + const internalSurvey = [SurveyType.KON, SurveyType.KIWI]; + const baseUrl = 'https://kcont.kric.com' + const sidParam = 'sid=${$SID}' + + const externalUrls = { + redirect: { + start: `${baseUrl}/redirect/start?${sidParam}`, + complete: `${baseUrl}/redirect/complete?${sidParam}`, + screen: `${baseUrl}/redirect/screen?${sidParam}`, + quota: `${baseUrl}/redirect/quota?${sidParam}`, + }, + api: { + start: `${baseUrl}/api/external/start?${sidParam}`, + complete: `${baseUrl}/api/external/complete?${sidParam}`, + screen: `${baseUrl}/api/external/screen?${sidParam}`, + quota: `${baseUrl}/api/external/quota?${sidParam}`, + }, + } as const + + const userTeam = auth.user?.userTeam ?? ""; + + const searchKonKiwiPrjct = async (keyword:string): Promise => { + const surveyType = projectInfo.surveyTy ?? SurveyType.NONE; + if(internalSurvey.includes(surveyType) && userTeam){ + const isKiwi = surveyType === SurveyType.KON? 0 : 1; + const res = await nextApi.get( + `/kart/project-list/${projectInfo.itrntPrjctCd}/${userTeam}/${isKiwi}`, + { query: keyword ? { keyword } : {} } + ); + + setSurveyProjectArray(res); + } + } + + const handleChange = (field: keyof ProjectInfo, value: any) => { + setProjectInfo((prev) => ({ ...prev, [field]: value })) + } + + const handleResultCodeClick = () => { + showDialog('resultCodeDialog') + } + + const handleSubmit = async () => { + if (!projectInfo.prjctName) { + alert('프로젝트명을 입력해주세요.') + return + } + // TODO: 저장 API + } + + const handleDeleteClick = async () => { + if (confirm('복구 할 수 없습니다. 정말 삭제 하시겠습니까?')) { + if(!selectedProject){ + alert("옳지 않은 요청입니다."); + } + else{ + await nextApi.del(`/project/${selectedProject.prjctIdx}`) + } + + window.location.href = `/`; + } + } + + useEffect(() => { + if(selectedProject){ + nextApi.get(`/project/info/${selectedProject.prjctIdx}`) + .then((res) => { setProjectInfo(res)}); + + nextApi.get(`/user/outsource`) + .then((res) => { + const outsourceOptions: MultiSelectOption[] = res + .map(u => ({ + value: u.userId, + label: `${u.userCmpn} / ${u.userName}(${u.userId})`, + })); + setOutsourceOptionArray(outsourceOptions) + }); + + nextApi.get(`/assign/prjct-outsource/${selectedProject.prjctIdx}`) + .then((res) => setOutsourceUserArray(res)); + } + }, [selectedProject]) + + useEffect(() => { + if (projectInfo.surveyTy !== SurveyType.EXTERNAL) { + setExternalTab('redirect') + + if(projectInfo.surveyPrjctCd && internalSurvey.includes(projectInfo.surveyTy || SurveyType.NONE)){ + let surveyUrl = `/project/${projectInfo.surveyPrjctCd}/INDEX.asp?${sidParam}`; + if(projectInfo.surveyTy === SurveyType.KON){ + surveyUrl = `https://kon.kric.com` + surveyUrl + } + else if(projectInfo.surveyTy === SurveyType.KIWI){ + surveyUrl = `https://kon.kiwisurvey.kr` + surveyUrl + } + + handleChange('surveyUrl', surveyUrl) + } + } + }, [projectInfo.surveyTy, projectInfo.surveyPrjctCd]) + + useEffect(() => { + let userTeams = Array.from(new Set(users.map(u => u.userTeam))); + if(!userTeams.includes("T900")){ //TFT + userTeams.push("T900"); + } + userTeams = userTeams.sort((a, b) => a.localeCompare(b, "ko")); + setDeptArray(userTeams); + }, [users]); + + useEffect(() => { + const userOptions: MultiSelectOption[] = users + .filter(u => u.userId == projectInfo.ownerFw || u.userTeam == FW_TEAM) + .map(u => ({ + value: u.userId, + label: u.userNm, + })); + setFwArray(userOptions); + }, [users, projectInfo.ownerFw]); + + useEffect(() => { + const keyword = debouncedKeyword.trim(); + searchKonKiwiPrjct(keyword).then(); + }, [debouncedKeyword, projectInfo.surveyTy, userTeam]); + + + if (!mounted) return + + return ( +
+
+
+ + + {/* 1. 기본 정보 */} +
+

프로젝트 기본 정보

+
+
+ + +
+ +
+
+ + handleChange('prjctStatus', Number(v) as ProjectStatus)} + className="flex gap-4" + > + {PROJECT_STATUS_ORDER.map((s) => { + const id = `status-${s}`; + return ( +
+ + +
+ ); + })} +
+
+ + +
+ +
+ + handleChange('prjctName', e.target.value)} + placeholder="프로젝트명을 입력하세요" + className="h-9" + /> +
+ +
+
+ + handleChange('ownerDept', value)} + placeholder="담당 그룹을 선택하세요" + heightClassName="h-9" + widthClassName="w-full" + /> +
+ +
+ + handleChange('ownerFw', value)} + getValue={(item) => item.value} + getLabel={(item) => item.label} + placeholder="담당 실사를 선택하세요" + heightClassName="h-9" + widthClassName="w-full" + /> +
+
+
+
+ +
+

외주사

+ console.log(value)} + getValue={(item) => item.value} + getLabel={(item) => item.label} + placeholder="없음" + heightClassName="h-9" + widthClassName="w-full" + /> +
+ +
+

설문 연동

+ + handleChange('surveyTy', Number(v) as SurveyType)} + className="flex gap-4" + > + {SURVEY_TYPE_ORDER.map((t) => { + const id = `survey-${t}`; // 유니크 보장 + return ( +
+ + +
+ ); + })} +
+ + {(projectInfo.surveyTy === SurveyType.KON || projectInfo.surveyTy === SurveyType.KIWI) && ( +
+ + handleChange('surveyPrjctCd', value)} + getValue={(item) => item.pkey} + getLabel={(item) => `[${item.pkey}] ${item.title}`} + searchMode={"inputOnly"} + onSearchValueChange={setSurveyKeyword} + placeholder="프로젝트를 선택하세요" + heightClassName="h-9" + widthClassName="w-full" + /> +
+ )} + {projectInfo.surveyTy !== SurveyType.NONE && ( +
+ + handleChange('surveyUrl', e.target.value)} + placeholder="https://" + className="h-9" + /> +
+ )} + + {projectInfo.surveyTy === SurveyType.EXTERNAL && ( +
+ setExternalTab(v as ExternalTab)} className="w-full"> + + 리다이렉트 + API + + + +
+
리다이렉트 URL
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
API URL
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +

API Method는 Post를 사용하시면 됩니다.

+
+
+
+
+ )} +
+ +
+

기타 옵션

+ +
+
+ handleChange('ff', checked === true)} + /> + +
+ +
+ handleChange('useContactSenario', checked === true)} + /> + +
+ + {projectInfo.useContactSenario && ( +
+ {handleChange('contactSenario', str); console.log(str)}} + placeholder="컨택 시나리오를 작성해 주세요" + className="w-full" + /> +
+ )} +
+
+
+
+ +
+
+
+
+ + +
+
+
+
+ + (open ? showDialog('resultCodeDialog') : hideDialog('resultCodeDialog'))} + /> +
+ ) +} + +export default ProjectInfoPage diff --git a/src/app/(pages)/login/page.tsx b/src/app/(pages)/login/page.tsx index 12b77fd..399b152 100644 --- a/src/app/(pages)/login/page.tsx +++ b/src/app/(pages)/login/page.tsx @@ -5,7 +5,7 @@ import {Button} from "@/components/ui/button"; import {Card, CardContent, CardHeader} from "@/components/ui/card"; import {Input} from "@/components/ui/input"; import React, {useEffect, useRef, useState} from "react"; -import {HttpError, nextApi} from "@/lib/http-client"; +import { nextApi } from "@/lib/http-client"; import {useRouter, useSearchParams} from "next/navigation"; import {LoginUser} from "@/types/auth"; import { useAuth } from "@/hooks/useAuth"; @@ -13,7 +13,7 @@ import { useLoading } from "@/hooks/useLoading"; import { useStorage } from "@/hooks/useStorage" import { StorageKeys } from "@/store/storage/storage-keys"; import {apiError} from "@/lib/http-util"; -import commonConst from "@/config/commonConst"; +import {NONE_HTTP_ERROR} from "@/const/commonConst"; const LoginPage = () => { const router = useRouter(); @@ -71,7 +71,7 @@ const LoginPage = () => { if (err.status === 401 || err.status === 403) { setError("아이디 또는 비밀번호를 다시 확인해주세요."); } - else if(err.code === commonConst.noneHttpError) { + else if(err.code === NONE_HTTP_ERROR) { setError("알 수 없는 오류가 발생했습니다. 잠시 후 다시 시도해주세요."); } else { diff --git a/src/app/(pages)/logout/page.tsx b/src/app/(pages)/logout/page.tsx index 4ae42d9..bb229de 100644 --- a/src/app/(pages)/logout/page.tsx +++ b/src/app/(pages)/logout/page.tsx @@ -24,7 +24,10 @@ const LogoutPage = () => { logout(); try { - await nextApi.post(`/logout/${userId}`); + if(userId !== ""){ + const logoutRequestOptions = {autoLogoutOnAuthError: false}; + await nextApi.post(`/logout/${userId}`, null, logoutRequestOptions); + } } catch (e) { const err = apiError(e); console.error(err.status, err.code, err.message); diff --git a/src/app/api/assign/[[...slug]]/route.ts b/src/app/api/assign/[[...slug]]/route.ts new file mode 100644 index 0000000..6922495 --- /dev/null +++ b/src/app/api/assign/[[...slug]]/route.ts @@ -0,0 +1,46 @@ +import {NextRequest, NextResponse} from "next/server"; +import {DataVerification, RouteContext} from "@/types/common"; +import {createContactApi} from "@/lib/server-api"; +import {UserInfo, UserUploadResponse} from "@/types/user"; +import {errorToResponse} from "@/lib/http-util"; + +export const GET = async (req: NextRequest, context: RouteContext) => { + try { + const { slug = [] } = await context.params; + const [action] = slug; + const contactApi = await createContactApi(); + + if (action === "prjct-outsource") { + const result = await contactApi.get(`/assign/prjct-outsource/${slug[1]}`); + return NextResponse.json(result, { status: 200 }); + } + + return NextResponse.json({ message: "Not found" }, { status: 404 }); + } catch (error: unknown) { + return errorToResponse(error); + } +}; + +export const PUT = async (req: NextRequest, context: RouteContext) => { + try { + const { slug = [] } = await context.params; + const [action] = slug ?? []; + const contactApi = await createContactApi(); + + if(!action){ + const body = await req.json().catch(() => null); + if (!body) { + return NextResponse.json( + { message: "요청 바디가 없습니다." }, + { status: 400 } + ); + } + + await contactApi.put(`/assign/prjct-outsource/${slug[1]}`, body); + return new NextResponse(null, { status: 204 }); + } + return NextResponse.json({ message: "Not found" }, { status: 404 }); + } catch (error: unknown) { + return errorToResponse(error); + } +} \ No newline at end of file diff --git a/src/app/api/external/[[...slug]]/route.ts b/src/app/api/external/[[...slug]]/route.ts new file mode 100644 index 0000000..45fc9a6 --- /dev/null +++ b/src/app/api/external/[[...slug]]/route.ts @@ -0,0 +1 @@ +//외부 설문에 뎐동 되는 API \ No newline at end of file diff --git a/src/app/api/intranet/[[...slug]]/route.ts b/src/app/api/intranet/[[...slug]]/route.ts new file mode 100644 index 0000000..c358923 --- /dev/null +++ b/src/app/api/intranet/[[...slug]]/route.ts @@ -0,0 +1,35 @@ +import {NextRequest, NextResponse} from "next/server"; +import {RouteContext} from "@/types/common"; +import {createContactApi, createIntranetApi} from "@/lib/server-api"; +import {IntranetProjectSearchResponse, ProjectInfo, ProjectOwnerResponse} from "@/types/project"; +import {errorToResponse} from "@/lib/http-util"; +import {ItrntUserInfo} from "@/types/user"; + +export const GET = async (req: NextRequest, context: RouteContext) => { + try { + const { searchParams } = new URL(req.url); + const {slug = []} = await context.params; + const [action] = slug; + const itrntApi = await createIntranetApi(); + + if(action === "project"){ + const keyword = (searchParams.get("keyword") ?? "").trim(); + const result = await itrntApi.get( + `/project/search/top10`, + { query: keyword ? { keyword } : {} } + ); + + return NextResponse.json(result, { status: 200 }); + } + + if(action === "user-list"){ + const result = await itrntApi.get(`/user/list`); + + return NextResponse.json(result, { status: 200 }); + } + + return NextResponse.json({ message: "Not found" }, { status: 404 }); + } catch (error: unknown) { + return errorToResponse(error); + } +}; \ No newline at end of file diff --git a/src/app/api/kart/[[...slug]]/route.ts b/src/app/api/kart/[[...slug]]/route.ts new file mode 100644 index 0000000..6f37dba --- /dev/null +++ b/src/app/api/kart/[[...slug]]/route.ts @@ -0,0 +1,28 @@ +import {NextRequest, NextResponse} from "next/server"; +import {RouteContext} from "@/types/common"; +import {createKartApi} from "@/lib/server-api"; +import {KonKiwiProjectInfo} from "@/types/project"; +import {errorToResponse} from "@/lib/http-util"; + +export const GET = async (req: NextRequest, context: RouteContext) => { + try { + const { searchParams } = new URL(req.url); + const {slug = []} = await context.params; + const [action] = slug; + const kartApi = await createKartApi(); + + if(action === "project-list" && slug.length === 4){ + const keyword = (searchParams.get("keyword") ?? "").trim(); + const result = await kartApi.get( + `/project/list/${slug[1]}/${slug[2]}/${slug[3]}`, + { query: keyword ? { keyword } : {} } + ); + + return NextResponse.json(result, { status: 200 }); + } + + return NextResponse.json({ message: "Not found" }, { status: 404 }); + } catch (error: unknown) { + return errorToResponse(error); + } +}; \ No newline at end of file diff --git a/src/app/api/logout/[[...slug]]/route.ts b/src/app/api/logout/[[...slug]]/route.ts index 80e59fb..c5f7dba 100644 --- a/src/app/api/logout/[[...slug]]/route.ts +++ b/src/app/api/logout/[[...slug]]/route.ts @@ -19,7 +19,6 @@ export async function POST( : "/auth/logout/"; await contactApi.post(url); - const res = NextResponse.json({ ok: true }); res.cookies.set("access_token", "", { diff --git a/src/app/api/project/[[...slug]]/route.ts b/src/app/api/project/[[...slug]]/route.ts index 8745dd2..0e5feb1 100644 --- a/src/app/api/project/[[...slug]]/route.ts +++ b/src/app/api/project/[[...slug]]/route.ts @@ -1,15 +1,38 @@ -import {NextRequest} from "next/server"; -import {createContactApi} from "@/lib/server-api"; +import {NextRequest, NextResponse} from "next/server"; +import {createContactApi, createIntranetApi} from "@/lib/server-api"; import {errorToResponse} from "@/lib/http-util"; -import {RouteContext} from "@/types/common"; +import {PageResponse, RouteContext} from "@/types/common"; +import {IntranetProjectSearchResponse, ProjectInfo, ProjectOwnerResponse} from "@/types/project"; export const GET = async (req: NextRequest, context: RouteContext) => { try { + const { searchParams } = new URL(req.url); const {slug = []} = await context.params; const [action] = slug; const contactApi = await createContactApi(); + if(action === "owner-list"){ + const result = await contactApi.get("/project/owner-list"); + return NextResponse.json(result, { status: 200 }); + } + if(action === "top"){ + const keyword = (searchParams.get("keyword") ?? "").trim(); + const result = await contactApi.get( + `/project/top/${slug[1]}`, + { query: keyword ? { keyword } : {} } + ); + return NextResponse.json(result, { status: 200 }); + } + + if(action === "info"){ + const result = await contactApi.get( + `/project/${slug[1]}`, + ); + return NextResponse.json(result, { status: 200 }); + } + + return NextResponse.json({ message: "Not found" }, { status: 404 }); } catch (error: unknown) { return errorToResponse(error); } @@ -21,7 +44,20 @@ export const POST = async (req: NextRequest, context: RouteContext) => { const [action] = slug; const contactApi = await createContactApi(); + if(action === "list"){ + const body = await req.json().catch(() => null); + if (!body) { + return NextResponse.json( + { message: "요청 바디가 없습니다." }, + { status: 400 } + ); + } + const result = await contactApi.post>("/project/list", body); + return NextResponse.json(result, { status: 200 }); + } + + return NextResponse.json({ message: "Not found" }, { status: 404 }); } catch (error: unknown) { return errorToResponse(error); } @@ -33,7 +69,20 @@ export const PUT = async (req: NextRequest, context: RouteContext) => { const [action] = slug; const contactApi = await createContactApi(); + if(!action){ + const body = await req.json().catch(() => null); + if (!body) { + return NextResponse.json( + { message: "요청 바디가 없습니다." }, + { status: 400 } + ); + } + const result = await contactApi.put("/project", body); + return NextResponse.json(result, { status: 200 }); + } + + return NextResponse.json({ message: "Not found" }, { status: 404 }); } catch (error: unknown) { return errorToResponse(error); } @@ -45,7 +94,7 @@ export const PATCH = async (req: NextRequest, context: RouteContext) => { const [action] = slug; const contactApi = await createContactApi(); - + return NextResponse.json({ message: "Not found" }, { status: 404 }); } catch (error: unknown) { return errorToResponse(error); } @@ -57,7 +106,12 @@ export const DELETE = async (req: NextRequest, context: RouteContext) => { const [action] = slug; const contactApi = await createContactApi(); + if(slug.length === 1){ + await contactApi.del(`/project/${slug[0]}`); + return new NextResponse(null, { status: 204 }); + } + return NextResponse.json({ message: "Not found" }, { status: 404 }); } catch (error: unknown) { return errorToResponse(error); } diff --git a/src/app/api/user/[[...slug]]/route.ts b/src/app/api/user/[[...slug]]/route.ts index 297db7d..23fa83f 100644 --- a/src/app/api/user/[[...slug]]/route.ts +++ b/src/app/api/user/[[...slug]]/route.ts @@ -30,8 +30,8 @@ export const GET = async (req: NextRequest, context: RouteContext) => { return NextResponse.json(result, { status: 200 }); } - if (!action) { - const result = await contactApi.get("/user"); + if(action === "outsource"){ + const result = await contactApi.get("/user/outsource"); return NextResponse.json(result, { status: 200 }); } @@ -41,6 +41,11 @@ export const GET = async (req: NextRequest, context: RouteContext) => { return NextResponse.json(result, { status: 200 }); } + if (!action) { + const result = await contactApi.get("/user"); + return NextResponse.json(result, { status: 200 }); + } + return NextResponse.json({ message: "Not found" }, { status: 404 }); } catch (error: unknown) { return errorToResponse(error); diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 0726f0e..6cff706 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -2,6 +2,7 @@ import type { Metadata } from "next"; import {Geist, Geist_Mono} from "next/font/google"; import { AppProvider } from "@/components/providers/AppProvider"; import "./globals.css"; +import {Toaster} from "sonner"; const geistSans = Geist({ variable: "--font-geist-sans", @@ -25,6 +26,7 @@ const RootLayout = ({ children }: { children: React.ReactNode}) => { className={`${geistSans.variable} ${geistMono.variable} antialiased`} > {children} + ); diff --git a/src/components/common/KriAutoComplete.tsx b/src/components/common/KriAutoComplete.tsx index 3a6a248..3a50e51 100644 --- a/src/components/common/KriAutoComplete.tsx +++ b/src/components/common/KriAutoComplete.tsx @@ -9,6 +9,7 @@ type BaseProps = { items: T[] searchable?: boolean searchMode?: "filter" | "inputOnly"; + defaultSearchValue?: string; onSearchValueChange?: (value: string) => void; placeholder?: string widthClassName?: string @@ -16,123 +17,164 @@ type BaseProps = { className?: string getValue?: (item: T) => string getLabel?: (item: T) => string + + /** ✅ 옵션: 원본 item을 option.info에 실어둘지 */ + withInfo?: boolean } -type KriMultiSelectProps = BaseProps & { +type KriMultiSelectProps = BaseProps & { value: string[] onChange: (value: string[]) => void - /** 최대 선택 개수 제한 (없으면 무제한) */ maxCount?: number maxSelected?: number hideSelectAll?: boolean + + /** ✅ withInfo=true일 때만 의미 있게 쓰면 됨 */ + onItemsChange?: (items: T[]) => void + onOptionsChange?: (options: MultiSelectOption[]) => void } -export function KriMultiSelect({ - items, - value, - onChange, - searchable = true, - searchMode = "filter", - onSearchValueChange, - maxCount = 1, - maxSelected, - hideSelectAll = false, - placeholder = 'Select options', - widthClassName, - heightClassName, - className, - getValue, - getLabel, -}: KriMultiSelectProps) { - const extractValue = React.useCallback((item: T) => (getValue ? getValue(item) : String(item)), [getValue]) - const extractLabel = React.useCallback((item: T) => (getLabel ? getLabel(item) : String(item)), [getLabel]) - - const options = React.useMemo( - () => - items.map((item) => ({ - value: extractValue(item), - label: extractLabel(item), - })), - [items, extractValue, extractLabel] +export function KriMultiSelect({ + items, + value, + onChange, + searchable = true, + searchMode = "filter", + defaultSearchValue = "", + onSearchValueChange, + maxCount = 1, + maxSelected, + hideSelectAll = false, + placeholder = 'Select options', + widthClassName, + heightClassName, + className, + getValue, + getLabel, + withInfo = false, + onItemsChange, + onOptionsChange, + }: KriMultiSelectProps) { + const extractValue = React.useCallback( + (item: T) => (getValue ? getValue(item) : String(item)), + [getValue] ) + const extractLabel = React.useCallback( + (item: T) => (getLabel ? getLabel(item) : String(item)), + [getLabel] + ) + + const options = React.useMemo[]>(() => { + return items.map((item) => ({ + value: extractValue(item), + label: extractLabel(item), + ...(withInfo ? { info: item } : {}), // ✅ 필요할 때만 info를 실음 + })) + }, [items, extractValue, extractLabel, withInfo]) return ( -
- -
+
+ + options={options} + defaultValue={value} + onValueChange={onChange} + onOptionChange={onOptionsChange} + onInfoChange={onItemsChange} + maxSelected={maxSelected} + placeholder={placeholder} + className={cn("bg-white content-text-lg", className)} + searchable={searchable} + searchMode={searchMode} + defaultSearchValue={defaultSearchValue} + onSearchValueChange={onSearchValueChange} + maxCount={maxCount} + hideSelectAll={hideSelectAll} + autoSize + singleLine + resetOnDefaultValueChange + deduplicateOptions + /> +
) } -type KriSingleSelectProps = BaseProps & { +type KriSingleSelectProps = BaseProps & { value: string onChange: (value: string) => void + onItemChange?: (item: T | null) => void + onOptionChange?: (option: MultiSelectOption | null) => void + preventDeselect?: boolean; + hideOptionCheck?: boolean; } -export function KriSingleSelect({ - items, - value, - onChange, - searchable = true, - searchMode = "filter", - onSearchValueChange, - placeholder = 'Select an option', - heightClassName, - widthClassName, - className, - getValue, - getLabel, - }: KriSingleSelectProps) { - const extractValue = React.useCallback((item: T) => (getValue ? getValue(item) : String(item)), [getValue]) - const extractLabel = React.useCallback((item: T) => (getLabel ? getLabel(item) : String(item)), [getLabel]) - - const options = React.useMemo( - () => - items.map((item) => ({ - value: extractValue(item), - label: extractLabel(item), - })), - [items, extractValue, extractLabel] +export function KriSingleSelect({ + items, + value, + onChange, + searchable = true, + searchMode = "filter", + defaultSearchValue = "", + onSearchValueChange, + placeholder = 'Select an option', + heightClassName, + widthClassName, + className, + getValue, + getLabel, + withInfo = false, + onItemChange, + onOptionChange, + preventDeselect = false, + hideOptionCheck = false, + }: KriSingleSelectProps) { + const extractValue = React.useCallback( + (item: T) => (getValue ? getValue(item) : String(item)), + [getValue] + ) + const extractLabel = React.useCallback( + (item: T) => (getLabel ? getLabel(item) : String(item)), + [getLabel] ) - const defaultValue = React.useMemo(() => (value ? [value] : []), [value]); + const options = React.useMemo[]>(() => { + return items.map((item) => ({ + value: extractValue(item), + label: extractLabel(item), + ...(withInfo ? { info: item } : {}), + })) + }, [items, extractValue, extractLabel, withInfo]) + + const defaultValue = React.useMemo(() => (value ? [value] : []), [value]) return ( -
- onChange(next.at(-1) ?? '')} - selectionMode="single" - maxCount={1} - maxSelected={1} - placeholder={placeholder} - className={cn("bg-white content-text-lg", className)} - searchable={searchable} - searchMode={searchMode} - onSearchValueChange={onSearchValueChange} - hideSelectAll - autoSize - singleLine - closeOnSelect - resetOnDefaultValueChange - deduplicateOptions - /> -
+
+ + options={options} + defaultValue={defaultValue} + onValueChange={(next) => onChange(next[0] ?? '')} + onOptionChange={(opts) => { + const opt = opts[0] ?? null + onOptionChange?.(opt) + onItemChange?.((withInfo ? (opt?.info ?? null) : null)) + }} + selectionMode="single" + maxCount={1} + maxSelected={1} + placeholder={placeholder} + className={cn("bg-white content-text-lg", className)} + searchable={searchable} + searchMode={searchMode} + defaultSearchValue={defaultSearchValue} + onSearchValueChange={onSearchValueChange} + preventDeselect={preventDeselect} + hideOptionCheck={hideOptionCheck} + hideSelectAll + autoSize + singleLine + closeOnSelect + resetOnDefaultValueChange + deduplicateOptions + /> +
) } diff --git a/src/components/common/LoadingOverlay.tsx b/src/components/common/LoadingOverlay.tsx index 84bcc34..cfc21aa 100644 --- a/src/components/common/LoadingOverlay.tsx +++ b/src/components/common/LoadingOverlay.tsx @@ -3,10 +3,10 @@ import { useAtomValue } from "jotai"; import { loadingAtom } from "@/store/jotai/loading"; -export function LoadingOverlay() { +export function LoadingOverlay({ force = false }: { force?: boolean }) { const isLoading = useAtomValue(loadingAtom); - if (!isLoading) return null; + if (!force && !isLoading) return null; return (
diff --git a/src/components/data-table/DataTable.tsx b/src/components/data-table/DataTable.tsx index 2c540fa..b59d974 100644 --- a/src/components/data-table/DataTable.tsx +++ b/src/components/data-table/DataTable.tsx @@ -30,6 +30,7 @@ import { usePagination } from './hooks/usePagination' import { DataTableProps, DataTableColumn } from './DataTable.type' import { cn } from '@/lib/utils' +import {usePreventClickOnDrag} from "@/components/data-table/hooks/usePreventClickOnDrag"; export function DataTable({ columns, @@ -42,8 +43,8 @@ export function DataTable({ onPaginationChange: onServerPaginationChange, onSortingChange: onServerSortingChange, selectMode = 'none', + onRowClick, onRowSelectionChange, - enableRowClickSelection = false, defaultPageSize = 10, pageSizeOptions = [5, 10, 25, 50], paginationItemsToDisplay = 5 @@ -60,6 +61,10 @@ export function DataTable({ // Row selection state const [rowSelection, setRowSelection] = useState({}) + const drag = usePreventClickOnDrag(6); + + const isNotSelection = !['none', 'click-event'].includes(selectMode); + // 서버 페이지네이션일 때 부모에게 알림 useEffect(() => { if (!isClient && onServerPaginationChange) { @@ -76,7 +81,7 @@ export function DataTable({ // Row selection 변경 시 부모에게 알림 useEffect(() => { - if (selectMode !== 'none' && onRowSelectionChange) { + if (isNotSelection && onRowSelectionChange) { const selectedRows = table .getSelectedRowModel() .rows.map(row => row.original) @@ -86,7 +91,7 @@ export function DataTable({ // selectMode에 따라 select column 추가 const enhancedColumns: DataTableColumn[] = [ - ...(selectMode !== 'none' + ...(isNotSelection ? [ { id: 'select', @@ -125,13 +130,23 @@ export function DataTable({ // Row 클릭 핸들러 const handleRowClick = (row: any) => { - if (!enableRowClickSelection || selectMode === 'none') return + switch (selectMode) { + case 'none': + return - if (selectMode === 'single') { - table.resetRowSelection() - row.toggleSelected(true) - } else { - row.toggleSelected(!row.getIsSelected()) + case 'click-event': + if (!onRowClick) return + onRowClick(row.original) + return + + case 'single': + table.resetRowSelection() + row.toggleSelected(true) + return + + default: // 'multi' 등 + row.toggleSelected(!row.getIsSelected()) + return } } @@ -144,7 +159,7 @@ export function DataTable({ pagination, rowSelection }, - enableRowSelection: selectMode !== 'none', + enableRowSelection: isNotSelection, onRowSelectionChange: setRowSelection, onSortingChange: setSorting, onPaginationChange: setPagination, @@ -218,11 +233,15 @@ export function DataTable({ handleRowClick(row)} + onPointerDown={drag.onPointerDown} + onPointerMove={drag.onPointerMove} + onPointerUp={drag.onPointerUp} + onPointerCancel={drag.onPointerCancel} + onClick={drag.wrapClick(() => handleRowClick(row))} className={cn( 'content-text-base', '[&>td]:py-0 [&>td]:px-2', - enableRowClickSelection && selectMode !== 'none' && 'cursor-pointer', + selectMode !== 'none' && 'cursor-pointer', 'data-[state=selected]:bg-slate-100 data-[state=selected]:font-semibold', shouldHighlight && 'bg-emerald-50', )} diff --git a/src/components/data-table/DataTable.type.ts b/src/components/data-table/DataTable.type.ts index f60bf7c..84b64c2 100644 --- a/src/components/data-table/DataTable.type.ts +++ b/src/components/data-table/DataTable.type.ts @@ -1,6 +1,6 @@ import { ColumnDef, PaginationState, SortingState } from '@tanstack/react-table' -export type SelectMode = 'none' | 'single' | 'multi' +export type SelectMode = 'none' | 'click-event' | 'single' | 'multi' export type DataTableColumn = ColumnDef & { enableSorting?: boolean // 정렬 가능 여부 (기본값: false) @@ -33,10 +33,10 @@ export interface DataTableProps { onPaginationChange?: (pagination: PaginationState) => void onSortingChange?: (sorting: SortingState) => void - // 선택 모드 - selectMode?: SelectMode // 'none' | 'single' | 'multi' (기본값: 'none') + // 선택 모드 + selectMode?: SelectMode // 'none' | 'click-event' | 'single' | 'multi' (기본값: 'none') + onRowClick?: (selectedRows: TData) => void onRowSelectionChange?: (selectedRows: TData[]) => void - enableRowClickSelection?: boolean // row 클릭 시 select 여부 (기본값: false) // 페이지네이션 설정 defaultPageSize?: number diff --git a/src/components/data-table/hooks/usePreventClickOnDrag.ts b/src/components/data-table/hooks/usePreventClickOnDrag.ts new file mode 100644 index 0000000..29a5abc --- /dev/null +++ b/src/components/data-table/hooks/usePreventClickOnDrag.ts @@ -0,0 +1,48 @@ +import * as React from "react"; + +export const usePreventClickOnDrag = (thresholdPx = 6) => { + const s = React.useRef({ x: 0, y: 0, dragging: false }); + + const onPointerDown = React.useCallback((e: React.PointerEvent) => { + // 좌클릭만 + if (e.button !== 0) return; + s.current.x = e.clientX; + s.current.y = e.clientY; + s.current.dragging = false; + }, []); + + const onPointerMove = React.useCallback( + (e: React.PointerEvent) => { + // 누르고 있을 때만 + if (e.buttons === 0) return; + + const dx = e.clientX - s.current.x; + const dy = e.clientY - s.current.y; + + if (dx * dx + dy * dy >= thresholdPx * thresholdPx) { + s.current.dragging = true; + } + }, + [thresholdPx] + ); + + const onPointerUp = React.useCallback(() => { + // click은 pointerup 다음에 발생하므로 "다음 tick"에 false로 복구 + setTimeout(() => { + s.current.dragging = false; + }, 0); + }, []); + + const wrapClick = + (fn: () => void) => + (e: React.MouseEvent) => { + if (s.current.dragging) { + e.preventDefault(); + e.stopPropagation(); + return; + } + fn(); + }; + + return { onPointerDown, onPointerMove, onPointerUp, onPointerCancel: onPointerUp, wrapClick }; +} \ No newline at end of file diff --git a/src/components/dialog/ProjectCreateDialog.tsx b/src/components/dialog/ProjectCreateDialog.tsx new file mode 100644 index 0000000..4189621 --- /dev/null +++ b/src/components/dialog/ProjectCreateDialog.tsx @@ -0,0 +1,269 @@ +'use client' + +import { useState, useEffect } from 'react' +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle +} from "@/components/ui/dialog"; +import {Label} from "@/components/ui/label"; +import {Input} from "@/components/ui/input"; +import {Button} from "@/components/ui/button"; +import {KriSingleSelect} from "@/components/common/KriAutoComplete"; +import {useDialog} from "@/hooks/useDialog"; +import type {DialogId} from "@/store/jotai/dialog"; +import {NONE_HTTP_ERROR, UNKNOWN_HTTP_ERROR} from "@/const/commonConst"; +import {apiError} from "@/lib/http-util"; +import {IntranetProjectSearchResponse, ProjectCreateRequest} from "@/types/project"; +import {useDebouncedValue} from "@/hooks/useDebouncedValue"; +import {nextApi} from "@/lib/http-client"; +import {PROJECT_NAME_REGEX} from "@/const/projectConst"; +import {FW_TEAM, USER_NAME_REGEX} from "@/const/userConst"; +import {MultiSelectOption} from "@/components/ui/multi-select"; +import {ItrntUserInfo} from "@/types/user"; + +export type ProjectCreateDialogProps = { + /** Jotai로 관리할 다이얼로그 ID (기본값: 'userUpsertDialog') */ + dialogId?: DialogId + + /** 필요하면 여전히 외부에서 open 제어도 가능하게 */ + open?: boolean + onOpenChange?: (open: boolean) => void + users:ItrntUserInfo[] + ownerFw: string; + onSubmit: (data: ProjectCreateRequest) => void | Promise +} + + + +const ProjectCreateDialog = ({ + dialogId = 'projectCreateDialog', + open, + onOpenChange, + users, + ownerFw, + onSubmit, +}:ProjectCreateDialogProps) => { + const defaultProjectInfo:ProjectCreateRequest = { + prjctName: "", + itrntPrjctCd: "", + ownerDept: "", + ownerFw: ownerFw, + } + const { isDialogOpen, showDialog, hideDialog } = useDialog(); + const [deptArray, setDeptArray] = useState([]); + const [fwArray, setFwArray] = useState([]); + const [isSubmitting, setIsSubmitting] = useState(false); + const [formData, setFormData] = useState(defaultProjectInfo); + + const [itrntKeyword, setItrntKeyword] = useState(''); + const debouncedKeyword = useDebouncedValue(itrntKeyword, 500); + const [itrntPrjctArray, setItrntPrjctArray] = useState([]); + + // 🔹 실제로 Dialog에 넘길 open 값 (외부 open 있으면 우선) + const resolvedOpen = open ?? isDialogOpen(dialogId); + + // 🔹 실제 onOpenChange 핸들러 (외부 콜백 + jotai 둘 다 처리) + const handleOpenChange = (nextOpen: boolean) => { + // 1) 외부에서 넘겨준 onOpenChange 먼저 호출 + onOpenChange?.(nextOpen); + + // 2) jotai 전역 상태도 함께 업데이트 + if (nextOpen) { + showDialog(dialogId); + setItrntKeyword(""); + } else { + hideDialog(dialogId); + } + } + + const handleInputChange = (field: keyof ProjectCreateRequest, value: any) => { + setFormData((prev) => { + const next = { ...prev, [field]: value } as ProjectCreateRequest; + + if (field === "itrntPrjctCd") { + const selected = itrntPrjctArray.find((p) => p.childSn === value); + if (selected){ + next.ownerDept = selected.researchTeam; + next.prjctName = selected.title; + } + } + + return next; + }); + } + + const handleSubmit = async () => { + if(!formData.itrntPrjctCd.trim()){ + alert("인트라넷 프로젝트를 선택해 주세요"); + return; + } + if (!formData.prjctName.trim()) { + alert('프로젝트 명을 입력해 주세요'); + return; + } + if (!PROJECT_NAME_REGEX.test(formData.prjctName)) { + alert("프로젝트명에 허용되지 않는 문자가 포함되어 있습니다"); + return; + } + if(!formData.ownerDept.trim()){ + alert('담당 그룹을 입력해 주세요'); + return; + } + if(!USER_NAME_REGEX.test(formData.ownerDept)){ + alert('담당 그룹이 올바르지 않습니다.'); + return; + } + if(!formData.ownerFw.trim()){ + alert('담당 SV를 입력해 주세요'); + return; + } + if(!USER_NAME_REGEX.test(formData.ownerDept)){ + alert('담당 SV가 올바르지 않습니다.'); + return; + } + + setIsSubmitting(true); + try { + await onSubmit(formData as ProjectCreateRequest); + handleOpenChange(false); + } catch (e) { + const err = apiError(e); + if(err.code !== NONE_HTTP_ERROR && err.code !== UNKNOWN_HTTP_ERROR){ + alert(err.message); + } + else{ + alert('저장에 실패했습니다.'); + } + } finally { + setIsSubmitting(false); + } + } + + const searchItrntPrjct = async (keyword:string): Promise => { + const res = await nextApi.get( + "/intranet/project", + { query: keyword ? { keyword } : {} } + ); + + setItrntPrjctArray(res); + } + + useEffect(() => { + const keyword = debouncedKeyword.trim(); + searchItrntPrjct(keyword).then(); + }, [debouncedKeyword]); + + useEffect(() => { + setFormData(defaultProjectInfo); + }, [resolvedOpen]) + + useEffect(() => { + let userTeams = Array.from(new Set(users.map(u => u.userTeam))); + if(!userTeams.includes("T900")){ //TFT + userTeams.push("T900"); + } + userTeams = userTeams.sort((a, b) => a.localeCompare(b, "ko")); + setDeptArray(userTeams); + + const userOptions: MultiSelectOption[] = users + .filter(u => u.userId == ownerFw || u.userTeam == FW_TEAM) + .map(u => ({ + value: u.userId, + label: u.userNm, + })); + setFwArray(userOptions); + }, [users]); + + return ( + + + + + 프로젝트 생성 + + 프로젝트 생성에 필요한 기본정보를 입력해주세요. + +
+
+ + handleInputChange('itrntPrjctCd', e)} + getLabel={(item) => `[${item.childSn}] ${item.title}`} + getValue={(item) => item.childSn} + searchMode={"inputOnly"} + onSearchValueChange={setItrntKeyword} + placeholder="인트라넷 프로젝트" + widthClassName="w-full" + heightClassName="h-9" + /> +
+
+ + handleInputChange('prjctName', e.target.value)} + /> +
+
+ + handleInputChange('ownerDept', value)} + placeholder="담당 그룹을 선택하세요" + heightClassName="h-9" + widthClassName="w-full" + /> +
+
+ + handleInputChange('ownerFw', value)} + getValue={(item) => item.value} + getLabel={(item) => item.label} + placeholder="담당 실사를 선택하세요" + heightClassName="h-9" + widthClassName="w-full" + /> +
+
+ + + + +
+
+ ); +} + +export default ProjectCreateDialog \ No newline at end of file diff --git a/src/components/dialog/ResultCodeDialog.tsx b/src/components/dialog/ResultCodeDialog.tsx new file mode 100644 index 0000000..fea14ef --- /dev/null +++ b/src/components/dialog/ResultCodeDialog.tsx @@ -0,0 +1,325 @@ +'use client' + +import { useMemo, useState } from 'react' +import { + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, +} from '@/components/ui/dialog' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import {Trash2, Plus, Download, Search, XIcon} from 'lucide-react' + +export type ResultCode = { + code: string + label: string +} + +type Project = { + prjctCd: string + prjctName: string + resultCodes: ResultCode[] +} + +type ResultCodeDialogProps = { + open?: boolean + onOpenChange?: (open: boolean) => void + onSave?: (codes: ResultCode[]) => void +} + +const ResultCodeDialog = ({ open, onOpenChange, onSave }: ResultCodeDialogProps) => { + const [importMode, setImportMode] = useState(false) + const [selectedProject, setSelectedProject] = useState('') + + const [resultCodes, setResultCodes] = useState([ + { code: '0', label: '컨택 성공' }, + { code: '1', label: '통화 예약' }, + { code: '2', label: '비수신' }, + { code: '3', label: '부재' }, + { code: '4', label: '휴가' }, + { code: '5', label: '출장' }, + { code: '6', label: '단순 거절' }, + { code: '7', label: '강력 거절' }, + { code: '8', label: '그런 사람 아님' }, + { code: '9', label: '메일 발송' }, + { code: '10', label: '독려' }, + { code: '11', label: '퇴사' }, + { code: '12', label: '기타' }, + { code: '13', label: '조사 대상 아님' }, + { code: '14', label: '수신 거부' }, + ]) + + // 샘플 프로젝트 목록 (실제로는 API에서 가져옴) + const projects: Project[] = [ + { + prjctCd: '250701yd', + prjctName: '250701yd', + resultCodes: [ + { code: '0', label: '완료' }, + { code: '1', label: '거절' }, + { code: '2', label: '진행중' }, + ], + }, + { + prjctCd: '1509013', + prjctName: '1509013_J2307KJC_KFB_저기 1차 카카오톡 AUTOAGI_#01250Group', + resultCodes: [ + { code: '0', label: '성공' }, + { code: '1', label: '실패' }, + { code: '2', label: '보류' }, + ], + }, + { + prjctCd: '1503013', + prjctName: '1503013_J2307KJC_KFB_저기 1차 카카오톡 AUTOAGI_그룹01테스트0', + resultCodes: [ + { code: '0', label: '승인' }, + { code: '1', label: '반려' }, + ], + }, + ] + + const [projectSearch, setProjectSearch] = useState('') + const filteredProjects = useMemo(() => { + const q = projectSearch.trim().toLowerCase() + if (!q) return projects + return projects.filter(p => + `${p.prjctCd} ${p.prjctName}`.toLowerCase().includes(q) + ) + }, [projectSearch]) + + const selectedProjectData = useMemo( + () => projects.find(p => p.prjctCd === selectedProject), + [selectedProject] + ) + + const handleAddCode = () => { + setResultCodes(prev => [...prev, { code: String(prev.length), label: '' }]) + } + + const handleDeleteCode = (index: number) => { + setResultCodes(prev => prev.filter((_, i) => i !== index)) + } + + const handleCodeChange = (index: number, field: keyof ResultCode, value: string) => { + setResultCodes(prev => { + const next = [...prev] + next[index] = { ...next[index], [field]: value } + return next + }) + } + + const handleImportClick = () => { + setImportMode(true) + } + + const handleImportApply = () => { + if (selectedProjectData) { + setResultCodes(selectedProjectData.resultCodes) + setImportMode(false) + setSelectedProject('') + setProjectSearch('') + } + } + + const handleImportCancel = () => { + setImportMode(false) + setSelectedProject('') + setProjectSearch('') + } + + const handleSave = () => { + onSave?.(resultCodes) + onOpenChange?.(false) + setImportMode(false) + setSelectedProject('') + setProjectSearch('') + } + + const handleClose = () => { + onOpenChange?.(false) + setImportMode(false) + setSelectedProject('') + setProjectSearch('') + } + + return ( + + {/* ✅ importMode일 때 더 넓게(그리고 애니메이션으로 부드럽게) */} + + + + 결과 코드 설정 + + + + {/* 상단 버튼 영역 */} +
+ {!importMode ? ( + + ) : ( +
+
+ + setProjectSearch(e.target.value)} + placeholder="프로젝트 코드/이름 검색..." + className="h-9 pl-9" + /> +
+
+ )} +
+ + {/* 본문 */} +
+ {/* 왼쪽: 결과 코드 */} +
+
+
+
결과 코드 목록
+ {!importMode && ( + + )} +
+ +
+ + + + + + + + + {resultCodes.map((code, index) => ( + + + + + + ))} + +
코드레이블 +
+ handleCodeChange(index, 'code', e.target.value)} + className="h-9" + disabled={importMode} + /> + + handleCodeChange(index, 'label', e.target.value)} + className="h-9" + disabled={importMode} + /> + + {!importMode && ( + + )} +
+
+ + {!importMode && ( +
+ Tip: 코드 값은 중복되지 않게 유지해주세요. +
+ )} +
+
+ + {/* 오른쪽: importMode일 때만 */} + {importMode && ( +
+ {/* 미리보기 */} +
+
+
미리보기
+
+ +
+ {selectedProjectData ? ( + + + + + + + + + {selectedProjectData.resultCodes.map((code, idx) => ( + + + + + ))} + +
코드레이블
{code.code}{code.label}
+ ) : ( +
프로젝트를 선택하세요.
+ )} +
+
+
+ )} +
+ + + {importMode ? ( + <> + + + + ) : ( + <> + + + + )} + +
+
+ ) +} + +export default ResultCodeDialog diff --git a/src/components/dialog/UserUpsertDialog.tsx b/src/components/dialog/UserUpsertDialog.tsx index c04984c..40ddec1 100644 --- a/src/components/dialog/UserUpsertDialog.tsx +++ b/src/components/dialog/UserUpsertDialog.tsx @@ -18,9 +18,10 @@ import { UserInfoSaveRequest } from '@/types/user' import KriPassword from "@/components/common/KriPassword"; import {KriSelect, KriSelectItem} from "@/components/common/KriSelect"; import {DataVerification} from "@/types/common"; -import commonConst from "@/config/commonConst"; import {apiError} from "@/lib/http-util"; import {KriSingleSelect} from "@/components/common/KriAutoComplete"; +import {USER_NAME_REGEX} from "@/const/userConst"; +import {NONE_HTTP_ERROR, UNKNOWN_HTTP_ERROR} from "@/const/commonConst"; export type UserUpsertDialogProps = { /** Jotai로 관리할 다이얼로그 ID (기본값: 'userUpsertDialog') */ @@ -151,19 +152,20 @@ const UserUpsertDialog = ({ alert('이름을 입력해주세요.'); return; } - if(!commonConst.nameRegex.test(formData.userName)){ + if(!USER_NAME_REGEX.test(formData.userName)){ alert('올바르지 않은 이름입니다.'); return; } - setIsSubmitting(true) + setIsSubmitting(true); + try { await onSubmit(formData as UserInfoSaveRequest); handleOpenChange(false); } catch (e) { const err = apiError(e); console.error(err.status, err.code, err.message); - if(err.code !== commonConst.noneHttpError && err.code !== commonConst.unknownHttpError){ + if(err.code !== NONE_HTTP_ERROR && err.code !== UNKNOWN_HTTP_ERROR){ alert(err.message); } else{ diff --git a/src/components/layout/BodyTitle.tsx b/src/components/layout/BodyTitle.tsx index f21f9f0..3822006 100644 --- a/src/components/layout/BodyTitle.tsx +++ b/src/components/layout/BodyTitle.tsx @@ -5,7 +5,7 @@ interface BodyTitleProps { const BodyTitle = ({titleText}:BodyTitleProps) => { return (
-

{titleText}

+

{titleText}

); } diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 60befb9..19a32bb 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -13,7 +13,6 @@ interface HeaderProps { menuOpen: boolean; activeTopId: string; fontSize: number; - handleIsProjectMenu: (isProjectMenu: boolean) => void; onToggleMenu: () => void; onNavigate: (path: string) => void; decreaseFontSize: () => void; @@ -25,12 +24,11 @@ export const Header = ({ menuOpen, activeTopId, fontSize, - handleIsProjectMenu, onToggleMenu, onNavigate, decreaseFontSize, increaseFontSize, - }: HeaderProps) => { +}: HeaderProps) => { const { auth } = useAuth(); const [userInfo, setUserInfo] = useState(undefined); @@ -38,6 +36,9 @@ export const Header = ({ if(auth.user){ setUserInfo(auth.user); } + else{ + onNavigate("/logout") + } }, [auth]) return ( @@ -79,10 +80,7 @@ export const Header = ({ diff --git a/src/components/layout/MainLayout.tsx b/src/components/layout/MainLayout.tsx index b28c560..c486a41 100644 --- a/src/components/layout/MainLayout.tsx +++ b/src/components/layout/MainLayout.tsx @@ -6,7 +6,10 @@ import { Header } from "@/components/layout/Header"; import { Sidebar } from "@/components/layout/Sidebar"; import {useFontSize} from "@/hooks/useFontSize"; import {projectSideMenus, manageSideMenus, topMenus} from "@/config/menu.data"; -import commonConst from "@/config/commonConst"; +import ProjectTitle from "@/components/layout/ProjectTitle"; +import {cn} from "@/lib/utils"; +import {FONT_SIZE} from "@/const/commonConst"; +import {useSelectedProject} from "@/hooks/useSelectedProject"; type MainLayoutProps = { children: ReactNode; @@ -17,13 +20,15 @@ const MainLayout = ({ children, initialFontSize }: MainLayoutProps) => { const router = useRouter(); const pathname = usePathname(); - const [isProjectMenu, setIsProjectMenu] = useState(false); + const { selectedProject } = useSelectedProject(); const [menuOpen, setMenuOpen] = useState(true); const [fontSize, setFontSize] = useFontSize(initialFontSize, { hydrateFromCookie: false }); const isMain = pathname === "/"; + const isProjectMenu = !pathname.startsWith("/manage"); + const isViewProjectTitle = !isMain && isProjectMenu && !pathname.startsWith("/project/info") const activeTop = topMenus.find((m) => m.match?.(pathname)) ?? topMenus[0]; - const sideMenus = pathname.startsWith("/manage") ? manageSideMenus : projectSideMenus; + const sideMenus = isProjectMenu ? projectSideMenus : manageSideMenus; // 2단 메뉴 open 상태 const [openMenus, setOpenMenus] = useState>(() => { @@ -43,10 +48,6 @@ const MainLayout = ({ children, initialFontSize }: MainLayoutProps) => { return initial; }); - const handleIsProjectMenu = (isProject: boolean) => { - setIsProjectMenu(isProject); - } - const movePage = (path: string) => { router.push(path); }; @@ -56,11 +57,11 @@ const MainLayout = ({ children, initialFontSize }: MainLayoutProps) => { }; const decreaseFontSize = () =>{ - setFontSize(Math.max(commonConst.fontSizeMin, fontSize - 2)); + setFontSize(Math.max(FONT_SIZE.MIN, fontSize - 2)); } const increaseFontSize = () =>{ - setFontSize(Math.min(commonConst.fontSizeMax, fontSize + 2)); + setFontSize(Math.min(FONT_SIZE.MAX, fontSize + 2)); } // CSS 변수 동기화 @@ -72,15 +73,25 @@ const MainLayout = ({ children, initialFontSize }: MainLayoutProps) => { ); }, [fontSize]); + useEffect(() => { + if(!isMain && isProjectMenu && !selectedProject){ + alert("옳지 않은 접근입니다."); + } + }, []); + return ( -
+
{/* 헤더 - 고정 폰트 크기 */}
setMenuOpen((prev) => !prev)} onNavigate={movePage} decreaseFontSize={decreaseFontSize} @@ -88,7 +99,7 @@ const MainLayout = ({ children, initialFontSize }: MainLayoutProps) => { /> {/* 본문 */} -
+
{/* 사이드바 - 고정 폰트 크기 */} {!isMain && ( { {/* 메인 콘텐츠만 가변 폰트 크기 적용 */}
+ {isViewProjectTitle && + + } {children}
diff --git a/src/components/layout/ProjectTitle.tsx b/src/components/layout/ProjectTitle.tsx new file mode 100644 index 0000000..916ba3c --- /dev/null +++ b/src/components/layout/ProjectTitle.tsx @@ -0,0 +1,17 @@ +import {useSelectedProject} from "@/hooks/useSelectedProject"; +import {useMounted} from "@/hooks/useMounted"; + +const ProjectTitle = () => { + const mounted = useMounted(); + const { selectedProject } = useSelectedProject(); + + if(!mounted) return null; + + return ( +
+

{selectedProject?.prjctName}

+
+ ); +} + +export default ProjectTitle \ No newline at end of file diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index ab2bb00..e8eee28 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -1,9 +1,11 @@ "use client"; import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; import { ChevronDown } from "lucide-react"; import { SideMenuItem } from "@/config/menu.types"; +import {KriSingleSelect} from "@/components/common/KriAutoComplete"; +import {useDebouncedValue} from "@/hooks/useDebouncedValue"; +import {SidebarProjectSearch} from "@/components/layout/SidebarProjectSearch "; interface SidebarProps { isProjectMenu: boolean; @@ -51,15 +53,9 @@ export const Sidebar = ({ `} >
- {isProjectMenu && ( -
- -
- )} + {isProjectMenu && + + } {/* 좌측 메뉴 */}
+
+ ) : ( +
+ + {placeholder} + + +
+ )} + + + setIsPopoverOpen(false)} + > + + {searchable && ( + + )} + {searchable && ( +
+ Type to filter options. Use arrow keys to navigate results. +
+ )} + e.stopPropagation()} + className={cn( + "min-h-0 max-h-[40vh] overflow-y-auto multiselect-scrollbar", + screenSize === "mobile" && "max-h-[50vh]", + "overscroll-behavior-y-contain" )} - {searchable && ( -
- Type to filter options. Use arrow keys to navigate results. -
- )} - - - {emptyIndicator || "검색 결과가 없습니다."} - - {!isSingle && !hideSelectAll && !searchValue && ( - - + > + + {emptyIndicator || "검색 결과가 없습니다."} + + {!isSingle && !hideSelectAll && !searchValue && ( + + + {!hideOptionCheck &&
( ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible" )} - aria-hidden="true"> - + aria-hidden="true" + > +
- - (전체 선택 - {getAllOptions().length > 20 - ? ` - ${getAllOptions().length} options` - : ""} - ) - -
-
- )} - {isGroupedOptions(filteredOptions) ? ( - filteredOptions.map((group) => ( - - {group.options.map((option) => { - const isSelected = selectedValues.includes( - option.value - ); - return ( - toggleOption(option.value)} - role="option" - aria-selected={isSelected} - aria-disabled={option.disabled} - aria-label={`${option.label}${ - isSelected ? ", selected" : ", not selected" - }${option.disabled ? ", disabled" : ""}`} - className={cn( - "cursor-pointer", - option.disabled && "opacity-50 cursor-not-allowed" - )} - disabled={option.disabled}> - - {option.icon && ( - - ); - })} - - )) - ) : ( - - {filteredOptions.map((option) => { - const isSelected = selectedValues.includes(option.value); + } + + (전체 선택 + {getAllOptions().length > 20 + ? ` - ${getAllOptions().length} options` + : ""} + ) + +
+
+ )} + {isGroupedOptions(filteredOptions) ? ( + filteredOptions.map((group) => ( + + {group.options.map((option) => { + const isSelected = selectedValues.includes( + option.value + ); return ( ( }${option.disabled ? ", disabled" : ""}`} className={cn( "cursor-pointer", - option.disabled && "opacity-50 cursor-not-allowed" + option.disabled && + "opacity-50 cursor-not-allowed" )} - disabled={option.disabled}> - + disabled={option.disabled} + > + {!hideOptionCheck && + + } {option.icon && ( ( ); })} - )} - - {/* + )) + ) : ( -
- {selectedValues.length > 0 && ( - <> - - Clear - - - - )} - setIsPopoverOpen(false)} - className="flex-1 justify-center cursor-pointer max-w-full"> - Close - -
+ {filteredOptions.map((option) => { + const isSelected = selectedValues.includes(option.value); + return ( + toggleOption(option.value)} + role="option" + aria-selected={isSelected} + aria-disabled={option.disabled} + aria-label={`${option.label}${ + isSelected ? ", selected" : ", not selected" + }${option.disabled ? ", disabled" : ""}`} + className={cn( + "cursor-pointer", + option.disabled && + "opacity-50 cursor-not-allowed" + )} + disabled={option.disabled} + > + {!hideOptionCheck && + + } + {option.icon && ( + + ); + })}
- */} -
-
-
- {animation > 0 && selectedValues.length > 0 && ( - setIsAnimating(!isAnimating)} - /> - )} - - - ); - } -); + )} + + + + + {animation > 0 && selectedValues.length > 0 && ( + setIsAnimating(!isAnimating)} + /> + )} + + + ); +} -MultiSelect.displayName = "MultiSelect"; -export type { MultiSelectOption, MultiSelectGroup, MultiSelectProps }; \ No newline at end of file +const ForwardedMultiSelect = React.forwardRef< + MultiSelectRef, + MultiSelectProps +>(MultiSelectInner); + +ForwardedMultiSelect.displayName = "MultiSelect"; + +/** + * 제네릭 friendly 타입 캐스팅 + * - 사용 시: ... /> + */ +export const MultiSelect = ForwardedMultiSelect as ( + props: MultiSelectProps & React.RefAttributes +) => React.ReactElement | null; \ No newline at end of file diff --git a/src/components/ui/tabs.tsx b/src/components/ui/tabs.tsx new file mode 100644 index 0000000..497ba5e --- /dev/null +++ b/src/components/ui/tabs.tsx @@ -0,0 +1,66 @@ +"use client" + +import * as React from "react" +import * as TabsPrimitive from "@radix-ui/react-tabs" + +import { cn } from "@/lib/utils" + +function Tabs({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function TabsList({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function TabsTrigger({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function TabsContent({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { Tabs, TabsList, TabsTrigger, TabsContent } diff --git a/src/config/commonConst.ts b/src/config/commonConst.ts deleted file mode 100644 index 9970d53..0000000 --- a/src/config/commonConst.ts +++ /dev/null @@ -1,12 +0,0 @@ -const commonConst = { - fontSizeDefault: 14, - fontSizeMin: 12, - fontSizeMax: 24, - externalUserRole: 4000, - unknownHttpError: 'UNKNOWN_HTTP_ERROR', - noneHttpError: 'NONE_HTTP_ERROR', - nameRegex: /^[가-힣A-Za-z][가-힣A-Za-z0-9_ ()]*$/, - defaultCmpn: 'KRI', -} as const; - -export default commonConst; \ No newline at end of file diff --git a/src/const/commonConst.ts b/src/const/commonConst.ts new file mode 100644 index 0000000..abae1df --- /dev/null +++ b/src/const/commonConst.ts @@ -0,0 +1,8 @@ +export const FONT_SIZE = { + DEFAULT: 14, + MIN: 12, + MAX: 24, +} as const; + +export const UNKNOWN_HTTP_ERROR = 'UNKNOWN_HTTP_ERROR'; +export const NONE_HTTP_ERROR = 'NONE_HTTP_ERROR'; \ No newline at end of file diff --git a/src/const/projectConst.ts b/src/const/projectConst.ts new file mode 100644 index 0000000..778a4b9 --- /dev/null +++ b/src/const/projectConst.ts @@ -0,0 +1,62 @@ +export enum SurveyType { + NONE = 0, + KON = 1, + KIWI = 2, + EXTERNAL = 99, +} + +export const SURVEY_TYPE_ORDER = [ + SurveyType.NONE, + SurveyType.KON, + SurveyType.KIWI, + SurveyType.EXTERNAL, +] as const; + +// 라벨 맵 (단일 소스) +export const SURVEY_TYPE_LABEL = { + [SurveyType.NONE]: "없음", + [SurveyType.KON]: "KON", + [SurveyType.KIWI]: "KIWI", + [SurveyType.EXTERNAL]: "외부 설문", +} as const satisfies Record; + +export enum ProjectStatus { + WAITING = 0, + IN_PROGRESS = 1, + COMPLETED = 10, +} + +export const PROJECT_STATUS_ORDER = [ + ProjectStatus.WAITING, + ProjectStatus.IN_PROGRESS, + ProjectStatus.COMPLETED, +] as const; + +export const PROJECT_STATUS_LABEL = { + [ProjectStatus.WAITING]: "대기", + [ProjectStatus.IN_PROGRESS]: "진행", + [ProjectStatus.COMPLETED]: "완료", +} as const satisfies Record; + +export const PROJECT_STATUS_CLASS = { + [ProjectStatus.WAITING]: "bg-yellow-100 text-yellow-800", + [ProjectStatus.IN_PROGRESS]: "bg-blue-100 text-blue-800", + [ProjectStatus.COMPLETED]: "bg-green-100 text-green-800", +} as const satisfies Record; + +// 옵션이 필요하면(셀렉트/라디오 등) 이것만 돌려 쓰기 +export const SURVEY_TYPE_OPTIONS = [ + { value: SurveyType.NONE, label: SURVEY_TYPE_LABEL[SurveyType.NONE] }, + { value: SurveyType.KON, label: SURVEY_TYPE_LABEL[SurveyType.KON] }, + { value: SurveyType.KIWI, label: SURVEY_TYPE_LABEL[SurveyType.KIWI] }, + { value: SurveyType.EXTERNAL, label: SURVEY_TYPE_LABEL[SurveyType.EXTERNAL] }, +] as const; + +export const PROJECT_STATUS_OPTIONS = [ + { value: ProjectStatus.WAITING, label: PROJECT_STATUS_LABEL[ProjectStatus.WAITING] }, + { value: ProjectStatus.IN_PROGRESS, label: PROJECT_STATUS_LABEL[ProjectStatus.IN_PROGRESS] }, + { value: ProjectStatus.COMPLETED, label: PROJECT_STATUS_LABEL[ProjectStatus.COMPLETED] }, +] as const; + +export const PROJECT_NAME_REGEX= /^[^\u0000-\u001F\u007F]+$/ +export const PROJECT_SEARCH_COUNT = 20 diff --git a/src/const/userConst.ts b/src/const/userConst.ts new file mode 100644 index 0000000..fe9c953 --- /dev/null +++ b/src/const/userConst.ts @@ -0,0 +1,8 @@ +export const EXTERNAL_USER_ROLE = 4000 +export const FW_USER_ROLE = 9000 + +export const USER_NAME_REGEX = /^[가-힣A-Za-z][가-힣A-Za-z0-9_ ()]*$/ +export const DEFAULT_COMPANY_NAME = 'KRI' + +export const FW_TEAM = "S101" +export const QC_TEAM = "S201" \ No newline at end of file diff --git a/src/hooks/useDebouncedValue.ts b/src/hooks/useDebouncedValue.ts new file mode 100644 index 0000000..db3641c --- /dev/null +++ b/src/hooks/useDebouncedValue.ts @@ -0,0 +1,12 @@ +import { useEffect, useState } from "react"; + +export function useDebouncedValue(value: T, delayMs = 1200) { + const [debounced, setDebounced] = useState(value); + + useEffect(() => { + const t = setTimeout(() => setDebounced(value), delayMs); + return () => clearTimeout(t); + }, [value, delayMs]); + + return debounced; +} \ No newline at end of file diff --git a/src/hooks/useFontSize.ts b/src/hooks/useFontSize.ts index e614e0d..f3df789 100644 --- a/src/hooks/useFontSize.ts +++ b/src/hooks/useFontSize.ts @@ -3,7 +3,7 @@ import { useCallback, useEffect, useState } from "react"; import { cookieStore } from "@/store/cookie/cookie"; import { CookieKeys } from "@/store/cookie/cookie-keys"; -import commonConst from "@/config/commonConst"; +import {FONT_SIZE} from "@/const/commonConst"; const MIN_FONT_SIZE = 12; const MAX_FONT_SIZE = 24; @@ -48,7 +48,7 @@ type UseFontSizeOptions = { } export const useFontSize = ( - defaultSize: number = commonConst.fontSizeDefault, + defaultSize: number = FONT_SIZE.DEFAULT, options: UseFontSizeOptions = {}, ) => { const { hydrateFromCookie = true } = options; @@ -100,7 +100,7 @@ export const useFontSize = ( export const useFontSizeValue = ( options: UseFontSizeOptions = {}, ) => { - const defaultSize = commonConst.fontSizeDefault; + const defaultSize = FONT_SIZE.DEFAULT; const [fontSize] = useFontSize(defaultSize, options); return fontSize; } \ No newline at end of file diff --git a/src/hooks/useItrntUserList.ts b/src/hooks/useItrntUserList.ts new file mode 100644 index 0000000..6e3d9f2 --- /dev/null +++ b/src/hooks/useItrntUserList.ts @@ -0,0 +1,109 @@ +"use client"; + +import { useCallback, useEffect, useRef, useState } from "react"; +import { StorageKeys } from "@/store/storage/storage-keys"; +import { useStorage } from "@/hooks/useStorage"; +import { nextApi } from "@/lib/http-client"; + +export type ItrntUserInfo = { + userId: string; + userNm: string; + userCmpn: string; + userTeam: string; + userRole: number; +}; + +let inFlight: Promise | null = null; + +export const useItrntUserList = () => { + const endpoint = "/intranet/user-list"; + const storage = useStorage(StorageKeys.ItrntUserList); + const { get, set, remove } = storage; + + // ✅ storage 함수 레퍼런스 고정(최신 함수는 effect로 갱신) + const storageRef = useRef({ get, set, remove }); + useEffect(() => { + storageRef.current = { get, set, remove }; + }, [get, set, remove]); + + const [users, setUsers] = useState([]); + const [isLoading, setIsLoading] = useState(true); + const [error, setError] = useState(null); + + const mountedRef = useRef(true); + useEffect(() => { + mountedRef.current = true; + return () => { + mountedRef.current = false; + }; + }, []); + + const fetchUsers = useCallback(async (): Promise => { + return await nextApi.get(endpoint); + }, [endpoint]); + + // ✅ ensure는 이제 storage 함수들에 "직접" 의존하지 않음(루프 차단) + const ensure = useCallback(async (force = false): Promise => { + const { get: sGet, set: sSet } = storageRef.current; + + if (!force) { + const cached = sGet(); + if (Array.isArray(cached)) return cached as ItrntUserInfo[]; + } + + if (!inFlight) { + inFlight = fetchUsers().finally(() => { + inFlight = null; + }); + } + + const list = await inFlight; + sSet(list); + return list; + }, [fetchUsers]); + + useEffect(() => { + (async () => { + setIsLoading(true); + setError(null); + + try { + const list = await ensure(false); + if (!mountedRef.current) return; + setUsers(list); + } catch (e) { + if (!mountedRef.current) return; + setUsers([]); + setError(e); + } finally { + if (!mountedRef.current) return; + setIsLoading(false); + } + })(); + }, [ensure]); + + const refresh = useCallback(async () => { + setIsLoading(true); + setError(null); + + try { + const list = await ensure(true); + if (!mountedRef.current) return; + setUsers(list); + } catch (e) { + if (!mountedRef.current) return; + setUsers([]); + setError(e); + } finally { + if (!mountedRef.current) return; + setIsLoading(false); + } + }, [ensure]); + + const clearCache = useCallback(() => { + storageRef.current.remove(); + setUsers([]); + }, []); + + return { users, isLoading, error, refresh, clearCache } as const; +}; \ No newline at end of file diff --git a/src/hooks/useMounted.ts b/src/hooks/useMounted.ts new file mode 100644 index 0000000..a39831c --- /dev/null +++ b/src/hooks/useMounted.ts @@ -0,0 +1,7 @@ +import { useEffect, useState } from "react"; + +export const useMounted = () => { + const [mounted, setMounted] = useState(false); + useEffect(() => setMounted(true), []); + return mounted; +}; \ No newline at end of file diff --git a/src/lib/env.server.ts b/src/lib/env.server.ts index 0847b17..537cb4f 100644 --- a/src/lib/env.server.ts +++ b/src/lib/env.server.ts @@ -7,5 +7,8 @@ const required = (name: string) => { export const serverEnv = { ENV: required("ENV"), API_CONTACT_SERVER: required("API_CONTACT_SERVER"), + API_INTRANET_SERVER: required("API_INTRANET_SERVER"), + API_KART_SERVER: required("API_KART_SERVER"), + KART_API_KEY: required("KART_API_KEY"), // 다른 서버 전용 env들 추가 가능 }; \ No newline at end of file diff --git a/src/lib/http-util.ts b/src/lib/http-util.ts index f6593d2..15a9a51 100644 --- a/src/lib/http-util.ts +++ b/src/lib/http-util.ts @@ -1,7 +1,7 @@ import {NextResponse} from "next/server"; import {HttpError} from "@/lib/http-client"; import {clientEnv} from "@/lib/env.client"; -import commonConst from "@/config/commonConst"; +import {NONE_HTTP_ERROR, UNKNOWN_HTTP_ERROR} from "@/const/commonConst"; export type ApiError = { status: number @@ -26,7 +26,7 @@ const isDev = clientEnv.ENV !== "prod" export const apiError = (e: unknown): ApiError => { if (e instanceof HttpError) { const d = e.data as any - const code = typeof d?.code === "string" ? d.code : commonConst.unknownHttpError + const code = typeof d?.code === "string" ? d.code : UNKNOWN_HTTP_ERROR const message = (typeof d?.detail === "string" && d.detail) || (typeof d?.message === "string" && d.message) || @@ -48,5 +48,5 @@ export const apiError = (e: unknown): ApiError => { } if (isDev) console.error("[NON-HTTP ERROR]", e) - return { status: 500, code: commonConst.noneHttpError, message: "저장에 실패했습니다." } + return { status: 500, code: NONE_HTTP_ERROR, message: "저장에 실패했습니다." } } diff --git a/src/lib/server-api.ts b/src/lib/server-api.ts index 431f070..f183ec3 100644 --- a/src/lib/server-api.ts +++ b/src/lib/server-api.ts @@ -2,15 +2,29 @@ import { cookies } from "next/headers"; import { createHttpClient } from "@/lib/http-client"; import { serverEnv } from "@/lib/env.server"; -const createServerApi = async (rootUrl: string) => { +const createServerApi = async (rootUrl: string, defaultHeaders?: Record) => { const cookieStore = await cookies(); const accessToken = cookieStore.get("access_token")?.value ?? null; return createHttpClient(rootUrl, { getToken: () => accessToken, // 이미 위에서 읽은 값만 참조 + defaultHeaders: { + "content-type": "application/json", + ...(defaultHeaders ?? {}), + }, }); }; export const createContactApi = () => { return createServerApi(serverEnv.API_CONTACT_SERVER); -} \ No newline at end of file +} + +export const createIntranetApi = () => { + return createServerApi(serverEnv.API_INTRANET_SERVER); +} + +export const createKartApi = () => { + return createServerApi(serverEnv.API_KART_SERVER, { + "X-API-Key": serverEnv.KART_API_KEY, + }); +}; \ No newline at end of file diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 03b59ae..d0db4fd 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -5,6 +5,21 @@ export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } +export function getKeyByValue< + const T extends Record +>(map: T, value: T[keyof T]) { + const entry = Object.entries(map).find(([, v]) => v === value); + return entry ? (entry[0] as keyof T) : undefined; +} + +export function getNumberKeyByValue( + map: Record, + value: string +): number | undefined { + const entry = Object.entries(map).find(([, v]) => v === value); + return entry ? Number(entry[0]) : undefined; +} + export function buildUrlWithParams( targetPath: string, from: Record, diff --git a/src/store/jotai/dialog.ts b/src/store/jotai/dialog.ts index b5c7a80..e51e294 100644 --- a/src/store/jotai/dialog.ts +++ b/src/store/jotai/dialog.ts @@ -3,9 +3,12 @@ import { atom } from 'jotai' // 사용할 수 있는 DialogId를 타입으로 고정 // Dialog추가 할 때만다 추가하기 export type DialogId = - | 'userUpsertDialog' - | 'userUploadDialog' - | 'listUploadDialog' +| 'userUpsertDialog' +| 'userUploadDialog' +| 'listUploadDialog' +| 'projectCreateDialog' +| 'resultCodeDialog' +| 'resultCodeCopyDialog' // 현재 열려 있는 다이얼로그 ID 리스트 export const openDialogIdsAtom = atom([]) \ No newline at end of file diff --git a/src/store/jotai/project.ts b/src/store/jotai/project.ts index 6b3b6c4..dbed348 100644 --- a/src/store/jotai/project.ts +++ b/src/store/jotai/project.ts @@ -2,12 +2,13 @@ import { StorageKeys } from "@/store/storage/storage-keys"; import {createSessionStorageAtom} from "@/store/jotai/utils"; -import {AuthState} from "@/store/jotai/auth"; export type SelectedProject = { - id: string; - name: string; - // 필요하면 여기서 추가 (code, status 등) + prjctIdx: number; + prjctCd: string + prjctName: string; + ownerDept: string; + ownerFw: string; }; /** diff --git a/src/store/storage/storage-keys.ts b/src/store/storage/storage-keys.ts index faf4366..968879b 100644 --- a/src/store/storage/storage-keys.ts +++ b/src/store/storage/storage-keys.ts @@ -3,6 +3,7 @@ export const StorageKeys = { SeatNumber: "kri:seatNumber", LoginType: "kri:loginType", SelectedProject: "kri:selectedProject", + ItrntUserList:"kri:itrntUserList", //SidebarCollapsed: "kri:sidebarCollapsed", // 필요하면 여기 계속 추가 } as const; @@ -12,6 +13,7 @@ export const StorageType: Record = { [StorageKeys.SeatNumber]: "local", [StorageKeys.LoginType]: "local", [StorageKeys.SelectedProject]: "session", + [StorageKeys.ItrntUserList]: "session", }; export type StorageKey = (typeof StorageKeys)[keyof typeof StorageKeys]; \ No newline at end of file diff --git a/src/types/common.ts b/src/types/common.ts index 1453e19..9bf429c 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -4,4 +4,16 @@ export type DataVerification = { errMessage: string; } -export type RouteContext = { params: Promise<{ slug?: string[] }> }; \ No newline at end of file +export type RouteContext = { params: Promise<{ slug?: string[] }> }; + +export type PageResponse = { + content: T[]; + totalElements: number; + totalPages: number; + pageIndex: number; + pageSize: number; + numberOfElements: number; + first: boolean; + last: boolean; + empty: boolean; +} \ No newline at end of file diff --git a/src/types/project.ts b/src/types/project.ts new file mode 100644 index 0000000..1e64082 --- /dev/null +++ b/src/types/project.ts @@ -0,0 +1,70 @@ +import {ProjectStatus, SurveyType} from "@/const/projectConst"; + +export type ProjectInfo = { + prjctIdx: number; // Long + prjctCd: string; + prjctStatus: ProjectStatus; + prjctName: string; + itrntPrjctCd: string; + ownerDept: string; + ownerFw: string; + surveyTy: SurveyType; + surveyPrjctCd?: string; + surveyUrl?: string; + ff: boolean; + useContactSenario: boolean; + contactSenario?: string; + regUser: string; + regDt: string; + modUser?: string; + modDt?: string; +}; + +export type ProjectCreateRequest = { + prjctName: string; + itrntPrjctCd: string; + ownerDept: string; + ownerFw: string; +} + +export type ProjectListQuery = { + prjctText: string; + prjctStatusList: ProjectStatus[]; + ownerDeptList: string[]; + ownerFwList: string[]; +} + +export type ProjectListRequest = { + prjctText: string; + prjctStatusList: ProjectStatus[]; + ownerDeptList: string[]; + ownerFwList: string[]; + + pageIndex: number; + pageSize: number; + + sortBy: string; + sortDir: "asc" | "desc"; +} + +export type ProjectOwnerResponse = { + ownerDeptList:string[]; + ownerFwList:string[]; +} + +export type IntranetProjectSearchResponse = { + childSn: string; + title: string; + researchTeam: string; + researchTeamName: string; +} + +export type KonKiwiProjectInfo = { + pkey:string; + title:string; + surveyType:string; + status:string; + gkey:string; + mkey:string; + createDate:string; +} \ No newline at end of file diff --git a/src/types/user.ts b/src/types/user.ts index ffc91cd..23268a7 100644 --- a/src/types/user.ts +++ b/src/types/user.ts @@ -1,3 +1,11 @@ +export type ItrntUserInfo = { + userId: string; + userNm: string; + userCmpn: string; + userTeam: string; + userRole: number; +}; + export type UserInfo = { /** 사용자 ID */ userId: string @@ -33,15 +41,6 @@ export type UserInfoSaveRequest = { memo?: string } -export type UserTableInfo = { - userId: string - userCmpn: string - userName: string - userRole: string - regDt: string - memo: string -} - export type UserUploadResponse = { totalCount: number; successCount: number; @@ -49,4 +48,4 @@ export type UserUploadResponse = { hasErrorFile: boolean; errorFileName: string | null; errorFileBase64: string | null; -}; +}; \ No newline at end of file