convex-cms 0.0.2 → 0.0.3
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/admin-dist/nitro.json +15 -0
- package/admin-dist/public/assets/CmsEmptyState-CRswfTzk.js +5 -0
- package/admin-dist/public/assets/CmsPageHeader-CirpXndm.js +1 -0
- package/admin-dist/public/assets/CmsStatusBadge-CbEUpQu-.js +1 -0
- package/admin-dist/public/assets/CmsToolbar-BI2nZOXp.js +1 -0
- package/admin-dist/public/assets/ContentEntryEditor-CBeCyK_m.js +4 -0
- package/admin-dist/public/assets/ErrorState-BIVaWmom.js +1 -0
- package/admin-dist/public/assets/TaxonomyFilter-ChaY6Y_x.js +1 -0
- package/admin-dist/public/assets/_contentTypeId-DQ8k_Rvw.js +1 -0
- package/admin-dist/public/assets/_entryId-CKU_glsK.js +1 -0
- package/admin-dist/public/assets/alert-BXjTqrwQ.js +1 -0
- package/admin-dist/public/assets/badge-hvUOzpVZ.js +1 -0
- package/admin-dist/public/assets/circle-check-big-CF_pR17r.js +1 -0
- package/admin-dist/public/assets/command-DU82cJlt.js +1 -0
- package/admin-dist/public/assets/content-_LXl3pp7.js +1 -0
- package/admin-dist/public/assets/content-types-KjxaXGxY.js +2 -0
- package/admin-dist/public/assets/globals-CS6BZ0zp.css +1 -0
- package/admin-dist/public/assets/index-DNGIZHL-.js +1 -0
- package/admin-dist/public/assets/label-KNtpL71g.js +1 -0
- package/admin-dist/public/assets/link-2-Bw2aI4V4.js +1 -0
- package/admin-dist/public/assets/list-sYepHjt_.js +1 -0
- package/admin-dist/public/assets/main-CKj5yfEi.js +97 -0
- package/admin-dist/public/assets/media-Bkrkffm7.js +1 -0
- package/admin-dist/public/assets/new._contentTypeId-C3LstjNs.js +1 -0
- package/admin-dist/public/assets/plus-DUn8v_Xf.js +1 -0
- package/admin-dist/public/assets/rotate-ccw-DJEoHcRI.js +1 -0
- package/admin-dist/public/assets/scroll-area-DfIlT0in.js +1 -0
- package/admin-dist/public/assets/search-MuAUDJKR.js +1 -0
- package/admin-dist/public/assets/select-BD29IXCI.js +1 -0
- package/admin-dist/public/assets/settings-DmMyn_6A.js +1 -0
- package/admin-dist/public/assets/switch-h3Rrnl5i.js +1 -0
- package/admin-dist/public/assets/tabs-imc8h-Dp.js +1 -0
- package/admin-dist/public/assets/taxonomies-dAsrT65H.js +1 -0
- package/admin-dist/public/assets/textarea-BTy7nwzR.js +1 -0
- package/admin-dist/public/assets/trash-SAWKZZHv.js +1 -0
- package/admin-dist/public/assets/triangle-alert-E52Vfeuh.js +1 -0
- package/admin-dist/public/assets/useBreadcrumbLabel-BECBMCzM.js +1 -0
- package/admin-dist/public/assets/usePermissions-Basjs9BT.js +1 -0
- package/admin-dist/public/favicon.ico +0 -0
- package/admin-dist/server/_chunks/_libs/@date-fns/tz.mjs +217 -0
- package/admin-dist/server/_chunks/_libs/@floating-ui/core.mjs +719 -0
- package/admin-dist/server/_chunks/_libs/@floating-ui/dom.mjs +622 -0
- package/admin-dist/server/_chunks/_libs/@floating-ui/react-dom.mjs +292 -0
- package/admin-dist/server/_chunks/_libs/@floating-ui/utils.mjs +320 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/number.mjs +6 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/primitive.mjs +11 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-arrow.mjs +23 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-avatar.mjs +119 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-checkbox.mjs +270 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-collection.mjs +69 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-compose-refs.mjs +39 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-context.mjs +137 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-dialog.mjs +325 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-direction.mjs +9 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-dismissable-layer.mjs +210 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-dropdown-menu.mjs +253 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-focus-guards.mjs +29 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-focus-scope.mjs +206 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-id.mjs +14 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-label.mjs +23 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-menu.mjs +812 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-popover.mjs +300 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-popper.mjs +286 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-portal.mjs +16 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-presence.mjs +128 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-primitive.mjs +141 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-roving-focus.mjs +224 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-scroll-area.mjs +721 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-select.mjs +1163 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-separator.mjs +28 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-slot.mjs +601 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-switch.mjs +152 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-tabs.mjs +189 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-use-callback-ref.mjs +11 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-use-controllable-state.mjs +69 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-use-effect-event.mjs +1 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-use-escape-keydown.mjs +17 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-use-is-hydrated.mjs +15 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-use-layout-effect.mjs +6 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-use-previous.mjs +14 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-use-size.mjs +39 -0
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-visually-hidden.mjs +33 -0
- package/admin-dist/server/_chunks/_libs/@tanstack/history.mjs +409 -0
- package/admin-dist/server/_chunks/_libs/@tanstack/react-router.mjs +1711 -0
- package/admin-dist/server/_chunks/_libs/@tanstack/react-store.mjs +56 -0
- package/admin-dist/server/_chunks/_libs/@tanstack/router-core.mjs +4829 -0
- package/admin-dist/server/_chunks/_libs/@tanstack/store.mjs +134 -0
- package/admin-dist/server/_chunks/_libs/react-dom.mjs +10781 -0
- package/admin-dist/server/_chunks/_libs/react.mjs +513 -0
- package/admin-dist/server/_libs/aria-hidden.mjs +122 -0
- package/admin-dist/server/_libs/class-variance-authority.mjs +44 -0
- package/admin-dist/server/_libs/clsx.mjs +16 -0
- package/admin-dist/server/_libs/cmdk.mjs +315 -0
- package/admin-dist/server/_libs/convex.mjs +4841 -0
- package/admin-dist/server/_libs/cookie-es.mjs +58 -0
- package/admin-dist/server/_libs/croner.mjs +1 -0
- package/admin-dist/server/_libs/crossws.mjs +1 -0
- package/admin-dist/server/_libs/date-fns.mjs +1716 -0
- package/admin-dist/server/_libs/detect-node-es.mjs +1 -0
- package/admin-dist/server/_libs/get-nonce.mjs +9 -0
- package/admin-dist/server/_libs/h3-v2.mjs +277 -0
- package/admin-dist/server/_libs/h3.mjs +401 -0
- package/admin-dist/server/_libs/hookable.mjs +1 -0
- package/admin-dist/server/_libs/isbot.mjs +20 -0
- package/admin-dist/server/_libs/lucide-react.mjs +850 -0
- package/admin-dist/server/_libs/ohash.mjs +1 -0
- package/admin-dist/server/_libs/react-day-picker.mjs +2201 -0
- package/admin-dist/server/_libs/react-remove-scroll-bar.mjs +82 -0
- package/admin-dist/server/_libs/react-remove-scroll.mjs +328 -0
- package/admin-dist/server/_libs/react-style-singleton.mjs +69 -0
- package/admin-dist/server/_libs/rou3.mjs +8 -0
- package/admin-dist/server/_libs/seroval-plugins.mjs +58 -0
- package/admin-dist/server/_libs/seroval.mjs +1765 -0
- package/admin-dist/server/_libs/srvx.mjs +719 -0
- package/admin-dist/server/_libs/tailwind-merge.mjs +3010 -0
- package/admin-dist/server/_libs/tiny-invariant.mjs +12 -0
- package/admin-dist/server/_libs/tiny-warning.mjs +5 -0
- package/admin-dist/server/_libs/tslib.mjs +39 -0
- package/admin-dist/server/_libs/ufo.mjs +54 -0
- package/admin-dist/server/_libs/unctx.mjs +1 -0
- package/admin-dist/server/_libs/unstorage.mjs +1 -0
- package/admin-dist/server/_libs/use-callback-ref.mjs +66 -0
- package/admin-dist/server/_libs/use-sidecar.mjs +106 -0
- package/admin-dist/server/_libs/use-sync-external-store.mjs +139 -0
- package/admin-dist/server/_libs/zod.mjs +4223 -0
- package/admin-dist/server/_ssr/CmsEmptyState-DU7-7-mV.mjs +290 -0
- package/admin-dist/server/_ssr/CmsPageHeader-CseW0AHm.mjs +24 -0
- package/admin-dist/server/_ssr/CmsStatusBadge-B_pi4KCp.mjs +127 -0
- package/admin-dist/server/_ssr/CmsToolbar-X75ex6ek.mjs +49 -0
- package/admin-dist/server/_ssr/ContentEntryEditor-CepusRsA.mjs +3720 -0
- package/admin-dist/server/_ssr/ErrorState-cI-bKLez.mjs +89 -0
- package/admin-dist/server/_ssr/TaxonomyFilter-Bwrq0-cz.mjs +188 -0
- package/admin-dist/server/_ssr/_contentTypeId-BqYKEcLr.mjs +379 -0
- package/admin-dist/server/_ssr/_entryId-CRfnqeDf.mjs +161 -0
- package/admin-dist/server/_ssr/_tanstack-start-manifest_v-BwDlABVk.mjs +4 -0
- package/admin-dist/server/_ssr/alert-CVt45UUP.mjs +92 -0
- package/admin-dist/server/_ssr/badge-6BsP37vG.mjs +125 -0
- package/admin-dist/server/_ssr/command-fy8epIKf.mjs +128 -0
- package/admin-dist/server/_ssr/config.server-D7JHDcDv.mjs +117 -0
- package/admin-dist/server/_ssr/content-B5RhL7uW.mjs +532 -0
- package/admin-dist/server/_ssr/content-types-BIOqCQYN.mjs +1166 -0
- package/admin-dist/server/_ssr/index-DHSHDPt1.mjs +193 -0
- package/admin-dist/server/_ssr/index.mjs +1275 -0
- package/admin-dist/server/_ssr/label-C8Dko1j7.mjs +22 -0
- package/admin-dist/server/_ssr/media-CSx3XttC.mjs +1832 -0
- package/admin-dist/server/_ssr/new._contentTypeId-DzanEZQM.mjs +144 -0
- package/admin-dist/server/_ssr/router-DDWcF-kt.mjs +1556 -0
- package/admin-dist/server/_ssr/scroll-area-bjPYwhXN.mjs +59 -0
- package/admin-dist/server/_ssr/select-BUhDDf4T.mjs +142 -0
- package/admin-dist/server/_ssr/settings-DAsxnw2q.mjs +348 -0
- package/admin-dist/server/_ssr/start-HYkvq4Ni.mjs +4 -0
- package/admin-dist/server/_ssr/switch-BgyRtQ1Z.mjs +31 -0
- package/admin-dist/server/_ssr/tabs-DzMdRB1A.mjs +628 -0
- package/admin-dist/server/_ssr/taxonomies-C8j8g5Q5.mjs +915 -0
- package/admin-dist/server/_ssr/textarea-9jNeYJSc.mjs +18 -0
- package/admin-dist/server/_ssr/trash-DYMxwhZB.mjs +291 -0
- package/admin-dist/server/_ssr/useBreadcrumbLabel-FNSAr2Ha.mjs +16 -0
- package/admin-dist/server/_ssr/usePermissions-BJGGahrJ.mjs +68 -0
- package/admin-dist/server/favicon.ico +0 -0
- package/admin-dist/server/index.mjs +627 -0
- package/dist/cli/index.js +0 -0
- package/dist/client/admin-config.d.ts +0 -1
- package/dist/client/admin-config.d.ts.map +1 -1
- package/dist/client/admin-config.js +0 -1
- package/dist/client/admin-config.js.map +1 -1
- package/dist/client/adminApi.d.ts.map +1 -1
- package/dist/client/agentTools.d.ts +1237 -135
- package/dist/client/agentTools.d.ts.map +1 -1
- package/dist/client/agentTools.js +33 -9
- package/dist/client/agentTools.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/component.d.ts +9 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/mediaAssets.d.ts +35 -0
- package/dist/component/mediaAssets.d.ts.map +1 -1
- package/dist/component/mediaAssets.js +81 -0
- package/dist/component/mediaAssets.js.map +1 -1
- package/dist/test.d.ts.map +1 -1
- package/dist/test.js +2 -1
- package/dist/test.js.map +1 -1
- package/package.json +9 -5
- package/dist/component/auditLog.d.ts +0 -410
- package/dist/component/auditLog.d.ts.map +0 -1
- package/dist/component/auditLog.js +0 -607
- package/dist/component/auditLog.js.map +0 -1
- package/dist/component/types.d.ts +0 -4
- package/dist/component/types.d.ts.map +0 -1
- package/dist/component/types.js +0 -2
- package/dist/component/types.js.map +0 -1
- package/src/cli/commands/admin.ts +0 -104
- package/src/cli/index.ts +0 -21
- package/src/cli/utils/detectConvexUrl.ts +0 -54
- package/src/cli/utils/openBrowser.ts +0 -16
- package/src/client/admin-config.ts +0 -138
- package/src/client/adminApi.ts +0 -942
- package/src/client/agentTools.ts +0 -1311
- package/src/client/argTypes.ts +0 -316
- package/src/client/field-types.ts +0 -187
- package/src/client/index.ts +0 -1301
- package/src/client/queryBuilder.ts +0 -1100
- package/src/client/schema/codegen.ts +0 -500
- package/src/client/schema/defineContentType.ts +0 -501
- package/src/client/schema/index.ts +0 -169
- package/src/client/schema/schemaDrift.ts +0 -574
- package/src/client/schema/typedClient.ts +0 -688
- package/src/client/schema/types.ts +0 -666
- package/src/client/types.ts +0 -723
- package/src/client/workflows.ts +0 -141
- package/src/client/wrapper.ts +0 -4304
- package/src/component/_generated/api.ts +0 -140
- package/src/component/_generated/component.ts +0 -5029
- package/src/component/_generated/dataModel.ts +0 -60
- package/src/component/_generated/server.ts +0 -156
- package/src/component/authorization.ts +0 -647
- package/src/component/authorizationHooks.ts +0 -668
- package/src/component/bulkOperations.ts +0 -687
- package/src/component/contentEntries.ts +0 -1976
- package/src/component/contentEntryMutations.ts +0 -1223
- package/src/component/contentEntryValidation.ts +0 -707
- package/src/component/contentLock.ts +0 -550
- package/src/component/contentTypeMigration.ts +0 -1064
- package/src/component/contentTypeMutations.ts +0 -969
- package/src/component/contentTypes.ts +0 -346
- package/src/component/convex.config.ts +0 -44
- package/src/component/documentTypes.ts +0 -240
- package/src/component/eventEmitter.ts +0 -485
- package/src/component/exportImport.ts +0 -1169
- package/src/component/index.ts +0 -491
- package/src/component/lib/deepReferenceResolver.ts +0 -999
- package/src/component/lib/errors.ts +0 -816
- package/src/component/lib/index.ts +0 -145
- package/src/component/lib/mediaReferenceResolver.ts +0 -495
- package/src/component/lib/metadataExtractor.ts +0 -792
- package/src/component/lib/mutationAuth.ts +0 -199
- package/src/component/lib/queries.ts +0 -79
- package/src/component/lib/ragContentChunker.ts +0 -1371
- package/src/component/lib/referenceResolver.ts +0 -430
- package/src/component/lib/slugGenerator.ts +0 -262
- package/src/component/lib/slugUniqueness.ts +0 -333
- package/src/component/lib/softDelete.ts +0 -44
- package/src/component/localeFallbackChain.ts +0 -673
- package/src/component/localeFields.ts +0 -896
- package/src/component/mediaAssetMutations.ts +0 -725
- package/src/component/mediaAssets.ts +0 -932
- package/src/component/mediaFolderMutations.ts +0 -1046
- package/src/component/mediaUploadMutations.ts +0 -224
- package/src/component/mediaVariantMutations.ts +0 -900
- package/src/component/mediaVariants.ts +0 -793
- package/src/component/ragContentIndexer.ts +0 -1067
- package/src/component/rateLimitHooks.ts +0 -572
- package/src/component/roles.ts +0 -1360
- package/src/component/scheduledPublish.ts +0 -358
- package/src/component/schema.ts +0 -617
- package/src/component/taxonomies.ts +0 -949
- package/src/component/taxonomyMutations.ts +0 -1210
- package/src/component/trash.ts +0 -724
- package/src/component/userContext.ts +0 -898
- package/src/component/validation.ts +0 -1388
- package/src/component/validators.ts +0 -949
- package/src/component/versionMutations.ts +0 -392
- package/src/component/webhookTrigger.ts +0 -1922
- package/src/react/index.ts +0 -898
- package/src/test.ts +0 -1580
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../_chunks/_libs/react.mjs";
|
|
2
|
+
import { R as Root, V as Viewport, C as Corner, S as ScrollAreaScrollbar, a as ScrollAreaThumb } from "../_chunks/_libs/@radix-ui/react-scroll-area.mjs";
|
|
3
|
+
import { c as cn } from "./router-DDWcF-kt.mjs";
|
|
4
|
+
function ScrollArea({
|
|
5
|
+
className,
|
|
6
|
+
children,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
10
|
+
Root,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "scroll-area",
|
|
13
|
+
className: cn("relative", className),
|
|
14
|
+
...props,
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17
|
+
Viewport,
|
|
18
|
+
{
|
|
19
|
+
"data-slot": "scroll-area-viewport",
|
|
20
|
+
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
21
|
+
children
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ScrollBar, {}),
|
|
25
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Corner, {})
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function ScrollBar({
|
|
31
|
+
className,
|
|
32
|
+
orientation = "vertical",
|
|
33
|
+
...props
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
36
|
+
ScrollAreaScrollbar,
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "scroll-area-scrollbar",
|
|
39
|
+
orientation,
|
|
40
|
+
className: cn(
|
|
41
|
+
"flex touch-none p-px transition-colors select-none",
|
|
42
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
43
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
44
|
+
className
|
|
45
|
+
),
|
|
46
|
+
...props,
|
|
47
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48
|
+
ScrollAreaThumb,
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "scroll-area-thumb",
|
|
51
|
+
className: "bg-border relative flex-1 rounded-full"
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
ScrollArea as S
|
|
59
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../_chunks/_libs/react.mjs";
|
|
2
|
+
import { R as Root2, T as Trigger, I as Icon, V as Value, P as Portal, C as Content2, a as Viewport, b as Item, c as ItemIndicator, d as ItemText, S as ScrollUpButton, e as ScrollDownButton } from "../_chunks/_libs/@radix-ui/react-select.mjs";
|
|
3
|
+
import { c as cn } from "./router-DDWcF-kt.mjs";
|
|
4
|
+
import { d as ChevronDown, Z as Check, ai as ChevronUp } from "../_libs/lucide-react.mjs";
|
|
5
|
+
function Select({
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2, { "data-slot": "select", ...props });
|
|
9
|
+
}
|
|
10
|
+
function SelectValue({
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Value, { "data-slot": "select-value", ...props });
|
|
14
|
+
}
|
|
15
|
+
function SelectTrigger({
|
|
16
|
+
className,
|
|
17
|
+
size = "default",
|
|
18
|
+
children,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
22
|
+
Trigger,
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "select-trigger",
|
|
25
|
+
"data-size": size,
|
|
26
|
+
className: cn(
|
|
27
|
+
"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",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props,
|
|
31
|
+
children: [
|
|
32
|
+
children,
|
|
33
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "size-4 opacity-50" }) })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function SelectContent({
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
position = "item-aligned",
|
|
42
|
+
align = "center",
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
46
|
+
Content2,
|
|
47
|
+
{
|
|
48
|
+
"data-slot": "select-content",
|
|
49
|
+
className: cn(
|
|
50
|
+
"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",
|
|
51
|
+
position === "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",
|
|
52
|
+
className
|
|
53
|
+
),
|
|
54
|
+
position,
|
|
55
|
+
align,
|
|
56
|
+
...props,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectScrollUpButton, {}),
|
|
59
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
60
|
+
Viewport,
|
|
61
|
+
{
|
|
62
|
+
className: cn(
|
|
63
|
+
"p-1",
|
|
64
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
65
|
+
),
|
|
66
|
+
children
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectScrollDownButton, {})
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
) });
|
|
73
|
+
}
|
|
74
|
+
function SelectItem({
|
|
75
|
+
className,
|
|
76
|
+
children,
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
80
|
+
Item,
|
|
81
|
+
{
|
|
82
|
+
"data-slot": "select-item",
|
|
83
|
+
className: cn(
|
|
84
|
+
"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",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
...props,
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
"data-slot": "select-item-indicator",
|
|
93
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
94
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ItemIndicator, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "size-4" }) })
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ItemText, { children })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
function SelectScrollUpButton({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}) {
|
|
106
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
107
|
+
ScrollUpButton,
|
|
108
|
+
{
|
|
109
|
+
"data-slot": "select-scroll-up-button",
|
|
110
|
+
className: cn(
|
|
111
|
+
"flex cursor-default items-center justify-center py-1",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
...props,
|
|
115
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronUp, { className: "size-4" })
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
function SelectScrollDownButton({
|
|
120
|
+
className,
|
|
121
|
+
...props
|
|
122
|
+
}) {
|
|
123
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
124
|
+
ScrollDownButton,
|
|
125
|
+
{
|
|
126
|
+
"data-slot": "select-scroll-down-button",
|
|
127
|
+
className: cn(
|
|
128
|
+
"flex cursor-default items-center justify-center py-1",
|
|
129
|
+
className
|
|
130
|
+
),
|
|
131
|
+
...props,
|
|
132
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "size-4" })
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
Select as S,
|
|
138
|
+
SelectTrigger as a,
|
|
139
|
+
SelectValue as b,
|
|
140
|
+
SelectContent as c,
|
|
141
|
+
SelectItem as d
|
|
142
|
+
};
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "../_chunks/_libs/react.mjs";
|
|
2
|
+
import { u as useSettingsConfig, a as api, R as RouteGuard, b as useTheme, c as cn } from "./router-DDWcF-kt.mjs";
|
|
3
|
+
import { B as Badge, C as CmsButton } from "./badge-6BsP37vG.mjs";
|
|
4
|
+
import { L as Label } from "./label-C8Dko1j7.mjs";
|
|
5
|
+
import { S as Select, a as SelectTrigger, b as SelectValue, c as SelectContent, d as SelectItem } from "./select-BUhDDf4T.mjs";
|
|
6
|
+
import { u as usePermissions } from "./usePermissions-BJGGahrJ.mjs";
|
|
7
|
+
import { C as CmsPageHeader } from "./CmsPageHeader-CseW0AHm.mjs";
|
|
8
|
+
import { A as Alert, a as AlertDescription, C as CmsSurface } from "./alert-CVt45UUP.mjs";
|
|
9
|
+
import { S as Switch } from "./switch-BgyRtQ1Z.mjs";
|
|
10
|
+
import { u as useQuery, d as useMutation } from "../_libs/convex.mjs";
|
|
11
|
+
import { O as TriangleAlert, Z as Check, X, _ as Sun, $ as Moon, a0 as Monitor } from "../_libs/lucide-react.mjs";
|
|
12
|
+
import "../_chunks/_libs/@tanstack/react-router.mjs";
|
|
13
|
+
import "../_libs/tiny-warning.mjs";
|
|
14
|
+
import "../_chunks/_libs/@tanstack/router-core.mjs";
|
|
15
|
+
import "../_libs/cookie-es.mjs";
|
|
16
|
+
import "../_chunks/_libs/@tanstack/store.mjs";
|
|
17
|
+
import "../_chunks/_libs/@tanstack/history.mjs";
|
|
18
|
+
import "../_libs/tiny-invariant.mjs";
|
|
19
|
+
import "../_libs/seroval.mjs";
|
|
20
|
+
import "../_libs/seroval-plugins.mjs";
|
|
21
|
+
import "node:stream/web";
|
|
22
|
+
import "node:stream";
|
|
23
|
+
import "../_chunks/_libs/react-dom.mjs";
|
|
24
|
+
import "util";
|
|
25
|
+
import "crypto";
|
|
26
|
+
import "async_hooks";
|
|
27
|
+
import "stream";
|
|
28
|
+
import "../_libs/isbot.mjs";
|
|
29
|
+
import "../_chunks/_libs/@tanstack/react-store.mjs";
|
|
30
|
+
import "../_libs/use-sync-external-store.mjs";
|
|
31
|
+
import "../_libs/clsx.mjs";
|
|
32
|
+
import "../_libs/tailwind-merge.mjs";
|
|
33
|
+
import "../_chunks/_libs/@radix-ui/react-slot.mjs";
|
|
34
|
+
import "../_chunks/_libs/@radix-ui/react-compose-refs.mjs";
|
|
35
|
+
import "../_chunks/_libs/@radix-ui/react-dropdown-menu.mjs";
|
|
36
|
+
import "../_chunks/_libs/@radix-ui/primitive.mjs";
|
|
37
|
+
import "../_chunks/_libs/@radix-ui/react-context.mjs";
|
|
38
|
+
import "../_chunks/_libs/@radix-ui/react-use-controllable-state.mjs";
|
|
39
|
+
import "../_chunks/_libs/@radix-ui/react-use-layout-effect.mjs";
|
|
40
|
+
import "../_chunks/_libs/@radix-ui/react-primitive.mjs";
|
|
41
|
+
import "../_chunks/_libs/@radix-ui/react-menu.mjs";
|
|
42
|
+
import "../_chunks/_libs/@radix-ui/react-collection.mjs";
|
|
43
|
+
import "../_chunks/_libs/@radix-ui/react-direction.mjs";
|
|
44
|
+
import "../_chunks/_libs/@radix-ui/react-dismissable-layer.mjs";
|
|
45
|
+
import "../_chunks/_libs/@radix-ui/react-use-callback-ref.mjs";
|
|
46
|
+
import "../_chunks/_libs/@radix-ui/react-use-escape-keydown.mjs";
|
|
47
|
+
import "../_chunks/_libs/@radix-ui/react-focus-guards.mjs";
|
|
48
|
+
import "../_chunks/_libs/@radix-ui/react-focus-scope.mjs";
|
|
49
|
+
import "../_chunks/_libs/@radix-ui/react-popper.mjs";
|
|
50
|
+
import "../_chunks/_libs/@floating-ui/react-dom.mjs";
|
|
51
|
+
import "../_chunks/_libs/@floating-ui/dom.mjs";
|
|
52
|
+
import "../_chunks/_libs/@floating-ui/core.mjs";
|
|
53
|
+
import "../_chunks/_libs/@floating-ui/utils.mjs";
|
|
54
|
+
import "../_chunks/_libs/@radix-ui/react-arrow.mjs";
|
|
55
|
+
import "../_chunks/_libs/@radix-ui/react-use-size.mjs";
|
|
56
|
+
import "../_chunks/_libs/@radix-ui/react-portal.mjs";
|
|
57
|
+
import "../_chunks/_libs/@radix-ui/react-presence.mjs";
|
|
58
|
+
import "../_chunks/_libs/@radix-ui/react-roving-focus.mjs";
|
|
59
|
+
import "../_chunks/_libs/@radix-ui/react-id.mjs";
|
|
60
|
+
import "../_libs/aria-hidden.mjs";
|
|
61
|
+
import "../_libs/react-remove-scroll.mjs";
|
|
62
|
+
import "../_libs/tslib.mjs";
|
|
63
|
+
import "../_libs/react-remove-scroll-bar.mjs";
|
|
64
|
+
import "../_libs/react-style-singleton.mjs";
|
|
65
|
+
import "../_libs/get-nonce.mjs";
|
|
66
|
+
import "../_libs/use-sidecar.mjs";
|
|
67
|
+
import "../_libs/use-callback-ref.mjs";
|
|
68
|
+
import "../_chunks/_libs/@radix-ui/react-avatar.mjs";
|
|
69
|
+
import "../_chunks/_libs/@radix-ui/react-use-is-hydrated.mjs";
|
|
70
|
+
import "../_libs/class-variance-authority.mjs";
|
|
71
|
+
import "../_chunks/_libs/@radix-ui/react-popover.mjs";
|
|
72
|
+
import "./index.mjs";
|
|
73
|
+
import "node:async_hooks";
|
|
74
|
+
import "../_libs/h3-v2.mjs";
|
|
75
|
+
import "../_libs/rou3.mjs";
|
|
76
|
+
import "../_libs/srvx.mjs";
|
|
77
|
+
import "node:http";
|
|
78
|
+
import "node:https";
|
|
79
|
+
import "node:http2";
|
|
80
|
+
import "../_libs/zod.mjs";
|
|
81
|
+
import "../_chunks/_libs/@radix-ui/react-label.mjs";
|
|
82
|
+
import "../_chunks/_libs/@radix-ui/react-select.mjs";
|
|
83
|
+
import "../_chunks/_libs/@radix-ui/number.mjs";
|
|
84
|
+
import "../_chunks/_libs/@radix-ui/react-use-previous.mjs";
|
|
85
|
+
import "../_chunks/_libs/@radix-ui/react-visually-hidden.mjs";
|
|
86
|
+
import "../_chunks/_libs/@radix-ui/react-switch.mjs";
|
|
87
|
+
const LOCALE_OPTIONS = [{
|
|
88
|
+
value: "en",
|
|
89
|
+
label: "English (en)"
|
|
90
|
+
}, {
|
|
91
|
+
value: "es",
|
|
92
|
+
label: "Spanish (es)"
|
|
93
|
+
}, {
|
|
94
|
+
value: "fr",
|
|
95
|
+
label: "French (fr)"
|
|
96
|
+
}, {
|
|
97
|
+
value: "de",
|
|
98
|
+
label: "German (de)"
|
|
99
|
+
}, {
|
|
100
|
+
value: "it",
|
|
101
|
+
label: "Italian (it)"
|
|
102
|
+
}, {
|
|
103
|
+
value: "pt",
|
|
104
|
+
label: "Portuguese (pt)"
|
|
105
|
+
}, {
|
|
106
|
+
value: "zh",
|
|
107
|
+
label: "Chinese (zh)"
|
|
108
|
+
}, {
|
|
109
|
+
value: "ja",
|
|
110
|
+
label: "Japanese (ja)"
|
|
111
|
+
}];
|
|
112
|
+
const THEME_OPTIONS = [{
|
|
113
|
+
value: "light",
|
|
114
|
+
label: "Light",
|
|
115
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Sun, { className: "size-4" })
|
|
116
|
+
}, {
|
|
117
|
+
value: "dark",
|
|
118
|
+
label: "Dark",
|
|
119
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Moon, { className: "size-4" })
|
|
120
|
+
}, {
|
|
121
|
+
value: "system",
|
|
122
|
+
label: "System",
|
|
123
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Monitor, { className: "size-4" })
|
|
124
|
+
}];
|
|
125
|
+
function AppearanceSection() {
|
|
126
|
+
const {
|
|
127
|
+
theme,
|
|
128
|
+
setTheme
|
|
129
|
+
} = useTheme();
|
|
130
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(CmsSurface, { elevation: "base", className: "p-6", children: [
|
|
131
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "mb-4 text-lg font-semibold text-foreground", children: "Appearance" }),
|
|
132
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
133
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
134
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { className: "text-sm font-medium", children: "Theme" }),
|
|
135
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Choose your preferred color theme for the admin interface." })
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-1 rounded-lg border bg-muted/50 p-1", children: THEME_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", onClick: () => setTheme(option.value), className: cn("flex items-center gap-2 rounded-md px-3 py-1.5 text-sm font-medium transition-colors", theme === option.value ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"), children: [
|
|
138
|
+
option.icon,
|
|
139
|
+
option.label
|
|
140
|
+
] }, option.value)) })
|
|
141
|
+
] }) })
|
|
142
|
+
] });
|
|
143
|
+
}
|
|
144
|
+
function SettingsPage() {
|
|
145
|
+
const {
|
|
146
|
+
canManageSettings
|
|
147
|
+
} = usePermissions();
|
|
148
|
+
const canEdit = canManageSettings();
|
|
149
|
+
const {
|
|
150
|
+
baseConfig
|
|
151
|
+
} = useSettingsConfig();
|
|
152
|
+
const settings = useQuery(api.settings.get);
|
|
153
|
+
const updateSettings = useMutation(api.settings.update);
|
|
154
|
+
const resetSettings = useMutation(api.settings.reset);
|
|
155
|
+
const [formData, setFormData] = reactExports.useState(null);
|
|
156
|
+
const [isDirty, setIsDirty] = reactExports.useState(false);
|
|
157
|
+
const [feedbackStatus, setFeedbackStatus] = reactExports.useState("idle");
|
|
158
|
+
const [errorMessage, setErrorMessage] = reactExports.useState(null);
|
|
159
|
+
reactExports.useEffect(() => {
|
|
160
|
+
if (settings && !formData) {
|
|
161
|
+
setFormData(settings);
|
|
162
|
+
}
|
|
163
|
+
}, [settings, formData]);
|
|
164
|
+
reactExports.useEffect(() => {
|
|
165
|
+
if (settings && !isDirty) {
|
|
166
|
+
setFormData(settings);
|
|
167
|
+
}
|
|
168
|
+
}, [settings, isDirty]);
|
|
169
|
+
const handleLocaleChange = reactExports.useCallback((value) => {
|
|
170
|
+
if (!formData) return;
|
|
171
|
+
setFormData({
|
|
172
|
+
...formData,
|
|
173
|
+
defaultLocale: value
|
|
174
|
+
});
|
|
175
|
+
setIsDirty(true);
|
|
176
|
+
setFeedbackStatus("idle");
|
|
177
|
+
}, [formData]);
|
|
178
|
+
const handleFeatureChange = reactExports.useCallback((feature) => {
|
|
179
|
+
if (!formData) return;
|
|
180
|
+
setFormData({
|
|
181
|
+
...formData,
|
|
182
|
+
features: {
|
|
183
|
+
...formData.features,
|
|
184
|
+
[feature]: !formData.features[feature]
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
setIsDirty(true);
|
|
188
|
+
setFeedbackStatus("idle");
|
|
189
|
+
}, [formData]);
|
|
190
|
+
const handleSave = reactExports.useCallback(async () => {
|
|
191
|
+
if (!formData || !isDirty) return;
|
|
192
|
+
setFeedbackStatus("saving");
|
|
193
|
+
setErrorMessage(null);
|
|
194
|
+
try {
|
|
195
|
+
await updateSettings({
|
|
196
|
+
defaultLocale: formData.defaultLocale,
|
|
197
|
+
features: formData.features
|
|
198
|
+
});
|
|
199
|
+
setFeedbackStatus("saved");
|
|
200
|
+
setIsDirty(false);
|
|
201
|
+
setTimeout(() => {
|
|
202
|
+
setFeedbackStatus("idle");
|
|
203
|
+
}, 3e3);
|
|
204
|
+
} catch (error) {
|
|
205
|
+
setFeedbackStatus("error");
|
|
206
|
+
setErrorMessage(error instanceof Error ? error.message : "Failed to save settings");
|
|
207
|
+
}
|
|
208
|
+
}, [formData, isDirty, updateSettings]);
|
|
209
|
+
const handleReset = reactExports.useCallback(async () => {
|
|
210
|
+
const confirmed = window.confirm("Are you sure you want to reset all settings to their defaults? This action cannot be undone.");
|
|
211
|
+
if (!confirmed) return;
|
|
212
|
+
setFeedbackStatus("saving");
|
|
213
|
+
setErrorMessage(null);
|
|
214
|
+
try {
|
|
215
|
+
const newSettings = await resetSettings({});
|
|
216
|
+
setFormData(newSettings);
|
|
217
|
+
setFeedbackStatus("saved");
|
|
218
|
+
setIsDirty(false);
|
|
219
|
+
setTimeout(() => {
|
|
220
|
+
setFeedbackStatus("idle");
|
|
221
|
+
}, 3e3);
|
|
222
|
+
} catch (error) {
|
|
223
|
+
setFeedbackStatus("error");
|
|
224
|
+
setErrorMessage(error instanceof Error ? error.message : "Failed to reset settings");
|
|
225
|
+
}
|
|
226
|
+
}, [resetSettings]);
|
|
227
|
+
const handleDiscard = reactExports.useCallback(() => {
|
|
228
|
+
if (settings) {
|
|
229
|
+
setFormData(settings);
|
|
230
|
+
setIsDirty(false);
|
|
231
|
+
setFeedbackStatus("idle");
|
|
232
|
+
setErrorMessage(null);
|
|
233
|
+
}
|
|
234
|
+
}, [settings]);
|
|
235
|
+
if (settings === void 0) {
|
|
236
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteGuard, { requiredPermission: {
|
|
237
|
+
resource: "settings",
|
|
238
|
+
action: "manage"
|
|
239
|
+
}, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
240
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CmsPageHeader, { title: "Settings", description: "Configure your CMS settings and preferences." }),
|
|
241
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
242
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "size-8 animate-spin rounded-full border-2 border-muted border-t-primary" }),
|
|
243
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-sm text-muted-foreground", children: "Loading settings..." })
|
|
244
|
+
] })
|
|
245
|
+
] }) });
|
|
246
|
+
}
|
|
247
|
+
if (settings === null && !formData) {
|
|
248
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteGuard, { requiredPermission: {
|
|
249
|
+
resource: "settings",
|
|
250
|
+
action: "manage"
|
|
251
|
+
}, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
252
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CmsPageHeader, { title: "Settings", description: "Configure your CMS settings and preferences." }),
|
|
253
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
|
|
254
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TriangleAlert, { className: "size-4" }),
|
|
255
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "Failed to load settings. Please try refreshing the page." })
|
|
256
|
+
] })
|
|
257
|
+
] }) });
|
|
258
|
+
}
|
|
259
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteGuard, { requiredPermission: {
|
|
260
|
+
resource: "settings",
|
|
261
|
+
action: "manage"
|
|
262
|
+
}, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
263
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between", children: [
|
|
264
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CmsPageHeader, { title: "Settings", description: "Configure your CMS settings and preferences." }),
|
|
265
|
+
canEdit && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
266
|
+
feedbackStatus === "saved" && /* @__PURE__ */ jsxRuntimeExports.jsxs(Badge, { variant: "secondary", className: "gap-1 bg-emerald-100 text-emerald-700", children: [
|
|
267
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "size-3" }),
|
|
268
|
+
"Settings saved successfully"
|
|
269
|
+
] }),
|
|
270
|
+
feedbackStatus === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs(Badge, { variant: "destructive", className: "gap-1", children: [
|
|
271
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "size-3" }),
|
|
272
|
+
errorMessage || "An error occurred"
|
|
273
|
+
] }),
|
|
274
|
+
isDirty && /* @__PURE__ */ jsxRuntimeExports.jsx(CmsButton, { variant: "secondary", onClick: handleDiscard, disabled: feedbackStatus === "saving", children: "Discard Changes" }),
|
|
275
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CmsButton, { onClick: handleSave, disabled: !isDirty, loading: feedbackStatus === "saving", children: "Save Changes" })
|
|
276
|
+
] })
|
|
277
|
+
] }),
|
|
278
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6", children: [
|
|
279
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AppearanceSection, {}),
|
|
280
|
+
formData?.features.localization && /* @__PURE__ */ jsxRuntimeExports.jsxs(CmsSurface, { elevation: "base", className: "p-6", children: [
|
|
281
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "mb-4 text-lg font-semibold text-foreground", children: "General" }),
|
|
282
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
283
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
284
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { className: "text-sm font-medium", children: "Default Locale" }),
|
|
285
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "The default language for new content entries." })
|
|
286
|
+
] }),
|
|
287
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: formData?.defaultLocale || "en", onValueChange: handleLocaleChange, disabled: !canEdit || feedbackStatus === "saving", children: [
|
|
288
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-48", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
|
|
289
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: LOCALE_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: option.value, children: option.label }, option.value)) })
|
|
290
|
+
] })
|
|
291
|
+
] }) })
|
|
292
|
+
] }),
|
|
293
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(CmsSurface, { elevation: "base", className: "p-6", children: [
|
|
294
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "mb-4 text-lg font-semibold text-foreground", children: "Features" }),
|
|
295
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
296
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
297
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
298
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { className: "text-sm font-medium", children: "Enable Versioning" }),
|
|
299
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Track content history and enable rollback to previous versions" })
|
|
300
|
+
] }),
|
|
301
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Switch, { checked: formData?.features.versioning ?? true, onCheckedChange: () => handleFeatureChange("versioning"), disabled: !canEdit || feedbackStatus === "saving" })
|
|
302
|
+
] }),
|
|
303
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
304
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
305
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { className: "text-sm font-medium", children: "Enable Scheduling" }),
|
|
306
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Schedule content to publish at a future date and time" })
|
|
307
|
+
] }),
|
|
308
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Switch, { checked: formData?.features.scheduling ?? true, onCheckedChange: () => handleFeatureChange("scheduling"), disabled: !canEdit || feedbackStatus === "saving" })
|
|
309
|
+
] }),
|
|
310
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
311
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
312
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { className: "text-sm font-medium", children: "Enable Localization" }),
|
|
313
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Support multiple languages for content entries" })
|
|
314
|
+
] }),
|
|
315
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Switch, { checked: formData?.features.localization ?? false, onCheckedChange: () => handleFeatureChange("localization"), disabled: !canEdit || feedbackStatus === "saving" })
|
|
316
|
+
] }),
|
|
317
|
+
baseConfig.navigation.showMedia && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
318
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
319
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { className: "text-sm font-medium", children: "Enable Media Management" }),
|
|
320
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Use the built-in media library for image and file uploads" })
|
|
321
|
+
] }),
|
|
322
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Switch, { checked: formData?.features.mediaManagement ?? true, onCheckedChange: () => handleFeatureChange("mediaManagement"), disabled: !canEdit || feedbackStatus === "saving" })
|
|
323
|
+
] })
|
|
324
|
+
] })
|
|
325
|
+
] }),
|
|
326
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(CmsSurface, { elevation: "base", className: "p-6", children: [
|
|
327
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "mb-4 text-lg font-semibold text-foreground", children: "API" }),
|
|
328
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
329
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { className: "text-sm font-medium", children: "Convex Deployment URL" }),
|
|
330
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "mt-1 block rounded-md bg-muted px-3 py-2 text-sm", children: "https://majestic-beagle-49.convex.cloud" })
|
|
331
|
+
] }) })
|
|
332
|
+
] }),
|
|
333
|
+
canEdit && /* @__PURE__ */ jsxRuntimeExports.jsxs(CmsSurface, { elevation: "base", className: "border-red-200 p-6 dark:border-red-900", children: [
|
|
334
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "mb-4 text-lg font-semibold text-red-600", children: "Danger Zone" }),
|
|
335
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
336
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
337
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { className: "text-sm font-medium", children: "Reset to Defaults" }),
|
|
338
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Reset all settings to their default values. This cannot be undone." })
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CmsButton, { variant: "danger", onClick: handleReset, disabled: feedbackStatus === "saving", children: "Reset Settings" })
|
|
341
|
+
] })
|
|
342
|
+
] })
|
|
343
|
+
] })
|
|
344
|
+
] }) });
|
|
345
|
+
}
|
|
346
|
+
export {
|
|
347
|
+
SettingsPage as component
|
|
348
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../_chunks/_libs/react.mjs";
|
|
2
|
+
import { R as Root, T as Thumb } from "../_chunks/_libs/@radix-ui/react-switch.mjs";
|
|
3
|
+
import { c as cn } from "./router-DDWcF-kt.mjs";
|
|
4
|
+
function Switch({
|
|
5
|
+
className,
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9
|
+
Root,
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "switch",
|
|
12
|
+
className: cn(
|
|
13
|
+
"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",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
...props,
|
|
17
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18
|
+
Thumb,
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "switch-thumb",
|
|
21
|
+
className: cn(
|
|
22
|
+
"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"
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
Switch as S
|
|
31
|
+
};
|