@questpie/admin 3.0.3 → 3.0.4

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 (249) hide show
  1. package/README.md +34 -5
  2. package/dist/client/blocks/block-renderer.d.mts +2 -2
  3. package/dist/client/blocks/block-renderer.mjs +4 -1
  4. package/dist/client/builder/types/action-types.d.mts +31 -3
  5. package/dist/client/builder/types/collection-types.d.mts +140 -0
  6. package/dist/client/builder/types/ui-config.d.mts +16 -2
  7. package/dist/client/builder/types/views.d.mts +57 -0
  8. package/dist/client/builder/types/widget-types.d.mts +5 -0
  9. package/dist/client/components/actions/action-button.mjs +137 -199
  10. package/dist/client/components/actions/action-dialog.mjs +198 -156
  11. package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
  12. package/dist/client/components/actions/header-actions.mjs +52 -53
  13. package/dist/client/components/admin-link.d.mts +2 -2
  14. package/dist/client/components/auth/auth-loading.mjs +41 -18
  15. package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
  16. package/dist/client/components/blocks/block-insert-button.mjs +4 -4
  17. package/dist/client/components/blocks/block-item.mjs +2 -2
  18. package/dist/client/components/blocks/block-library-sidebar.mjs +2 -2
  19. package/dist/client/components/component-renderer.mjs +1 -1
  20. package/dist/client/components/fields/array-field.mjs +14 -14
  21. package/dist/client/components/fields/asset-preview-field.mjs +1 -1
  22. package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
  23. package/dist/client/components/fields/json-field.mjs +2 -2
  24. package/dist/client/components/fields/object-array-field.mjs +22 -22
  25. package/dist/client/components/fields/object-field.mjs +5 -5
  26. package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
  27. package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
  28. package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
  29. package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
  30. package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
  31. package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
  32. package/dist/client/components/fields/relation-picker.mjs +7 -6
  33. package/dist/client/components/fields/relation-select.mjs +71 -47
  34. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
  35. package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
  36. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
  37. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
  38. package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
  39. package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
  40. package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
  41. package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
  42. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
  43. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
  44. package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
  45. package/dist/client/components/fields/upload-field.mjs +45 -49
  46. package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
  47. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
  48. package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
  49. package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
  50. package/dist/client/components/history-sidebar.mjs +850 -340
  51. package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
  52. package/dist/client/components/locale-switcher.mjs +8 -8
  53. package/dist/client/components/media/media-grid.mjs +12 -9
  54. package/dist/client/components/media/media-picker-dialog.mjs +242 -230
  55. package/dist/client/components/preview/live-preview-mode.mjs +1 -1
  56. package/dist/client/components/primitives/asset-preview.mjs +37 -22
  57. package/dist/client/components/primitives/date-input.mjs +212 -249
  58. package/dist/client/components/primitives/dropzone.mjs +192 -159
  59. package/dist/client/components/primitives/field-select-control.mjs +93 -0
  60. package/dist/client/components/primitives/select-multi.mjs +251 -230
  61. package/dist/client/components/primitives/select-single.mjs +345 -290
  62. package/dist/client/components/primitives/time-input.mjs +2 -2
  63. package/dist/client/components/sheets/resource-sheet.mjs +2 -0
  64. package/dist/client/components/ui/accordion.mjs +4 -4
  65. package/dist/client/components/ui/alert.mjs +3 -3
  66. package/dist/client/components/ui/badge.mjs +4 -4
  67. package/dist/client/components/ui/button.mjs +47 -37
  68. package/dist/client/components/ui/card.mjs +2 -2
  69. package/dist/client/components/ui/checkbox.mjs +1 -1
  70. package/dist/client/components/ui/command.mjs +5 -5
  71. package/dist/client/components/ui/dialog.mjs +3 -3
  72. package/dist/client/components/ui/drawer.mjs +1 -1
  73. package/dist/client/components/ui/dropdown-menu.mjs +157 -15
  74. package/dist/client/components/ui/empty-state.mjs +88 -59
  75. package/dist/client/components/ui/field.mjs +2 -2
  76. package/dist/client/components/ui/input-group.mjs +3 -3
  77. package/dist/client/components/ui/input.mjs +1 -1
  78. package/dist/client/components/ui/kbd.mjs +1 -1
  79. package/dist/client/components/ui/label.mjs +1 -1
  80. package/dist/client/components/ui/popover.mjs +19 -11
  81. package/dist/client/components/ui/scroll-fade.mjs +170 -0
  82. package/dist/client/components/ui/search-input.mjs +1 -1
  83. package/dist/client/components/ui/select.mjs +129 -27
  84. package/dist/client/components/ui/sheet.mjs +54 -34
  85. package/dist/client/components/ui/sidebar.mjs +15 -14
  86. package/dist/client/components/ui/skeleton.mjs +28 -12
  87. package/dist/client/components/ui/switch.mjs +2 -2
  88. package/dist/client/components/ui/table.mjs +82 -74
  89. package/dist/client/components/ui/tabs.mjs +26 -31
  90. package/dist/client/components/ui/textarea.mjs +1 -1
  91. package/dist/client/components/ui/tooltip.mjs +1 -1
  92. package/dist/client/components/widgets/chart-widget.mjs +134 -96
  93. package/dist/client/components/widgets/progress-widget.mjs +59 -34
  94. package/dist/client/components/widgets/quick-actions-widget.mjs +184 -113
  95. package/dist/client/components/widgets/recent-items-widget.mjs +144 -102
  96. package/dist/client/components/widgets/stats-widget.mjs +91 -72
  97. package/dist/client/components/widgets/table-widget.mjs +159 -246
  98. package/dist/client/components/widgets/timeline-widget.mjs +66 -43
  99. package/dist/client/components/widgets/value-widget.mjs +261 -152
  100. package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
  101. package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
  102. package/dist/client/contexts/focus-context.d.mts +2 -2
  103. package/dist/client/hooks/use-action.mjs +63 -55
  104. package/dist/client/hooks/use-audit-history.mjs +1 -65
  105. package/dist/client/hooks/use-collection-validation.mjs +36 -23
  106. package/dist/client/hooks/use-collection.mjs +96 -1
  107. package/dist/client/hooks/use-saved-views.mjs +70 -49
  108. package/dist/client/hooks/use-server-actions.mjs +59 -40
  109. package/dist/client/hooks/use-server-validation.mjs +156 -41
  110. package/dist/client/hooks/use-server-widget-data.mjs +1 -1
  111. package/dist/client/hooks/use-setup-status.d.mts +3 -3
  112. package/dist/client/hooks/use-setup-status.mjs +2 -2
  113. package/dist/client/hooks/use-transition-stage.mjs +2 -10
  114. package/dist/client/hooks/use-validation-error-map.mjs +31 -13
  115. package/dist/client/hooks/use-view-state.mjs +238 -174
  116. package/dist/client/i18n/date-locale.mjs +33 -0
  117. package/dist/client/i18n/hooks.mjs +17 -1
  118. package/dist/client/lib/utils.mjs +3 -2
  119. package/dist/client/preview/block-scope-context.d.mts +2 -2
  120. package/dist/client/preview/preview-banner.d.mts +2 -2
  121. package/dist/client/preview/preview-field.d.mts +4 -4
  122. package/dist/client/preview/preview-field.mjs +2 -2
  123. package/dist/client/runtime/provider.mjs +8 -1
  124. package/dist/client/runtime/translations-provider.mjs +1 -1
  125. package/dist/client/scope/picker.d.mts +2 -2
  126. package/dist/client/scope/provider.d.mts +2 -2
  127. package/dist/client/styles/base.css +1022 -0
  128. package/dist/client/styles/index.css +3 -589
  129. package/dist/client/utils/auto-expand-fields.mjs +4 -2
  130. package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
  131. package/dist/client/utils/use-lazy-component.mjs +80 -0
  132. package/dist/client/views/auth/auth-layout.d.mts +18 -11
  133. package/dist/client/views/auth/auth-layout.mjs +291 -80
  134. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  135. package/dist/client/views/auth/forgot-password-form.mjs +2 -2
  136. package/dist/client/views/auth/login-form.d.mts +2 -2
  137. package/dist/client/views/auth/login-form.mjs +1 -1
  138. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  139. package/dist/client/views/auth/reset-password-form.mjs +2 -2
  140. package/dist/client/views/auth/setup-form.d.mts +2 -2
  141. package/dist/client/views/collection/auto-form-fields.mjs +11 -9
  142. package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
  143. package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
  144. package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
  145. package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
  146. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
  147. package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
  148. package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
  149. package/dist/client/views/collection/columns/build-columns.mjs +29 -9
  150. package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
  151. package/dist/client/views/collection/field-renderer.mjs +50 -89
  152. package/dist/client/views/collection/form-view.mjs +237 -227
  153. package/dist/client/views/collection/table-view.mjs +1162 -229
  154. package/dist/client/views/collection/view-skeletons.mjs +222 -79
  155. package/dist/client/views/common/global-search.mjs +29 -18
  156. package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
  157. package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
  158. package/dist/client/views/dashboard/widget-card.mjs +23 -14
  159. package/dist/client/views/globals/global-form-view.mjs +634 -589
  160. package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
  161. package/dist/client/views/layout/admin-layout.d.mts +3 -6
  162. package/dist/client/views/layout/admin-layout.mjs +149 -172
  163. package/dist/client/views/layout/admin-router.mjs +747 -544
  164. package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
  165. package/dist/client/views/layout/admin-sidebar.mjs +751 -591
  166. package/dist/client/views/layout/admin-theme.d.mts +10 -0
  167. package/dist/client/views/layout/admin-theme.mjs +84 -0
  168. package/dist/client/views/layout/admin-view-layout.mjs +161 -0
  169. package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
  170. package/dist/client/views/pages/accept-invite-page.mjs +49 -26
  171. package/dist/client/views/pages/dashboard-page.d.mts +2 -2
  172. package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
  173. package/dist/client/views/pages/forgot-password-page.mjs +2 -19
  174. package/dist/client/views/pages/invite-page.d.mts +2 -2
  175. package/dist/client/views/pages/invite-page.mjs +2 -19
  176. package/dist/client/views/pages/login-page.d.mts +1 -1
  177. package/dist/client/views/pages/login-page.mjs +4 -21
  178. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  179. package/dist/client/views/pages/reset-password-page.mjs +3 -20
  180. package/dist/client/views/pages/setup-page.d.mts +2 -2
  181. package/dist/client/views/pages/setup-page.mjs +3 -20
  182. package/dist/client.d.mts +6 -2
  183. package/dist/client.mjs +2 -1
  184. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  185. package/dist/index.d.mts +6 -2
  186. package/dist/index.mjs +2 -1
  187. package/dist/server/augmentation/dashboard.d.mts +67 -3
  188. package/dist/server/augmentation/form-layout.d.mts +21 -0
  189. package/dist/server/augmentation/index.d.mts +1 -1
  190. package/dist/server/codegen/admin-client-template.mjs +4 -0
  191. package/dist/server/fields/blocks.d.mts +1 -1
  192. package/dist/server/fields/blocks.mjs +12 -0
  193. package/dist/server/fields/rich-text.d.mts +1 -1
  194. package/dist/server/fields/rich-text.mjs +8 -0
  195. package/dist/server/i18n/index.mjs +17 -1
  196. package/dist/server/i18n/messages/cs.mjs +23 -0
  197. package/dist/server/i18n/messages/de.mjs +23 -0
  198. package/dist/server/i18n/messages/en.mjs +64 -1
  199. package/dist/server/i18n/messages/es.mjs +23 -0
  200. package/dist/server/i18n/messages/fr.mjs +23 -0
  201. package/dist/server/i18n/messages/pl.mjs +23 -0
  202. package/dist/server/i18n/messages/pt.mjs +23 -0
  203. package/dist/server/i18n/messages/sk.mjs +83 -1
  204. package/dist/server/modules/admin/block/introspection.mjs +4 -1
  205. package/dist/server/modules/admin/block/prefetch.mjs +12 -2
  206. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  207. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  208. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  209. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  210. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  211. package/dist/server/modules/admin/collections/assets.d.mts +20 -20
  212. package/dist/server/modules/admin/collections/assets.mjs +0 -1
  213. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  214. package/dist/server/modules/admin/collections/user.d.mts +12 -0
  215. package/dist/server/modules/admin/collections/user.mjs +40 -9
  216. package/dist/server/modules/admin/collections/verification.d.mts +2 -2
  217. package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
  218. package/dist/server/modules/admin/factories.mjs +7 -18
  219. package/dist/server/modules/admin/index.d.mts +1 -1
  220. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  221. package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
  222. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  223. package/dist/server/modules/admin/routes/execute-action.mjs +33 -0
  224. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  225. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  226. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  227. package/dist/server/modules/admin/routes/setup.d.mts +10 -10
  228. package/dist/server/modules/admin/routes/setup.mjs +7 -7
  229. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  230. package/dist/server/modules/admin/routes/translations.mjs +5 -1
  231. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  232. package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
  233. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
  234. package/dist/server/modules/audit/.generated/module.d.mts +1 -1
  235. package/dist/server/modules/audit/.generated/module.mjs +1 -1
  236. package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
  237. package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
  238. package/dist/server/modules/audit/config/app.mjs +99 -42
  239. package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
  240. package/dist/server/plugin.mjs +4 -2
  241. package/dist/server/proxy-factories.d.mts +4 -3
  242. package/dist/server/proxy-factories.mjs +34 -8
  243. package/dist/shared/types/saved-views.types.d.mts +2 -0
  244. package/package.json +6 -4
  245. package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
  246. package/dist/client/components/ui/spinner.mjs +0 -52
  247. package/dist/client/components/ui/toolbar.mjs +0 -136
  248. package/dist/client/contexts/breadcrumb-context.mjs +0 -60
  249. package/dist/client/views/layout/admin-topbar.mjs +0 -236
@@ -1,12 +1,17 @@
1
+ import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
2
+ import { formatLabel } from "../../lib/utils.mjs";
1
3
  import { selectClient, useAdminStore } from "../../runtime/provider.mjs";
4
+ import { Button } from "../../components/ui/button.mjs";
2
5
  import { useSuspenseAdminConfig } from "../../hooks/use-admin-config.mjs";
3
6
  import { Card } from "../../components/ui/card.mjs";
7
+ import { Skeleton } from "../../components/ui/skeleton.mjs";
4
8
  import { parsePrefillParams } from "../../hooks/use-prefill-params.mjs";
5
9
  import { useCollectionSchema } from "../../hooks/use-collection-schema.mjs";
6
10
  import { getCollectionMetaQueryOptions } from "../../hooks/use-collection-meta.mjs";
7
11
  import { useGlobalSchema } from "../../hooks/use-global-schema.mjs";
8
12
  import { getGlobalMetaQueryOptions } from "../../hooks/use-global-meta.mjs";
9
- import { Skeleton } from "../../components/ui/skeleton.mjs";
13
+ import { AdminViewHeader } from "./admin-view-layout.mjs";
14
+ import { FormViewSkeleton, TableViewSkeleton } from "../collection/view-skeletons.mjs";
10
15
  import { DashboardGrid } from "../dashboard/dashboard-grid.mjs";
11
16
  import { c } from "react/compiler-runtime";
12
17
  import { Icon } from "@iconify/react";
@@ -31,12 +36,20 @@ import { jsx, jsxs } from "react/jsx-runtime";
31
36
  */
32
37
  const EMPTY_COLLECTION_COMPONENTS = {};
33
38
  const EMPTY_GLOBAL_COMPONENTS = {};
39
+ const AUTH_ROUTE_SEGMENTS = new Set([
40
+ "login",
41
+ "forgot-password",
42
+ "reset-password",
43
+ "accept-invite",
44
+ "setup"
45
+ ]);
46
+ const componentLoaderCache = /* @__PURE__ */ new WeakMap();
34
47
  /**
35
48
  * Hook that resolves router configuration using Suspense.
36
49
  * Suspends until server config is loaded - no loading checks needed.
37
50
  */
38
51
  function useRouterConfig(props) {
39
- const $ = c(19);
52
+ const $ = c(20);
40
53
  const admin = useAdminStore(_temp);
41
54
  const { data: serverConfig } = useSuspenseAdminConfig();
42
55
  let t0;
@@ -97,13 +110,15 @@ function useRouterConfig(props) {
97
110
  }
98
111
  const mergedDashboard = t2;
99
112
  const t3 = props.pages ?? storePages;
100
- let t4;
101
- if ($[12] !== mergedDashboard || $[13] !== props.DashboardComponent || $[14] !== serverCollections || $[15] !== serverGlobals || $[16] !== storeViews || $[17] !== t3) {
102
- t4 = {
113
+ const t4 = serverConfig?.branding?.name;
114
+ let t5;
115
+ if ($[12] !== mergedDashboard || $[13] !== props.DashboardComponent || $[14] !== serverCollections || $[15] !== serverGlobals || $[16] !== storeViews || $[17] !== t3 || $[18] !== t4) {
116
+ t5 = {
103
117
  collections: serverCollections,
104
118
  globals: serverGlobals,
105
119
  pages: t3,
106
120
  views: storeViews,
121
+ brandingName: t4,
107
122
  dashboardConfig: mergedDashboard,
108
123
  DashboardComponent: props.DashboardComponent
109
124
  };
@@ -114,8 +129,9 @@ function useRouterConfig(props) {
114
129
  $[16] = storeViews;
115
130
  $[17] = t3;
116
131
  $[18] = t4;
117
- } else t4 = $[18];
118
- return t4;
132
+ $[19] = t5;
133
+ } else t5 = $[19];
134
+ return t5;
119
135
  }
120
136
  function _temp(s) {
121
137
  return s.admin;
@@ -153,6 +169,24 @@ function matchRoute(segments, _collections = {}, globals = {}, pages = {}) {
153
169
  }
154
170
  return { type: "not-found" };
155
171
  }
172
+ function formatDocumentTitle(pageTitle, appTitle) {
173
+ const title = pageTitle.trim();
174
+ const app = appTitle.trim() || "Admin";
175
+ if (!title || title === app) return app;
176
+ return `${title} | ${app}`;
177
+ }
178
+ function setDocumentMetaDescription(description) {
179
+ const content = description.trim();
180
+ if (!content) return;
181
+ let meta = document.querySelector("meta[name=\"description\"]");
182
+ if (!meta) {
183
+ meta = document.createElement("meta");
184
+ meta.name = "description";
185
+ meta.setAttribute("data-questpie-admin", "true");
186
+ document.head.appendChild(meta);
187
+ }
188
+ meta.content = content;
189
+ }
156
190
  /**
157
191
  * Find the first registered view of a given kind from the views registry.
158
192
  * Used as a fallback when no explicit view is configured on a collection/global.
@@ -192,20 +226,24 @@ function isDynamicImportLoader(loader) {
192
226
  if (candidate.$$typeof) return false;
193
227
  return loader.length === 0;
194
228
  }
195
- function ViewLoadingState() {
196
- const $ = c(1);
197
- let t0;
198
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
199
- t0 = /* @__PURE__ */ jsx("div", {
200
- className: "text-muted-foreground flex h-64 items-center justify-center",
201
- children: /* @__PURE__ */ jsx(Icon, {
202
- icon: "ph:spinner-gap",
203
- className: "size-6 animate-spin"
204
- })
205
- });
206
- $[0] = t0;
207
- } else t0 = $[0];
208
- return t0;
229
+ function getCachedComponent(loader) {
230
+ if (!isDynamicImportLoader(loader)) return void 0;
231
+ return componentLoaderCache.get(loader);
232
+ }
233
+ function cacheComponent(loader, Component) {
234
+ if (!isDynamicImportLoader(loader)) return;
235
+ componentLoaderCache.set(loader, Component);
236
+ }
237
+ function ViewLoadingState(t0) {
238
+ const $ = c(2);
239
+ const { viewKind } = t0;
240
+ let t1;
241
+ if ($[0] !== viewKind) {
242
+ t1 = viewKind === "list" ? /* @__PURE__ */ jsx(TableViewSkeleton, {}) : /* @__PURE__ */ jsx(FormViewSkeleton, {});
243
+ $[0] = viewKind;
244
+ $[1] = t1;
245
+ } else t1 = $[1];
246
+ return t1;
209
247
  }
210
248
  function UnknownViewState(t0) {
211
249
  const $ = c(7);
@@ -288,6 +326,79 @@ function RouterSkeleton() {
288
326
  } else t2 = $[2];
289
327
  return t2;
290
328
  }
329
+ function AuthPageSkeleton() {
330
+ const $ = c(3);
331
+ let t0;
332
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
333
+ t0 = /* @__PURE__ */ jsxs("aside", {
334
+ className: "qa-auth-layout__brand flex flex-col items-center justify-center gap-8",
335
+ children: [/* @__PURE__ */ jsxs("div", {
336
+ className: "flex items-center gap-3",
337
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-9" }), /* @__PURE__ */ jsx(Skeleton, {
338
+ variant: "text",
339
+ className: "h-4 w-36"
340
+ })]
341
+ }), /* @__PURE__ */ jsx(Skeleton, {
342
+ variant: "text",
343
+ className: "hidden h-3 w-40 lg:block"
344
+ })]
345
+ });
346
+ $[0] = t0;
347
+ } else t0 = $[0];
348
+ let t1;
349
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
350
+ t1 = /* @__PURE__ */ jsxs("div", {
351
+ className: "space-y-2",
352
+ children: [/* @__PURE__ */ jsx(Skeleton, {
353
+ variant: "text",
354
+ className: "h-4 w-20"
355
+ }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
356
+ });
357
+ $[1] = t1;
358
+ } else t1 = $[1];
359
+ let t2;
360
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
361
+ t2 = /* @__PURE__ */ jsx("div", {
362
+ className: "qa-auth-layout bg-background text-foreground relative flex min-h-screen items-center justify-center overflow-hidden px-5 py-8 sm:px-8",
363
+ children: /* @__PURE__ */ jsxs("div", {
364
+ className: "qa-auth-layout__shell grid w-full max-w-4xl items-center gap-10 lg:grid-cols-[minmax(220px,280px)_minmax(360px,384px)] lg:gap-16",
365
+ children: [t0, /* @__PURE__ */ jsx("main", {
366
+ className: "qa-auth-layout__form-panel flex items-center justify-center",
367
+ children: /* @__PURE__ */ jsx(Card, {
368
+ className: "border-border-subtle w-full max-w-sm shadow-none",
369
+ children: /* @__PURE__ */ jsxs("div", {
370
+ className: "space-y-5 p-4",
371
+ children: [
372
+ t1,
373
+ /* @__PURE__ */ jsxs("div", {
374
+ className: "space-y-2",
375
+ children: [/* @__PURE__ */ jsx(Skeleton, {
376
+ variant: "text",
377
+ className: "h-4 w-24"
378
+ }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
379
+ }),
380
+ /* @__PURE__ */ jsx(Skeleton, {
381
+ variant: "text",
382
+ className: "h-4 w-28"
383
+ }),
384
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
385
+ ]
386
+ })
387
+ })
388
+ })]
389
+ })
390
+ });
391
+ $[2] = t2;
392
+ } else t2 = $[2];
393
+ return t2;
394
+ }
395
+ function getFallbackForSegments(segments) {
396
+ const [first, second, third] = segments;
397
+ if (first && AUTH_ROUTE_SEGMENTS.has(first)) return /* @__PURE__ */ jsx(AuthPageSkeleton, {});
398
+ if (first === "collections" && second) return third ? /* @__PURE__ */ jsx(FormViewSkeleton, {}) : /* @__PURE__ */ jsx(TableViewSkeleton, {});
399
+ if (first === "globals" && second) return /* @__PURE__ */ jsx(FormViewSkeleton, {});
400
+ return /* @__PURE__ */ jsx(RouterSkeleton, {});
401
+ }
291
402
  function shallowEqualComponentProps(a, b) {
292
403
  if (a === b) return true;
293
404
  const aKeys = Object.keys(a);
@@ -303,21 +414,25 @@ function areRegistryViewRendererPropsEqual(prev, next) {
303
414
  return shallowEqualComponentProps(prev.componentProps, next.componentProps);
304
415
  }
305
416
  const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1(t0) {
306
- const $ = c(12);
417
+ const $ = c(18);
307
418
  const { loader, componentProps, viewKind, viewId } = t0;
308
419
  let t1;
309
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
310
- t1 = {
311
- Component: null,
312
- loading: true,
313
- error: null
420
+ if ($[0] !== loader) {
421
+ t1 = () => {
422
+ const cachedComponent = getCachedComponent(loader);
423
+ return {
424
+ Component: cachedComponent ?? null,
425
+ loading: !cachedComponent,
426
+ error: null
427
+ };
314
428
  };
315
- $[0] = t1;
316
- } else t1 = $[0];
429
+ $[0] = loader;
430
+ $[1] = t1;
431
+ } else t1 = $[1];
317
432
  const [state, setState] = React.useState(t1);
318
433
  let t2;
319
434
  let t3;
320
- if ($[1] !== loader) {
435
+ if ($[2] !== loader) {
321
436
  t2 = () => {
322
437
  if (!loader) {
323
438
  setState({
@@ -335,6 +450,15 @@ const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1(t0) {
335
450
  });
336
451
  return;
337
452
  }
453
+ const cachedComponent_0 = getCachedComponent(loader);
454
+ if (cachedComponent_0) {
455
+ setState({
456
+ Component: cachedComponent_0,
457
+ loading: false,
458
+ error: null
459
+ });
460
+ return;
461
+ }
338
462
  let mounted = true;
339
463
  setState(_temp2);
340
464
  (async () => {
@@ -344,6 +468,7 @@ const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1(t0) {
344
468
  let Component;
345
469
  if (result.default) Component = result.default;
346
470
  else Component = result;
471
+ cacheComponent(loader, Component);
347
472
  setState({
348
473
  Component,
349
474
  loading: false,
@@ -367,55 +492,64 @@ const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1(t0) {
367
492
  };
368
493
  };
369
494
  t3 = [loader];
370
- $[1] = loader;
371
- $[2] = t2;
372
- $[3] = t3;
495
+ $[2] = loader;
496
+ $[3] = t2;
497
+ $[4] = t3;
373
498
  } else {
374
- t2 = $[2];
375
- t3 = $[3];
499
+ t2 = $[3];
500
+ t3 = $[4];
376
501
  }
377
502
  React.useEffect(t2, t3);
378
503
  if (state.loading) {
379
504
  let t4$1;
380
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
381
- t4$1 = /* @__PURE__ */ jsx(ViewLoadingState, {});
382
- $[4] = t4$1;
383
- } else t4$1 = $[4];
505
+ if ($[5] !== viewKind) {
506
+ t4$1 = /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
507
+ $[5] = viewKind;
508
+ $[6] = t4$1;
509
+ } else t4$1 = $[6];
384
510
  return t4$1;
385
511
  }
386
512
  if (state.error || !state.Component) {
387
513
  let t4$1;
388
- if ($[5] !== viewId || $[6] !== viewKind) {
514
+ if ($[7] !== viewId || $[8] !== viewKind) {
389
515
  t4$1 = /* @__PURE__ */ jsx(UnknownViewState, {
390
516
  viewKind,
391
517
  viewId
392
518
  });
393
- $[5] = viewId;
394
- $[6] = viewKind;
395
- $[7] = t4$1;
396
- } else t4$1 = $[7];
519
+ $[7] = viewId;
520
+ $[8] = viewKind;
521
+ $[9] = t4$1;
522
+ } else t4$1 = $[9];
397
523
  return t4$1;
398
524
  }
399
525
  const Component_0 = state.Component;
400
526
  let t4;
401
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
402
- t4 = /* @__PURE__ */ jsx(ViewLoadingState, {});
403
- $[8] = t4;
404
- } else t4 = $[8];
527
+ if ($[10] !== viewKind) {
528
+ t4 = /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
529
+ $[10] = viewKind;
530
+ $[11] = t4;
531
+ } else t4 = $[11];
405
532
  let t5;
406
- if ($[9] !== Component_0 || $[10] !== componentProps) {
407
- t5 = /* @__PURE__ */ jsx(React.Suspense, {
533
+ if ($[12] !== Component_0 || $[13] !== componentProps) {
534
+ t5 = /* @__PURE__ */ jsx(Component_0, { ...componentProps });
535
+ $[12] = Component_0;
536
+ $[13] = componentProps;
537
+ $[14] = t5;
538
+ } else t5 = $[14];
539
+ let t6;
540
+ if ($[15] !== t4 || $[16] !== t5) {
541
+ t6 = /* @__PURE__ */ jsx(React.Suspense, {
408
542
  fallback: t4,
409
- children: /* @__PURE__ */ jsx(Component_0, { ...componentProps })
543
+ children: t5
410
544
  });
411
- $[9] = Component_0;
412
- $[10] = componentProps;
413
- $[11] = t5;
414
- } else t5 = $[11];
415
- return t5;
545
+ $[15] = t4;
546
+ $[16] = t5;
547
+ $[17] = t6;
548
+ } else t6 = $[17];
549
+ return t6;
416
550
  }, areRegistryViewRendererPropsEqual);
417
551
  function DefaultDashboard() {
418
- const $ = c(4);
552
+ const $ = c(3);
419
553
  let t0;
420
554
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
421
555
  t0 = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
@@ -429,57 +563,44 @@ function DefaultDashboard() {
429
563
  const date = t0;
430
564
  let t1;
431
565
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
432
- t1 = /* @__PURE__ */ jsx("div", {
433
- className: "mb-8 flex items-end justify-between",
434
- children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h1", {
435
- className: "text-3xl font-bold tracking-tight",
436
- children: "Dashboard"
437
- }), /* @__PURE__ */ jsx("p", {
438
- className: "text-muted-foreground mt-1 font-mono text-xs tracking-widest uppercase",
439
- children: date
440
- })] })
566
+ t1 = /* @__PURE__ */ jsx(AdminViewHeader, {
567
+ className: "mb-4",
568
+ title: "Dashboard",
569
+ meta: date
441
570
  });
442
571
  $[1] = t1;
443
572
  } else t1 = $[1];
444
573
  let t2;
445
574
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
446
- t2 = /* @__PURE__ */ jsx("div", { className: "bg-primary/10 absolute -top-12 -right-12 h-32 w-32 rounded-full blur-3xl" });
447
- $[2] = t2;
448
- } else t2 = $[2];
449
- let t3;
450
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
451
- t3 = /* @__PURE__ */ jsxs("div", {
575
+ t2 = /* @__PURE__ */ jsxs("div", {
452
576
  className: "qa-default-dashboard container",
453
577
  children: [t1, /* @__PURE__ */ jsx("div", {
454
578
  className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",
455
- children: /* @__PURE__ */ jsxs(Card, {
456
- className: "relative overflow-hidden p-6",
457
- children: [t2, /* @__PURE__ */ jsxs("div", {
458
- className: "relative",
459
- children: [
460
- /* @__PURE__ */ jsxs("div", {
461
- className: "mb-4 flex items-center gap-3",
462
- children: [/* @__PURE__ */ jsx("div", { className: "bg-primary h-2 w-2 rounded-full" }), /* @__PURE__ */ jsx("h3", {
463
- className: "text-primary font-mono text-xs font-bold tracking-widest uppercase",
464
- children: "System Status"
465
- })]
466
- }),
467
- /* @__PURE__ */ jsx("h2", {
468
- className: "mb-2 text-xl font-bold",
469
- children: "Welcome back"
470
- }),
471
- /* @__PURE__ */ jsx("p", {
472
- className: "text-muted-foreground text-sm leading-relaxed",
473
- children: "Select a collection from the sidebar to manage your content."
474
- })
475
- ]
476
- })]
579
+ children: /* @__PURE__ */ jsx(Card, {
580
+ className: "p-6",
581
+ children: /* @__PURE__ */ jsxs("div", { children: [
582
+ /* @__PURE__ */ jsxs("div", {
583
+ className: "mb-4 flex items-center gap-3",
584
+ children: [/* @__PURE__ */ jsx("div", { className: "bg-primary h-2 w-2 rounded-full" }), /* @__PURE__ */ jsx("h3", {
585
+ className: "text-muted-foreground font-chrome chrome-meta text-xs font-medium",
586
+ children: "System Status"
587
+ })]
588
+ }),
589
+ /* @__PURE__ */ jsx("h2", {
590
+ className: "mb-2 text-xl font-semibold",
591
+ children: "Welcome back"
592
+ }),
593
+ /* @__PURE__ */ jsx("p", {
594
+ className: "text-muted-foreground text-sm leading-relaxed",
595
+ children: "Select a collection from the sidebar to manage your content."
596
+ })
597
+ ] })
477
598
  })
478
599
  })]
479
600
  });
480
- $[3] = t3;
481
- } else t3 = $[3];
482
- return t3;
601
+ $[2] = t2;
602
+ } else t2 = $[2];
603
+ return t2;
483
604
  }
484
605
  function DefaultNotFound() {
485
606
  const $ = c(1);
@@ -500,42 +621,31 @@ function DefaultNotFound() {
500
621
  return t0;
501
622
  }
502
623
  function RestrictedAccess(t0) {
503
- const $ = c(18);
624
+ const $ = c(16);
504
625
  const { type, name, navigate, basePath } = t0;
505
626
  let t1;
506
627
  let t2;
507
628
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
508
- t1 = /* @__PURE__ */ jsx("div", { className: "bg-muted absolute -top-16 -right-16 h-40 w-40 rounded-full blur-3xl" });
509
- t2 = /* @__PURE__ */ jsx("div", { className: "bg-muted absolute -bottom-16 -left-16 h-40 w-40 rounded-full blur-3xl" });
510
- $[0] = t1;
511
- $[1] = t2;
512
- } else {
513
- t1 = $[0];
514
- t2 = $[1];
515
- }
516
- let t3;
517
- let t4;
518
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
519
- t3 = /* @__PURE__ */ jsx("div", {
629
+ t1 = /* @__PURE__ */ jsx("div", {
520
630
  className: "bg-muted mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-full",
521
631
  children: /* @__PURE__ */ jsx(Icon, {
522
632
  icon: "ph:lock-simple",
523
633
  className: "text-muted-foreground h-8 w-8"
524
634
  })
525
635
  });
526
- t4 = /* @__PURE__ */ jsx("h1", {
636
+ t2 = /* @__PURE__ */ jsx("h1", {
527
637
  className: "mb-2 text-xl font-semibold",
528
638
  children: "Access Restricted"
529
639
  });
530
- $[2] = t3;
531
- $[3] = t4;
640
+ $[0] = t1;
641
+ $[1] = t2;
532
642
  } else {
533
- t3 = $[2];
534
- t4 = $[3];
643
+ t1 = $[0];
644
+ t2 = $[1];
535
645
  }
536
- let t5;
537
- if ($[4] !== name) {
538
- t5 = /* @__PURE__ */ jsxs("span", {
646
+ let t3;
647
+ if ($[2] !== name) {
648
+ t3 = /* @__PURE__ */ jsxs("span", {
539
649
  className: "text-foreground font-mono",
540
650
  children: [
541
651
  "\"",
@@ -543,93 +653,111 @@ function RestrictedAccess(t0) {
543
653
  "\""
544
654
  ]
545
655
  });
546
- $[4] = name;
547
- $[5] = t5;
548
- } else t5 = $[5];
549
- let t6;
550
- if ($[6] !== t5 || $[7] !== type) {
551
- t6 = /* @__PURE__ */ jsxs("p", {
656
+ $[2] = name;
657
+ $[3] = t3;
658
+ } else t3 = $[3];
659
+ let t4;
660
+ if ($[4] !== t3 || $[5] !== type) {
661
+ t4 = /* @__PURE__ */ jsxs("p", {
552
662
  className: "text-muted-foreground mb-6 text-sm",
553
663
  children: [
554
664
  "The ",
555
665
  type,
556
666
  " ",
557
- t5,
667
+ t3,
558
668
  " is not available in the admin panel. It may be hidden or you don't have permission to access it."
559
669
  ]
560
670
  });
561
- $[6] = t5;
562
- $[7] = type;
563
- $[8] = t6;
564
- } else t6 = $[8];
565
- let t7;
566
- if ($[9] !== basePath || $[10] !== navigate) {
567
- t7 = () => navigate(basePath);
568
- $[9] = basePath;
569
- $[10] = navigate;
570
- $[11] = t7;
571
- } else t7 = $[11];
572
- let t8;
573
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
574
- t8 = /* @__PURE__ */ jsx(Icon, {
671
+ $[4] = t3;
672
+ $[5] = type;
673
+ $[6] = t4;
674
+ } else t4 = $[6];
675
+ let t5;
676
+ if ($[7] !== basePath || $[8] !== navigate) {
677
+ t5 = () => navigate(basePath);
678
+ $[7] = basePath;
679
+ $[8] = navigate;
680
+ $[9] = t5;
681
+ } else t5 = $[9];
682
+ let t6;
683
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
684
+ t6 = /* @__PURE__ */ jsx(Icon, {
575
685
  icon: "ph:arrow-left",
576
686
  className: "h-4 w-4"
577
687
  });
578
- $[12] = t8;
579
- } else t8 = $[12];
580
- let t9;
581
- if ($[13] !== t7) {
582
- t9 = /* @__PURE__ */ jsxs("button", {
583
- type: "button",
584
- onClick: t7,
585
- className: "bg-primary text-primary-foreground hover:bg-primary/90 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors",
586
- children: [t8, "Back to Dashboard"]
688
+ $[10] = t6;
689
+ } else t6 = $[10];
690
+ let t7;
691
+ if ($[11] !== t5) {
692
+ t7 = /* @__PURE__ */ jsxs(Button, {
693
+ variant: "outline",
694
+ onClick: t5,
695
+ children: [t6, "Back to Dashboard"]
587
696
  });
588
- $[13] = t7;
589
- $[14] = t9;
590
- } else t9 = $[14];
591
- let t10;
592
- if ($[15] !== t6 || $[16] !== t9) {
593
- t10 = /* @__PURE__ */ jsx("div", {
697
+ $[11] = t5;
698
+ $[12] = t7;
699
+ } else t7 = $[12];
700
+ let t8;
701
+ if ($[13] !== t4 || $[14] !== t7) {
702
+ t8 = /* @__PURE__ */ jsx("div", {
594
703
  className: "qa-restricted-access container py-12",
595
- children: /* @__PURE__ */ jsxs(Card, {
596
- className: "relative mx-auto max-w-lg overflow-hidden p-8 text-center",
597
- children: [
704
+ children: /* @__PURE__ */ jsx(Card, {
705
+ className: "mx-auto max-w-lg p-8 text-center",
706
+ children: /* @__PURE__ */ jsxs("div", { children: [
598
707
  t1,
599
708
  t2,
600
- /* @__PURE__ */ jsxs("div", {
601
- className: "relative",
602
- children: [
603
- t3,
604
- t4,
605
- t6,
606
- t9
607
- ]
608
- })
609
- ]
709
+ t4,
710
+ t7
711
+ ] })
610
712
  })
611
713
  });
612
- $[15] = t6;
613
- $[16] = t9;
614
- $[17] = t10;
615
- } else t10 = $[17];
616
- return t10;
714
+ $[13] = t4;
715
+ $[14] = t7;
716
+ $[15] = t8;
717
+ } else t8 = $[15];
718
+ return t8;
617
719
  }
618
720
  function LazyPageRenderer(t0) {
619
- const $ = c(9);
721
+ const $ = c(14);
620
722
  const { config } = t0;
621
- const [Component, setComponent] = React.useState(null);
622
- const [loading, setLoading] = React.useState(true);
623
- const [error, setError] = React.useState(null);
723
+ const component = config.component;
624
724
  let t1;
725
+ if ($[0] !== component) {
726
+ t1 = () => getCachedComponent(component) ?? null;
727
+ $[0] = component;
728
+ $[1] = t1;
729
+ } else t1 = $[1];
730
+ const [Component, setComponent] = React.useState(t1);
625
731
  let t2;
626
- if ($[0] !== config.component) {
627
- t1 = () => {
732
+ if ($[2] !== Component) {
733
+ t2 = () => Component == null;
734
+ $[2] = Component;
735
+ $[3] = t2;
736
+ } else t2 = $[3];
737
+ const [loading, setLoading] = React.useState(t2);
738
+ const [error, setError] = React.useState(null);
739
+ let t3;
740
+ let t4;
741
+ if ($[4] !== component) {
742
+ t3 = () => {
628
743
  let mounted = true;
629
744
  (async function load() {
630
745
  try {
631
- if (typeof config.component === "function") {
632
- const result = config.component();
746
+ const cachedComponent = getCachedComponent(component);
747
+ if (cachedComponent) {
748
+ if (mounted) {
749
+ setComponent(() => cachedComponent);
750
+ setLoading(false);
751
+ setError(null);
752
+ }
753
+ return;
754
+ }
755
+ if (mounted) {
756
+ setLoading(true);
757
+ setError(null);
758
+ }
759
+ if (typeof component === "function") {
760
+ const result = component();
633
761
  let isThenable = false;
634
762
  if (result != null) {
635
763
  if (typeof result.then === "function") isThenable = true;
@@ -640,15 +768,16 @@ function LazyPageRenderer(t0) {
640
768
  let resolved;
641
769
  if (mod.default) resolved = mod.default;
642
770
  else resolved = mod;
771
+ cacheComponent(component, resolved);
643
772
  setComponent(() => resolved);
644
773
  }
645
- } else if (mounted) setComponent(() => config.component);
646
- } else if (config.component) {
647
- if (mounted) setComponent(() => config.component);
774
+ } else if (mounted) setComponent(() => component);
775
+ } else if (component) {
776
+ if (mounted) setComponent(() => component);
648
777
  }
649
778
  if (mounted) setLoading(false);
650
- } catch (t3$1) {
651
- const err = t3$1;
779
+ } catch (t5$1) {
780
+ const err = t5$1;
652
781
  if (mounted) {
653
782
  let resolvedError;
654
783
  if (err instanceof Error) resolvedError = err;
@@ -662,59 +791,55 @@ function LazyPageRenderer(t0) {
662
791
  mounted = false;
663
792
  };
664
793
  };
665
- t2 = [config.component];
666
- $[0] = config.component;
667
- $[1] = t1;
668
- $[2] = t2;
794
+ t4 = [component];
795
+ $[4] = component;
796
+ $[5] = t3;
797
+ $[6] = t4;
669
798
  } else {
670
- t1 = $[1];
671
- t2 = $[2];
799
+ t3 = $[5];
800
+ t4 = $[6];
672
801
  }
673
- React.useEffect(t1, t2);
802
+ React.useEffect(t3, t4);
674
803
  if (loading) {
675
- let t3$1;
676
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
677
- t3$1 = /* @__PURE__ */ jsx("div", {
678
- className: "text-muted-foreground flex h-64 items-center justify-center",
679
- children: /* @__PURE__ */ jsx(Icon, {
680
- icon: "ph:spinner-gap",
681
- className: "size-6 animate-spin"
682
- })
683
- });
684
- $[3] = t3$1;
685
- } else t3$1 = $[3];
686
- return t3$1;
804
+ let t5$1;
805
+ if ($[7] !== config.path) {
806
+ const path = config.path?.replace(/^\//, "") ?? "";
807
+ t5$1 = AUTH_ROUTE_SEGMENTS.has(path) ? /* @__PURE__ */ jsx(AuthPageSkeleton, {}) : /* @__PURE__ */ jsx(RouterSkeleton, {});
808
+ $[7] = config.path;
809
+ $[8] = t5$1;
810
+ } else t5$1 = $[8];
811
+ return t5$1;
687
812
  }
688
813
  if (error) {
689
- let t3$1;
690
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
691
- t3$1 = /* @__PURE__ */ jsx("h1", {
814
+ let t5$1;
815
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
816
+ t5$1 = /* @__PURE__ */ jsx("h1", {
692
817
  className: "text-destructive mb-4 text-2xl font-bold",
693
818
  children: "Error"
694
819
  });
695
- $[4] = t3$1;
696
- } else t3$1 = $[4];
697
- let t4;
698
- if ($[5] !== error.message) {
699
- t4 = /* @__PURE__ */ jsxs("div", {
820
+ $[9] = t5$1;
821
+ } else t5$1 = $[9];
822
+ let t6;
823
+ if ($[10] !== error.message) {
824
+ t6 = /* @__PURE__ */ jsxs("div", {
700
825
  className: "container",
701
- children: [t3$1, /* @__PURE__ */ jsx("p", {
826
+ children: [t5$1, /* @__PURE__ */ jsx("p", {
702
827
  className: "text-muted-foreground",
703
828
  children: error.message
704
829
  })]
705
830
  });
706
- $[5] = error.message;
707
- $[6] = t4;
708
- } else t4 = $[6];
709
- return t4;
831
+ $[10] = error.message;
832
+ $[11] = t6;
833
+ } else t6 = $[11];
834
+ return t6;
710
835
  }
711
- let t3;
712
- if ($[7] !== Component) {
713
- t3 = Component ? /* @__PURE__ */ jsx(Component, {}) : /* @__PURE__ */ jsx(DefaultNotFound, {});
714
- $[7] = Component;
715
- $[8] = t3;
716
- } else t3 = $[8];
717
- return t3;
836
+ let t5;
837
+ if ($[12] !== Component) {
838
+ t5 = Component ? /* @__PURE__ */ jsx(Component, {}) : /* @__PURE__ */ jsx(DefaultNotFound, {});
839
+ $[12] = Component;
840
+ $[13] = t5;
841
+ } else t5 = $[13];
842
+ return t5;
718
843
  }
719
844
  /**
720
845
  * AdminRouter Component
@@ -723,29 +848,37 @@ function LazyPageRenderer(t0) {
723
848
  * Uses Suspense internally - shows skeleton while config loads.
724
849
  */
725
850
  function AdminRouter(props) {
726
- const $ = c(3);
851
+ const $ = c(7);
727
852
  let t0;
728
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
729
- t0 = /* @__PURE__ */ jsx(RouterSkeleton, {});
730
- $[0] = t0;
731
- } else t0 = $[0];
853
+ if ($[0] !== props.segments) {
854
+ t0 = getFallbackForSegments(props.segments);
855
+ $[0] = props.segments;
856
+ $[1] = t0;
857
+ } else t0 = $[1];
732
858
  let t1;
733
- if ($[1] !== props) {
734
- t1 = /* @__PURE__ */ jsx(React.Suspense, {
859
+ if ($[2] !== props) {
860
+ t1 = /* @__PURE__ */ jsx(AdminRouterInner, { ...props });
861
+ $[2] = props;
862
+ $[3] = t1;
863
+ } else t1 = $[3];
864
+ let t2;
865
+ if ($[4] !== t0 || $[5] !== t1) {
866
+ t2 = /* @__PURE__ */ jsx(React.Suspense, {
735
867
  fallback: t0,
736
- children: /* @__PURE__ */ jsx(AdminRouterInner, { ...props })
868
+ children: t1
737
869
  });
738
- $[1] = props;
739
- $[2] = t1;
740
- } else t1 = $[2];
741
- return t1;
870
+ $[4] = t0;
871
+ $[5] = t1;
872
+ $[6] = t2;
873
+ } else t2 = $[6];
874
+ return t2;
742
875
  }
743
876
  /**
744
877
  * Inner router component that uses Suspense for data loading.
745
878
  * Guaranteed to have config loaded when rendering.
746
879
  */
747
880
  function AdminRouterInner(t0) {
748
- const $ = c(134);
881
+ const $ = c(153);
749
882
  const { segments, navigate, basePath: t1, searchParams: searchParamsProp, collections: collectionsProp, globals: globalsProp, pages: pagesProp, DashboardComponent: DashboardComponentProp, dashboardConfig: dashboardConfigProp, collectionComponents, globalComponents, registry, NotFoundComponent } = t0;
750
883
  const basePath = t1 === void 0 ? "/admin" : t1;
751
884
  const resolvedCollectionComponents = collectionComponents ?? EMPTY_COLLECTION_COMPONENTS;
@@ -796,7 +929,7 @@ function AdminRouterInner(t0) {
796
929
  $[8] = pagesProp;
797
930
  $[9] = t4;
798
931
  } else t4 = $[9];
799
- const { collections, globals, pages, views, dashboardConfig, DashboardComponent } = useRouterConfig(t4);
932
+ const { collections, globals, pages, views, brandingName, dashboardConfig, DashboardComponent } = useRouterConfig(t4);
800
933
  let t5;
801
934
  if ($[10] !== collections || $[11] !== globals || $[12] !== pages || $[13] !== segments) {
802
935
  t5 = matchRoute(segments, collections, globals, pages);
@@ -829,263 +962,327 @@ function AdminRouterInner(t0) {
829
962
  $[18] = t9;
830
963
  } else t9 = $[18];
831
964
  const { data: activeGlobalSchema } = useGlobalSchema(activeGlobalName, t9);
965
+ const { t } = useTranslation();
966
+ const resolveText = useResolveText();
832
967
  let t10;
833
- if ($[19] !== segments) {
834
- t10 = segments.join("/");
835
- $[19] = segments;
836
- $[20] = t10;
837
- } else t10 = $[20];
838
- const routeKey = t10;
839
- let t11;
840
- if ($[21] !== route.name || $[22] !== route.type) {
841
- t11 = () => {
842
- let pageTitle = "Admin";
843
- bb54: switch (route.type) {
968
+ if ($[19] !== activeCollectionSchema || $[20] !== activeGlobalSchema || $[21] !== brandingName || $[22] !== collections || $[23] !== dashboardConfig?.description || $[24] !== dashboardConfig?.title || $[25] !== globals || $[26] !== resolveText || $[27] !== route.config || $[28] !== route.name || $[29] !== route.type || $[30] !== t) {
969
+ t10 = () => {
970
+ const appTitle = resolveText(brandingName, "Admin");
971
+ let pageTitle = t("dashboard.title");
972
+ let metaDescription = pageTitle;
973
+ const resolveResourceLabel = (config, schemaConfig, fallback) => resolveText(config?.label ?? config?.meta?.label ?? schemaConfig?.label, formatLabel(fallback));
974
+ const resolveResourceDescription = (config_0, schemaConfig_0) => resolveText(config_0?.description ?? config_0?.meta?.description ?? schemaConfig_0?.description).trim();
975
+ bb104: switch (route.type) {
844
976
  case "dashboard":
845
- pageTitle = "Dashboard";
846
- break bb54;
847
- case "collection-list":
848
- pageTitle = `${route.name} — List`;
849
- break bb54;
850
- case "collection-create":
851
- pageTitle = `${route.name} — Create`;
852
- break bb54;
853
- case "collection-edit":
854
- pageTitle = `${route.name} — Edit`;
855
- break bb54;
856
- case "global-edit":
857
- pageTitle = `${route.name} — Settings`;
858
- break bb54;
859
- case "page": pageTitle = route.name;
977
+ pageTitle = resolveText(dashboardConfig?.title, t("dashboard.title"));
978
+ metaDescription = resolveText(dashboardConfig?.description).trim() || pageTitle;
979
+ break bb104;
980
+ case "collection-list": {
981
+ const config_4 = collections[route.name];
982
+ const schemaConfig_4 = activeCollectionSchema?.admin?.config;
983
+ const label_2 = resolveResourceLabel(config_4, schemaConfig_4, route.name);
984
+ pageTitle = label_2;
985
+ metaDescription = resolveResourceDescription(config_4, schemaConfig_4) || t("collection.list", { name: label_2 });
986
+ break bb104;
987
+ }
988
+ case "collection-create": {
989
+ const config_3 = collections[route.name];
990
+ const schemaConfig_3 = activeCollectionSchema?.admin?.config;
991
+ const label_1 = resolveResourceLabel(config_3, schemaConfig_3, route.name);
992
+ pageTitle = `${label_1}: ${t("common.create")}`;
993
+ metaDescription = resolveResourceDescription(config_3, schemaConfig_3) || t("collection.create", { name: label_1 });
994
+ break bb104;
995
+ }
996
+ case "collection-edit": {
997
+ const config_2 = collections[route.name];
998
+ const schemaConfig_2 = activeCollectionSchema?.admin?.config;
999
+ const label_0 = resolveResourceLabel(config_2, schemaConfig_2, route.name);
1000
+ pageTitle = `${label_0}: ${t("common.edit")}`;
1001
+ metaDescription = resolveResourceDescription(config_2, schemaConfig_2) || t("collection.edit", { name: label_0 });
1002
+ break bb104;
1003
+ }
1004
+ case "global-edit": {
1005
+ const config_1 = globals[route.name];
1006
+ const schemaConfig_1 = activeGlobalSchema?.admin?.config;
1007
+ const label = resolveResourceLabel(config_1, schemaConfig_1, route.name);
1008
+ pageTitle = label;
1009
+ metaDescription = resolveResourceDescription(config_1, schemaConfig_1) || label;
1010
+ break bb104;
1011
+ }
1012
+ case "page":
1013
+ pageTitle = resolveText(route.config.label, formatLabel(route.name));
1014
+ metaDescription = pageTitle;
1015
+ break bb104;
1016
+ case "not-found":
1017
+ pageTitle = t("error.notFound");
1018
+ metaDescription = pageTitle;
860
1019
  }
861
- document.title = pageTitle;
862
- const main = document.getElementById("main-content");
863
- if (main) requestAnimationFrame(() => {
864
- main.focus({ preventScroll: true });
865
- });
1020
+ document.title = formatDocumentTitle(pageTitle, appTitle);
1021
+ setDocumentMetaDescription(metaDescription || pageTitle);
866
1022
  };
867
- $[21] = route.name;
868
- $[22] = route.type;
869
- $[23] = t11;
870
- } else t11 = $[23];
1023
+ $[19] = activeCollectionSchema;
1024
+ $[20] = activeGlobalSchema;
1025
+ $[21] = brandingName;
1026
+ $[22] = collections;
1027
+ $[23] = dashboardConfig?.description;
1028
+ $[24] = dashboardConfig?.title;
1029
+ $[25] = globals;
1030
+ $[26] = resolveText;
1031
+ $[27] = route.config;
1032
+ $[28] = route.name;
1033
+ $[29] = route.type;
1034
+ $[30] = t;
1035
+ $[31] = t10;
1036
+ } else t10 = $[31];
1037
+ let t11;
1038
+ if ($[32] !== activeCollectionSchema || $[33] !== activeGlobalSchema || $[34] !== brandingName || $[35] !== collections || $[36] !== dashboardConfig || $[37] !== globals || $[38] !== resolveText || $[39] !== route || $[40] !== t) {
1039
+ t11 = [
1040
+ activeCollectionSchema,
1041
+ activeGlobalSchema,
1042
+ brandingName,
1043
+ collections,
1044
+ dashboardConfig,
1045
+ globals,
1046
+ resolveText,
1047
+ route,
1048
+ t
1049
+ ];
1050
+ $[32] = activeCollectionSchema;
1051
+ $[33] = activeGlobalSchema;
1052
+ $[34] = brandingName;
1053
+ $[35] = collections;
1054
+ $[36] = dashboardConfig;
1055
+ $[37] = globals;
1056
+ $[38] = resolveText;
1057
+ $[39] = route;
1058
+ $[40] = t;
1059
+ $[41] = t11;
1060
+ } else t11 = $[41];
1061
+ React.useEffect(t10, t11);
871
1062
  let t12;
872
- if ($[24] !== route || $[25] !== routeKey) {
873
- t12 = [routeKey, route];
874
- $[24] = route;
875
- $[25] = routeKey;
876
- $[26] = t12;
877
- } else t12 = $[26];
878
- React.useEffect(t11, t12);
1063
+ if ($[42] !== segments) {
1064
+ t12 = segments.join("/");
1065
+ $[42] = segments;
1066
+ $[43] = t12;
1067
+ } else t12 = $[43];
1068
+ const routeKey = t12;
1069
+ let t13;
1070
+ if ($[44] !== routeKey) {
1071
+ t13 = [routeKey];
1072
+ $[44] = routeKey;
1073
+ $[45] = t13;
1074
+ } else t13 = $[45];
1075
+ React.useEffect(_temp3, t13);
879
1076
  if (route.type === "dashboard") {
880
1077
  if (DashboardComponent) {
881
- let t13$2;
882
- if ($[27] !== DashboardComponent) {
883
- t13$2 = /* @__PURE__ */ jsx(DashboardComponent, {});
884
- $[27] = DashboardComponent;
885
- $[28] = t13$2;
886
- } else t13$2 = $[28];
887
- return t13$2;
1078
+ let t14$2;
1079
+ if ($[46] !== DashboardComponent) {
1080
+ t14$2 = /* @__PURE__ */ jsx(DashboardComponent, {});
1081
+ $[46] = DashboardComponent;
1082
+ $[47] = t14$2;
1083
+ } else t14$2 = $[47];
1084
+ return t14$2;
888
1085
  }
889
1086
  if (dashboardConfig?.items?.length || dashboardConfig?.widgets?.length) {
890
- let t13$2;
891
- if ($[29] !== basePath || $[30] !== dashboardConfig || $[31] !== navigate) {
892
- t13$2 = /* @__PURE__ */ jsx(DashboardGrid, {
1087
+ let t14$2;
1088
+ if ($[48] !== basePath || $[49] !== dashboardConfig || $[50] !== navigate) {
1089
+ t14$2 = /* @__PURE__ */ jsx(DashboardGrid, {
893
1090
  config: dashboardConfig,
894
1091
  basePath,
895
1092
  navigate
896
1093
  });
897
- $[29] = basePath;
898
- $[30] = dashboardConfig;
899
- $[31] = navigate;
900
- $[32] = t13$2;
901
- } else t13$2 = $[32];
902
- return t13$2;
1094
+ $[48] = basePath;
1095
+ $[49] = dashboardConfig;
1096
+ $[50] = navigate;
1097
+ $[51] = t14$2;
1098
+ } else t14$2 = $[51];
1099
+ return t14$2;
903
1100
  }
904
- let t13$1;
905
- if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
906
- t13$1 = /* @__PURE__ */ jsx(DefaultDashboard, {});
907
- $[33] = t13$1;
908
- } else t13$1 = $[33];
909
- return t13$1;
1101
+ let t14$1;
1102
+ if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
1103
+ t14$1 = /* @__PURE__ */ jsx(DefaultDashboard, {});
1104
+ $[52] = t14$1;
1105
+ } else t14$1 = $[52];
1106
+ return t14$1;
910
1107
  }
911
1108
  if (route.type === "collection-list") {
912
1109
  const { name } = route;
913
- const config = collections[name];
914
- if (!config) {
915
- let t13$2;
916
- if ($[34] !== basePath || $[35] !== name || $[36] !== navigate) {
917
- t13$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1110
+ const config_5 = collections[name];
1111
+ if (!config_5) {
1112
+ let t14$2;
1113
+ if ($[53] !== basePath || $[54] !== name || $[55] !== navigate) {
1114
+ t14$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
918
1115
  type: "collection",
919
1116
  name,
920
1117
  navigate,
921
1118
  basePath
922
1119
  });
923
- $[34] = basePath;
924
- $[35] = name;
925
- $[36] = navigate;
926
- $[37] = t13$2;
927
- } else t13$2 = $[37];
928
- return t13$2;
1120
+ $[53] = basePath;
1121
+ $[54] = name;
1122
+ $[55] = navigate;
1123
+ $[56] = t14$2;
1124
+ } else t14$2 = $[56];
1125
+ return t14$2;
929
1126
  }
930
1127
  const custom = resolvedCollectionComponents[name];
931
1128
  const viewNameFromSchema = activeCollectionSchema?.admin?.list?.view;
932
- const t13$1 = config?.list;
933
- let t14;
934
- if ($[38] !== t13$1) {
935
- t14 = getConfiguredViewName(t13$1);
936
- $[38] = t13$1;
937
- $[39] = t14;
938
- } else t14 = $[39];
939
- const viewNameFromConfig = t14;
1129
+ const t14$1 = config_5?.list;
940
1130
  let t15;
941
- if ($[40] !== viewNameFromConfig || $[41] !== viewNameFromSchema || $[42] !== views) {
942
- t15 = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "list");
943
- $[40] = viewNameFromConfig;
944
- $[41] = viewNameFromSchema;
945
- $[42] = views;
946
- $[43] = t15;
947
- } else t15 = $[43];
948
- const selectedListView = t15;
949
- const selectedListViewDefinition = views[selectedListView];
1131
+ if ($[57] !== t14$1) {
1132
+ t15 = getConfiguredViewName(t14$1);
1133
+ $[57] = t14$1;
1134
+ $[58] = t15;
1135
+ } else t15 = $[58];
1136
+ const viewNameFromConfig = t15;
950
1137
  let t16;
951
- if ($[44] !== activeCollectionSchema || $[45] !== config || $[46] !== selectedListViewDefinition) {
952
- t16 = mergeViewConfig(getViewBaseConfig(selectedListViewDefinition), config?.list?.config ?? config?.list ?? activeCollectionSchema?.admin?.list);
953
- $[44] = activeCollectionSchema;
954
- $[45] = config;
955
- $[46] = selectedListViewDefinition;
956
- $[47] = t16;
957
- } else t16 = $[47];
958
- const selectedListViewConfig = t16;
1138
+ if ($[59] !== viewNameFromConfig || $[60] !== viewNameFromSchema || $[61] !== views) {
1139
+ t16 = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "list");
1140
+ $[59] = viewNameFromConfig;
1141
+ $[60] = viewNameFromSchema;
1142
+ $[61] = views;
1143
+ $[62] = t16;
1144
+ } else t16 = $[62];
1145
+ const selectedListView = t16;
1146
+ const selectedListViewDefinition = views[selectedListView];
959
1147
  let t17;
960
- if ($[48] !== selectedListViewDefinition) {
961
- t17 = getViewLoader(selectedListViewDefinition);
962
- $[48] = selectedListViewDefinition;
963
- $[49] = t17;
964
- } else t17 = $[49];
965
- const listViewLoader = t17;
1148
+ if ($[63] !== activeCollectionSchema || $[64] !== config_5 || $[65] !== selectedListViewDefinition) {
1149
+ t17 = mergeViewConfig(getViewBaseConfig(selectedListViewDefinition), config_5?.list?.config ?? config_5?.list ?? activeCollectionSchema?.admin?.list);
1150
+ $[63] = activeCollectionSchema;
1151
+ $[64] = config_5;
1152
+ $[65] = selectedListViewDefinition;
1153
+ $[66] = t17;
1154
+ } else t17 = $[66];
1155
+ const selectedListViewConfig = t17;
1156
+ let t18;
1157
+ if ($[67] !== selectedListViewDefinition) {
1158
+ t18 = getViewLoader(selectedListViewDefinition);
1159
+ $[67] = selectedListViewDefinition;
1160
+ $[68] = t18;
1161
+ } else t18 = $[68];
1162
+ const listViewLoader = t18;
966
1163
  if (selectedListViewDefinition && selectedListViewDefinition.kind !== "list" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedListView}" kind "${selectedListViewDefinition.kind}" != expected "list"`);
967
1164
  if (custom?.List) {
968
- let t18$1;
969
- if ($[50] !== custom.List) {
970
- t18$1 = /* @__PURE__ */ jsx(custom.List, {});
971
- $[50] = custom.List;
972
- $[51] = t18$1;
973
- } else t18$1 = $[51];
974
- return t18$1;
1165
+ let t19$1;
1166
+ if ($[69] !== custom.List) {
1167
+ t19$1 = /* @__PURE__ */ jsx(custom.List, {});
1168
+ $[69] = custom.List;
1169
+ $[70] = t19$1;
1170
+ } else t19$1 = $[70];
1171
+ return t19$1;
975
1172
  }
976
- let t18;
977
- if ($[52] !== basePath || $[53] !== config || $[54] !== name || $[55] !== navigate || $[56] !== selectedListViewConfig) {
978
- t18 = {
1173
+ let t19;
1174
+ if ($[71] !== basePath || $[72] !== config_5 || $[73] !== name || $[74] !== navigate || $[75] !== selectedListViewConfig) {
1175
+ t19 = {
979
1176
  collection: name,
980
- config,
1177
+ config: config_5,
981
1178
  viewConfig: selectedListViewConfig,
982
1179
  navigate,
983
1180
  basePath
984
1181
  };
985
- $[52] = basePath;
986
- $[53] = config;
987
- $[54] = name;
988
- $[55] = navigate;
989
- $[56] = selectedListViewConfig;
990
- $[57] = t18;
991
- } else t18 = $[57];
992
- const listComponentProps = t18;
993
- let t19;
994
- if ($[58] !== listComponentProps || $[59] !== listViewLoader || $[60] !== name || $[61] !== selectedListView) {
995
- t19 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1182
+ $[71] = basePath;
1183
+ $[72] = config_5;
1184
+ $[73] = name;
1185
+ $[74] = navigate;
1186
+ $[75] = selectedListViewConfig;
1187
+ $[76] = t19;
1188
+ } else t19 = $[76];
1189
+ const listComponentProps = t19;
1190
+ let t20;
1191
+ if ($[77] !== listComponentProps || $[78] !== listViewLoader || $[79] !== name || $[80] !== selectedListView) {
1192
+ t20 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
996
1193
  loader: listViewLoader,
997
1194
  viewKind: "list",
998
1195
  viewId: selectedListView,
999
1196
  componentProps: listComponentProps
1000
1197
  }, name);
1001
- $[58] = listComponentProps;
1002
- $[59] = listViewLoader;
1003
- $[60] = name;
1004
- $[61] = selectedListView;
1005
- $[62] = t19;
1006
- } else t19 = $[62];
1007
- return t19;
1198
+ $[77] = listComponentProps;
1199
+ $[78] = listViewLoader;
1200
+ $[79] = name;
1201
+ $[80] = selectedListView;
1202
+ $[81] = t20;
1203
+ } else t20 = $[81];
1204
+ return t20;
1008
1205
  }
1009
1206
  if (route.type === "collection-create" || route.type === "collection-edit") {
1010
1207
  const { name: name_0 } = route;
1011
1208
  const id = route.type === "collection-edit" ? route.id : void 0;
1012
- const config_0 = collections[name_0];
1013
- if (!config_0) {
1014
- let t13$2;
1015
- if ($[63] !== basePath || $[64] !== name_0 || $[65] !== navigate) {
1016
- t13$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1209
+ const config_6 = collections[name_0];
1210
+ if (!config_6) {
1211
+ let t14$2;
1212
+ if ($[82] !== basePath || $[83] !== name_0 || $[84] !== navigate) {
1213
+ t14$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1017
1214
  type: "collection",
1018
1215
  name: name_0,
1019
1216
  navigate,
1020
1217
  basePath
1021
1218
  });
1022
- $[63] = basePath;
1023
- $[64] = name_0;
1024
- $[65] = navigate;
1025
- $[66] = t13$2;
1026
- } else t13$2 = $[66];
1027
- return t13$2;
1219
+ $[82] = basePath;
1220
+ $[83] = name_0;
1221
+ $[84] = navigate;
1222
+ $[85] = t14$2;
1223
+ } else t14$2 = $[85];
1224
+ return t14$2;
1028
1225
  }
1029
1226
  const custom_0 = resolvedCollectionComponents[name_0];
1030
1227
  const viewNameFromSchema_0 = activeCollectionSchema?.admin?.form?.view;
1031
- const t13$1 = config_0?.form;
1032
- let t14;
1033
- if ($[67] !== t13$1) {
1034
- t14 = getConfiguredViewName(t13$1);
1035
- $[67] = t13$1;
1036
- $[68] = t14;
1037
- } else t14 = $[68];
1038
- const viewNameFromConfig_0 = t14;
1228
+ const t14$1 = config_6?.form;
1039
1229
  let t15;
1040
- if ($[69] !== viewNameFromConfig_0 || $[70] !== viewNameFromSchema_0 || $[71] !== views) {
1041
- t15 = viewNameFromSchema_0 ?? viewNameFromConfig_0 ?? findDefaultView(views, "form");
1042
- $[69] = viewNameFromConfig_0;
1043
- $[70] = viewNameFromSchema_0;
1044
- $[71] = views;
1045
- $[72] = t15;
1046
- } else t15 = $[72];
1047
- const selectedFormView = t15;
1048
- const selectedFormViewDefinition = views[selectedFormView];
1230
+ if ($[86] !== t14$1) {
1231
+ t15 = getConfiguredViewName(t14$1);
1232
+ $[86] = t14$1;
1233
+ $[87] = t15;
1234
+ } else t15 = $[87];
1235
+ const viewNameFromConfig_0 = t15;
1049
1236
  let t16;
1050
- if ($[73] !== activeCollectionSchema || $[74] !== config_0 || $[75] !== selectedFormViewDefinition) {
1051
- t16 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config_0?.form?.config ?? config_0?.form ?? activeCollectionSchema?.admin?.form);
1052
- $[73] = activeCollectionSchema;
1053
- $[74] = config_0;
1054
- $[75] = selectedFormViewDefinition;
1055
- $[76] = t16;
1056
- } else t16 = $[76];
1057
- const selectedFormViewConfig = t16;
1237
+ if ($[88] !== viewNameFromConfig_0 || $[89] !== viewNameFromSchema_0 || $[90] !== views) {
1238
+ t16 = viewNameFromSchema_0 ?? viewNameFromConfig_0 ?? findDefaultView(views, "form");
1239
+ $[88] = viewNameFromConfig_0;
1240
+ $[89] = viewNameFromSchema_0;
1241
+ $[90] = views;
1242
+ $[91] = t16;
1243
+ } else t16 = $[91];
1244
+ const selectedFormView = t16;
1245
+ const selectedFormViewDefinition = views[selectedFormView];
1058
1246
  let t17;
1059
- if ($[77] !== selectedFormViewDefinition) {
1060
- t17 = getViewLoader(selectedFormViewDefinition);
1061
- $[77] = selectedFormViewDefinition;
1062
- $[78] = t17;
1063
- } else t17 = $[78];
1064
- const formViewLoader = t17;
1247
+ if ($[92] !== activeCollectionSchema || $[93] !== config_6 || $[94] !== selectedFormViewDefinition) {
1248
+ t17 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config_6?.form?.config ?? config_6?.form ?? activeCollectionSchema?.admin?.form);
1249
+ $[92] = activeCollectionSchema;
1250
+ $[93] = config_6;
1251
+ $[94] = selectedFormViewDefinition;
1252
+ $[95] = t17;
1253
+ } else t17 = $[95];
1254
+ const selectedFormViewConfig = t17;
1255
+ let t18;
1256
+ if ($[96] !== selectedFormViewDefinition) {
1257
+ t18 = getViewLoader(selectedFormViewDefinition);
1258
+ $[96] = selectedFormViewDefinition;
1259
+ $[97] = t18;
1260
+ } else t18 = $[97];
1261
+ const formViewLoader = t18;
1065
1262
  if (selectedFormViewDefinition && selectedFormViewDefinition.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView}" kind "${selectedFormViewDefinition.kind}" != expected "form"`);
1066
1263
  if (custom_0?.Form) {
1067
- let t18$1;
1068
- if ($[79] !== custom_0.Form) {
1069
- t18$1 = /* @__PURE__ */ jsx(custom_0.Form, {});
1070
- $[79] = custom_0.Form;
1071
- $[80] = t18$1;
1072
- } else t18$1 = $[80];
1073
- return t18$1;
1264
+ let t19$1;
1265
+ if ($[98] !== custom_0.Form) {
1266
+ t19$1 = /* @__PURE__ */ jsx(custom_0.Form, {});
1267
+ $[98] = custom_0.Form;
1268
+ $[99] = t19$1;
1269
+ } else t19$1 = $[99];
1270
+ return t19$1;
1074
1271
  }
1075
- let t18;
1076
- if ($[81] !== prefillValues || $[82] !== route.type) {
1077
- t18 = route.type === "collection-create" && Object.keys(prefillValues).length > 0 ? prefillValues : void 0;
1078
- $[81] = prefillValues;
1079
- $[82] = route.type;
1080
- $[83] = t18;
1081
- } else t18 = $[83];
1082
- const defaultValues = t18;
1083
1272
  let t19;
1084
- if ($[84] !== basePath || $[85] !== collections || $[86] !== config_0 || $[87] !== defaultValues || $[88] !== id || $[89] !== name_0 || $[90] !== navigate || $[91] !== registry || $[92] !== selectedFormViewConfig) {
1085
- t19 = {
1273
+ if ($[100] !== prefillValues || $[101] !== route.type) {
1274
+ t19 = route.type === "collection-create" && Object.keys(prefillValues).length > 0 ? prefillValues : void 0;
1275
+ $[100] = prefillValues;
1276
+ $[101] = route.type;
1277
+ $[102] = t19;
1278
+ } else t19 = $[102];
1279
+ const defaultValues = t19;
1280
+ let t20;
1281
+ if ($[103] !== basePath || $[104] !== collections || $[105] !== config_6 || $[106] !== defaultValues || $[107] !== id || $[108] !== name_0 || $[109] !== navigate || $[110] !== registry || $[111] !== selectedFormViewConfig) {
1282
+ t20 = {
1086
1283
  collection: name_0,
1087
1284
  id,
1088
- config: config_0,
1285
+ config: config_6,
1089
1286
  viewConfig: selectedFormViewConfig,
1090
1287
  navigate,
1091
1288
  basePath,
@@ -1093,154 +1290,160 @@ function AdminRouterInner(t0) {
1093
1290
  registry,
1094
1291
  allCollectionsConfig: collections
1095
1292
  };
1096
- $[84] = basePath;
1097
- $[85] = collections;
1098
- $[86] = config_0;
1099
- $[87] = defaultValues;
1100
- $[88] = id;
1101
- $[89] = name_0;
1102
- $[90] = navigate;
1103
- $[91] = registry;
1104
- $[92] = selectedFormViewConfig;
1105
- $[93] = t19;
1106
- } else t19 = $[93];
1107
- const editComponentProps = t19;
1108
- const t20 = `${name_0}-${id ?? "create"}`;
1109
- let t21;
1110
- if ($[94] !== editComponentProps || $[95] !== formViewLoader || $[96] !== selectedFormView || $[97] !== t20) {
1111
- t21 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1293
+ $[103] = basePath;
1294
+ $[104] = collections;
1295
+ $[105] = config_6;
1296
+ $[106] = defaultValues;
1297
+ $[107] = id;
1298
+ $[108] = name_0;
1299
+ $[109] = navigate;
1300
+ $[110] = registry;
1301
+ $[111] = selectedFormViewConfig;
1302
+ $[112] = t20;
1303
+ } else t20 = $[112];
1304
+ const editComponentProps = t20;
1305
+ const t21 = `${name_0}-${id ?? "create"}`;
1306
+ let t22;
1307
+ if ($[113] !== editComponentProps || $[114] !== formViewLoader || $[115] !== selectedFormView || $[116] !== t21) {
1308
+ t22 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1112
1309
  loader: formViewLoader,
1113
1310
  viewKind: "form",
1114
1311
  viewId: selectedFormView,
1115
1312
  componentProps: editComponentProps
1116
- }, t20);
1117
- $[94] = editComponentProps;
1118
- $[95] = formViewLoader;
1119
- $[96] = selectedFormView;
1120
- $[97] = t20;
1121
- $[98] = t21;
1122
- } else t21 = $[98];
1123
- return t21;
1313
+ }, t21);
1314
+ $[113] = editComponentProps;
1315
+ $[114] = formViewLoader;
1316
+ $[115] = selectedFormView;
1317
+ $[116] = t21;
1318
+ $[117] = t22;
1319
+ } else t22 = $[117];
1320
+ return t22;
1124
1321
  }
1125
1322
  if (route.type === "global-edit") {
1126
1323
  const { name: name_1 } = route;
1127
- const config_1 = globals[name_1];
1128
- if (!config_1) {
1129
- let t13$2;
1130
- if ($[99] !== basePath || $[100] !== name_1 || $[101] !== navigate) {
1131
- t13$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1324
+ const config_7 = globals[name_1];
1325
+ if (!config_7) {
1326
+ let t14$2;
1327
+ if ($[118] !== basePath || $[119] !== name_1 || $[120] !== navigate) {
1328
+ t14$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1132
1329
  type: "global",
1133
1330
  name: name_1,
1134
1331
  navigate,
1135
1332
  basePath
1136
1333
  });
1137
- $[99] = basePath;
1138
- $[100] = name_1;
1139
- $[101] = navigate;
1140
- $[102] = t13$2;
1141
- } else t13$2 = $[102];
1142
- return t13$2;
1334
+ $[118] = basePath;
1335
+ $[119] = name_1;
1336
+ $[120] = navigate;
1337
+ $[121] = t14$2;
1338
+ } else t14$2 = $[121];
1339
+ return t14$2;
1143
1340
  }
1144
1341
  const custom_1 = resolvedGlobalComponents[name_1];
1145
1342
  const viewNameFromSchema_1 = activeGlobalSchema?.admin?.form?.view;
1146
- const t13$1 = config_1?.form;
1147
- let t14;
1148
- if ($[103] !== t13$1) {
1149
- t14 = getConfiguredViewName(t13$1);
1150
- $[103] = t13$1;
1151
- $[104] = t14;
1152
- } else t14 = $[104];
1153
- const viewNameFromConfig_1 = t14;
1343
+ const t14$1 = config_7?.form;
1154
1344
  let t15;
1155
- if ($[105] !== viewNameFromConfig_1 || $[106] !== viewNameFromSchema_1 || $[107] !== views) {
1156
- t15 = viewNameFromSchema_1 ?? viewNameFromConfig_1 ?? findDefaultView(views, "form");
1157
- $[105] = viewNameFromConfig_1;
1158
- $[106] = viewNameFromSchema_1;
1159
- $[107] = views;
1160
- $[108] = t15;
1161
- } else t15 = $[108];
1162
- const selectedFormView_0 = t15;
1163
- const selectedFormViewDefinition_0 = views[selectedFormView_0];
1345
+ if ($[122] !== t14$1) {
1346
+ t15 = getConfiguredViewName(t14$1);
1347
+ $[122] = t14$1;
1348
+ $[123] = t15;
1349
+ } else t15 = $[123];
1350
+ const viewNameFromConfig_1 = t15;
1164
1351
  let t16;
1165
- if ($[109] !== activeGlobalSchema || $[110] !== config_1 || $[111] !== selectedFormViewDefinition_0) {
1166
- t16 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition_0), config_1?.form?.config ?? config_1?.form ?? activeGlobalSchema?.admin?.form);
1167
- $[109] = activeGlobalSchema;
1168
- $[110] = config_1;
1169
- $[111] = selectedFormViewDefinition_0;
1170
- $[112] = t16;
1171
- } else t16 = $[112];
1172
- const selectedFormViewConfig_0 = t16;
1352
+ if ($[124] !== viewNameFromConfig_1 || $[125] !== viewNameFromSchema_1 || $[126] !== views) {
1353
+ t16 = viewNameFromSchema_1 ?? viewNameFromConfig_1 ?? findDefaultView(views, "form");
1354
+ $[124] = viewNameFromConfig_1;
1355
+ $[125] = viewNameFromSchema_1;
1356
+ $[126] = views;
1357
+ $[127] = t16;
1358
+ } else t16 = $[127];
1359
+ const selectedFormView_0 = t16;
1360
+ const selectedFormViewDefinition_0 = views[selectedFormView_0];
1173
1361
  let t17;
1174
- if ($[113] !== selectedFormViewDefinition_0) {
1175
- t17 = getViewLoader(selectedFormViewDefinition_0);
1176
- $[113] = selectedFormViewDefinition_0;
1177
- $[114] = t17;
1178
- } else t17 = $[114];
1179
- const globalViewLoader = t17;
1362
+ if ($[128] !== activeGlobalSchema || $[129] !== config_7 || $[130] !== selectedFormViewDefinition_0) {
1363
+ t17 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition_0), config_7?.form?.config ?? config_7?.form ?? activeGlobalSchema?.admin?.form);
1364
+ $[128] = activeGlobalSchema;
1365
+ $[129] = config_7;
1366
+ $[130] = selectedFormViewDefinition_0;
1367
+ $[131] = t17;
1368
+ } else t17 = $[131];
1369
+ const selectedFormViewConfig_0 = t17;
1370
+ let t18;
1371
+ if ($[132] !== selectedFormViewDefinition_0) {
1372
+ t18 = getViewLoader(selectedFormViewDefinition_0);
1373
+ $[132] = selectedFormViewDefinition_0;
1374
+ $[133] = t18;
1375
+ } else t18 = $[133];
1376
+ const globalViewLoader = t18;
1180
1377
  if (selectedFormViewDefinition_0 && selectedFormViewDefinition_0.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView_0}" kind "${selectedFormViewDefinition_0.kind}" != expected "form"`);
1181
1378
  if (custom_1?.Form) {
1182
- let t18$1;
1183
- if ($[115] !== custom_1.Form) {
1184
- t18$1 = /* @__PURE__ */ jsx(custom_1.Form, {});
1185
- $[115] = custom_1.Form;
1186
- $[116] = t18$1;
1187
- } else t18$1 = $[116];
1188
- return t18$1;
1379
+ let t19$1;
1380
+ if ($[134] !== custom_1.Form) {
1381
+ t19$1 = /* @__PURE__ */ jsx(custom_1.Form, {});
1382
+ $[134] = custom_1.Form;
1383
+ $[135] = t19$1;
1384
+ } else t19$1 = $[135];
1385
+ return t19$1;
1189
1386
  }
1190
- let t18;
1191
- if ($[117] !== basePath || $[118] !== config_1 || $[119] !== globals || $[120] !== name_1 || $[121] !== navigate || $[122] !== registry || $[123] !== selectedFormViewConfig_0) {
1192
- t18 = {
1387
+ let t19;
1388
+ if ($[136] !== basePath || $[137] !== config_7 || $[138] !== globals || $[139] !== name_1 || $[140] !== navigate || $[141] !== registry || $[142] !== selectedFormViewConfig_0) {
1389
+ t19 = {
1193
1390
  global: name_1,
1194
- config: config_1,
1391
+ config: config_7,
1195
1392
  viewConfig: selectedFormViewConfig_0,
1196
1393
  navigate,
1197
1394
  basePath,
1198
1395
  registry,
1199
1396
  allGlobalsConfig: globals
1200
1397
  };
1201
- $[117] = basePath;
1202
- $[118] = config_1;
1203
- $[119] = globals;
1204
- $[120] = name_1;
1205
- $[121] = navigate;
1206
- $[122] = registry;
1207
- $[123] = selectedFormViewConfig_0;
1208
- $[124] = t18;
1209
- } else t18 = $[124];
1210
- const globalComponentProps = t18;
1211
- let t19;
1212
- if ($[125] !== globalComponentProps || $[126] !== globalViewLoader || $[127] !== name_1 || $[128] !== selectedFormView_0) {
1213
- t19 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1398
+ $[136] = basePath;
1399
+ $[137] = config_7;
1400
+ $[138] = globals;
1401
+ $[139] = name_1;
1402
+ $[140] = navigate;
1403
+ $[141] = registry;
1404
+ $[142] = selectedFormViewConfig_0;
1405
+ $[143] = t19;
1406
+ } else t19 = $[143];
1407
+ const globalComponentProps = t19;
1408
+ let t20;
1409
+ if ($[144] !== globalComponentProps || $[145] !== globalViewLoader || $[146] !== name_1 || $[147] !== selectedFormView_0) {
1410
+ t20 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1214
1411
  loader: globalViewLoader,
1215
1412
  viewKind: "form",
1216
1413
  viewId: selectedFormView_0,
1217
1414
  componentProps: globalComponentProps
1218
1415
  }, name_1);
1219
- $[125] = globalComponentProps;
1220
- $[126] = globalViewLoader;
1221
- $[127] = name_1;
1222
- $[128] = selectedFormView_0;
1223
- $[129] = t19;
1224
- } else t19 = $[129];
1225
- return t19;
1416
+ $[144] = globalComponentProps;
1417
+ $[145] = globalViewLoader;
1418
+ $[146] = name_1;
1419
+ $[147] = selectedFormView_0;
1420
+ $[148] = t20;
1421
+ } else t20 = $[148];
1422
+ return t20;
1226
1423
  }
1227
1424
  if (route.type === "page") {
1228
- let t13$1;
1229
- if ($[130] !== route.config) {
1230
- t13$1 = /* @__PURE__ */ jsx(LazyPageRenderer, { config: route.config });
1231
- $[130] = route.config;
1232
- $[131] = t13$1;
1233
- } else t13$1 = $[131];
1234
- return t13$1;
1425
+ let t14$1;
1426
+ if ($[149] !== route.config) {
1427
+ t14$1 = /* @__PURE__ */ jsx(LazyPageRenderer, { config: route.config });
1428
+ $[149] = route.config;
1429
+ $[150] = t14$1;
1430
+ } else t14$1 = $[150];
1431
+ return t14$1;
1235
1432
  }
1236
1433
  const NotFound = NotFoundComponent || DefaultNotFound;
1237
- let t13;
1238
- if ($[132] !== NotFound) {
1239
- t13 = /* @__PURE__ */ jsx(NotFound, {});
1240
- $[132] = NotFound;
1241
- $[133] = t13;
1242
- } else t13 = $[133];
1243
- return t13;
1434
+ let t14;
1435
+ if ($[151] !== NotFound) {
1436
+ t14 = /* @__PURE__ */ jsx(NotFound, {});
1437
+ $[151] = NotFound;
1438
+ $[152] = t14;
1439
+ } else t14 = $[152];
1440
+ return t14;
1441
+ }
1442
+ function _temp3() {
1443
+ const main = document.getElementById("main-content");
1444
+ if (main) requestAnimationFrame(() => {
1445
+ main.focus({ preventScroll: true });
1446
+ });
1244
1447
  }
1245
1448
  function _temp2(prev) {
1246
1449
  return {