@questpie/admin 3.2.3 → 3.2.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.
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +164 -339
- package/dist/client/components/actions/action-button.mjs +9 -9
- package/dist/client/components/actions/action-dialog.mjs +195 -493
- package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
- package/dist/client/components/actions/header-actions.mjs +73 -165
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/admin-link.mjs +40 -126
- package/dist/client/components/auth/auth-loading.mjs +9 -44
- package/dist/client/components/blocks/block-canvas.mjs +31 -95
- package/dist/client/components/blocks/block-editor-context.mjs +13 -57
- package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
- package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
- package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
- package/dist/client/components/blocks/block-insert-button.mjs +49 -165
- package/dist/client/components/blocks/block-item-menu.mjs +102 -301
- package/dist/client/components/blocks/block-item.mjs +136 -370
- package/dist/client/components/blocks/block-library-sidebar.mjs +106 -220
- package/dist/client/components/blocks/block-tree.mjs +12 -68
- package/dist/client/components/blocks/block-type-icon.mjs +14 -56
- package/dist/client/components/brand-logo.mjs +35 -149
- package/dist/client/components/component-renderer.mjs +42 -118
- package/dist/client/components/error-boundary.mjs +14 -58
- package/dist/client/components/fields/array-field.mjs +209 -521
- package/dist/client/components/fields/asset-preview-field.mjs +41 -141
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
- package/dist/client/components/fields/boolean-field.mjs +29 -59
- package/dist/client/components/fields/date-field.mjs +7 -37
- package/dist/client/components/fields/datetime-field.mjs +7 -38
- package/dist/client/components/fields/email-field.mjs +25 -54
- package/dist/client/components/fields/field-wrapper.mjs +30 -105
- package/dist/client/components/fields/json-field.mjs +107 -313
- package/dist/client/components/fields/locale-badge.mjs +6 -15
- package/dist/client/components/fields/number-field.mjs +27 -60
- package/dist/client/components/fields/object-array-field.mjs +283 -659
- package/dist/client/components/fields/object-field.mjs +165 -633
- package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
- package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
- package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
- package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
- package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
- package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
- package/dist/client/components/fields/relation-field.mjs +10 -66
- package/dist/client/components/fields/relation-picker.mjs +18 -18
- package/dist/client/components/fields/relation-select.mjs +12 -12
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -182
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +8 -19
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
- package/dist/client/components/fields/rich-text-editor/index.mjs +196 -530
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
- package/dist/client/components/fields/rich-text-field.mjs +14 -53
- package/dist/client/components/fields/select-field.mjs +39 -74
- package/dist/client/components/fields/text-field.mjs +26 -59
- package/dist/client/components/fields/textarea-field.mjs +26 -58
- package/dist/client/components/fields/time-field.mjs +7 -35
- package/dist/client/components/fields/upload-field.mjs +47 -165
- package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
- package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
- package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
- package/dist/client/components/history-sidebar.mjs +306 -611
- package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
- package/dist/client/components/locale-switcher.mjs +106 -228
- package/dist/client/components/media/media-grid.mjs +84 -273
- package/dist/client/components/media/media-picker-dialog.mjs +177 -494
- package/dist/client/components/preview/live-preview-mode.mjs +240 -438
- package/dist/client/components/preview/preview-pane.mjs +22 -22
- package/dist/client/components/primitives/asset-preview.mjs +290 -666
- package/dist/client/components/primitives/checkbox-input.mjs +9 -35
- package/dist/client/components/primitives/date-input.mjs +109 -327
- package/dist/client/components/primitives/dropzone.mjs +209 -336
- package/dist/client/components/primitives/field-select-control.mjs +12 -80
- package/dist/client/components/primitives/number-input.mjs +4 -4
- package/dist/client/components/primitives/select-multi.mjs +200 -559
- package/dist/client/components/primitives/select-single.mjs +165 -499
- package/dist/client/components/primitives/time-input.mjs +43 -117
- package/dist/client/components/primitives/toggle-input.mjs +9 -29
- package/dist/client/components/sheets/resource-sheet.mjs +61 -70
- package/dist/client/components/ui/accordion.mjs +35 -155
- package/dist/client/components/ui/alert.mjs +13 -68
- package/dist/client/components/ui/badge.mjs +9 -51
- package/dist/client/components/ui/button.mjs +8 -54
- package/dist/client/components/ui/card.mjs +37 -193
- package/dist/client/components/ui/checkbox.mjs +12 -68
- package/dist/client/components/ui/command.mjs +48 -219
- package/dist/client/components/ui/dialog.mjs +50 -262
- package/dist/client/components/ui/drawer.mjs +55 -259
- package/dist/client/components/ui/dropdown-menu.mjs +86 -427
- package/dist/client/components/ui/empty-state.mjs +28 -98
- package/dist/client/components/ui/field.mjs +73 -309
- package/dist/client/components/ui/input-group.mjs +42 -167
- package/dist/client/components/ui/input.mjs +7 -37
- package/dist/client/components/ui/kbd.mjs +6 -36
- package/dist/client/components/ui/label.mjs +7 -37
- package/dist/client/components/ui/popover.mjs +34 -169
- package/dist/client/components/ui/responsive-dialog.mjs +67 -273
- package/dist/client/components/ui/scroll-fade.mjs +63 -158
- package/dist/client/components/ui/search-input.mjs +33 -100
- package/dist/client/components/ui/select.mjs +72 -393
- package/dist/client/components/ui/separator.mjs +7 -38
- package/dist/client/components/ui/sheet.mjs +49 -269
- package/dist/client/components/ui/sidebar.mjs +171 -690
- package/dist/client/components/ui/skeleton.mjs +7 -38
- package/dist/client/components/ui/sonner.mjs +11 -42
- package/dist/client/components/ui/switch.mjs +9 -45
- package/dist/client/components/ui/table.mjs +48 -266
- package/dist/client/components/ui/tabs.mjs +26 -139
- package/dist/client/components/ui/textarea.mjs +6 -32
- package/dist/client/components/ui/tooltip.mjs +27 -129
- package/dist/client/components/widgets/chart-widget.mjs +174 -522
- package/dist/client/components/widgets/progress-widget.mjs +66 -172
- package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
- package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
- package/dist/client/components/widgets/stats-widget.mjs +41 -175
- package/dist/client/components/widgets/table-widget.mjs +9 -9
- package/dist/client/components/widgets/timeline-widget.mjs +86 -226
- package/dist/client/components/widgets/value-widget.mjs +74 -381
- package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
- package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
- package/dist/client/contexts/focus-context.d.mts +4 -0
- package/dist/client/contexts/focus-context.mjs +87 -150
- package/dist/client/hooks/typed-hooks.mjs +241 -701
- package/dist/client/hooks/use-action.mjs +62 -198
- package/dist/client/hooks/use-admin-config.mjs +5 -35
- package/dist/client/hooks/use-admin-preferences.mjs +16 -88
- package/dist/client/hooks/use-admin-routes.mjs +22 -56
- package/dist/client/hooks/use-audit-history.mjs +21 -69
- package/dist/client/hooks/use-brand.mjs +1 -9
- package/dist/client/hooks/use-collection-fields.mjs +17 -57
- package/dist/client/hooks/use-collection-meta.mjs +12 -44
- package/dist/client/hooks/use-collection-schema.mjs +10 -33
- package/dist/client/hooks/use-collection-validation.mjs +23 -53
- package/dist/client/hooks/use-collection.mjs +194 -614
- package/dist/client/hooks/use-current-user.mjs +0 -1
- package/dist/client/hooks/use-field-hooks.mjs +10 -10
- package/dist/client/hooks/use-field-options.mjs +61 -202
- package/dist/client/hooks/use-global-fields.mjs +14 -46
- package/dist/client/hooks/use-global-meta.mjs +9 -30
- package/dist/client/hooks/use-global-schema.mjs +9 -30
- package/dist/client/hooks/use-global.mjs +63 -219
- package/dist/client/hooks/use-locks.mjs +117 -325
- package/dist/client/hooks/use-media-query.mjs +16 -36
- package/dist/client/hooks/use-prefill-params.mjs +0 -1
- package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
- package/dist/client/hooks/use-reactive-fields.mjs +1 -1
- package/dist/client/hooks/use-reactive-prop.mjs +65 -223
- package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
- package/dist/client/hooks/use-saved-views.mjs +22 -103
- package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
- package/dist/client/hooks/use-search.mjs +31 -143
- package/dist/client/hooks/use-server-actions.mjs +18 -50
- package/dist/client/hooks/use-server-validation.mjs +72 -166
- package/dist/client/hooks/use-server-widget-data.mjs +7 -33
- package/dist/client/hooks/use-setup-status.mjs +12 -25
- package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
- package/dist/client/hooks/use-transition-stage.mjs +8 -38
- package/dist/client/hooks/use-upload.mjs +54 -152
- package/dist/client/hooks/use-validation-error-map.mjs +6 -26
- package/dist/client/hooks/use-view-state.mjs +187 -437
- package/dist/client/i18n/hooks.mjs +65 -197
- package/dist/client/lib/render-profiler.mjs +14 -41
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/block-scope-context.mjs +14 -36
- package/dist/client/preview/diff.mjs +110 -0
- package/dist/client/preview/preview-banner.mjs +42 -108
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +166 -409
- package/dist/client/preview/use-collection-preview.mjs +135 -201
- package/dist/client/runtime/content-locales-provider.mjs +31 -83
- package/dist/client/runtime/locale-scope.mjs +22 -63
- package/dist/client/runtime/provider.mjs +100 -255
- package/dist/client/runtime/translations-provider.mjs +41 -107
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/picker.mjs +86 -321
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/scope/provider.mjs +8 -17
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/accept-invite-form.mjs +121 -412
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/auth-layout.mjs +104 -284
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +94 -325
- package/dist/client/views/auth/invite-form.mjs +107 -442
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +116 -337
- package/dist/client/views/auth/reset-password-form.mjs +128 -453
- package/dist/client/views/auth/setup-form.mjs +140 -478
- package/dist/client/views/collection/auto-form-fields.mjs +243 -615
- package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -400
- package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
- package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
- package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
- package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
- package/dist/client/views/collection/columns/build-columns.mjs +8 -48
- package/dist/client/views/collection/field-renderer.mjs +11 -24
- package/dist/client/views/collection/form-view.mjs +288 -560
- package/dist/client/views/collection/table-view.mjs +239 -469
- package/dist/client/views/collection/view-skeletons.mjs +112 -237
- package/dist/client/views/common/global-search.mjs +241 -543
- package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
- package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
- package/dist/client/views/dashboard/widget-card.mjs +61 -269
- package/dist/client/views/globals/global-form-view.mjs +478 -1298
- package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
- package/dist/client/views/layout/admin-layout.mjs +83 -246
- package/dist/client/views/layout/admin-router.mjs +457 -1289
- package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
- package/dist/client/views/layout/admin-theme.mjs +30 -64
- package/dist/client/views/layout/admin-view-layout.mjs +40 -144
- package/dist/client/views/pages/accept-invite-page.mjs +95 -290
- package/dist/client/views/pages/dashboard-page.mjs +11 -57
- package/dist/client/views/pages/forgot-password-page.mjs +31 -83
- package/dist/client/views/pages/invite-page.mjs +35 -90
- package/dist/client/views/pages/login-page.mjs +41 -121
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +46 -173
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +33 -95
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
- package/dist/server/modules/admin/collections/account.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
- package/dist/server/modules/admin/collections/assets.d.mts +34 -34
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +53 -53
- package/dist/server/modules/admin/collections/verification.d.mts +36 -36
- package/dist/server/modules/admin/index.d.mts +21 -20
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/package.json +3 -5
|
@@ -5,7 +5,6 @@ import { getAdminConfigQueryOptions } from "../../hooks/use-admin-config.mjs";
|
|
|
5
5
|
import { AdminThemeAppliedContext, useManagedAdminTheme } from "./admin-theme.mjs";
|
|
6
6
|
import { AdminLayout } from "./admin-layout.mjs";
|
|
7
7
|
import { AuthGuard } from "../../components/auth/auth-guard.mjs";
|
|
8
|
-
import { c } from "react/compiler-runtime";
|
|
9
8
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
10
9
|
import { jsx } from "react/jsx-runtime";
|
|
11
10
|
|
|
@@ -162,12 +161,7 @@ function isPublicPath(currentPath, basePath, publicPaths) {
|
|
|
162
161
|
* Universal wrapper for admin layout that works with any router.
|
|
163
162
|
* Handles all the provider setup and renders children inside the layout.
|
|
164
163
|
*/
|
|
165
|
-
function AdminLayoutProvider(
|
|
166
|
-
const $ = c(33);
|
|
167
|
-
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;
|
|
168
|
-
const basePath = t1 === void 0 ? "/admin" : t1;
|
|
169
|
-
const publicPaths = t2 === void 0 ? DEFAULT_PUBLIC_PATHS : t2;
|
|
170
|
-
const requiredRole = t3 === void 0 ? "admin" : t3;
|
|
164
|
+
function AdminLayoutProvider({ admin: adminInput, client, authClient, queryClient, LinkComponent, activeRoute, basePath = "/admin", header, footer, sidebarProps, theme, setTheme, showThemeToggle, toasterProps, className, enableAuthGuard, publicPaths = DEFAULT_PUBLIC_PATHS, requiredRole = "admin", authLoadingFallback, authUnauthorizedFallback, useServerTranslations, translationsFallback, initialUiLocale, children }) {
|
|
171
165
|
const qc = queryClient ? configureAdminQueryClient(queryClient) : getDefaultQueryClient();
|
|
172
166
|
const { theme: managedTheme, setTheme: setManagedTheme } = useManagedAdminTheme(theme, setTheme);
|
|
173
167
|
if (client?.routes) {
|
|
@@ -178,71 +172,37 @@ function AdminLayoutProvider(t0) {
|
|
|
178
172
|
qc.prefetchQuery(getAdminTranslationsQueryOptions(client, locale));
|
|
179
173
|
}
|
|
180
174
|
}
|
|
181
|
-
|
|
182
|
-
if ($[0] !== adminInput) {
|
|
183
|
-
t4 = Admin.normalize(adminInput);
|
|
184
|
-
$[0] = adminInput;
|
|
185
|
-
$[1] = t4;
|
|
186
|
-
} else t4 = $[1];
|
|
187
|
-
const admin = t4;
|
|
175
|
+
const admin = Admin.normalize(adminInput);
|
|
188
176
|
const shouldUseAuthGuard = enableAuthGuard ?? authClient != null;
|
|
189
177
|
const isCurrentPathPublic = isPublicPath(activeRoute ?? (typeof window !== "undefined" ? window.location.pathname : void 0), basePath, publicPaths);
|
|
190
178
|
let innerContent;
|
|
191
179
|
if (isCurrentPathPublic) innerContent = children;
|
|
192
180
|
else {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
$[7] = footer;
|
|
215
|
-
$[8] = header;
|
|
216
|
-
$[9] = managedTheme;
|
|
217
|
-
$[10] = setManagedTheme;
|
|
218
|
-
$[11] = showThemeToggle;
|
|
219
|
-
$[12] = sidebarProps;
|
|
220
|
-
$[13] = toasterProps;
|
|
221
|
-
$[14] = t5$1;
|
|
222
|
-
} else t5$1 = $[14];
|
|
223
|
-
const layoutContent = t5$1;
|
|
224
|
-
let t6$1;
|
|
225
|
-
if ($[15] !== authLoadingFallback || $[16] !== authUnauthorizedFallback || $[17] !== basePath || $[18] !== layoutContent || $[19] !== requiredRole || $[20] !== shouldUseAuthGuard) {
|
|
226
|
-
t6$1 = shouldUseAuthGuard ? /* @__PURE__ */ jsx(AuthGuard, {
|
|
227
|
-
loginPath: `${basePath}/login`,
|
|
228
|
-
requiredRole,
|
|
229
|
-
loadingFallback: authLoadingFallback,
|
|
230
|
-
unauthorizedFallback: authUnauthorizedFallback,
|
|
231
|
-
children: layoutContent
|
|
232
|
-
}) : layoutContent;
|
|
233
|
-
$[15] = authLoadingFallback;
|
|
234
|
-
$[16] = authUnauthorizedFallback;
|
|
235
|
-
$[17] = basePath;
|
|
236
|
-
$[18] = layoutContent;
|
|
237
|
-
$[19] = requiredRole;
|
|
238
|
-
$[20] = shouldUseAuthGuard;
|
|
239
|
-
$[21] = t6$1;
|
|
240
|
-
} else t6$1 = $[21];
|
|
241
|
-
innerContent = t6$1;
|
|
181
|
+
const layoutContent = /* @__PURE__ */ jsx(AdminLayout, {
|
|
182
|
+
LinkComponent,
|
|
183
|
+
activeRoute,
|
|
184
|
+
basePath,
|
|
185
|
+
header,
|
|
186
|
+
footer,
|
|
187
|
+
sidebarProps,
|
|
188
|
+
theme: managedTheme,
|
|
189
|
+
setTheme: setManagedTheme,
|
|
190
|
+
showThemeToggle,
|
|
191
|
+
toasterProps,
|
|
192
|
+
className,
|
|
193
|
+
children
|
|
194
|
+
});
|
|
195
|
+
innerContent = shouldUseAuthGuard ? /* @__PURE__ */ jsx(AuthGuard, {
|
|
196
|
+
loginPath: `${basePath}/login`,
|
|
197
|
+
requiredRole,
|
|
198
|
+
loadingFallback: authLoadingFallback,
|
|
199
|
+
unauthorizedFallback: authUnauthorizedFallback,
|
|
200
|
+
children: layoutContent
|
|
201
|
+
}) : layoutContent;
|
|
242
202
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
203
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
204
|
+
client: qc,
|
|
205
|
+
children: /* @__PURE__ */ jsx(AdminThemeAppliedContext.Provider, {
|
|
246
206
|
value: true,
|
|
247
207
|
children: /* @__PURE__ */ jsx(AdminProvider, {
|
|
248
208
|
admin,
|
|
@@ -253,28 +213,8 @@ function AdminLayoutProvider(t0) {
|
|
|
253
213
|
initialUiLocale,
|
|
254
214
|
children: innerContent
|
|
255
215
|
})
|
|
256
|
-
})
|
|
257
|
-
|
|
258
|
-
$[23] = authClient;
|
|
259
|
-
$[24] = client;
|
|
260
|
-
$[25] = initialUiLocale;
|
|
261
|
-
$[26] = innerContent;
|
|
262
|
-
$[27] = translationsFallback;
|
|
263
|
-
$[28] = useServerTranslations;
|
|
264
|
-
$[29] = t5;
|
|
265
|
-
} else t5 = $[29];
|
|
266
|
-
const content = t5;
|
|
267
|
-
let t6;
|
|
268
|
-
if ($[30] !== content || $[31] !== qc) {
|
|
269
|
-
t6 = /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
270
|
-
client: qc,
|
|
271
|
-
children: content
|
|
272
|
-
});
|
|
273
|
-
$[30] = content;
|
|
274
|
-
$[31] = qc;
|
|
275
|
-
$[32] = t6;
|
|
276
|
-
} else t6 = $[32];
|
|
277
|
-
return t6;
|
|
216
|
+
})
|
|
217
|
+
});
|
|
278
218
|
}
|
|
279
219
|
|
|
280
220
|
//#endregion
|
|
@@ -7,7 +7,6 @@ import { Toaster } from "../../components/ui/sonner.mjs";
|
|
|
7
7
|
import { GlobalSearch } from "../common/global-search.mjs";
|
|
8
8
|
import { AdminSidebar } from "./admin-sidebar.mjs";
|
|
9
9
|
import { AdminThemeAppliedContext, useManagedAdminTheme } from "./admin-theme.mjs";
|
|
10
|
-
import { c } from "react/compiler-runtime";
|
|
11
10
|
import * as React from "react";
|
|
12
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
12
|
|
|
@@ -23,22 +22,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
23
22
|
* Automatically reads from AdminProvider context when props are not provided.
|
|
24
23
|
*/
|
|
25
24
|
function useLayoutProps(props) {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if ($[0] !== t0 || $[1] !== t1) {
|
|
33
|
-
t2 = {
|
|
34
|
-
brandName: t0,
|
|
35
|
-
navigate: t1
|
|
36
|
-
};
|
|
37
|
-
$[0] = t0;
|
|
38
|
-
$[1] = t1;
|
|
39
|
-
$[2] = t2;
|
|
40
|
-
} else t2 = $[2];
|
|
41
|
-
return t2;
|
|
25
|
+
const storeBrandName = useAdminStore((s) => s.brandName);
|
|
26
|
+
const storeNavigate = useAdminStore((s) => s.navigate);
|
|
27
|
+
return {
|
|
28
|
+
brandName: props.brandName ?? storeBrandName,
|
|
29
|
+
navigate: props.navigate ?? storeNavigate
|
|
30
|
+
};
|
|
42
31
|
}
|
|
43
32
|
/**
|
|
44
33
|
* AdminLayout Component
|
|
@@ -56,243 +45,91 @@ function useLayoutProps(props) {
|
|
|
56
45
|
* </AdminProvider>
|
|
57
46
|
* ```
|
|
58
47
|
*/
|
|
59
|
-
function
|
|
60
|
-
return s_0.navigate;
|
|
61
|
-
}
|
|
62
|
-
function _temp(s) {
|
|
63
|
-
return s.brandName;
|
|
64
|
-
}
|
|
65
|
-
function AdminLayout(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;
|
|
68
|
-
const basePath = t1 === void 0 ? "/admin" : t1;
|
|
69
|
-
const sidebarCollapsedProp = t2 === void 0 ? false : t2;
|
|
70
|
-
const layoutMode = t3 === void 0 ? "wide" : t3;
|
|
48
|
+
function AdminLayout({ LinkComponent, activeRoute, basePath = "/admin", brandName: brandNameProp, sidebarCollapsed: sidebarCollapsedProp = false, children, className, sidebarProps, header, footer, navigate: navigateProp, theme: themeProp, setTheme: setThemeProp, showThemeToggle, toasterProps, layoutMode = "wide" }) {
|
|
71
49
|
const { theme, setTheme } = useManagedAdminTheme(themeProp, setThemeProp);
|
|
72
50
|
const shouldShowHeader = !!header;
|
|
73
51
|
const shouldShowFooter = !!footer;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
navigate: navigateProp
|
|
79
|
-
};
|
|
80
|
-
$[0] = brandNameProp;
|
|
81
|
-
$[1] = navigateProp;
|
|
82
|
-
$[2] = t4;
|
|
83
|
-
} else t4 = $[2];
|
|
84
|
-
const { brandName, navigate } = useLayoutProps(t4);
|
|
52
|
+
const { brandName, navigate } = useLayoutProps({
|
|
53
|
+
brandName: brandNameProp,
|
|
54
|
+
navigate: navigateProp
|
|
55
|
+
});
|
|
85
56
|
const i18n = useSafeI18n();
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return message && message !== key ? message : fallback;
|
|
91
|
-
};
|
|
92
|
-
$[3] = i18n;
|
|
93
|
-
$[4] = t5;
|
|
94
|
-
} else t5 = $[4];
|
|
95
|
-
const t = t5;
|
|
57
|
+
const t = (key, fallback) => {
|
|
58
|
+
const message = i18n?.t(key);
|
|
59
|
+
return message && message !== key ? message : fallback;
|
|
60
|
+
};
|
|
96
61
|
const [isSearchOpen, setIsSearchOpen] = React.useState(false);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
t7 = () => setIsSearchOpen(false);
|
|
106
|
-
$[6] = t7;
|
|
107
|
-
} else t7 = $[6];
|
|
108
|
-
const closeSearch = t7;
|
|
109
|
-
let t8;
|
|
110
|
-
let t9;
|
|
111
|
-
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
112
|
-
t8 = () => {
|
|
113
|
-
const down = (e) => {
|
|
114
|
-
if (shouldHandleAdminShortcut(e, { key: "k" })) {
|
|
115
|
-
e.preventDefault();
|
|
116
|
-
setIsSearchOpen(true);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
document.addEventListener("keydown", down);
|
|
120
|
-
return () => document.removeEventListener("keydown", down);
|
|
62
|
+
const openSearch = React.useCallback(() => setIsSearchOpen(true), []);
|
|
63
|
+
const closeSearch = React.useCallback(() => setIsSearchOpen(false), []);
|
|
64
|
+
React.useEffect(() => {
|
|
65
|
+
const down = (e) => {
|
|
66
|
+
if (shouldHandleAdminShortcut(e, { key: "k" })) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
setIsSearchOpen(true);
|
|
69
|
+
}
|
|
121
70
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
React.useEffect(t8, t9);
|
|
130
|
-
let t10;
|
|
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];
|
|
136
|
-
let t11;
|
|
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
|
-
href: "#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
|
-
});
|
|
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, {
|
|
155
|
-
isOpen: isSearchOpen,
|
|
156
|
-
onClose: closeSearch,
|
|
157
|
-
navigate,
|
|
158
|
-
basePath
|
|
159
|
-
});
|
|
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, {
|
|
169
|
-
LinkComponent,
|
|
170
|
-
activeRoute,
|
|
171
|
-
basePath,
|
|
172
|
-
brandName,
|
|
173
|
-
theme,
|
|
174
|
-
setTheme,
|
|
175
|
-
showThemeToggle,
|
|
176
|
-
onSearchOpen: openSearch,
|
|
177
|
-
...sidebarProps
|
|
178
|
-
});
|
|
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];
|
|
189
|
-
let t16;
|
|
190
|
-
if ($[28] !== header || $[29] !== shouldShowHeader) {
|
|
191
|
-
t16 = shouldShowHeader && header && /* @__PURE__ */ jsx("header", {
|
|
192
|
-
className: "qa-admin-layout__header border-border-subtle border-b",
|
|
193
|
-
children: header
|
|
194
|
-
});
|
|
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";
|
|
202
|
-
const t20 = layoutMode === "immersive" && "p-0";
|
|
203
|
-
let t21;
|
|
204
|
-
if ($[31] !== t17 || $[32] !== t18 || $[33] !== t19 || $[34] !== t20) {
|
|
205
|
-
t21 = cn("qa-admin-layout__main-content min-w-0", t17, t18, t19, t20);
|
|
206
|
-
$[31] = t17;
|
|
207
|
-
$[32] = t18;
|
|
208
|
-
$[33] = t19;
|
|
209
|
-
$[34] = t20;
|
|
210
|
-
$[35] = t21;
|
|
211
|
-
} else t21 = $[35];
|
|
212
|
-
let t22;
|
|
213
|
-
if ($[36] !== children || $[37] !== t21) {
|
|
214
|
-
t22 = /* @__PURE__ */ jsx("main", {
|
|
215
|
-
id: "main-content",
|
|
216
|
-
className: "qa-admin-layout__main min-w-0 flex-1 overflow-y-auto",
|
|
217
|
-
tabIndex: -1,
|
|
218
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
219
|
-
className: t21,
|
|
220
|
-
children
|
|
221
|
-
})
|
|
222
|
-
});
|
|
223
|
-
$[36] = children;
|
|
224
|
-
$[37] = t21;
|
|
225
|
-
$[38] = t22;
|
|
226
|
-
} else t22 = $[38];
|
|
227
|
-
let t23;
|
|
228
|
-
if ($[39] !== footer || $[40] !== shouldShowFooter) {
|
|
229
|
-
t23 = shouldShowFooter && footer && /* @__PURE__ */ jsx("footer", {
|
|
230
|
-
className: "qa-admin-layout__footer border-border-subtle border-t",
|
|
231
|
-
children: footer
|
|
232
|
-
});
|
|
233
|
-
$[39] = footer;
|
|
234
|
-
$[40] = shouldShowFooter;
|
|
235
|
-
$[41] = t23;
|
|
236
|
-
} else t23 = $[41];
|
|
237
|
-
let t24;
|
|
238
|
-
if ($[42] !== t16 || $[43] !== t22 || $[44] !== t23) {
|
|
239
|
-
t24 = /* @__PURE__ */ jsxs(SidebarInset, {
|
|
240
|
-
className: "qa-admin-layout__content bg-background flex h-svh flex-col overflow-hidden md:rounded-tl-2xl",
|
|
71
|
+
document.addEventListener("keydown", down);
|
|
72
|
+
return () => document.removeEventListener("keydown", down);
|
|
73
|
+
}, []);
|
|
74
|
+
return /* @__PURE__ */ jsx(AdminThemeAppliedContext.Provider, {
|
|
75
|
+
value: true,
|
|
76
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
77
|
+
className: cn("qa-admin-layout bg-sidebar text-foreground min-h-screen", className),
|
|
241
78
|
children: [
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
79
|
+
/* @__PURE__ */ jsx("a", {
|
|
80
|
+
href: "#main-content",
|
|
81
|
+
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",
|
|
82
|
+
children: t("ui.skipToMainContent", "Skip to main content")
|
|
83
|
+
}),
|
|
84
|
+
isSearchOpen && /* @__PURE__ */ jsx(GlobalSearch, {
|
|
85
|
+
isOpen: isSearchOpen,
|
|
86
|
+
onClose: closeSearch,
|
|
87
|
+
navigate,
|
|
88
|
+
basePath
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ jsxs(SidebarProvider, {
|
|
91
|
+
defaultOpen: !sidebarCollapsedProp,
|
|
92
|
+
className: "qa-admin-layout__sidebar-wrapper bg-sidebar mx-auto h-svh max-w-[1920px] overflow-hidden",
|
|
93
|
+
children: [/* @__PURE__ */ jsx(AdminSidebar, {
|
|
94
|
+
LinkComponent,
|
|
95
|
+
activeRoute,
|
|
96
|
+
basePath,
|
|
97
|
+
brandName,
|
|
98
|
+
theme,
|
|
99
|
+
setTheme,
|
|
100
|
+
showThemeToggle,
|
|
101
|
+
onSearchOpen: openSearch,
|
|
102
|
+
...sidebarProps
|
|
103
|
+
}), /* @__PURE__ */ jsxs(SidebarInset, {
|
|
104
|
+
className: "qa-admin-layout__content bg-background flex h-svh flex-col overflow-hidden md:rounded-tl-2xl",
|
|
105
|
+
children: [
|
|
106
|
+
shouldShowHeader && header && /* @__PURE__ */ jsx("header", {
|
|
107
|
+
className: "qa-admin-layout__header border-border-subtle border-b",
|
|
108
|
+
children: header
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx("main", {
|
|
111
|
+
id: "main-content",
|
|
112
|
+
className: "qa-admin-layout__main min-w-0 flex-1 overflow-y-auto",
|
|
113
|
+
tabIndex: -1,
|
|
114
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
115
|
+
className: cn("qa-admin-layout__main-content min-w-0", layoutMode === "default" && "mx-auto max-w-5xl px-3 pt-1 pb-6 md:px-4 md:pt-2 md:pb-8", layoutMode === "wide" && "px-3 pt-1 pb-6 md:px-4 md:pt-2 md:pb-8", layoutMode === "full" && "px-2 pt-1 pb-6 md:px-3 md:pb-8", layoutMode === "immersive" && "p-0"),
|
|
116
|
+
children
|
|
117
|
+
})
|
|
118
|
+
}),
|
|
119
|
+
shouldShowFooter && footer && /* @__PURE__ */ jsx("footer", {
|
|
120
|
+
className: "qa-admin-layout__footer border-border-subtle border-t",
|
|
121
|
+
children: footer
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
})]
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ jsx(Toaster, {
|
|
127
|
+
theme,
|
|
128
|
+
...toasterProps
|
|
129
|
+
})
|
|
245
130
|
]
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
$[43] = t22;
|
|
249
|
-
$[44] = t23;
|
|
250
|
-
$[45] = t24;
|
|
251
|
-
} else t24 = $[45];
|
|
252
|
-
let t25;
|
|
253
|
-
if ($[46] !== t14 || $[47] !== t15 || $[48] !== t24) {
|
|
254
|
-
t25 = /* @__PURE__ */ jsxs(SidebarProvider, {
|
|
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]
|
|
258
|
-
});
|
|
259
|
-
$[46] = t14;
|
|
260
|
-
$[47] = t15;
|
|
261
|
-
$[48] = t24;
|
|
262
|
-
$[49] = t25;
|
|
263
|
-
} else t25 = $[49];
|
|
264
|
-
let t26;
|
|
265
|
-
if ($[50] !== theme || $[51] !== toasterProps) {
|
|
266
|
-
t26 = /* @__PURE__ */ jsx(Toaster, {
|
|
267
|
-
theme,
|
|
268
|
-
...toasterProps
|
|
269
|
-
});
|
|
270
|
-
$[50] = theme;
|
|
271
|
-
$[51] = toasterProps;
|
|
272
|
-
$[52] = t26;
|
|
273
|
-
} else t26 = $[52];
|
|
274
|
-
let t27;
|
|
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];
|
|
295
|
-
return t27;
|
|
131
|
+
})
|
|
132
|
+
});
|
|
296
133
|
}
|
|
297
134
|
|
|
298
135
|
//#endregion
|