@questpie/admin 3.0.3 → 3.0.5

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 (253) 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-editor-layout.mjs +2 -2
  16. package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
  17. package/dist/client/components/blocks/block-insert-button.mjs +4 -4
  18. package/dist/client/components/blocks/block-item.mjs +2 -2
  19. package/dist/client/components/blocks/block-library-sidebar.mjs +91 -63
  20. package/dist/client/components/component-renderer.mjs +1 -1
  21. package/dist/client/components/fields/array-field.mjs +14 -14
  22. package/dist/client/components/fields/asset-preview-field.mjs +1 -1
  23. package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
  24. package/dist/client/components/fields/json-field.mjs +2 -2
  25. package/dist/client/components/fields/object-array-field.mjs +22 -22
  26. package/dist/client/components/fields/object-field.mjs +5 -5
  27. package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
  28. package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
  29. package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
  30. package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
  31. package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
  32. package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
  33. package/dist/client/components/fields/relation-picker.mjs +7 -6
  34. package/dist/client/components/fields/relation-select.mjs +71 -47
  35. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
  36. package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
  37. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
  38. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
  39. package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
  40. package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
  41. package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
  42. package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
  43. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
  44. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
  45. package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
  46. package/dist/client/components/fields/upload-field.mjs +45 -49
  47. package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
  48. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
  49. package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
  50. package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
  51. package/dist/client/components/history-sidebar.mjs +850 -340
  52. package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
  53. package/dist/client/components/locale-switcher.mjs +8 -8
  54. package/dist/client/components/media/media-grid.mjs +106 -86
  55. package/dist/client/components/media/media-picker-dialog.mjs +242 -230
  56. package/dist/client/components/preview/live-preview-mode.mjs +1 -1
  57. package/dist/client/components/primitives/asset-preview.mjs +37 -22
  58. package/dist/client/components/primitives/date-input.mjs +212 -249
  59. package/dist/client/components/primitives/dropzone.mjs +192 -159
  60. package/dist/client/components/primitives/field-select-control.mjs +93 -0
  61. package/dist/client/components/primitives/select-multi.mjs +406 -365
  62. package/dist/client/components/primitives/select-single.mjs +391 -323
  63. package/dist/client/components/primitives/time-input.mjs +2 -2
  64. package/dist/client/components/sheets/resource-sheet.mjs +2 -0
  65. package/dist/client/components/ui/accordion.mjs +4 -4
  66. package/dist/client/components/ui/alert.mjs +3 -3
  67. package/dist/client/components/ui/badge.mjs +4 -4
  68. package/dist/client/components/ui/button.mjs +47 -37
  69. package/dist/client/components/ui/card.mjs +2 -2
  70. package/dist/client/components/ui/checkbox.mjs +1 -1
  71. package/dist/client/components/ui/command.mjs +5 -5
  72. package/dist/client/components/ui/dialog.mjs +3 -3
  73. package/dist/client/components/ui/drawer.mjs +1 -1
  74. package/dist/client/components/ui/dropdown-menu.mjs +157 -15
  75. package/dist/client/components/ui/empty-state.mjs +88 -59
  76. package/dist/client/components/ui/field.mjs +2 -2
  77. package/dist/client/components/ui/input-group.mjs +3 -3
  78. package/dist/client/components/ui/input.mjs +1 -1
  79. package/dist/client/components/ui/kbd.mjs +1 -1
  80. package/dist/client/components/ui/label.mjs +1 -1
  81. package/dist/client/components/ui/popover.mjs +19 -11
  82. package/dist/client/components/ui/scroll-fade.mjs +170 -0
  83. package/dist/client/components/ui/search-input.mjs +1 -1
  84. package/dist/client/components/ui/select.mjs +129 -27
  85. package/dist/client/components/ui/sheet.mjs +54 -34
  86. package/dist/client/components/ui/sidebar.mjs +15 -14
  87. package/dist/client/components/ui/skeleton.mjs +28 -12
  88. package/dist/client/components/ui/switch.mjs +2 -2
  89. package/dist/client/components/ui/table.mjs +82 -74
  90. package/dist/client/components/ui/tabs.mjs +26 -31
  91. package/dist/client/components/ui/textarea.mjs +1 -1
  92. package/dist/client/components/ui/tooltip.mjs +1 -1
  93. package/dist/client/components/widgets/chart-widget.mjs +154 -100
  94. package/dist/client/components/widgets/progress-widget.mjs +63 -36
  95. package/dist/client/components/widgets/quick-actions-widget.mjs +207 -115
  96. package/dist/client/components/widgets/recent-items-widget.mjs +147 -103
  97. package/dist/client/components/widgets/stats-widget.mjs +91 -72
  98. package/dist/client/components/widgets/table-widget.mjs +161 -247
  99. package/dist/client/components/widgets/timeline-widget.mjs +119 -78
  100. package/dist/client/components/widgets/value-widget.mjs +286 -157
  101. package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
  102. package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
  103. package/dist/client/contexts/focus-context.d.mts +2 -2
  104. package/dist/client/hooks/use-action.mjs +63 -55
  105. package/dist/client/hooks/use-audit-history.mjs +1 -65
  106. package/dist/client/hooks/use-collection-validation.mjs +36 -23
  107. package/dist/client/hooks/use-collection.mjs +96 -1
  108. package/dist/client/hooks/use-saved-views.mjs +70 -49
  109. package/dist/client/hooks/use-server-actions.mjs +70 -46
  110. package/dist/client/hooks/use-server-validation.mjs +156 -41
  111. package/dist/client/hooks/use-server-widget-data.mjs +1 -1
  112. package/dist/client/hooks/use-setup-status.d.mts +3 -3
  113. package/dist/client/hooks/use-setup-status.mjs +2 -2
  114. package/dist/client/hooks/use-transition-stage.mjs +2 -10
  115. package/dist/client/hooks/use-validation-error-map.mjs +31 -13
  116. package/dist/client/hooks/use-view-state.mjs +238 -174
  117. package/dist/client/i18n/date-locale.mjs +33 -0
  118. package/dist/client/i18n/hooks.mjs +17 -1
  119. package/dist/client/lib/utils.mjs +3 -2
  120. package/dist/client/preview/block-scope-context.d.mts +2 -2
  121. package/dist/client/preview/preview-banner.d.mts +2 -2
  122. package/dist/client/preview/preview-banner.mjs +75 -46
  123. package/dist/client/preview/preview-field.d.mts +4 -4
  124. package/dist/client/preview/preview-field.mjs +2 -2
  125. package/dist/client/runtime/provider.mjs +8 -1
  126. package/dist/client/runtime/translations-provider.mjs +1 -1
  127. package/dist/client/scope/picker.d.mts +2 -2
  128. package/dist/client/scope/provider.d.mts +2 -2
  129. package/dist/client/styles/base.css +1022 -0
  130. package/dist/client/styles/index.css +3 -589
  131. package/dist/client/utils/auto-expand-fields.mjs +4 -2
  132. package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
  133. package/dist/client/utils/use-lazy-component.mjs +80 -0
  134. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  135. package/dist/client/views/auth/auth-layout.d.mts +17 -10
  136. package/dist/client/views/auth/auth-layout.mjs +291 -80
  137. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  138. package/dist/client/views/auth/forgot-password-form.mjs +2 -2
  139. package/dist/client/views/auth/login-form.d.mts +2 -2
  140. package/dist/client/views/auth/login-form.mjs +1 -1
  141. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  142. package/dist/client/views/auth/reset-password-form.mjs +2 -2
  143. package/dist/client/views/auth/setup-form.d.mts +2 -2
  144. package/dist/client/views/collection/auto-form-fields.mjs +11 -9
  145. package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
  146. package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
  147. package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
  148. package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
  149. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
  150. package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
  151. package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
  152. package/dist/client/views/collection/columns/build-columns.mjs +29 -9
  153. package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
  154. package/dist/client/views/collection/field-renderer.mjs +50 -89
  155. package/dist/client/views/collection/form-view.mjs +237 -227
  156. package/dist/client/views/collection/table-view.mjs +1167 -234
  157. package/dist/client/views/collection/view-skeletons.mjs +222 -79
  158. package/dist/client/views/common/global-search.mjs +29 -18
  159. package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
  160. package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
  161. package/dist/client/views/dashboard/widget-card.mjs +23 -14
  162. package/dist/client/views/globals/global-form-view.mjs +634 -589
  163. package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
  164. package/dist/client/views/layout/admin-layout.d.mts +3 -6
  165. package/dist/client/views/layout/admin-layout.mjs +152 -155
  166. package/dist/client/views/layout/admin-router.mjs +936 -616
  167. package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
  168. package/dist/client/views/layout/admin-sidebar.mjs +762 -592
  169. package/dist/client/views/layout/admin-theme.d.mts +10 -0
  170. package/dist/client/views/layout/admin-theme.mjs +84 -0
  171. package/dist/client/views/layout/admin-view-layout.mjs +161 -0
  172. package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
  173. package/dist/client/views/pages/accept-invite-page.mjs +49 -26
  174. package/dist/client/views/pages/dashboard-page.d.mts +2 -2
  175. package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
  176. package/dist/client/views/pages/forgot-password-page.mjs +2 -19
  177. package/dist/client/views/pages/invite-page.d.mts +2 -2
  178. package/dist/client/views/pages/invite-page.mjs +2 -19
  179. package/dist/client/views/pages/login-page.d.mts +3 -3
  180. package/dist/client/views/pages/login-page.mjs +4 -21
  181. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  182. package/dist/client/views/pages/reset-password-page.mjs +3 -20
  183. package/dist/client/views/pages/setup-page.d.mts +2 -2
  184. package/dist/client/views/pages/setup-page.mjs +70 -71
  185. package/dist/client.d.mts +6 -2
  186. package/dist/client.mjs +2 -1
  187. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  188. package/dist/index.d.mts +6 -2
  189. package/dist/index.mjs +2 -1
  190. package/dist/server/augmentation/dashboard.d.mts +67 -3
  191. package/dist/server/augmentation/form-layout.d.mts +21 -0
  192. package/dist/server/augmentation/index.d.mts +1 -1
  193. package/dist/server/codegen/admin-client-template.mjs +4 -0
  194. package/dist/server/fields/blocks.d.mts +1 -1
  195. package/dist/server/fields/blocks.mjs +12 -0
  196. package/dist/server/fields/rich-text.d.mts +1 -1
  197. package/dist/server/fields/rich-text.mjs +8 -0
  198. package/dist/server/i18n/index.mjs +29 -7
  199. package/dist/server/i18n/messages/cs.mjs +414 -1
  200. package/dist/server/i18n/messages/de.mjs +412 -1
  201. package/dist/server/i18n/messages/en.mjs +166 -1
  202. package/dist/server/i18n/messages/es.mjs +412 -1
  203. package/dist/server/i18n/messages/fr.mjs +412 -1
  204. package/dist/server/i18n/messages/pl.mjs +416 -1
  205. package/dist/server/i18n/messages/pt.mjs +409 -1
  206. package/dist/server/i18n/messages/sk.mjs +216 -2
  207. package/dist/server/modules/admin/block/introspection.mjs +4 -1
  208. package/dist/server/modules/admin/block/prefetch.mjs +12 -2
  209. package/dist/server/modules/admin/collections/account.d.mts +2 -2
  210. package/dist/server/modules/admin/collections/admin-locks.d.mts +2 -2
  211. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  212. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  213. package/dist/server/modules/admin/collections/apikey.d.mts +42 -42
  214. package/dist/server/modules/admin/collections/assets.d.mts +20 -20
  215. package/dist/server/modules/admin/collections/assets.mjs +0 -1
  216. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  217. package/dist/server/modules/admin/collections/user.d.mts +40 -28
  218. package/dist/server/modules/admin/collections/user.mjs +40 -9
  219. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  220. package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
  221. package/dist/server/modules/admin/factories.mjs +7 -18
  222. package/dist/server/modules/admin/index.d.mts +1 -1
  223. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  224. package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
  225. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  226. package/dist/server/modules/admin/routes/execute-action.mjs +67 -28
  227. package/dist/server/modules/admin/routes/i18n-helpers.mjs +34 -0
  228. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  229. package/dist/server/modules/admin/routes/preview.mjs +25 -17
  230. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  231. package/dist/server/modules/admin/routes/route-helpers.mjs +1 -1
  232. package/dist/server/modules/admin/routes/setup.d.mts +10 -10
  233. package/dist/server/modules/admin/routes/setup.mjs +16 -13
  234. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  235. package/dist/server/modules/admin/routes/translations.mjs +5 -1
  236. package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
  237. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +2 -2
  238. package/dist/server/modules/audit/.generated/module.d.mts +1 -1
  239. package/dist/server/modules/audit/.generated/module.mjs +1 -1
  240. package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
  241. package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
  242. package/dist/server/modules/audit/config/app.mjs +99 -42
  243. package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
  244. package/dist/server/plugin.mjs +4 -2
  245. package/dist/server/proxy-factories.d.mts +4 -3
  246. package/dist/server/proxy-factories.mjs +34 -8
  247. package/dist/shared/types/saved-views.types.d.mts +2 -0
  248. package/package.json +6 -4
  249. package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
  250. package/dist/client/components/ui/spinner.mjs +0 -52
  251. package/dist/client/components/ui/toolbar.mjs +0 -136
  252. package/dist/client/contexts/breadcrumb-context.mjs +0 -60
  253. package/dist/client/views/layout/admin-topbar.mjs +0 -236
@@ -2,6 +2,7 @@ import { Admin } from "../../builder/admin.mjs";
2
2
  import { getAdminLocalesQueryOptions, getAdminTranslationsQueryOptions, getUiLocaleFromCookie } from "../../runtime/translations-provider.mjs";
3
3
  import { AdminProvider } from "../../runtime/provider.mjs";
4
4
  import { getAdminConfigQueryOptions } from "../../hooks/use-admin-config.mjs";
5
+ import { AdminThemeAppliedContext, useManagedAdminTheme } from "./admin-theme.mjs";
5
6
  import { AdminLayout } from "./admin-layout.mjs";
6
7
  import { AuthGuard } from "../../components/auth/auth-guard.mjs";
7
8
  import { c } from "react/compiler-runtime";
@@ -71,34 +72,27 @@ function isPublicPath(currentPath, basePath, publicPaths) {
71
72
  * Handles all the provider setup and renders children inside the layout.
72
73
  */
73
74
  function AdminLayoutProvider(t0) {
74
- const $ = c(38);
75
+ const $ = c(33);
75
76
  const { admin: adminInput, client, authClient, queryClient, LinkComponent, activeRoute, basePath: t1, header, footer, sidebarProps, theme, setTheme, showThemeToggle, toasterProps, className, enableAuthGuard, publicPaths: t2, requiredRole: t3, authLoadingFallback, authUnauthorizedFallback, useServerTranslations, translationsFallback, initialUiLocale, children } = t0;
76
77
  const basePath = t1 === void 0 ? "/admin" : t1;
77
78
  const publicPaths = t2 === void 0 ? DEFAULT_PUBLIC_PATHS : t2;
78
79
  const requiredRole = t3 === void 0 ? "admin" : t3;
79
- let qc;
80
- if ($[0] !== client || $[1] !== initialUiLocale || $[2] !== queryClient || $[3] !== useServerTranslations) {
81
- qc = queryClient ?? getDefaultQueryClient();
82
- if (client?.routes) {
83
- qc.prefetchQuery(getAdminConfigQueryOptions(client));
84
- if (useServerTranslations) {
85
- const locale = initialUiLocale ?? getUiLocaleFromCookie() ?? "en";
86
- qc.prefetchQuery(getAdminLocalesQueryOptions(client));
87
- qc.prefetchQuery(getAdminTranslationsQueryOptions(client, locale));
88
- }
80
+ const qc = queryClient ?? getDefaultQueryClient();
81
+ const { theme: managedTheme, setTheme: setManagedTheme } = useManagedAdminTheme(theme, setTheme);
82
+ if (client?.routes) {
83
+ qc.prefetchQuery(getAdminConfigQueryOptions(client));
84
+ if (useServerTranslations) {
85
+ const locale = initialUiLocale ?? getUiLocaleFromCookie() ?? "en";
86
+ qc.prefetchQuery(getAdminLocalesQueryOptions(client));
87
+ qc.prefetchQuery(getAdminTranslationsQueryOptions(client, locale));
89
88
  }
90
- $[0] = client;
91
- $[1] = initialUiLocale;
92
- $[2] = queryClient;
93
- $[3] = useServerTranslations;
94
- $[4] = qc;
95
- } else qc = $[4];
89
+ }
96
90
  let t4;
97
- if ($[5] !== adminInput) {
91
+ if ($[0] !== adminInput) {
98
92
  t4 = Admin.normalize(adminInput);
99
- $[5] = adminInput;
100
- $[6] = t4;
101
- } else t4 = $[6];
93
+ $[0] = adminInput;
94
+ $[1] = t4;
95
+ } else t4 = $[1];
102
96
  const admin = t4;
103
97
  const shouldUseAuthGuard = enableAuthGuard ?? authClient != null;
104
98
  const isCurrentPathPublic = isPublicPath(activeRoute ?? (typeof window !== "undefined" ? window.location.pathname : void 0), basePath, publicPaths);
@@ -106,7 +100,7 @@ function AdminLayoutProvider(t0) {
106
100
  if (isCurrentPathPublic) innerContent = children;
107
101
  else {
108
102
  let t5$1;
109
- if ($[7] !== LinkComponent || $[8] !== activeRoute || $[9] !== basePath || $[10] !== children || $[11] !== className || $[12] !== footer || $[13] !== header || $[14] !== setTheme || $[15] !== showThemeToggle || $[16] !== sidebarProps || $[17] !== theme || $[18] !== toasterProps) {
103
+ if ($[2] !== LinkComponent || $[3] !== activeRoute || $[4] !== basePath || $[5] !== children || $[6] !== className || $[7] !== footer || $[8] !== header || $[9] !== managedTheme || $[10] !== setManagedTheme || $[11] !== showThemeToggle || $[12] !== sidebarProps || $[13] !== toasterProps) {
110
104
  t5$1 = /* @__PURE__ */ jsx(AdminLayout, {
111
105
  LinkComponent,
112
106
  activeRoute,
@@ -114,30 +108,30 @@ function AdminLayoutProvider(t0) {
114
108
  header,
115
109
  footer,
116
110
  sidebarProps,
117
- theme,
118
- setTheme,
111
+ theme: managedTheme,
112
+ setTheme: setManagedTheme,
119
113
  showThemeToggle,
120
114
  toasterProps,
121
115
  className,
122
116
  children
123
117
  });
124
- $[7] = LinkComponent;
125
- $[8] = activeRoute;
126
- $[9] = basePath;
127
- $[10] = children;
128
- $[11] = className;
129
- $[12] = footer;
130
- $[13] = header;
131
- $[14] = setTheme;
132
- $[15] = showThemeToggle;
133
- $[16] = sidebarProps;
134
- $[17] = theme;
135
- $[18] = toasterProps;
136
- $[19] = t5$1;
137
- } else t5$1 = $[19];
118
+ $[2] = LinkComponent;
119
+ $[3] = activeRoute;
120
+ $[4] = basePath;
121
+ $[5] = children;
122
+ $[6] = className;
123
+ $[7] = footer;
124
+ $[8] = header;
125
+ $[9] = managedTheme;
126
+ $[10] = setManagedTheme;
127
+ $[11] = showThemeToggle;
128
+ $[12] = sidebarProps;
129
+ $[13] = toasterProps;
130
+ $[14] = t5$1;
131
+ } else t5$1 = $[14];
138
132
  const layoutContent = t5$1;
139
133
  let t6$1;
140
- if ($[20] !== authLoadingFallback || $[21] !== authUnauthorizedFallback || $[22] !== basePath || $[23] !== layoutContent || $[24] !== requiredRole || $[25] !== shouldUseAuthGuard) {
134
+ if ($[15] !== authLoadingFallback || $[16] !== authUnauthorizedFallback || $[17] !== basePath || $[18] !== layoutContent || $[19] !== requiredRole || $[20] !== shouldUseAuthGuard) {
141
135
  t6$1 = shouldUseAuthGuard ? /* @__PURE__ */ jsx(AuthGuard, {
142
136
  loginPath: `${basePath}/login`,
143
137
  requiredRole,
@@ -145,47 +139,50 @@ function AdminLayoutProvider(t0) {
145
139
  unauthorizedFallback: authUnauthorizedFallback,
146
140
  children: layoutContent
147
141
  }) : layoutContent;
148
- $[20] = authLoadingFallback;
149
- $[21] = authUnauthorizedFallback;
150
- $[22] = basePath;
151
- $[23] = layoutContent;
152
- $[24] = requiredRole;
153
- $[25] = shouldUseAuthGuard;
154
- $[26] = t6$1;
155
- } else t6$1 = $[26];
142
+ $[15] = authLoadingFallback;
143
+ $[16] = authUnauthorizedFallback;
144
+ $[17] = basePath;
145
+ $[18] = layoutContent;
146
+ $[19] = requiredRole;
147
+ $[20] = shouldUseAuthGuard;
148
+ $[21] = t6$1;
149
+ } else t6$1 = $[21];
156
150
  innerContent = t6$1;
157
151
  }
158
152
  let t5;
159
- if ($[27] !== admin || $[28] !== authClient || $[29] !== client || $[30] !== initialUiLocale || $[31] !== innerContent || $[32] !== translationsFallback || $[33] !== useServerTranslations) {
160
- t5 = /* @__PURE__ */ jsx(AdminProvider, {
161
- admin,
162
- client,
163
- authClient,
164
- useServerTranslations,
165
- translationsFallback,
166
- initialUiLocale,
167
- children: innerContent
153
+ if ($[22] !== admin || $[23] !== authClient || $[24] !== client || $[25] !== initialUiLocale || $[26] !== innerContent || $[27] !== translationsFallback || $[28] !== useServerTranslations) {
154
+ t5 = /* @__PURE__ */ jsx(AdminThemeAppliedContext.Provider, {
155
+ value: true,
156
+ children: /* @__PURE__ */ jsx(AdminProvider, {
157
+ admin,
158
+ client,
159
+ authClient,
160
+ useServerTranslations,
161
+ translationsFallback,
162
+ initialUiLocale,
163
+ children: innerContent
164
+ })
168
165
  });
169
- $[27] = admin;
170
- $[28] = authClient;
171
- $[29] = client;
172
- $[30] = initialUiLocale;
173
- $[31] = innerContent;
174
- $[32] = translationsFallback;
175
- $[33] = useServerTranslations;
176
- $[34] = t5;
177
- } else t5 = $[34];
166
+ $[22] = admin;
167
+ $[23] = authClient;
168
+ $[24] = client;
169
+ $[25] = initialUiLocale;
170
+ $[26] = innerContent;
171
+ $[27] = translationsFallback;
172
+ $[28] = useServerTranslations;
173
+ $[29] = t5;
174
+ } else t5 = $[29];
178
175
  const content = t5;
179
176
  let t6;
180
- if ($[35] !== content || $[36] !== qc) {
177
+ if ($[30] !== content || $[31] !== qc) {
181
178
  t6 = /* @__PURE__ */ jsx(QueryClientProvider, {
182
179
  client: qc,
183
180
  children: content
184
181
  });
185
- $[35] = content;
186
- $[36] = qc;
187
- $[37] = t6;
188
- } else t6 = $[37];
182
+ $[30] = content;
183
+ $[31] = qc;
184
+ $[32] = t6;
185
+ } else t6 = $[32];
189
186
  return t6;
190
187
  }
191
188
 
@@ -1,13 +1,10 @@
1
1
  import { AdminToasterProps } from "../../components/ui/sonner.mjs";
2
2
  import { AdminSidebarProps } from "./admin-sidebar.mjs";
3
+ import { AdminTheme } from "./admin-theme.mjs";
3
4
  import * as React from "react";
4
5
 
5
6
  //#region src/client/views/layout/admin-layout.d.ts
6
7
 
7
- /**
8
- * Theme mode for the admin interface
9
- */
10
- type AdminTheme = "light" | "dark" | "system";
11
8
  /**
12
9
  * Layout mode for content area width
13
10
  * - default: max-w-5xl centered (settings, narrow forms)
@@ -123,8 +120,8 @@ declare function AdminLayout({
123
120
  header,
124
121
  footer,
125
122
  navigate: navigateProp,
126
- theme,
127
- setTheme,
123
+ theme: themeProp,
124
+ setTheme: setThemeProp,
128
125
  showThemeToggle,
129
126
  toasterProps,
130
127
  layoutMode
@@ -1,11 +1,12 @@
1
+ import { useSafeI18n } from "../../i18n/hooks.mjs";
1
2
  import { cn } from "../../lib/utils.mjs";
2
3
  import { useAdminStore } from "../../runtime/provider.mjs";
4
+ import { shouldHandleAdminShortcut } from "../../utils/keyboard-shortcuts.mjs";
3
5
  import { SidebarInset, SidebarProvider } from "../../components/ui/sidebar.mjs";
4
6
  import { Toaster } from "../../components/ui/sonner.mjs";
5
- import { BreadcrumbProvider, useCurrentBreadcrumbs } from "../../contexts/breadcrumb-context.mjs";
6
7
  import { GlobalSearch } from "../common/global-search.mjs";
7
8
  import { AdminSidebar } from "./admin-sidebar.mjs";
8
- import { AdminTopbar } from "./admin-topbar.mjs";
9
+ import { AdminThemeAppliedContext, useManagedAdminTheme } from "./admin-theme.mjs";
9
10
  import { c } from "react/compiler-runtime";
10
11
  import * as React from "react";
11
12
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -40,30 +41,6 @@ function useLayoutProps(props) {
40
41
  return t2;
41
42
  }
42
43
  /**
43
- * Topbar wrapper that reads breadcrumbs from context
44
- */
45
- function _temp2(s_0) {
46
- return s_0.navigate;
47
- }
48
- function _temp(s) {
49
- return s.brandName;
50
- }
51
- const AdminTopbarWithBreadcrumbs = React.memo(function AdminTopbarWithBreadcrumbs$1(props) {
52
- const $ = c(3);
53
- const breadcrumbs = useCurrentBreadcrumbs();
54
- let t0;
55
- if ($[0] !== breadcrumbs || $[1] !== props) {
56
- t0 = /* @__PURE__ */ jsx(AdminTopbar, {
57
- ...props,
58
- breadcrumbs
59
- });
60
- $[0] = breadcrumbs;
61
- $[1] = props;
62
- $[2] = t0;
63
- } else t0 = $[2];
64
- return t0;
65
- });
66
- /**
67
44
  * AdminLayout Component
68
45
  *
69
46
  * When used inside AdminProvider, brandName is automatically
@@ -79,45 +56,62 @@ const AdminTopbarWithBreadcrumbs = React.memo(function AdminTopbarWithBreadcrumb
79
56
  * </AdminProvider>
80
57
  * ```
81
58
  */
59
+ function _temp2(s_0) {
60
+ return s_0.navigate;
61
+ }
62
+ function _temp(s) {
63
+ return s.brandName;
64
+ }
82
65
  function AdminLayout(t0) {
83
- const $ = c(55);
84
- const { LinkComponent, activeRoute, basePath: t1, brandName: brandNameProp, sidebarCollapsed: t2, children, className, sidebarProps, header, footer, navigate: navigateProp, theme: t3, setTheme, showThemeToggle, toasterProps, layoutMode: t4 } = t0;
66
+ const $ = c(59);
67
+ const { LinkComponent, activeRoute, basePath: t1, brandName: brandNameProp, sidebarCollapsed: t2, children, className, sidebarProps, header, footer, navigate: navigateProp, theme: themeProp, setTheme: setThemeProp, showThemeToggle, toasterProps, layoutMode: t3 } = t0;
85
68
  const basePath = t1 === void 0 ? "/admin" : t1;
86
69
  const sidebarCollapsedProp = t2 === void 0 ? false : t2;
87
- const theme = t3 === void 0 ? "system" : t3;
88
- const layoutMode = t4 === void 0 ? "wide" : t4;
70
+ const layoutMode = t3 === void 0 ? "wide" : t3;
71
+ const { theme, setTheme } = useManagedAdminTheme(themeProp, setThemeProp);
89
72
  const shouldShowHeader = !!header;
90
73
  const shouldShowFooter = !!footer;
91
- let t5;
74
+ let t4;
92
75
  if ($[0] !== brandNameProp || $[1] !== navigateProp) {
93
- t5 = {
76
+ t4 = {
94
77
  brandName: brandNameProp,
95
78
  navigate: navigateProp
96
79
  };
97
80
  $[0] = brandNameProp;
98
81
  $[1] = navigateProp;
99
- $[2] = t5;
100
- } else t5 = $[2];
101
- const { brandName, navigate } = useLayoutProps(t5);
82
+ $[2] = t4;
83
+ } else t4 = $[2];
84
+ const { brandName, navigate } = useLayoutProps(t4);
85
+ const i18n = useSafeI18n();
86
+ let t5;
87
+ if ($[3] !== i18n) {
88
+ t5 = (key, fallback) => {
89
+ const message = i18n?.t(key);
90
+ return message && message !== key ? message : fallback;
91
+ };
92
+ $[3] = i18n;
93
+ $[4] = t5;
94
+ } else t5 = $[4];
95
+ const t = t5;
102
96
  const [isSearchOpen, setIsSearchOpen] = React.useState(false);
103
97
  let t6;
104
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
98
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
105
99
  t6 = () => setIsSearchOpen(true);
106
- $[3] = t6;
107
- } else t6 = $[3];
100
+ $[5] = t6;
101
+ } else t6 = $[5];
108
102
  const openSearch = t6;
109
103
  let t7;
110
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
104
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
111
105
  t7 = () => setIsSearchOpen(false);
112
- $[4] = t7;
113
- } else t7 = $[4];
106
+ $[6] = t7;
107
+ } else t7 = $[6];
114
108
  const closeSearch = t7;
115
109
  let t8;
116
110
  let t9;
117
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
111
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
118
112
  t8 = () => {
119
113
  const down = (e) => {
120
- if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
114
+ if (shouldHandleAdminShortcut(e, { key: "k" })) {
121
115
  e.preventDefault();
122
116
  setIsSearchOpen(true);
123
117
  }
@@ -126,96 +120,97 @@ function AdminLayout(t0) {
126
120
  return () => document.removeEventListener("keydown", down);
127
121
  };
128
122
  t9 = [];
129
- $[5] = t8;
130
- $[6] = t9;
123
+ $[7] = t8;
124
+ $[8] = t9;
131
125
  } else {
132
- t8 = $[5];
133
- t9 = $[6];
126
+ t8 = $[7];
127
+ t9 = $[8];
134
128
  }
135
129
  React.useEffect(t8, t9);
136
130
  let t10;
137
- if ($[7] !== className) {
138
- t10 = cn("qa-admin-layout bg-background min-h-screen", className);
139
- $[7] = className;
140
- $[8] = t10;
141
- } else t10 = $[8];
131
+ if ($[9] !== className) {
132
+ t10 = cn("qa-admin-layout bg-sidebar text-foreground min-h-screen", className);
133
+ $[9] = className;
134
+ $[10] = t10;
135
+ } else t10 = $[10];
142
136
  let t11;
143
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
144
- t11 = /* @__PURE__ */ jsx("a", {
137
+ if ($[11] !== t) {
138
+ t11 = t("ui.skipToMainContent", "Skip to main content");
139
+ $[11] = t;
140
+ $[12] = t11;
141
+ } else t11 = $[12];
142
+ let t12;
143
+ if ($[13] !== t11) {
144
+ t12 = /* @__PURE__ */ jsx("a", {
145
145
  href: "#main-content",
146
- className: "qa-admin-layout__skip-link focus:bg-primary focus:text-primary-foreground sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-50 focus:px-4 focus:py-2 focus:text-sm focus:font-medium",
147
- children: "Skip to main content"
146
+ className: "qa-admin-layout__skip-link focus:bg-surface-high focus:text-foreground sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-50 focus:rounded-sm focus:px-4 focus:py-2 focus:text-sm focus:font-medium",
147
+ children: t11
148
148
  });
149
- $[9] = t11;
150
- } else t11 = $[9];
151
- let t12;
152
- if ($[10] !== basePath || $[11] !== isSearchOpen || $[12] !== navigate) {
153
- t12 = isSearchOpen && /* @__PURE__ */ jsx(GlobalSearch, {
149
+ $[13] = t11;
150
+ $[14] = t12;
151
+ } else t12 = $[14];
152
+ let t13;
153
+ if ($[15] !== basePath || $[16] !== isSearchOpen || $[17] !== navigate) {
154
+ t13 = isSearchOpen && /* @__PURE__ */ jsx(GlobalSearch, {
154
155
  isOpen: isSearchOpen,
155
156
  onClose: closeSearch,
156
157
  navigate,
157
158
  basePath
158
159
  });
159
- $[10] = basePath;
160
- $[11] = isSearchOpen;
161
- $[12] = navigate;
162
- $[13] = t12;
163
- } else t12 = $[13];
164
- const t13 = !sidebarCollapsedProp;
165
- let t14;
166
- if ($[14] !== LinkComponent || $[15] !== activeRoute || $[16] !== basePath || $[17] !== brandName || $[18] !== sidebarProps) {
167
- t14 = /* @__PURE__ */ jsx(AdminSidebar, {
160
+ $[15] = basePath;
161
+ $[16] = isSearchOpen;
162
+ $[17] = navigate;
163
+ $[18] = t13;
164
+ } else t13 = $[18];
165
+ const t14 = !sidebarCollapsedProp;
166
+ let t15;
167
+ if ($[19] !== LinkComponent || $[20] !== activeRoute || $[21] !== basePath || $[22] !== brandName || $[23] !== setTheme || $[24] !== showThemeToggle || $[25] !== sidebarProps || $[26] !== theme) {
168
+ t15 = /* @__PURE__ */ jsx(AdminSidebar, {
168
169
  LinkComponent,
169
170
  activeRoute,
170
171
  basePath,
171
172
  brandName,
172
- ...sidebarProps
173
- });
174
- $[14] = LinkComponent;
175
- $[15] = activeRoute;
176
- $[16] = basePath;
177
- $[17] = brandName;
178
- $[18] = sidebarProps;
179
- $[19] = t14;
180
- } else t14 = $[19];
181
- let t15;
182
- if ($[20] !== setTheme || $[21] !== showThemeToggle || $[22] !== theme) {
183
- t15 = /* @__PURE__ */ jsx(AdminTopbarWithBreadcrumbs, {
184
- onSearchOpen: openSearch,
185
173
  theme,
186
174
  setTheme,
187
- showThemeToggle
175
+ showThemeToggle,
176
+ onSearchOpen: openSearch,
177
+ ...sidebarProps
188
178
  });
189
- $[20] = setTheme;
190
- $[21] = showThemeToggle;
191
- $[22] = theme;
192
- $[23] = t15;
193
- } else t15 = $[23];
179
+ $[19] = LinkComponent;
180
+ $[20] = activeRoute;
181
+ $[21] = basePath;
182
+ $[22] = brandName;
183
+ $[23] = setTheme;
184
+ $[24] = showThemeToggle;
185
+ $[25] = sidebarProps;
186
+ $[26] = theme;
187
+ $[27] = t15;
188
+ } else t15 = $[27];
194
189
  let t16;
195
- if ($[24] !== header || $[25] !== shouldShowHeader) {
190
+ if ($[28] !== header || $[29] !== shouldShowHeader) {
196
191
  t16 = shouldShowHeader && header && /* @__PURE__ */ jsx("header", {
197
- className: "qa-admin-layout__header border-b",
192
+ className: "qa-admin-layout__header border-border-subtle border-b",
198
193
  children: header
199
194
  });
200
- $[24] = header;
201
- $[25] = shouldShowHeader;
202
- $[26] = t16;
203
- } else t16 = $[26];
204
- const t17 = layoutMode === "default" && "mx-auto max-w-5xl p-3 md:p-4 lg:p-6";
205
- const t18 = layoutMode === "wide" && "p-3 md:p-4 lg:p-6";
206
- const t19 = layoutMode === "full" && "p-2 md:p-3";
195
+ $[28] = header;
196
+ $[29] = shouldShowHeader;
197
+ $[30] = t16;
198
+ } else t16 = $[30];
199
+ const t17 = layoutMode === "default" && "mx-auto max-w-5xl px-3 pt-1 pb-6 md:px-4 md:pt-2 md:pb-8";
200
+ const t18 = layoutMode === "wide" && "px-3 pt-1 pb-6 md:px-4 md:pt-2 md:pb-8";
201
+ const t19 = layoutMode === "full" && "px-2 pt-1 pb-6 md:px-3 md:pb-8";
207
202
  const t20 = layoutMode === "immersive" && "p-0";
208
203
  let t21;
209
- if ($[27] !== t17 || $[28] !== t18 || $[29] !== t19 || $[30] !== t20) {
204
+ if ($[31] !== t17 || $[32] !== t18 || $[33] !== t19 || $[34] !== t20) {
210
205
  t21 = cn("qa-admin-layout__main-content min-w-0", t17, t18, t19, t20);
211
- $[27] = t17;
212
- $[28] = t18;
213
- $[29] = t19;
214
- $[30] = t20;
215
- $[31] = t21;
216
- } else t21 = $[31];
206
+ $[31] = t17;
207
+ $[32] = t18;
208
+ $[33] = t19;
209
+ $[34] = t20;
210
+ $[35] = t21;
211
+ } else t21 = $[35];
217
212
  let t22;
218
- if ($[32] !== children || $[33] !== t21) {
213
+ if ($[36] !== children || $[37] !== t21) {
219
214
  t22 = /* @__PURE__ */ jsx("main", {
220
215
  id: "main-content",
221
216
  className: "qa-admin-layout__main min-w-0 flex-1 overflow-y-auto",
@@ -225,76 +220,78 @@ function AdminLayout(t0) {
225
220
  children
226
221
  })
227
222
  });
228
- $[32] = children;
229
- $[33] = t21;
230
- $[34] = t22;
231
- } else t22 = $[34];
223
+ $[36] = children;
224
+ $[37] = t21;
225
+ $[38] = t22;
226
+ } else t22 = $[38];
232
227
  let t23;
233
- if ($[35] !== footer || $[36] !== shouldShowFooter) {
228
+ if ($[39] !== footer || $[40] !== shouldShowFooter) {
234
229
  t23 = shouldShowFooter && footer && /* @__PURE__ */ jsx("footer", {
235
- className: "qa-admin-layout__footer border-t",
230
+ className: "qa-admin-layout__footer border-border-subtle border-t",
236
231
  children: footer
237
232
  });
238
- $[35] = footer;
239
- $[36] = shouldShowFooter;
240
- $[37] = t23;
241
- } else t23 = $[37];
233
+ $[39] = footer;
234
+ $[40] = shouldShowFooter;
235
+ $[41] = t23;
236
+ } else t23 = $[41];
242
237
  let t24;
243
- if ($[38] !== t15 || $[39] !== t16 || $[40] !== t22 || $[41] !== t23) {
238
+ if ($[42] !== t16 || $[43] !== t22 || $[44] !== t23) {
244
239
  t24 = /* @__PURE__ */ jsxs(SidebarInset, {
245
- className: "qa-admin-layout__content flex h-svh flex-col",
240
+ className: "qa-admin-layout__content bg-background flex h-svh flex-col overflow-hidden md:rounded-tl-2xl",
246
241
  children: [
247
- t15,
248
242
  t16,
249
243
  t22,
250
244
  t23
251
245
  ]
252
246
  });
253
- $[38] = t15;
254
- $[39] = t16;
255
- $[40] = t22;
256
- $[41] = t23;
257
- $[42] = t24;
258
- } else t24 = $[42];
247
+ $[42] = t16;
248
+ $[43] = t22;
249
+ $[44] = t23;
250
+ $[45] = t24;
251
+ } else t24 = $[45];
259
252
  let t25;
260
- if ($[43] !== t13 || $[44] !== t14 || $[45] !== t24) {
253
+ if ($[46] !== t14 || $[47] !== t15 || $[48] !== t24) {
261
254
  t25 = /* @__PURE__ */ jsxs(SidebarProvider, {
262
- defaultOpen: t13,
263
- className: "qa-admin-layout__sidebar-wrapper border-border mx-auto h-svh max-w-[1920px] overflow-hidden border-x",
264
- children: [t14, t24]
255
+ defaultOpen: t14,
256
+ className: "qa-admin-layout__sidebar-wrapper bg-sidebar mx-auto h-svh max-w-[1920px] overflow-hidden",
257
+ children: [t15, t24]
265
258
  });
266
- $[43] = t13;
267
- $[44] = t14;
268
- $[45] = t24;
269
- $[46] = t25;
270
- } else t25 = $[46];
259
+ $[46] = t14;
260
+ $[47] = t15;
261
+ $[48] = t24;
262
+ $[49] = t25;
263
+ } else t25 = $[49];
271
264
  let t26;
272
- if ($[47] !== theme || $[48] !== toasterProps) {
265
+ if ($[50] !== theme || $[51] !== toasterProps) {
273
266
  t26 = /* @__PURE__ */ jsx(Toaster, {
274
267
  theme,
275
268
  ...toasterProps
276
269
  });
277
- $[47] = theme;
278
- $[48] = toasterProps;
279
- $[49] = t26;
280
- } else t26 = $[49];
270
+ $[50] = theme;
271
+ $[51] = toasterProps;
272
+ $[52] = t26;
273
+ } else t26 = $[52];
281
274
  let t27;
282
- if ($[50] !== t10 || $[51] !== t12 || $[52] !== t25 || $[53] !== t26) {
283
- t27 = /* @__PURE__ */ jsx(BreadcrumbProvider, { children: /* @__PURE__ */ jsxs("div", {
284
- className: t10,
285
- children: [
286
- t11,
287
- t12,
288
- t25,
289
- t26
290
- ]
291
- }) });
292
- $[50] = t10;
293
- $[51] = t12;
294
- $[52] = t25;
295
- $[53] = t26;
296
- $[54] = t27;
297
- } else t27 = $[54];
275
+ if ($[53] !== t10 || $[54] !== t12 || $[55] !== t13 || $[56] !== t25 || $[57] !== t26) {
276
+ t27 = /* @__PURE__ */ jsx(AdminThemeAppliedContext.Provider, {
277
+ value: true,
278
+ children: /* @__PURE__ */ jsxs("div", {
279
+ className: t10,
280
+ children: [
281
+ t12,
282
+ t13,
283
+ t25,
284
+ t26
285
+ ]
286
+ })
287
+ });
288
+ $[53] = t10;
289
+ $[54] = t12;
290
+ $[55] = t13;
291
+ $[56] = t25;
292
+ $[57] = t26;
293
+ $[58] = t27;
294
+ } else t27 = $[58];
298
295
  return t27;
299
296
  }
300
297