convex-cms 0.0.3 → 0.0.5-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -13
- package/admin-dist/nitro.json +1 -1
- package/admin-dist/public/assets/{CmsEmptyState-CRswfTzk.js → CmsEmptyState-CiMQwSQV.js} +2 -2
- package/admin-dist/public/assets/{CmsPageHeader-CirpXndm.js → CmsPageHeader-ohOq0luT.js} +1 -1
- package/admin-dist/public/assets/{CmsStatusBadge-CbEUpQu-.js → CmsStatusBadge-BdNf0V9v.js} +1 -1
- package/admin-dist/public/assets/CmsSurface-CWup6Jh7.js +1 -0
- package/admin-dist/public/assets/{CmsToolbar-BI2nZOXp.js → CmsToolbar-cEBlCHa3.js} +1 -1
- package/admin-dist/public/assets/{ContentEntryEditor-CBeCyK_m.js → ContentEntryEditor-BY5ypfUs.js} +1 -1
- package/admin-dist/public/assets/{ErrorState-BIVaWmom.js → ErrorState-C4nJ-ml4.js} +1 -1
- package/admin-dist/public/assets/{TaxonomyFilter-ChaY6Y_x.js → TaxonomyFilter-BgE_SR_O.js} +1 -1
- package/admin-dist/public/assets/{_contentTypeId-DQ8k_Rvw.js → _contentTypeId-DtZectcC.js} +1 -1
- package/admin-dist/public/assets/{_entryId-CKU_glsK.js → _entryId-BpSmrfAm.js} +1 -1
- package/admin-dist/public/assets/alert-Bf2l8kxw.js +1 -0
- package/admin-dist/public/assets/{badge-hvUOzpVZ.js → badge-qPrc4AUM.js} +1 -1
- package/admin-dist/public/assets/{circle-check-big-CF_pR17r.js → circle-check-big-Dgozy3vV.js} +1 -1
- package/admin-dist/public/assets/{command-DU82cJlt.js → command-QOmNhlb0.js} +1 -1
- package/admin-dist/public/assets/content-OEBGlxg1.js +1 -0
- package/admin-dist/public/assets/content-types-CjQliqVV.js +2 -0
- package/admin-dist/public/assets/{globals-CS6BZ0zp.css → globals-hAmgC66w.css} +1 -1
- package/admin-dist/public/assets/index-BH_ECMhv.js +1 -0
- package/admin-dist/public/assets/{label-KNtpL71g.js → label-DCsUdvFh.js} +1 -1
- package/admin-dist/public/assets/{link-2-Bw2aI4V4.js → link-2-Czw1N61H.js} +1 -1
- package/admin-dist/public/assets/{list-sYepHjt_.js → list-DtCsXj8-.js} +1 -1
- package/admin-dist/public/assets/{main-CKj5yfEi.js → main-CXgkZMhe.js} +3 -3
- package/admin-dist/public/assets/{media-Bkrkffm7.js → media-DTJ3-ViE.js} +1 -1
- package/admin-dist/public/assets/{new._contentTypeId-C3LstjNs.js → new._contentTypeId-CoTDxKzf.js} +1 -1
- package/admin-dist/public/assets/{plus-DUn8v_Xf.js → plus-xCFJK0RC.js} +1 -1
- package/admin-dist/public/assets/{rotate-ccw-DJEoHcRI.js → rotate-ccw-DIqK63wY.js} +1 -1
- package/admin-dist/public/assets/scroll-area-B-yrE66a.js +1 -0
- package/admin-dist/public/assets/{search-MuAUDJKR.js → search-CbCbboeU.js} +1 -1
- package/admin-dist/public/assets/select-Co3TZFJb.js +1 -0
- package/admin-dist/public/assets/settings-BspTTv_o.js +1 -0
- package/admin-dist/public/assets/switch-CfavASmR.js +1 -0
- package/admin-dist/public/assets/tabs-CN5s5u2W.js +1 -0
- package/admin-dist/public/assets/tanstack-adapter-npeE3RdY.js +1 -0
- package/admin-dist/public/assets/taxonomies-CgG46fIF.js +1 -0
- package/admin-dist/public/assets/{textarea-BTy7nwzR.js → textarea-BJ0XFZpT.js} +1 -1
- package/admin-dist/public/assets/trash-B3daldm5.js +1 -0
- package/admin-dist/public/assets/{triangle-alert-E52Vfeuh.js → triangle-alert-BZRcqsUg.js} +1 -1
- package/admin-dist/public/assets/useBreadcrumbLabel-DwZlwvFF.js +1 -0
- package/admin-dist/public/assets/{usePermissions-Basjs9BT.js → usePermissions-C1JQhfqb.js} +1 -1
- package/admin-dist/server/_chunks/_libs/@tanstack/react-router.mjs +7 -0
- package/admin-dist/server/_ssr/{badge-6BsP37vG.mjs → CmsButton-B45JAKR1.mjs} +33 -33
- package/admin-dist/server/_ssr/{CmsEmptyState-DU7-7-mV.mjs → CmsEmptyState-D_BQFAVR.mjs} +2 -2
- package/admin-dist/server/_ssr/{CmsPageHeader-CseW0AHm.mjs → CmsPageHeader-CrUZA59A.mjs} +1 -1
- package/admin-dist/server/_ssr/{CmsStatusBadge-B_pi4KCp.mjs → CmsStatusBadge-B-sj6yaj.mjs} +2 -2
- package/admin-dist/server/_ssr/CmsSurface-DKJZhpjk.mjs +44 -0
- package/admin-dist/server/_ssr/{CmsToolbar-X75ex6ek.mjs → CmsToolbar-ByaW5iXf.mjs} +2 -2
- package/admin-dist/server/_ssr/{ContentEntryEditor-CepusRsA.mjs → ContentEntryEditor-D3_Jb1dq.mjs} +11 -11
- package/admin-dist/server/_ssr/{TaxonomyFilter-Bwrq0-cz.mjs → TaxonomyFilter-BRJkuCtA.mjs} +4 -4
- package/admin-dist/server/_ssr/{_contentTypeId-BqYKEcLr.mjs → _contentTypeId-B9kA6CaM.mjs} +11 -11
- package/admin-dist/server/_ssr/{_entryId-CRfnqeDf.mjs → _entryId-BddcMkZN.mjs} +14 -14
- package/admin-dist/server/_ssr/_tanstack-start-manifest_v-Dd7AmelK.mjs +4 -0
- package/admin-dist/server/_ssr/{command-fy8epIKf.mjs → command-CGtVr8Gb.mjs} +1 -1
- package/admin-dist/server/_ssr/{content-B5RhL7uW.mjs → content-D1tbeOd0.mjs} +201 -86
- package/admin-dist/server/_ssr/{content-types-BIOqCQYN.mjs → content-types-BZqY_BER.mjs} +279 -103
- package/admin-dist/server/_ssr/{index-DHSHDPt1.mjs → index-BIdq4xaC.mjs} +88 -17
- package/admin-dist/server/_ssr/index.mjs +2 -2
- package/admin-dist/server/_ssr/{label-C8Dko1j7.mjs → label-T-QNKAr6.mjs} +1 -1
- package/admin-dist/server/_ssr/{media-CSx3XttC.mjs → media-C-xqjBrl.mjs} +40 -40
- package/admin-dist/server/_ssr/{new._contentTypeId-DzanEZQM.mjs → new._contentTypeId-DWic9cRq.mjs} +13 -13
- package/admin-dist/server/_ssr/{router-DDWcF-kt.mjs → router-D1BMAMJT.mjs} +11 -11
- package/admin-dist/server/_ssr/{scroll-area-bjPYwhXN.mjs → scroll-area-C0pic_WA.mjs} +1 -1
- package/admin-dist/server/_ssr/{select-BUhDDf4T.mjs → select-CqmuN2F6.mjs} +1 -1
- package/admin-dist/server/_ssr/{settings-DAsxnw2q.mjs → settings-CAkncGGV.mjs} +211 -129
- package/admin-dist/server/_ssr/{switch-BgyRtQ1Z.mjs → switch-CgmuJkT9.mjs} +1 -1
- package/admin-dist/server/_ssr/{tabs-DzMdRB1A.mjs → tabs-CnMj0aRy.mjs} +5 -3
- package/admin-dist/server/_ssr/tanstack-adapter-BXZrMauE.mjs +119 -0
- package/admin-dist/server/_ssr/{taxonomies-C8j8g5Q5.mjs → taxonomies-thl3BfVm.mjs} +168 -68
- package/admin-dist/server/_ssr/{textarea-9jNeYJSc.mjs → textarea-4K5OJgeh.mjs} +1 -1
- package/admin-dist/server/_ssr/{trash-DYMxwhZB.mjs → trash-B40Gx5zP.mjs} +206 -86
- package/admin-dist/server/_ssr/{useBreadcrumbLabel-FNSAr2Ha.mjs → useBreadcrumbLabel-rn-fL4zV.mjs} +1 -1
- package/admin-dist/server/_ssr/{usePermissions-BJGGahrJ.mjs → usePermissions-CKeM6_Vw.mjs} +1 -1
- package/admin-dist/server/index.mjs +194 -180
- package/dist/cli/commands/init.d.ts +6 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +156 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/client/admin-config.d.ts +2 -2
- package/dist/client/admin-config.js +2 -2
- package/dist/client/adminApi.d.ts +1877 -1851
- package/dist/client/adminApi.d.ts.map +1 -1
- package/dist/client/adminApi.js +649 -629
- package/dist/client/adminApi.js.map +1 -1
- package/dist/client/agentTools.d.ts +7 -17
- package/dist/client/agentTools.d.ts.map +1 -1
- package/dist/client/agentTools.js +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +4 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/schema/codegen.d.ts +2 -2
- package/dist/client/schema/codegen.d.ts.map +1 -1
- package/dist/client/schema/codegen.js +3 -3
- package/dist/client/schema/codegen.js.map +1 -1
- package/dist/client/schema/defineContentType.d.ts +3 -3
- package/dist/client/schema/defineContentType.js +3 -3
- package/dist/client/schema/index.d.ts +7 -7
- package/dist/client/schema/index.d.ts.map +1 -1
- package/dist/client/schema/index.js +5 -5
- package/dist/client/schema/index.js.map +1 -1
- package/dist/client/schema/schemaDrift.d.ts +1 -1
- package/dist/client/schema/schemaDrift.js +1 -1
- package/dist/client/schema/typedClient.d.ts +2 -2
- package/dist/client/schema/typedClient.js +2 -2
- package/dist/client/schema/types.d.ts +1 -1
- package/dist/client/schema/types.js +1 -1
- package/dist/client/wrapper.d.ts +108 -65
- package/dist/client/wrapper.d.ts.map +1 -1
- package/dist/client/wrapper.js +22 -22
- package/dist/client/wrapper.js.map +1 -1
- package/dist/component/convex.config.d.ts +2 -2
- package/dist/component/convex.config.js +2 -2
- package/dist/component/index.d.ts +1 -1
- package/dist/component/index.js +1 -1
- package/dist/component/lib/ragContentChunker.d.ts +1 -1
- package/dist/component/lib/ragContentChunker.js +1 -1
- package/dist/component/roles.d.ts +1 -1
- package/dist/component/roles.js +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +13 -7
- package/dist/react/index.js.map +1 -1
- package/dist/test.d.ts +2 -2
- package/dist/test.js +2 -2
- package/package.json +31 -11
- package/admin-dist/public/assets/alert-BXjTqrwQ.js +0 -1
- package/admin-dist/public/assets/content-_LXl3pp7.js +0 -1
- package/admin-dist/public/assets/content-types-KjxaXGxY.js +0 -2
- package/admin-dist/public/assets/index-DNGIZHL-.js +0 -1
- package/admin-dist/public/assets/scroll-area-DfIlT0in.js +0 -1
- package/admin-dist/public/assets/select-BD29IXCI.js +0 -1
- package/admin-dist/public/assets/settings-DmMyn_6A.js +0 -1
- package/admin-dist/public/assets/switch-h3Rrnl5i.js +0 -1
- package/admin-dist/public/assets/tabs-imc8h-Dp.js +0 -1
- package/admin-dist/public/assets/taxonomies-dAsrT65H.js +0 -1
- package/admin-dist/public/assets/trash-SAWKZZHv.js +0 -1
- package/admin-dist/public/assets/useBreadcrumbLabel-BECBMCzM.js +0 -1
- package/admin-dist/server/_ssr/_tanstack-start-manifest_v-BwDlABVk.mjs +0 -4
- package/admin-dist/server/_ssr/alert-CVt45UUP.mjs +0 -92
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,oDAAoD;AACpD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,kCAAkC;AAClC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIxE,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF,SAAS,gBAAgB;IACvB,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AACvE,CAAC;AAED,SAAS,kBA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* } from "
|
|
18
|
+
* } from "convex-cms/test";
|
|
19
19
|
* import schema from "./schema";
|
|
20
20
|
*
|
|
21
21
|
* const modules = import.meta.glob("./**\/*.ts");
|
|
@@ -130,7 +130,7 @@ export type MediaFolderData = Omit<MediaFolderInternal, "_id" | "_creationTime">
|
|
|
130
130
|
* @example
|
|
131
131
|
* ```typescript
|
|
132
132
|
* import { convexTest } from "convex-test";
|
|
133
|
-
* import { register } from "
|
|
133
|
+
* import { register } from "convex-cms/test";
|
|
134
134
|
* import schema from "./schema";
|
|
135
135
|
*
|
|
136
136
|
* const modules = import.meta.glob("./**\/*.ts");
|
package/dist/test.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* contentTypeFactory,
|
|
17
17
|
* contentEntryFactory,
|
|
18
18
|
* assertContentType,
|
|
19
|
-
* } from "
|
|
19
|
+
* } from "convex-cms/test";
|
|
20
20
|
* import schema from "./schema";
|
|
21
21
|
*
|
|
22
22
|
* const modules = import.meta.glob("./**\/*.ts");
|
|
@@ -62,7 +62,7 @@ const modules = import.meta.glob("./component/**/*.js");
|
|
|
62
62
|
* @example
|
|
63
63
|
* ```typescript
|
|
64
64
|
* import { convexTest } from "convex-test";
|
|
65
|
-
* import { register } from "
|
|
65
|
+
* import { register } from "convex-cms/test";
|
|
66
66
|
* import schema from "./schema";
|
|
67
67
|
*
|
|
68
68
|
* const modules = import.meta.glob("./**\/*.ts");
|
package/package.json
CHANGED
|
@@ -1,31 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "convex-cms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5-alpha.0",
|
|
4
4
|
"description": "A developer-first Convex Component for content management with flexible RBAC and AI-ready architecture",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
7
7
|
"admin"
|
|
8
8
|
],
|
|
9
9
|
"main": "./dist/client/index.js",
|
|
10
|
+
"module": "./dist/client/index.js",
|
|
10
11
|
"types": "./dist/client/index.d.ts",
|
|
11
12
|
"exports": {
|
|
13
|
+
"./package.json": "./package.json",
|
|
12
14
|
".": {
|
|
13
15
|
"types": "./dist/client/index.d.ts",
|
|
14
|
-
"
|
|
16
|
+
"default": "./dist/client/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./convex.config.js": {
|
|
19
|
+
"types": "./dist/component/convex.config.d.ts",
|
|
20
|
+
"default": "./dist/component/convex.config.js"
|
|
21
|
+
},
|
|
22
|
+
"./convex.config": {
|
|
23
|
+
"types": "./dist/component/convex.config.d.ts",
|
|
24
|
+
"default": "./dist/component/convex.config.js"
|
|
15
25
|
},
|
|
16
|
-
"./convex.config": "./dist/component/convex.config.js",
|
|
17
26
|
"./types": {
|
|
18
27
|
"types": "./dist/client/types.d.ts",
|
|
19
|
-
"
|
|
28
|
+
"default": "./dist/client/types.js"
|
|
20
29
|
},
|
|
21
30
|
"./react": {
|
|
22
31
|
"types": "./dist/react/index.d.ts",
|
|
23
|
-
"
|
|
32
|
+
"default": "./dist/react/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./_generated/component.js": {
|
|
35
|
+
"types": "./dist/component/_generated/component.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./_generated/component": {
|
|
38
|
+
"types": "./dist/component/_generated/component.d.ts"
|
|
24
39
|
},
|
|
25
|
-
"./_generated/component": "./dist/component/_generated/component.js",
|
|
26
40
|
"./test": {
|
|
27
41
|
"types": "./dist/test.d.ts",
|
|
28
|
-
"
|
|
42
|
+
"default": "./dist/test.js"
|
|
29
43
|
}
|
|
30
44
|
},
|
|
31
45
|
"files": [
|
|
@@ -48,11 +62,13 @@
|
|
|
48
62
|
"dev:build": "tsc --project tsconfig.build.json --watch",
|
|
49
63
|
"dev:example": "cd example && npx convex dev",
|
|
50
64
|
"dev:watch": "chokidar 'src/**/*.ts' -c 'npm run build:component' --silent",
|
|
51
|
-
"test": "vitest run",
|
|
65
|
+
"test": "vitest run --typecheck",
|
|
66
|
+
"test:watch": "vitest --typecheck",
|
|
52
67
|
"lint": "eslint src/",
|
|
53
68
|
"typecheck": "tsc --noEmit",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
69
|
+
"preversion": "npm run build:clean && npm run test && npm run lint && npm run typecheck",
|
|
70
|
+
"alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha && git push --follow-tags",
|
|
71
|
+
"release": "npm version patch && npm publish && git push --follow-tags"
|
|
56
72
|
},
|
|
57
73
|
"keywords": [
|
|
58
74
|
"convex",
|
|
@@ -72,11 +88,15 @@
|
|
|
72
88
|
},
|
|
73
89
|
"homepage": "https://github.com/obkaro/convex-cms#readme",
|
|
74
90
|
"peerDependencies": {
|
|
91
|
+
"convex": "^1.31.6",
|
|
92
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
75
93
|
"@convex-dev/agent": "^0.3.0",
|
|
76
|
-
"convex": "^1.17.0",
|
|
77
94
|
"zod": "^3.23.0"
|
|
78
95
|
},
|
|
79
96
|
"peerDependenciesMeta": {
|
|
97
|
+
"react": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
80
100
|
"@convex-dev/agent": {
|
|
81
101
|
"optional": true
|
|
82
102
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,c as r,i}from"./main-CKj5yfEi.js";const o={base:"surface-base",elevated:"surface-elevated",floating:"surface-floating"},c={none:"",sm:"p-3",md:"p-4",lg:"p-6"},u={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"};function f({elevation:t="base",padding:e="md",rounded:a="lg",className:d,children:n,...l}){return s.jsx("div",{className:r(o[t],c[e],u[a],d),...l,children:n})}const g=i("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function m({className:t,variant:e,...a}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:r(g({variant:e}),t),...a})}function p({className:t,...e}){return s.jsx("div",{"data-slot":"alert-description",className:r("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}export{m as A,f as C,p as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r,b as A,a as y,p as J,u as L,D as K,k as W,C as Z,l as ee,m as se,F as te,w as I,c as ae}from"./main-CKj5yfEi.js";import{u as ne}from"./usePermissions-Basjs9BT.js";import{C as c,B as re,X as le}from"./badge-hvUOzpVZ.js";import{c as ie,I as ce,C as oe,a as P}from"./CmsEmptyState-CRswfTzk.js";import{S as O,a as F,b as V,c as R,d as N}from"./select-BD29IXCI.js";import{E as de,a as $}from"./ErrorState-BIVaWmom.js";import{C as me}from"./circle-check-big-CF_pR17r.js";import{T as ue}from"./triangle-alert-E52Vfeuh.js";import{C as _}from"./CmsPageHeader-CirpXndm.js";import{C as he}from"./CmsToolbar-BI2nZOXp.js";import{C as xe}from"./CmsStatusBadge-CbEUpQu-.js";import{P as pe}from"./plus-DUn8v_Xf.js";import{S as fe}from"./search-MuAUDJKR.js";const je={publish:{title:"Publish Items",description:"This will publish all selected items, making them publicly visible.",confirmLabel:"Publish All",confirmVariant:"success"},unpublish:{title:"Unpublish Items",description:"This will unpublish all selected items, changing them back to draft status.",confirmLabel:"Unpublish All",confirmVariant:"warning"},delete:{title:"Delete Items",description:"This will move all selected items to trash.",warning:"Items in trash can be restored within the retention period.",confirmLabel:"Delete All",confirmVariant:"danger"},archive:{title:"Archive Items",description:"This will archive all selected items.",confirmLabel:"Archive All",confirmVariant:"secondary"}};function be({action:a,count:o,isProcessing:m,result:t,onConfirm:b,onCancel:u}){const l=je[a];return e.jsx(ie,{open:!0,onOpenChange:h=>!h&&!m&&u(),title:l.title,size:"sm",footer:t?e.jsx(c,{variant:"primary",onClick:u,children:t.failed===0?"Done":"Close"}):e.jsxs(e.Fragment,{children:[e.jsx(c,{variant:"outline",onClick:u,disabled:m,children:"Cancel"}),e.jsx(c,{variant:l.confirmVariant,onClick:b,loading:m,children:l.confirmLabel})]}),children:t?e.jsx("div",{className:"space-y-4",children:t.failed===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-4 text-center",children:[e.jsx("div",{className:"flex size-12 items-center justify-center rounded-full bg-emerald-100 text-emerald-600",children:e.jsx(me,{className:"size-6"})}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Successfully processed"," ",e.jsx("span",{className:"font-semibold text-foreground",children:t.succeeded})," ",t.succeeded===1?"item":"items"]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"rounded-lg border border-emerald-200 bg-emerald-50 p-3 text-center",children:[e.jsx("p",{className:"text-2xl font-semibold text-emerald-700",children:t.succeeded}),e.jsx("p",{className:"text-xs text-emerald-600",children:"Succeeded"})]}),e.jsxs("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 text-center",children:[e.jsx("p",{className:"text-2xl font-semibold text-red-700",children:t.failed}),e.jsx("p",{className:"text-xs text-red-600",children:"Failed"})]})]}),t.errors&&t.errors.length>0&&e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3",children:[e.jsx("p",{className:"mb-2 text-sm font-medium text-amber-800",children:"Errors:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-amber-700",children:[t.errors.slice(0,5).map((h,i)=>e.jsxs("li",{className:"truncate",children:["• ",h]},i)),t.errors.length>5&&e.jsxs("li",{className:"text-amber-600",children:["...and ",t.errors.length-5," more errors"]})]})]})]})}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You are about to ",a," ",e.jsxs("span",{className:"font-semibold text-foreground",children:[o," ",o===1?"item":"items"]}),"."]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l.description}),l.warning&&e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-amber-200 bg-amber-50 p-3",children:[e.jsx(ue,{className:"mt-0.5 size-4 shrink-0 text-amber-600"}),e.jsxs("p",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-medium",children:"Note:"})," ",l.warning]})]})]})})}function ge({selectedIds:a,onClearSelection:o,onOperationComplete:m}){const[t,b]=r.useState(null),[u,l]=r.useState(!1),[h,i]=r.useState(null),d=A(y.bulkOperations.bulkPublish),g=A(y.bulkOperations.bulkUnpublish),w=A(y.bulkOperations.bulkDelete),S=A(y.bulkOperations.bulkUpdate),x=r.useCallback(n=>{b(n),i(null)},[]),p=r.useCallback(async()=>{if(!(!t||a.length===0)){l(!0),i(null);try{let n;switch(t){case"publish":n=await d({ids:a,changeDescription:"Bulk published from admin"});break;case"unpublish":n=await g({ids:a});break;case"delete":n=await w({ids:a,hardDelete:!1});break;case"archive":n=await S({ids:a,status:"archived"});break;default:throw new Error(`Unknown action: ${t}`)}i({succeeded:n.succeeded,failed:n.failed,errors:n.errors?.map(f=>`${f.id}: ${f.error}`)}),n.failed===0&&setTimeout(()=>{b(null),o(),m?.()},1500)}catch(n){const f=n instanceof Error?n.message:"Operation failed";i({succeeded:0,failed:a.length,errors:[f]})}finally{l(!1)}}},[t,a,d,g,w,S,o,m]),v=r.useCallback(()=>{b(null),i(null)},[]);return a.length===0?null:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 border-t bg-background/95 px-6 py-3 shadow-lg backdrop-blur supports-[backdrop-filter]:bg-background/80",children:e.jsxs("div",{className:"mx-auto flex max-w-7xl items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(re,{variant:"secondary",className:"text-sm font-semibold",children:a.length}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[a.length===1?"item":"items"," selected"]}),e.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-sm text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(le,{className:"size-3"}),"Clear"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(c,{variant:"success",size:"sm",onClick:()=>x("publish"),children:"Publish"}),e.jsx(c,{variant:"warning",size:"sm",onClick:()=>x("unpublish"),children:"Unpublish"}),e.jsx(c,{variant:"secondary",size:"sm",onClick:()=>x("archive"),children:"Archive"}),e.jsx(c,{variant:"danger",size:"sm",onClick:()=>x("delete"),children:"Delete"})]})]})}),t&&e.jsx(be,{action:t,count:a.length,isProcessing:u,result:h,onConfirm:p,onCancel:v})]})}function Ue(){const a=J(),[o,m]=r.useState(""),[t,b]=r.useState(""),[u,l]=r.useState(""),[h,i]=r.useState(null),[d,g]=r.useState(new Set),{canCreate:w,canUpdate:S}=ne(),x=L(y.contentTypes.list,{isActive:!0}),p=x?.page??[],v=x?.error,n=x===void 0,f=L(y.entries.list,{contentTypeId:o||void 0,status:t||void 0,search:u.trim()||void 0,paginationOpts:{numItems:50,cursor:null}}),j=f?.page??[],D=f?.error,M=n||f===void 0,E=r.useCallback(()=>{i(null),window.location.reload()},[]),Q=s=>{a({to:"/entries/new/$contentTypeId",params:{contentTypeId:s}})},G=s=>p.find(T=>T._id===s)?.displayName??"Unknown",U=(s,C)=>{const k=p.find(q=>q._id===C)?.titleField??"title",z=s.data[k];return typeof z=="string"&&z?z:"Untitled"},H=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),X=r.useCallback((s,C)=>{g(T=>{const k=new Set(T);return C?k.add(s):k.delete(s),k})},[]),Y=r.useCallback(()=>{d.size===j.length&&j.length>0?g(new Set):g(new Set(j.map(s=>s._id)))},[d.size,j]),B=r.useCallback(()=>{g(new Set)},[]);return v&&D?e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx(_,{title:"Content",description:"Browse and manage content entries across all content types."}),e.jsx(de,{error:v,title:"Failed to load content",onRetry:E})]}):M?e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx(_,{title:"Content",description:"Browse and manage content entries across all content types."}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx("div",{className:"size-8 animate-spin rounded-full border-2 border-muted border-t-primary"}),e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Loading content..."})]})]}):e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx(_,{title:"Content",description:"Browse and manage content entries across all content types."}),v&&h!=="contentTypes"&&e.jsx($,{error:v,onDismiss:()=>i("contentTypes"),onRetry:E}),D&&h!=="entries"&&e.jsx($,{error:D,onDismiss:()=>i("entries"),onRetry:E}),e.jsx(he,{left:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(fe,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(ce,{type:"text",placeholder:"Search content...",value:u,onChange:s=>l(s.target.value),className:"w-64 pl-9","data-testid":"content-search-input"})]}),e.jsxs(O,{value:o||"all",onValueChange:s=>m(s==="all"?"":s),children:[e.jsx(F,{className:"w-48",children:e.jsx(V,{placeholder:"All Content Types"})}),e.jsxs(R,{children:[e.jsx(N,{value:"all",children:"All Content Types"}),p.map(s=>e.jsx(N,{value:s._id,children:s.displayName},s._id))]})]}),e.jsxs(O,{value:t||"all",onValueChange:s=>b(s==="all"?"":s),children:[e.jsx(F,{className:"w-36",children:e.jsx(V,{placeholder:"All Statuses"})}),e.jsxs(R,{children:[e.jsx(N,{value:"all",children:"All Statuses"}),e.jsx(N,{value:"draft",children:"Draft"}),e.jsx(N,{value:"published",children:"Published"}),e.jsx(N,{value:"scheduled",children:"Scheduled"}),e.jsx(N,{value:"archived",children:"Archived"})]})]})]}),right:w("contentEntries")&&e.jsxs(K,{children:[e.jsx(W,{asChild:!0,children:e.jsxs(c,{disabled:p.length===0,children:[e.jsx(pe,{className:"size-4"}),"Create Entry",e.jsx(Z,{className:"size-4"})]})}),e.jsx(ee,{align:"end",children:p.map(s=>e.jsx(se,{onClick:()=>Q(s._id),children:s.displayName},s._id))})]})}),e.jsx(ge,{selectedIds:Array.from(d),onClearSelection:B,onOperationComplete:B}),j.length===0?e.jsx(oe,{icon:e.jsx(te,{className:"size-6"}),title:"No content entries yet",description:p.length===0?"Create a content type first, then start adding content entries.":'Click "Create Entry" to add your first content entry.'}):e.jsx("div",{className:"rounded-lg border bg-card",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"w-10 p-3 text-left",children:e.jsx(P,{checked:d.size===j.length&&j.length>0,onCheckedChange:Y,"aria-label":"Select all entries"})}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Title"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Type"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Status"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Updated"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Actions"})]})}),e.jsx("tbody",{children:j.map(s=>e.jsxs("tr",{className:ae("border-b last:border-0 transition-colors hover:bg-muted/50",d.has(s._id)&&"bg-primary/5"),children:[e.jsx("td",{className:"p-3",children:e.jsx(P,{checked:d.has(s._id),onCheckedChange:C=>X(s._id,C),"aria-label":`Select ${U(s,s.contentTypeId)}`})}),e.jsx("td",{className:"p-3",children:e.jsxs(I,{to:"/entries/$entryId",params:{entryId:s._id},className:"block",children:[e.jsx("span",{className:"font-medium text-foreground hover:text-primary",children:U(s,s.contentTypeId)}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:s.slug})]})}),e.jsx("td",{className:"p-3 text-sm text-muted-foreground",children:G(s.contentTypeId)}),e.jsx("td",{className:"p-3",children:e.jsx(xe,{status:s.status})}),e.jsx("td",{className:"p-3 text-sm text-muted-foreground",children:H(s._creationTime)}),e.jsx("td",{className:"p-3",children:S("contentEntries")?e.jsx(c,{variant:"outline",size:"sm",asChild:!0,children:e.jsx(I,{to:"/entries/$entryId",params:{entryId:s._id},children:"Edit"})}):e.jsx(c,{variant:"outline",size:"sm",asChild:!0,children:e.jsx(I,{to:"/entries/$entryId",params:{entryId:s._id},children:"View"})})})]},s._id))})]})})]})}export{Ue as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as de,j as e,r as a,b as fe,a as ie,c as V,C as oe,q as Ce,I as Fe,s as Q,t as Se,v as ke,u as Re,w as je}from"./main-CKj5yfEi.js";import{c as we,I as D,a as re,C as Be}from"./CmsEmptyState-CRswfTzk.js";import{C as E,X as ne,B as J}from"./badge-hvUOzpVZ.js";import{L as v}from"./label-KNtpL71g.js";import{T as Pe,a as ze,P as Ne}from"./textarea-BTy7nwzR.js";import{C as Ue,S as ee,a as se,b as te,c as ae,d as U}from"./select-BD29IXCI.js";import{T as Ve}from"./triangle-alert-E52Vfeuh.js";import{P as ce}from"./plus-DUn8v_Xf.js";import{F as Me,L as me}from"./list-sYepHjt_.js";import{L as Ee}from"./link-2-Bw2aI4V4.js";import{E as He,a as We}from"./ErrorState-BIVaWmom.js";import{C as be}from"./CmsPageHeader-CirpXndm.js";import{C as Ge}from"./CmsToolbar-BI2nZOXp.js";import{S as Je}from"./search-MuAUDJKR.js";const Qe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],X=de("file-type",Qe);const Xe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Ye=de("grid-3x3",Xe);const Ke=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],ue=de("text-align-start",Ke);function Ze({isOpen:d,onClose:p,breakingChanges:g,onForceUpdate:y,onCancel:o,isLoading:h}){const m=()=>{o(),p()};return e.jsx(we,{open:d,onOpenChange:u=>!u&&!h&&m(),title:"Breaking Changes Detected",size:"lg",footer:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"outline",onClick:m,disabled:h,children:"Cancel"}),e.jsx(E,{variant:"danger",onClick:y,loading:h,children:"Force Update"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-amber-200 bg-amber-50 p-3",children:[e.jsx(Ve,{className:"mt-0.5 size-5 shrink-0 text-amber-600"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-amber-800",children:"These changes may affect existing content"}),e.jsx("p",{className:"text-sm text-amber-700",children:"The following changes could cause data loss or validation errors for existing entries. Review carefully before proceeding."})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm font-medium text-foreground",children:[g.length," breaking change",g.length!==1?"s":""," detected:"]}),e.jsx("ul",{className:"space-y-2",children:g.map((u,c)=>e.jsxs("li",{className:"flex items-start gap-2 rounded-md border bg-muted/30 px-3 py-2 text-sm",children:[e.jsx("span",{className:"mt-0.5 size-1.5 shrink-0 rounded-full bg-amber-500"}),e.jsx("span",{className:"text-muted-foreground",children:u})]},c))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Force Update" to apply these changes anyway, or "Cancel" to go back and modify your changes.'})]})})}const le={text:{label:"Text",icon:e.jsx(ue,{className:"size-4"}),description:"Single line text input"},richText:{label:"Rich Text",icon:e.jsx(X,{className:"size-4"}),description:"Multi-line formatted text"},number:{label:"Number",icon:e.jsx(ke,{className:"size-4"}),description:"Numeric value"},boolean:{label:"Boolean",icon:e.jsx(Se,{className:"size-4"}),description:"True/false toggle"},date:{label:"Date",icon:e.jsx(Q,{className:"size-4"}),description:"Date picker"},datetime:{label:"Date & Time",icon:e.jsx(Q,{className:"size-4"}),description:"Date and time picker"},reference:{label:"Reference",icon:e.jsx(Ee,{className:"size-4"}),description:"Link to another content entry"},media:{label:"Media",icon:e.jsx(Fe,{className:"size-4"}),description:"Image, video, or file"},json:{label:"JSON",icon:e.jsx(Ce,{className:"size-4"}),description:"Custom JSON data"},select:{label:"Select",icon:e.jsx(oe,{className:"size-4"}),description:"Dropdown selection"},multiSelect:{label:"Multi-Select",icon:e.jsx(me,{className:"size-4"}),description:"Multiple selections"},tags:{label:"Tags",icon:e.jsx(ze,{className:"size-4"}),description:"Free-form tag list"},category:{label:"Category",icon:e.jsx(Me,{className:"size-4"}),description:"Taxonomy category selection"}};function ve(d){return d.toLowerCase().trim().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"_").replace(/^[0-9]/,"_$&").slice(0,64)}function ye(d){return/^[a-z][a-z0-9_]{0,63}$/.test(d)}function es({isOpen:d,onClose:p,onCreated:g,onUpdated:y,contentType:o}){const h=!!o,[m,u]=a.useState(""),[c,f]=a.useState(""),[L,T]=a.useState(!1),[_,R]=a.useState(""),[w,M]=a.useState(!1),[n,C]=a.useState([{name:"title",label:"Title",type:"text",required:!0}]),[F,z]=a.useState("title"),[S,q]=a.useState("title"),[t,b]=a.useState(!1),[H,I]=a.useState(null),[x,k]=a.useState(null),[B,P]=a.useState(!1),[_e,Y]=a.useState([]),[De,A]=a.useState(!1),[Le,K]=a.useState(!1),xe=fe(ie.contentTypes.create),W=fe(ie.contentTypes.update);a.useEffect(()=>{o&&d&&(u(o.displayName),f(o.name),T(!0),R(o.description||""),M(o.singleton||!1),C(o.fields),z(o.titleField||""),q(o.slugField||""))},[o,d]);const $=a.useCallback(()=>{u(""),f(""),T(!1),R(""),M(!1),C([{name:"title",label:"Title",type:"text",required:!0}]),z("title"),q("title"),b(!1),I(null),k(null),P(!1),Y([]),A(!1),K(!1)},[]),Ie=a.useCallback(s=>{u(s),L||f(ve(s))},[L]),$e=a.useCallback(s=>{T(!0),f(s.toLowerCase().replace(/[^a-z0-9_]/g,""))},[]),Te=a.useCallback(()=>{const s=`field_${n.length+1}`;C(l=>[...l,{name:s,label:`Field ${l.length+1}`,type:"text",required:!1}]),k(n.length),P(!0)},[n.length]),qe=a.useCallback(s=>{const l=n[s];if(C(r=>r.filter((i,N)=>N!==s)),F===l.name){const r=n.find((i,N)=>N!==s&&i.type==="text");z(r?.name||"")}if(S===l.name){const r=n.find((i,N)=>N!==s&&i.type==="text");q(r?.name||"")}x===s?(k(null),P(!1)):x!==null&&x>s&&k(x-1)},[n,x,F,S]),O=a.useCallback((s,l)=>{C(r=>r.map((i,N)=>N===s?{...i,...l}:i))},[]),he=a.useCallback((s,l)=>{C(r=>{const i=[...r],[N]=i.splice(s,1);return i.splice(l,0,N),i}),k(l)},[]),G=a.useMemo(()=>{const s=[];m.trim()||s.push("Display name is required"),c.trim()?ye(c)||s.push("System Name must start with a letter and contain only lowercase letters, numbers, and underscores"):s.push("System Name is required"),n.length===0&&s.push("At least one field is required");const l=n.map(i=>i.name),r=l.filter((i,N)=>l.indexOf(i)!==N);r.length>0&&s.push(`Duplicate field names: ${[...new Set(r)].join(", ")}`);for(const i of n)i.name.trim()?/^[a-z][a-z0-9_]{0,63}$/.test(i.name)||s.push(`Field "${i.name}" has an invalid name format`):s.push(`Field "${i.label}" has an empty name`),i.label.trim()||s.push(`Field with name "${i.name}" has an empty label`),(i.type==="select"||i.type==="multiSelect")&&(!i.options?.options||i.options.options.length===0)&&s.push(`${i.type} field "${i.label}" requires at least one option`);return s},[m,c,n]),Z=a.useMemo(()=>n.filter(s=>s.type==="text"),[n]),Ae=s=>s.split(`
|
|
2
|
-
`).filter(r=>r.trim().startsWith("-")).map(r=>r.trim().substring(2)),pe=a.useCallback(async(s,l=!1)=>{if(s.preventDefault(),G.length>0){I(G.join(". "));return}b(!0),I(null);try{if(h&&o){const r=await W({id:o._id,displayName:m.trim(),description:_.trim()||void 0,fields:n,singleton:w,titleField:F||void 0,slugField:S||void 0,force:l});y?.(r),$(),p()}else{const r=await xe({name:c,displayName:m.trim(),description:_.trim()||void 0,fields:n,singleton:w,titleField:F||void 0,slugField:S||void 0});g?.(r),$(),p()}}catch(r){const i=r instanceof Error?r.message:h?"Failed to update content type":"Failed to create content type";if(h&&!l&&i.includes("breaking change")){const N=Ae(i);Y(N),A(!0)}else I(i)}finally{b(!1)}},[G,h,o,xe,W,c,m,_,n,w,F,S,g,y,$,p]),Oe=a.useCallback(async()=>{K(!0);try{if(o){const s=await W({id:o._id,displayName:m.trim(),description:_.trim()||void 0,fields:n,singleton:w,titleField:F||void 0,slugField:S||void 0,force:!0});y?.(s),$(),A(!1),p()}}catch(s){const l=s instanceof Error?s.message:"Failed to update content type";I(l),A(!1)}finally{K(!1)}},[o,W,m,_,n,w,F,S,y,$,p]),ge=a.useCallback(()=>{t||($(),p())},[t,$,p]);if(!d)return null;const j=x!==null?n[x]:null;return e.jsxs(e.Fragment,{children:[e.jsx(we,{open:d,onOpenChange:s=>!s&&ge(),title:h?"Edit Content Type":"Create Content Type",size:"2xl",footer:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"outline",onClick:ge,disabled:t,children:"Cancel"}),e.jsx(E,{variant:"primary",onClick:pe,disabled:G.length>0,loading:t,"data-testid":h?"update-content-type-submit":"create-content-type-submit",children:h?"Save Changes":"Create Content Type"})]}),children:e.jsxs("form",{onSubmit:pe,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Basic Information"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"displayName",children:["Display Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(D,{id:"displayName",value:m,onChange:s=>Ie(s.target.value),placeholder:"e.g., Blog Post",disabled:t,autoFocus:!0,"data-testid":"display-name-input"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"machineName",children:["System Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(D,{id:"machineName",value:c,onChange:s=>$e(s.target.value),placeholder:"e.g., blog_post",disabled:t||h,className:V(!ye(c)&&c&&"border-destructive"),"data-testid":"machine-name-input"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h?"System name cannot be changed after creation":"Lowercase letters, numbers, and underscores only. Used in API queries."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"description",children:"Description"}),e.jsx(Pe,{id:"description",value:_,onChange:s=>R(s.target.value),placeholder:"Optional description of this content type",disabled:t,rows:2})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(re,{id:"singleton",checked:w,onCheckedChange:s=>M(s),disabled:t}),e.jsx(v,{htmlFor:"singleton",className:"cursor-pointer",children:"Singleton (only one entry allowed)"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Fields"}),e.jsxs(E,{type:"button",variant:"secondary",size:"sm",onClick:Te,disabled:t,"data-testid":"add-field-button",children:[e.jsx(ce,{className:"size-3.5"}),"Add Field"]})]}),e.jsx("div",{className:"space-y-2",children:n.map((s,l)=>e.jsxs("div",{className:V("flex cursor-pointer items-center gap-2 rounded-lg border p-2 transition-colors hover:bg-muted/50",x===l&&"border-primary bg-primary/5"),onClick:()=>{k(l),P(!0)},"data-testid":`field-item-${l}`,children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[l>0&&e.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),he(l,l-1)},className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:e.jsx(Ue,{className:"size-3"})}),l<n.length-1&&e.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),he(l,l+1)},className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:e.jsx(oe,{className:"size-3"})})]}),e.jsx("div",{className:"flex size-8 items-center justify-center rounded bg-muted text-muted-foreground",children:le[s.type].icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.label}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[le[s.type].label,s.required&&" *"]})]}),e.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),qe(l)},disabled:t||n.length===1,className:"rounded p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:opacity-50",children:e.jsx(ne,{className:"size-4"})})]},l))}),B&&j&&x!==null&&e.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4","data-testid":"field-editor",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("h5",{className:"font-medium",children:["Edit Field: ",j.label]}),e.jsx("button",{type:"button",onClick:()=>{P(!1),k(null)},className:"rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:e.jsx(ne,{className:"size-4"})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"fieldLabel",children:["Label ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(D,{id:"fieldLabel",value:j.label,onChange:s=>O(x,{label:s.target.value,name:L?j.name:ve(s.target.value)||j.name}),disabled:t,"data-testid":"field-label-input"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"fieldName",children:["Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(D,{id:"fieldName",value:j.name,onChange:s=>O(x,{name:s.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")}),disabled:t,"data-testid":"field-name-input"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"fieldType",children:["Type ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(ee,{value:j.type,onValueChange:s=>O(x,{type:s,options:void 0}),disabled:t,children:[e.jsx(se,{"data-testid":"field-type-select",children:e.jsx(te,{})}),e.jsx(ae,{children:Object.entries(le).map(([s,l])=>e.jsx(U,{value:s,children:e.jsxs("div",{className:"flex items-center gap-2",children:[l.icon,e.jsx("span",{children:l.label}),e.jsxs("span",{className:"text-muted-foreground",children:["- ",l.description]})]})},s))})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(re,{id:"fieldRequired",checked:j.required,onCheckedChange:s=>O(x,{required:s}),disabled:t}),e.jsx(v,{htmlFor:"fieldRequired",className:"cursor-pointer",children:"Required"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"fieldDescription",children:"Help Text"}),e.jsx(D,{id:"fieldDescription",value:j.description||"",onChange:s=>O(x,{description:s.target.value||void 0}),placeholder:"Help text shown below the field",disabled:t})]}),(j.type==="select"||j.type==="multiSelect")&&e.jsx(ss,{options:j.options?.options||[],onChange:s=>O(x,{options:{...j.options,options:s}}),disabled:t})]})]})]}),Z.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Display Settings"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"titleField",children:"Title Field"}),e.jsxs(ee,{value:F||"none",onValueChange:s=>z(s==="none"?"":s),disabled:t,children:[e.jsx(se,{children:e.jsx(te,{placeholder:"None"})}),e.jsxs(ae,{children:[e.jsx(U,{value:"none",children:"None"}),Z.map(s=>e.jsx(U,{value:s.name,children:s.label},s.name))]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Field to display as the entry title in lists"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"slugField",children:"Slug Field"}),e.jsxs(ee,{value:S||"none",onValueChange:s=>q(s==="none"?"":s),disabled:t,children:[e.jsx(se,{children:e.jsx(te,{placeholder:"None (auto-generate)"})}),e.jsxs(ae,{children:[e.jsx(U,{value:"none",children:"None (auto-generate)"}),Z.map(s=>e.jsx(U,{value:s.name,children:s.label},s.name))]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Field to use for generating URL-friendly slugs"})]})]}),H&&e.jsx("div",{className:"rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800",role:"alert","data-testid":"submit-error",children:H})]})}),e.jsx(Ze,{isOpen:De,onClose:()=>A(!1),breakingChanges:_e,onForceUpdate:Oe,onCancel:()=>{A(!1),Y([])},isLoading:Le})]})}function ss({options:d,onChange:p,disabled:g}){const y=()=>{p([...d,{value:`option_${d.length+1}`,label:""}])},o=m=>{p(d.filter((u,c)=>c!==m))},h=(m,u)=>{p(d.map((c,f)=>f===m?{...c,...u}:c))};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{children:["Options ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx("div",{className:"space-y-2",children:d.map((m,u)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{value:m.label,onChange:c=>{const f=c.target.value,L=f.toLowerCase().replace(/[^a-z0-9]/g,"_").replace(/^_+|_+$/g,"");h(u,{label:f,value:L})},placeholder:"Option label",disabled:g,className:"flex-1"}),e.jsx(D,{value:m.value,onChange:c=>h(u,{value:c.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")}),placeholder:"value",disabled:g,className:"w-32"}),e.jsx("button",{type:"button",onClick:()=>o(u),disabled:g,className:"rounded p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:e.jsx(ne,{className:"size-4"})})]},u))}),e.jsxs(E,{type:"button",variant:"secondary",size:"sm",onClick:y,disabled:g,children:[e.jsx(ce,{className:"size-3.5"}),"Add Option"]})]})}const ts={text:e.jsx(ue,{className:"size-3"}),richText:e.jsx(X,{className:"size-3"}),number:e.jsx(ke,{className:"size-3"}),boolean:e.jsx(Se,{className:"size-3"}),date:e.jsx(Q,{className:"size-3"}),datetime:e.jsx(Q,{className:"size-3"}),reference:e.jsx(Ee,{className:"size-3"}),media:e.jsx(Fe,{className:"size-3"}),json:e.jsx(Ce,{className:"size-3"}),select:e.jsx(oe,{className:"size-3"}),multiSelect:e.jsx(me,{className:"size-3"}),tags:e.jsx(ze,{className:"size-3"}),category:e.jsx(Me,{className:"size-3"})};function fs(){const[d,p]=a.useState(""),[g,y]=a.useState("grid"),[o,h]=a.useState(!0),[m,u]=a.useState(!1),[c,f]=a.useState(null),[L,T]=a.useState(!1),_=a.useCallback(()=>{u(!1)},[]),R=a.useCallback(()=>{f(null)},[]),w=Re(ie.contentTypes.list,{isActive:o?!0:void 0,includeEntryCounts:!0}),M=w?.page??[],n=w===void 0,C=w?.error,F=a.useCallback(()=>{T(!1),window.location.reload()},[]),z=a.useMemo(()=>{if(!d.trim())return M;const t=d.toLowerCase();return M.filter(b=>b.name.toLowerCase().includes(t)||b.displayName.toLowerCase().includes(t))},[M,d]),S=t=>new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),q=t=>{const H=Date.now()-t,I=Math.floor(H/1e3),x=Math.floor(I/60),k=Math.floor(x/60),B=Math.floor(k/24);return B>30?S(t):B>0?`${B}d ago`:k>0?`${k}h ago`:x>0?`${x}m ago`:"Just now"};return C&&!n?e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx(be,{title:"Content Types",description:"Define the structure of your content with custom fields and validation rules."}),e.jsx(He,{error:C,title:"Failed to load content types",onRetry:F})]}):e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx(be,{title:"Content Types",description:"Define the structure of your content with custom fields and validation rules."}),C&&!L&&e.jsx(We,{error:C,onDismiss:()=>T(!0),onRetry:F}),e.jsx(Ge,{left:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Je,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(D,{type:"search",placeholder:"Search content types...",value:d,onChange:t=>p(t.target.value),className:"w-64 pl-9"})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-sm",children:[e.jsx(re,{checked:o,onCheckedChange:t=>h(t)}),"Active only"]})]}),right:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex rounded-md border bg-muted/30",children:[e.jsx("button",{className:V("rounded-l-md p-2 transition-colors",g==="grid"?"bg-background shadow-sm":"hover:bg-muted/50"),onClick:()=>y("grid"),title:"Grid view","aria-label":"Grid view",children:e.jsx(Ye,{className:"size-4"})}),e.jsx("button",{className:V("rounded-r-md p-2 transition-colors",g==="list"?"bg-background shadow-sm":"hover:bg-muted/50"),onClick:()=>y("list"),title:"List view","aria-label":"List view",children:e.jsx(me,{className:"size-4"})})]}),e.jsxs(E,{onClick:()=>u(!0),"data-testid":"create-content-type-button",children:[e.jsx(ce,{className:"size-4"}),"Create Content Type"]})]})}),n?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx("div",{className:"size-8 animate-spin rounded-full border-2 border-muted border-t-primary"}),e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Loading content types..."})]}):z.length===0?e.jsx(Be,{icon:e.jsx(X,{className:"size-6"}),title:d?"No content types match your search":"No content types defined",description:d?"Try adjusting your search query or filters.":"Content types define the schema for your content. Create one to get started."}):g==="grid"?e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:z.map(t=>e.jsxs("div",{className:"group flex flex-col rounded-lg border bg-card p-4 transition-all hover:border-primary/50 hover:shadow-md",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("div",{className:"flex size-10 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e.jsx(X,{className:"size-5"})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[!t.isActive&&e.jsx(J,{variant:"secondary",className:"text-xs font-normal",children:"Inactive"}),t.singleton&&e.jsx(J,{variant:"secondary",className:"border-amber-200 bg-amber-50 text-xs font-normal text-amber-700",children:"Singleton"}),e.jsx("button",{onClick:()=>f(t),className:"rounded p-1.5 text-muted-foreground opacity-0 transition-all hover:bg-muted hover:text-foreground group-hover:opacity-100",title:"Edit content type","aria-label":"Edit content type",children:e.jsx(Ne,{className:"size-4"})})]})]}),e.jsxs(je,{to:"/entries/type/$contentTypeId",params:{contentTypeId:t._id},className:"flex flex-1 flex-col",children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:t.displayName}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:t.name}),e.jsxs("div",{className:"mt-3 flex items-center gap-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold text-foreground",children:t.fields.length}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.fields.length===1?"Field":"Fields"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold text-foreground",children:t.entryCount??0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.entryCount===1?"Entry":"Entries"})]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[t.fields.slice(0,4).map(b=>e.jsxs("span",{className:"flex items-center gap-1 rounded-md bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",title:b.label,children:[ts[b.type]||e.jsx(ue,{className:"size-3"}),e.jsx("span",{className:"truncate",children:b.label})]},b.name)),t.fields.length>4&&e.jsxs("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",children:["+",t.fields.length-4," more"]})]}),e.jsxs("p",{className:"mt-auto pt-3 text-xs text-muted-foreground",children:["Updated ",q(t._creationTime)]})]})]},t._id))}):e.jsx("div",{className:"rounded-lg border bg-card",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Name"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Fields"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Entries"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Status"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Last Updated"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Actions"})]})}),e.jsx("tbody",{children:z.map(t=>e.jsxs("tr",{className:"border-b last:border-0 transition-colors hover:bg-muted/50",children:[e.jsxs("td",{className:"p-3",children:[e.jsx("p",{className:"font-medium text-foreground",children:t.displayName}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.name})]}),e.jsx("td",{className:"p-3 text-sm text-muted-foreground",children:t.fields.length}),e.jsx("td",{className:"p-3 text-sm text-muted-foreground",children:t.entryCount??0}),e.jsx("td",{className:"p-3",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(J,{variant:t.isActive?"default":"secondary",className:V("text-xs font-normal",t.isActive&&"border-emerald-200 bg-emerald-50 text-emerald-700"),children:t.isActive?"Active":"Inactive"}),t.singleton&&e.jsx(J,{variant:"secondary",className:"border-amber-200 bg-amber-50 text-xs font-normal text-amber-700",children:"Singleton"})]})}),e.jsx("td",{className:"p-3 text-sm text-muted-foreground",children:S(t._creationTime)}),e.jsx("td",{className:"p-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(E,{variant:"outline",size:"sm",onClick:()=>f(t),children:[e.jsx(Ne,{className:"size-3.5"}),"Edit"]}),e.jsx(E,{variant:"outline",size:"sm",asChild:!0,children:e.jsx(je,{to:"/entries/type/$contentTypeId",params:{contentTypeId:t._id},children:"View Entries"})})]})})]},t._id))})]})}),!n&&z.length>0&&e.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["Showing ",z.length," of ",M.length," content type",M.length!==1?"s":""]}),e.jsx(es,{isOpen:m||!!c,onClose:()=>{u(!1),f(null)},contentType:c,onCreated:_,onUpdated:R})]})}export{fs as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as l,j as e,c as n,u as m,a as x,F as u,I as g,x as j,S as h,w as p}from"./main-CKj5yfEi.js";import{C as f}from"./CmsPageHeader-CirpXndm.js";const b=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],N=l("trending-up",b);function d({className:t,...s}){return e.jsx("div",{"data-slot":"card",className:n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...s})}function v({className:t,...s}){return e.jsx("div",{"data-slot":"card-header",className:n("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...s})}function C({className:t,...s}){return e.jsx("div",{"data-slot":"card-title",className:n("leading-none font-semibold",t),...s})}function y({className:t,...s}){return e.jsx("div",{"data-slot":"card-description",className:n("text-muted-foreground text-sm",t),...s})}function o({className:t,...s}){return e.jsx("div",{"data-slot":"card-content",className:n("px-6",t),...s})}function S({className:t,...s}){return e.jsx("div",{"data-slot":"skeleton",className:n("bg-accent animate-pulse rounded-md",t),...s})}function z(){const t=m(x.stats.getDashboardStats),s=t===void 0,a=t===null;return e.jsxs("div",{className:"space-y-8",children:[e.jsx(f,{title:"Dashboard",description:"Welcome to Convex CMS Admin. Manage your content, media, and publishing workflows."}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(i,{title:"Content Entries",description:"Create and manage your content",href:"/content",icon:e.jsx(u,{className:"size-5"})}),e.jsx(i,{title:"Media Library",description:"Upload and organize media assets",href:"/media",icon:e.jsx(g,{className:"size-5"})}),e.jsx(i,{title:"Content Types",description:"Define content schemas and fields",href:"/content-types",icon:e.jsx(j,{className:"size-5"})}),e.jsx(i,{title:"Settings",description:"Configure CMS settings",href:"/settings",icon:e.jsx(h,{className:"size-5"})})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{className:"size-5 text-muted-foreground"}),e.jsx("h2",{className:"text-lg font-semibold",children:"Quick Stats"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(r,{label:"Content Types",value:s?void 0:a?"—":String(t.contentTypes),isLoading:s}),e.jsx(r,{label:"Content Entries",value:s?void 0:a?"—":String(t.contentEntries),isLoading:s}),e.jsx(r,{label:"Media Assets",value:s?void 0:a?"—":String(t.mediaAssets),isLoading:s}),e.jsx(r,{label:"Published",value:s?void 0:a?"—":String(t.published),isLoading:s})]})]})]})}function i({title:t,description:s,href:a,icon:c}){return e.jsx(p,{to:a,children:e.jsxs(d,{className:"transition-colors hover:bg-accent/50",children:[e.jsxs(v,{className:"pb-2",children:[e.jsx("div",{className:"mb-2 flex size-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:c}),e.jsx(C,{className:"text-base",children:t})]}),e.jsx(o,{children:e.jsx(y,{children:s})})]})})}function r({label:t,value:s,isLoading:a=!1}){return e.jsx(d,{children:e.jsxs(o,{className:"p-4",children:[a?e.jsx(S,{className:"mb-1 h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:s}),e.jsx("div",{className:"text-sm text-muted-foreground",children:t})]})})}export{z as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,_ as T,$ as se,j as f,a0 as _,a1 as O,a2 as ce,a3 as C,a4 as P,a5 as ae,c as F}from"./main-CKj5yfEi.js";import{c as ie}from"./badge-hvUOzpVZ.js";function de(e,o){return s.useReducer((r,l)=>o[r][l]??r,e)}var U="ScrollArea",[$]=ce(U),[ue,m]=$(U),q=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,type:l="hover",dir:t,scrollHideDelay:n=600,...c}=e,[a,i]=s.useState(null),[h,d]=s.useState(null),[b,u]=s.useState(null),[S,w]=s.useState(null),[A,Y]=s.useState(null),[x,L]=s.useState(0),[M,D]=s.useState(0),[j,y]=s.useState(!1),[N,W]=s.useState(!1),v=T(o,E=>i(E)),p=se(t);return f.jsx(ue,{scope:r,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:h,onViewportChange:d,content:b,onContentChange:u,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:j,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:D,children:f.jsx(_.div,{dir:p,...c,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...e.style}})})});q.displayName=U;var G="ScrollAreaViewport",J=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,children:l,nonce:t,...n}=e,c=m(G,r),a=s.useRef(null),i=T(o,a,c.onViewportChange);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),f.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:i,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:f.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});J.displayName=G;var g="ScrollAreaScrollbar",K=s.forwardRef((e,o)=>{const{forceMount:r,...l}=e,t=m(g,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:c}=t,a=e.orientation==="horizontal";return s.useEffect(()=>(a?n(!0):c(!0),()=>{a?n(!1):c(!1)}),[a,n,c]),t.type==="hover"?f.jsx(he,{...l,ref:o,forceMount:r}):t.type==="scroll"?f.jsx(fe,{...l,ref:o,forceMount:r}):t.type==="auto"?f.jsx(Q,{...l,ref:o,forceMount:r}):t.type==="always"?f.jsx(V,{...l,ref:o}):null});K.displayName=g;var he=s.forwardRef((e,o)=>{const{forceMount:r,...l}=e,t=m(g,e.__scopeScrollArea),[n,c]=s.useState(!1);return s.useEffect(()=>{const a=t.scrollArea;let i=0;if(a){const h=()=>{window.clearTimeout(i),c(!0)},d=()=>{i=window.setTimeout(()=>c(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",h),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(i),a.removeEventListener("pointerenter",h),a.removeEventListener("pointerleave",d)}}},[t.scrollArea,t.scrollHideDelay]),f.jsx(O,{present:r||n,children:f.jsx(Q,{"data-state":n?"visible":"hidden",...l,ref:o})})}),fe=s.forwardRef((e,o)=>{const{forceMount:r,...l}=e,t=m(g,e.__scopeScrollArea),n=e.orientation==="horizontal",c=X(()=>i("SCROLL_END"),100),[a,i]=de("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(a==="idle"){const h=window.setTimeout(()=>i("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(h)}},[a,t.scrollHideDelay,i]),s.useEffect(()=>{const h=t.viewport,d=n?"scrollLeft":"scrollTop";if(h){let b=h[d];const u=()=>{const S=h[d];b!==S&&(i("SCROLL"),c()),b=S};return h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[t.viewport,n,i,c]),f.jsx(O,{present:r||a!=="hidden",children:f.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:o,onPointerEnter:C(e.onPointerEnter,()=>i("POINTER_ENTER")),onPointerLeave:C(e.onPointerLeave,()=>i("POINTER_LEAVE"))})})}),Q=s.forwardRef((e,o)=>{const r=m(g,e.__scopeScrollArea),{forceMount:l,...t}=e,[n,c]=s.useState(!1),a=e.orientation==="horizontal",i=X(()=>{if(r.viewport){const h=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;c(a?h:d)}},10);return R(r.viewport,i),R(r.content,i),f.jsx(O,{present:l||n,children:f.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:o})})}),V=s.forwardRef((e,o)=>{const{orientation:r="vertical",...l}=e,t=m(g,e.__scopeScrollArea),n=s.useRef(null),c=s.useRef(0),[a,i]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=te(a.viewport,a.content),d={...l,sizes:a,onSizesChange:i,hasThumb:h>0&&h<1,onThumbChange:u=>n.current=u,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:u=>c.current=u};function b(u,S){return we(u,c.current,a,S)}return r==="horizontal"?f.jsx(be,{...d,ref:o,onThumbPositionChange:()=>{if(t.viewport&&n.current){const u=t.viewport.scrollLeft,S=k(u,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:u=>{t.viewport&&(t.viewport.scrollLeft=u)},onDragScroll:u=>{t.viewport&&(t.viewport.scrollLeft=b(u,t.dir))}}):r==="vertical"?f.jsx(Se,{...d,ref:o,onThumbPositionChange:()=>{if(t.viewport&&n.current){const u=t.viewport.scrollTop,S=k(u,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:u=>{t.viewport&&(t.viewport.scrollTop=u)},onDragScroll:u=>{t.viewport&&(t.viewport.scrollTop=b(u))}}):null}),be=s.forwardRef((e,o)=>{const{sizes:r,onSizesChange:l,...t}=e,n=m(g,e.__scopeScrollArea),[c,a]=s.useState(),i=s.useRef(null),h=T(o,i,n.onScrollbarXChange);return s.useEffect(()=>{i.current&&a(getComputedStyle(i.current))},[i]),f.jsx(ee,{"data-orientation":"horizontal",...t,ref:h,sizes:r,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,b)=>{if(n.viewport){const u=n.viewport.scrollLeft+d.deltaX;e.onWheelScroll(u),le(u,b)&&d.preventDefault()}},onResize:()=>{i.current&&n.viewport&&c&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:i.current.clientWidth,paddingStart:z(c.paddingLeft),paddingEnd:z(c.paddingRight)}})}})}),Se=s.forwardRef((e,o)=>{const{sizes:r,onSizesChange:l,...t}=e,n=m(g,e.__scopeScrollArea),[c,a]=s.useState(),i=s.useRef(null),h=T(o,i,n.onScrollbarYChange);return s.useEffect(()=>{i.current&&a(getComputedStyle(i.current))},[i]),f.jsx(ee,{"data-orientation":"vertical",...t,ref:h,sizes:r,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,b)=>{if(n.viewport){const u=n.viewport.scrollTop+d.deltaY;e.onWheelScroll(u),le(u,b)&&d.preventDefault()}},onResize:()=>{i.current&&n.viewport&&c&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:i.current.clientHeight,paddingStart:z(c.paddingTop),paddingEnd:z(c.paddingBottom)}})}})}),[ve,Z]=$(g),ee=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:c,onThumbPointerDown:a,onThumbPositionChange:i,onDragScroll:h,onWheelScroll:d,onResize:b,...u}=e,S=m(g,r),[w,A]=s.useState(null),Y=T(o,v=>A(v)),x=s.useRef(null),L=s.useRef(""),M=S.viewport,D=l.content-l.viewport,j=P(d),y=P(i),N=X(b,10);function W(v){if(x.current){const p=v.clientX-x.current.left,E=v.clientY-x.current.top;h({x:p,y:E})}}return s.useEffect(()=>{const v=p=>{const E=p.target;w?.contains(E)&&j(p,D)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,D,j]),s.useEffect(y,[l,y]),R(w,N),R(S.content,N),f.jsx(ve,{scope:r,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(c),onThumbPositionChange:y,onThumbPointerDown:P(a),children:f.jsx(_.div,{...u,ref:Y,style:{position:"absolute",...u.style},onPointerDown:C(e.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(e.onPointerMove,W),onPointerUp:C(e.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",re=s.forwardRef((e,o)=>{const{forceMount:r,...l}=e,t=Z(H,e.__scopeScrollArea);return f.jsx(O,{present:r||t.hasThumb,children:f.jsx(me,{ref:o,...l})})}),me=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,style:l,...t}=e,n=m(H,r),c=Z(H,r),{onThumbPositionChange:a}=c,i=T(o,b=>c.onThumbChange(b)),h=s.useRef(void 0),d=X(()=>{h.current&&(h.current(),h.current=void 0)},100);return s.useEffect(()=>{const b=n.viewport;if(b){const u=()=>{if(d(),!h.current){const S=ge(b,a);h.current=S,a()}};return a(),b.addEventListener("scroll",u),()=>b.removeEventListener("scroll",u)}},[n.viewport,d,a]),f.jsx(_.div,{"data-state":c.hasThumb?"visible":"hidden",...t,ref:i,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(e.onPointerDownCapture,b=>{const S=b.target.getBoundingClientRect(),w=b.clientX-S.left,A=b.clientY-S.top;c.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(e.onPointerUp,c.onThumbPointerUp)})});re.displayName=H;var B="ScrollAreaCorner",oe=s.forwardRef((e,o)=>{const r=m(B,e.__scopeScrollArea),l=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&l?f.jsx(pe,{...e,ref:o}):null});oe.displayName=B;var pe=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,...l}=e,t=m(B,r),[n,c]=s.useState(0),[a,i]=s.useState(0),h=!!(n&&a);return R(t.scrollbarX,()=>{const d=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(d),i(d)}),R(t.scrollbarY,()=>{const d=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(d),c(d)}),h?f.jsx(_.div,{...l,ref:o,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function z(e){return e?parseInt(e,10):0}function te(e,o){const r=e/o;return isNaN(r)?0:r}function I(e){const o=te(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=(e.scrollbar.size-r)*o;return Math.max(l,18)}function we(e,o,r,l="ltr"){const t=I(r),n=t/2,c=o||n,a=t-c,i=r.scrollbar.paddingStart+c,h=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,b=l==="ltr"?[0,d]:[d*-1,0];return ne([i,h],b)(e)}function k(e,o,r="ltr"){const l=I(o),t=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,n=o.scrollbar.size-t,c=o.content-o.viewport,a=n-l,i=r==="ltr"?[0,c]:[c*-1,0],h=ie(e,i);return ne([0,c],[0,a])(h)}function ne(e,o){return r=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const l=(o[1]-o[0])/(e[1]-e[0]);return o[0]+l*(r-e[0])}}function le(e,o){return e>0&&e<o}var ge=(e,o=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},l=0;return(function t(){const n={left:e.scrollLeft,top:e.scrollTop},c=r.left!==n.left,a=r.top!==n.top;(c||a)&&o(),r=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(e,o){const r=P(e),l=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(l.current),[]),s.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(r,o)},[r,o])}function R(e,o){const r=P(o);ae(()=>{let l=0;if(e){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(r)});return t.observe(e),()=>{window.cancelAnimationFrame(l),t.unobserve(e)}}},[e,r])}var xe=q,Pe=J,Ce=oe;function ye({className:e,children:o,...r}){return f.jsxs(xe,{"data-slot":"scroll-area",className:F("relative",e),...r,children:[f.jsx(Pe,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:o}),f.jsx(Ee,{}),f.jsx(Ce,{})]})}function Ee({className:e,orientation:o="vertical",...r}){return f.jsx(K,{"data-slot":"scroll-area-scrollbar",orientation:o,className:F("flex touch-none p-px transition-colors select-none",o==="vertical"&&"h-full w-2.5 border-l border-l-transparent",o==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:f.jsx(re,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}export{ye as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as nt,r as n,j as a,ad as rt,a0 as R,$ as st,a6 as Te,al as at,a8 as Ie,_ as L,am as lt,a3 as E,a5 as $,ae as it,an as Pe,ao as Ne,ap as ct,a4 as dt,af as ut,ah as pt,ag as ft,ai as mt,aj as ht,a2 as gt,aq as vt,ar as xt,C as _e,c as te}from"./main-CKj5yfEi.js";import{u as St,c as Ee,a as wt}from"./badge-hvUOzpVZ.js";const yt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ct=nt("chevron-up",yt);function It(t){const o=bt(t),e=n.forwardRef((s,r)=>{const{children:d,...l}=s,i=n.Children.toArray(d),c=i.find(Et);if(c){const p=c.props.children,g=i.map(x=>x===c?n.Children.count(p)>1?n.Children.only(null):n.isValidElement(p)?p.props.children:null:x);return a.jsx(o,{...l,ref:r,children:n.isValidElement(p)?n.cloneElement(p,void 0,g):null})}return a.jsx(o,{...l,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function bt(t){const o=n.forwardRef((e,s)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const l=Nt(r),i=Pt(d,r.props);return r.type!==n.Fragment&&(i.ref=s?rt(s,l):l),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var Tt=Symbol("radix.slottable");function Et(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Tt}function Pt(t,o){const e={...o};for(const s in o){const r=t[s],d=o[s];/^on[A-Z]/.test(s)?r&&d?e[s]=(...i)=>{const c=d(...i);return r(...i),c}:r&&(e[s]=r):s==="style"?e[s]={...r,...d}:s==="className"&&(e[s]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function Nt(t){let o=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=Object.getOwnPropertyDescriptor(t,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var Re=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),_t="VisuallyHidden",Rt=n.forwardRef((t,o)=>a.jsx(R.span,{...t,ref:o,style:{...Re,...t.style}}));Rt.displayName=_t;var jt=[" ","Enter","ArrowUp","ArrowDown"],Mt=[" ","Enter"],J="Select",[ce,de,At]=ct(J),[oe]=gt(J,[At,Ne]),ue=Ne(),[Ot,G]=oe(J),[Dt,Lt]=oe(J),je=t=>{const{__scopeSelect:o,children:e,open:s,defaultOpen:r,onOpenChange:d,value:l,defaultValue:i,onValueChange:c,dir:p,name:g,autoComplete:x,disabled:P,required:b,form:C}=t,u=ue(o),[h,S]=n.useState(null),[m,v]=n.useState(null),[F,M]=n.useState(!1),ne=st(p),[N,O]=Te({prop:s,defaultProp:r??!1,onChange:d,caller:J}),[U,q]=Te({prop:l,defaultProp:i,onChange:c,caller:J}),k=n.useRef(null),V=h?C||!!h.closest("form"):!0,[z,B]=n.useState(new Set),H=Array.from(z).map(_=>_.props.value).join(";");return a.jsx(at,{...u,children:a.jsxs(Ot,{required:b,scope:o,trigger:h,onTriggerChange:S,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:N,onOpenChange:O,dir:ne,triggerPointerDownPosRef:k,disabled:P,children:[a.jsx(ce.Provider,{scope:o,children:a.jsx(Dt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(_=>{B(D=>new Set(D).add(_))},[]),onNativeOptionRemove:n.useCallback(_=>{B(D=>{const W=new Set(D);return W.delete(_),W})},[]),children:e})}),V?a.jsxs(Qe,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:x,value:U,onChange:_=>q(_.target.value),disabled:P,form:C,children:[U===void 0?a.jsx("option",{value:""}):null,Array.from(z)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...r}=t,d=ue(e),l=G(Me,e),i=l.disabled||s,c=L(o,l.onTriggerChange),p=de(e),g=n.useRef("touch"),[x,P,b]=tt(u=>{const h=p().filter(v=>!v.disabled),S=h.find(v=>v.value===l.value),m=ot(h,u,S);m!==void 0&&l.onValueChange(m.value)}),C=u=>{i||(l.onOpenChange(!0),b()),u&&(l.triggerPointerDownPosRef.current={x:Math.round(u.pageX),y:Math.round(u.pageY)})};return a.jsx(lt,{asChild:!0,...d,children:a.jsx(R.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":et(l.value)?"":void 0,...r,ref:c,onClick:E(r.onClick,u=>{u.currentTarget.focus(),g.current!=="mouse"&&C(u)}),onPointerDown:E(r.onPointerDown,u=>{g.current=u.pointerType;const h=u.target;h.hasPointerCapture(u.pointerId)&&h.releasePointerCapture(u.pointerId),u.button===0&&u.ctrlKey===!1&&u.pointerType==="mouse"&&(C(u),u.preventDefault())}),onKeyDown:E(r.onKeyDown,u=>{const h=x.current!=="";!(u.ctrlKey||u.altKey||u.metaKey)&&u.key.length===1&&P(u.key),!(h&&u.key===" ")&&jt.includes(u.key)&&(C(),u.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,children:d,placeholder:l="",...i}=t,c=G(Oe,e),{onValueNodeHasChildrenChange:p}=c,g=d!==void 0,x=L(o,c.onValueNodeChange);return $(()=>{p(g)},[p,g]),a.jsx(R.span,{...i,ref:x,style:{pointerEvents:"none"},children:et(c.value)?a.jsx(a.Fragment,{children:l}):d})});De.displayName=Oe;var kt="SelectIcon",Le=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...r}=t;return a.jsx(R.span,{"aria-hidden":!0,...r,ref:o,children:s||"▼"})});Le.displayName=kt;var Vt="SelectPortal",ke=t=>a.jsx(it,{asChild:!0,...t});ke.displayName=Vt;var Q="SelectContent",Ve=n.forwardRef((t,o)=>{const e=G(Q,t.__scopeSelect),[s,r]=n.useState();if($(()=>{r(new DocumentFragment)},[]),!e.open){const d=s;return d?Pe.createPortal(a.jsx(Be,{scope:t.__scopeSelect,children:a.jsx(ce.Slot,{scope:t.__scopeSelect,children:a.jsx("div",{children:t.children})})}),d):null}return a.jsx(He,{...t,ref:o})});Ve.displayName=Q;var A=10,[Be,Y]=oe(Q),Bt="SelectContentImpl",Ht=It("SelectContent.RemoveScroll"),He=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:l,side:i,sideOffset:c,align:p,alignOffset:g,arrowPadding:x,collisionBoundary:P,collisionPadding:b,sticky:C,hideWhenDetached:u,avoidCollisions:h,...S}=t,m=G(Q,e),[v,F]=n.useState(null),[M,ne]=n.useState(null),N=L(o,f=>F(f)),[O,U]=n.useState(null),[q,k]=n.useState(null),V=de(e),[z,B]=n.useState(!1),H=n.useRef(!1);n.useEffect(()=>{if(v)return ut(v)},[v]),pt();const _=n.useCallback(f=>{const[I,...j]=V().map(T=>T.ref.current),[w]=j.slice(-1),y=document.activeElement;for(const T of f)if(T===y||(T?.scrollIntoView({block:"nearest"}),T===I&&M&&(M.scrollTop=0),T===w&&M&&(M.scrollTop=M.scrollHeight),T?.focus(),document.activeElement!==y))return},[V,M]),D=n.useCallback(()=>_([O,v]),[_,O,v]);n.useEffect(()=>{z&&D()},[z,D]);const{onOpenChange:W,triggerPointerDownPosRef:K}=m;n.useEffect(()=>{if(v){let f={x:0,y:0};const I=w=>{f={x:Math.abs(Math.round(w.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(w.pageY)-(K.current?.y??0))}},j=w=>{f.x<=10&&f.y<=10?w.preventDefault():v.contains(w.target)||W(!1),document.removeEventListener("pointermove",I),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",j,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",j,{capture:!0})}}},[v,W,K]),n.useEffect(()=>{const f=()=>W(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[W]);const[pe,ae]=tt(f=>{const I=V().filter(y=>!y.disabled),j=I.find(y=>y.ref.current===document.activeElement),w=ot(I,f,j);w&&setTimeout(()=>w.ref.current.focus())}),fe=n.useCallback((f,I,j)=>{const w=!H.current&&!j;(m.value!==void 0&&m.value===I||w)&&(U(f),w&&(H.current=!0))},[m.value]),me=n.useCallback(()=>v?.focus(),[v]),ee=n.useCallback((f,I,j)=>{const w=!H.current&&!j;(m.value!==void 0&&m.value===I||w)&&k(f)},[m.value]),le=s==="popper"?xe:We,re=le===xe?{side:i,sideOffset:c,align:p,alignOffset:g,arrowPadding:x,collisionBoundary:P,collisionPadding:b,sticky:C,hideWhenDetached:u,avoidCollisions:h}:{};return a.jsx(Be,{scope:e,content:v,viewport:M,onViewportChange:ne,itemRefCallback:fe,selectedItem:O,onItemLeave:me,itemTextRefCallback:ee,focusSelectedItem:D,selectedItemText:q,position:s,isPositioned:z,searchRef:pe,children:a.jsx(ft,{as:Ht,allowPinchZoom:!0,children:a.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:E(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:a.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:a.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...S,...re,onPlaced:()=>B(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:E(S.onKeyDown,f=>{const I=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!I&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let w=V().filter(y=>!y.disabled).map(y=>y.ref.current);if(["ArrowUp","End"].includes(f.key)&&(w=w.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const y=f.target,T=w.indexOf(y);w=w.slice(T+1)}setTimeout(()=>_(w)),f.preventDefault()}})})})})})})});He.displayName=Bt;var Wt="SelectItemAlignedPosition",We=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:s,...r}=t,d=G(Q,e),l=Y(Q,e),[i,c]=n.useState(null),[p,g]=n.useState(null),x=L(o,N=>g(N)),P=de(e),b=n.useRef(!1),C=n.useRef(!0),{viewport:u,selectedItem:h,selectedItemText:S,focusSelectedItem:m}=l,v=n.useCallback(()=>{if(d.trigger&&d.valueNode&&i&&p&&u&&h&&S){const N=d.trigger.getBoundingClientRect(),O=p.getBoundingClientRect(),U=d.valueNode.getBoundingClientRect(),q=S.getBoundingClientRect();if(d.dir!=="rtl"){const y=q.left-O.left,T=U.left-y,Z=N.left-T,X=N.width+Z,he=Math.max(X,O.width),ge=window.innerWidth-A,ve=Ee(T,[A,Math.max(A,ge-he)]);i.style.minWidth=X+"px",i.style.left=ve+"px"}else{const y=O.right-q.right,T=window.innerWidth-U.right-y,Z=window.innerWidth-N.right-T,X=N.width+Z,he=Math.max(X,O.width),ge=window.innerWidth-A,ve=Ee(T,[A,Math.max(A,ge-he)]);i.style.minWidth=X+"px",i.style.right=ve+"px"}const k=P(),V=window.innerHeight-A*2,z=u.scrollHeight,B=window.getComputedStyle(p),H=parseInt(B.borderTopWidth,10),_=parseInt(B.paddingTop,10),D=parseInt(B.borderBottomWidth,10),W=parseInt(B.paddingBottom,10),K=H+_+z+W+D,pe=Math.min(h.offsetHeight*5,K),ae=window.getComputedStyle(u),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),ee=N.top+N.height/2-A,le=V-ee,re=h.offsetHeight/2,f=h.offsetTop+re,I=H+_+f,j=K-I;if(I<=ee){const y=k.length>0&&h===k[k.length-1].ref.current;i.style.bottom="0px";const T=p.clientHeight-u.offsetTop-u.offsetHeight,Z=Math.max(le,re+(y?me:0)+T+D),X=I+Z;i.style.height=X+"px"}else{const y=k.length>0&&h===k[0].ref.current;i.style.top="0px";const Z=Math.max(ee,H+u.offsetTop+(y?fe:0)+re)+j;i.style.height=Z+"px",u.scrollTop=I-ee+u.offsetTop}i.style.margin=`${A}px 0`,i.style.minHeight=pe+"px",i.style.maxHeight=V+"px",s?.(),requestAnimationFrame(()=>b.current=!0)}},[P,d.trigger,d.valueNode,i,p,u,h,S,d.dir,s]);$(()=>v(),[v]);const[F,M]=n.useState();$(()=>{p&&M(window.getComputedStyle(p).zIndex)},[p]);const ne=n.useCallback(N=>{N&&C.current===!0&&(v(),m?.(),C.current=!1)},[v,m]);return a.jsx(Ut,{scope:e,contentWrapper:i,shouldExpandOnScrollRef:b,onScrollButtonChange:ne,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:a.jsx(R.div,{...r,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});We.displayName=Wt;var Ft="SelectPopperPosition",xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:s="start",collisionPadding:r=A,...d}=t,l=ue(e);return a.jsx(vt,{...l,...d,ref:o,align:s,collisionPadding:r,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xe.displayName=Ft;var[Ut,be]=oe(Q,{}),Se="SelectViewport",Fe=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:s,...r}=t,d=Y(Se,e),l=be(Se,e),i=L(o,d.onViewportChange),c=n.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),a.jsx(ce.Slot,{scope:e,children:a.jsx(R.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,p=>{const g=p.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:P}=l;if(P?.current&&x){const b=Math.abs(c.current-g.scrollTop);if(b>0){const C=window.innerHeight-A*2,u=parseFloat(x.style.minHeight),h=parseFloat(x.style.height),S=Math.max(u,h);if(S<C){const m=S+b,v=Math.min(C,m),F=m-v;x.style.height=v+"px",x.style.bottom==="0px"&&(g.scrollTop=F>0?F:0,x.style.justifyContent="flex-end")}}}c.current=g.scrollTop})})})]})});Fe.displayName=Se;var Ue="SelectGroup",[zt,Kt]=oe(Ue),$t=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Ie();return a.jsx(zt,{scope:e,id:r,children:a.jsx(R.div,{role:"group","aria-labelledby":r,...s,ref:o})})});$t.displayName=Ue;var ze="SelectLabel",Gt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Kt(ze,e);return a.jsx(R.div,{id:r.id,...s,ref:o})});Gt.displayName=ze;var ie="SelectItem",[Yt,Ke]=oe(ie),$e=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:s,disabled:r=!1,textValue:d,...l}=t,i=G(ie,e),c=Y(ie,e),p=i.value===s,[g,x]=n.useState(d??""),[P,b]=n.useState(!1),C=L(o,m=>c.itemRefCallback?.(m,s,r)),u=Ie(),h=n.useRef("touch"),S=()=>{r||(i.onValueChange(s),i.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(Yt,{scope:e,value:s,disabled:r,textId:u,isSelected:p,onItemTextChange:n.useCallback(m=>{x(v=>v||(m?.textContent??"").trim())},[]),children:a.jsx(ce.ItemSlot,{scope:e,value:s,disabled:r,textValue:g,children:a.jsx(R.div,{role:"option","aria-labelledby":u,"data-highlighted":P?"":void 0,"aria-selected":p&&P,"data-state":p?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...l,ref:C,onFocus:E(l.onFocus,()=>b(!0)),onBlur:E(l.onBlur,()=>b(!1)),onClick:E(l.onClick,()=>{h.current!=="mouse"&&S()}),onPointerUp:E(l.onPointerUp,()=>{h.current==="mouse"&&S()}),onPointerDown:E(l.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:E(l.onPointerMove,m=>{h.current=m.pointerType,r?c.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(l.onPointerLeave,m=>{m.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:E(l.onKeyDown,m=>{c.searchRef?.current!==""&&m.key===" "||(Mt.includes(m.key)&&S(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var se="SelectItemText",Ge=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,...d}=t,l=G(se,e),i=Y(se,e),c=Ke(se,e),p=Lt(se,e),[g,x]=n.useState(null),P=L(o,S=>x(S),c.onItemTextChange,S=>i.itemTextRefCallback?.(S,c.value,c.disabled)),b=g?.textContent,C=n.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:b},c.value),[c.disabled,c.value,b]),{onNativeOptionAdd:u,onNativeOptionRemove:h}=p;return $(()=>(u(C),()=>h(C)),[u,h,C]),a.jsxs(a.Fragment,{children:[a.jsx(R.span,{id:c.textId,...d,ref:P}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Pe.createPortal(d.children,l.valueNode):null]})});Ge.displayName=se;var Ye="SelectItemIndicator",qe=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return Ke(Ye,e).isSelected?a.jsx(R.span,{"aria-hidden":!0,...s,ref:o}):null});qe.displayName=Ye;var we="SelectScrollUpButton",Ze=n.forwardRef((t,o)=>{const e=Y(we,t.__scopeSelect),s=be(we,t.__scopeSelect),[r,d]=n.useState(!1),l=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=c.scrollTop>0;d(p)};const c=e.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),r?a.jsx(Je,{...t,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=e;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});Ze.displayName=we;var ye="SelectScrollDownButton",Xe=n.forwardRef((t,o)=>{const e=Y(ye,t.__scopeSelect),s=be(ye,t.__scopeSelect),[r,d]=n.useState(!1),l=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=c.scrollHeight-c.clientHeight,g=Math.ceil(c.scrollTop)<p;d(g)};const c=e.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),r?a.jsx(Je,{...t,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=e;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});Xe.displayName=ye;var Je=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:s,...r}=t,d=Y("SelectScrollButton",e),l=n.useRef(null),i=de(e),c=n.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),$(()=>{i().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),a.jsx(R.div,{"aria-hidden":!0,...r,ref:o,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(s,50))}),onPointerMove:E(r.onPointerMove,()=>{d.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(s,50))}),onPointerLeave:E(r.onPointerLeave,()=>{c()})})}),qt="SelectSeparator",Zt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return a.jsx(R.div,{"aria-hidden":!0,...s,ref:o})});Zt.displayName=qt;var Ce="SelectArrow",Xt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=ue(e),d=G(Ce,e),l=Y(Ce,e);return d.open&&l.position==="popper"?a.jsx(xt,{...r,...s,ref:o}):null});Xt.displayName=Ce;var Jt="SelectBubbleInput",Qe=n.forwardRef(({__scopeSelect:t,value:o,...e},s)=>{const r=n.useRef(null),d=L(s,r),l=St(o);return n.useEffect(()=>{const i=r.current;if(!i)return;const c=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(c,"value").set;if(l!==o&&g){const x=new Event("change",{bubbles:!0});g.call(i,o),i.dispatchEvent(x)}},[l,o]),a.jsx(R.select,{...e,style:{...Re,...e.style},ref:d,defaultValue:o})});Qe.displayName=Jt;function et(t){return t===""||t===void 0}function tt(t){const o=dt(t),e=n.useRef(""),s=n.useRef(0),r=n.useCallback(l=>{const i=e.current+l;o(i),(function c(p){e.current=p,window.clearTimeout(s.current),p!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(i)},[o]),d=n.useCallback(()=>{e.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[e,r,d]}function ot(t,o,e){const r=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,d=e?t.indexOf(e):-1;let l=Qt(t,Math.max(d,0));r.length===1&&(l=l.filter(p=>p!==e));const c=l.find(p=>p.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function Qt(t,o){return t.map((e,s)=>t[(o+s)%t.length])}var eo=je,to=Ae,oo=De,no=Le,ro=ke,so=Ve,ao=Fe,lo=$e,io=Ge,co=qe,uo=Ze,po=Xe;function vo({...t}){return a.jsx(eo,{"data-slot":"select",...t})}function xo({...t}){return a.jsx(oo,{"data-slot":"select-value",...t})}function So({className:t,size:o="default",children:e,...s}){return a.jsxs(to,{"data-slot":"select-trigger","data-size":o,className:te("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s,children:[e,a.jsx(no,{asChild:!0,children:a.jsx(_e,{className:"size-4 opacity-50"})})]})}function wo({className:t,children:o,position:e="item-aligned",align:s="center",...r}){return a.jsx(ro,{children:a.jsxs(so,{"data-slot":"select-content",className:te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,align:s,...r,children:[a.jsx(fo,{}),a.jsx(ao,{className:te("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),a.jsx(mo,{})]})})}function yo({className:t,children:o,...e}){return a.jsxs(lo,{"data-slot":"select-item",className:te("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...e,children:[a.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(co,{children:a.jsx(wt,{className:"size-4"})})}),a.jsx(io,{children:o})]})}function fo({className:t,...o}){return a.jsx(uo,{"data-slot":"select-scroll-up-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:a.jsx(Ct,{className:"size-4"})})}function mo({className:t,...o}){return a.jsx(po,{"data-slot":"select-scroll-down-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:a.jsx(_e,{className:"size-4"})})}export{Ct as C,vo as S,Rt as V,So as a,xo as b,wo as c,yo as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as k,g as P,u as A,a as p,b as w,r as i,j as e,R as b,h as F,c as R}from"./main-CKj5yfEi.js";import{B as M,a as _,X as I,C as y}from"./badge-hvUOzpVZ.js";import{L as c}from"./label-KNtpL71g.js";import{S as q,a as O,b as B,c as G,d as V}from"./select-BD29IXCI.js";import{u as H}from"./usePermissions-Basjs9BT.js";import{C as N}from"./CmsPageHeader-CirpXndm.js";import{A as U,a as $,C as h}from"./alert-BXjTqrwQ.js";import{S as j}from"./switch-h3Rrnl5i.js";import{T as J}from"./triangle-alert-E52Vfeuh.js";const Q=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],X=k("monitor",Q);const Z=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],K=k("moon",Z);const W=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Y=k("sun",W),ee=[{value:"en",label:"English (en)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"},{value:"it",label:"Italian (it)"},{value:"pt",label:"Portuguese (pt)"},{value:"zh",label:"Chinese (zh)"},{value:"ja",label:"Japanese (ja)"}],se=[{value:"light",label:"Light",icon:e.jsx(Y,{className:"size-4"})},{value:"dark",label:"Dark",icon:e.jsx(K,{className:"size-4"})},{value:"system",label:"System",icon:e.jsx(X,{className:"size-4"})}];function te(){const{theme:v,setTheme:l}=F();return e.jsxs(h,{elevation:"base",className:"p-6",children:[e.jsx("h2",{className:"mb-4 text-lg font-semibold text-foreground",children:"Appearance"}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(c,{className:"text-sm font-medium",children:"Theme"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose your preferred color theme for the admin interface."})]}),e.jsx("div",{className:"flex gap-1 rounded-lg border bg-muted/50 p-1",children:se.map(d=>e.jsxs("button",{type:"button",onClick:()=>l(d.value),className:R("flex items-center gap-2 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",v===d.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[d.icon,d.label]},d.value))})]})})]})}function ue(){const{canManageSettings:v}=H(),l=v(),{baseConfig:d}=P(),a=A(p.settings.get),C=w(p.settings.update),S=w(p.settings.reset),[s,o]=i.useState(null),[m,u]=i.useState(!1),[r,n]=i.useState("idle"),[E,x]=i.useState(null);i.useEffect(()=>{a&&!s&&o(a)},[a,s]),i.useEffect(()=>{a&&!m&&o(a)},[a,m]);const z=i.useCallback(t=>{s&&(o({...s,defaultLocale:t}),u(!0),n("idle"))},[s]),f=i.useCallback(t=>{s&&(o({...s,features:{...s.features,[t]:!s.features[t]}}),u(!0),n("idle"))},[s]),L=i.useCallback(async()=>{if(!(!s||!m)){n("saving"),x(null);try{await C({defaultLocale:s.defaultLocale,features:s.features}),n("saved"),u(!1),setTimeout(()=>{n("idle")},3e3)}catch(t){n("error"),x(t instanceof Error?t.message:"Failed to save settings")}}},[s,m,C]),T=i.useCallback(async()=>{if(window.confirm("Are you sure you want to reset all settings to their defaults? This action cannot be undone.")){n("saving"),x(null);try{const g=await S({});o(g),n("saved"),u(!1),setTimeout(()=>{n("idle")},3e3)}catch(g){n("error"),x(g instanceof Error?g.message:"Failed to reset settings")}}},[S]),D=i.useCallback(()=>{a&&(o(a),u(!1),n("idle"),x(null))},[a]);return a===void 0?e.jsx(b,{requiredPermission:{resource:"settings",action:"manage"},children:e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx(N,{title:"Settings",description:"Configure your CMS settings and preferences."}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx("div",{className:"size-8 animate-spin rounded-full border-2 border-muted border-t-primary"}),e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Loading settings..."})]})]})}):a===null&&!s?e.jsx(b,{requiredPermission:{resource:"settings",action:"manage"},children:e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx(N,{title:"Settings",description:"Configure your CMS settings and preferences."}),e.jsxs(U,{variant:"destructive",children:[e.jsx(J,{className:"size-4"}),e.jsx($,{children:"Failed to load settings. Please try refreshing the page."})]})]})}):e.jsx(b,{requiredPermission:{resource:"settings",action:"manage"},children:e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(N,{title:"Settings",description:"Configure your CMS settings and preferences."}),l&&e.jsxs("div",{className:"flex items-center gap-3",children:[r==="saved"&&e.jsxs(M,{variant:"secondary",className:"gap-1 bg-emerald-100 text-emerald-700",children:[e.jsx(_,{className:"size-3"}),"Settings saved successfully"]}),r==="error"&&e.jsxs(M,{variant:"destructive",className:"gap-1",children:[e.jsx(I,{className:"size-3"}),E||"An error occurred"]}),m&&e.jsx(y,{variant:"secondary",onClick:D,disabled:r==="saving",children:"Discard Changes"}),e.jsx(y,{onClick:L,disabled:!m,loading:r==="saving",children:"Save Changes"})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(te,{}),s?.features.localization&&e.jsxs(h,{elevation:"base",className:"p-6",children:[e.jsx("h2",{className:"mb-4 text-lg font-semibold text-foreground",children:"General"}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(c,{className:"text-sm font-medium",children:"Default Locale"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"The default language for new content entries."})]}),e.jsxs(q,{value:s?.defaultLocale||"en",onValueChange:z,disabled:!l||r==="saving",children:[e.jsx(O,{className:"w-48",children:e.jsx(B,{})}),e.jsx(G,{children:ee.map(t=>e.jsx(V,{value:t.value,children:t.label},t.value))})]})]})})]}),e.jsxs(h,{elevation:"base",className:"p-6",children:[e.jsx("h2",{className:"mb-4 text-lg font-semibold text-foreground",children:"Features"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(c,{className:"text-sm font-medium",children:"Enable Versioning"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Track content history and enable rollback to previous versions"})]}),e.jsx(j,{checked:s?.features.versioning??!0,onCheckedChange:()=>f("versioning"),disabled:!l||r==="saving"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(c,{className:"text-sm font-medium",children:"Enable Scheduling"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Schedule content to publish at a future date and time"})]}),e.jsx(j,{checked:s?.features.scheduling??!0,onCheckedChange:()=>f("scheduling"),disabled:!l||r==="saving"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(c,{className:"text-sm font-medium",children:"Enable Localization"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Support multiple languages for content entries"})]}),e.jsx(j,{checked:s?.features.localization??!1,onCheckedChange:()=>f("localization"),disabled:!l||r==="saving"})]}),d.navigation.showMedia&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(c,{className:"text-sm font-medium",children:"Enable Media Management"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Use the built-in media library for image and file uploads"})]}),e.jsx(j,{checked:s?.features.mediaManagement??!0,onCheckedChange:()=>f("mediaManagement"),disabled:!l||r==="saving"})]})]})]}),e.jsxs(h,{elevation:"base",className:"p-6",children:[e.jsx("h2",{className:"mb-4 text-lg font-semibold text-foreground",children:"API"}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(c,{className:"text-sm font-medium",children:"Convex Deployment URL"}),e.jsx("code",{className:"mt-1 block rounded-md bg-muted px-3 py-2 text-sm",children:"https://majestic-beagle-49.convex.cloud"})]})})]}),l&&e.jsxs(h,{elevation:"base",className:"border-red-200 p-6 dark:border-red-900",children:[e.jsx("h2",{className:"mb-4 text-lg font-semibold text-red-600",children:"Danger Zone"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(c,{className:"text-sm font-medium",children:"Reset to Defaults"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Reset all settings to their default values. This cannot be undone."})]}),e.jsx(y,{variant:"danger",onClick:T,disabled:r==="saving",children:"Reset Settings"})]})]})]})]})})}export{ue as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,_ as C,a6 as T,j as o,a0 as y,a3 as I,a7 as M,a2 as H,c as g}from"./main-CKj5yfEi.js";import{u as z}from"./badge-hvUOzpVZ.js";var b="Switch",[A]=H(b),[U,q]=A(b),P=s.forwardRef((e,a)=>{const{__scopeSwitch:t,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:k,form:i,...w}=e,[l,p]=s.useState(null),v=C(a,f=>p(f)),x=s.useRef(!1),S=l?i||!!l.closest("form"):!0,[h,N]=T({prop:r,defaultProp:m??!1,onChange:k,caller:b});return o.jsxs(U,{scope:t,checked:h,disabled:c,children:[o.jsx(y.button,{type:"button",role:"switch","aria-checked":h,"aria-required":d,"data-state":j(h),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:v,onClick:I(e.onClick,f=>{N(B=>!B),S&&(x.current=f.isPropagationStopped(),x.current||f.stopPropagation())})}),S&&o.jsx(_,{control:l,bubbles:!x.current,name:n,value:u,checked:h,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((e,a)=>{const{__scopeSwitch:t,...n}=e,r=q(E,t);return o.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:a})});R.displayName=E;var L="SwitchBubbleInput",_=s.forwardRef(({__scopeSwitch:e,control:a,checked:t,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=z(t),k=M(a);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&p){const v=new Event("click",{bubbles:n});p.call(i,t),i.dispatchEvent(v)}},[u,t,n]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:c,style:{...r.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=L;function j(e){return e?"checked":"unchecked"}var O=P,D=R;function X({className:e,...a}){return o.jsx(O,{"data-slot":"switch",className:g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...a,children:o.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{X as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as k,r as u,b as H,j as t,Y as ee,c as N,$ as te,a6 as se,a0 as T,a8 as re,a9 as ae,aa as ne,a3 as z,ab as B,a2 as oe,a1 as ie}from"./main-CKj5yfEi.js";import{C as j,X as $,a as ce}from"./badge-hvUOzpVZ.js";const le=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Re=k("chevron-left",le);const de=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Ue=k("file",de);const ue=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],De=k("music",ue);const pe=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],me=k("refresh-cw",pe);const ge=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],fe=k("upload",ge);const he=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],Ie=k("video",he);function ve(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function xe(r,a=5e3){return r.type.startsWith("image/")?new Promise(s=>{const c=new Image;let l=null;const i=setTimeout(()=>{l&&URL.revokeObjectURL(l),s(void 0)},a);c.onload=()=>{clearTimeout(i),l&&URL.revokeObjectURL(l),s({width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{clearTimeout(i),l&&URL.revokeObjectURL(l),s(void 0)},l=URL.createObjectURL(r),c.src=l}):Promise.resolve(void 0)}function be(r,a,s,c){return new Promise((l,i)=>{const n=new XMLHttpRequest,g=()=>{n.abort(),i(new DOMException("Upload aborted","AbortError"))};s.addEventListener("abort",g),n.upload.onprogress=h=>{if(h.lengthComputable){const v=Math.round(h.loaded/h.total*80);c(10+v)}},n.onload=()=>{if(s.removeEventListener("abort",g),n.status>=200&&n.status<300)try{const h=JSON.parse(n.responseText);l(h.storageId)}catch{i(new Error("Invalid response from upload server"))}else i(new Error(`Upload failed: ${n.statusText||`HTTP ${n.status}`}`))},n.onerror=()=>{s.removeEventListener("abort",g),i(new Error("Network error during upload"))},n.ontimeout=()=>{s.removeEventListener("abort",g),i(new Error("Upload timed out"))},n.open("POST",r),n.setRequestHeader("Content-Type",a.type),n.send(a)})}function Ce(r,a){switch(a.type){case"ADD_FILES":{const s=a.files.map(c=>({id:ve(),file:c,status:"pending",progress:0}));return[...r,...s]}case"UPDATE_FILE":return r.map(s=>s.id===a.id?{...s,...a.updates}:s);case"RETRY_FILE":return r.map(s=>s.id===a.id?{...s,status:"pending",progress:0,error:void 0}:s);case"REMOVE_FILE":return r.filter(s=>s.id!==a.id);case"CLEAR_COMPLETED":return r.filter(s=>s.status==="pending"||s.status==="uploading");case"CLEAR_ALL":return[];case"CANCEL_FILE":return r.map(s=>s.id===a.id&&(s.status==="pending"||s.status==="uploading")?{...s,status:"cancelled",error:"Upload cancelled"}:s);case"CANCEL_ALL":return r.map(s=>s.status==="pending"||s.status==="uploading"?{...s,status:"cancelled",error:"Upload cancelled"}:s);default:return r}}function ye(r){const{maxConcurrent:a=3,metadata:s,onComplete:c,onError:l}=r,[i,n]=u.useReducer(Ce,[]),g=H(r.getUploadUrl),h=H(r.createAsset),v=u.useRef(0),p=u.useRef(new Map),m=u.useRef(!1),x=u.useCallback(async o=>{const f=new AbortController;p.current.set(o.id,f),n({type:"UPDATE_FILE",id:o.id,updates:{status:"uploading",progress:0}});try{const y=await g({});n({type:"UPDATE_FILE",id:o.id,updates:{progress:5}});const e=await be(y,o.file,f.signal,L=>{n({type:"UPDATE_FILE",id:o.id,updates:{progress:L}})});n({type:"UPDATE_FILE",id:o.id,updates:{progress:90}});const C=await xe(o.file),b=await h({storageId:e,name:o.file.name,mimeType:o.file.type,size:o.file.size,...C,...s});n({type:"UPDATE_FILE",id:o.id,updates:{status:"complete",progress:100,result:b}})}catch(y){const e=y instanceof Error?y:new Error(String(y));if(e.name==="AbortError")n({type:"UPDATE_FILE",id:o.id,updates:{status:"cancelled",error:"Upload cancelled"}});else{const C={...o,status:"error",error:e.message};n({type:"UPDATE_FILE",id:o.id,updates:{status:"error",error:e.message}}),l?.(C)}}finally{p.current.delete(o.id),v.current--}},[g,h,s,l]),d=u.useCallback(()=>{if(m.current)return;m.current=!0;const o=i.filter(f=>f.status==="pending");for(;v.current<a&&o.length>0;){const f=o.shift();v.current++,x(f)}m.current=!1,v.current===0&&i.length>0&&i.every(f=>f.status!=="pending"&&f.status!=="uploading")&&c?.(i)},[i,a,x,c]);u.useEffect(()=>{i.some(o=>o.status==="pending")&&v.current<a&&d()},[i,a,d]);const A=u.useCallback(o=>{n({type:"ADD_FILES",files:o})},[]),E=u.useCallback(o=>{const f=p.current.get(o);f&&f.abort(),n({type:"CANCEL_FILE",id:o})},[]),w=u.useCallback(()=>{p.current.forEach(o=>o.abort()),n({type:"CANCEL_ALL"})},[]),R=u.useCallback(o=>{n({type:"RETRY_FILE",id:o})},[]),U=u.useCallback(()=>{n({type:"CLEAR_COMPLETED"})},[]),D=u.useCallback(()=>{p.current.forEach(o=>o.abort()),n({type:"CLEAR_ALL"})},[]),I=i.some(o=>o.status==="uploading"),M=i.length>0?Math.round(i.reduce((o,f)=>o+f.progress,0)/i.length):0;return{files:i,addFiles:A,cancelFile:E,cancelAll:w,retryFile:R,clearCompleted:U,clearAll:D,isUploading:I,overallProgress:M}}function S(r){if(r===0)return"0 B";const a=1024,s=["B","KB","MB","GB"],c=Math.floor(Math.log(r)/Math.log(a));return`${parseFloat((r/Math.pow(a,c)).toFixed(1))} ${s[c]}`}function je(r,a){return a.length===0?!0:a.some(s=>{if(s.endsWith("/*")){const c=s.slice(0,-2);return r.startsWith(c+"/")}return r===s})}function Me({onUploadComplete:r,currentFolderId:a,generateUploadUrl:s,createAsset:c,maxFileSize:l,allowedMimeTypes:i=[],maxConcurrentUploads:n=3,onError:g}){const[h,v]=u.useState(!1),[p,m]=u.useState(new Map),x=u.useRef(null),d=ye({getUploadUrl:s,createAsset:c,maxConcurrent:n,metadata:a?{parentId:a}:void 0,onComplete:e=>{const C=e.map(b=>({filename:b.file.name,storageId:b.result?String(b.result._id||""):"",success:b.status==="complete",error:b.error}));r(C)},onError:e=>{g?.(e.error||"Upload failed",e.file.name)}}),A=u.useCallback(e=>l&&e.size>l?`File exceeds maximum size of ${S(l)}`:i.length>0&&!je(e.type,i)?`File type ${e.type||"unknown"} is not allowed`:null,[l,i]),E=u.useCallback(e=>{const C=Array.from(e),b=new Map,L=[];for(const P of C){const V=A(P);V?b.set(P.name,V):L.push(P)}m(b),L.length>0&&d.addFiles(L)},[A,d]),w=u.useCallback(e=>{e.preventDefault(),e.stopPropagation(),v(!0)},[]),R=u.useCallback(e=>{e.preventDefault(),e.stopPropagation(),v(!1)},[]),U=u.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),D=u.useCallback(e=>{e.preventDefault(),e.stopPropagation(),v(!1),e.dataTransfer.files?.length&&E(e.dataTransfer.files)},[E]),I=u.useCallback(e=>{e.target.files?.length&&(E(e.target.files),e.target.value="")},[E]),M=e=>{switch(e){case"complete":return t.jsx(ce,{className:"size-4 text-emerald-500"});case"error":case"cancelled":return t.jsx($,{className:"size-4 text-red-500"});case"uploading":return t.jsx("div",{className:"size-4 animate-spin rounded-full border-2 border-muted border-t-primary"});default:return t.jsx("div",{className:"size-4 rounded-full border-2 border-muted"})}},o=d.files.filter(e=>e.status==="complete").length,f=d.files.filter(e=>e.status==="error"||e.status==="cancelled").length,y=o>0||f>0;return t.jsxs("div",{className:"space-y-4",children:[p.size>0&&t.jsxs("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 p-3",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(ee,{className:"mt-0.5 size-4 shrink-0 text-destructive"}),t.jsx("div",{className:"flex-1 space-y-1",children:Array.from(p.entries()).map(([e,C])=>t.jsxs("p",{className:"text-sm text-destructive",children:[t.jsxs("span",{className:"font-medium",children:[e,":"]})," ",C]},e))})]}),t.jsx(j,{variant:"ghost",size:"sm",className:"mt-2",onClick:()=>m(new Map),children:"Dismiss"})]}),!d.isUploading&&d.files.length===0&&t.jsxs("div",{className:N("flex cursor-pointer flex-col items-center justify-center gap-3 rounded-lg border-2 border-dashed p-8 text-center transition-colors",h?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-primary/50 hover:bg-muted/50"),onClick:()=>x.current?.click(),onDragEnter:w,onDragLeave:R,onDragOver:U,onDrop:D,children:[t.jsx("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:t.jsx(fe,{className:"size-6 text-muted-foreground"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:h?"Drop files here":"Drag and drop files here"}),t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"or click to browse"})]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Supports images, videos, documents, and more",l&&` (max ${S(l)} per file)`]})]}),d.files.length>0&&t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsxs("span",{className:"font-medium",children:[d.files.length," file",d.files.length!==1?"s":""]}),d.isUploading&&t.jsxs("span",{className:"text-muted-foreground",children:[d.overallProgress,"% complete"]}),!d.isUploading&&y&&t.jsxs("div",{className:"flex items-center gap-2",children:[o>0&&t.jsxs("span",{className:"text-emerald-600",children:[o," completed"]}),f>0&&t.jsxs("span",{className:"text-red-500",children:[f," failed"]})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[!d.isUploading&&t.jsx(j,{variant:"outline",size:"sm",onClick:()=>x.current?.click(),children:"Add More"}),d.isUploading&&t.jsx(j,{variant:"outline",size:"sm",onClick:d.cancelAll,children:"Cancel All"}),y&&!d.isUploading&&t.jsx(j,{variant:"ghost",size:"sm",onClick:d.clearCompleted,children:"Clear Done"})]})]}),d.isUploading&&t.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:t.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${d.overallProgress}%`}})}),t.jsx("div",{className:"space-y-2",children:d.files.map(e=>t.jsxs("div",{className:N("flex items-center gap-3 rounded-lg border bg-card p-3",e.status==="error"&&"border-red-200 bg-red-50 dark:border-red-900 dark:bg-red-950/20",e.status==="complete"&&"border-emerald-200 bg-emerald-50 dark:border-emerald-900 dark:bg-emerald-950/20"),children:[t.jsx("div",{className:"shrink-0",children:M(e.status)}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",title:e.file.name,children:e.file.name}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:S(e.file.size)}),e.error&&t.jsx("span",{className:"text-xs text-red-500",children:e.error})]})]}),e.status==="uploading"&&t.jsxs("div",{className:"flex w-20 items-center gap-2",children:[t.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-muted",children:t.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${e.progress}%`}})}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.progress,"%"]})]}),t.jsxs("div",{className:"shrink-0",children:[e.status==="pending"&&!d.isUploading&&t.jsx(j,{variant:"ghost",size:"icon-sm",onClick:()=>d.cancelFile(e.id),title:"Remove",children:t.jsx($,{className:"size-4"})}),(e.status==="uploading"||e.status==="pending")&&d.isUploading&&t.jsx(j,{variant:"ghost",size:"icon-sm",onClick:()=>d.cancelFile(e.id),title:"Cancel",children:t.jsx($,{className:"size-4"})}),(e.status==="error"||e.status==="cancelled")&&!d.isUploading&&t.jsx(j,{variant:"ghost",size:"icon-sm",onClick:()=>d.retryFile(e.id),title:"Retry",children:t.jsx(me,{className:"size-4"})})]})]},e.id))})]}),t.jsx("input",{ref:x,type:"file",multiple:!0,onChange:I,className:"hidden",accept:i.length>0?i.join(","):void 0})]})}var _="Tabs",[Ee]=oe(_,[B]),F=B(),[Ne,O]=Ee(_),G=u.forwardRef((r,a)=>{const{__scopeTabs:s,value:c,onValueChange:l,defaultValue:i,orientation:n="horizontal",dir:g,activationMode:h="automatic",...v}=r,p=te(g),[m,x]=se({prop:c,onChange:l,defaultProp:i??"",caller:_});return t.jsx(Ne,{scope:s,baseId:re(),value:m,onValueChange:x,orientation:n,dir:p,activationMode:h,children:t.jsx(T.div,{dir:p,"data-orientation":n,...v,ref:a})})});G.displayName=_;var W="TabsList",K=u.forwardRef((r,a)=>{const{__scopeTabs:s,loop:c=!0,...l}=r,i=O(W,s),n=F(s);return t.jsx(ae,{asChild:!0,...n,orientation:i.orientation,dir:i.dir,loop:c,children:t.jsx(T.div,{role:"tablist","aria-orientation":i.orientation,...l,ref:a})})});K.displayName=W;var X="TabsTrigger",Y=u.forwardRef((r,a)=>{const{__scopeTabs:s,value:c,disabled:l=!1,...i}=r,n=O(X,s),g=F(s),h=Z(n.baseId,c),v=q(n.baseId,c),p=c===n.value;return t.jsx(ne,{asChild:!0,...g,focusable:!l,active:p,children:t.jsx(T.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":v,"data-state":p?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:h,...i,ref:a,onMouseDown:z(r.onMouseDown,m=>{!l&&m.button===0&&m.ctrlKey===!1?n.onValueChange(c):m.preventDefault()}),onKeyDown:z(r.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&n.onValueChange(c)}),onFocus:z(r.onFocus,()=>{const m=n.activationMode!=="manual";!p&&!l&&m&&n.onValueChange(c)})})})});Y.displayName=X;var Q="TabsContent",J=u.forwardRef((r,a)=>{const{__scopeTabs:s,value:c,forceMount:l,children:i,...n}=r,g=O(Q,s),h=Z(g.baseId,c),v=q(g.baseId,c),p=c===g.value,m=u.useRef(p);return u.useEffect(()=>{const x=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(x)},[]),t.jsx(ie,{present:l||p,children:({present:x})=>t.jsx(T.div,{"data-state":p?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":h,hidden:!x,id:v,tabIndex:0,...n,ref:a,style:{...r.style,animationDuration:m.current?"0s":void 0},children:x&&i})})});J.displayName=Q;function Z(r,a){return`${r}-trigger-${a}`}function q(r,a){return`${r}-content-${a}`}var ke=G,Le=K,Ae=Y,Te=J;function Pe({className:r,...a}){return t.jsx(ke,{"data-slot":"tabs",className:N("flex flex-col gap-2",r),...a})}function ze({className:r,...a}){return t.jsx(Le,{"data-slot":"tabs-list",className:N("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",r),...a})}function $e({className:r,...a}){return t.jsx(Ae,{"data-slot":"tabs-trigger",className:N("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),...a})}function Se({className:r,...a}){return t.jsx(Te,{"data-slot":"tabs-content",className:N("flex-1 outline-none",r),...a})}export{Re as C,Ue as F,De as M,me as R,Pe as T,fe as U,Ie as V,ze as a,$e as b,Me as c,Se as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as K,r as t,b as I,a as F,j as e,u as L,e as W,C as X,f as Y,c as P,T as Q}from"./main-CKj5yfEi.js";import{c as R,I as D,a as H,C as Z,b as U}from"./CmsEmptyState-CRswfTzk.js";import{C as f,B as q}from"./badge-hvUOzpVZ.js";import{L as j}from"./label-KNtpL71g.js";import{T as V,P as G,a as M}from"./textarea-BTy7nwzR.js";import{P as _}from"./plus-DUn8v_Xf.js";import{C as ee}from"./CmsPageHeader-CirpXndm.js";import{C as B,A as se,a as ae}from"./alert-BXjTqrwQ.js";import{S as te}from"./scroll-area-DfIlT0in.js";import{T as re}from"./triangle-alert-E52Vfeuh.js";const ie=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],le=K("folder-tree",ie);function ne({taxonomy:s,onSave:c,onCancel:w}){const x=!!s,[n,N]=t.useState({name:s?.name??"",displayName:s?.displayName??"",description:s?.description??"",isHierarchical:s?.isHierarchical??!1,allowInlineCreation:s?.allowInlineCreation??!0,isActive:s?.isActive??!0,icon:s?.icon??"",sortOrder:s?.sortOrder??0}),[d,o]=t.useState({}),[m,v]=t.useState(!1),[C,u]=t.useState(null),[y,E]=t.useState(!1),b=I(F.taxonomies.createTaxonomy),k=I(F.taxonomies.updateTaxonomy);t.useEffect(()=>{s&&N({name:s.name,displayName:s.displayName,description:s.description??"",isHierarchical:s.isHierarchical,allowInlineCreation:s.allowInlineCreation,isActive:s.isActive,icon:s.icon??"",sortOrder:s.sortOrder??0})},[s]);const h=t.useCallback((r,O)=>{N(T=>({...T,[r]:O})),o(T=>{const{[r]:l,...a}=T;return a})},[]),S=t.useCallback(r=>r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),[]),z=t.useCallback(r=>{h("displayName",r),!x&&!y&&h("name",S(r))},[h,x,y,S]),i=t.useCallback(()=>{const r={};return n.name.trim()?/^[a-z][a-z0-9-]*$/.test(n.name)||(r.name="Slug must start with a letter and contain only lowercase letters, numbers, and hyphens"):r.name="Slug is required",n.displayName.trim()||(r.displayName="Display name is required"),o(r),Object.keys(r).length===0},[n]),p=t.useCallback(async r=>{if(r.preventDefault(),!!i()){v(!0),u(null);try{x&&s?await k({id:s._id,displayName:n.displayName,description:n.description||void 0,allowInlineCreation:n.allowInlineCreation,icon:n.icon||void 0,sortOrder:n.sortOrder,isActive:n.isActive}):await b({name:n.name,displayName:n.displayName,description:n.description||void 0,isHierarchical:n.isHierarchical,allowInlineCreation:n.allowInlineCreation,icon:n.icon||void 0,sortOrder:n.sortOrder}),c()}catch(O){const T=O instanceof Error?O.message:"Failed to save taxonomy";u(T)}finally{v(!1)}}},[i,x,s,n,b,k,c]);return e.jsx(R,{open:!0,onOpenChange:r=>!r&&!m&&w(),title:x?"Edit Taxonomy":"Create Taxonomy",size:"lg",footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"outline",onClick:w,disabled:m,children:"Cancel"}),e.jsx(f,{variant:"primary",onClick:p,loading:m,children:x?"Save Changes":"Create Taxonomy"})]}),children:e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[C&&e.jsx("div",{className:"rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800",children:C}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(j,{htmlFor:"displayName",children:["Display Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(D,{id:"displayName",value:n.displayName,onChange:r=>z(r.target.value),placeholder:"e.g., Categories, Tags",disabled:m,className:d.displayName?"border-destructive":""}),d.displayName&&e.jsx("p",{className:"text-xs text-destructive",children:d.displayName})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(j,{htmlFor:"name",children:["Slug ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(D,{id:"name",value:n.name,onChange:r=>{h("name",r.target.value.toLowerCase()),E(!0)},placeholder:"e.g., categories, tags",disabled:m||x,className:d.name?"border-destructive":""}),d.name&&e.jsx("p",{className:"text-xs text-destructive",children:d.name}),x&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Slug cannot be changed after creation"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"description",children:"Description"}),e.jsx(V,{id:"description",value:n.description,onChange:r=>h("description",r.target.value),placeholder:"Optional description",rows:2,disabled:m})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"icon",children:"Icon"}),e.jsx(D,{id:"icon",value:n.icon,onChange:r=>h("icon",r.target.value),placeholder:"e.g., 🏷️ or folder",disabled:m}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Emoji or icon name"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"sortOrder",children:"Sort Order"}),e.jsx(D,{id:"sortOrder",type:"number",value:n.sortOrder,onChange:r=>h("sortOrder",parseInt(r.target.value)||0),disabled:m})]})]}),e.jsxs("div",{className:"space-y-4 pt-2",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(H,{id:"isHierarchical",checked:n.isHierarchical,onCheckedChange:r=>h("isHierarchical",r),disabled:m||x}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{htmlFor:"isHierarchical",className:"cursor-pointer font-medium",children:"Hierarchical"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Terms can have parent-child relationships (like categories)"}),x&&e.jsx("p",{className:"text-xs text-amber-600",children:"Hierarchy type cannot be changed after creation"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(H,{id:"allowInlineCreation",checked:n.allowInlineCreation,onCheckedChange:r=>h("allowInlineCreation",r),disabled:m}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{htmlFor:"allowInlineCreation",className:"cursor-pointer font-medium",children:"Allow inline creation"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Users can create new terms while editing content"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(H,{id:"isActive",checked:n.isActive,onCheckedChange:r=>h("isActive",r),disabled:m}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{htmlFor:"isActive",className:"cursor-pointer font-medium",children:"Active"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Inactive taxonomies are hidden from content editors"})]})]})]})]})})}function oe({taxonomyId:s,isHierarchical:c,allowInlineCreation:w}){const[x,n]=t.useState(new Set),[N,d]=t.useState(null),[o,m]=t.useState(!1),[v,C]=t.useState(),[u,y]=t.useState(null),[E,b]=t.useState(null),k=c?L(F.taxonomies.getTermsHierarchy,{taxonomyId:s}):L(F.taxonomies.listTerms,{taxonomyId:s}),h=I(F.taxonomies.deleteTerm),S=c?k:k?.page,z=S===void 0,i=t.useCallback(l=>{n(a=>{const g=new Set(a);return g.has(l)?g.delete(l):g.add(l),g})},[]),p=t.useCallback(l=>{C(l),d(null),m(!0)},[]),r=t.useCallback(l=>{d(l),m(!0)},[]),O=t.useCallback(async l=>{b(null);try{await h({id:l,cascade:!0}),y(null)}catch(a){const g=a instanceof Error?a.message:"Failed to delete term";b(g)}},[h]),T=(l,a=0)=>{const g=l.children&&l.children.length>0,A=x.has(l._id);return e.jsxs("div",{className:"border-b border-border/50 last:border-0",children:[e.jsxs("div",{className:P("group flex items-center gap-2 py-2 pr-2 transition-colors hover:bg-muted/50",a>0&&"border-l-2 border-muted"),style:{paddingLeft:`${a*24+8}px`},children:[c&&e.jsx("button",{type:"button",onClick:()=>i(l._id),disabled:!g,className:P("flex size-5 items-center justify-center rounded transition-colors",g?"text-muted-foreground hover:bg-muted hover:text-foreground":"invisible"),"aria-expanded":A,children:g&&(A?e.jsx(X,{className:"size-4"}):e.jsx(Y,{className:"size-4"}))}),e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[l.color&&e.jsx("span",{className:"size-3 shrink-0 rounded-full",style:{backgroundColor:l.color}}),l.icon&&e.jsx("span",{className:"shrink-0 text-sm",children:l.icon}),e.jsx("span",{className:"truncate font-medium text-foreground",children:l.name}),e.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:["(",l.slug,")"]}),e.jsxs("span",{className:"ml-auto shrink-0 rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",children:[l.usageCount," ",l.usageCount===1?"use":"uses"]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[c&&w&&e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>p(l._id),title:"Add child term",className:"size-7 p-0",children:e.jsx(_,{className:"size-3.5"})}),e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>r(l),title:"Edit term",className:"size-7 p-0",children:e.jsx(G,{className:"size-3.5"})}),e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>y(l._id),title:"Delete term",className:"size-7 p-0 text-destructive hover:text-destructive",children:e.jsx(Q,{className:"size-3.5"})})]})]}),c&&g&&A&&e.jsx("div",{children:l.children.map($=>T($,a+1))})]},l._id)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Terms"}),e.jsxs(f,{variant:"secondary",size:"sm",onClick:()=>p(),children:[e.jsx(_,{className:"size-3.5"}),"Add Term"]})]}),E&&e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800",children:[E,e.jsx("button",{type:"button",onClick:()=>b(null),className:"text-red-600 hover:text-red-800",children:"×"})]}),e.jsx("div",{className:"rounded-lg border bg-card",children:z?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"size-6 animate-spin rounded-full border-2 border-muted border-t-primary"})}):!S||S.length===0?e.jsx(Z,{icon:e.jsx(W,{className:"size-8"}),title:"No terms yet",description:"Add your first term to start organizing content.",action:w&&e.jsxs(f,{variant:"secondary",onClick:()=>p(),children:[e.jsx(_,{className:"size-4"}),"Add your first term"]})}):e.jsx("div",{className:"divide-y divide-border/50",children:S.map(l=>T(l))})}),o&&e.jsx(ce,{taxonomyId:s,term:N,parentId:v,isHierarchical:c,onSave:()=>{m(!1),d(null),C(void 0)},onCancel:()=>{m(!1),d(null),C(void 0)}}),e.jsx(U,{open:!!u,onOpenChange:l=>!l&&y(null),title:"Delete Term",description:c?"Are you sure you want to delete this term? All child terms will also be deleted.":"Are you sure you want to delete this term?",confirmLabel:"Delete",variant:"danger",onConfirm:()=>u&&O(u)})]})}function ce({taxonomyId:s,term:c,parentId:w,isHierarchical:x,onSave:n,onCancel:N}){const d=!!c,[o,m]=t.useState({name:c?.name??"",slug:c?.slug??"",description:c?.description??"",color:c?.color??"",icon:c?.icon??"",sortOrder:c?.sortOrder??0}),[v,C]=t.useState({}),[u,y]=t.useState(!1),[E,b]=t.useState(null),[k,h]=t.useState(!1),S=I(F.taxonomies.createTerm),z=I(F.taxonomies.updateTerm),i=t.useCallback((a,g)=>{m(A=>({...A,[a]:g})),C(A=>{const{[a]:$,...J}=A;return J})},[]),p=t.useCallback(a=>a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),[]),r=t.useCallback(a=>{i("name",a),!d&&!k&&i("slug",p(a))},[i,d,k,p]),O=t.useCallback(()=>{const a={};return o.name.trim()||(a.name="Name is required"),o.slug.trim()?/^[a-z0-9-]+$/.test(o.slug)||(a.slug="Slug must contain only lowercase letters, numbers, and hyphens"):a.slug="Slug is required",C(a),Object.keys(a).length===0},[o]),T=t.useCallback(async a=>{if(a.preventDefault(),!!O()){y(!0),b(null);try{d&&c?await z({id:c._id,name:o.name,slug:o.slug,description:o.description||void 0,color:o.color||void 0,icon:o.icon||void 0,sortOrder:o.sortOrder}):await S({taxonomyId:s,name:o.name,slug:o.slug,description:o.description||void 0,parentId:w,color:o.color||void 0,icon:o.icon||void 0,sortOrder:o.sortOrder}),n()}catch(g){const A=g instanceof Error?g.message:"Failed to save term";b(A)}finally{y(!1)}}},[O,d,c,o,s,w,S,z,n]),l=d?"Edit Term":w?"Create Child Term":"Create Term";return e.jsx(R,{open:!0,onOpenChange:a=>!a&&!u&&N(),title:l,size:"md",footer:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"outline",onClick:N,disabled:u,children:"Cancel"}),e.jsx(f,{variant:"primary",onClick:T,loading:u,children:d?"Save Changes":"Create Term"})]}),children:e.jsxs("form",{onSubmit:T,className:"space-y-4",children:[E&&e.jsx("div",{className:"rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800",children:E}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(j,{htmlFor:"termName",children:["Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(D,{id:"termName",value:o.name,onChange:a=>r(a.target.value),placeholder:"e.g., Technology",disabled:u,className:v.name?"border-destructive":""}),v.name&&e.jsx("p",{className:"text-xs text-destructive",children:v.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(j,{htmlFor:"termSlug",children:["Slug ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(D,{id:"termSlug",value:o.slug,onChange:a=>{i("slug",a.target.value.toLowerCase()),h(!0)},placeholder:"e.g., technology",disabled:u,className:v.slug?"border-destructive":""}),v.slug&&e.jsx("p",{className:"text-xs text-destructive",children:v.slug})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"termDescription",children:"Description"}),e.jsx(V,{id:"termDescription",value:o.description,onChange:a=>i("description",a.target.value),placeholder:"Optional description",rows:2,disabled:u})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"termColor",children:"Color"}),e.jsx(D,{id:"termColor",type:"color",value:o.color||"#6b7280",onChange:a=>i("color",a.target.value),disabled:u,className:"h-9 p-1"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"termIcon",children:"Icon"}),e.jsx(D,{id:"termIcon",value:o.icon,onChange:a=>i("icon",a.target.value),placeholder:"e.g., 💻",disabled:u})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"termSortOrder",children:"Sort Order"}),e.jsx(D,{id:"termSortOrder",type:"number",value:o.sortOrder,onChange:a=>i("sortOrder",parseInt(a.target.value)||0),disabled:u})]})]})]})})}function Ne(){const[s,c]=t.useState(null),[w,x]=t.useState(!1),[n,N]=t.useState(null),[d,o]=t.useState(null),[m,v]=t.useState(null),C=L(F.taxonomies.list,{isActive:void 0,includeDeleted:!1}),u=I(F.taxonomies.deleteTaxonomy),y=C?.page??[],E=C===void 0,b=t.useCallback(()=>{N(null),x(!0)},[]),k=t.useCallback(i=>{N(i),x(!0)},[]),h=t.useCallback(async i=>{v(null);try{await u({id:i}),o(null),s?._id===i&&c(null)}catch(p){const r=p instanceof Error?p.message:"Failed to delete taxonomy";v(r)}},[u,s]),S=t.useCallback(()=>{x(!1),N(null)},[]),z=i=>i.isHierarchical?e.jsx(le,{className:"size-5"}):e.jsx(M,{className:"size-5"});return e.jsxs("div",{className:"flex h-[calc(100vh-4rem)] flex-col p-6",children:[e.jsxs("div",{className:"mb-6 flex items-start justify-between",children:[e.jsx(ee,{title:"Taxonomies",description:"Manage tags, categories, and other classification systems"}),e.jsxs(f,{onClick:b,children:[e.jsx(_,{className:"size-4"}),"Create Taxonomy"]})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 gap-6",children:[e.jsx(B,{elevation:"base",className:"w-80 shrink-0 overflow-hidden",children:E?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx("div",{className:"size-6 animate-spin rounded-full border-2 border-muted border-t-primary"}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Loading taxonomies..."})]}):y.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:[e.jsx(M,{className:"mb-3 size-8 text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No taxonomies created yet."}),e.jsx(f,{variant:"secondary",className:"mt-4",onClick:b,children:"Create your first taxonomy"})]}):e.jsx(te,{className:"h-full",children:e.jsx("div",{className:"divide-y",children:y.map(i=>e.jsxs("div",{className:P("group flex cursor-pointer items-center gap-3 p-3 transition-colors hover:bg-muted/50",s?._id===i._id&&"bg-primary/5",!i.isActive&&"opacity-60"),onClick:()=>c(i),children:[e.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:z(i)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:i.displayName}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:i.name})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(q,{variant:"secondary",className:"text-xs font-normal",children:i.isHierarchical?"Hierarchical":"Flat"}),!i.isActive&&e.jsx(q,{variant:"outline",className:"text-xs font-normal",children:"Inactive"})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[e.jsx(f,{variant:"ghost",size:"icon-sm",onClick:p=>{p.stopPropagation(),k(i)},title:"Edit taxonomy",children:e.jsx(G,{className:"size-4"})}),e.jsx(f,{variant:"ghost",size:"icon-sm",onClick:p=>{p.stopPropagation(),o(i._id)},title:"Delete taxonomy",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",children:e.jsx(Q,{className:"size-4"})})]})]},i._id))})})}),e.jsx(B,{elevation:"base",className:"min-w-0 flex-1 overflow-hidden",children:s?e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-start justify-between border-b p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex size-10 items-center justify-center rounded-md bg-muted text-muted-foreground",children:z(s)}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.displayName}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]})]}),e.jsx(f,{variant:"secondary",onClick:()=>k(s),children:"Edit Taxonomy"})]}),e.jsx("div",{className:"flex-1 overflow-auto p-4",children:e.jsx(oe,{taxonomyId:s._id,isHierarchical:s.isHierarchical,allowInlineCreation:s.allowInlineCreation})})]}):e.jsx(Z,{icon:e.jsx(M,{className:"size-6"}),title:"Select a taxonomy",description:"Select a taxonomy to view and manage its terms",className:"h-full"})})]}),w&&e.jsx(ne,{taxonomy:n,onSave:S,onCancel:()=>{x(!1),N(null)}}),e.jsx(U,{open:d!==null,onOpenChange:i=>{i||(o(null),v(null))},title:"Delete Taxonomy",description:"Are you sure you want to delete this taxonomy? All associated terms will also be deleted.",confirmLabel:"Delete",onConfirm:()=>d&&h(d),variant:"danger",children:m&&e.jsxs(se,{variant:"destructive",className:"mt-4",children:[e.jsx(re,{className:"size-4"}),e.jsx(ae,{children:m})]})})]})}export{Ne as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,u as m,a as i,b as E,j as e,T as D,c as Y}from"./main-CKj5yfEi.js";import{C as Z}from"./CmsPageHeader-CirpXndm.js";import{C as ee}from"./CmsToolbar-BI2nZOXp.js";import{I as se,C as te,a as I,b as ae}from"./CmsEmptyState-CRswfTzk.js";import{C as A,A as R,a as _}from"./alert-BXjTqrwQ.js";import{C as c,X as Q,B as re}from"./badge-hvUOzpVZ.js";import{S as ne,a as le,b as oe,c as ie,d as L}from"./select-BD29IXCI.js";import{S as ce}from"./search-MuAUDJKR.js";import{T as B}from"./triangle-alert-E52Vfeuh.js";import{R as M}from"./rotate-ccw-DJEoHcRI.js";function Ce(){const[g,F]=a.useState(""),[j,O]=a.useState(""),[n,o]=a.useState(new Set),[y,x]=a.useState(null),[N,C]=a.useState(!1),[P,u]=a.useState(!1),[b,S]=a.useState(!1),[v,h]=a.useState(null),T=m(i.trash.list,{contentTypeId:g||void 0,search:j||void 0,paginationOpts:{numItems:50,cursor:null}}),U=m(i.trash.getConfig,{}),V=m(i.trash.getStats,{}),H=m(i.contentTypes.list,{})?.page??[],w=E(i.bulkOperations.bulkRestore),k=E(i.trash.empty),l=T?.page??[],X=T===void 0,p=U,f=V,$=a.useCallback((s,t)=>{o(r=>{const d=new Set(r);return t?d.add(s):d.delete(s),d})},[]),q=a.useCallback(()=>{n.size===l.length?o(new Set):o(new Set(l.map(s=>s._id)))},[n.size,l]),z=a.useCallback(async s=>{C(!0),x(null);try{await w({ids:s}),o(t=>{const r=new Set(t);return s.forEach(d=>r.delete(d)),r})}catch(t){const r=t instanceof Error?t.message:"Failed to restore";x(r)}finally{C(!1)}},[w]),G=a.useCallback(async()=>{S(!0),h(null);try{await k({}),u(!1),o(new Set)}catch(s){const t=s instanceof Error?s.message:"Failed to empty trash";h(t)}finally{S(!1)}},[k]),J=s=>new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),K=s=>{if(!p?.retentionDays)return null;const t=s+p.retentionDays*24*60*60*1e3,r=Math.ceil((t-Date.now())/(1440*60*1e3));return Math.max(0,r)},W=s=>{if(s.title)return s.title;if(s.name)return s.name;if(s.data){const t=s.data.title||s.data.name;if(t&&typeof t=="string")return t}return s.slug||s._id};return e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(Z,{title:"Trash",description:`Deleted items are kept for ${p?.retentionDays??30} days before permanent deletion`}),l.length>0&&e.jsxs(c,{variant:"danger",onClick:()=>u(!0),children:[e.jsx(D,{className:"size-4"}),"Empty Trash"]})]}),f&&e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs(A,{elevation:"base",className:"p-4",children:[e.jsx("p",{className:"text-2xl font-semibold text-foreground",children:f.totalCount??0}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Items in Trash"})]}),e.jsxs(A,{elevation:"base",className:"p-4",children:[e.jsx("p",{className:"text-2xl font-semibold text-foreground",children:f.expiredCount??0}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Expired"})]})]}),e.jsx(ee,{left:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ce,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(se,{type:"text",placeholder:"Search deleted items...",value:j,onChange:s=>O(s.target.value),className:"w-64 pl-9"})]}),e.jsxs(ne,{value:g||"all",onValueChange:s=>F(s==="all"?"":s),children:[e.jsx(le,{className:"w-48",children:e.jsx(oe,{placeholder:"All Content Types"})}),e.jsxs(ie,{children:[e.jsx(L,{value:"all",children:"All Content Types"}),H.map(s=>e.jsx(L,{value:s._id,children:s.displayName},s._id))]})]})]})}),y&&e.jsxs(R,{variant:"destructive",children:[e.jsx(B,{className:"size-4"}),e.jsxs(_,{className:"flex items-center justify-between",children:[y,e.jsx(c,{variant:"ghost",size:"icon-sm",onClick:()=>x(null),children:e.jsx(Q,{className:"size-4"})})]})]}),v&&e.jsxs(R,{variant:"destructive",children:[e.jsx(B,{className:"size-4"}),e.jsxs(_,{className:"flex items-center justify-between",children:[v,e.jsx(c,{variant:"ghost",size:"icon-sm",onClick:()=>h(null),children:e.jsx(Q,{className:"size-4"})})]})]}),n.size>0&&e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-primary/20 bg-primary/5 p-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[n.size," ",n.size===1?"item":"items"," selected"]}),e.jsxs(c,{variant:"primary",size:"sm",onClick:()=>z(Array.from(n)),loading:N,children:[e.jsx(M,{className:"size-4"}),"Restore Selected"]}),e.jsx(c,{variant:"secondary",size:"sm",onClick:()=>o(new Set),children:"Clear Selection"})]}),X?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx("div",{className:"size-8 animate-spin rounded-full border-2 border-muted border-t-primary"}),e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Loading trash..."})]}):l.length===0?e.jsx(te,{icon:e.jsx(D,{className:"size-6"}),title:"Trash is empty",description:"Deleted items will appear here"}):e.jsx("div",{className:"rounded-lg border bg-card",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"w-10 p-3 text-left",children:e.jsx(I,{checked:n.size===l.length&&l.length>0,onCheckedChange:q})}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Name"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Type"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Deleted"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Expires In"}),e.jsx("th",{className:"p-3 text-left text-sm font-medium text-muted-foreground",children:"Actions"})]})}),e.jsx("tbody",{children:l.map(s=>{const t=K(s.deletedAt);return e.jsxs("tr",{className:Y("border-b last:border-0 transition-colors hover:bg-muted/50",n.has(s._id)&&"bg-primary/5"),children:[e.jsx("td",{className:"p-3",children:e.jsx(I,{checked:n.has(s._id),onCheckedChange:r=>$(s._id,r)})}),e.jsxs("td",{className:"p-3",children:[e.jsx("span",{className:"font-medium text-foreground",children:W(s)}),s.slug&&e.jsx("span",{className:"block text-xs text-muted-foreground",children:s.slug})]}),e.jsx("td",{className:"p-3 text-sm text-muted-foreground",children:s.contentTypeName||"Unknown"}),e.jsxs("td",{className:"p-3",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:J(s.deletedAt)}),s.deletedBy&&e.jsxs("span",{className:"block text-xs text-muted-foreground",children:["by ",s.deletedBy]})]}),e.jsx("td",{className:"p-3",children:t!==null&&e.jsxs(re,{variant:t<=3?"destructive":"secondary",className:"font-normal",children:[t," ",t===1?"day":"days"]})}),e.jsx("td",{className:"p-3",children:e.jsxs(c,{variant:"outline",size:"sm",onClick:()=>z([s._id]),loading:N,children:[e.jsx(M,{className:"size-4"}),"Restore"]})})]},s._id)})})]})}),e.jsx(ae,{open:P,onOpenChange:u,title:"Empty Trash",description:"This will permanently delete all items in the trash. This action cannot be undone.",confirmLabel:b?"Deleting...":"Empty Trash",onConfirm:G,variant:"danger",loading:b})]})}export{Ce as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ac as c,r as u}from"./main-CKj5yfEi.js";function a(r,e){const{setOverride:s,clearOverride:t}=c();u.useEffect(()=>(e&&s(r,e),()=>{t(r)}),[r,e,s,t])}export{a as u};
|