convex-cms 0.0.5-alpha.5 → 0.0.7-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/README.md +59 -97
  2. package/admin/src/components/ContentEntryEditor.tsx +2 -2
  3. package/admin/src/components/ContentTypeFormModal.tsx +121 -81
  4. package/admin/src/components/fields/ReferenceField.tsx +9 -9
  5. package/admin/src/pages/ContentPage.tsx +11 -19
  6. package/admin/src/pages/ContentTypesPage.tsx +62 -16
  7. package/admin/src/routes/entries/$entryId.tsx +1 -1
  8. package/admin/src/routes/entries/type/$contentTypeId.tsx +1 -1
  9. package/admin-dist/nitro.json +1 -1
  10. package/admin-dist/public/assets/CmsEmptyState-CXVkI3FZ.js +1 -0
  11. package/admin-dist/public/assets/CmsPageHeader-DU9fD34s.js +1 -0
  12. package/admin-dist/public/assets/{CmsStatusBadge-Dd9uToHE.js → CmsStatusBadge-nZ9TeLBL.js} +1 -1
  13. package/admin-dist/public/assets/{CmsSurface-DBy5Lumx.js → CmsSurface-DF7OcKg_.js} +1 -1
  14. package/admin-dist/public/assets/CmsToolbar-5S8FQrSx.js +1 -0
  15. package/admin-dist/public/assets/ContentEntryEditor-BDb44eTo.js +4 -0
  16. package/admin-dist/public/assets/TaxonomyFilter-DEN2Q9Lo.js +1 -0
  17. package/admin-dist/public/assets/_contentTypeId-Ba5iowxH.js +1 -0
  18. package/admin-dist/public/assets/_entryId-OY3sLz6O.js +1 -0
  19. package/admin-dist/public/assets/alert-BbW1Q9CR.js +1 -0
  20. package/admin-dist/public/assets/badge-DdM8Eua8.js +1 -0
  21. package/admin-dist/public/assets/{circle-check-big-CpLxAvEj.js → circle-check-big-B7eCOM8r.js} +1 -1
  22. package/admin-dist/public/assets/command-BIjzeKOv.js +1 -0
  23. package/admin-dist/public/assets/content-BV3YeSSW.js +1 -0
  24. package/admin-dist/public/assets/content-types-Bm4b2tf8.js +1 -0
  25. package/admin-dist/public/assets/globals-D41WzvyZ.css +1 -0
  26. package/admin-dist/public/assets/index-DnJ5Twlv.js +1 -0
  27. package/admin-dist/public/assets/main-BZB1uYTH.js +102 -0
  28. package/admin-dist/public/assets/media-BIMN5jXt.js +1 -0
  29. package/admin-dist/public/assets/new._contentTypeId-DTWb8ZDl.js +1 -0
  30. package/admin-dist/public/assets/pencil-BDQ1ZWRw.js +1 -0
  31. package/admin-dist/public/assets/{rotate-ccw-BZpZtw0N.js → rotate-ccw-BWblSIsl.js} +1 -1
  32. package/admin-dist/public/assets/scroll-area-BoaB6x8v.js +1 -0
  33. package/admin-dist/public/assets/{search-BvgYr-c9.js → search-CYMIpd39.js} +1 -1
  34. package/admin-dist/public/assets/settings-DaNDUtr5.js +1 -0
  35. package/admin-dist/public/assets/switch-DN7TOCa5.js +1 -0
  36. package/admin-dist/public/assets/tabs-RN__emeJ.js +1 -0
  37. package/admin-dist/public/assets/tanstack-adapter-DQcKErwf.js +1 -0
  38. package/admin-dist/public/assets/taxonomies-DylY9HE1.js +1 -0
  39. package/admin-dist/public/assets/trash-Dp_a2mpb.js +1 -0
  40. package/admin-dist/public/assets/{useBreadcrumbLabel-D00rvqjw.js → useBreadcrumbLabel-BQ9dJI6T.js} +1 -1
  41. package/admin-dist/public/assets/usePermissions-WUBNg_Id.js +1 -0
  42. package/admin-dist/server/_chunks/_libs/@date-fns/tz.mjs +2 -2
  43. package/admin-dist/server/_chunks/_libs/@radix-ui/react-avatar.mjs +1 -1
  44. package/admin-dist/server/_chunks/_libs/@radix-ui/react-collection.mjs +1 -1
  45. package/admin-dist/server/_chunks/_libs/@radix-ui/react-context.mjs +2 -2
  46. package/admin-dist/server/_chunks/_libs/@radix-ui/react-dialog.mjs +2 -2
  47. package/admin-dist/server/_chunks/_libs/@radix-ui/react-label.mjs +1 -1
  48. package/admin-dist/server/_chunks/_libs/@radix-ui/react-menu.mjs +1 -1
  49. package/admin-dist/server/_chunks/_libs/@radix-ui/react-popover.mjs +1 -1
  50. package/admin-dist/server/_chunks/_libs/@radix-ui/react-primitive.mjs +6 -72
  51. package/admin-dist/server/_chunks/_libs/@radix-ui/react-select.mjs +1 -1
  52. package/admin-dist/server/_chunks/_libs/@radix-ui/react-separator.mjs +1 -1
  53. package/admin-dist/server/_chunks/_libs/@radix-ui/react-slot.mjs +20 -435
  54. package/admin-dist/server/_chunks/_libs/@radix-ui/react-visually-hidden.mjs +30 -3
  55. package/admin-dist/server/_chunks/_libs/@tanstack/history.mjs +0 -376
  56. package/admin-dist/server/_chunks/_libs/@tanstack/react-router.mjs +168 -383
  57. package/admin-dist/server/_chunks/_libs/@tanstack/router-core.mjs +451 -1195
  58. package/admin-dist/server/_chunks/_libs/react-dom.mjs +5 -5
  59. package/admin-dist/server/_chunks/_libs/react.mjs +2 -2
  60. package/admin-dist/server/_libs/cmdk.mjs +1 -1
  61. package/admin-dist/server/_libs/convex.mjs +3 -3
  62. package/admin-dist/server/_libs/cookie-es.mjs +1 -58
  63. package/admin-dist/server/_libs/date-fns.mjs +1 -1
  64. package/admin-dist/server/_libs/lucide-react.mjs +110 -103
  65. package/admin-dist/server/_libs/seroval-plugins.mjs +1 -58
  66. package/admin-dist/server/_libs/seroval.mjs +1 -1765
  67. package/admin-dist/server/_libs/zod.mjs +1 -1
  68. package/admin-dist/server/_ssr/CmsEmptyState-DYh_PPQE.mjs +38 -0
  69. package/admin-dist/server/_ssr/{CmsPageHeader-ClNPU7Up.mjs → CmsPageHeader-BcniLh49.mjs} +1 -1
  70. package/admin-dist/server/_ssr/{CmsStatusBadge-CojMbrY7.mjs → CmsStatusBadge-BShWDxwE.mjs} +2 -2
  71. package/admin-dist/server/_ssr/{CmsSurface-Dcv440rp.mjs → CmsSurface-CHEv-Kba.mjs} +1 -1
  72. package/admin-dist/server/_ssr/{CmsToolbar-BKv1nL6u.mjs → CmsToolbar-Dqqb216_.mjs} +2 -3
  73. package/admin-dist/server/_ssr/{ContentEntryEditor-weiXSBdZ.mjs → ContentEntryEditor-DOIAyWME.mjs} +18 -21
  74. package/admin-dist/server/_ssr/{TaxonomyFilter-BPQ57Mwk.mjs → TaxonomyFilter-BfsPAZ-Y.mjs} +4 -5
  75. package/admin-dist/server/_ssr/{_contentTypeId-DyyauLOs.mjs → _contentTypeId-CPjmri90.mjs} +34 -43
  76. package/admin-dist/server/_ssr/{_entryId-9Cafwxmw.mjs → _entryId-D0yu8HuP.mjs} +35 -47
  77. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-DgCpSt_y.mjs +4 -0
  78. package/admin-dist/server/_ssr/badge-Cp61aQNc.mjs +39 -0
  79. package/admin-dist/server/_ssr/{command-CEf8YBxY.mjs → command-BfjE1WJf.mjs} +2 -2
  80. package/admin-dist/server/_ssr/{config.server-D7JHDcDv.mjs → config.server-BOr7Jxr4.mjs} +5 -14
  81. package/admin-dist/server/_ssr/{content-ZFWVzO25.mjs → content-DrODe6sA.mjs} +40 -49
  82. package/admin-dist/server/_ssr/content-types-BPgMwxiT.mjs +459 -0
  83. package/admin-dist/server/_ssr/{index-BlSIlH4Z.mjs → index-BTHmIC9W.mjs} +26 -28
  84. package/admin-dist/server/_ssr/index.mjs +3459 -62
  85. package/admin-dist/server/_ssr/{media-CD2_NUMw.mjs → media-DkvBfmD9.mjs} +31 -43
  86. package/admin-dist/server/_ssr/{new._contentTypeId-dmZy6PBX.mjs → new._contentTypeId-Co_73sDJ.mjs} +33 -45
  87. package/admin-dist/server/_ssr/router-CaDgRHfQ.mjs +3031 -0
  88. package/admin-dist/server/_ssr/{scroll-area-BH_1K-WT.mjs → scroll-area-D3v-O_jk.mjs} +1 -1
  89. package/admin-dist/server/_ssr/{settings-DVdsoWoh.mjs → settings-MaEXh2Hz.mjs} +30 -39
  90. package/admin-dist/server/_ssr/{switch-DX_X8vZl.mjs → switch-DmbR03dm.mjs} +1 -1
  91. package/admin-dist/server/_ssr/{tabs-4FWM0sn8.mjs → tabs-5oFlAGLz.mjs} +2 -3
  92. package/admin-dist/server/_ssr/{tanstack-adapter-D3ZcKtbY.mjs → tanstack-adapter-DNaUioIZ.mjs} +1 -1
  93. package/admin-dist/server/_ssr/{taxonomies-BHFfO9Yr.mjs → taxonomies-D3xMK23a.mjs} +30 -39
  94. package/admin-dist/server/_ssr/{trash-9tUB2KwI.mjs → trash-CNw1mtF1.mjs} +30 -39
  95. package/admin-dist/server/_ssr/{useBreadcrumbLabel-DVme3DSb.mjs → useBreadcrumbLabel-BQGjOTcy.mjs} +1 -1
  96. package/admin-dist/server/_ssr/{usePermissions-zAQj-ruE.mjs → usePermissions-D0qtvmNi.mjs} +1 -1
  97. package/admin-dist/server/index.mjs +162 -204
  98. package/dist/cli/templates/cmsClient.d.ts +1 -1
  99. package/dist/cli/templates/cmsClient.d.ts.map +1 -1
  100. package/dist/cli/templates/cmsClient.js +30 -11
  101. package/dist/cli/templates/cmsClient.js.map +1 -1
  102. package/dist/cli/templates/cmsConfig.d.ts +1 -1
  103. package/dist/cli/templates/cmsConfig.d.ts.map +1 -1
  104. package/dist/cli/templates/cmsConfig.js +3 -3
  105. package/dist/client/admin/contentLock.d.ts +4 -4
  106. package/dist/client/admin/contentLock.d.ts.map +1 -1
  107. package/dist/client/admin/contentLock.js +1 -1
  108. package/dist/client/admin/contentLock.js.map +1 -1
  109. package/dist/client/admin/contentTypes.d.ts +303 -290
  110. package/dist/client/admin/contentTypes.d.ts.map +1 -1
  111. package/dist/client/admin/contentTypes.js +101 -9
  112. package/dist/client/admin/contentTypes.js.map +1 -1
  113. package/dist/client/admin/entries.d.ts +18 -19
  114. package/dist/client/admin/entries.d.ts.map +1 -1
  115. package/dist/client/admin/entries.js +6 -8
  116. package/dist/client/admin/entries.js.map +1 -1
  117. package/dist/client/admin/index.d.ts +690 -642
  118. package/dist/client/admin/index.d.ts.map +1 -1
  119. package/dist/client/admin/index.js +29 -5
  120. package/dist/client/admin/index.js.map +1 -1
  121. package/dist/client/admin/media.d.ts.map +1 -1
  122. package/dist/client/admin/taxonomies.d.ts.map +1 -1
  123. package/dist/client/admin/trash.d.ts +3 -4
  124. package/dist/client/admin/trash.d.ts.map +1 -1
  125. package/dist/client/admin/types.d.ts +181 -4
  126. package/dist/client/admin/types.d.ts.map +1 -1
  127. package/dist/client/admin/validators.d.ts +2009 -25
  128. package/dist/client/admin/validators.d.ts.map +1 -1
  129. package/dist/client/admin/validators.js +15 -4
  130. package/dist/client/admin/validators.js.map +1 -1
  131. package/dist/client/admin/versions.d.ts +1 -1
  132. package/dist/client/admin/versions.d.ts.map +1 -1
  133. package/dist/client/agentTools.d.ts +1 -4
  134. package/dist/client/agentTools.d.ts.map +1 -1
  135. package/dist/client/agentTools.js +9 -21
  136. package/dist/client/agentTools.js.map +1 -1
  137. package/dist/client/config.d.ts +10 -0
  138. package/dist/client/config.d.ts.map +1 -1
  139. package/dist/client/config.js +1 -0
  140. package/dist/client/config.js.map +1 -1
  141. package/dist/client/defineContent.d.ts +338 -0
  142. package/dist/client/defineContent.d.ts.map +1 -0
  143. package/dist/client/defineContent.js +368 -0
  144. package/dist/client/defineContent.js.map +1 -0
  145. package/dist/client/index.d.ts +2 -0
  146. package/dist/client/index.d.ts.map +1 -1
  147. package/dist/client/index.js +2 -0
  148. package/dist/client/index.js.map +1 -1
  149. package/dist/client/queryBuilder.d.ts +0 -15
  150. package/dist/client/queryBuilder.d.ts.map +1 -1
  151. package/dist/client/queryBuilder.js +0 -23
  152. package/dist/client/queryBuilder.js.map +1 -1
  153. package/dist/client/registry.d.ts +77 -0
  154. package/dist/client/registry.d.ts.map +1 -0
  155. package/dist/client/registry.js +95 -0
  156. package/dist/client/registry.js.map +1 -0
  157. package/dist/client/schema/defineContentType.d.ts +36 -24
  158. package/dist/client/schema/defineContentType.d.ts.map +1 -1
  159. package/dist/client/schema/defineContentType.js +77 -48
  160. package/dist/client/schema/defineContentType.js.map +1 -1
  161. package/dist/client/schema/typedClient.d.ts.map +1 -1
  162. package/dist/client/schema/typedClient.js +2 -10
  163. package/dist/client/schema/typedClient.js.map +1 -1
  164. package/dist/client/schema/types.d.ts +16 -9
  165. package/dist/client/schema/types.d.ts.map +1 -1
  166. package/dist/client/schema/types.js.map +1 -1
  167. package/dist/client/utils/toSlug.d.ts +60 -0
  168. package/dist/client/utils/toSlug.d.ts.map +1 -0
  169. package/dist/client/utils/toSlug.js +31 -0
  170. package/dist/client/utils/toSlug.js.map +1 -0
  171. package/dist/client/wrapper.d.ts +2 -2
  172. package/dist/client/wrapper.d.ts.map +1 -1
  173. package/dist/client/wrapper.js +22 -30
  174. package/dist/client/wrapper.js.map +1 -1
  175. package/dist/component/_generated/component.d.ts +24 -28
  176. package/dist/component/_generated/component.d.ts.map +1 -1
  177. package/dist/component/authorizationHooks.d.ts +1 -1
  178. package/dist/component/authorizationHooks.d.ts.map +1 -1
  179. package/dist/component/authorizationHooks.js +2 -2
  180. package/dist/component/authorizationHooks.js.map +1 -1
  181. package/dist/component/bulkOperations.d.ts.map +1 -1
  182. package/dist/component/bulkOperations.js +7 -4
  183. package/dist/component/bulkOperations.js.map +1 -1
  184. package/dist/component/contentEntries.d.ts +18 -56
  185. package/dist/component/contentEntries.d.ts.map +1 -1
  186. package/dist/component/contentEntries.js +45 -137
  187. package/dist/component/contentEntries.js.map +1 -1
  188. package/dist/component/contentEntryMutations.d.ts +14 -14
  189. package/dist/component/contentEntryMutations.d.ts.map +1 -1
  190. package/dist/component/contentEntryMutations.js +40 -43
  191. package/dist/component/contentEntryMutations.js.map +1 -1
  192. package/dist/component/contentEntryValidation.d.ts +3 -3
  193. package/dist/component/contentEntryValidation.js +6 -9
  194. package/dist/component/contentEntryValidation.js.map +1 -1
  195. package/dist/component/contentLock.d.ts +7 -7
  196. package/dist/component/contentLock.js +3 -3
  197. package/dist/component/contentLock.js.map +1 -1
  198. package/dist/component/contentTypeMigration.d.ts +1 -1
  199. package/dist/component/contentTypeMigration.js +2 -2
  200. package/dist/component/contentTypeMigration.js.map +1 -1
  201. package/dist/component/contentTypeMutations.js +2 -2
  202. package/dist/component/contentTypeMutations.js.map +1 -1
  203. package/dist/component/convex.config.d.ts.map +1 -1
  204. package/dist/component/convex.config.js +1 -1
  205. package/dist/component/convex.config.js.map +1 -1
  206. package/dist/component/eventEmitter.d.ts +0 -1
  207. package/dist/component/eventEmitter.d.ts.map +1 -1
  208. package/dist/component/eventEmitter.js.map +1 -1
  209. package/dist/component/exportImport.d.ts +37 -37
  210. package/dist/component/exportImport.d.ts.map +1 -1
  211. package/dist/component/exportImport.js +34 -34
  212. package/dist/component/exportImport.js.map +1 -1
  213. package/dist/component/lib/deepReferenceResolver.d.ts +2 -2
  214. package/dist/component/lib/deepReferenceResolver.d.ts.map +1 -1
  215. package/dist/component/lib/deepReferenceResolver.js +13 -8
  216. package/dist/component/lib/deepReferenceResolver.js.map +1 -1
  217. package/dist/component/lib/ragContentChunker.d.ts +3 -3
  218. package/dist/component/lib/ragContentChunker.d.ts.map +1 -1
  219. package/dist/component/lib/ragContentChunker.js +4 -4
  220. package/dist/component/lib/ragContentChunker.js.map +1 -1
  221. package/dist/component/lib/referenceResolver.d.ts.map +1 -1
  222. package/dist/component/lib/referenceResolver.js +10 -17
  223. package/dist/component/lib/referenceResolver.js.map +1 -1
  224. package/dist/component/mediaAssetMutations.js +4 -4
  225. package/dist/component/mediaAssetMutations.js.map +1 -1
  226. package/dist/component/ragContentIndexer.d.ts +2 -2
  227. package/dist/component/ragContentIndexer.d.ts.map +1 -1
  228. package/dist/component/ragContentIndexer.js +44 -48
  229. package/dist/component/ragContentIndexer.js.map +1 -1
  230. package/dist/component/roles.d.ts +3 -3
  231. package/dist/component/scheduledPublish.d.ts +4 -4
  232. package/dist/component/scheduledPublish.js +3 -3
  233. package/dist/component/scheduledPublish.js.map +1 -1
  234. package/dist/component/schema.d.ts +18 -18
  235. package/dist/component/schema.js +5 -5
  236. package/dist/component/schema.js.map +1 -1
  237. package/dist/component/trash.d.ts +6 -9
  238. package/dist/component/trash.d.ts.map +1 -1
  239. package/dist/component/trash.js +12 -36
  240. package/dist/component/trash.js.map +1 -1
  241. package/dist/component/userContext.d.ts +1 -2
  242. package/dist/component/userContext.d.ts.map +1 -1
  243. package/dist/component/userContext.js +1 -2
  244. package/dist/component/userContext.js.map +1 -1
  245. package/dist/component/validators.d.ts +27 -33
  246. package/dist/component/validators.d.ts.map +1 -1
  247. package/dist/component/validators.js +3 -5
  248. package/dist/component/validators.js.map +1 -1
  249. package/dist/component/versionMutations.d.ts +1 -1
  250. package/dist/component/webhookTrigger.d.ts +14 -14
  251. package/dist/test.d.ts +30 -30
  252. package/dist/test.d.ts.map +1 -1
  253. package/dist/test.js +24 -24
  254. package/dist/test.js.map +1 -1
  255. package/package.json +1 -1
  256. package/admin-dist/public/assets/CmsEmptyState-Do_erIgn.js +0 -5
  257. package/admin-dist/public/assets/CmsPageHeader-qDwPGi48.js +0 -1
  258. package/admin-dist/public/assets/CmsToolbar-D1-Y-7SK.js +0 -1
  259. package/admin-dist/public/assets/ContentEntryEditor-CWBiIx52.js +0 -4
  260. package/admin-dist/public/assets/TaxonomyFilter-CdYQawxb.js +0 -1
  261. package/admin-dist/public/assets/_contentTypeId-D9VMP6Gs.js +0 -1
  262. package/admin-dist/public/assets/_entryId-2FlCfqE7.js +0 -1
  263. package/admin-dist/public/assets/alert-GxZx0y5c.js +0 -1
  264. package/admin-dist/public/assets/badge-BAlGIjop.js +0 -1
  265. package/admin-dist/public/assets/command-di7XCqcv.js +0 -1
  266. package/admin-dist/public/assets/content-D8zELsDG.js +0 -1
  267. package/admin-dist/public/assets/content-types-BmzD0krT.js +0 -2
  268. package/admin-dist/public/assets/globals-BvFfH-v9.css +0 -1
  269. package/admin-dist/public/assets/index-zqfj4T_v.js +0 -1
  270. package/admin-dist/public/assets/label-B6PPtKR5.js +0 -1
  271. package/admin-dist/public/assets/link-2-W2fVnVOf.js +0 -1
  272. package/admin-dist/public/assets/list-F8O0lZXC.js +0 -1
  273. package/admin-dist/public/assets/main-dZT72bAG.js +0 -97
  274. package/admin-dist/public/assets/media-CETueFbV.js +0 -1
  275. package/admin-dist/public/assets/new._contentTypeId-BV2-TyyR.js +0 -1
  276. package/admin-dist/public/assets/plus-AABQIF0N.js +0 -1
  277. package/admin-dist/public/assets/scroll-area-CDfk-zrz.js +0 -1
  278. package/admin-dist/public/assets/select-BuiHcMzS.js +0 -1
  279. package/admin-dist/public/assets/settings-DBxbYDvn.js +0 -1
  280. package/admin-dist/public/assets/switch-DiJvolcs.js +0 -1
  281. package/admin-dist/public/assets/tabs-Cgz6G_Xy.js +0 -1
  282. package/admin-dist/public/assets/tanstack-adapter-BknsSgra.js +0 -1
  283. package/admin-dist/public/assets/taxonomies-DOErsLl5.js +0 -1
  284. package/admin-dist/public/assets/textarea-CgggMxUX.js +0 -1
  285. package/admin-dist/public/assets/trash-BU4ANuaW.js +0 -1
  286. package/admin-dist/public/assets/triangle-alert-lvCbwp0s.js +0 -1
  287. package/admin-dist/public/assets/usePermissions-D7tQowaF.js +0 -1
  288. package/admin-dist/server/_libs/h3-v2.mjs +0 -277
  289. package/admin-dist/server/_ssr/CmsButton-DbzfJru_.mjs +0 -125
  290. package/admin-dist/server/_ssr/CmsEmptyState-CuvcXr3Z.mjs +0 -290
  291. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-Dk-FIYPN.mjs +0 -4
  292. package/admin-dist/server/_ssr/content-types-D25lUE-j.mjs +0 -1312
  293. package/admin-dist/server/_ssr/label-PblVvdRv.mjs +0 -22
  294. package/admin-dist/server/_ssr/router-x6Ab8T4s.mjs +0 -1622
  295. package/admin-dist/server/_ssr/select-CrfEkFJw.mjs +0 -142
  296. package/admin-dist/server/_ssr/textarea-CZVaroMc.mjs +0 -18
@@ -1,1622 +0,0 @@
1
- import { c as createRouter, a as createRootRoute, b as createFileRoute, l as lazyRouteComponent, O as Outlet, H as HeadContent, S as Scripts, u as useRouterState, L as Link, d as useNavigate } from "../_chunks/_libs/@tanstack/react-router.mjs";
2
- import { r as reactExports, j as jsxRuntimeExports } from "../_chunks/_libs/react.mjs";
3
- import { c as clsx } from "../_libs/clsx.mjs";
4
- import { t as twMerge } from "../_libs/tailwind-merge.mjs";
5
- import { R as Root$1, C as CollapsibleTrigger$1, a as CollapsibleContent$1 } from "../_chunks/_libs/@radix-ui/react-collapsible.mjs";
6
- import { S as Slot } from "../_chunks/_libs/@radix-ui/react-slot.mjs";
7
- import { R as Root2$1, T as Trigger$1, P as Portal2, C as Content2$1, L as Label2, S as Separator2, I as Item2 } from "../_chunks/_libs/@radix-ui/react-dropdown-menu.mjs";
8
- import { R as Root, I as Image, F as Fallback } from "../_chunks/_libs/@radix-ui/react-avatar.mjs";
9
- import { c as cva } from "../_libs/class-variance-authority.mjs";
10
- import { R as Root2, T as Trigger, P as Portal, C as Content2 } from "../_chunks/_libs/@radix-ui/react-popover.mjs";
11
- import { c as createServerFn, T as TSS_SERVER_FUNCTION, g as getServerFnById } from "./index.mjs";
12
- import { v, c as componentsGeneric, C as ConvexReactClient, a as ConvexProvider, u as useQuery, b as anyApi } from "../_libs/convex.mjs";
13
- import { L as LoaderCircle, a as Layers, H as House, B as Bell, C as CircleQuestionMark, b as Book, c as Code, M as MessageSquare, E as ExternalLink, d as ChevronDown, U as User, e as LogOut, f as ChevronRight, g as CircleAlert, h as Eye, S as SquarePen, A as Archive, i as Bookmark, F as Flag, j as Heart, k as Star, P as Package, l as Phone, m as Mail, D as DollarSign, n as MapPin, o as Folder, p as Braces, q as SquareCheckBig, T as ToggleLeft, r as Hash, s as Link$1, t as Clock, u as Calendar, G as Globe, v as Lock, w as Trash2, x as Settings, y as FileCode, z as Tags, I as Image$1, J as FileText, K as LayoutDashboard } from "../_libs/lucide-react.mjs";
14
- import { o as object, b as boolean, s as string, _ as _enum, n as number, a as array, r as record } from "../_libs/zod.mjs";
15
- import "../_libs/tiny-warning.mjs";
16
- import "../_chunks/_libs/@tanstack/router-core.mjs";
17
- import "../_libs/cookie-es.mjs";
18
- import "../_chunks/_libs/@tanstack/store.mjs";
19
- import "../_chunks/_libs/@tanstack/history.mjs";
20
- import "../_libs/tiny-invariant.mjs";
21
- import "../_libs/seroval.mjs";
22
- import "../_libs/seroval-plugins.mjs";
23
- import "node:stream/web";
24
- import "node:stream";
25
- import "../_chunks/_libs/react-dom.mjs";
26
- import "util";
27
- import "crypto";
28
- import "async_hooks";
29
- import "stream";
30
- import "../_libs/isbot.mjs";
31
- import "../_chunks/_libs/@tanstack/react-store.mjs";
32
- import "../_libs/use-sync-external-store.mjs";
33
- import "../_chunks/_libs/@radix-ui/primitive.mjs";
34
- import "../_chunks/_libs/@radix-ui/react-context.mjs";
35
- import "../_chunks/_libs/@radix-ui/react-use-controllable-state.mjs";
36
- import "../_chunks/_libs/@radix-ui/react-use-layout-effect.mjs";
37
- import "../_chunks/_libs/@radix-ui/react-compose-refs.mjs";
38
- import "../_chunks/_libs/@radix-ui/react-primitive.mjs";
39
- import "../_chunks/_libs/@radix-ui/react-presence.mjs";
40
- import "../_chunks/_libs/@radix-ui/react-id.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-roving-focus.mjs";
58
- import "../_libs/aria-hidden.mjs";
59
- import "../_libs/react-remove-scroll.mjs";
60
- import "../_libs/tslib.mjs";
61
- import "../_libs/react-remove-scroll-bar.mjs";
62
- import "../_libs/react-style-singleton.mjs";
63
- import "../_libs/get-nonce.mjs";
64
- import "../_libs/use-sidecar.mjs";
65
- import "../_libs/use-callback-ref.mjs";
66
- import "../_chunks/_libs/@radix-ui/react-use-is-hydrated.mjs";
67
- import "node:async_hooks";
68
- import "../_libs/h3-v2.mjs";
69
- import "../_libs/rou3.mjs";
70
- import "../_libs/srvx.mjs";
71
- import "node:http";
72
- import "node:https";
73
- import "node:http2";
74
- const globalsCss = "/assets/globals-BvFfH-v9.css";
75
- function cn(...inputs) {
76
- return twMerge(clsx(inputs));
77
- }
78
- v.union(
79
- v.literal("admin"),
80
- v.literal("editor"),
81
- v.literal("author"),
82
- v.literal("viewer")
83
- );
84
- const resourceValidator = v.union(
85
- v.literal("contentTypes"),
86
- v.literal("contentEntries"),
87
- v.literal("mediaItems"),
88
- v.literal("settings")
89
- );
90
- const actionValidator = v.union(
91
- v.literal("create"),
92
- v.literal("read"),
93
- v.literal("update"),
94
- v.literal("delete"),
95
- v.literal("publish"),
96
- v.literal("unpublish"),
97
- v.literal("restore"),
98
- v.literal("manage"),
99
- v.literal("move")
100
- );
101
- v.object({
102
- resource: resourceValidator,
103
- action: actionValidator,
104
- scope: v.optional(v.union(v.literal("all"), v.literal("own")))
105
- });
106
- function fullCrud(resource, scope = "all") {
107
- return [
108
- { resource, action: "create", scope },
109
- { resource, action: "read", scope },
110
- { resource, action: "update", scope },
111
- { resource, action: "delete", scope }
112
- ];
113
- }
114
- function readOnly(resource, scope = "all") {
115
- return [{ resource, action: "read", scope }];
116
- }
117
- function publishPermissions(scope = "all") {
118
- return [
119
- { resource: "contentEntries", action: "publish", scope },
120
- { resource: "contentEntries", action: "unpublish", scope }
121
- ];
122
- }
123
- const ADMIN_ROLE = {
124
- name: "admin",
125
- displayName: "Administrator",
126
- description: "Full access to all CMS features including settings and content type management",
127
- isSystem: true,
128
- permissions: [
129
- // Content types - full management
130
- ...fullCrud("contentTypes"),
131
- // Content entries - full CRUD + publish
132
- ...fullCrud("contentEntries"),
133
- ...publishPermissions(),
134
- { resource: "contentEntries", action: "restore" },
135
- // Media - full management
136
- ...fullCrud("mediaItems"),
137
- // Settings - full access
138
- { resource: "settings", action: "manage" },
139
- ...readOnly("settings")
140
- ]
141
- };
142
- const EDITOR_ROLE = {
143
- name: "editor",
144
- displayName: "Editor",
145
- description: "Can manage all content and media, but cannot modify settings or content types",
146
- isSystem: true,
147
- permissions: [
148
- // Content types - read only
149
- ...readOnly("contentTypes"),
150
- // Content entries - full CRUD + publish
151
- ...fullCrud("contentEntries"),
152
- ...publishPermissions(),
153
- { resource: "contentEntries", action: "restore" },
154
- // Media - full management
155
- ...fullCrud("mediaItems")
156
- ]
157
- };
158
- const AUTHOR_ROLE = {
159
- name: "author",
160
- displayName: "Author",
161
- description: "Can create and manage own content and media",
162
- isSystem: true,
163
- permissions: [
164
- // Content types - read only
165
- ...readOnly("contentTypes"),
166
- // Content entries - own content only
167
- { resource: "contentEntries", action: "create" },
168
- { resource: "contentEntries", action: "read", scope: "own" },
169
- { resource: "contentEntries", action: "update", scope: "own" },
170
- { resource: "contentEntries", action: "delete", scope: "own" },
171
- // Authors can publish/unpublish their own content
172
- { resource: "contentEntries", action: "publish", scope: "own" },
173
- { resource: "contentEntries", action: "unpublish", scope: "own" },
174
- // Media - can create and manage own, read all (for embedding)
175
- { resource: "mediaItems", action: "create" },
176
- { resource: "mediaItems", action: "read", scope: "all" },
177
- // Can read all for embedding
178
- { resource: "mediaItems", action: "update", scope: "own" },
179
- { resource: "mediaItems", action: "delete", scope: "own" }
180
- ]
181
- };
182
- const VIEWER_ROLE = {
183
- name: "viewer",
184
- displayName: "Viewer",
185
- description: "Read-only access to published content and media",
186
- isSystem: true,
187
- permissions: [
188
- // Content types - read only
189
- ...readOnly("contentTypes"),
190
- // Content entries - read published only (scope: "all" means all published)
191
- ...readOnly("contentEntries"),
192
- // Media - read only
193
- ...readOnly("mediaItems")
194
- ]
195
- };
196
- const DEFAULT_ROLES = {
197
- admin: ADMIN_ROLE,
198
- editor: EDITOR_ROLE,
199
- author: AUTHOR_ROLE,
200
- viewer: VIEWER_ROLE
201
- };
202
- function permissionMatches(granted, requested) {
203
- if (granted.resource !== requested.resource || granted.action !== requested.action) {
204
- return false;
205
- }
206
- const grantedScope = granted.scope ?? "all";
207
- const requestedScope = requested.scope ?? "all";
208
- if (grantedScope === "all") {
209
- return true;
210
- }
211
- return requestedScope === "own";
212
- }
213
- function hasPermission(roleName, permission, customRoles) {
214
- const role = DEFAULT_ROLES[roleName] ?? customRoles?.[roleName];
215
- if (!role) {
216
- return false;
217
- }
218
- return role.permissions.some((p) => permissionMatches(p, permission));
219
- }
220
- function getRolePermissions(roleName, customRoles) {
221
- const role = DEFAULT_ROLES[roleName] ?? customRoles?.[roleName];
222
- return role?.permissions ?? [];
223
- }
224
- function getRole(roleName, customRoles) {
225
- return DEFAULT_ROLES[roleName] ?? customRoles?.[roleName];
226
- }
227
- function getResourcePermissions(roleName, resource, customRoles) {
228
- return getRolePermissions(roleName, customRoles).filter(
229
- (p) => p.resource === resource
230
- );
231
- }
232
- function canAccessResource(roleName, resource, customRoles) {
233
- return getResourcePermissions(roleName, resource, customRoles).length > 0;
234
- }
235
- const AuthContext = reactExports.createContext(null);
236
- function AuthProvider({
237
- children,
238
- getUser,
239
- getUserRole,
240
- onLogout,
241
- autoRedirectToLogin = false,
242
- loginUrl = "/login"
243
- }) {
244
- const [user, setUser] = reactExports.useState(null);
245
- const [role, setRole] = reactExports.useState(null);
246
- const [authState, setAuthState] = reactExports.useState("loading");
247
- const [error, setError] = reactExports.useState(null);
248
- const loadAuth = reactExports.useCallback(async () => {
249
- setAuthState("loading");
250
- setError(null);
251
- try {
252
- const currentUser = await getUser();
253
- if (!currentUser) {
254
- setUser(null);
255
- setRole(null);
256
- setAuthState("unauthenticated");
257
- if (autoRedirectToLogin && typeof window !== "undefined") {
258
- window.location.href = loginUrl;
259
- }
260
- return;
261
- }
262
- const userRole = await getUserRole({ userId: currentUser.id });
263
- setUser(currentUser);
264
- setRole(userRole);
265
- setAuthState("authenticated");
266
- } catch (err) {
267
- console.error("Authentication error:", err);
268
- setUser(null);
269
- setRole(null);
270
- setError(err instanceof Error ? err.message : "Authentication failed");
271
- setAuthState("error");
272
- }
273
- }, [getUser, getUserRole, autoRedirectToLogin, loginUrl]);
274
- reactExports.useEffect(() => {
275
- loadAuth();
276
- }, [loadAuth]);
277
- const checkPermission = reactExports.useCallback(
278
- (permission) => {
279
- if (!role) {
280
- return false;
281
- }
282
- return hasPermission(role, permission);
283
- },
284
- [role]
285
- );
286
- const logout = reactExports.useCallback(async () => {
287
- try {
288
- if (onLogout) {
289
- await onLogout();
290
- }
291
- setUser(null);
292
- setRole(null);
293
- setAuthState("unauthenticated");
294
- if (autoRedirectToLogin && typeof window !== "undefined") {
295
- window.location.href = loginUrl;
296
- }
297
- } catch (err) {
298
- console.error("Logout error:", err);
299
- setError(err instanceof Error ? err.message : "Logout failed");
300
- }
301
- }, [onLogout, autoRedirectToLogin, loginUrl]);
302
- const refresh = reactExports.useCallback(async () => {
303
- await loadAuth();
304
- }, [loadAuth]);
305
- const value = {
306
- user,
307
- role,
308
- authState,
309
- isLoading: authState === "loading",
310
- isAuthenticated: authState === "authenticated",
311
- error,
312
- checkPermission,
313
- logout,
314
- refresh
315
- };
316
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AuthContext.Provider, { value, children });
317
- }
318
- function useAuth() {
319
- const context = reactExports.useContext(AuthContext);
320
- if (!context) {
321
- throw new Error("useAuth must be used within an AuthProvider");
322
- }
323
- return context;
324
- }
325
- const ThemeContext = reactExports.createContext(null);
326
- const STORAGE_KEY = "convex-cms-theme";
327
- function getSystemTheme() {
328
- if (typeof window === "undefined") return "light";
329
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
330
- }
331
- function getStoredTheme() {
332
- if (typeof window === "undefined") return "system";
333
- const stored = localStorage.getItem(STORAGE_KEY);
334
- if (stored === "light" || stored === "dark" || stored === "system") {
335
- return stored;
336
- }
337
- return "system";
338
- }
339
- function ThemeProvider({ children }) {
340
- const [theme, setThemeState] = reactExports.useState(() => getStoredTheme());
341
- const [resolvedTheme, setResolvedTheme] = reactExports.useState(() => {
342
- const stored = getStoredTheme();
343
- return stored === "system" ? getSystemTheme() : stored;
344
- });
345
- const applyTheme = reactExports.useCallback((newTheme) => {
346
- const resolved = newTheme === "system" ? getSystemTheme() : newTheme;
347
- setResolvedTheme(resolved);
348
- const root = document.documentElement;
349
- root.classList.remove("light", "dark");
350
- root.classList.add(resolved);
351
- }, []);
352
- const setTheme = reactExports.useCallback(
353
- (newTheme) => {
354
- setThemeState(newTheme);
355
- localStorage.setItem(STORAGE_KEY, newTheme);
356
- applyTheme(newTheme);
357
- },
358
- [applyTheme]
359
- );
360
- reactExports.useEffect(() => {
361
- applyTheme(theme);
362
- }, [theme, applyTheme]);
363
- reactExports.useEffect(() => {
364
- const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
365
- const handleChange = () => {
366
- if (theme === "system") {
367
- applyTheme("system");
368
- }
369
- };
370
- mediaQuery.addEventListener("change", handleChange);
371
- return () => mediaQuery.removeEventListener("change", handleChange);
372
- }, [theme, applyTheme]);
373
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeContext.Provider, { value: { theme, resolvedTheme, setTheme }, children });
374
- }
375
- function useTheme() {
376
- const context = reactExports.useContext(ThemeContext);
377
- if (!context) {
378
- throw new Error("useTheme must be used within a ThemeProvider");
379
- }
380
- return context;
381
- }
382
- const navItemSchema = object({
383
- id: string(),
384
- path: string(),
385
- label: string(),
386
- icon: string(),
387
- visible: boolean().default(true),
388
- section: _enum(["main", "config"]).default("main"),
389
- badge: string().optional(),
390
- exact: boolean().optional()
391
- });
392
- const brandingSchema = object({
393
- appName: string().default("Convex CMS"),
394
- logo: string().optional(),
395
- favicon: string().optional()
396
- });
397
- const layoutSchema = object({
398
- sidebarWidth: number().min(200).max(400).default(256),
399
- sidebarCollapsible: boolean().default(false)
400
- });
401
- const navigationSchema = object({
402
- showDashboard: boolean().default(true),
403
- showContent: boolean().default(true),
404
- showMedia: boolean().default(true),
405
- showTaxonomies: boolean().default(true),
406
- showContentTypes: boolean().default(true),
407
- showTrash: boolean().default(true),
408
- showSettings: boolean().default(true),
409
- customItems: array(navItemSchema).default([])
410
- });
411
- const themeSchema = object({
412
- mode: _enum(["light", "dark", "system"]).default("system"),
413
- allowModeSwitch: boolean().default(true),
414
- tokens: record(string(), string()).optional()
415
- });
416
- const adminConfigSchema = object({
417
- branding: brandingSchema.default(() => brandingSchema.parse({})),
418
- layout: layoutSchema.default(() => layoutSchema.parse({})),
419
- navigation: navigationSchema.default(() => navigationSchema.parse({})),
420
- theme: themeSchema.default(() => themeSchema.parse({}))
421
- });
422
- const DEFAULT_NAV_ITEMS = [
423
- {
424
- id: "dashboard",
425
- path: "/",
426
- label: "Dashboard",
427
- icon: "LayoutDashboard",
428
- section: "main",
429
- exact: true
430
- },
431
- { id: "content", path: "/content", label: "Content", icon: "FileText", section: "main" },
432
- { id: "media", path: "/media", label: "Media", icon: "Image", section: "main" },
433
- { id: "taxonomies", path: "/taxonomies", label: "Taxonomies", icon: "Tags", section: "main" },
434
- {
435
- id: "content-types",
436
- path: "/content-types",
437
- label: "Content Types",
438
- icon: "Layers",
439
- section: "config"
440
- },
441
- { id: "trash", path: "/trash", label: "Trash", icon: "Trash2", section: "config" },
442
- { id: "settings", path: "/settings", label: "Settings", icon: "Settings", section: "config" }
443
- ];
444
- function resolveAdminConfig(input) {
445
- return adminConfigSchema.parse(input ?? {});
446
- }
447
- function getVisibleNavItems(config) {
448
- const visibilityMap = {
449
- dashboard: config.navigation.showDashboard,
450
- content: config.navigation.showContent,
451
- media: config.navigation.showMedia,
452
- taxonomies: config.navigation.showTaxonomies,
453
- "content-types": config.navigation.showContentTypes,
454
- trash: config.navigation.showTrash,
455
- settings: config.navigation.showSettings
456
- };
457
- const filtered = DEFAULT_NAV_ITEMS.filter((item) => visibilityMap[item.id] !== false);
458
- const allItems = [...filtered, ...config.navigation.customItems.filter((i) => i.visible !== false)];
459
- return {
460
- main: allItems.filter((i) => i.section === "main"),
461
- config: allItems.filter((i) => i.section === "config")
462
- };
463
- }
464
- const AdminConfigContext = reactExports.createContext(null);
465
- function AdminConfigProvider({
466
- config,
467
- children
468
- }) {
469
- const navItems = getVisibleNavItems(config);
470
- const value = { ...config, navItems };
471
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AdminConfigContext.Provider, { value, children });
472
- }
473
- function useAdminConfig() {
474
- const config = reactExports.useContext(AdminConfigContext);
475
- if (!config) {
476
- throw new Error("useAdminConfig must be used within AdminConfigProvider");
477
- }
478
- return config;
479
- }
480
- const api = anyApi;
481
- componentsGeneric();
482
- const SettingsConfigContext = reactExports.createContext(null);
483
- function SettingsConfigProvider({
484
- baseConfig,
485
- children
486
- }) {
487
- const settings = useQuery(api.admin.getSettings);
488
- const mergedConfig = reactExports.useMemo(() => {
489
- if (!settings) return baseConfig;
490
- return {
491
- ...baseConfig,
492
- navigation: {
493
- ...baseConfig.navigation,
494
- showMedia: baseConfig.navigation.showMedia && settings.features.mediaManagement
495
- }
496
- };
497
- }, [baseConfig, settings]);
498
- const contextValue = reactExports.useMemo(
499
- () => ({ baseConfig, settings }),
500
- [baseConfig, settings]
501
- );
502
- return /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsConfigContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AdminConfigProvider, { config: mergedConfig, children }) });
503
- }
504
- function useSettingsConfig() {
505
- const ctx = reactExports.useContext(SettingsConfigContext);
506
- if (!ctx) {
507
- throw new Error("useSettingsConfig must be used within SettingsConfigProvider");
508
- }
509
- return ctx;
510
- }
511
- const BreadcrumbContext = reactExports.createContext(null);
512
- function BreadcrumbProvider({ children }) {
513
- const [overrides, setOverrides] = reactExports.useState(/* @__PURE__ */ new Map());
514
- const setOverride = reactExports.useCallback((path, label) => {
515
- setOverrides((prev) => {
516
- const next = new Map(prev);
517
- next.set(path, label);
518
- return next;
519
- });
520
- }, []);
521
- const clearOverride = reactExports.useCallback((path) => {
522
- setOverrides((prev) => {
523
- const next = new Map(prev);
524
- next.delete(path);
525
- return next;
526
- });
527
- }, []);
528
- const value = reactExports.useMemo(
529
- () => ({ overrides, setOverride, clearOverride }),
530
- [overrides, setOverride, clearOverride]
531
- );
532
- return /* @__PURE__ */ jsxRuntimeExports.jsx(BreadcrumbContext.Provider, { value, children });
533
- }
534
- function useBreadcrumbContext() {
535
- const context = reactExports.useContext(BreadcrumbContext);
536
- if (!context) {
537
- throw new Error("useBreadcrumbContext must be used within a BreadcrumbProvider");
538
- }
539
- return context;
540
- }
541
- const iconRegistry = {
542
- LayoutDashboard,
543
- FileText,
544
- Image: Image$1,
545
- Layers,
546
- Tags,
547
- FileCode,
548
- Settings,
549
- Trash2,
550
- HelpCircle: CircleQuestionMark,
551
- Home: House,
552
- User,
553
- Bell,
554
- Lock,
555
- Globe,
556
- Calendar,
557
- Clock,
558
- Link: Link$1,
559
- Hash,
560
- ToggleLeft,
561
- ChevronDown,
562
- CheckSquare: SquareCheckBig,
563
- Braces,
564
- Folder,
565
- MapPin,
566
- DollarSign,
567
- Mail,
568
- Phone,
569
- Package,
570
- Star,
571
- Heart,
572
- Flag,
573
- Bookmark,
574
- Archive,
575
- Edit: SquarePen,
576
- Eye,
577
- AlertCircle: CircleAlert
578
- };
579
- function Icon({
580
- name,
581
- className = "size-5"
582
- }) {
583
- const IconComponent = iconRegistry[name];
584
- if (!IconComponent) {
585
- return null;
586
- }
587
- return /* @__PURE__ */ jsxRuntimeExports.jsx(IconComponent, { className });
588
- }
589
- const Collapsible = Root$1;
590
- const CollapsibleTrigger = CollapsibleTrigger$1;
591
- const CollapsibleContent = CollapsibleContent$1;
592
- function Sidebar() {
593
- const routerState = useRouterState();
594
- const currentPath = routerState.location.pathname;
595
- const config = useAdminConfig();
596
- const { navItems, branding, layout } = config;
597
- const contentTypesResult = useQuery(api.admin.listContentTypes, {
598
- isActive: true
599
- });
600
- const contentTypes = contentTypesResult?.page ?? [];
601
- const isActive = (to, exact) => {
602
- if (exact) {
603
- return currentPath === to;
604
- }
605
- return currentPath.startsWith(to);
606
- };
607
- const isContentActive = currentPath === "/content" || currentPath.startsWith("/entries/type/") || currentPath.startsWith("/entries/new/") || currentPath.startsWith("/entries/");
608
- const renderNavItem = (item) => {
609
- if (item.id === "content") {
610
- return renderContentMenu(item);
611
- }
612
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
613
- Link,
614
- {
615
- to: item.path,
616
- className: cn(
617
- "flex items-center gap-3 rounded-md px-2 py-2 text-sm font-medium transition-colors",
618
- isActive(item.path, item.exact) ? "bg-sidebar-accent text-sidebar-accent-foreground" : "text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-accent-foreground"
619
- ),
620
- children: [
621
- /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: item.icon, className: "size-5" }),
622
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-1", children: item.label }),
623
- item.badge && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "rounded-full bg-sidebar-primary px-2 py-0.5 text-xs text-sidebar-primary-foreground", children: item.badge })
624
- ]
625
- },
626
- item.id
627
- );
628
- };
629
- const renderContentMenu = (item) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Collapsible, { defaultOpen: isContentActive, children: [
630
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
631
- CollapsibleTrigger,
632
- {
633
- className: cn(
634
- "flex w-full items-center gap-3 rounded-md px-2 py-2 text-sm font-medium transition-colors",
635
- isContentActive ? "bg-sidebar-accent text-sidebar-accent-foreground" : "text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-accent-foreground",
636
- "group"
637
- ),
638
- children: [
639
- /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: item.icon, className: "size-5" }),
640
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-1 text-left", children: item.label }),
641
- /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "size-4 transition-transform duration-200 group-data-[state=open]:rotate-180" })
642
- ]
643
- }
644
- ),
645
- /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ml-5 mt-1 space-y-1 border-l border-sidebar-border pl-3", children: [
646
- /* @__PURE__ */ jsxRuntimeExports.jsx(
647
- Link,
648
- {
649
- to: "/content",
650
- className: cn(
651
- "flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors",
652
- currentPath === "/content" ? "bg-sidebar-accent/60 text-sidebar-accent-foreground" : "text-sidebar-foreground/80 hover:bg-sidebar-accent/30 hover:text-sidebar-accent-foreground"
653
- ),
654
- children: "All Entries"
655
- }
656
- ),
657
- contentTypes.map((type) => /* @__PURE__ */ jsxRuntimeExports.jsx(
658
- Link,
659
- {
660
- to: "/entries/type/$contentTypeId",
661
- params: { contentTypeId: type._id },
662
- className: cn(
663
- "flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors",
664
- currentPath === `/entries/type/${type._id}` ? "bg-sidebar-accent/60 text-sidebar-accent-foreground" : "text-sidebar-foreground/80 hover:bg-sidebar-accent/30 hover:text-sidebar-accent-foreground"
665
- ),
666
- children: type.displayName
667
- },
668
- type._id
669
- )),
670
- contentTypes.length === 0 && contentTypesResult !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
671
- Link,
672
- {
673
- to: "/content-types",
674
- className: "flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-sidebar-foreground/60 hover:bg-sidebar-accent/30 hover:text-sidebar-accent-foreground",
675
- children: "+ Create content type"
676
- }
677
- )
678
- ] }) })
679
- ] }, item.id);
680
- const sidebarWidth = layout.sidebarWidth;
681
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
682
- "aside",
683
- {
684
- className: "fixed inset-y-0 left-0 z-50 flex flex-col border-r border-sidebar-border bg-sidebar",
685
- style: { width: sidebarWidth },
686
- children: [
687
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-14 items-center gap-2 border-b border-sidebar-border px-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Link, { to: "/", className: "flex items-center gap-2 font-semibold text-sidebar-foreground", children: [
688
- branding.logo ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: branding.logo, alt: branding.appName, className: "size-8" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Layers, { className: "size-4" }) }),
689
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-base", children: branding.appName })
690
- ] }) }),
691
- /* @__PURE__ */ jsxRuntimeExports.jsxs("nav", { className: "flex-1 space-y-6 overflow-y-auto p-4", children: [
692
- navItems.main.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
693
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 text-xs font-medium uppercase tracking-wider text-sidebar-foreground/60", children: "Main" }),
694
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-1 pt-2", children: navItems.main.map(renderNavItem) })
695
- ] }),
696
- navItems.config.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
697
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 text-xs font-medium uppercase tracking-wider text-sidebar-foreground/60", children: "Configuration" }),
698
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-1 pt-2", children: navItems.config.map(renderNavItem) })
699
- ] })
700
- ] }),
701
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t border-sidebar-border p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between text-xs text-sidebar-foreground/60", children: [
702
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Version" }),
703
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono", children: "0.1.0" })
704
- ] }) })
705
- ]
706
- }
707
- );
708
- }
709
- function Breadcrumb({ ...props }) {
710
- return /* @__PURE__ */ jsxRuntimeExports.jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
711
- }
712
- function BreadcrumbList({ className, ...props }) {
713
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
714
- "ol",
715
- {
716
- "data-slot": "breadcrumb-list",
717
- className: cn(
718
- "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
719
- className
720
- ),
721
- ...props
722
- }
723
- );
724
- }
725
- function BreadcrumbItem({ className, ...props }) {
726
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
727
- "li",
728
- {
729
- "data-slot": "breadcrumb-item",
730
- className: cn("inline-flex items-center gap-1.5", className),
731
- ...props
732
- }
733
- );
734
- }
735
- function BreadcrumbLink({
736
- asChild,
737
- className,
738
- ...props
739
- }) {
740
- const Comp = asChild ? Slot : "a";
741
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
742
- Comp,
743
- {
744
- "data-slot": "breadcrumb-link",
745
- className: cn("hover:text-foreground transition-colors", className),
746
- ...props
747
- }
748
- );
749
- }
750
- function BreadcrumbPage({ className, ...props }) {
751
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
752
- "span",
753
- {
754
- "data-slot": "breadcrumb-page",
755
- role: "link",
756
- "aria-disabled": "true",
757
- "aria-current": "page",
758
- className: cn("text-foreground font-normal", className),
759
- ...props
760
- }
761
- );
762
- }
763
- function BreadcrumbSeparator({
764
- children,
765
- className,
766
- ...props
767
- }) {
768
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
769
- "li",
770
- {
771
- "data-slot": "breadcrumb-separator",
772
- role: "presentation",
773
- "aria-hidden": "true",
774
- className: cn("[&>svg]:size-3.5", className),
775
- ...props,
776
- children: children ?? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, {})
777
- }
778
- );
779
- }
780
- function DropdownMenu({
781
- ...props
782
- }) {
783
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2$1, { "data-slot": "dropdown-menu", ...props });
784
- }
785
- function DropdownMenuTrigger({
786
- ...props
787
- }) {
788
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
789
- Trigger$1,
790
- {
791
- "data-slot": "dropdown-menu-trigger",
792
- ...props
793
- }
794
- );
795
- }
796
- function DropdownMenuContent({
797
- className,
798
- sideOffset = 4,
799
- ...props
800
- }) {
801
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
802
- Content2$1,
803
- {
804
- "data-slot": "dropdown-menu-content",
805
- sideOffset,
806
- className: cn(
807
- "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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
808
- className
809
- ),
810
- ...props
811
- }
812
- ) });
813
- }
814
- function DropdownMenuItem({
815
- className,
816
- inset,
817
- variant = "default",
818
- ...props
819
- }) {
820
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
821
- Item2,
822
- {
823
- "data-slot": "dropdown-menu-item",
824
- "data-inset": inset,
825
- "data-variant": variant,
826
- className: cn(
827
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
828
- className
829
- ),
830
- ...props
831
- }
832
- );
833
- }
834
- function DropdownMenuLabel({
835
- className,
836
- inset,
837
- ...props
838
- }) {
839
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
840
- Label2,
841
- {
842
- "data-slot": "dropdown-menu-label",
843
- "data-inset": inset,
844
- className: cn(
845
- "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
846
- className
847
- ),
848
- ...props
849
- }
850
- );
851
- }
852
- function DropdownMenuSeparator({
853
- className,
854
- ...props
855
- }) {
856
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
857
- Separator2,
858
- {
859
- "data-slot": "dropdown-menu-separator",
860
- className: cn("bg-border -mx-1 my-1 h-px", className),
861
- ...props
862
- }
863
- );
864
- }
865
- function Avatar({
866
- className,
867
- ...props
868
- }) {
869
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
870
- Root,
871
- {
872
- "data-slot": "avatar",
873
- className: cn(
874
- "relative flex size-8 shrink-0 overflow-hidden rounded-full",
875
- className
876
- ),
877
- ...props
878
- }
879
- );
880
- }
881
- function AvatarImage({
882
- className,
883
- ...props
884
- }) {
885
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
886
- Image,
887
- {
888
- "data-slot": "avatar-image",
889
- className: cn("aspect-square size-full", className),
890
- ...props
891
- }
892
- );
893
- }
894
- function AvatarFallback({
895
- className,
896
- ...props
897
- }) {
898
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
899
- Fallback,
900
- {
901
- "data-slot": "avatar-fallback",
902
- className: cn(
903
- "bg-muted flex size-full items-center justify-center rounded-full",
904
- className
905
- ),
906
- ...props
907
- }
908
- );
909
- }
910
- const buttonVariants = cva(
911
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
912
- {
913
- variants: {
914
- variant: {
915
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
916
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
917
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
918
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
919
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
920
- link: "text-primary underline-offset-4 hover:underline"
921
- },
922
- size: {
923
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
924
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
925
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
926
- icon: "size-9",
927
- "icon-sm": "size-8",
928
- "icon-lg": "size-10"
929
- }
930
- },
931
- defaultVariants: {
932
- variant: "default",
933
- size: "default"
934
- }
935
- }
936
- );
937
- function Button({
938
- className,
939
- variant = "default",
940
- size = "default",
941
- asChild = false,
942
- ...props
943
- }) {
944
- const Comp = asChild ? Slot : "button";
945
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
946
- Comp,
947
- {
948
- "data-slot": "button",
949
- "data-variant": variant,
950
- "data-size": size,
951
- className: cn(buttonVariants({ variant, size, className })),
952
- ...props
953
- }
954
- );
955
- }
956
- function Popover({
957
- ...props
958
- }) {
959
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2, { "data-slot": "popover", ...props });
960
- }
961
- function PopoverTrigger({
962
- ...props
963
- }) {
964
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Trigger, { "data-slot": "popover-trigger", ...props });
965
- }
966
- function PopoverContent({
967
- className,
968
- align = "center",
969
- sideOffset = 4,
970
- ...props
971
- }) {
972
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
973
- Content2,
974
- {
975
- "data-slot": "popover-content",
976
- align,
977
- sideOffset,
978
- className: cn(
979
- "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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
980
- className
981
- ),
982
- ...props
983
- }
984
- ) });
985
- }
986
- const KEYBOARD_SHORTCUTS = [
987
- { keys: ["⌘", "S"], description: "Save entry" },
988
- { keys: ["⌘", "⇧", "P"], description: "Publish entry" },
989
- { keys: ["⌘", "K"], description: "Quick search" },
990
- { keys: ["Esc"], description: "Close modal/panel" }
991
- ];
992
- const HELP_RESOURCES = [
993
- { label: "Documentation", url: "https://docs.convex.dev", icon: Book },
994
- { label: "API Reference", url: "https://docs.convex.dev/api", icon: Code },
995
- { label: "Community Discord", url: "https://discord.gg/convex", icon: MessageSquare }
996
- ];
997
- const routeLabels = {
998
- "/": "Dashboard",
999
- "/content": "Content",
1000
- "/media": "Media Library",
1001
- "/content-types": "Content Types",
1002
- "/settings": "Settings",
1003
- "/taxonomies": "Taxonomies",
1004
- "/trash": "Trash",
1005
- "/entries": "Entries",
1006
- "/entries/type": "Content Types",
1007
- "/entries/new": "New Entry"
1008
- };
1009
- function getBreadcrumbs(pathname, appName, overrides) {
1010
- const breadcrumbs = [{ label: appName, to: "/" }];
1011
- if (pathname === "/") {
1012
- return breadcrumbs;
1013
- }
1014
- const segments = pathname.split("/").filter(Boolean);
1015
- let currentPath = "";
1016
- segments.forEach((segment, index) => {
1017
- currentPath += `/${segment}`;
1018
- const isLast = index === segments.length - 1;
1019
- let label = overrides.get(currentPath) ?? routeLabels[currentPath];
1020
- if (!label) {
1021
- label = segment.charAt(0).toUpperCase() + segment.slice(1).replace(/-/g, " ");
1022
- }
1023
- if (isLast) {
1024
- breadcrumbs.push({ label });
1025
- } else {
1026
- breadcrumbs.push({ label, to: currentPath });
1027
- }
1028
- });
1029
- return breadcrumbs;
1030
- }
1031
- function Header() {
1032
- const routerState = useRouterState();
1033
- const navigate = useNavigate();
1034
- const { branding } = useAdminConfig();
1035
- let overrides = /* @__PURE__ */ new Map();
1036
- try {
1037
- const breadcrumbContext = useBreadcrumbContext();
1038
- overrides = breadcrumbContext.overrides;
1039
- } catch {
1040
- }
1041
- const breadcrumbs = getBreadcrumbs(routerState.location.pathname, branding.appName, overrides);
1042
- let user = null;
1043
- let role = null;
1044
- let logout = async () => {
1045
- };
1046
- let isAuthenticated = false;
1047
- try {
1048
- const auth = useAuth();
1049
- user = auth.user;
1050
- role = auth.role;
1051
- logout = auth.logout;
1052
- isAuthenticated = auth.isAuthenticated;
1053
- } catch {
1054
- }
1055
- const roleDefinition = role ? getRole(role) : null;
1056
- const roleDisplayName = roleDefinition?.displayName ?? role ?? "No Role";
1057
- const userDisplayName = user?.name ?? user?.email ?? "User";
1058
- const getInitials = (name) => {
1059
- const parts = name.split(" ");
1060
- if (parts.length >= 2) {
1061
- return `${parts[0][0]}${parts[1][0]}`.toUpperCase();
1062
- }
1063
- return name.slice(0, 2).toUpperCase();
1064
- };
1065
- const userInitials = user?.name ? getInitials(user.name) : "U";
1066
- const handleLogout = async () => {
1067
- await logout();
1068
- };
1069
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: "sticky top-0 z-40 flex h-14 items-center justify-between border-b border-border bg-background/95 px-6 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: [
1070
- /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BreadcrumbList, { children: breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
1071
- index > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(BreadcrumbSeparator, {}),
1072
- /* @__PURE__ */ jsxRuntimeExports.jsx(BreadcrumbItem, { children: crumb.to ? /* @__PURE__ */ jsxRuntimeExports.jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Link, { to: crumb.to, className: "flex items-center gap-1.5", children: [
1073
- index === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(House, { className: "size-3.5" }),
1074
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: crumb.label })
1075
- ] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(BreadcrumbPage, { children: crumb.label }) })
1076
- ] }, index)) }) }),
1077
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [
1078
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover, { children: [
1079
- /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "size-9", children: [
1080
- /* @__PURE__ */ jsxRuntimeExports.jsx(Bell, { className: "size-4" }),
1081
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Notifications" })
1082
- ] }) }),
1083
- /* @__PURE__ */ jsxRuntimeExports.jsxs(PopoverContent, { align: "end", className: "w-80", children: [
1084
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between pb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-medium", children: "Notifications" }) }),
1085
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
1086
- /* @__PURE__ */ jsxRuntimeExports.jsx(Bell, { className: "size-8 text-muted-foreground/50" }),
1087
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 text-sm font-medium", children: "No notifications yet" }),
1088
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground", children: "You're all caught up!" })
1089
- ] })
1090
- ] })
1091
- ] }),
1092
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover, { children: [
1093
- /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "size-9", children: [
1094
- /* @__PURE__ */ jsxRuntimeExports.jsx(CircleQuestionMark, { className: "size-4" }),
1095
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Help" })
1096
- ] }) }),
1097
- /* @__PURE__ */ jsxRuntimeExports.jsxs(PopoverContent, { align: "end", className: "w-72", children: [
1098
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-medium", children: "Help & Resources" }) }),
1099
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
1100
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
1101
- /* @__PURE__ */ jsxRuntimeExports.jsx("h5", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "Keyboard Shortcuts" }),
1102
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-1", children: KEYBOARD_SHORTCUTS.map((shortcut, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
1103
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-muted-foreground", children: shortcut.description }),
1104
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-0.5", children: shortcut.keys.map((key, keyIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1105
- "kbd",
1106
- {
1107
- className: "rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-xs",
1108
- children: key
1109
- },
1110
- keyIndex
1111
- )) })
1112
- ] }, index)) })
1113
- ] }),
1114
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
1115
- /* @__PURE__ */ jsxRuntimeExports.jsx("h5", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "Resources" }),
1116
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-1", children: HELP_RESOURCES.map((resource) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
1117
- "a",
1118
- {
1119
- href: resource.url,
1120
- target: "_blank",
1121
- rel: "noopener noreferrer",
1122
- className: "flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent",
1123
- children: [
1124
- /* @__PURE__ */ jsxRuntimeExports.jsx(resource.icon, { className: "size-4 text-muted-foreground" }),
1125
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-1", children: resource.label }),
1126
- /* @__PURE__ */ jsxRuntimeExports.jsx(ExternalLink, { className: "size-3 text-muted-foreground" })
1127
- ]
1128
- },
1129
- resource.label
1130
- )) })
1131
- ] })
1132
- ] })
1133
- ] })
1134
- ] }),
1135
- /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { children: [
1136
- /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", className: "h-9 gap-2 pl-2 pr-3", children: [
1137
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Avatar, { className: "size-6", children: [
1138
- /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarImage, { src: user?.avatarUrl, alt: userDisplayName }),
1139
- /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "text-xs", children: userInitials })
1140
- ] }),
1141
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: userDisplayName }),
1142
- /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "size-3.5 text-muted-foreground" })
1143
- ] }) }),
1144
- /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenuContent, { align: "end", className: "w-56", children: [
1145
- /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuLabel, { className: "font-normal", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col space-y-1", children: [
1146
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium", children: userDisplayName }),
1147
- user?.email && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground", children: user.email }),
1148
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground", children: roleDisplayName })
1149
- ] }) }),
1150
- /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuSeparator, {}),
1151
- /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenuItem, { onClick: () => navigate({ to: "/settings" }), children: [
1152
- /* @__PURE__ */ jsxRuntimeExports.jsx(User, { className: "mr-2 size-4" }),
1153
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Profile & Settings" })
1154
- ] }),
1155
- isAuthenticated && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1156
- /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuSeparator, {}),
1157
- /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenuItem, { onClick: handleLogout, className: "text-destructive focus:text-destructive", children: [
1158
- /* @__PURE__ */ jsxRuntimeExports.jsx(LogOut, { className: "mr-2 size-4" }),
1159
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Logout" })
1160
- ] })
1161
- ] })
1162
- ] })
1163
- ] })
1164
- ] })
1165
- ] });
1166
- }
1167
- function AdminLayout({ children }) {
1168
- const { layout } = useAdminConfig();
1169
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-h-screen bg-background", children: [
1170
- /* @__PURE__ */ jsxRuntimeExports.jsx(Sidebar, {}),
1171
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-1 flex-col", style: { marginLeft: layout.sidebarWidth }, children: [
1172
- /* @__PURE__ */ jsxRuntimeExports.jsx(Header, {}),
1173
- /* @__PURE__ */ jsxRuntimeExports.jsx("main", { className: "flex-1 overflow-auto p-6", children })
1174
- ] })
1175
- ] });
1176
- }
1177
- function DefaultLoading() {
1178
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "route-guard route-guard--loading bg-background flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "h-8 w-8 animate-spin text-muted-foreground" }) });
1179
- }
1180
- function DefaultUnauthenticated() {
1181
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "route-guard route-guard--unauthenticated", children: [
1182
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "route-guard-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1183
- "svg",
1184
- {
1185
- xmlns: "http://www.w3.org/2000/svg",
1186
- width: "48",
1187
- height: "48",
1188
- viewBox: "0 0 24 24",
1189
- fill: "none",
1190
- stroke: "currentColor",
1191
- strokeWidth: "2",
1192
- strokeLinecap: "round",
1193
- strokeLinejoin: "round",
1194
- children: [
1195
- /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
1196
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
1197
- ]
1198
- }
1199
- ) }),
1200
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: "Authentication Required" }),
1201
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Please log in to access the admin panel." })
1202
- ] });
1203
- }
1204
- function DefaultUnauthorized({
1205
- requiredRole,
1206
- requiredPermission
1207
- }) {
1208
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "route-guard route-guard--unauthorized", children: [
1209
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "route-guard-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1210
- "svg",
1211
- {
1212
- xmlns: "http://www.w3.org/2000/svg",
1213
- width: "48",
1214
- height: "48",
1215
- viewBox: "0 0 24 24",
1216
- fill: "none",
1217
- stroke: "currentColor",
1218
- strokeWidth: "2",
1219
- strokeLinecap: "round",
1220
- strokeLinejoin: "round",
1221
- children: [
1222
- /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1223
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "4.93", y1: "4.93", x2: "19.07", y2: "19.07" })
1224
- ]
1225
- }
1226
- ) }),
1227
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: "Access Denied" }),
1228
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "You don't have permission to access this page." }),
1229
- requiredRole && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "route-guard-detail", children: [
1230
- "Required role: ",
1231
- /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: requiredRole })
1232
- ] }),
1233
- requiredPermission && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "route-guard-detail", children: [
1234
- "Required permission:",
1235
- " ",
1236
- /* @__PURE__ */ jsxRuntimeExports.jsxs("strong", { children: [
1237
- requiredPermission.action,
1238
- " on ",
1239
- requiredPermission.resource
1240
- ] })
1241
- ] })
1242
- ] });
1243
- }
1244
- function DefaultError({ error }) {
1245
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "route-guard route-guard--error", children: [
1246
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "route-guard-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1247
- "svg",
1248
- {
1249
- xmlns: "http://www.w3.org/2000/svg",
1250
- width: "48",
1251
- height: "48",
1252
- viewBox: "0 0 24 24",
1253
- fill: "none",
1254
- stroke: "currentColor",
1255
- strokeWidth: "2",
1256
- strokeLinecap: "round",
1257
- strokeLinejoin: "round",
1258
- children: [
1259
- /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1260
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
1261
- /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
1262
- ]
1263
- }
1264
- ) }),
1265
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: "Authentication Error" }),
1266
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: error })
1267
- ] });
1268
- }
1269
- function RouteGuard({
1270
- children,
1271
- requiredPermission,
1272
- requiredRole,
1273
- loadingComponent,
1274
- unauthenticatedComponent,
1275
- unauthorizedComponent,
1276
- onUnauthenticated,
1277
- onUnauthorized
1278
- }) {
1279
- const { authState, role, checkPermission, error } = useAuth();
1280
- if (authState === "loading") {
1281
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: loadingComponent ?? /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultLoading, {}) });
1282
- }
1283
- if (authState === "error") {
1284
- return /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultError, { error: error ?? "An error occurred" });
1285
- }
1286
- if (authState === "unauthenticated") {
1287
- onUnauthenticated?.();
1288
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: unauthenticatedComponent ?? /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultUnauthenticated, {}) });
1289
- }
1290
- if (!role) {
1291
- onUnauthorized?.();
1292
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: unauthorizedComponent ?? /* @__PURE__ */ jsxRuntimeExports.jsx(
1293
- DefaultUnauthorized,
1294
- {
1295
- requiredRole,
1296
- requiredPermission
1297
- }
1298
- ) });
1299
- }
1300
- if (requiredRole && role !== requiredRole) {
1301
- onUnauthorized?.();
1302
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: unauthorizedComponent ?? /* @__PURE__ */ jsxRuntimeExports.jsx(
1303
- DefaultUnauthorized,
1304
- {
1305
- requiredRole,
1306
- requiredPermission
1307
- }
1308
- ) });
1309
- }
1310
- if (requiredPermission && !checkPermission(requiredPermission)) {
1311
- onUnauthorized?.();
1312
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: unauthorizedComponent ?? /* @__PURE__ */ jsxRuntimeExports.jsx(
1313
- DefaultUnauthorized,
1314
- {
1315
- requiredRole,
1316
- requiredPermission
1317
- }
1318
- ) });
1319
- }
1320
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
1321
- }
1322
- const createSsrRpc = (functionId, importer) => {
1323
- const url = "/_serverFn/" + functionId;
1324
- const serverFnMeta = { id: functionId };
1325
- const fn = async (...args) => {
1326
- const serverFn = await getServerFnById(functionId);
1327
- return serverFn(...args);
1328
- };
1329
- return Object.assign(fn, {
1330
- url,
1331
- serverFnMeta,
1332
- [TSS_SERVER_FUNCTION]: true
1333
- });
1334
- };
1335
- const getServerConfig = createServerFn({
1336
- method: "GET"
1337
- }).handler(createSsrRpc("dff4e5b7f7b29b6a323200a2df0a5335d739cf583e83c9e514598af6b5ade819"));
1338
- const mockGetUser = () => {
1339
- return {
1340
- id: "mock_user_123",
1341
- name: "Demo Admin",
1342
- email: "admin@example.com"
1343
- };
1344
- };
1345
- const mockGetUserRole = () => {
1346
- return "admin";
1347
- };
1348
- const mockLogout = () => {
1349
- console.log("Logout called (mock mode)");
1350
- };
1351
- const noAuthGetUser = () => null;
1352
- const noAuthGetUserRole = () => null;
1353
- const noAuthLogout = () => {
1354
- };
1355
- function getAuthConfig(authMode) {
1356
- switch (authMode) {
1357
- case "mock":
1358
- case "demo":
1359
- return {
1360
- getUser: mockGetUser,
1361
- getUserRole: mockGetUserRole,
1362
- onLogout: mockLogout
1363
- };
1364
- case "none":
1365
- case "disabled":
1366
- return {
1367
- getUser: noAuthGetUser,
1368
- getUserRole: noAuthGetUserRole,
1369
- onLogout: noAuthLogout
1370
- };
1371
- default:
1372
- return {
1373
- getUser: mockGetUser,
1374
- getUserRole: mockGetUserRole,
1375
- onLogout: mockLogout
1376
- };
1377
- }
1378
- }
1379
- const Route$a = createRootRoute({
1380
- head: () => ({
1381
- meta: [
1382
- {
1383
- charSet: "utf-8"
1384
- },
1385
- {
1386
- name: "viewport",
1387
- content: "width=device-width, initial-scale=1"
1388
- },
1389
- {
1390
- title: "Convex CMS Admin"
1391
- },
1392
- {
1393
- name: "description",
1394
- content: "Admin interface for Convex CMS - manage content, media, and publishing workflows"
1395
- }
1396
- ],
1397
- links: [
1398
- { rel: "stylesheet", href: globalsCss },
1399
- { rel: "icon", href: "/favicon.ico" }
1400
- ]
1401
- }),
1402
- // Load server config at route initialization
1403
- loader: async () => {
1404
- const config = await getServerConfig();
1405
- return { config };
1406
- },
1407
- component: RootComponent
1408
- });
1409
- function RootComponent() {
1410
- const { config } = Route$a.useLoaderData();
1411
- const authConfig = reactExports.useMemo(() => getAuthConfig(config.authMode), [config.authMode]);
1412
- const adminConfig = reactExports.useMemo(
1413
- () => resolveAdminConfig(config.adminConfig),
1414
- [config.adminConfig]
1415
- );
1416
- return /* @__PURE__ */ jsxRuntimeExports.jsx(RootDocument, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BreadcrumbProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConvexProviderWrapper, { config, adminConfig, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1417
- AuthProvider,
1418
- {
1419
- getUser: authConfig.getUser,
1420
- getUserRole: authConfig.getUserRole,
1421
- onLogout: authConfig.onLogout,
1422
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(RouteGuard, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AdminLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}) }) })
1423
- }
1424
- ) }) }) }) });
1425
- }
1426
- function ConvexProviderWrapper({
1427
- children,
1428
- config,
1429
- adminConfig
1430
- }) {
1431
- const convex = reactExports.useMemo(() => {
1432
- if (!config.convexUrl) return null;
1433
- return new ConvexReactClient(config.convexUrl);
1434
- }, [config.convexUrl]);
1435
- if (!convex) {
1436
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex min-h-screen items-center justify-center bg-background p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-lg space-y-4 rounded-lg border border-amber-200 bg-amber-50 p-6 text-center", children: [
1437
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-semibold text-amber-900", children: "Convex Configuration Required" }),
1438
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-amber-800", children: "Please provide a Convex deployment URL to connect to your backend." }),
1439
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 text-left text-sm text-amber-700", children: [
1440
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: "Options:" }),
1441
- /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "list-inside list-disc space-y-1", children: [
1442
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
1443
- "Run with URL:",
1444
- " ",
1445
- /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "rounded bg-amber-100 px-1", children: "npx convex-cms admin --url YOUR_URL" })
1446
- ] }),
1447
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
1448
- "Set environment variable:",
1449
- " ",
1450
- /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "rounded bg-amber-100 px-1", children: "CONVEX_URL=YOUR_URL" })
1451
- ] }),
1452
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
1453
- "Add to",
1454
- " ",
1455
- /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "rounded bg-amber-100 px-1", children: ".env.local" }),
1456
- ":",
1457
- " ",
1458
- /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "rounded bg-amber-100 px-1", children: "CONVEX_URL=YOUR_URL" })
1459
- ] })
1460
- ] })
1461
- ] }),
1462
- /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-amber-700", children: [
1463
- "Run",
1464
- " ",
1465
- /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "rounded bg-amber-100 px-1", children: "npx convex dev" }),
1466
- " to start Convex and get your URL."
1467
- ] })
1468
- ] }) });
1469
- }
1470
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ConvexProvider, { client: convex, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsConfigProvider, { baseConfig: adminConfig, children }) });
1471
- }
1472
- function RootDocument({ children }) {
1473
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("html", { lang: "en", children: [
1474
- /* @__PURE__ */ jsxRuntimeExports.jsx("head", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeadContent, {}) }),
1475
- /* @__PURE__ */ jsxRuntimeExports.jsxs("body", { children: [
1476
- children,
1477
- /* @__PURE__ */ jsxRuntimeExports.jsx(Scripts, {})
1478
- ] })
1479
- ] });
1480
- }
1481
- const $$splitComponentImporter$9 = () => import("./trash-9tUB2KwI.mjs");
1482
- const Route$9 = createFileRoute("/trash")({
1483
- component: lazyRouteComponent($$splitComponentImporter$9, "component")
1484
- });
1485
- const $$splitComponentImporter$8 = () => import("./taxonomies-BHFfO9Yr.mjs");
1486
- const Route$8 = createFileRoute("/taxonomies")({
1487
- component: lazyRouteComponent($$splitComponentImporter$8, "component")
1488
- });
1489
- const $$splitComponentImporter$7 = () => import("./settings-DVdsoWoh.mjs");
1490
- const Route$7 = createFileRoute("/settings")({
1491
- component: lazyRouteComponent($$splitComponentImporter$7, "component")
1492
- });
1493
- const $$splitComponentImporter$6 = () => import("./media-CD2_NUMw.mjs");
1494
- const Route$6 = createFileRoute("/media")({
1495
- component: lazyRouteComponent($$splitComponentImporter$6, "component")
1496
- });
1497
- const $$splitComponentImporter$5 = () => import("./content-types-D25lUE-j.mjs");
1498
- const Route$5 = createFileRoute("/content-types")({
1499
- component: lazyRouteComponent($$splitComponentImporter$5, "component")
1500
- });
1501
- const $$splitComponentImporter$4 = () => import("./content-ZFWVzO25.mjs");
1502
- const Route$4 = createFileRoute("/content")({
1503
- component: lazyRouteComponent($$splitComponentImporter$4, "component")
1504
- });
1505
- const $$splitComponentImporter$3 = () => import("./index-BlSIlH4Z.mjs");
1506
- const Route$3 = createFileRoute("/")({
1507
- component: lazyRouteComponent($$splitComponentImporter$3, "component")
1508
- });
1509
- const $$splitComponentImporter$2 = () => import("./_entryId-9Cafwxmw.mjs");
1510
- const Route$2 = createFileRoute("/entries/$entryId")({
1511
- component: lazyRouteComponent($$splitComponentImporter$2, "component")
1512
- });
1513
- const $$splitComponentImporter$1 = () => import("./_contentTypeId-DyyauLOs.mjs");
1514
- const Route$1 = createFileRoute("/entries/type/$contentTypeId")({
1515
- component: lazyRouteComponent($$splitComponentImporter$1, "component")
1516
- });
1517
- const $$splitComponentImporter = () => import("./new._contentTypeId-dmZy6PBX.mjs");
1518
- const Route = createFileRoute("/entries/new/$contentTypeId")({
1519
- component: lazyRouteComponent($$splitComponentImporter, "component")
1520
- });
1521
- const TrashRoute = Route$9.update({
1522
- id: "/trash",
1523
- path: "/trash",
1524
- getParentRoute: () => Route$a
1525
- });
1526
- const TaxonomiesRoute = Route$8.update({
1527
- id: "/taxonomies",
1528
- path: "/taxonomies",
1529
- getParentRoute: () => Route$a
1530
- });
1531
- const SettingsRoute = Route$7.update({
1532
- id: "/settings",
1533
- path: "/settings",
1534
- getParentRoute: () => Route$a
1535
- });
1536
- const MediaRoute = Route$6.update({
1537
- id: "/media",
1538
- path: "/media",
1539
- getParentRoute: () => Route$a
1540
- });
1541
- const ContentTypesRoute = Route$5.update({
1542
- id: "/content-types",
1543
- path: "/content-types",
1544
- getParentRoute: () => Route$a
1545
- });
1546
- const ContentRoute = Route$4.update({
1547
- id: "/content",
1548
- path: "/content",
1549
- getParentRoute: () => Route$a
1550
- });
1551
- const IndexRoute = Route$3.update({
1552
- id: "/",
1553
- path: "/",
1554
- getParentRoute: () => Route$a
1555
- });
1556
- const EntriesEntryIdRoute = Route$2.update({
1557
- id: "/entries/$entryId",
1558
- path: "/entries/$entryId",
1559
- getParentRoute: () => Route$a
1560
- });
1561
- const EntriesTypeContentTypeIdRoute = Route$1.update({
1562
- id: "/entries/type/$contentTypeId",
1563
- path: "/entries/type/$contentTypeId",
1564
- getParentRoute: () => Route$a
1565
- });
1566
- const EntriesNewContentTypeIdRoute = Route.update({
1567
- id: "/entries/new/$contentTypeId",
1568
- path: "/entries/new/$contentTypeId",
1569
- getParentRoute: () => Route$a
1570
- });
1571
- const rootRouteChildren = {
1572
- IndexRoute,
1573
- ContentRoute,
1574
- ContentTypesRoute,
1575
- MediaRoute,
1576
- SettingsRoute,
1577
- TaxonomiesRoute,
1578
- TrashRoute,
1579
- EntriesEntryIdRoute,
1580
- EntriesNewContentTypeIdRoute,
1581
- EntriesTypeContentTypeIdRoute
1582
- };
1583
- const routeTree = Route$a._addFileChildren(rootRouteChildren)._addFileTypes();
1584
- function getRouter() {
1585
- const router2 = createRouter({
1586
- routeTree,
1587
- scrollRestoration: true,
1588
- defaultPreload: "intent"
1589
- });
1590
- return router2;
1591
- }
1592
- const router = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1593
- __proto__: null,
1594
- getRouter
1595
- }, Symbol.toStringTag, { value: "Module" }));
1596
- export {
1597
- Button as B,
1598
- DropdownMenu as D,
1599
- Popover as P,
1600
- RouteGuard as R,
1601
- api as a,
1602
- useTheme as b,
1603
- cn as c,
1604
- DropdownMenuTrigger as d,
1605
- DropdownMenuContent as e,
1606
- DropdownMenuItem as f,
1607
- DropdownMenuSeparator as g,
1608
- useSettingsConfig as h,
1609
- Route$2 as i,
1610
- Route$1 as j,
1611
- PopoverTrigger as k,
1612
- PopoverContent as l,
1613
- useAuth as m,
1614
- getResourcePermissions as n,
1615
- canAccessResource as o,
1616
- hasPermission as p,
1617
- Route as q,
1618
- buttonVariants as r,
1619
- useBreadcrumbContext as s,
1620
- router as t,
1621
- useAdminConfig as u
1622
- };