convex-cms 0.0.3 → 0.0.5-alpha.2
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 +107 -60
- package/admin/README.md +99 -0
- package/admin/src/components/AdminLayout.tsx +22 -0
- package/admin/src/components/BreakingChangesWarningDialog.tsx +81 -0
- package/admin/src/components/BulkActionBar.tsx +190 -0
- package/admin/src/components/BulkOperationModal.tsx +177 -0
- package/admin/src/components/ContentEntryEditor.tsx +1104 -0
- package/admin/src/components/ContentTypeFormModal.tsx +1012 -0
- package/admin/src/components/ErrorBoundary.tsx +83 -0
- package/admin/src/components/ErrorState.tsx +147 -0
- package/admin/src/components/Header.tsx +294 -0
- package/admin/src/components/RouteGuard.tsx +264 -0
- package/admin/src/components/Sidebar.tsx +90 -0
- package/admin/src/components/TaxonomyEditor.tsx +348 -0
- package/admin/src/components/TermTree.tsx +533 -0
- package/admin/src/components/UploadDropzone.tsx +383 -0
- package/admin/src/components/VersionCompare.tsx +250 -0
- package/admin/src/components/VersionHistory.tsx +279 -0
- package/admin/src/components/VersionRollbackModal.tsx +79 -0
- package/admin/src/components/cmsds/CmsButton.tsx +101 -0
- package/admin/src/components/cmsds/CmsDialog.tsx +139 -0
- package/admin/src/components/cmsds/CmsDropdown.tsx +62 -0
- package/admin/src/components/cmsds/CmsEmptyState.tsx +54 -0
- package/admin/src/components/cmsds/CmsField.tsx +47 -0
- package/admin/src/components/cmsds/CmsPageHeader.tsx +35 -0
- package/admin/src/components/cmsds/CmsStatusBadge.tsx +153 -0
- package/admin/src/components/cmsds/CmsSurface.tsx +52 -0
- package/admin/src/components/cmsds/CmsTable.tsx +164 -0
- package/admin/src/components/cmsds/CmsToolbar.tsx +58 -0
- package/admin/src/components/cmsds/index.ts +10 -0
- package/admin/src/components/fields/BooleanField.tsx +74 -0
- package/admin/src/components/fields/CategoryField.tsx +394 -0
- package/admin/src/components/fields/DateField.tsx +173 -0
- package/admin/src/components/fields/DefaultFieldRenderer.tsx +74 -0
- package/admin/src/components/fields/FieldRenderer.tsx +180 -0
- package/admin/src/components/fields/FieldWrapper.tsx +57 -0
- package/admin/src/components/fields/JsonField.tsx +172 -0
- package/admin/src/components/fields/MediaField.tsx +367 -0
- package/admin/src/components/fields/MultiSelectField.tsx +118 -0
- package/admin/src/components/fields/NumberField.tsx +77 -0
- package/admin/src/components/fields/ReferenceField.tsx +386 -0
- package/admin/src/components/fields/RichTextField.tsx +171 -0
- package/admin/src/components/fields/SelectField.tsx +62 -0
- package/admin/src/components/fields/TagField.tsx +325 -0
- package/admin/src/components/fields/TextAreaField.tsx +68 -0
- package/admin/src/components/fields/TextField.tsx +56 -0
- package/admin/src/components/fields/index.ts +54 -0
- package/admin/src/components/fields/registry.ts +64 -0
- package/admin/src/components/fields/types.ts +217 -0
- package/admin/src/components/filters/TaxonomyFilter.tsx +254 -0
- package/admin/src/components/filters/index.ts +1 -0
- package/admin/src/components/index.ts +8 -0
- package/admin/src/components/media/MediaAssetActions.tsx +115 -0
- package/admin/src/components/media/MediaAssetEditDialog.tsx +217 -0
- package/admin/src/components/media/MediaBulkActionBar.tsx +51 -0
- package/admin/src/components/media/MediaFolderActions.tsx +69 -0
- package/admin/src/components/media/MediaFolderEditDialog.tsx +126 -0
- package/admin/src/components/media/MediaMoveModal.tsx +179 -0
- package/admin/src/components/media/MediaPreviewModal.tsx +370 -0
- package/admin/src/components/media/MediaTaxonomyPicker.tsx +304 -0
- package/admin/src/components/media/MediaTrashBulkActionBar.tsx +59 -0
- package/admin/src/components/ui/accordion.tsx +64 -0
- package/admin/src/components/ui/alert-dialog.tsx +155 -0
- package/admin/src/components/ui/alert.tsx +66 -0
- package/admin/src/components/ui/avatar.tsx +53 -0
- package/admin/src/components/ui/badge.tsx +46 -0
- package/admin/src/components/ui/breadcrumb.tsx +109 -0
- package/admin/src/components/ui/button.tsx +62 -0
- package/admin/src/components/ui/calendar.tsx +220 -0
- package/admin/src/components/ui/card.tsx +92 -0
- package/admin/src/components/ui/checkbox.tsx +30 -0
- package/admin/src/components/ui/command.tsx +182 -0
- package/admin/src/components/ui/dialog.tsx +143 -0
- package/admin/src/components/ui/dropdown-menu.tsx +257 -0
- package/admin/src/components/ui/form.tsx +167 -0
- package/admin/src/components/ui/input.tsx +21 -0
- package/admin/src/components/ui/label.tsx +24 -0
- package/admin/src/components/ui/popover.tsx +46 -0
- package/admin/src/components/ui/scroll-area.tsx +56 -0
- package/admin/src/components/ui/select.tsx +190 -0
- package/admin/src/components/ui/separator.tsx +26 -0
- package/admin/src/components/ui/sheet.tsx +137 -0
- package/admin/src/components/ui/sidebar.tsx +724 -0
- package/admin/src/components/ui/skeleton.tsx +13 -0
- package/admin/src/components/ui/sonner.tsx +38 -0
- package/admin/src/components/ui/switch.tsx +31 -0
- package/admin/src/components/ui/table.tsx +114 -0
- package/admin/src/components/ui/tabs.tsx +66 -0
- package/admin/src/components/ui/textarea.tsx +18 -0
- package/admin/src/components/ui/tooltip.tsx +61 -0
- package/admin/src/contexts/AdminConfigContext.tsx +30 -0
- package/admin/src/contexts/AuthContext.tsx +330 -0
- package/admin/src/contexts/BreadcrumbContext.tsx +49 -0
- package/admin/src/contexts/SettingsConfigContext.tsx +57 -0
- package/admin/src/contexts/ThemeContext.tsx +91 -0
- package/admin/src/contexts/index.ts +20 -0
- package/admin/src/embed/components/EmbedHeader.tsx +103 -0
- package/admin/src/embed/components/EmbedLayout.tsx +29 -0
- package/admin/src/embed/components/EmbedSidebar.tsx +119 -0
- package/admin/src/embed/components/index.ts +3 -0
- package/admin/src/embed/contexts/ApiContext.tsx +32 -0
- package/admin/src/embed/index.tsx +184 -0
- package/admin/src/embed/navigation.tsx +202 -0
- package/admin/src/embed/pages/Content.tsx +19 -0
- package/admin/src/embed/pages/ContentTypes.tsx +19 -0
- package/admin/src/embed/pages/Dashboard.tsx +19 -0
- package/admin/src/embed/pages/Media.tsx +19 -0
- package/admin/src/embed/pages/Settings.tsx +22 -0
- package/admin/src/embed/pages/Taxonomies.tsx +22 -0
- package/admin/src/embed/pages/Trash.tsx +22 -0
- package/admin/src/embed/pages/index.ts +7 -0
- package/admin/src/embed/types.ts +24 -0
- package/admin/src/hooks/index.ts +2 -0
- package/admin/src/hooks/use-mobile.ts +19 -0
- package/admin/src/hooks/useBreadcrumbLabel.ts +15 -0
- package/admin/src/hooks/usePermissions.ts +211 -0
- package/admin/src/lib/admin-config.ts +111 -0
- package/admin/src/lib/cn.ts +6 -0
- package/admin/src/lib/config.server.ts +56 -0
- package/admin/src/lib/convex.ts +26 -0
- package/admin/src/lib/embed-adapter.ts +80 -0
- package/admin/src/lib/icons.tsx +96 -0
- package/admin/src/lib/loadAdminConfig.ts +92 -0
- package/admin/src/lib/motion.ts +29 -0
- package/admin/src/lib/navigation.ts +43 -0
- package/admin/src/lib/tanstack-adapter.ts +82 -0
- package/admin/src/pages/ContentPage.tsx +337 -0
- package/admin/src/pages/ContentTypesPage.tsx +457 -0
- package/admin/src/pages/DashboardPage.tsx +163 -0
- package/admin/src/pages/MediaPage.tsx +34 -0
- package/admin/src/pages/SettingsPage.tsx +486 -0
- package/admin/src/pages/TaxonomiesPage.tsx +289 -0
- package/admin/src/pages/TrashPage.tsx +421 -0
- package/admin/src/pages/index.ts +14 -0
- package/admin/src/routeTree.gen.ts +262 -0
- package/admin/src/router.tsx +22 -0
- package/admin/src/routes/__root.tsx +250 -0
- package/admin/src/routes/content-types.tsx +20 -0
- package/admin/src/routes/content.tsx +20 -0
- package/admin/src/routes/entries/$entryId.tsx +107 -0
- package/admin/src/routes/entries/new.$contentTypeId.tsx +69 -0
- package/admin/src/routes/entries/type/$contentTypeId.tsx +503 -0
- package/admin/src/routes/index.tsx +20 -0
- package/admin/src/routes/media.tsx +1095 -0
- package/admin/src/routes/settings.tsx +20 -0
- package/admin/src/routes/taxonomies.tsx +20 -0
- package/admin/src/routes/trash.tsx +20 -0
- package/admin/src/styles/globals.css +69 -0
- package/admin/src/styles/tailwind-config.css +74 -0
- package/admin/src/styles/theme.css +73 -0
- package/admin/src/types/index.ts +221 -0
- package/admin/src/utils/errorParsing.ts +163 -0
- package/admin/src/utils/index.ts +5 -0
- package/admin/src/vite-env.d.ts +14 -0
- package/admin/tailwind.preset.cjs +102 -0
- package/admin-dist/nitro.json +1 -1
- package/admin-dist/public/assets/{CmsEmptyState-CRswfTzk.js → CmsEmptyState-CkqBIab3.js} +2 -2
- package/admin-dist/public/assets/{CmsPageHeader-CirpXndm.js → CmsPageHeader-CUtl5MMG.js} +1 -1
- package/admin-dist/public/assets/{CmsStatusBadge-CbEUpQu-.js → CmsStatusBadge-CUYFgEe-.js} +1 -1
- package/admin-dist/public/assets/CmsSurface-CsJfAVa3.js +1 -0
- package/admin-dist/public/assets/{CmsToolbar-BI2nZOXp.js → CmsToolbar-CnfbcxeP.js} +1 -1
- package/admin-dist/public/assets/{ContentEntryEditor-CBeCyK_m.js → ContentEntryEditor-BU220CCy.js} +1 -1
- package/admin-dist/public/assets/TaxonomyFilter-CWCxC5HZ.js +1 -0
- package/admin-dist/public/assets/_contentTypeId-DK8cskRt.js +1 -0
- package/admin-dist/public/assets/{_entryId-CKU_glsK.js → _entryId-CuVMExbb.js} +1 -1
- package/admin-dist/public/assets/alert-CF1BSzGR.js +1 -0
- package/admin-dist/public/assets/{badge-hvUOzpVZ.js → badge-CmuOIVKp.js} +1 -1
- package/admin-dist/public/assets/{circle-check-big-CF_pR17r.js → circle-check-big-BKDVG6DU.js} +1 -1
- package/admin-dist/public/assets/{command-DU82cJlt.js → command-XJxnF2Sd.js} +1 -1
- package/admin-dist/public/assets/content-QBUxdxbS.js +1 -0
- package/admin-dist/public/assets/content-types-CrNEm8Hf.js +2 -0
- package/admin-dist/public/assets/globals-B7Wsfh_v.css +1 -0
- package/admin-dist/public/assets/index-C7xOwudI.js +1 -0
- package/admin-dist/public/assets/{label-KNtpL71g.js → label-CHCnXeBk.js} +1 -1
- package/admin-dist/public/assets/{link-2-Bw2aI4V4.js → link-2-Bb34judH.js} +1 -1
- package/admin-dist/public/assets/{list-sYepHjt_.js → list-9Pzt48ld.js} +1 -1
- package/admin-dist/public/assets/{main-CKj5yfEi.js → main-CjQ2VI9L.js} +3 -3
- package/admin-dist/public/assets/media-Dc5PWt2Q.js +1 -0
- package/admin-dist/public/assets/{new._contentTypeId-C3LstjNs.js → new._contentTypeId-C_I4YxIa.js} +1 -1
- package/admin-dist/public/assets/{plus-DUn8v_Xf.js → plus-Ceef7DHk.js} +1 -1
- package/admin-dist/public/assets/{rotate-ccw-DJEoHcRI.js → rotate-ccw-7k7-4VUq.js} +1 -1
- package/admin-dist/public/assets/scroll-area-CC6wujnp.js +1 -0
- package/admin-dist/public/assets/{search-MuAUDJKR.js → search-DwoUV2pv.js} +1 -1
- package/admin-dist/public/assets/select-hOZTp8aC.js +1 -0
- package/admin-dist/public/assets/settings-t2PbCZh4.js +1 -0
- package/admin-dist/public/assets/switch-jX2pDaNU.js +1 -0
- package/admin-dist/public/assets/tabs-q4EbZk7c.js +1 -0
- package/admin-dist/public/assets/tanstack-adapter-B-Glm4kH.js +1 -0
- package/admin-dist/public/assets/taxonomies-kyk5P4ZW.js +1 -0
- package/admin-dist/public/assets/{textarea-BTy7nwzR.js → textarea-B6SfBmr0.js} +1 -1
- package/admin-dist/public/assets/trash-BOCnIznD.js +1 -0
- package/admin-dist/public/assets/{triangle-alert-E52Vfeuh.js → triangle-alert-CXFIO_Gu.js} +1 -1
- package/admin-dist/public/assets/useBreadcrumbLabel-_6qBagc3.js +1 -0
- package/admin-dist/public/assets/{usePermissions-Basjs9BT.js → usePermissions-M1ijZ7a6.js} +1 -1
- package/admin-dist/server/_chunks/_libs/@tanstack/react-router.mjs +7 -0
- package/admin-dist/server/_ssr/{badge-6BsP37vG.mjs → CmsButton-DOiTVKQq.mjs} +33 -33
- package/admin-dist/server/_ssr/{CmsEmptyState-DU7-7-mV.mjs → CmsEmptyState-fbnGt3LD.mjs} +2 -2
- package/admin-dist/server/_ssr/{CmsPageHeader-CseW0AHm.mjs → CmsPageHeader-DHRrdOZa.mjs} +1 -1
- package/admin-dist/server/_ssr/{CmsStatusBadge-B_pi4KCp.mjs → CmsStatusBadge-s7obWbKZ.mjs} +2 -2
- package/admin-dist/server/_ssr/CmsSurface-rFoYjb62.mjs +44 -0
- package/admin-dist/server/_ssr/{CmsToolbar-X75ex6ek.mjs → CmsToolbar-zTE45z2q.mjs} +2 -2
- package/admin-dist/server/_ssr/{ContentEntryEditor-CepusRsA.mjs → ContentEntryEditor-BLoEjT_m.mjs} +12 -12
- package/admin-dist/server/_ssr/{TaxonomyFilter-Bwrq0-cz.mjs → TaxonomyFilter-XAtaJC2z.mjs} +5 -5
- package/admin-dist/server/_ssr/{_contentTypeId-BqYKEcLr.mjs → _contentTypeId-Csl4822C.mjs} +13 -13
- package/admin-dist/server/_ssr/{_entryId-CRfnqeDf.mjs → _entryId-D8alLFBx.mjs} +15 -15
- package/admin-dist/server/_ssr/_tanstack-start-manifest_v-BffZedId.mjs +4 -0
- package/admin-dist/server/_ssr/{command-fy8epIKf.mjs → command-C0Di14--.mjs} +1 -1
- package/admin-dist/server/_ssr/{content-B5RhL7uW.mjs → content-CT-FPsmV.mjs} +170 -98
- package/admin-dist/server/_ssr/{content-types-BIOqCQYN.mjs → content-types-C8cBFdzE.mjs} +260 -115
- package/admin-dist/server/_ssr/{index-DHSHDPt1.mjs → index-BJtcrEc-.mjs} +88 -17
- package/admin-dist/server/_ssr/index.mjs +2 -2
- package/admin-dist/server/_ssr/{label-C8Dko1j7.mjs → label-qn2Afwl4.mjs} +1 -1
- package/admin-dist/server/_ssr/{media-CSx3XttC.mjs → media-qv5IAsMZ.mjs} +43 -43
- package/admin-dist/server/_ssr/{new._contentTypeId-DzanEZQM.mjs → new._contentTypeId-DdGyrhqs.mjs} +13 -13
- package/admin-dist/server/_ssr/{router-DDWcF-kt.mjs → router-nSVkxb6Y.mjs} +11 -11
- package/admin-dist/server/_ssr/{scroll-area-bjPYwhXN.mjs → scroll-area-BCinP455.mjs} +1 -1
- package/admin-dist/server/_ssr/{select-BUhDDf4T.mjs → select-BKQlQScw.mjs} +1 -1
- package/admin-dist/server/_ssr/{settings-DAsxnw2q.mjs → settings-BCr2KQlk.mjs} +236 -139
- package/admin-dist/server/_ssr/{switch-BgyRtQ1Z.mjs → switch-BaOi42fE.mjs} +1 -1
- package/admin-dist/server/_ssr/{tabs-DzMdRB1A.mjs → tabs-DYXEi9kq.mjs} +5 -3
- package/admin-dist/server/_ssr/tanstack-adapter-Bsz8kha-.mjs +119 -0
- package/admin-dist/server/_ssr/{taxonomies-C8j8g5Q5.mjs → taxonomies-CueMHTbE.mjs} +184 -73
- package/admin-dist/server/_ssr/{textarea-9jNeYJSc.mjs → textarea-CI0Jqx2x.mjs} +1 -1
- package/admin-dist/server/_ssr/{trash-DYMxwhZB.mjs → trash-DE6W8GoX.mjs} +211 -88
- package/admin-dist/server/_ssr/{useBreadcrumbLabel-FNSAr2Ha.mjs → useBreadcrumbLabel-B5Yi72lM.mjs} +1 -1
- package/admin-dist/server/_ssr/{usePermissions-BJGGahrJ.mjs → usePermissions-C3nZ-Izm.mjs} +1 -1
- package/admin-dist/server/index.mjs +189 -182
- 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/bulk.d.ts +79 -0
- package/dist/client/admin/bulk.d.ts.map +1 -0
- package/dist/client/admin/bulk.js +72 -0
- package/dist/client/admin/bulk.js.map +1 -0
- package/dist/client/admin/contentLock.d.ts +118 -0
- package/dist/client/admin/contentLock.d.ts.map +1 -0
- package/dist/client/admin/contentLock.js +81 -0
- package/dist/client/admin/contentLock.js.map +1 -0
- package/dist/client/admin/contentTypes.d.ts +1204 -0
- package/dist/client/admin/contentTypes.d.ts.map +1 -0
- package/dist/client/admin/contentTypes.js +122 -0
- package/dist/client/admin/contentTypes.js.map +1 -0
- package/dist/client/admin/dashboard.d.ts +16 -0
- package/dist/client/admin/dashboard.d.ts.map +1 -0
- package/dist/client/admin/dashboard.js +33 -0
- package/dist/client/admin/dashboard.js.map +1 -0
- package/dist/client/admin/entries.d.ts +358 -0
- package/dist/client/admin/entries.d.ts.map +1 -0
- package/dist/client/admin/entries.js +220 -0
- package/dist/client/admin/entries.js.map +1 -0
- package/dist/client/admin/index.d.ts +6568 -0
- package/dist/client/admin/index.d.ts.map +1 -0
- package/dist/client/admin/index.js +305 -0
- package/dist/client/admin/index.js.map +1 -0
- package/dist/client/admin/media.d.ts +1038 -0
- package/dist/client/admin/media.d.ts.map +1 -0
- package/dist/client/admin/media.js +489 -0
- package/dist/client/admin/media.js.map +1 -0
- package/dist/client/admin/taxonomies.d.ts +339 -0
- package/dist/client/admin/taxonomies.d.ts.map +1 -0
- package/dist/client/admin/taxonomies.js +364 -0
- package/dist/client/admin/taxonomies.js.map +1 -0
- package/dist/client/admin/trash.d.ts +91 -0
- package/dist/client/admin/trash.d.ts.map +1 -0
- package/dist/client/admin/trash.js +71 -0
- package/dist/client/admin/trash.js.map +1 -0
- package/dist/client/admin/types.d.ts +320 -0
- package/dist/client/admin/types.d.ts.map +1 -0
- package/dist/client/admin/types.js +7 -0
- package/dist/client/admin/types.js.map +1 -0
- package/dist/client/admin/validators.d.ts +3886 -0
- package/dist/client/admin/validators.d.ts.map +1 -0
- package/dist/client/admin/validators.js +322 -0
- package/dist/client/admin/validators.js.map +1 -0
- package/dist/client/admin/versions.d.ts +106 -0
- package/dist/client/admin/versions.d.ts.map +1 -0
- package/dist/client/admin/versions.js +57 -0
- package/dist/client/admin/versions.js.map +1 -0
- package/dist/client/adminApiTypes.d.ts +27 -0
- package/dist/client/adminApiTypes.d.ts.map +1 -0
- package/dist/client/adminApiTypes.js +12 -0
- package/dist/client/adminApiTypes.js.map +1 -0
- package/dist/client/{admin-config.d.ts → adminConfig.d.ts} +4 -4
- package/dist/client/adminConfig.d.ts.map +1 -0
- package/dist/client/{admin-config.js → adminConfig.js} +3 -3
- package/dist/client/adminConfig.js.map +1 -0
- package/dist/client/agentTools.d.ts +11 -21
- package/dist/client/agentTools.d.ts.map +1 -1
- package/dist/client/agentTools.js +4 -4
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +19 -6
- 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/contentEntries.d.ts +4 -4
- package/dist/component/contentEntryMutations.d.ts +46 -0
- package/dist/component/contentEntryMutations.d.ts.map +1 -1
- package/dist/component/contentEntryMutations.js +1 -1
- package/dist/component/contentEntryMutations.js.map +1 -1
- package/dist/component/contentTypeMigration.d.ts +1 -1
- package/dist/component/contentTypeMutations.d.ts +22 -0
- package/dist/component/contentTypeMutations.d.ts.map +1 -1
- package/dist/component/contentTypeMutations.js +1 -1
- package/dist/component/contentTypeMutations.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/mediaAssetMutations.d.ts +47 -0
- package/dist/component/mediaAssetMutations.d.ts.map +1 -1
- package/dist/component/mediaAssetMutations.js +1 -1
- package/dist/component/mediaAssetMutations.js.map +1 -1
- package/dist/component/roles.d.ts +1 -1
- package/dist/component/roles.js +1 -1
- package/dist/component/schema.d.ts +9 -0
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +1 -1
- package/dist/component/schema.js.map +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 +115 -13
- package/admin-dist/public/assets/ErrorState-BIVaWmom.js +0 -1
- package/admin-dist/public/assets/TaxonomyFilter-ChaY6Y_x.js +0 -1
- package/admin-dist/public/assets/_contentTypeId-DQ8k_Rvw.js +0 -1
- 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/globals-CS6BZ0zp.css +0 -1
- package/admin-dist/public/assets/index-DNGIZHL-.js +0 -1
- package/admin-dist/public/assets/media-Bkrkffm7.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/ErrorState-cI-bKLez.mjs +0 -89
- 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/client/admin-config.d.ts.map +0 -1
- package/dist/client/admin-config.js.map +0 -1
- package/dist/client/adminApi.d.ts +0 -2273
- package/dist/client/adminApi.d.ts.map +0 -1
- package/dist/client/adminApi.js +0 -716
- package/dist/client/adminApi.js.map +0 -1
|
@@ -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};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { j as jsxRuntimeExports } from "../_chunks/_libs/react.mjs";
|
|
2
|
-
function ErrorState({
|
|
3
|
-
error,
|
|
4
|
-
title = "Something went wrong",
|
|
5
|
-
onRetry,
|
|
6
|
-
isRetrying = false,
|
|
7
|
-
icon,
|
|
8
|
-
className = ""
|
|
9
|
-
}) {
|
|
10
|
-
const errorMessage = error instanceof Error ? error.message : error ?? "An unexpected error occurred";
|
|
11
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `error-state ${className}`, role: "alert", "data-testid": "error-state", children: [
|
|
12
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "error-state-icon", children: icon ?? /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
13
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
14
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
15
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
16
|
-
] }) }),
|
|
17
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "error-state-title", children: title }),
|
|
18
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "error-state-message", children: errorMessage }),
|
|
19
|
-
onRetry && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
20
|
-
"button",
|
|
21
|
-
{
|
|
22
|
-
type: "button",
|
|
23
|
-
className: "btn btn-primary",
|
|
24
|
-
onClick: onRetry,
|
|
25
|
-
disabled: isRetrying,
|
|
26
|
-
"data-testid": "error-retry-button",
|
|
27
|
-
children: isRetrying ? "Retrying..." : "Try Again"
|
|
28
|
-
}
|
|
29
|
-
)
|
|
30
|
-
] });
|
|
31
|
-
}
|
|
32
|
-
function ErrorAlert({
|
|
33
|
-
error,
|
|
34
|
-
onDismiss,
|
|
35
|
-
onRetry,
|
|
36
|
-
isRetrying = false,
|
|
37
|
-
variant = "error",
|
|
38
|
-
className = ""
|
|
39
|
-
}) {
|
|
40
|
-
if (!error) return null;
|
|
41
|
-
const errorMessage = error instanceof Error ? error.message : error;
|
|
42
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
43
|
-
"div",
|
|
44
|
-
{
|
|
45
|
-
className: `error-alert error-alert--${variant} ${className}`,
|
|
46
|
-
role: "alert",
|
|
47
|
-
"data-testid": "error-alert",
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "error-alert-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
50
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
51
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
52
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
53
|
-
] }) }),
|
|
54
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "error-alert-content", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "error-alert-message", children: errorMessage }) }),
|
|
55
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "error-alert-actions", children: [
|
|
56
|
-
onRetry && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57
|
-
"button",
|
|
58
|
-
{
|
|
59
|
-
type: "button",
|
|
60
|
-
className: "error-alert-btn error-alert-btn--retry",
|
|
61
|
-
onClick: onRetry,
|
|
62
|
-
disabled: isRetrying,
|
|
63
|
-
"data-testid": "error-alert-retry",
|
|
64
|
-
children: isRetrying ? "Retrying..." : "Retry"
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
onDismiss && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
68
|
-
"button",
|
|
69
|
-
{
|
|
70
|
-
type: "button",
|
|
71
|
-
className: "error-alert-btn error-alert-btn--dismiss",
|
|
72
|
-
onClick: onDismiss,
|
|
73
|
-
"aria-label": "Dismiss error",
|
|
74
|
-
"data-testid": "error-alert-dismiss",
|
|
75
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
76
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
77
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
78
|
-
] })
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
] })
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
export {
|
|
87
|
-
ErrorState as E,
|
|
88
|
-
ErrorAlert as a
|
|
89
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/__root.tsx", "children": ["/", "/content", "/content-types", "/media", "/settings", "/taxonomies", "/trash", "/entries/$entryId", "/entries/new/$contentTypeId", "/entries/type/$contentTypeId"], "preloads": ["/assets/main-CKj5yfEi.js"], "assets": [] }, "/": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-DNGIZHL-.js", "/assets/CmsPageHeader-CirpXndm.js"] }, "/content": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/content.tsx", "assets": [], "preloads": ["/assets/content-_LXl3pp7.js", "/assets/usePermissions-Basjs9BT.js", "/assets/badge-hvUOzpVZ.js", "/assets/CmsEmptyState-CRswfTzk.js", "/assets/select-BD29IXCI.js", "/assets/ErrorState-BIVaWmom.js", "/assets/circle-check-big-CF_pR17r.js", "/assets/triangle-alert-E52Vfeuh.js", "/assets/CmsPageHeader-CirpXndm.js", "/assets/CmsToolbar-BI2nZOXp.js", "/assets/CmsStatusBadge-CbEUpQu-.js", "/assets/plus-DUn8v_Xf.js", "/assets/search-MuAUDJKR.js"] }, "/content-types": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/content-types.tsx", "assets": [], "preloads": ["/assets/content-types-KjxaXGxY.js", "/assets/CmsEmptyState-CRswfTzk.js", "/assets/badge-hvUOzpVZ.js", "/assets/label-KNtpL71g.js", "/assets/textarea-BTy7nwzR.js", "/assets/select-BD29IXCI.js", "/assets/triangle-alert-E52Vfeuh.js", "/assets/plus-DUn8v_Xf.js", "/assets/list-sYepHjt_.js", "/assets/link-2-Bw2aI4V4.js", "/assets/ErrorState-BIVaWmom.js", "/assets/CmsPageHeader-CirpXndm.js", "/assets/CmsToolbar-BI2nZOXp.js", "/assets/search-MuAUDJKR.js"] }, "/media": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/media.tsx", "assets": [], "preloads": ["/assets/media-Bkrkffm7.js", "/assets/tabs-imc8h-Dp.js", "/assets/CmsPageHeader-CirpXndm.js", "/assets/CmsToolbar-BI2nZOXp.js", "/assets/CmsEmptyState-CRswfTzk.js", "/assets/badge-hvUOzpVZ.js", "/assets/TaxonomyFilter-ChaY6Y_x.js", "/assets/label-KNtpL71g.js", "/assets/select-BD29IXCI.js", "/assets/textarea-BTy7nwzR.js", "/assets/plus-DUn8v_Xf.js", "/assets/link-2-Bw2aI4V4.js", "/assets/rotate-ccw-DJEoHcRI.js", "/assets/search-MuAUDJKR.js", "/assets/command-DU82cJlt.js"] }, "/settings": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/settings.tsx", "assets": [], "preloads": ["/assets/settings-DmMyn_6A.js", "/assets/badge-hvUOzpVZ.js", "/assets/label-KNtpL71g.js", "/assets/select-BD29IXCI.js", "/assets/usePermissions-Basjs9BT.js", "/assets/CmsPageHeader-CirpXndm.js", "/assets/alert-BXjTqrwQ.js", "/assets/switch-h3Rrnl5i.js", "/assets/triangle-alert-E52Vfeuh.js"] }, "/taxonomies": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/taxonomies.tsx", "assets": [], "preloads": ["/assets/taxonomies-dAsrT65H.js", "/assets/CmsEmptyState-CRswfTzk.js", "/assets/badge-hvUOzpVZ.js", "/assets/label-KNtpL71g.js", "/assets/textarea-BTy7nwzR.js", "/assets/plus-DUn8v_Xf.js", "/assets/CmsPageHeader-CirpXndm.js", "/assets/alert-BXjTqrwQ.js", "/assets/scroll-area-DfIlT0in.js", "/assets/triangle-alert-E52Vfeuh.js"] }, "/trash": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/trash.tsx", "assets": [], "preloads": ["/assets/trash-SAWKZZHv.js", "/assets/CmsPageHeader-CirpXndm.js", "/assets/CmsToolbar-BI2nZOXp.js", "/assets/CmsEmptyState-CRswfTzk.js", "/assets/alert-BXjTqrwQ.js", "/assets/badge-hvUOzpVZ.js", "/assets/select-BD29IXCI.js", "/assets/search-MuAUDJKR.js", "/assets/triangle-alert-E52Vfeuh.js", "/assets/rotate-ccw-DJEoHcRI.js"] }, "/entries/$entryId": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/entries/$entryId.tsx", "assets": [], "preloads": ["/assets/_entryId-CKU_glsK.js", "/assets/ContentEntryEditor-CBeCyK_m.js", "/assets/usePermissions-Basjs9BT.js", "/assets/useBreadcrumbLabel-BECBMCzM.js", "/assets/CmsEmptyState-CRswfTzk.js", "/assets/label-KNtpL71g.js", "/assets/switch-h3Rrnl5i.js", "/assets/badge-hvUOzpVZ.js", "/assets/tabs-imc8h-Dp.js", "/assets/textarea-BTy7nwzR.js", "/assets/list-sYepHjt_.js", "/assets/select-BD29IXCI.js", "/assets/search-MuAUDJKR.js", "/assets/command-DU82cJlt.js", "/assets/CmsStatusBadge-CbEUpQu-.js", "/assets/plus-DUn8v_Xf.js", "/assets/link-2-Bw2aI4V4.js", "/assets/scroll-area-DfIlT0in.js", "/assets/triangle-alert-E52Vfeuh.js", "/assets/circle-check-big-CF_pR17r.js"] }, "/entries/new/$contentTypeId": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/entries/new.$contentTypeId.tsx", "assets": [], "preloads": ["/assets/new._contentTypeId-C3LstjNs.js", "/assets/ContentEntryEditor-CBeCyK_m.js", "/assets/useBreadcrumbLabel-BECBMCzM.js", "/assets/CmsEmptyState-CRswfTzk.js", "/assets/label-KNtpL71g.js", "/assets/switch-h3Rrnl5i.js", "/assets/badge-hvUOzpVZ.js", "/assets/tabs-imc8h-Dp.js", "/assets/textarea-BTy7nwzR.js", "/assets/list-sYepHjt_.js", "/assets/select-BD29IXCI.js", "/assets/search-MuAUDJKR.js", "/assets/command-DU82cJlt.js", "/assets/CmsStatusBadge-CbEUpQu-.js", "/assets/plus-DUn8v_Xf.js", "/assets/link-2-Bw2aI4V4.js", "/assets/scroll-area-DfIlT0in.js", "/assets/triangle-alert-E52Vfeuh.js", "/assets/circle-check-big-CF_pR17r.js"] }, "/entries/type/$contentTypeId": { "filePath": "/Users/home/Developer/projects/convex-cms/admin/src/routes/entries/type/$contentTypeId.tsx", "assets": [], "preloads": ["/assets/_contentTypeId-DQ8k_Rvw.js", "/assets/usePermissions-Basjs9BT.js", "/assets/useBreadcrumbLabel-BECBMCzM.js", "/assets/CmsPageHeader-CirpXndm.js", "/assets/CmsToolbar-BI2nZOXp.js", "/assets/badge-hvUOzpVZ.js", "/assets/CmsStatusBadge-CbEUpQu-.js", "/assets/CmsEmptyState-CRswfTzk.js", "/assets/TaxonomyFilter-ChaY6Y_x.js", "/assets/select-BD29IXCI.js", "/assets/plus-DUn8v_Xf.js", "/assets/search-MuAUDJKR.js", "/assets/command-DU82cJlt.js"] } }, "clientEntry": "/assets/main-CKj5yfEi.js" });
|
|
2
|
-
export {
|
|
3
|
-
tsrStartManifest
|
|
4
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { j as jsxRuntimeExports } from "../_chunks/_libs/react.mjs";
|
|
2
|
-
import { c as cn } from "./router-DDWcF-kt.mjs";
|
|
3
|
-
import { c as cva } from "../_libs/class-variance-authority.mjs";
|
|
4
|
-
const elevationClasses = {
|
|
5
|
-
base: "surface-base",
|
|
6
|
-
elevated: "surface-elevated",
|
|
7
|
-
floating: "surface-floating"
|
|
8
|
-
};
|
|
9
|
-
const paddingClasses = {
|
|
10
|
-
none: "",
|
|
11
|
-
sm: "p-3",
|
|
12
|
-
md: "p-4",
|
|
13
|
-
lg: "p-6"
|
|
14
|
-
};
|
|
15
|
-
const roundedClasses = {
|
|
16
|
-
none: "rounded-none",
|
|
17
|
-
sm: "rounded-sm",
|
|
18
|
-
md: "rounded-md",
|
|
19
|
-
lg: "rounded-lg"
|
|
20
|
-
};
|
|
21
|
-
function CmsSurface({
|
|
22
|
-
elevation = "base",
|
|
23
|
-
padding = "md",
|
|
24
|
-
rounded = "lg",
|
|
25
|
-
className,
|
|
26
|
-
children,
|
|
27
|
-
...props
|
|
28
|
-
}) {
|
|
29
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
30
|
-
"div",
|
|
31
|
-
{
|
|
32
|
-
className: cn(
|
|
33
|
-
elevationClasses[elevation],
|
|
34
|
-
paddingClasses[padding],
|
|
35
|
-
roundedClasses[rounded],
|
|
36
|
-
className
|
|
37
|
-
),
|
|
38
|
-
...props,
|
|
39
|
-
children
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
const alertVariants = cva(
|
|
44
|
-
"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",
|
|
45
|
-
{
|
|
46
|
-
variants: {
|
|
47
|
-
variant: {
|
|
48
|
-
default: "bg-card text-card-foreground",
|
|
49
|
-
destructive: "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
defaultVariants: {
|
|
53
|
-
variant: "default"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
function Alert({
|
|
58
|
-
className,
|
|
59
|
-
variant,
|
|
60
|
-
...props
|
|
61
|
-
}) {
|
|
62
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
"data-slot": "alert",
|
|
66
|
-
role: "alert",
|
|
67
|
-
className: cn(alertVariants({ variant }), className),
|
|
68
|
-
...props
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
function AlertDescription({
|
|
73
|
-
className,
|
|
74
|
-
...props
|
|
75
|
-
}) {
|
|
76
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77
|
-
"div",
|
|
78
|
-
{
|
|
79
|
-
"data-slot": "alert-description",
|
|
80
|
-
className: cn(
|
|
81
|
-
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
82
|
-
className
|
|
83
|
-
),
|
|
84
|
-
...props
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
export {
|
|
89
|
-
Alert as A,
|
|
90
|
-
CmsSurface as C,
|
|
91
|
-
AlertDescription as a
|
|
92
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin-config.d.ts","sourceRoot":"","sources":["../../src/client/admin-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAyCD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAEpF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAE5E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin-config.js","sourceRoot":"","sources":["../../src/client/admin-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACnD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAA8B,CAAC;AAEhC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;IACvD,kBAAkB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAC/C,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACtC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACpC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACzC,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAChD,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC3D,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChE,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC1D,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACtE,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;CACxD,CAAC,CAAC;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAA4B;IAC5D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAA4B;IAC7D,OAAO,iBAAiB,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AAC9C,CAAC"}
|