@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
|
@@ -13,7 +13,6 @@ import { getGlobalMetaQueryOptions } from "../../hooks/use-global-meta.mjs";
|
|
|
13
13
|
import { AdminViewHeader } from "./admin-view-layout.mjs";
|
|
14
14
|
import { FormViewSkeleton, TableViewSkeleton } from "../collection/view-skeletons.mjs";
|
|
15
15
|
import { DashboardGrid } from "../dashboard/dashboard-grid.mjs";
|
|
16
|
-
import { c } from "react/compiler-runtime";
|
|
17
16
|
import { Icon } from "@iconify/react";
|
|
18
17
|
import * as React from "react";
|
|
19
18
|
import { useQueryClient } from "@tanstack/react-query";
|
|
@@ -49,92 +48,36 @@ const componentLoaderCache = /* @__PURE__ */ new WeakMap();
|
|
|
49
48
|
* Suspends until server config is loaded - no loading checks needed.
|
|
50
49
|
*/
|
|
51
50
|
function useRouterConfig(props) {
|
|
52
|
-
const
|
|
53
|
-
const admin = useAdminStore(_temp);
|
|
51
|
+
const admin = useAdminStore((s) => s.admin);
|
|
54
52
|
const { data: serverConfig } = useSuspenseAdminConfig();
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
t0 = admin.getPages();
|
|
58
|
-
$[0] = admin;
|
|
59
|
-
$[1] = t0;
|
|
60
|
-
} else t0 = $[1];
|
|
61
|
-
const storePages = t0;
|
|
62
|
-
let t1;
|
|
63
|
-
if ($[2] !== admin) {
|
|
64
|
-
t1 = admin.getViews();
|
|
65
|
-
$[2] = admin;
|
|
66
|
-
$[3] = t1;
|
|
67
|
-
} else t1 = $[3];
|
|
68
|
-
const storeViews = t1;
|
|
53
|
+
const storePages = admin.getPages();
|
|
54
|
+
const storeViews = admin.getViews();
|
|
69
55
|
let serverCollections;
|
|
70
56
|
if (props.collections) serverCollections = props.collections;
|
|
71
|
-
else
|
|
57
|
+
else {
|
|
72
58
|
serverCollections = {};
|
|
73
|
-
if (serverConfig?.collections) {
|
|
74
|
-
|
|
75
|
-
if ($[6] !== serverConfig.collections) {
|
|
76
|
-
t2$1 = Object.entries(serverConfig.collections);
|
|
77
|
-
$[6] = serverConfig.collections;
|
|
78
|
-
$[7] = t2$1;
|
|
79
|
-
} else t2$1 = $[7];
|
|
80
|
-
for (const [name, meta] of t2$1) serverCollections[name] = meta ?? {};
|
|
81
|
-
}
|
|
82
|
-
$[4] = serverConfig;
|
|
83
|
-
$[5] = serverCollections;
|
|
84
|
-
} else serverCollections = $[5];
|
|
59
|
+
if (serverConfig?.collections) for (const [name, meta] of Object.entries(serverConfig.collections)) serverCollections[name] = meta ?? {};
|
|
60
|
+
}
|
|
85
61
|
let serverGlobals;
|
|
86
62
|
if (props.globals) serverGlobals = props.globals;
|
|
87
|
-
else
|
|
63
|
+
else {
|
|
88
64
|
serverGlobals = {};
|
|
89
|
-
if (serverConfig?.globals) {
|
|
90
|
-
let t2$1;
|
|
91
|
-
if ($[10] !== serverConfig.globals) {
|
|
92
|
-
t2$1 = Object.entries(serverConfig.globals);
|
|
93
|
-
$[10] = serverConfig.globals;
|
|
94
|
-
$[11] = t2$1;
|
|
95
|
-
} else t2$1 = $[11];
|
|
96
|
-
for (const [name_0, meta_0] of t2$1) serverGlobals[name_0] = meta_0 ?? {};
|
|
97
|
-
}
|
|
98
|
-
$[8] = serverConfig;
|
|
99
|
-
$[9] = serverGlobals;
|
|
100
|
-
} else serverGlobals = $[9];
|
|
101
|
-
serverConfig?.dashboard;
|
|
102
|
-
let t2;
|
|
103
|
-
bb0: {
|
|
104
|
-
const serverDashboard = serverConfig?.dashboard;
|
|
105
|
-
if (serverDashboard?.items?.length) {
|
|
106
|
-
t2 = serverDashboard;
|
|
107
|
-
break bb0;
|
|
108
|
-
}
|
|
109
|
-
t2 = props.dashboardConfig;
|
|
65
|
+
if (serverConfig?.globals) for (const [name, meta] of Object.entries(serverConfig.globals)) serverGlobals[name] = meta ?? {};
|
|
110
66
|
}
|
|
111
|
-
const mergedDashboard =
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
$[12] = mergedDashboard;
|
|
126
|
-
$[13] = props.DashboardComponent;
|
|
127
|
-
$[14] = serverCollections;
|
|
128
|
-
$[15] = serverGlobals;
|
|
129
|
-
$[16] = storeViews;
|
|
130
|
-
$[17] = t3;
|
|
131
|
-
$[18] = t4;
|
|
132
|
-
$[19] = t5;
|
|
133
|
-
} else t5 = $[19];
|
|
134
|
-
return t5;
|
|
135
|
-
}
|
|
136
|
-
function _temp(s) {
|
|
137
|
-
return s.admin;
|
|
67
|
+
const mergedDashboard = React.useMemo(() => {
|
|
68
|
+
const serverDashboard = serverConfig?.dashboard;
|
|
69
|
+
if (serverDashboard?.items?.length) return serverDashboard;
|
|
70
|
+
return props.dashboardConfig;
|
|
71
|
+
}, [props.dashboardConfig, serverConfig?.dashboard]);
|
|
72
|
+
return {
|
|
73
|
+
collections: serverCollections,
|
|
74
|
+
globals: serverGlobals,
|
|
75
|
+
pages: props.pages ?? storePages,
|
|
76
|
+
views: storeViews,
|
|
77
|
+
brandingName: serverConfig?.branding?.name,
|
|
78
|
+
dashboardConfig: mergedDashboard,
|
|
79
|
+
DashboardComponent: props.DashboardComponent
|
|
80
|
+
};
|
|
138
81
|
}
|
|
139
82
|
function matchRoute(segments, _collections = {}, globals = {}, pages = {}) {
|
|
140
83
|
if (segments.length === 0) return { type: "dashboard" };
|
|
@@ -234,170 +177,94 @@ function cacheComponent(loader, Component) {
|
|
|
234
177
|
if (!isDynamicImportLoader(loader)) return;
|
|
235
178
|
componentLoaderCache.set(loader, Component);
|
|
236
179
|
}
|
|
237
|
-
function ViewLoadingState(
|
|
238
|
-
|
|
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;
|
|
180
|
+
function ViewLoadingState({ viewKind }) {
|
|
181
|
+
return viewKind === "list" ? /* @__PURE__ */ jsx(TableViewSkeleton, {}) : /* @__PURE__ */ jsx(FormViewSkeleton, {});
|
|
247
182
|
}
|
|
248
|
-
function UnknownViewState(
|
|
249
|
-
const $ = c(13);
|
|
250
|
-
const { viewKind, viewId } = t0;
|
|
183
|
+
function UnknownViewState({ viewKind, viewId }) {
|
|
251
184
|
const { t } = useTranslation();
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
$[3] = t1;
|
|
266
|
-
$[4] = t2;
|
|
267
|
-
} else t2 = $[4];
|
|
268
|
-
let t3;
|
|
269
|
-
if ($[5] !== t || $[6] !== viewId) {
|
|
270
|
-
t3 = t("error.unregisteredViewDescription", { viewId });
|
|
271
|
-
$[5] = t;
|
|
272
|
-
$[6] = viewId;
|
|
273
|
-
$[7] = t3;
|
|
274
|
-
} else t3 = $[7];
|
|
275
|
-
let t4;
|
|
276
|
-
if ($[8] !== t3) {
|
|
277
|
-
t4 = /* @__PURE__ */ jsx("p", {
|
|
278
|
-
className: "text-muted-foreground mt-2 text-sm",
|
|
279
|
-
children: t3
|
|
280
|
-
});
|
|
281
|
-
$[8] = t3;
|
|
282
|
-
$[9] = t4;
|
|
283
|
-
} else t4 = $[9];
|
|
284
|
-
let t5;
|
|
285
|
-
if ($[10] !== t2 || $[11] !== t4) {
|
|
286
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
287
|
-
className: "container",
|
|
288
|
-
children: /* @__PURE__ */ jsxs(Card, {
|
|
289
|
-
className: "border-warning/30 bg-warning/5 p-6",
|
|
290
|
-
children: [t2, t4]
|
|
291
|
-
})
|
|
292
|
-
});
|
|
293
|
-
$[10] = t2;
|
|
294
|
-
$[11] = t4;
|
|
295
|
-
$[12] = t5;
|
|
296
|
-
} else t5 = $[12];
|
|
297
|
-
return t5;
|
|
185
|
+
return /* @__PURE__ */ jsx("div", {
|
|
186
|
+
className: "container",
|
|
187
|
+
children: /* @__PURE__ */ jsxs(Card, {
|
|
188
|
+
className: "border-warning/30 bg-warning/5 p-6",
|
|
189
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
190
|
+
className: "text-lg font-semibold",
|
|
191
|
+
children: t("error.failedToLoadView", { viewType: viewKind })
|
|
192
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
193
|
+
className: "text-muted-foreground mt-2 text-sm",
|
|
194
|
+
children: t("error.unregisteredViewDescription", { viewId })
|
|
195
|
+
})]
|
|
196
|
+
})
|
|
197
|
+
});
|
|
298
198
|
}
|
|
299
199
|
/**
|
|
300
200
|
* Skeleton shown while router config is loading (Suspense fallback)
|
|
301
201
|
*/
|
|
302
202
|
function RouterSkeleton() {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
className: "qa-router-skeleton container space-y-4 py-6",
|
|
319
|
-
children: [
|
|
320
|
-
t0,
|
|
321
|
-
t1,
|
|
322
|
-
/* @__PURE__ */ jsxs("div", {
|
|
323
|
-
className: "space-y-2",
|
|
324
|
-
children: [
|
|
325
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
|
|
326
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
|
|
327
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" })
|
|
328
|
-
]
|
|
329
|
-
})
|
|
330
|
-
]
|
|
331
|
-
});
|
|
332
|
-
$[2] = t2;
|
|
333
|
-
} else t2 = $[2];
|
|
334
|
-
return t2;
|
|
203
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
204
|
+
className: "qa-router-skeleton container space-y-4 py-6",
|
|
205
|
+
children: [
|
|
206
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48" }),
|
|
207
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }),
|
|
208
|
+
/* @__PURE__ */ jsxs("div", {
|
|
209
|
+
className: "space-y-2",
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
|
|
212
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
|
|
213
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" })
|
|
214
|
+
]
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
});
|
|
335
218
|
}
|
|
336
219
|
function AuthPageSkeleton() {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
220
|
+
return /* @__PURE__ */ jsx("div", {
|
|
221
|
+
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",
|
|
222
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
223
|
+
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",
|
|
224
|
+
children: [/* @__PURE__ */ jsxs("aside", {
|
|
225
|
+
className: "qa-auth-layout__brand flex flex-col items-center justify-center gap-8",
|
|
226
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
227
|
+
className: "flex items-center gap-3",
|
|
228
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-9" }), /* @__PURE__ */ jsx(Skeleton, {
|
|
229
|
+
variant: "text",
|
|
230
|
+
className: "h-4 w-36"
|
|
231
|
+
})]
|
|
232
|
+
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
345
233
|
variant: "text",
|
|
346
|
-
className: "h-
|
|
234
|
+
className: "hidden h-3 w-40 lg:block"
|
|
347
235
|
})]
|
|
348
|
-
}), /* @__PURE__ */ jsx(
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
className: "space-y-2",
|
|
359
|
-
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
360
|
-
variant: "text",
|
|
361
|
-
className: "h-4 w-20"
|
|
362
|
-
}), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
|
|
363
|
-
});
|
|
364
|
-
$[1] = t1;
|
|
365
|
-
} else t1 = $[1];
|
|
366
|
-
let t2;
|
|
367
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
368
|
-
t2 = /* @__PURE__ */ jsx("div", {
|
|
369
|
-
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",
|
|
370
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
371
|
-
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",
|
|
372
|
-
children: [t0, /* @__PURE__ */ jsx("main", {
|
|
373
|
-
className: "qa-auth-layout__form-panel flex items-center justify-center",
|
|
374
|
-
children: /* @__PURE__ */ jsx(Card, {
|
|
375
|
-
className: "border-border-subtle w-full max-w-sm shadow-none",
|
|
376
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
377
|
-
className: "space-y-5 p-4",
|
|
378
|
-
children: [
|
|
379
|
-
t1,
|
|
380
|
-
/* @__PURE__ */ jsxs("div", {
|
|
381
|
-
className: "space-y-2",
|
|
382
|
-
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
383
|
-
variant: "text",
|
|
384
|
-
className: "h-4 w-24"
|
|
385
|
-
}), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
|
|
386
|
-
}),
|
|
387
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
236
|
+
}), /* @__PURE__ */ jsx("main", {
|
|
237
|
+
className: "qa-auth-layout__form-panel flex items-center justify-center",
|
|
238
|
+
children: /* @__PURE__ */ jsx(Card, {
|
|
239
|
+
className: "border-border-subtle w-full max-w-sm shadow-none",
|
|
240
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
241
|
+
className: "space-y-5 p-4",
|
|
242
|
+
children: [
|
|
243
|
+
/* @__PURE__ */ jsxs("div", {
|
|
244
|
+
className: "space-y-2",
|
|
245
|
+
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
388
246
|
variant: "text",
|
|
389
|
-
className: "h-4 w-
|
|
390
|
-
}),
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
247
|
+
className: "h-4 w-20"
|
|
248
|
+
}), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ jsxs("div", {
|
|
251
|
+
className: "space-y-2",
|
|
252
|
+
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
253
|
+
variant: "text",
|
|
254
|
+
className: "h-4 w-24"
|
|
255
|
+
}), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ jsx(Skeleton, {
|
|
258
|
+
variant: "text",
|
|
259
|
+
className: "h-4 w-28"
|
|
260
|
+
}),
|
|
261
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
|
|
262
|
+
]
|
|
394
263
|
})
|
|
395
|
-
})
|
|
396
|
-
})
|
|
397
|
-
})
|
|
398
|
-
|
|
399
|
-
} else t2 = $[2];
|
|
400
|
-
return t2;
|
|
264
|
+
})
|
|
265
|
+
})]
|
|
266
|
+
})
|
|
267
|
+
});
|
|
401
268
|
}
|
|
402
269
|
function getFallbackForSegments(segments) {
|
|
403
270
|
const [first, second, third] = segments;
|
|
@@ -420,543 +287,223 @@ function areRegistryViewRendererPropsEqual(prev, next) {
|
|
|
420
287
|
if (prev.viewId !== next.viewId) return false;
|
|
421
288
|
return shallowEqualComponentProps(prev.componentProps, next.componentProps);
|
|
422
289
|
}
|
|
423
|
-
const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1(
|
|
424
|
-
const
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
Component:
|
|
447
|
-
loading: false,
|
|
448
|
-
error: null
|
|
449
|
-
});
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
452
|
-
if (!isDynamicImportLoader(loader)) {
|
|
453
|
-
setState({
|
|
454
|
-
Component: loader,
|
|
455
|
-
loading: false,
|
|
290
|
+
const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1({ loader, componentProps, viewKind, viewId }) {
|
|
291
|
+
const loaderIsDynamic = isDynamicImportLoader(loader);
|
|
292
|
+
const directComponent = loader && !loaderIsDynamic ? loader : null;
|
|
293
|
+
const cachedComponent = React.useMemo(() => loaderIsDynamic ? getCachedComponent(loader) ?? null : null, [loader, loaderIsDynamic]);
|
|
294
|
+
const needsAsyncLoad = loaderIsDynamic && !cachedComponent;
|
|
295
|
+
const [asyncState, setAsyncState] = React.useState({
|
|
296
|
+
loader: null,
|
|
297
|
+
Component: null,
|
|
298
|
+
error: null
|
|
299
|
+
});
|
|
300
|
+
React.useEffect(() => {
|
|
301
|
+
if (!needsAsyncLoad || !isDynamicImportLoader(loader)) return;
|
|
302
|
+
let mounted = true;
|
|
303
|
+
(async () => {
|
|
304
|
+
try {
|
|
305
|
+
const result = await loader();
|
|
306
|
+
if (!mounted) return;
|
|
307
|
+
let Component$1;
|
|
308
|
+
if (result.default) Component$1 = result.default;
|
|
309
|
+
else Component$1 = result;
|
|
310
|
+
cacheComponent(loader, Component$1);
|
|
311
|
+
setAsyncState({
|
|
312
|
+
loader,
|
|
313
|
+
Component: Component$1,
|
|
456
314
|
error: null
|
|
457
315
|
});
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
316
|
+
} catch (error$1) {
|
|
317
|
+
if (!mounted) return;
|
|
318
|
+
let resolvedError;
|
|
319
|
+
if (error$1 instanceof Error) resolvedError = error$1;
|
|
320
|
+
else resolvedError = /* @__PURE__ */ new Error("Failed to load view component");
|
|
321
|
+
setAsyncState({
|
|
322
|
+
loader,
|
|
323
|
+
Component: null,
|
|
324
|
+
error: resolvedError
|
|
466
325
|
});
|
|
467
|
-
return;
|
|
468
326
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
try {
|
|
473
|
-
const result = await loader();
|
|
474
|
-
if (!mounted) return;
|
|
475
|
-
let Component;
|
|
476
|
-
if (result.default) Component = result.default;
|
|
477
|
-
else Component = result;
|
|
478
|
-
cacheComponent(loader, Component);
|
|
479
|
-
setState({
|
|
480
|
-
Component,
|
|
481
|
-
loading: false,
|
|
482
|
-
error: null
|
|
483
|
-
});
|
|
484
|
-
} catch (t4$1) {
|
|
485
|
-
const error = t4$1;
|
|
486
|
-
if (!mounted) return;
|
|
487
|
-
let resolvedError;
|
|
488
|
-
if (error instanceof Error) resolvedError = error;
|
|
489
|
-
else resolvedError = /* @__PURE__ */ new Error("Failed to load view component");
|
|
490
|
-
setState({
|
|
491
|
-
Component: null,
|
|
492
|
-
loading: false,
|
|
493
|
-
error: resolvedError
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
})();
|
|
497
|
-
return () => {
|
|
498
|
-
mounted = false;
|
|
499
|
-
};
|
|
327
|
+
})();
|
|
328
|
+
return () => {
|
|
329
|
+
mounted = false;
|
|
500
330
|
};
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
$[5] = viewKind;
|
|
515
|
-
$[6] = t4$1;
|
|
516
|
-
} else t4$1 = $[6];
|
|
517
|
-
return t4$1;
|
|
518
|
-
}
|
|
519
|
-
if (state.error || !state.Component) {
|
|
520
|
-
let t4$1;
|
|
521
|
-
if ($[7] !== viewId || $[8] !== viewKind) {
|
|
522
|
-
t4$1 = /* @__PURE__ */ jsx(UnknownViewState, {
|
|
523
|
-
viewKind,
|
|
524
|
-
viewId
|
|
525
|
-
});
|
|
526
|
-
$[7] = viewId;
|
|
527
|
-
$[8] = viewKind;
|
|
528
|
-
$[9] = t4$1;
|
|
529
|
-
} else t4$1 = $[9];
|
|
530
|
-
return t4$1;
|
|
531
|
-
}
|
|
532
|
-
const Component_0 = state.Component;
|
|
533
|
-
let t4;
|
|
534
|
-
if ($[10] !== viewKind) {
|
|
535
|
-
t4 = /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
|
|
536
|
-
$[10] = viewKind;
|
|
537
|
-
$[11] = t4;
|
|
538
|
-
} else t4 = $[11];
|
|
539
|
-
let t5;
|
|
540
|
-
if ($[12] !== Component_0 || $[13] !== componentProps) {
|
|
541
|
-
t5 = /* @__PURE__ */ jsx(Component_0, { ...componentProps });
|
|
542
|
-
$[12] = Component_0;
|
|
543
|
-
$[13] = componentProps;
|
|
544
|
-
$[14] = t5;
|
|
545
|
-
} else t5 = $[14];
|
|
546
|
-
let t6;
|
|
547
|
-
if ($[15] !== t4 || $[16] !== t5) {
|
|
548
|
-
t6 = /* @__PURE__ */ jsx(React.Suspense, {
|
|
549
|
-
fallback: t4,
|
|
550
|
-
children: t5
|
|
551
|
-
});
|
|
552
|
-
$[15] = t4;
|
|
553
|
-
$[16] = t5;
|
|
554
|
-
$[17] = t6;
|
|
555
|
-
} else t6 = $[17];
|
|
556
|
-
return t6;
|
|
331
|
+
}, [loader, needsAsyncLoad]);
|
|
332
|
+
const asyncMatches = asyncState.loader === loader;
|
|
333
|
+
const Component = directComponent ?? cachedComponent ?? (asyncMatches ? asyncState.Component : null);
|
|
334
|
+
const error = asyncMatches ? asyncState.error : null;
|
|
335
|
+
if (needsAsyncLoad && !Component && !error) return /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
|
|
336
|
+
if (error || !Component) return /* @__PURE__ */ jsx(UnknownViewState, {
|
|
337
|
+
viewKind,
|
|
338
|
+
viewId
|
|
339
|
+
});
|
|
340
|
+
return /* @__PURE__ */ jsx(React.Suspense, {
|
|
341
|
+
fallback: /* @__PURE__ */ jsx(ViewLoadingState, { viewKind }),
|
|
342
|
+
children: /* @__PURE__ */ jsx(Component, { ...componentProps })
|
|
343
|
+
});
|
|
557
344
|
}, areRegistryViewRendererPropsEqual);
|
|
558
345
|
function DefaultDashboard() {
|
|
559
|
-
const $ = c(27);
|
|
560
346
|
const { t, formatDate } = useTranslation();
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
$[1] = t0;
|
|
571
|
-
} else t0 = $[1];
|
|
572
|
-
const date = t0;
|
|
573
|
-
let t1;
|
|
574
|
-
if ($[2] !== t) {
|
|
575
|
-
t1 = t("dashboard.title");
|
|
576
|
-
$[2] = t;
|
|
577
|
-
$[3] = t1;
|
|
578
|
-
} else t1 = $[3];
|
|
579
|
-
let t2;
|
|
580
|
-
if ($[4] !== date || $[5] !== t1) {
|
|
581
|
-
t2 = /* @__PURE__ */ jsx(AdminViewHeader, {
|
|
347
|
+
const date = formatDate(/* @__PURE__ */ new Date(), {
|
|
348
|
+
weekday: "long",
|
|
349
|
+
year: "numeric",
|
|
350
|
+
month: "long",
|
|
351
|
+
day: "numeric"
|
|
352
|
+
});
|
|
353
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
354
|
+
className: "qa-default-dashboard container",
|
|
355
|
+
children: [/* @__PURE__ */ jsx(AdminViewHeader, {
|
|
582
356
|
className: "mb-4",
|
|
583
|
-
title:
|
|
357
|
+
title: t("dashboard.title"),
|
|
584
358
|
meta: date
|
|
585
|
-
})
|
|
586
|
-
$[4] = date;
|
|
587
|
-
$[5] = t1;
|
|
588
|
-
$[6] = t2;
|
|
589
|
-
} else t2 = $[6];
|
|
590
|
-
let t3;
|
|
591
|
-
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
592
|
-
t3 = /* @__PURE__ */ jsx("div", { className: "bg-primary h-2 w-2 rounded-full" });
|
|
593
|
-
$[7] = t3;
|
|
594
|
-
} else t3 = $[7];
|
|
595
|
-
let t4;
|
|
596
|
-
if ($[8] !== t) {
|
|
597
|
-
t4 = t("dashboard.systemStatus");
|
|
598
|
-
$[8] = t;
|
|
599
|
-
$[9] = t4;
|
|
600
|
-
} else t4 = $[9];
|
|
601
|
-
let t5;
|
|
602
|
-
if ($[10] !== t4) {
|
|
603
|
-
t5 = /* @__PURE__ */ jsxs("div", {
|
|
604
|
-
className: "mb-4 flex items-center gap-3",
|
|
605
|
-
children: [t3, /* @__PURE__ */ jsx("h3", {
|
|
606
|
-
className: "text-muted-foreground font-chrome chrome-meta text-xs font-medium",
|
|
607
|
-
children: t4
|
|
608
|
-
})]
|
|
609
|
-
});
|
|
610
|
-
$[10] = t4;
|
|
611
|
-
$[11] = t5;
|
|
612
|
-
} else t5 = $[11];
|
|
613
|
-
let t6;
|
|
614
|
-
if ($[12] !== t) {
|
|
615
|
-
t6 = t("dashboard.welcome");
|
|
616
|
-
$[12] = t;
|
|
617
|
-
$[13] = t6;
|
|
618
|
-
} else t6 = $[13];
|
|
619
|
-
let t7;
|
|
620
|
-
if ($[14] !== t6) {
|
|
621
|
-
t7 = /* @__PURE__ */ jsx("h2", {
|
|
622
|
-
className: "mb-2 text-xl font-semibold",
|
|
623
|
-
children: t6
|
|
624
|
-
});
|
|
625
|
-
$[14] = t6;
|
|
626
|
-
$[15] = t7;
|
|
627
|
-
} else t7 = $[15];
|
|
628
|
-
let t8;
|
|
629
|
-
if ($[16] !== t) {
|
|
630
|
-
t8 = t("dashboard.welcomeDescription");
|
|
631
|
-
$[16] = t;
|
|
632
|
-
$[17] = t8;
|
|
633
|
-
} else t8 = $[17];
|
|
634
|
-
let t9;
|
|
635
|
-
if ($[18] !== t8) {
|
|
636
|
-
t9 = /* @__PURE__ */ jsx("p", {
|
|
637
|
-
className: "text-muted-foreground text-sm leading-relaxed",
|
|
638
|
-
children: t8
|
|
639
|
-
});
|
|
640
|
-
$[18] = t8;
|
|
641
|
-
$[19] = t9;
|
|
642
|
-
} else t9 = $[19];
|
|
643
|
-
let t10;
|
|
644
|
-
if ($[20] !== t5 || $[21] !== t7 || $[22] !== t9) {
|
|
645
|
-
t10 = /* @__PURE__ */ jsx("div", {
|
|
359
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
646
360
|
className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",
|
|
647
361
|
children: /* @__PURE__ */ jsx(Card, {
|
|
648
362
|
className: "p-6",
|
|
649
363
|
children: /* @__PURE__ */ jsxs("div", { children: [
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
364
|
+
/* @__PURE__ */ jsxs("div", {
|
|
365
|
+
className: "mb-4 flex items-center gap-3",
|
|
366
|
+
children: [/* @__PURE__ */ jsx("div", { className: "bg-primary h-2 w-2 rounded-full" }), /* @__PURE__ */ jsx("h3", {
|
|
367
|
+
className: "text-muted-foreground font-chrome chrome-meta text-xs font-medium",
|
|
368
|
+
children: t("dashboard.systemStatus")
|
|
369
|
+
})]
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ jsx("h2", {
|
|
372
|
+
className: "mb-2 text-xl font-semibold",
|
|
373
|
+
children: t("dashboard.welcome")
|
|
374
|
+
}),
|
|
375
|
+
/* @__PURE__ */ jsx("p", {
|
|
376
|
+
className: "text-muted-foreground text-sm leading-relaxed",
|
|
377
|
+
children: t("dashboard.welcomeDescription")
|
|
378
|
+
})
|
|
653
379
|
] })
|
|
654
380
|
})
|
|
655
|
-
})
|
|
656
|
-
|
|
657
|
-
$[21] = t7;
|
|
658
|
-
$[22] = t9;
|
|
659
|
-
$[23] = t10;
|
|
660
|
-
} else t10 = $[23];
|
|
661
|
-
let t11;
|
|
662
|
-
if ($[24] !== t10 || $[25] !== t2) {
|
|
663
|
-
t11 = /* @__PURE__ */ jsxs("div", {
|
|
664
|
-
className: "qa-default-dashboard container",
|
|
665
|
-
children: [t2, t10]
|
|
666
|
-
});
|
|
667
|
-
$[24] = t10;
|
|
668
|
-
$[25] = t2;
|
|
669
|
-
$[26] = t11;
|
|
670
|
-
} else t11 = $[26];
|
|
671
|
-
return t11;
|
|
381
|
+
})]
|
|
382
|
+
});
|
|
672
383
|
}
|
|
673
384
|
function DefaultNotFound() {
|
|
674
|
-
const $ = c(11);
|
|
675
385
|
const { t } = useTranslation();
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
$[0] = t;
|
|
680
|
-
$[1] = t0;
|
|
681
|
-
} else t0 = $[1];
|
|
682
|
-
let t1;
|
|
683
|
-
if ($[2] !== t0) {
|
|
684
|
-
t1 = /* @__PURE__ */ jsx("h1", {
|
|
386
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
387
|
+
className: "qa-not-found container",
|
|
388
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
685
389
|
className: "mb-4 text-2xl font-bold",
|
|
686
|
-
children:
|
|
687
|
-
})
|
|
688
|
-
$[2] = t0;
|
|
689
|
-
$[3] = t1;
|
|
690
|
-
} else t1 = $[3];
|
|
691
|
-
let t2;
|
|
692
|
-
if ($[4] !== t) {
|
|
693
|
-
t2 = t("error.pageNotFoundDescription");
|
|
694
|
-
$[4] = t;
|
|
695
|
-
$[5] = t2;
|
|
696
|
-
} else t2 = $[5];
|
|
697
|
-
let t3;
|
|
698
|
-
if ($[6] !== t2) {
|
|
699
|
-
t3 = /* @__PURE__ */ jsx("p", {
|
|
390
|
+
children: t("error.pageNotFound")
|
|
391
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
700
392
|
className: "text-muted-foreground",
|
|
701
|
-
children:
|
|
702
|
-
})
|
|
703
|
-
|
|
704
|
-
$[7] = t3;
|
|
705
|
-
} else t3 = $[7];
|
|
706
|
-
let t4;
|
|
707
|
-
if ($[8] !== t1 || $[9] !== t3) {
|
|
708
|
-
t4 = /* @__PURE__ */ jsxs("div", {
|
|
709
|
-
className: "qa-not-found container",
|
|
710
|
-
children: [t1, t3]
|
|
711
|
-
});
|
|
712
|
-
$[8] = t1;
|
|
713
|
-
$[9] = t3;
|
|
714
|
-
$[10] = t4;
|
|
715
|
-
} else t4 = $[10];
|
|
716
|
-
return t4;
|
|
393
|
+
children: t("error.pageNotFoundDescription")
|
|
394
|
+
})]
|
|
395
|
+
});
|
|
717
396
|
}
|
|
718
|
-
function RestrictedAccess(
|
|
719
|
-
const $ = c(24);
|
|
720
|
-
const { type, name, navigate, basePath } = t0;
|
|
397
|
+
function RestrictedAccess({ type, name, navigate, basePath }) {
|
|
721
398
|
const { t } = useTranslation();
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
className: "
|
|
726
|
-
children: /* @__PURE__ */
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
$[7] = type;
|
|
757
|
-
$[8] = t4;
|
|
758
|
-
} else t4 = $[8];
|
|
759
|
-
let t5;
|
|
760
|
-
if ($[9] !== t4) {
|
|
761
|
-
t5 = /* @__PURE__ */ jsx("p", {
|
|
762
|
-
className: "text-muted-foreground mb-6 text-sm",
|
|
763
|
-
children: t4
|
|
764
|
-
});
|
|
765
|
-
$[9] = t4;
|
|
766
|
-
$[10] = t5;
|
|
767
|
-
} else t5 = $[10];
|
|
768
|
-
let t6;
|
|
769
|
-
if ($[11] !== basePath || $[12] !== navigate) {
|
|
770
|
-
t6 = () => navigate(basePath);
|
|
771
|
-
$[11] = basePath;
|
|
772
|
-
$[12] = navigate;
|
|
773
|
-
$[13] = t6;
|
|
774
|
-
} else t6 = $[13];
|
|
775
|
-
let t7;
|
|
776
|
-
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
777
|
-
t7 = /* @__PURE__ */ jsx(Icon, {
|
|
778
|
-
icon: "ph:arrow-left",
|
|
779
|
-
className: "h-4 w-4"
|
|
780
|
-
});
|
|
781
|
-
$[14] = t7;
|
|
782
|
-
} else t7 = $[14];
|
|
783
|
-
let t8;
|
|
784
|
-
if ($[15] !== t) {
|
|
785
|
-
t8 = t("error.backToDashboard");
|
|
786
|
-
$[15] = t;
|
|
787
|
-
$[16] = t8;
|
|
788
|
-
} else t8 = $[16];
|
|
789
|
-
let t9;
|
|
790
|
-
if ($[17] !== t6 || $[18] !== t8) {
|
|
791
|
-
t9 = /* @__PURE__ */ jsxs(Button, {
|
|
792
|
-
variant: "outline",
|
|
793
|
-
onClick: t6,
|
|
794
|
-
children: [t7, t8]
|
|
795
|
-
});
|
|
796
|
-
$[17] = t6;
|
|
797
|
-
$[18] = t8;
|
|
798
|
-
$[19] = t9;
|
|
799
|
-
} else t9 = $[19];
|
|
800
|
-
let t10;
|
|
801
|
-
if ($[20] !== t3 || $[21] !== t5 || $[22] !== t9) {
|
|
802
|
-
t10 = /* @__PURE__ */ jsx("div", {
|
|
803
|
-
className: "qa-restricted-access container py-12",
|
|
804
|
-
children: /* @__PURE__ */ jsx(Card, {
|
|
805
|
-
className: "mx-auto max-w-lg p-8 text-center",
|
|
806
|
-
children: /* @__PURE__ */ jsxs("div", { children: [
|
|
807
|
-
t1,
|
|
808
|
-
t3,
|
|
809
|
-
t5,
|
|
810
|
-
t9
|
|
811
|
-
] })
|
|
812
|
-
})
|
|
813
|
-
});
|
|
814
|
-
$[20] = t3;
|
|
815
|
-
$[21] = t5;
|
|
816
|
-
$[22] = t9;
|
|
817
|
-
$[23] = t10;
|
|
818
|
-
} else t10 = $[23];
|
|
819
|
-
return t10;
|
|
399
|
+
return /* @__PURE__ */ jsx("div", {
|
|
400
|
+
className: "qa-restricted-access container py-12",
|
|
401
|
+
children: /* @__PURE__ */ jsx(Card, {
|
|
402
|
+
className: "mx-auto max-w-lg p-8 text-center",
|
|
403
|
+
children: /* @__PURE__ */ jsxs("div", { children: [
|
|
404
|
+
/* @__PURE__ */ jsx("div", {
|
|
405
|
+
className: "bg-muted mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-full",
|
|
406
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
407
|
+
icon: "ph:lock-simple",
|
|
408
|
+
className: "text-muted-foreground h-8 w-8"
|
|
409
|
+
})
|
|
410
|
+
}),
|
|
411
|
+
/* @__PURE__ */ jsx("h1", {
|
|
412
|
+
className: "mb-2 text-xl font-semibold",
|
|
413
|
+
children: t("error.accessRestricted")
|
|
414
|
+
}),
|
|
415
|
+
/* @__PURE__ */ jsx("p", {
|
|
416
|
+
className: "text-muted-foreground mb-6 text-sm",
|
|
417
|
+
children: t("error.accessRestrictedResourceDescription", {
|
|
418
|
+
type,
|
|
419
|
+
name
|
|
420
|
+
})
|
|
421
|
+
}),
|
|
422
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
423
|
+
variant: "outline",
|
|
424
|
+
onClick: () => navigate(basePath),
|
|
425
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
426
|
+
icon: "ph:arrow-left",
|
|
427
|
+
className: "h-4 w-4"
|
|
428
|
+
}), t("error.backToDashboard")]
|
|
429
|
+
})
|
|
430
|
+
] })
|
|
431
|
+
})
|
|
432
|
+
});
|
|
820
433
|
}
|
|
821
|
-
function LazyPageRenderer(
|
|
822
|
-
const $ = c(21);
|
|
823
|
-
const { config } = t0;
|
|
434
|
+
function LazyPageRenderer({ config }) {
|
|
824
435
|
const { t } = useTranslation();
|
|
825
436
|
const component = config.component;
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
t1 = () => getCachedComponent(component) ?? null;
|
|
829
|
-
$[0] = component;
|
|
830
|
-
$[1] = t1;
|
|
831
|
-
} else t1 = $[1];
|
|
832
|
-
const [Component, setComponent] = React.useState(t1);
|
|
833
|
-
let t2;
|
|
834
|
-
if ($[2] !== Component) {
|
|
835
|
-
t2 = () => Component == null;
|
|
836
|
-
$[2] = Component;
|
|
837
|
-
$[3] = t2;
|
|
838
|
-
} else t2 = $[3];
|
|
839
|
-
const [loading, setLoading] = React.useState(t2);
|
|
437
|
+
const [Component, setComponent] = React.useState(() => getCachedComponent(component) ?? null);
|
|
438
|
+
const [loading, setLoading] = React.useState(() => Component == null);
|
|
840
439
|
const [error, setError] = React.useState(null);
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
try {
|
|
848
|
-
const cachedComponent = getCachedComponent(component);
|
|
849
|
-
if (cachedComponent) {
|
|
850
|
-
if (mounted) {
|
|
851
|
-
setComponent(() => cachedComponent);
|
|
852
|
-
setLoading(false);
|
|
853
|
-
setError(null);
|
|
854
|
-
}
|
|
855
|
-
return;
|
|
856
|
-
}
|
|
440
|
+
React.useEffect(() => {
|
|
441
|
+
let mounted = true;
|
|
442
|
+
async function load() {
|
|
443
|
+
try {
|
|
444
|
+
const cachedComponent = getCachedComponent(component);
|
|
445
|
+
if (cachedComponent) {
|
|
857
446
|
if (mounted) {
|
|
858
|
-
|
|
447
|
+
setComponent(() => cachedComponent);
|
|
448
|
+
setLoading(false);
|
|
859
449
|
setError(null);
|
|
860
450
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
else resolved = mod;
|
|
873
|
-
cacheComponent(component, resolved);
|
|
874
|
-
setComponent(() => resolved);
|
|
875
|
-
}
|
|
876
|
-
} else if (mounted) setComponent(() => component);
|
|
877
|
-
} else if (component) {
|
|
878
|
-
if (mounted) setComponent(() => component);
|
|
879
|
-
}
|
|
880
|
-
if (mounted) setLoading(false);
|
|
881
|
-
} catch (t5$1) {
|
|
882
|
-
const err = t5$1;
|
|
883
|
-
if (mounted) {
|
|
884
|
-
let resolvedError;
|
|
885
|
-
if (err instanceof Error) resolvedError = err;
|
|
886
|
-
else resolvedError = new Error(t("error.failedToLoad"));
|
|
887
|
-
setError(resolvedError);
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
if (mounted) {
|
|
454
|
+
setLoading(true);
|
|
455
|
+
setError(null);
|
|
456
|
+
}
|
|
457
|
+
if (typeof component === "function") {
|
|
458
|
+
const result = component();
|
|
459
|
+
let isThenable = false;
|
|
460
|
+
if (result != null) {
|
|
461
|
+
if (typeof result.then === "function") isThenable = true;
|
|
888
462
|
}
|
|
889
|
-
if (
|
|
463
|
+
if (isThenable) {
|
|
464
|
+
const mod = await result;
|
|
465
|
+
if (mounted) {
|
|
466
|
+
let resolved;
|
|
467
|
+
if (mod.default) resolved = mod.default;
|
|
468
|
+
else resolved = mod;
|
|
469
|
+
cacheComponent(component, resolved);
|
|
470
|
+
setComponent(() => resolved);
|
|
471
|
+
}
|
|
472
|
+
} else if (mounted) setComponent(() => component);
|
|
473
|
+
} else if (component) {
|
|
474
|
+
if (mounted) setComponent(() => component);
|
|
890
475
|
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
mounted
|
|
894
|
-
|
|
476
|
+
if (mounted) setLoading(false);
|
|
477
|
+
} catch (err) {
|
|
478
|
+
if (mounted) {
|
|
479
|
+
let resolvedError;
|
|
480
|
+
if (err instanceof Error) resolvedError = err;
|
|
481
|
+
else resolvedError = new Error(t("error.failedToLoad"));
|
|
482
|
+
setError(resolvedError);
|
|
483
|
+
}
|
|
484
|
+
if (mounted) setLoading(false);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
load();
|
|
488
|
+
return () => {
|
|
489
|
+
mounted = false;
|
|
895
490
|
};
|
|
896
|
-
|
|
897
|
-
$[4] = component;
|
|
898
|
-
$[5] = t;
|
|
899
|
-
$[6] = t3;
|
|
900
|
-
$[7] = t4;
|
|
901
|
-
} else {
|
|
902
|
-
t3 = $[6];
|
|
903
|
-
t4 = $[7];
|
|
904
|
-
}
|
|
905
|
-
React.useEffect(t3, t4);
|
|
491
|
+
}, [component, t]);
|
|
906
492
|
if (loading) {
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
const path = config.path?.replace(/^\//, "") ?? "";
|
|
910
|
-
t5$1 = AUTH_ROUTE_SEGMENTS.has(path) ? /* @__PURE__ */ jsx(AuthPageSkeleton, {}) : /* @__PURE__ */ jsx(RouterSkeleton, {});
|
|
911
|
-
$[8] = config.path;
|
|
912
|
-
$[9] = t5$1;
|
|
913
|
-
} else t5$1 = $[9];
|
|
914
|
-
return t5$1;
|
|
493
|
+
const path = config.path?.replace(/^\//, "") ?? "";
|
|
494
|
+
return AUTH_ROUTE_SEGMENTS.has(path) ? /* @__PURE__ */ jsx(AuthPageSkeleton, {}) : /* @__PURE__ */ jsx(RouterSkeleton, {});
|
|
915
495
|
}
|
|
916
|
-
if (error) {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
children: t5$1
|
|
928
|
-
});
|
|
929
|
-
$[12] = t5$1;
|
|
930
|
-
$[13] = t6;
|
|
931
|
-
} else t6 = $[13];
|
|
932
|
-
let t7;
|
|
933
|
-
if ($[14] !== error.message) {
|
|
934
|
-
t7 = /* @__PURE__ */ jsx("p", {
|
|
935
|
-
className: "text-muted-foreground",
|
|
936
|
-
children: error.message
|
|
937
|
-
});
|
|
938
|
-
$[14] = error.message;
|
|
939
|
-
$[15] = t7;
|
|
940
|
-
} else t7 = $[15];
|
|
941
|
-
let t8;
|
|
942
|
-
if ($[16] !== t6 || $[17] !== t7) {
|
|
943
|
-
t8 = /* @__PURE__ */ jsxs("div", {
|
|
944
|
-
className: "container",
|
|
945
|
-
children: [t6, t7]
|
|
946
|
-
});
|
|
947
|
-
$[16] = t6;
|
|
948
|
-
$[17] = t7;
|
|
949
|
-
$[18] = t8;
|
|
950
|
-
} else t8 = $[18];
|
|
951
|
-
return t8;
|
|
952
|
-
}
|
|
953
|
-
let t5;
|
|
954
|
-
if ($[19] !== Component) {
|
|
955
|
-
t5 = Component ? /* @__PURE__ */ jsx(Component, {}) : /* @__PURE__ */ jsx(DefaultNotFound, {});
|
|
956
|
-
$[19] = Component;
|
|
957
|
-
$[20] = t5;
|
|
958
|
-
} else t5 = $[20];
|
|
959
|
-
return t5;
|
|
496
|
+
if (error) return /* @__PURE__ */ jsxs("div", {
|
|
497
|
+
className: "container",
|
|
498
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
499
|
+
className: "text-destructive mb-4 text-2xl font-bold",
|
|
500
|
+
children: t("error.unexpectedError")
|
|
501
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
502
|
+
className: "text-muted-foreground",
|
|
503
|
+
children: error.message
|
|
504
|
+
})]
|
|
505
|
+
});
|
|
506
|
+
return Component ? /* @__PURE__ */ jsx(Component, {}) : /* @__PURE__ */ jsx(DefaultNotFound, {});
|
|
960
507
|
}
|
|
961
508
|
/**
|
|
962
509
|
* AdminRouter Component
|
|
@@ -965,609 +512,230 @@ function LazyPageRenderer(t0) {
|
|
|
965
512
|
* Uses Suspense internally - shows skeleton while config loads.
|
|
966
513
|
*/
|
|
967
514
|
function AdminRouter(props) {
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
$[0] = props.segments;
|
|
973
|
-
$[1] = t0;
|
|
974
|
-
} else t0 = $[1];
|
|
975
|
-
let t1;
|
|
976
|
-
if ($[2] !== props) {
|
|
977
|
-
t1 = /* @__PURE__ */ jsx(AdminRouterInner, { ...props });
|
|
978
|
-
$[2] = props;
|
|
979
|
-
$[3] = t1;
|
|
980
|
-
} else t1 = $[3];
|
|
981
|
-
let t2;
|
|
982
|
-
if ($[4] !== t0 || $[5] !== t1) {
|
|
983
|
-
t2 = /* @__PURE__ */ jsx(React.Suspense, {
|
|
984
|
-
fallback: t0,
|
|
985
|
-
children: t1
|
|
986
|
-
});
|
|
987
|
-
$[4] = t0;
|
|
988
|
-
$[5] = t1;
|
|
989
|
-
$[6] = t2;
|
|
990
|
-
} else t2 = $[6];
|
|
991
|
-
return t2;
|
|
515
|
+
return /* @__PURE__ */ jsx(React.Suspense, {
|
|
516
|
+
fallback: getFallbackForSegments(props.segments),
|
|
517
|
+
children: /* @__PURE__ */ jsx(AdminRouterInner, { ...props })
|
|
518
|
+
});
|
|
992
519
|
}
|
|
993
520
|
/**
|
|
994
521
|
* Inner router component that uses Suspense for data loading.
|
|
995
522
|
* Guaranteed to have config loaded when rendering.
|
|
996
523
|
*/
|
|
997
|
-
function AdminRouterInner(
|
|
998
|
-
const $ = c(153);
|
|
999
|
-
const { segments, navigate, basePath: t1, searchParams: searchParamsProp, collections: collectionsProp, globals: globalsProp, pages: pagesProp, DashboardComponent: DashboardComponentProp, dashboardConfig: dashboardConfigProp, collectionComponents, globalComponents, registry, NotFoundComponent } = t0;
|
|
1000
|
-
const basePath = t1 === void 0 ? "/admin" : t1;
|
|
524
|
+
function AdminRouterInner({ segments, navigate, basePath = "/admin", searchParams: searchParamsProp, collections: collectionsProp, globals: globalsProp, pages: pagesProp, DashboardComponent: DashboardComponentProp, dashboardConfig: dashboardConfigProp, collectionComponents, globalComponents, renderFormFields: _renderFormFields, registry, NotFoundComponent }) {
|
|
1001
525
|
const resolvedCollectionComponents = collectionComponents ?? EMPTY_COLLECTION_COMPONENTS;
|
|
1002
526
|
const resolvedGlobalComponents = globalComponents ?? EMPTY_GLOBAL_COMPONENTS;
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
if (
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
} else t3$1 = $[1];
|
|
1023
|
-
t2 = t3$1;
|
|
1024
|
-
}
|
|
1025
|
-
const searchParams = t2;
|
|
1026
|
-
let t3;
|
|
1027
|
-
if ($[2] !== searchParams) {
|
|
1028
|
-
t3 = parsePrefillParams(searchParams);
|
|
1029
|
-
$[2] = searchParams;
|
|
1030
|
-
$[3] = t3;
|
|
1031
|
-
} else t3 = $[3];
|
|
1032
|
-
const prefillValues = t3;
|
|
1033
|
-
let t4;
|
|
1034
|
-
if ($[4] !== DashboardComponentProp || $[5] !== collectionsProp || $[6] !== dashboardConfigProp || $[7] !== globalsProp || $[8] !== pagesProp) {
|
|
1035
|
-
t4 = {
|
|
1036
|
-
collections: collectionsProp,
|
|
1037
|
-
globals: globalsProp,
|
|
1038
|
-
pages: pagesProp,
|
|
1039
|
-
dashboardConfig: dashboardConfigProp,
|
|
1040
|
-
DashboardComponent: DashboardComponentProp
|
|
1041
|
-
};
|
|
1042
|
-
$[4] = DashboardComponentProp;
|
|
1043
|
-
$[5] = collectionsProp;
|
|
1044
|
-
$[6] = dashboardConfigProp;
|
|
1045
|
-
$[7] = globalsProp;
|
|
1046
|
-
$[8] = pagesProp;
|
|
1047
|
-
$[9] = t4;
|
|
1048
|
-
} else t4 = $[9];
|
|
1049
|
-
const { collections, globals, pages, views, brandingName, dashboardConfig, DashboardComponent } = useRouterConfig(t4);
|
|
1050
|
-
let t5;
|
|
1051
|
-
if ($[10] !== collections || $[11] !== globals || $[12] !== pages || $[13] !== segments) {
|
|
1052
|
-
t5 = matchRoute(segments, collections, globals, pages);
|
|
1053
|
-
$[10] = collections;
|
|
1054
|
-
$[11] = globals;
|
|
1055
|
-
$[12] = pages;
|
|
1056
|
-
$[13] = segments;
|
|
1057
|
-
$[14] = t5;
|
|
1058
|
-
} else t5 = $[14];
|
|
1059
|
-
const route = t5;
|
|
527
|
+
const searchParams = React.useMemo(() => {
|
|
528
|
+
if (searchParamsProp) return searchParamsProp;
|
|
529
|
+
if (typeof window !== "undefined") return new URLSearchParams(window.location.search);
|
|
530
|
+
return new URLSearchParams();
|
|
531
|
+
}, [searchParamsProp]);
|
|
532
|
+
const prefillValues = React.useMemo(() => parsePrefillParams(searchParams), [searchParams]);
|
|
533
|
+
const { collections, globals, pages, views, brandingName, dashboardConfig, DashboardComponent } = useRouterConfig({
|
|
534
|
+
collections: collectionsProp,
|
|
535
|
+
globals: globalsProp,
|
|
536
|
+
pages: pagesProp,
|
|
537
|
+
dashboardConfig: dashboardConfigProp,
|
|
538
|
+
DashboardComponent: DashboardComponentProp
|
|
539
|
+
});
|
|
540
|
+
const route = React.useMemo(() => matchRoute(segments, collections, globals, pages), [
|
|
541
|
+
segments,
|
|
542
|
+
collections,
|
|
543
|
+
globals,
|
|
544
|
+
pages
|
|
545
|
+
]);
|
|
1060
546
|
const activeCollectionName = route.type === "collection-list" || route.type === "collection-create" || route.type === "collection-edit" ? route.name : "";
|
|
1061
547
|
const activeGlobalName = route.type === "global-edit" ? route.name : "";
|
|
1062
548
|
const queryClient = useQueryClient();
|
|
1063
549
|
const client = useAdminStore(selectClient);
|
|
1064
550
|
if (activeCollectionName && client) queryClient.prefetchQuery(getCollectionMetaQueryOptions(activeCollectionName, client));
|
|
1065
551
|
if (activeGlobalName && client) queryClient.prefetchQuery(getGlobalMetaQueryOptions(activeGlobalName, client));
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1068
|
-
if ($[15] !== t6) {
|
|
1069
|
-
t7 = { enabled: t6 };
|
|
1070
|
-
$[15] = t6;
|
|
1071
|
-
$[16] = t7;
|
|
1072
|
-
} else t7 = $[16];
|
|
1073
|
-
const { data: activeCollectionSchema } = useCollectionSchema(activeCollectionName, t7);
|
|
1074
|
-
const t8 = !!activeGlobalName;
|
|
1075
|
-
let t9;
|
|
1076
|
-
if ($[17] !== t8) {
|
|
1077
|
-
t9 = { enabled: t8 };
|
|
1078
|
-
$[17] = t8;
|
|
1079
|
-
$[18] = t9;
|
|
1080
|
-
} else t9 = $[18];
|
|
1081
|
-
const { data: activeGlobalSchema } = useGlobalSchema(activeGlobalName, t9);
|
|
552
|
+
const { data: activeCollectionSchema } = useCollectionSchema(activeCollectionName, { enabled: !!activeCollectionName });
|
|
553
|
+
const { data: activeGlobalSchema } = useGlobalSchema(activeGlobalName, { enabled: !!activeGlobalName });
|
|
1082
554
|
const { t } = useTranslation();
|
|
1083
555
|
const resolveText = useResolveText();
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
metaDescription = resolveResourceDescription(config_4, schemaConfig_4) || t("collection.list", { name: label_2 });
|
|
1103
|
-
break bb104;
|
|
1104
|
-
}
|
|
1105
|
-
case "collection-create": {
|
|
1106
|
-
const config_3 = collections[route.name];
|
|
1107
|
-
const schemaConfig_3 = activeCollectionSchema?.admin?.config;
|
|
1108
|
-
const label_1 = resolveResourceLabel(config_3, schemaConfig_3, route.name);
|
|
1109
|
-
pageTitle = `${label_1}: ${t("common.create")}`;
|
|
1110
|
-
metaDescription = resolveResourceDescription(config_3, schemaConfig_3) || t("collection.create", { name: label_1 });
|
|
1111
|
-
break bb104;
|
|
1112
|
-
}
|
|
1113
|
-
case "collection-edit": {
|
|
1114
|
-
const config_2 = collections[route.name];
|
|
1115
|
-
const schemaConfig_2 = activeCollectionSchema?.admin?.config;
|
|
1116
|
-
const label_0 = resolveResourceLabel(config_2, schemaConfig_2, route.name);
|
|
1117
|
-
pageTitle = `${label_0}: ${t("common.edit")}`;
|
|
1118
|
-
metaDescription = resolveResourceDescription(config_2, schemaConfig_2) || t("collection.edit", { name: label_0 });
|
|
1119
|
-
break bb104;
|
|
1120
|
-
}
|
|
1121
|
-
case "global-edit": {
|
|
1122
|
-
const config_1 = globals[route.name];
|
|
1123
|
-
const schemaConfig_1 = activeGlobalSchema?.admin?.config;
|
|
1124
|
-
const label = resolveResourceLabel(config_1, schemaConfig_1, route.name);
|
|
1125
|
-
pageTitle = label;
|
|
1126
|
-
metaDescription = resolveResourceDescription(config_1, schemaConfig_1) || label;
|
|
1127
|
-
break bb104;
|
|
1128
|
-
}
|
|
1129
|
-
case "page":
|
|
1130
|
-
pageTitle = resolveText(route.config.label, formatLabel(route.name));
|
|
1131
|
-
metaDescription = pageTitle;
|
|
1132
|
-
break bb104;
|
|
1133
|
-
case "not-found":
|
|
1134
|
-
pageTitle = t("error.notFound");
|
|
1135
|
-
metaDescription = pageTitle;
|
|
556
|
+
React.useEffect(() => {
|
|
557
|
+
const appTitle = resolveText(brandingName, "Admin");
|
|
558
|
+
let pageTitle = t("dashboard.title");
|
|
559
|
+
let metaDescription = pageTitle;
|
|
560
|
+
const resolveResourceLabel = (config, schemaConfig, fallback) => resolveText(config?.label ?? config?.meta?.label ?? schemaConfig?.label, formatLabel(fallback));
|
|
561
|
+
const resolveResourceDescription = (config, schemaConfig) => resolveText(config?.description ?? config?.meta?.description ?? schemaConfig?.description).trim();
|
|
562
|
+
switch (route.type) {
|
|
563
|
+
case "dashboard":
|
|
564
|
+
pageTitle = resolveText(dashboardConfig?.title, t("dashboard.title"));
|
|
565
|
+
metaDescription = resolveText(dashboardConfig?.description).trim() || pageTitle;
|
|
566
|
+
break;
|
|
567
|
+
case "collection-list": {
|
|
568
|
+
const config = collections[route.name];
|
|
569
|
+
const schemaConfig = activeCollectionSchema?.admin?.config;
|
|
570
|
+
const label = resolveResourceLabel(config, schemaConfig, route.name);
|
|
571
|
+
pageTitle = label;
|
|
572
|
+
metaDescription = resolveResourceDescription(config, schemaConfig) || t("collection.list", { name: label });
|
|
573
|
+
break;
|
|
1136
574
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
$[34] = brandingName;
|
|
1170
|
-
$[35] = collections;
|
|
1171
|
-
$[36] = dashboardConfig;
|
|
1172
|
-
$[37] = globals;
|
|
1173
|
-
$[38] = resolveText;
|
|
1174
|
-
$[39] = route;
|
|
1175
|
-
$[40] = t;
|
|
1176
|
-
$[41] = t11;
|
|
1177
|
-
} else t11 = $[41];
|
|
1178
|
-
React.useEffect(t10, t11);
|
|
1179
|
-
let t12;
|
|
1180
|
-
if ($[42] !== segments) {
|
|
1181
|
-
t12 = segments.join("/");
|
|
1182
|
-
$[42] = segments;
|
|
1183
|
-
$[43] = t12;
|
|
1184
|
-
} else t12 = $[43];
|
|
1185
|
-
const routeKey = t12;
|
|
1186
|
-
let t13;
|
|
1187
|
-
if ($[44] !== routeKey) {
|
|
1188
|
-
t13 = [routeKey];
|
|
1189
|
-
$[44] = routeKey;
|
|
1190
|
-
$[45] = t13;
|
|
1191
|
-
} else t13 = $[45];
|
|
1192
|
-
React.useEffect(_temp3, t13);
|
|
1193
|
-
if (route.type === "dashboard") {
|
|
1194
|
-
if (DashboardComponent) {
|
|
1195
|
-
let t14$2;
|
|
1196
|
-
if ($[46] !== DashboardComponent) {
|
|
1197
|
-
t14$2 = /* @__PURE__ */ jsx(DashboardComponent, {});
|
|
1198
|
-
$[46] = DashboardComponent;
|
|
1199
|
-
$[47] = t14$2;
|
|
1200
|
-
} else t14$2 = $[47];
|
|
1201
|
-
return t14$2;
|
|
1202
|
-
}
|
|
1203
|
-
if (dashboardConfig?.items?.length || dashboardConfig?.widgets?.length) {
|
|
1204
|
-
let t14$2;
|
|
1205
|
-
if ($[48] !== basePath || $[49] !== dashboardConfig || $[50] !== navigate) {
|
|
1206
|
-
t14$2 = /* @__PURE__ */ jsx(DashboardGrid, {
|
|
1207
|
-
config: dashboardConfig,
|
|
1208
|
-
basePath,
|
|
1209
|
-
navigate
|
|
1210
|
-
});
|
|
1211
|
-
$[48] = basePath;
|
|
1212
|
-
$[49] = dashboardConfig;
|
|
1213
|
-
$[50] = navigate;
|
|
1214
|
-
$[51] = t14$2;
|
|
1215
|
-
} else t14$2 = $[51];
|
|
1216
|
-
return t14$2;
|
|
575
|
+
case "collection-create": {
|
|
576
|
+
const config = collections[route.name];
|
|
577
|
+
const schemaConfig = activeCollectionSchema?.admin?.config;
|
|
578
|
+
const label = resolveResourceLabel(config, schemaConfig, route.name);
|
|
579
|
+
pageTitle = `${label}: ${t("common.create")}`;
|
|
580
|
+
metaDescription = resolveResourceDescription(config, schemaConfig) || t("collection.create", { name: label });
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
case "collection-edit": {
|
|
584
|
+
const config = collections[route.name];
|
|
585
|
+
const schemaConfig = activeCollectionSchema?.admin?.config;
|
|
586
|
+
const label = resolveResourceLabel(config, schemaConfig, route.name);
|
|
587
|
+
pageTitle = `${label}: ${t("common.edit")}`;
|
|
588
|
+
metaDescription = resolveResourceDescription(config, schemaConfig) || t("collection.edit", { name: label });
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
case "global-edit": {
|
|
592
|
+
const config = globals[route.name];
|
|
593
|
+
const schemaConfig = activeGlobalSchema?.admin?.config;
|
|
594
|
+
const label = resolveResourceLabel(config, schemaConfig, route.name);
|
|
595
|
+
pageTitle = label;
|
|
596
|
+
metaDescription = resolveResourceDescription(config, schemaConfig) || label;
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
599
|
+
case "page":
|
|
600
|
+
pageTitle = resolveText(route.config.label, formatLabel(route.name));
|
|
601
|
+
metaDescription = pageTitle;
|
|
602
|
+
break;
|
|
603
|
+
case "not-found":
|
|
604
|
+
pageTitle = t("error.notFound");
|
|
605
|
+
metaDescription = pageTitle;
|
|
606
|
+
break;
|
|
1217
607
|
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
608
|
+
document.title = formatDocumentTitle(pageTitle, appTitle);
|
|
609
|
+
setDocumentMetaDescription(metaDescription || pageTitle);
|
|
610
|
+
}, [
|
|
611
|
+
activeCollectionSchema,
|
|
612
|
+
activeGlobalSchema,
|
|
613
|
+
brandingName,
|
|
614
|
+
collections,
|
|
615
|
+
dashboardConfig,
|
|
616
|
+
globals,
|
|
617
|
+
resolveText,
|
|
618
|
+
route,
|
|
619
|
+
t
|
|
620
|
+
]);
|
|
621
|
+
const routeKey = segments.join("/");
|
|
622
|
+
React.useEffect(() => {
|
|
623
|
+
const main = document.getElementById("main-content");
|
|
624
|
+
if (main) requestAnimationFrame(() => {
|
|
625
|
+
main.focus({ preventScroll: true });
|
|
626
|
+
});
|
|
627
|
+
}, [routeKey]);
|
|
628
|
+
if (route.type === "dashboard") {
|
|
629
|
+
if (DashboardComponent) return /* @__PURE__ */ jsx(DashboardComponent, {});
|
|
630
|
+
if (dashboardConfig?.items?.length || dashboardConfig?.widgets?.length) return /* @__PURE__ */ jsx(DashboardGrid, {
|
|
631
|
+
config: dashboardConfig,
|
|
632
|
+
basePath,
|
|
633
|
+
navigate
|
|
634
|
+
});
|
|
635
|
+
return /* @__PURE__ */ jsx(DefaultDashboard, {});
|
|
1224
636
|
}
|
|
1225
637
|
if (route.type === "collection-list") {
|
|
1226
638
|
const { name } = route;
|
|
1227
|
-
const
|
|
1228
|
-
if (!
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
navigate,
|
|
1235
|
-
basePath
|
|
1236
|
-
});
|
|
1237
|
-
$[53] = basePath;
|
|
1238
|
-
$[54] = name;
|
|
1239
|
-
$[55] = navigate;
|
|
1240
|
-
$[56] = t14$2;
|
|
1241
|
-
} else t14$2 = $[56];
|
|
1242
|
-
return t14$2;
|
|
1243
|
-
}
|
|
639
|
+
const config = collections[name];
|
|
640
|
+
if (!config) return /* @__PURE__ */ jsx(RestrictedAccess, {
|
|
641
|
+
type: "collection",
|
|
642
|
+
name,
|
|
643
|
+
navigate,
|
|
644
|
+
basePath
|
|
645
|
+
});
|
|
1244
646
|
const custom = resolvedCollectionComponents[name];
|
|
1245
647
|
const viewNameFromSchema = activeCollectionSchema?.admin?.list?.view;
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
if ($[57] !== t14$1) {
|
|
1249
|
-
t15 = getConfiguredViewName(t14$1);
|
|
1250
|
-
$[57] = t14$1;
|
|
1251
|
-
$[58] = t15;
|
|
1252
|
-
} else t15 = $[58];
|
|
1253
|
-
const viewNameFromConfig = t15;
|
|
1254
|
-
let t16;
|
|
1255
|
-
if ($[59] !== viewNameFromConfig || $[60] !== viewNameFromSchema || $[61] !== views) {
|
|
1256
|
-
t16 = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "list");
|
|
1257
|
-
$[59] = viewNameFromConfig;
|
|
1258
|
-
$[60] = viewNameFromSchema;
|
|
1259
|
-
$[61] = views;
|
|
1260
|
-
$[62] = t16;
|
|
1261
|
-
} else t16 = $[62];
|
|
1262
|
-
const selectedListView = t16;
|
|
648
|
+
const viewNameFromConfig = getConfiguredViewName(config?.list);
|
|
649
|
+
const selectedListView = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "list");
|
|
1263
650
|
const selectedListViewDefinition = views[selectedListView];
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
t17 = mergeViewConfig(getViewBaseConfig(selectedListViewDefinition), config_5?.list?.config ?? config_5?.list ?? activeCollectionSchema?.admin?.list);
|
|
1267
|
-
$[63] = activeCollectionSchema;
|
|
1268
|
-
$[64] = config_5;
|
|
1269
|
-
$[65] = selectedListViewDefinition;
|
|
1270
|
-
$[66] = t17;
|
|
1271
|
-
} else t17 = $[66];
|
|
1272
|
-
const selectedListViewConfig = t17;
|
|
1273
|
-
let t18;
|
|
1274
|
-
if ($[67] !== selectedListViewDefinition) {
|
|
1275
|
-
t18 = getViewLoader(selectedListViewDefinition);
|
|
1276
|
-
$[67] = selectedListViewDefinition;
|
|
1277
|
-
$[68] = t18;
|
|
1278
|
-
} else t18 = $[68];
|
|
1279
|
-
const listViewLoader = t18;
|
|
651
|
+
const selectedListViewConfig = mergeViewConfig(getViewBaseConfig(selectedListViewDefinition), config?.list?.config ?? config?.list ?? activeCollectionSchema?.admin?.list);
|
|
652
|
+
const listViewLoader = getViewLoader(selectedListViewDefinition);
|
|
1280
653
|
if (selectedListViewDefinition && selectedListViewDefinition.kind !== "list" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedListView}" kind "${selectedListViewDefinition.kind}" != expected "list"`);
|
|
1281
|
-
if (custom?.List) {
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
} else t19$1 = $[70];
|
|
1288
|
-
return t19$1;
|
|
1289
|
-
}
|
|
1290
|
-
let t19;
|
|
1291
|
-
if ($[71] !== basePath || $[72] !== config_5 || $[73] !== name || $[74] !== navigate || $[75] !== selectedListViewConfig) {
|
|
1292
|
-
t19 = {
|
|
654
|
+
if (custom?.List) return /* @__PURE__ */ jsx(custom.List, {});
|
|
655
|
+
return /* @__PURE__ */ jsx(RegistryViewRenderer, {
|
|
656
|
+
loader: listViewLoader,
|
|
657
|
+
viewKind: "list",
|
|
658
|
+
viewId: selectedListView,
|
|
659
|
+
componentProps: {
|
|
1293
660
|
collection: name,
|
|
1294
|
-
config
|
|
661
|
+
config,
|
|
1295
662
|
viewConfig: selectedListViewConfig,
|
|
1296
663
|
navigate,
|
|
1297
664
|
basePath
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
$[72] = config_5;
|
|
1301
|
-
$[73] = name;
|
|
1302
|
-
$[74] = navigate;
|
|
1303
|
-
$[75] = selectedListViewConfig;
|
|
1304
|
-
$[76] = t19;
|
|
1305
|
-
} else t19 = $[76];
|
|
1306
|
-
const listComponentProps = t19;
|
|
1307
|
-
let t20;
|
|
1308
|
-
if ($[77] !== listComponentProps || $[78] !== listViewLoader || $[79] !== name || $[80] !== selectedListView) {
|
|
1309
|
-
t20 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
|
|
1310
|
-
loader: listViewLoader,
|
|
1311
|
-
viewKind: "list",
|
|
1312
|
-
viewId: selectedListView,
|
|
1313
|
-
componentProps: listComponentProps
|
|
1314
|
-
}, name);
|
|
1315
|
-
$[77] = listComponentProps;
|
|
1316
|
-
$[78] = listViewLoader;
|
|
1317
|
-
$[79] = name;
|
|
1318
|
-
$[80] = selectedListView;
|
|
1319
|
-
$[81] = t20;
|
|
1320
|
-
} else t20 = $[81];
|
|
1321
|
-
return t20;
|
|
665
|
+
}
|
|
666
|
+
}, name);
|
|
1322
667
|
}
|
|
1323
668
|
if (route.type === "collection-create" || route.type === "collection-edit") {
|
|
1324
|
-
const { name
|
|
669
|
+
const { name } = route;
|
|
1325
670
|
const id = route.type === "collection-edit" ? route.id : void 0;
|
|
1326
|
-
const
|
|
1327
|
-
if (!
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
$[83] = name_0;
|
|
1338
|
-
$[84] = navigate;
|
|
1339
|
-
$[85] = t14$2;
|
|
1340
|
-
} else t14$2 = $[85];
|
|
1341
|
-
return t14$2;
|
|
1342
|
-
}
|
|
1343
|
-
const custom_0 = resolvedCollectionComponents[name_0];
|
|
1344
|
-
const viewNameFromSchema_0 = activeCollectionSchema?.admin?.form?.view;
|
|
1345
|
-
const t14$1 = config_6?.form;
|
|
1346
|
-
let t15;
|
|
1347
|
-
if ($[86] !== t14$1) {
|
|
1348
|
-
t15 = getConfiguredViewName(t14$1);
|
|
1349
|
-
$[86] = t14$1;
|
|
1350
|
-
$[87] = t15;
|
|
1351
|
-
} else t15 = $[87];
|
|
1352
|
-
const viewNameFromConfig_0 = t15;
|
|
1353
|
-
let t16;
|
|
1354
|
-
if ($[88] !== viewNameFromConfig_0 || $[89] !== viewNameFromSchema_0 || $[90] !== views) {
|
|
1355
|
-
t16 = viewNameFromSchema_0 ?? viewNameFromConfig_0 ?? findDefaultView(views, "form");
|
|
1356
|
-
$[88] = viewNameFromConfig_0;
|
|
1357
|
-
$[89] = viewNameFromSchema_0;
|
|
1358
|
-
$[90] = views;
|
|
1359
|
-
$[91] = t16;
|
|
1360
|
-
} else t16 = $[91];
|
|
1361
|
-
const selectedFormView = t16;
|
|
671
|
+
const config = collections[name];
|
|
672
|
+
if (!config) return /* @__PURE__ */ jsx(RestrictedAccess, {
|
|
673
|
+
type: "collection",
|
|
674
|
+
name,
|
|
675
|
+
navigate,
|
|
676
|
+
basePath
|
|
677
|
+
});
|
|
678
|
+
const custom = resolvedCollectionComponents[name];
|
|
679
|
+
const viewNameFromSchema = activeCollectionSchema?.admin?.form?.view;
|
|
680
|
+
const viewNameFromConfig = getConfiguredViewName(config?.form);
|
|
681
|
+
const selectedFormView = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "form");
|
|
1362
682
|
const selectedFormViewDefinition = views[selectedFormView];
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
t17 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config_6?.form?.config ?? config_6?.form ?? activeCollectionSchema?.admin?.form);
|
|
1366
|
-
$[92] = activeCollectionSchema;
|
|
1367
|
-
$[93] = config_6;
|
|
1368
|
-
$[94] = selectedFormViewDefinition;
|
|
1369
|
-
$[95] = t17;
|
|
1370
|
-
} else t17 = $[95];
|
|
1371
|
-
const selectedFormViewConfig = t17;
|
|
1372
|
-
let t18;
|
|
1373
|
-
if ($[96] !== selectedFormViewDefinition) {
|
|
1374
|
-
t18 = getViewLoader(selectedFormViewDefinition);
|
|
1375
|
-
$[96] = selectedFormViewDefinition;
|
|
1376
|
-
$[97] = t18;
|
|
1377
|
-
} else t18 = $[97];
|
|
1378
|
-
const formViewLoader = t18;
|
|
683
|
+
const selectedFormViewConfig = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config?.form?.config ?? config?.form ?? activeCollectionSchema?.admin?.form);
|
|
684
|
+
const formViewLoader = getViewLoader(selectedFormViewDefinition);
|
|
1379
685
|
if (selectedFormViewDefinition && selectedFormViewDefinition.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView}" kind "${selectedFormViewDefinition.kind}" != expected "form"`);
|
|
1380
|
-
if (
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
return t19$1;
|
|
1388
|
-
}
|
|
1389
|
-
let t19;
|
|
1390
|
-
if ($[100] !== prefillValues || $[101] !== route.type) {
|
|
1391
|
-
t19 = route.type === "collection-create" && Object.keys(prefillValues).length > 0 ? prefillValues : void 0;
|
|
1392
|
-
$[100] = prefillValues;
|
|
1393
|
-
$[101] = route.type;
|
|
1394
|
-
$[102] = t19;
|
|
1395
|
-
} else t19 = $[102];
|
|
1396
|
-
const defaultValues = t19;
|
|
1397
|
-
let t20;
|
|
1398
|
-
if ($[103] !== basePath || $[104] !== collections || $[105] !== config_6 || $[106] !== defaultValues || $[107] !== id || $[108] !== name_0 || $[109] !== navigate || $[110] !== registry || $[111] !== selectedFormViewConfig) {
|
|
1399
|
-
t20 = {
|
|
1400
|
-
collection: name_0,
|
|
686
|
+
if (custom?.Form) return /* @__PURE__ */ jsx(custom.Form, {});
|
|
687
|
+
return /* @__PURE__ */ jsx(RegistryViewRenderer, {
|
|
688
|
+
loader: formViewLoader,
|
|
689
|
+
viewKind: "form",
|
|
690
|
+
viewId: selectedFormView,
|
|
691
|
+
componentProps: {
|
|
692
|
+
collection: name,
|
|
1401
693
|
id,
|
|
1402
|
-
config
|
|
694
|
+
config,
|
|
1403
695
|
viewConfig: selectedFormViewConfig,
|
|
1404
696
|
navigate,
|
|
1405
697
|
basePath,
|
|
1406
|
-
defaultValues,
|
|
698
|
+
defaultValues: route.type === "collection-create" && Object.keys(prefillValues).length > 0 ? prefillValues : void 0,
|
|
1407
699
|
registry,
|
|
1408
700
|
allCollectionsConfig: collections
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
$[104] = collections;
|
|
1412
|
-
$[105] = config_6;
|
|
1413
|
-
$[106] = defaultValues;
|
|
1414
|
-
$[107] = id;
|
|
1415
|
-
$[108] = name_0;
|
|
1416
|
-
$[109] = navigate;
|
|
1417
|
-
$[110] = registry;
|
|
1418
|
-
$[111] = selectedFormViewConfig;
|
|
1419
|
-
$[112] = t20;
|
|
1420
|
-
} else t20 = $[112];
|
|
1421
|
-
const editComponentProps = t20;
|
|
1422
|
-
const t21 = `${name_0}-${id ?? "create"}`;
|
|
1423
|
-
let t22;
|
|
1424
|
-
if ($[113] !== editComponentProps || $[114] !== formViewLoader || $[115] !== selectedFormView || $[116] !== t21) {
|
|
1425
|
-
t22 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
|
|
1426
|
-
loader: formViewLoader,
|
|
1427
|
-
viewKind: "form",
|
|
1428
|
-
viewId: selectedFormView,
|
|
1429
|
-
componentProps: editComponentProps
|
|
1430
|
-
}, t21);
|
|
1431
|
-
$[113] = editComponentProps;
|
|
1432
|
-
$[114] = formViewLoader;
|
|
1433
|
-
$[115] = selectedFormView;
|
|
1434
|
-
$[116] = t21;
|
|
1435
|
-
$[117] = t22;
|
|
1436
|
-
} else t22 = $[117];
|
|
1437
|
-
return t22;
|
|
701
|
+
}
|
|
702
|
+
}, `${name}-${id ?? "create"}`);
|
|
1438
703
|
}
|
|
1439
704
|
if (route.type === "global-edit") {
|
|
1440
|
-
const { name
|
|
1441
|
-
const
|
|
1442
|
-
if (!
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
$[123] = t15;
|
|
1466
|
-
} else t15 = $[123];
|
|
1467
|
-
const viewNameFromConfig_1 = t15;
|
|
1468
|
-
let t16;
|
|
1469
|
-
if ($[124] !== viewNameFromConfig_1 || $[125] !== viewNameFromSchema_1 || $[126] !== views) {
|
|
1470
|
-
t16 = viewNameFromSchema_1 ?? viewNameFromConfig_1 ?? findDefaultView(views, "form");
|
|
1471
|
-
$[124] = viewNameFromConfig_1;
|
|
1472
|
-
$[125] = viewNameFromSchema_1;
|
|
1473
|
-
$[126] = views;
|
|
1474
|
-
$[127] = t16;
|
|
1475
|
-
} else t16 = $[127];
|
|
1476
|
-
const selectedFormView_0 = t16;
|
|
1477
|
-
const selectedFormViewDefinition_0 = views[selectedFormView_0];
|
|
1478
|
-
let t17;
|
|
1479
|
-
if ($[128] !== activeGlobalSchema || $[129] !== config_7 || $[130] !== selectedFormViewDefinition_0) {
|
|
1480
|
-
t17 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition_0), config_7?.form?.config ?? config_7?.form ?? activeGlobalSchema?.admin?.form);
|
|
1481
|
-
$[128] = activeGlobalSchema;
|
|
1482
|
-
$[129] = config_7;
|
|
1483
|
-
$[130] = selectedFormViewDefinition_0;
|
|
1484
|
-
$[131] = t17;
|
|
1485
|
-
} else t17 = $[131];
|
|
1486
|
-
const selectedFormViewConfig_0 = t17;
|
|
1487
|
-
let t18;
|
|
1488
|
-
if ($[132] !== selectedFormViewDefinition_0) {
|
|
1489
|
-
t18 = getViewLoader(selectedFormViewDefinition_0);
|
|
1490
|
-
$[132] = selectedFormViewDefinition_0;
|
|
1491
|
-
$[133] = t18;
|
|
1492
|
-
} else t18 = $[133];
|
|
1493
|
-
const globalViewLoader = t18;
|
|
1494
|
-
if (selectedFormViewDefinition_0 && selectedFormViewDefinition_0.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView_0}" kind "${selectedFormViewDefinition_0.kind}" != expected "form"`);
|
|
1495
|
-
if (custom_1?.Form) {
|
|
1496
|
-
let t19$1;
|
|
1497
|
-
if ($[134] !== custom_1.Form) {
|
|
1498
|
-
t19$1 = /* @__PURE__ */ jsx(custom_1.Form, {});
|
|
1499
|
-
$[134] = custom_1.Form;
|
|
1500
|
-
$[135] = t19$1;
|
|
1501
|
-
} else t19$1 = $[135];
|
|
1502
|
-
return t19$1;
|
|
1503
|
-
}
|
|
1504
|
-
let t19;
|
|
1505
|
-
if ($[136] !== basePath || $[137] !== config_7 || $[138] !== globals || $[139] !== name_1 || $[140] !== navigate || $[141] !== registry || $[142] !== selectedFormViewConfig_0) {
|
|
1506
|
-
t19 = {
|
|
1507
|
-
global: name_1,
|
|
1508
|
-
config: config_7,
|
|
1509
|
-
viewConfig: selectedFormViewConfig_0,
|
|
705
|
+
const { name } = route;
|
|
706
|
+
const config = globals[name];
|
|
707
|
+
if (!config) return /* @__PURE__ */ jsx(RestrictedAccess, {
|
|
708
|
+
type: "global",
|
|
709
|
+
name,
|
|
710
|
+
navigate,
|
|
711
|
+
basePath
|
|
712
|
+
});
|
|
713
|
+
const custom = resolvedGlobalComponents[name];
|
|
714
|
+
const viewNameFromSchema = activeGlobalSchema?.admin?.form?.view;
|
|
715
|
+
const viewNameFromConfig = getConfiguredViewName(config?.form);
|
|
716
|
+
const selectedFormView = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "form");
|
|
717
|
+
const selectedFormViewDefinition = views[selectedFormView];
|
|
718
|
+
const selectedFormViewConfig = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config?.form?.config ?? config?.form ?? activeGlobalSchema?.admin?.form);
|
|
719
|
+
const globalViewLoader = getViewLoader(selectedFormViewDefinition);
|
|
720
|
+
if (selectedFormViewDefinition && selectedFormViewDefinition.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView}" kind "${selectedFormViewDefinition.kind}" != expected "form"`);
|
|
721
|
+
if (custom?.Form) return /* @__PURE__ */ jsx(custom.Form, {});
|
|
722
|
+
return /* @__PURE__ */ jsx(RegistryViewRenderer, {
|
|
723
|
+
loader: globalViewLoader,
|
|
724
|
+
viewKind: "form",
|
|
725
|
+
viewId: selectedFormView,
|
|
726
|
+
componentProps: {
|
|
727
|
+
global: name,
|
|
728
|
+
config,
|
|
729
|
+
viewConfig: selectedFormViewConfig,
|
|
1510
730
|
navigate,
|
|
1511
731
|
basePath,
|
|
1512
732
|
registry,
|
|
1513
733
|
allGlobalsConfig: globals
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
$[137] = config_7;
|
|
1517
|
-
$[138] = globals;
|
|
1518
|
-
$[139] = name_1;
|
|
1519
|
-
$[140] = navigate;
|
|
1520
|
-
$[141] = registry;
|
|
1521
|
-
$[142] = selectedFormViewConfig_0;
|
|
1522
|
-
$[143] = t19;
|
|
1523
|
-
} else t19 = $[143];
|
|
1524
|
-
const globalComponentProps = t19;
|
|
1525
|
-
let t20;
|
|
1526
|
-
if ($[144] !== globalComponentProps || $[145] !== globalViewLoader || $[146] !== name_1 || $[147] !== selectedFormView_0) {
|
|
1527
|
-
t20 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
|
|
1528
|
-
loader: globalViewLoader,
|
|
1529
|
-
viewKind: "form",
|
|
1530
|
-
viewId: selectedFormView_0,
|
|
1531
|
-
componentProps: globalComponentProps
|
|
1532
|
-
}, name_1);
|
|
1533
|
-
$[144] = globalComponentProps;
|
|
1534
|
-
$[145] = globalViewLoader;
|
|
1535
|
-
$[146] = name_1;
|
|
1536
|
-
$[147] = selectedFormView_0;
|
|
1537
|
-
$[148] = t20;
|
|
1538
|
-
} else t20 = $[148];
|
|
1539
|
-
return t20;
|
|
1540
|
-
}
|
|
1541
|
-
if (route.type === "page") {
|
|
1542
|
-
let t14$1;
|
|
1543
|
-
if ($[149] !== route.config) {
|
|
1544
|
-
t14$1 = /* @__PURE__ */ jsx(LazyPageRenderer, { config: route.config });
|
|
1545
|
-
$[149] = route.config;
|
|
1546
|
-
$[150] = t14$1;
|
|
1547
|
-
} else t14$1 = $[150];
|
|
1548
|
-
return t14$1;
|
|
734
|
+
}
|
|
735
|
+
}, name);
|
|
1549
736
|
}
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
if ($[151] !== NotFound) {
|
|
1553
|
-
t14 = /* @__PURE__ */ jsx(NotFound, {});
|
|
1554
|
-
$[151] = NotFound;
|
|
1555
|
-
$[152] = t14;
|
|
1556
|
-
} else t14 = $[152];
|
|
1557
|
-
return t14;
|
|
1558
|
-
}
|
|
1559
|
-
function _temp3() {
|
|
1560
|
-
const main = document.getElementById("main-content");
|
|
1561
|
-
if (main) requestAnimationFrame(() => {
|
|
1562
|
-
main.focus({ preventScroll: true });
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
function _temp2(prev) {
|
|
1566
|
-
return {
|
|
1567
|
-
...prev,
|
|
1568
|
-
loading: true,
|
|
1569
|
-
error: null
|
|
1570
|
-
};
|
|
737
|
+
if (route.type === "page") return /* @__PURE__ */ jsx(LazyPageRenderer, { config: route.config });
|
|
738
|
+
return /* @__PURE__ */ jsx(NotFoundComponent || DefaultNotFound, {});
|
|
1571
739
|
}
|
|
1572
740
|
|
|
1573
741
|
//#endregion
|