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