@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
|
@@ -15,7 +15,6 @@ import { useCurrentUser, useSessionState } from "../../hooks/use-current-user.mj
|
|
|
15
15
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuItem, SidebarSeparator, SidebarTrigger, useSidebar } from "../../components/ui/sidebar.mjs";
|
|
16
16
|
import { BrandLogoMark } from "../../components/brand-logo.mjs";
|
|
17
17
|
import { getAdminPreferenceQueryKey, useAdminPreference, useSetAdminPreference } from "../../hooks/use-admin-preferences.mjs";
|
|
18
|
-
import { c } from "react/compiler-runtime";
|
|
19
18
|
import { Icon } from "@iconify/react";
|
|
20
19
|
import * as React from "react";
|
|
21
20
|
import { useQueryClient } from "@tanstack/react-query";
|
|
@@ -50,127 +49,91 @@ function getSidebarItemProps(item) {
|
|
|
50
49
|
* only for page items (which are client-only).
|
|
51
50
|
*/
|
|
52
51
|
function useServerNavigation() {
|
|
53
|
-
const $ = c(6);
|
|
54
52
|
const { data: serverConfig } = useAdminConfig();
|
|
55
|
-
const storeNavigation = useAdminStore(
|
|
53
|
+
const storeNavigation = useAdminStore((s) => s.navigation);
|
|
56
54
|
const basePath = useAdminStore(selectBasePath);
|
|
57
|
-
|
|
58
|
-
bb0: {
|
|
55
|
+
return React.useMemo(() => {
|
|
59
56
|
const sections = serverConfig?.sidebar?.sections;
|
|
60
|
-
if (!sections?.length)
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
if (!sections?.length) return void 0;
|
|
58
|
+
const pageMap = /* @__PURE__ */ new Map();
|
|
59
|
+
for (const group of storeNavigation ?? []) for (const element of group.items ?? []) if (element.type !== "divider" && "id" in element) {
|
|
60
|
+
const navItem = element;
|
|
61
|
+
if (navItem.type === "page") pageMap.set(navItem.id, navItem);
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const meta_0 = serverConfig?.collections?.[collectionName];
|
|
77
|
-
return {
|
|
78
|
-
id: `collection:${collectionName}`,
|
|
79
|
-
label: props.label ?? meta_0?.label ?? formatLabel(collectionName),
|
|
80
|
-
href: `${basePath}/collections/${collectionName}`,
|
|
81
|
-
icon: props.icon ?? meta_0?.icon,
|
|
82
|
-
type: "collection",
|
|
83
|
-
order: 0
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
case "global": {
|
|
87
|
-
const globalName = props.global;
|
|
88
|
-
const meta = serverConfig?.globals?.[globalName];
|
|
89
|
-
return {
|
|
90
|
-
id: `global:${globalName}`,
|
|
91
|
-
label: props.label ?? meta?.label ?? formatLabel(globalName),
|
|
92
|
-
href: `${basePath}/globals/${globalName}`,
|
|
93
|
-
icon: props.icon ?? meta?.icon,
|
|
94
|
-
type: "global",
|
|
95
|
-
order: 0
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
case "page": {
|
|
99
|
-
const found = pageMap.get(`page:${props.pageId}`);
|
|
100
|
-
if (!found) return;
|
|
101
|
-
return {
|
|
102
|
-
...found,
|
|
103
|
-
label: props.label ?? found.label,
|
|
104
|
-
icon: props.icon ?? found.icon
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
case "link": return {
|
|
108
|
-
id: `link:${props.href}`,
|
|
109
|
-
label: props.label ?? "",
|
|
110
|
-
href: props.href,
|
|
111
|
-
icon: props.icon,
|
|
112
|
-
type: "link",
|
|
63
|
+
function convertItem(item) {
|
|
64
|
+
const props = getSidebarItemProps(item);
|
|
65
|
+
switch (item.type) {
|
|
66
|
+
case "collection": {
|
|
67
|
+
const collectionName = props.collection;
|
|
68
|
+
const meta = serverConfig?.collections?.[collectionName];
|
|
69
|
+
return {
|
|
70
|
+
id: `collection:${collectionName}`,
|
|
71
|
+
label: props.label ?? meta?.label ?? formatLabel(collectionName),
|
|
72
|
+
href: `${basePath}/collections/${collectionName}`,
|
|
73
|
+
icon: props.icon ?? meta?.icon,
|
|
74
|
+
type: "collection",
|
|
113
75
|
order: 0
|
|
114
76
|
};
|
|
115
|
-
case "divider": return { type: "divider" };
|
|
116
|
-
default: return;
|
|
117
77
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
78
|
+
case "global": {
|
|
79
|
+
const globalName = props.global;
|
|
80
|
+
const meta = serverConfig?.globals?.[globalName];
|
|
81
|
+
return {
|
|
82
|
+
id: `global:${globalName}`,
|
|
83
|
+
label: props.label ?? meta?.label ?? formatLabel(globalName),
|
|
84
|
+
href: `${basePath}/globals/${globalName}`,
|
|
85
|
+
icon: props.icon ?? meta?.icon,
|
|
86
|
+
type: "global",
|
|
87
|
+
order: 0
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
case "page": {
|
|
91
|
+
const found = pageMap.get(`page:${props.pageId}`);
|
|
92
|
+
if (!found) return void 0;
|
|
93
|
+
return {
|
|
94
|
+
...found,
|
|
95
|
+
label: props.label ?? found.label,
|
|
96
|
+
icon: props.icon ?? found.icon
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
case "link": return {
|
|
100
|
+
id: `link:${props.href}`,
|
|
101
|
+
label: props.label ?? "",
|
|
102
|
+
href: props.href,
|
|
103
|
+
icon: props.icon,
|
|
104
|
+
type: "link",
|
|
105
|
+
order: 0
|
|
127
106
|
};
|
|
107
|
+
case "divider": return { type: "divider" };
|
|
108
|
+
default: return;
|
|
128
109
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
110
|
+
}
|
|
111
|
+
function convertSection(section) {
|
|
112
|
+
return {
|
|
113
|
+
id: section.id,
|
|
114
|
+
label: section.title,
|
|
115
|
+
icon: section.icon,
|
|
116
|
+
collapsible: section.collapsible,
|
|
117
|
+
items: (section.items ?? []).map(convertItem).filter((i) => i !== void 0),
|
|
118
|
+
sections: section.sections?.map(convertSection)
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return sections.map(convertSection);
|
|
122
|
+
}, [
|
|
123
|
+
serverConfig,
|
|
124
|
+
storeNavigation,
|
|
125
|
+
basePath
|
|
126
|
+
]);
|
|
146
127
|
}
|
|
147
128
|
function useSidebarProps(props) {
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
$[0] = serverNavigation;
|
|
157
|
-
$[1] = storeNavigation;
|
|
158
|
-
$[2] = t0;
|
|
159
|
-
} else t0 = $[2];
|
|
160
|
-
const t1 = props.brandName ?? storeBrandName ?? "Admin";
|
|
161
|
-
let t2;
|
|
162
|
-
if ($[3] !== storeBrandLogo || $[4] !== t0 || $[5] !== t1) {
|
|
163
|
-
t2 = {
|
|
164
|
-
navigation: t0,
|
|
165
|
-
brandName: t1,
|
|
166
|
-
brandLogo: storeBrandLogo
|
|
167
|
-
};
|
|
168
|
-
$[3] = storeBrandLogo;
|
|
169
|
-
$[4] = t0;
|
|
170
|
-
$[5] = t1;
|
|
171
|
-
$[6] = t2;
|
|
172
|
-
} else t2 = $[6];
|
|
173
|
-
return t2;
|
|
129
|
+
const storeNavigation = useAdminStore((s) => s.navigation);
|
|
130
|
+
const storeBrandName = useAdminStore((s) => s.brandName);
|
|
131
|
+
const storeBrandLogo = useAdminStore((s) => s.brandLogo);
|
|
132
|
+
return {
|
|
133
|
+
navigation: useServerNavigation() ?? storeNavigation ?? [],
|
|
134
|
+
brandName: props.brandName ?? storeBrandName ?? "Admin",
|
|
135
|
+
brandLogo: storeBrandLogo
|
|
136
|
+
};
|
|
174
137
|
}
|
|
175
138
|
/**
|
|
176
139
|
* Render an icon - handles ComponentReference and React components.
|
|
@@ -184,15 +147,6 @@ function useSidebarProps(props) {
|
|
|
184
147
|
* <RenderIcon icon={{ type: "icon", props: { name: "ph:users" } }} />
|
|
185
148
|
* ```
|
|
186
149
|
*/
|
|
187
|
-
function _temp5(s_1) {
|
|
188
|
-
return s_1.brandLogo;
|
|
189
|
-
}
|
|
190
|
-
function _temp4(s_0) {
|
|
191
|
-
return s_0.brandName;
|
|
192
|
-
}
|
|
193
|
-
function _temp3(s) {
|
|
194
|
-
return s.navigation;
|
|
195
|
-
}
|
|
196
150
|
function areIconValuesEqual(a, b) {
|
|
197
151
|
if (a === b) return true;
|
|
198
152
|
if (!a || !b) return false;
|
|
@@ -211,100 +165,40 @@ function areIconValuesEqual(a, b) {
|
|
|
211
165
|
return false;
|
|
212
166
|
}
|
|
213
167
|
const RenderIcon = React.memo(function RenderIcon$1(props) {
|
|
214
|
-
const $ = c(10);
|
|
215
168
|
const { icon, className } = props;
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
t0 = cn("size-4 shrink-0", className);
|
|
219
|
-
$[0] = className;
|
|
220
|
-
$[1] = t0;
|
|
221
|
-
} else t0 = $[1];
|
|
222
|
-
const mergedClassName = t0;
|
|
223
|
-
let t1;
|
|
224
|
-
if ($[2] !== mergedClassName) {
|
|
225
|
-
t1 = { className: mergedClassName };
|
|
226
|
-
$[2] = mergedClassName;
|
|
227
|
-
$[3] = t1;
|
|
228
|
-
} else t1 = $[3];
|
|
229
|
-
const additionalProps = t1;
|
|
169
|
+
const mergedClassName = React.useMemo(() => cn("size-4 shrink-0", className), [className]);
|
|
170
|
+
const additionalProps = React.useMemo(() => ({ className: mergedClassName }), [mergedClassName]);
|
|
230
171
|
if (!icon) return null;
|
|
231
|
-
if (typeof icon === "object" && icon !== null && "type" in icon) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
reference: t2$1,
|
|
237
|
-
additionalProps
|
|
238
|
-
});
|
|
239
|
-
$[4] = additionalProps;
|
|
240
|
-
$[5] = t2$1;
|
|
241
|
-
$[6] = t3;
|
|
242
|
-
} else t3 = $[6];
|
|
243
|
-
return t3;
|
|
244
|
-
}
|
|
245
|
-
const IconComp = icon;
|
|
246
|
-
let t2;
|
|
247
|
-
if ($[7] !== IconComp || $[8] !== mergedClassName) {
|
|
248
|
-
t2 = /* @__PURE__ */ jsx(IconComp, { className: mergedClassName });
|
|
249
|
-
$[7] = IconComp;
|
|
250
|
-
$[8] = mergedClassName;
|
|
251
|
-
$[9] = t2;
|
|
252
|
-
} else t2 = $[9];
|
|
253
|
-
return t2;
|
|
172
|
+
if (typeof icon === "object" && icon !== null && "type" in icon) return /* @__PURE__ */ jsx(ComponentRenderer, {
|
|
173
|
+
reference: icon,
|
|
174
|
+
additionalProps
|
|
175
|
+
});
|
|
176
|
+
return /* @__PURE__ */ jsx(icon, { className: mergedClassName });
|
|
254
177
|
}, (prev, next) => {
|
|
255
178
|
if (prev.className !== next.className) return false;
|
|
256
179
|
return areIconValuesEqual(prev.icon, next.icon);
|
|
257
180
|
});
|
|
258
|
-
function QuestpieSymbol(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
t4 = /* @__PURE__ */ jsx("path", {
|
|
280
|
-
d: "M23 13H13V23H23V13Z",
|
|
281
|
-
fill: "#B700FF"
|
|
282
|
-
});
|
|
283
|
-
$[2] = t2;
|
|
284
|
-
$[3] = t3;
|
|
285
|
-
$[4] = t4;
|
|
286
|
-
} else {
|
|
287
|
-
t2 = $[2];
|
|
288
|
-
t3 = $[3];
|
|
289
|
-
t4 = $[4];
|
|
290
|
-
}
|
|
291
|
-
let t5;
|
|
292
|
-
if ($[5] !== t1) {
|
|
293
|
-
t5 = /* @__PURE__ */ jsxs("svg", {
|
|
294
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
295
|
-
viewBox: "0 0 24 24",
|
|
296
|
-
fill: "none",
|
|
297
|
-
className: t1,
|
|
298
|
-
children: [
|
|
299
|
-
t2,
|
|
300
|
-
t3,
|
|
301
|
-
t4
|
|
302
|
-
]
|
|
303
|
-
});
|
|
304
|
-
$[5] = t1;
|
|
305
|
-
$[6] = t5;
|
|
306
|
-
} else t5 = $[6];
|
|
307
|
-
return t5;
|
|
181
|
+
function QuestpieSymbol({ className }) {
|
|
182
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
183
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
184
|
+
viewBox: "0 0 24 24",
|
|
185
|
+
fill: "none",
|
|
186
|
+
className: cn("size-6 shrink-0", className),
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ jsx("title", { children: "QUESTPIE" }),
|
|
189
|
+
/* @__PURE__ */ jsx("path", {
|
|
190
|
+
d: "M22 10V2H2V22H10",
|
|
191
|
+
stroke: "currentColor",
|
|
192
|
+
strokeWidth: "2",
|
|
193
|
+
strokeLinecap: "square",
|
|
194
|
+
className: "text-foreground"
|
|
195
|
+
}),
|
|
196
|
+
/* @__PURE__ */ jsx("path", {
|
|
197
|
+
d: "M23 13H13V23H23V13Z",
|
|
198
|
+
fill: "#B700FF"
|
|
199
|
+
})
|
|
200
|
+
]
|
|
201
|
+
});
|
|
308
202
|
}
|
|
309
203
|
/**
|
|
310
204
|
* Check if element is a navigation item (not divider)
|
|
@@ -330,157 +224,63 @@ function isRouteActive(activeRoute, itemHref, basePath, exact = false) {
|
|
|
330
224
|
*/
|
|
331
225
|
const menuButtonStyles = cn("item-surface font-chrome flex w-full items-center gap-2 px-2 py-2 text-[13px] font-medium transition-[background-color,color,border-color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-foreground", "focus-visible:ring-sidebar-ring focus-visible:ring-1 focus-visible:outline-none", "group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-2");
|
|
332
226
|
const menuButtonActiveStyles = cn("border-transparent bg-[var(--sidebar-active-background)] text-[var(--sidebar-active-foreground)]");
|
|
333
|
-
function NavItem(
|
|
334
|
-
const $ = c(45);
|
|
335
|
-
const { item, isActive, LinkComponent, renderNavItem, useActiveProps, className, depth: t1 } = t0;
|
|
227
|
+
function NavItem({ item, isActive, LinkComponent, renderNavItem, useActiveProps, className, depth = 0 }) {
|
|
336
228
|
const { state, isMobile, setOpenMobile } = useSidebar();
|
|
337
229
|
const collapsed = state === "collapsed";
|
|
338
|
-
const
|
|
339
|
-
let t2;
|
|
340
|
-
if ($[0] !== item.label || $[1] !== resolveText) {
|
|
341
|
-
t2 = resolveText(item.label);
|
|
342
|
-
$[0] = item.label;
|
|
343
|
-
$[1] = resolveText;
|
|
344
|
-
$[2] = t2;
|
|
345
|
-
} else t2 = $[2];
|
|
346
|
-
const label = t2;
|
|
230
|
+
const label = useResolveText()(item.label);
|
|
347
231
|
const shouldUseExact = item.type === "link" || item.type === "page";
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
activeOptions: { exact: shouldUseExact }
|
|
353
|
-
} : {};
|
|
354
|
-
$[3] = shouldUseExact;
|
|
355
|
-
$[4] = useActiveProps;
|
|
356
|
-
$[5] = t3;
|
|
357
|
-
} else t3 = $[5];
|
|
358
|
-
const linkActiveProps = t3;
|
|
232
|
+
const linkActiveProps = useActiveProps ? {
|
|
233
|
+
activeProps: { className: menuButtonActiveStyles },
|
|
234
|
+
activeOptions: { exact: shouldUseExact }
|
|
235
|
+
} : {};
|
|
359
236
|
const ariaCurrent = isActive ? "page" : void 0;
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
const handleClick = t4;
|
|
370
|
-
const t5 = item.href;
|
|
371
|
-
const t6 = collapsed ? label : void 0;
|
|
372
|
-
const t7 = isActive && "qa-sidebar__nav-link--active";
|
|
373
|
-
const t8 = isActive && menuButtonActiveStyles;
|
|
374
|
-
let t9;
|
|
375
|
-
if ($[9] !== t7 || $[10] !== t8) {
|
|
376
|
-
t9 = cn("qa-sidebar__nav-link", menuButtonStyles, t7, t8);
|
|
377
|
-
$[9] = t7;
|
|
378
|
-
$[10] = t8;
|
|
379
|
-
$[11] = t9;
|
|
380
|
-
} else t9 = $[11];
|
|
381
|
-
let t10;
|
|
382
|
-
if ($[12] !== item.icon) {
|
|
383
|
-
t10 = item.icon && /* @__PURE__ */ jsx(RenderIcon, {
|
|
237
|
+
const handleClick = React.useCallback(() => {
|
|
238
|
+
if (isMobile) setOpenMobile(false);
|
|
239
|
+
}, [isMobile, setOpenMobile]);
|
|
240
|
+
const linkContent = /* @__PURE__ */ jsxs(LinkComponent, {
|
|
241
|
+
to: item.href,
|
|
242
|
+
"aria-label": collapsed ? label : void 0,
|
|
243
|
+
className: cn("qa-sidebar__nav-link", menuButtonStyles, isActive && "qa-sidebar__nav-link--active", isActive && menuButtonActiveStyles),
|
|
244
|
+
...linkActiveProps,
|
|
245
|
+
children: [item.icon && /* @__PURE__ */ jsx(RenderIcon, {
|
|
384
246
|
icon: item.icon,
|
|
385
247
|
className: "qa-sidebar__nav-icon"
|
|
386
|
-
})
|
|
387
|
-
$[12] = item.icon;
|
|
388
|
-
$[13] = t10;
|
|
389
|
-
} else t10 = $[13];
|
|
390
|
-
let t11;
|
|
391
|
-
if ($[14] !== label) {
|
|
392
|
-
t11 = /* @__PURE__ */ jsx("span", {
|
|
248
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
393
249
|
className: "qa-sidebar__nav-label truncate group-data-[collapsible=icon]:hidden",
|
|
394
250
|
children: label
|
|
395
|
-
})
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
to:
|
|
403
|
-
"
|
|
404
|
-
className: t9,
|
|
251
|
+
})]
|
|
252
|
+
});
|
|
253
|
+
const builtInNavItem = collapsed && !isMobile ? /* @__PURE__ */ jsx(SidebarMenuItem, {
|
|
254
|
+
className: "qa-sidebar__nav-item",
|
|
255
|
+
onClickCapture: handleClick,
|
|
256
|
+
"aria-current": ariaCurrent,
|
|
257
|
+
children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs(LinkComponent, {
|
|
258
|
+
to: item.href,
|
|
259
|
+
className: cn("qa-sidebar__nav-link", menuButtonStyles, isActive && "qa-sidebar__nav-link--active", isActive && menuButtonActiveStyles),
|
|
405
260
|
...linkActiveProps,
|
|
406
|
-
children: [
|
|
407
|
-
|
|
408
|
-
$[16] = LinkComponent;
|
|
409
|
-
$[17] = item.href;
|
|
410
|
-
$[18] = linkActiveProps;
|
|
411
|
-
$[19] = t10;
|
|
412
|
-
$[20] = t11;
|
|
413
|
-
$[21] = t6;
|
|
414
|
-
$[22] = t9;
|
|
415
|
-
$[23] = t12;
|
|
416
|
-
} else t12 = $[23];
|
|
417
|
-
const linkContent = t12;
|
|
418
|
-
let t13;
|
|
419
|
-
if ($[24] !== LinkComponent || $[25] !== ariaCurrent || $[26] !== className || $[27] !== collapsed || $[28] !== handleClick || $[29] !== isActive || $[30] !== isMobile || $[31] !== item.href || $[32] !== item.icon || $[33] !== label || $[34] !== linkActiveProps || $[35] !== linkContent) {
|
|
420
|
-
t13 = collapsed && !isMobile ? /* @__PURE__ */ jsx(SidebarMenuItem, {
|
|
421
|
-
className: "qa-sidebar__nav-item",
|
|
422
|
-
onClickCapture: handleClick,
|
|
423
|
-
"aria-current": ariaCurrent,
|
|
424
|
-
children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs(LinkComponent, {
|
|
425
|
-
to: item.href,
|
|
426
|
-
className: cn("qa-sidebar__nav-link", menuButtonStyles, isActive && "qa-sidebar__nav-link--active", isActive && menuButtonActiveStyles),
|
|
427
|
-
...linkActiveProps,
|
|
428
|
-
children: [item.icon && /* @__PURE__ */ jsx(RenderIcon, { icon: item.icon }), /* @__PURE__ */ jsx("span", {
|
|
429
|
-
className: "truncate group-data-[collapsible=icon]:hidden",
|
|
430
|
-
children: label
|
|
431
|
-
})]
|
|
432
|
-
}) }), /* @__PURE__ */ jsx(TooltipContent, {
|
|
433
|
-
side: "right",
|
|
434
|
-
align: "center",
|
|
261
|
+
children: [item.icon && /* @__PURE__ */ jsx(RenderIcon, { icon: item.icon }), /* @__PURE__ */ jsx("span", {
|
|
262
|
+
className: "truncate group-data-[collapsible=icon]:hidden",
|
|
435
263
|
children: label
|
|
436
|
-
})]
|
|
437
|
-
})
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
} else t13 = $[36];
|
|
457
|
-
const builtInNavItem = t13;
|
|
458
|
-
if (renderNavItem) {
|
|
459
|
-
let t14;
|
|
460
|
-
if ($[37] !== collapsed || $[38] !== isActive || $[39] !== item || $[40] !== renderNavItem) {
|
|
461
|
-
t14 = renderNavItem({
|
|
462
|
-
item,
|
|
463
|
-
isActive,
|
|
464
|
-
collapsed
|
|
465
|
-
});
|
|
466
|
-
$[37] = collapsed;
|
|
467
|
-
$[38] = isActive;
|
|
468
|
-
$[39] = item;
|
|
469
|
-
$[40] = renderNavItem;
|
|
470
|
-
$[41] = t14;
|
|
471
|
-
} else t14 = $[41];
|
|
472
|
-
let t15;
|
|
473
|
-
if ($[42] !== builtInNavItem || $[43] !== t14) {
|
|
474
|
-
t15 = /* @__PURE__ */ jsx(React.Suspense, {
|
|
475
|
-
fallback: builtInNavItem,
|
|
476
|
-
children: t14
|
|
477
|
-
});
|
|
478
|
-
$[42] = builtInNavItem;
|
|
479
|
-
$[43] = t14;
|
|
480
|
-
$[44] = t15;
|
|
481
|
-
} else t15 = $[44];
|
|
482
|
-
return t15;
|
|
483
|
-
}
|
|
264
|
+
})]
|
|
265
|
+
}) }), /* @__PURE__ */ jsx(TooltipContent, {
|
|
266
|
+
side: "right",
|
|
267
|
+
align: "center",
|
|
268
|
+
children: label
|
|
269
|
+
})] })
|
|
270
|
+
}) : /* @__PURE__ */ jsx(SidebarMenuItem, {
|
|
271
|
+
className: cn("qa-sidebar__nav-item", className),
|
|
272
|
+
onClickCapture: handleClick,
|
|
273
|
+
"aria-current": ariaCurrent,
|
|
274
|
+
children: linkContent
|
|
275
|
+
});
|
|
276
|
+
if (renderNavItem) return /* @__PURE__ */ jsx(React.Suspense, {
|
|
277
|
+
fallback: builtInNavItem,
|
|
278
|
+
children: renderNavItem({
|
|
279
|
+
item,
|
|
280
|
+
isActive,
|
|
281
|
+
collapsed
|
|
282
|
+
})
|
|
283
|
+
});
|
|
484
284
|
return builtInNavItem;
|
|
485
285
|
}
|
|
486
286
|
const SIDEBAR_COLLAPSED_SECTIONS_KEY = "sidebar:collapsed-sections";
|
|
@@ -490,124 +290,70 @@ const SIDEBAR_COLLAPSED_SECTIONS_KEY = "sidebar:collapsed-sections";
|
|
|
490
290
|
* Collapsible sections default to collapsed (true) when no preference is stored.
|
|
491
291
|
*/
|
|
492
292
|
function useSidebarCollapsedSections() {
|
|
493
|
-
const $ = c(13);
|
|
494
293
|
const user = useCurrentUser();
|
|
495
294
|
const queryClient = useQueryClient();
|
|
496
295
|
const { data: stored, isLoading } = useAdminPreference(SIDEBAR_COLLAPSED_SECTIONS_KEY);
|
|
497
296
|
const { mutate: persist } = useSetAdminPreference(SIDEBAR_COLLAPSED_SECTIONS_KEY);
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
t1 = getAdminPreferenceQueryKey(t0, SIDEBAR_COLLAPSED_SECTIONS_KEY);
|
|
502
|
-
$[0] = t0;
|
|
503
|
-
$[1] = t1;
|
|
504
|
-
} else t1 = $[1];
|
|
505
|
-
const queryKey = t1;
|
|
506
|
-
let t2;
|
|
507
|
-
if ($[2] !== stored) {
|
|
508
|
-
t2 = (sectionId, collapsible) => {
|
|
297
|
+
const queryKey = getAdminPreferenceQueryKey(user?.id, SIDEBAR_COLLAPSED_SECTIONS_KEY);
|
|
298
|
+
return {
|
|
299
|
+
isSectionCollapsed: React.useCallback((sectionId, collapsible) => {
|
|
509
300
|
if (!collapsible || !sectionId) return false;
|
|
510
301
|
return stored?.[sectionId] ?? false;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
$[3] = t2;
|
|
514
|
-
} else t2 = $[3];
|
|
515
|
-
const isSectionCollapsed = t2;
|
|
516
|
-
let t3;
|
|
517
|
-
if ($[4] !== persist || $[5] !== queryClient || $[6] !== queryKey || $[7] !== stored) {
|
|
518
|
-
t3 = (sectionId_0) => {
|
|
302
|
+
}, [stored]),
|
|
303
|
+
toggleSection: React.useCallback((sectionId) => {
|
|
519
304
|
const current = stored ?? {};
|
|
520
|
-
const isCurrentlyCollapsed = current[
|
|
305
|
+
const isCurrentlyCollapsed = current[sectionId] ?? false;
|
|
521
306
|
const next = {
|
|
522
307
|
...current,
|
|
523
|
-
[
|
|
308
|
+
[sectionId]: !isCurrentlyCollapsed
|
|
524
309
|
};
|
|
525
310
|
queryClient.setQueryData(queryKey, next);
|
|
526
311
|
persist(next);
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
let t4;
|
|
536
|
-
if ($[9] !== isLoading || $[10] !== isSectionCollapsed || $[11] !== toggleSection) {
|
|
537
|
-
t4 = {
|
|
538
|
-
isSectionCollapsed,
|
|
539
|
-
toggleSection,
|
|
540
|
-
isLoading
|
|
541
|
-
};
|
|
542
|
-
$[9] = isLoading;
|
|
543
|
-
$[10] = isSectionCollapsed;
|
|
544
|
-
$[11] = toggleSection;
|
|
545
|
-
$[12] = t4;
|
|
546
|
-
} else t4 = $[12];
|
|
547
|
-
return t4;
|
|
312
|
+
}, [
|
|
313
|
+
stored,
|
|
314
|
+
queryClient,
|
|
315
|
+
queryKey,
|
|
316
|
+
persist
|
|
317
|
+
]),
|
|
318
|
+
isLoading
|
|
319
|
+
};
|
|
548
320
|
}
|
|
549
|
-
function NavGroup(
|
|
550
|
-
const $ = c(26);
|
|
551
|
-
const { group, activeRoute, LinkComponent, renderNavItem, basePath, useActiveProps, isSectionCollapsed, toggleSection, depth: t1 } = t0;
|
|
552
|
-
const depth = t1 === void 0 ? 0 : t1;
|
|
321
|
+
function NavGroup({ group, activeRoute, LinkComponent, renderNavItem, basePath, useActiveProps, isSectionCollapsed, toggleSection, depth = 0 }) {
|
|
553
322
|
const isCollapsed = isSectionCollapsed(group.id, group.collapsible);
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
t2 = resolveText(group.label);
|
|
558
|
-
$[0] = group.label;
|
|
559
|
-
$[1] = resolveText;
|
|
560
|
-
$[2] = t2;
|
|
561
|
-
} else t2 = $[2];
|
|
562
|
-
const groupLabel = t2;
|
|
563
|
-
let t3;
|
|
564
|
-
if ($[3] !== group.items) {
|
|
565
|
-
t3 = group.items ?? [];
|
|
566
|
-
$[3] = group.items;
|
|
567
|
-
$[4] = t3;
|
|
568
|
-
} else t3 = $[4];
|
|
569
|
-
const items = t3;
|
|
570
|
-
let t4;
|
|
571
|
-
if ($[5] !== group.sections) {
|
|
572
|
-
t4 = group.sections ?? [];
|
|
573
|
-
$[5] = group.sections;
|
|
574
|
-
$[6] = t4;
|
|
575
|
-
} else t4 = $[6];
|
|
576
|
-
const sections = t4;
|
|
323
|
+
const groupLabel = useResolveText()(group.label);
|
|
324
|
+
const items = group.items ?? [];
|
|
325
|
+
const sections = group.sections ?? [];
|
|
577
326
|
const hasContent = items.length > 0 || sections.length > 0;
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
let t7;
|
|
609
|
-
if ($[7] !== LinkComponent || $[8] !== activeRoute || $[9] !== basePath || $[10] !== depth || $[11] !== group.id || $[12] !== groupLabel || $[13] !== hasContent || $[14] !== isCollapsed || $[15] !== isSectionCollapsed || $[16] !== items || $[17] !== renderNavItem || $[18] !== sections || $[19] !== toggleSection || $[20] !== useActiveProps) {
|
|
610
|
-
t7 = !isCollapsed && hasContent && /* @__PURE__ */ jsxs(SidebarGroupContent, {
|
|
327
|
+
return /* @__PURE__ */ jsxs(SidebarGroup, {
|
|
328
|
+
className: "qa-sidebar__group",
|
|
329
|
+
children: [groupLabel && /* @__PURE__ */ jsxs(SidebarGroupLabel, {
|
|
330
|
+
className: cn("qa-sidebar__group-label mt-2 gap-2 px-3", group.collapsible && "hover:text-sidebar-foreground cursor-pointer", depth > 0 && "pl-6"),
|
|
331
|
+
role: group.collapsible ? "button" : void 0,
|
|
332
|
+
tabIndex: group.collapsible ? 0 : void 0,
|
|
333
|
+
"aria-expanded": group.collapsible ? !isCollapsed : void 0,
|
|
334
|
+
onClick: group.collapsible && group.id ? () => toggleSection(group.id) : void 0,
|
|
335
|
+
onKeyDown: group.collapsible && group.id ? (e) => {
|
|
336
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
337
|
+
e.preventDefault();
|
|
338
|
+
toggleSection(group.id);
|
|
339
|
+
}
|
|
340
|
+
} : void 0,
|
|
341
|
+
children: [
|
|
342
|
+
group.icon && /* @__PURE__ */ jsx(RenderIcon, {
|
|
343
|
+
icon: group.icon,
|
|
344
|
+
className: "size-3.5"
|
|
345
|
+
}),
|
|
346
|
+
/* @__PURE__ */ jsx("span", {
|
|
347
|
+
className: "flex-1 text-left",
|
|
348
|
+
children: groupLabel
|
|
349
|
+
}),
|
|
350
|
+
group.collapsible && /* @__PURE__ */ jsx(Icon, {
|
|
351
|
+
icon: "ph:caret-down",
|
|
352
|
+
className: cn("size-3.5 transition-transform", isCollapsed && "-rotate-90"),
|
|
353
|
+
"aria-hidden": "true"
|
|
354
|
+
})
|
|
355
|
+
]
|
|
356
|
+
}), !isCollapsed && hasContent && /* @__PURE__ */ jsxs(SidebarGroupContent, {
|
|
611
357
|
className: cn(depth > 0 && "pl-3"),
|
|
612
358
|
children: [items.length > 0 && /* @__PURE__ */ jsx(SidebarMenu, { children: items.map((element, elementIndex) => {
|
|
613
359
|
if (!isNavigationItem(element)) return /* @__PURE__ */ jsx(SidebarSeparator, { className: "my-2" }, `${group.id ?? groupLabel ?? "group"}-divider-${elementIndex}`);
|
|
@@ -631,88 +377,31 @@ function NavGroup(t0) {
|
|
|
631
377
|
toggleSection,
|
|
632
378
|
depth: depth + 1
|
|
633
379
|
}, subSection.id))]
|
|
634
|
-
})
|
|
635
|
-
|
|
636
|
-
$[8] = activeRoute;
|
|
637
|
-
$[9] = basePath;
|
|
638
|
-
$[10] = depth;
|
|
639
|
-
$[11] = group.id;
|
|
640
|
-
$[12] = groupLabel;
|
|
641
|
-
$[13] = hasContent;
|
|
642
|
-
$[14] = isCollapsed;
|
|
643
|
-
$[15] = isSectionCollapsed;
|
|
644
|
-
$[16] = items;
|
|
645
|
-
$[17] = renderNavItem;
|
|
646
|
-
$[18] = sections;
|
|
647
|
-
$[19] = toggleSection;
|
|
648
|
-
$[20] = useActiveProps;
|
|
649
|
-
$[21] = t7;
|
|
650
|
-
} else t7 = $[21];
|
|
651
|
-
let t8;
|
|
652
|
-
if ($[22] !== T0 || $[23] !== t6 || $[24] !== t7) {
|
|
653
|
-
t8 = /* @__PURE__ */ jsxs(T0, {
|
|
654
|
-
className: t5,
|
|
655
|
-
children: [t6, t7]
|
|
656
|
-
});
|
|
657
|
-
$[22] = T0;
|
|
658
|
-
$[23] = t6;
|
|
659
|
-
$[24] = t7;
|
|
660
|
-
$[25] = t8;
|
|
661
|
-
} else t8 = $[25];
|
|
662
|
-
return t8;
|
|
380
|
+
})]
|
|
381
|
+
});
|
|
663
382
|
}
|
|
664
383
|
/**
|
|
665
384
|
* Loading skeleton for UserFooter
|
|
666
385
|
*/
|
|
667
|
-
function UserFooterSkeleton(
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
} else t3 = $[2];
|
|
682
|
-
let t4;
|
|
683
|
-
if ($[3] !== collapsed) {
|
|
684
|
-
t4 = !collapsed && /* @__PURE__ */ jsxs("div", {
|
|
685
|
-
className: "grid flex-1 gap-1",
|
|
686
|
-
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
687
|
-
variant: "text",
|
|
688
|
-
className: "h-3 w-24"
|
|
689
|
-
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
690
|
-
variant: "text",
|
|
691
|
-
className: "h-2 w-32"
|
|
386
|
+
function UserFooterSkeleton({ collapsed }) {
|
|
387
|
+
return /* @__PURE__ */ jsx(SidebarFooter, {
|
|
388
|
+
className: "border-sidebar-border border-t p-2",
|
|
389
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
390
|
+
className: cn("item-surface border-sidebar-border/40 flex items-center gap-2.5 p-2", collapsed && "justify-center"),
|
|
391
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-8 shrink-0" }), !collapsed && /* @__PURE__ */ jsxs("div", {
|
|
392
|
+
className: "grid flex-1 gap-1",
|
|
393
|
+
children: [/* @__PURE__ */ jsx(Skeleton, {
|
|
394
|
+
variant: "text",
|
|
395
|
+
className: "h-3 w-24"
|
|
396
|
+
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
397
|
+
variant: "text",
|
|
398
|
+
className: "h-2 w-32"
|
|
399
|
+
})]
|
|
692
400
|
})]
|
|
693
|
-
})
|
|
694
|
-
|
|
695
|
-
$[4] = t4;
|
|
696
|
-
} else t4 = $[4];
|
|
697
|
-
let t5;
|
|
698
|
-
if ($[5] !== t2 || $[6] !== t4) {
|
|
699
|
-
t5 = /* @__PURE__ */ jsx(SidebarFooter, {
|
|
700
|
-
className: "border-sidebar-border border-t p-2",
|
|
701
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
702
|
-
className: t2,
|
|
703
|
-
children: [t3, t4]
|
|
704
|
-
})
|
|
705
|
-
});
|
|
706
|
-
$[5] = t2;
|
|
707
|
-
$[6] = t4;
|
|
708
|
-
$[7] = t5;
|
|
709
|
-
} else t5 = $[7];
|
|
710
|
-
return t5;
|
|
401
|
+
})
|
|
402
|
+
});
|
|
711
403
|
}
|
|
712
|
-
function UserFooter(
|
|
713
|
-
const $ = c(109);
|
|
714
|
-
const { theme: t1, setTheme, showThemeToggle } = t0;
|
|
715
|
-
const theme = t1 === void 0 ? "system" : t1;
|
|
404
|
+
function UserFooter({ theme = "system", setTheme, showThemeToggle }) {
|
|
716
405
|
const { state, isMobile, setOpenMobile } = useSidebar();
|
|
717
406
|
const collapsed = state === "collapsed";
|
|
718
407
|
const authClient = useAuthClientSafe();
|
|
@@ -725,454 +414,198 @@ function UserFooter(t0) {
|
|
|
725
414
|
const localeConfig = admin.getLocale();
|
|
726
415
|
const uiLocales = i18nAdapter?.locales ?? localeConfig.supported ?? ["en"];
|
|
727
416
|
const hasMultipleUiLocales = uiLocales.length > 1;
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
label: getLocaleName(code)
|
|
733
|
-
});
|
|
734
|
-
$[0] = getLocaleName;
|
|
735
|
-
$[1] = t2;
|
|
736
|
-
} else t2 = $[1];
|
|
737
|
-
const uiLocaleOptions = uiLocales.map(t2);
|
|
417
|
+
const uiLocaleOptions = uiLocales.map((code) => ({
|
|
418
|
+
code,
|
|
419
|
+
label: getLocaleName(code)
|
|
420
|
+
}));
|
|
738
421
|
const contentLocales = useSafeContentLocales();
|
|
739
422
|
const contentLocale = useAdminStore(selectContentLocale);
|
|
740
423
|
const setContentLocale = useAdminStore(selectSetContentLocale);
|
|
741
424
|
const hasMultipleContentLocales = (contentLocales?.locales?.length ?? 0) > 1;
|
|
742
425
|
const shouldShowThemeToggle = !!setTheme && showThemeToggle !== false;
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
t3 = t("ui.themeLight");
|
|
746
|
-
$[2] = t;
|
|
747
|
-
$[3] = t3;
|
|
748
|
-
} else t3 = $[3];
|
|
749
|
-
let t4;
|
|
750
|
-
if ($[4] !== t3) {
|
|
751
|
-
t4 = {
|
|
426
|
+
const themeOptions = [
|
|
427
|
+
{
|
|
752
428
|
value: "light",
|
|
753
|
-
label:
|
|
429
|
+
label: t("ui.themeLight"),
|
|
754
430
|
icon: "ph:sun"
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
$[5] = t4;
|
|
758
|
-
} else t4 = $[5];
|
|
759
|
-
let t5;
|
|
760
|
-
if ($[6] !== t) {
|
|
761
|
-
t5 = t("ui.themeDark");
|
|
762
|
-
$[6] = t;
|
|
763
|
-
$[7] = t5;
|
|
764
|
-
} else t5 = $[7];
|
|
765
|
-
let t6;
|
|
766
|
-
if ($[8] !== t5) {
|
|
767
|
-
t6 = {
|
|
431
|
+
},
|
|
432
|
+
{
|
|
768
433
|
value: "dark",
|
|
769
|
-
label:
|
|
434
|
+
label: t("ui.themeDark"),
|
|
770
435
|
icon: "ph:moon"
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
$[9] = t6;
|
|
774
|
-
} else t6 = $[9];
|
|
775
|
-
let t7;
|
|
776
|
-
if ($[10] !== t) {
|
|
777
|
-
t7 = t("ui.themeSystem");
|
|
778
|
-
$[10] = t;
|
|
779
|
-
$[11] = t7;
|
|
780
|
-
} else t7 = $[11];
|
|
781
|
-
let t8;
|
|
782
|
-
if ($[12] !== t7) {
|
|
783
|
-
t8 = {
|
|
436
|
+
},
|
|
437
|
+
{
|
|
784
438
|
value: "system",
|
|
785
|
-
label:
|
|
439
|
+
label: t("ui.themeSystem"),
|
|
786
440
|
icon: "ph:monitor"
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
if ($[21] !== authClient || $[22] !== basePath || $[23] !== closeSidebarOnMobile || $[24] !== navigate || $[25] !== t) {
|
|
816
|
-
t11 = async () => {
|
|
817
|
-
if (!authClient) return;
|
|
818
|
-
try {
|
|
819
|
-
await authClient.signOut();
|
|
820
|
-
closeSidebarOnMobile();
|
|
821
|
-
navigate(`${basePath}/login`);
|
|
822
|
-
} catch (t12$1) {
|
|
823
|
-
toast.error(t("auth.logoutFailed"));
|
|
824
|
-
}
|
|
825
|
-
};
|
|
826
|
-
$[21] = authClient;
|
|
827
|
-
$[22] = basePath;
|
|
828
|
-
$[23] = closeSidebarOnMobile;
|
|
829
|
-
$[24] = navigate;
|
|
830
|
-
$[25] = t;
|
|
831
|
-
$[26] = t11;
|
|
832
|
-
} else t11 = $[26];
|
|
833
|
-
const handleLogout = t11;
|
|
834
|
-
let t12;
|
|
835
|
-
if ($[27] !== basePath || $[28] !== closeSidebarOnMobile || $[29] !== navigate || $[30] !== user) {
|
|
836
|
-
t12 = () => {
|
|
837
|
-
if (user?.id) {
|
|
838
|
-
closeSidebarOnMobile();
|
|
839
|
-
navigate(`${basePath}/collections/user/${user.id}`);
|
|
840
|
-
}
|
|
841
|
-
};
|
|
842
|
-
$[27] = basePath;
|
|
843
|
-
$[28] = closeSidebarOnMobile;
|
|
844
|
-
$[29] = navigate;
|
|
845
|
-
$[30] = user;
|
|
846
|
-
$[31] = t12;
|
|
847
|
-
} else t12 = $[31];
|
|
848
|
-
const handleMyAccount = t12;
|
|
849
|
-
if (isPending) {
|
|
850
|
-
let t13$1;
|
|
851
|
-
if ($[32] !== collapsed) {
|
|
852
|
-
t13$1 = /* @__PURE__ */ jsx(UserFooterSkeleton, { collapsed });
|
|
853
|
-
$[32] = collapsed;
|
|
854
|
-
$[33] = t13$1;
|
|
855
|
-
} else t13$1 = $[33];
|
|
856
|
-
return t13$1;
|
|
857
|
-
}
|
|
441
|
+
}
|
|
442
|
+
];
|
|
443
|
+
const closeSidebarOnMobile = React.useCallback(() => {
|
|
444
|
+
if (isMobile) setOpenMobile(false);
|
|
445
|
+
}, [isMobile, setOpenMobile]);
|
|
446
|
+
const handleLogout = React.useCallback(async () => {
|
|
447
|
+
if (!authClient) return;
|
|
448
|
+
try {
|
|
449
|
+
await authClient.signOut();
|
|
450
|
+
closeSidebarOnMobile();
|
|
451
|
+
navigate(`${basePath}/login`);
|
|
452
|
+
} catch (error) {
|
|
453
|
+
toast.error(t("auth.logoutFailed"));
|
|
454
|
+
}
|
|
455
|
+
}, [
|
|
456
|
+
authClient,
|
|
457
|
+
navigate,
|
|
458
|
+
basePath,
|
|
459
|
+
closeSidebarOnMobile,
|
|
460
|
+
t
|
|
461
|
+
]);
|
|
462
|
+
const handleMyAccount = () => {
|
|
463
|
+
if (user?.id) {
|
|
464
|
+
closeSidebarOnMobile();
|
|
465
|
+
navigate(`${basePath}/collections/user/${user.id}`);
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
if (isPending) return /* @__PURE__ */ jsx(UserFooterSkeleton, { collapsed });
|
|
858
469
|
if (!authClient || !user) return null;
|
|
859
|
-
|
|
860
|
-
if ($[34] !== user.email || $[35] !== user.name) {
|
|
861
|
-
t13 = user.name || user.email?.split("@")[0] || "User";
|
|
862
|
-
$[34] = user.email;
|
|
863
|
-
$[35] = user.name;
|
|
864
|
-
$[36] = t13;
|
|
865
|
-
} else t13 = $[36];
|
|
866
|
-
const displayName = t13;
|
|
470
|
+
const displayName = user.name || user.email?.split("@")[0] || "User";
|
|
867
471
|
const displayEmail = user.email || "";
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
let t17;
|
|
881
|
-
if ($[39] !== user.image) {
|
|
882
|
-
t17 = /* @__PURE__ */ jsx("div", {
|
|
883
|
-
className: "qa-sidebar__user-avatar border-sidebar-border bg-sidebar-accent text-sidebar-accent-foreground flex size-8 shrink-0 items-center justify-center rounded-md border",
|
|
884
|
-
children: user.image ? /* @__PURE__ */ jsx("img", {
|
|
885
|
-
src: user.image,
|
|
886
|
-
alt: "",
|
|
887
|
-
className: "image-outline size-full rounded-md object-cover"
|
|
888
|
-
}) : /* @__PURE__ */ jsx(Icon, {
|
|
889
|
-
icon: "ph:user-bold",
|
|
890
|
-
className: "size-4"
|
|
891
|
-
})
|
|
892
|
-
});
|
|
893
|
-
$[39] = user.image;
|
|
894
|
-
$[40] = t17;
|
|
895
|
-
} else t17 = $[40];
|
|
896
|
-
let t18;
|
|
897
|
-
if ($[41] !== collapsed || $[42] !== displayEmail || $[43] !== displayName) {
|
|
898
|
-
t18 = !collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
899
|
-
className: "grid flex-1 text-left leading-tight",
|
|
900
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
901
|
-
className: "qa-sidebar__user-name truncate text-sm font-medium",
|
|
902
|
-
children: displayName
|
|
903
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
904
|
-
className: "qa-sidebar__user-email text-sidebar-foreground/55 truncate text-xs",
|
|
905
|
-
children: displayEmail
|
|
906
|
-
})]
|
|
907
|
-
}), /* @__PURE__ */ jsx(Icon, {
|
|
908
|
-
icon: "ph:caret-up-down",
|
|
909
|
-
className: "text-sidebar-foreground/60 ml-auto size-3.5",
|
|
910
|
-
"aria-hidden": "true"
|
|
911
|
-
})] });
|
|
912
|
-
$[41] = collapsed;
|
|
913
|
-
$[42] = displayEmail;
|
|
914
|
-
$[43] = displayName;
|
|
915
|
-
$[44] = t18;
|
|
916
|
-
} else t18 = $[44];
|
|
917
|
-
let t19;
|
|
918
|
-
if ($[45] !== t16 || $[46] !== t17 || $[47] !== t18) {
|
|
919
|
-
t19 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
920
|
-
className: t16,
|
|
921
|
-
children: [t17, t18]
|
|
922
|
-
});
|
|
923
|
-
$[45] = t16;
|
|
924
|
-
$[46] = t17;
|
|
925
|
-
$[47] = t18;
|
|
926
|
-
$[48] = t19;
|
|
927
|
-
} else t19 = $[48];
|
|
928
|
-
const T4 = DropdownMenuContent;
|
|
929
|
-
const t20 = collapsed ? "right" : "top";
|
|
930
|
-
const t21 = collapsed ? "start" : "start";
|
|
931
|
-
const t22 = "w-56";
|
|
932
|
-
let t23;
|
|
933
|
-
if ($[49] !== displayName) {
|
|
934
|
-
t23 = /* @__PURE__ */ jsx("p", {
|
|
935
|
-
className: "text-sm font-medium",
|
|
936
|
-
children: displayName
|
|
937
|
-
});
|
|
938
|
-
$[49] = displayName;
|
|
939
|
-
$[50] = t23;
|
|
940
|
-
} else t23 = $[50];
|
|
941
|
-
let t24;
|
|
942
|
-
if ($[51] !== displayEmail) {
|
|
943
|
-
t24 = /* @__PURE__ */ jsx("p", {
|
|
944
|
-
className: "text-muted-foreground text-xs",
|
|
945
|
-
children: displayEmail
|
|
946
|
-
});
|
|
947
|
-
$[51] = displayEmail;
|
|
948
|
-
$[52] = t24;
|
|
949
|
-
} else t24 = $[52];
|
|
950
|
-
let t25;
|
|
951
|
-
if ($[53] !== user.role) {
|
|
952
|
-
t25 = user.role && /* @__PURE__ */ jsx("p", {
|
|
953
|
-
className: "text-muted-foreground mt-0.5 text-xs capitalize",
|
|
954
|
-
children: user.role
|
|
955
|
-
});
|
|
956
|
-
$[53] = user.role;
|
|
957
|
-
$[54] = t25;
|
|
958
|
-
} else t25 = $[54];
|
|
959
|
-
let t26;
|
|
960
|
-
if ($[55] !== t23 || $[56] !== t24 || $[57] !== t25) {
|
|
961
|
-
t26 = /* @__PURE__ */ jsxs("div", {
|
|
962
|
-
className: "px-2 py-1.5",
|
|
963
|
-
children: [
|
|
964
|
-
t23,
|
|
965
|
-
t24,
|
|
966
|
-
t25
|
|
967
|
-
]
|
|
968
|
-
});
|
|
969
|
-
$[55] = t23;
|
|
970
|
-
$[56] = t24;
|
|
971
|
-
$[57] = t25;
|
|
972
|
-
$[58] = t26;
|
|
973
|
-
} else t26 = $[58];
|
|
974
|
-
let t27;
|
|
975
|
-
if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
|
|
976
|
-
t27 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
|
|
977
|
-
$[59] = t27;
|
|
978
|
-
} else t27 = $[59];
|
|
979
|
-
let t28;
|
|
980
|
-
if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
|
|
981
|
-
t28 = /* @__PURE__ */ jsx(Icon, {
|
|
982
|
-
icon: "ph:user-circle",
|
|
983
|
-
className: "size-4"
|
|
984
|
-
});
|
|
985
|
-
$[60] = t28;
|
|
986
|
-
} else t28 = $[60];
|
|
987
|
-
let t29;
|
|
988
|
-
if ($[61] !== t) {
|
|
989
|
-
t29 = t("auth.myAccount");
|
|
990
|
-
$[61] = t;
|
|
991
|
-
$[62] = t29;
|
|
992
|
-
} else t29 = $[62];
|
|
993
|
-
let t30;
|
|
994
|
-
if ($[63] !== handleMyAccount || $[64] !== t29) {
|
|
995
|
-
t30 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
996
|
-
onClick: handleMyAccount,
|
|
997
|
-
children: [t28, t29]
|
|
998
|
-
});
|
|
999
|
-
$[63] = handleMyAccount;
|
|
1000
|
-
$[64] = t29;
|
|
1001
|
-
$[65] = t30;
|
|
1002
|
-
} else t30 = $[65];
|
|
1003
|
-
let t31;
|
|
1004
|
-
if ($[66] !== setTheme || $[67] !== shouldShowThemeToggle || $[68] !== t || $[69] !== theme || $[70] !== themeOptions) {
|
|
1005
|
-
t31 = shouldShowThemeToggle && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:circle-half" }), t("ui.toggleTheme")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: themeOptions.map((option) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
1006
|
-
onClick: () => setTheme(option.value),
|
|
1007
|
-
children: [
|
|
1008
|
-
/* @__PURE__ */ jsx(Icon, {
|
|
1009
|
-
icon: option.icon,
|
|
472
|
+
return /* @__PURE__ */ jsx(SidebarFooter, {
|
|
473
|
+
className: "qa-sidebar__footer border-sidebar-border/70 border-t p-2",
|
|
474
|
+
children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
475
|
+
className: cn("qa-sidebar__user-trigger flex w-full items-center gap-2.5 rounded-md p-2 text-left transition-[background-color,color,transform] duration-150 ease-out active:scale-[0.96]", "hover:bg-sidebar-accent text-sidebar-foreground", "focus-visible:ring-sidebar-ring focus-visible:ring-1 focus-visible:outline-none", collapsed && "justify-center"),
|
|
476
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
477
|
+
className: "qa-sidebar__user-avatar border-sidebar-border bg-sidebar-accent text-sidebar-accent-foreground flex size-8 shrink-0 items-center justify-center rounded-md border",
|
|
478
|
+
children: user.image ? /* @__PURE__ */ jsx("img", {
|
|
479
|
+
src: user.image,
|
|
480
|
+
alt: "",
|
|
481
|
+
className: "image-outline size-full rounded-md object-cover"
|
|
482
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
483
|
+
icon: "ph:user-bold",
|
|
1010
484
|
className: "size-4"
|
|
1011
|
-
}),
|
|
1012
|
-
/* @__PURE__ */ jsx("span", {
|
|
1013
|
-
className: "flex-1",
|
|
1014
|
-
children: option.label
|
|
1015
|
-
}),
|
|
1016
|
-
theme === option.value && /* @__PURE__ */ jsx(Icon, {
|
|
1017
|
-
icon: "ph:check",
|
|
1018
|
-
className: "text-foreground size-4"
|
|
1019
485
|
})
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
/* @__PURE__ */ jsx("span", {
|
|
1039
|
-
className: "font-chrome chrome-meta w-6 text-xs font-medium",
|
|
1040
|
-
children: locale.code
|
|
1041
|
-
}),
|
|
1042
|
-
/* @__PURE__ */ jsx("span", {
|
|
1043
|
-
className: "flex-1",
|
|
1044
|
-
children: locale.label
|
|
1045
|
-
}),
|
|
1046
|
-
locale.code === uiLocale && /* @__PURE__ */ jsx(Icon, {
|
|
1047
|
-
icon: "ph:check",
|
|
1048
|
-
className: "text-foreground size-4"
|
|
1049
|
-
})
|
|
1050
|
-
]
|
|
1051
|
-
}, locale.code)) })] });
|
|
1052
|
-
let t33;
|
|
1053
|
-
if ($[72] !== contentLocale || $[73] !== contentLocales || $[74] !== hasMultipleContentLocales || $[75] !== setContentLocale || $[76] !== t) {
|
|
1054
|
-
t33 = hasMultipleContentLocales && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:translate" }), t("locale.contentLanguage")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: contentLocales.locales.map((locale_0) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
1055
|
-
onClick: () => setContentLocale(locale_0.code),
|
|
486
|
+
}), !collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
487
|
+
className: "grid flex-1 text-left leading-tight",
|
|
488
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
489
|
+
className: "qa-sidebar__user-name truncate text-sm font-medium",
|
|
490
|
+
children: displayName
|
|
491
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
492
|
+
className: "qa-sidebar__user-email text-sidebar-foreground/55 truncate text-xs",
|
|
493
|
+
children: displayEmail
|
|
494
|
+
})]
|
|
495
|
+
}), /* @__PURE__ */ jsx(Icon, {
|
|
496
|
+
icon: "ph:caret-up-down",
|
|
497
|
+
className: "text-sidebar-foreground/60 ml-auto size-3.5",
|
|
498
|
+
"aria-hidden": "true"
|
|
499
|
+
})] })]
|
|
500
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
501
|
+
side: collapsed ? "right" : "top",
|
|
502
|
+
align: collapsed ? "start" : "start",
|
|
503
|
+
className: "w-56",
|
|
1056
504
|
children: [
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
505
|
+
/* @__PURE__ */ jsxs("div", {
|
|
506
|
+
className: "px-2 py-1.5",
|
|
507
|
+
children: [
|
|
508
|
+
/* @__PURE__ */ jsx("p", {
|
|
509
|
+
className: "text-sm font-medium",
|
|
510
|
+
children: displayName
|
|
511
|
+
}),
|
|
512
|
+
/* @__PURE__ */ jsx("p", {
|
|
513
|
+
className: "text-muted-foreground text-xs",
|
|
514
|
+
children: displayEmail
|
|
515
|
+
}),
|
|
516
|
+
user.role && /* @__PURE__ */ jsx("p", {
|
|
517
|
+
className: "text-muted-foreground mt-0.5 text-xs capitalize",
|
|
518
|
+
children: user.role
|
|
519
|
+
})
|
|
520
|
+
]
|
|
1062
521
|
}),
|
|
1063
|
-
/* @__PURE__ */ jsx(
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
522
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
523
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
524
|
+
onClick: handleMyAccount,
|
|
525
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
526
|
+
icon: "ph:user-circle",
|
|
527
|
+
className: "size-4"
|
|
528
|
+
}), t("auth.myAccount")]
|
|
1070
529
|
}),
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
530
|
+
shouldShowThemeToggle && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:circle-half" }), t("ui.toggleTheme")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: themeOptions.map((option) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
531
|
+
onClick: () => setTheme(option.value),
|
|
532
|
+
children: [
|
|
533
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
534
|
+
icon: option.icon,
|
|
535
|
+
className: "size-4"
|
|
536
|
+
}),
|
|
537
|
+
/* @__PURE__ */ jsx("span", {
|
|
538
|
+
className: "flex-1",
|
|
539
|
+
children: option.label
|
|
540
|
+
}),
|
|
541
|
+
theme === option.value && /* @__PURE__ */ jsx(Icon, {
|
|
542
|
+
icon: "ph:check",
|
|
543
|
+
className: "text-foreground size-4"
|
|
544
|
+
})
|
|
545
|
+
]
|
|
546
|
+
}, option.value)) })] }),
|
|
547
|
+
hasMultipleUiLocales && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:globe" }), t("locale.uiLanguage")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: uiLocaleOptions.map((locale) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
548
|
+
onClick: () => setUiLocale(locale.code),
|
|
549
|
+
children: [
|
|
550
|
+
/* @__PURE__ */ jsx("img", {
|
|
551
|
+
src: getFlagUrl(locale.code),
|
|
552
|
+
alt: locale.code,
|
|
553
|
+
className: "image-outline h-3 w-4 object-cover",
|
|
554
|
+
onError: (e) => {
|
|
555
|
+
e.currentTarget.style.display = "none";
|
|
556
|
+
}
|
|
557
|
+
}),
|
|
558
|
+
/* @__PURE__ */ jsx("span", {
|
|
559
|
+
className: "font-chrome chrome-meta w-6 text-xs font-medium",
|
|
560
|
+
children: locale.code
|
|
561
|
+
}),
|
|
562
|
+
/* @__PURE__ */ jsx("span", {
|
|
563
|
+
className: "flex-1",
|
|
564
|
+
children: locale.label
|
|
565
|
+
}),
|
|
566
|
+
locale.code === uiLocale && /* @__PURE__ */ jsx(Icon, {
|
|
567
|
+
icon: "ph:check",
|
|
568
|
+
className: "text-foreground size-4"
|
|
569
|
+
})
|
|
570
|
+
]
|
|
571
|
+
}, locale.code)) })] }),
|
|
572
|
+
hasMultipleContentLocales && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:translate" }), t("locale.contentLanguage")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: contentLocales.locales.map((locale) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
573
|
+
onClick: () => setContentLocale(locale.code),
|
|
574
|
+
children: [
|
|
575
|
+
/* @__PURE__ */ jsx("img", {
|
|
576
|
+
src: getFlagUrl(locale.flagCountryCode ?? locale.code),
|
|
577
|
+
alt: locale.code,
|
|
578
|
+
className: "image-outline h-3 w-4 object-cover",
|
|
579
|
+
onError: (e) => {
|
|
580
|
+
e.currentTarget.style.display = "none";
|
|
581
|
+
}
|
|
582
|
+
}),
|
|
583
|
+
/* @__PURE__ */ jsx("span", {
|
|
584
|
+
className: "font-chrome chrome-meta w-6 text-xs font-medium",
|
|
585
|
+
children: locale.code
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ jsx("span", {
|
|
588
|
+
className: "flex-1",
|
|
589
|
+
children: locale.label ?? locale.code
|
|
590
|
+
}),
|
|
591
|
+
locale.code === contentLocale && /* @__PURE__ */ jsx(Icon, {
|
|
592
|
+
icon: "ph:check",
|
|
593
|
+
className: "text-foreground size-4"
|
|
594
|
+
})
|
|
595
|
+
]
|
|
596
|
+
}, locale.code)) })] }),
|
|
597
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
598
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
599
|
+
variant: "destructive",
|
|
600
|
+
onClick: handleLogout,
|
|
601
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
602
|
+
icon: "ph:sign-out",
|
|
603
|
+
className: "size-4"
|
|
604
|
+
}), t("auth.logout")]
|
|
1074
605
|
})
|
|
1075
606
|
]
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
$[73] = contentLocales;
|
|
1079
|
-
$[74] = hasMultipleContentLocales;
|
|
1080
|
-
$[75] = setContentLocale;
|
|
1081
|
-
$[76] = t;
|
|
1082
|
-
$[77] = t33;
|
|
1083
|
-
} else t33 = $[77];
|
|
1084
|
-
let t34;
|
|
1085
|
-
if ($[78] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1086
|
-
t34 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
|
|
1087
|
-
$[78] = t34;
|
|
1088
|
-
} else t34 = $[78];
|
|
1089
|
-
let t35;
|
|
1090
|
-
if ($[79] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1091
|
-
t35 = /* @__PURE__ */ jsx(Icon, {
|
|
1092
|
-
icon: "ph:sign-out",
|
|
1093
|
-
className: "size-4"
|
|
1094
|
-
});
|
|
1095
|
-
$[79] = t35;
|
|
1096
|
-
} else t35 = $[79];
|
|
1097
|
-
let t36;
|
|
1098
|
-
if ($[80] !== t) {
|
|
1099
|
-
t36 = t("auth.logout");
|
|
1100
|
-
$[80] = t;
|
|
1101
|
-
$[81] = t36;
|
|
1102
|
-
} else t36 = $[81];
|
|
1103
|
-
let t37;
|
|
1104
|
-
if ($[82] !== handleLogout || $[83] !== t36) {
|
|
1105
|
-
t37 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
1106
|
-
variant: "destructive",
|
|
1107
|
-
onClick: handleLogout,
|
|
1108
|
-
children: [t35, t36]
|
|
1109
|
-
});
|
|
1110
|
-
$[82] = handleLogout;
|
|
1111
|
-
$[83] = t36;
|
|
1112
|
-
$[84] = t37;
|
|
1113
|
-
} else t37 = $[84];
|
|
1114
|
-
let t38;
|
|
1115
|
-
if ($[85] !== T4 || $[86] !== t20 || $[87] !== t21 || $[88] !== t26 || $[89] !== t27 || $[90] !== t30 || $[91] !== t31 || $[92] !== t32 || $[93] !== t33 || $[94] !== t37) {
|
|
1116
|
-
t38 = /* @__PURE__ */ jsxs(T4, {
|
|
1117
|
-
side: t20,
|
|
1118
|
-
align: t21,
|
|
1119
|
-
className: t22,
|
|
1120
|
-
children: [
|
|
1121
|
-
t26,
|
|
1122
|
-
t27,
|
|
1123
|
-
t30,
|
|
1124
|
-
t31,
|
|
1125
|
-
t32,
|
|
1126
|
-
t33,
|
|
1127
|
-
t34,
|
|
1128
|
-
t37
|
|
1129
|
-
]
|
|
1130
|
-
});
|
|
1131
|
-
$[85] = T4;
|
|
1132
|
-
$[86] = t20;
|
|
1133
|
-
$[87] = t21;
|
|
1134
|
-
$[88] = t26;
|
|
1135
|
-
$[89] = t27;
|
|
1136
|
-
$[90] = t30;
|
|
1137
|
-
$[91] = t31;
|
|
1138
|
-
$[92] = t32;
|
|
1139
|
-
$[93] = t33;
|
|
1140
|
-
$[94] = t37;
|
|
1141
|
-
$[95] = t38;
|
|
1142
|
-
} else t38 = $[95];
|
|
1143
|
-
let t39;
|
|
1144
|
-
if ($[96] !== T3 || $[97] !== t19 || $[98] !== t38) {
|
|
1145
|
-
t39 = /* @__PURE__ */ jsxs(T3, { children: [t19, t38] });
|
|
1146
|
-
$[96] = T3;
|
|
1147
|
-
$[97] = t19;
|
|
1148
|
-
$[98] = t38;
|
|
1149
|
-
$[99] = t39;
|
|
1150
|
-
} else t39 = $[99];
|
|
1151
|
-
let t40;
|
|
1152
|
-
if ($[100] !== T2 || $[101] !== t39) {
|
|
1153
|
-
t40 = /* @__PURE__ */ jsx(T2, { children: t39 });
|
|
1154
|
-
$[100] = T2;
|
|
1155
|
-
$[101] = t39;
|
|
1156
|
-
$[102] = t40;
|
|
1157
|
-
} else t40 = $[102];
|
|
1158
|
-
let t41;
|
|
1159
|
-
if ($[103] !== T1 || $[104] !== t40) {
|
|
1160
|
-
t41 = /* @__PURE__ */ jsx(T1, { children: t40 });
|
|
1161
|
-
$[103] = T1;
|
|
1162
|
-
$[104] = t40;
|
|
1163
|
-
$[105] = t41;
|
|
1164
|
-
} else t41 = $[105];
|
|
1165
|
-
let t42;
|
|
1166
|
-
if ($[106] !== T0 || $[107] !== t41) {
|
|
1167
|
-
t42 = /* @__PURE__ */ jsx(T0, {
|
|
1168
|
-
className: t14,
|
|
1169
|
-
children: t41
|
|
1170
|
-
});
|
|
1171
|
-
$[106] = T0;
|
|
1172
|
-
$[107] = t41;
|
|
1173
|
-
$[108] = t42;
|
|
1174
|
-
} else t42 = $[108];
|
|
1175
|
-
return t42;
|
|
607
|
+
})] }) }) })
|
|
608
|
+
});
|
|
1176
609
|
}
|
|
1177
610
|
/**
|
|
1178
611
|
* AdminSidebar Component
|
|
@@ -1199,137 +632,56 @@ function UserFooter(t0) {
|
|
|
1199
632
|
* </SidebarProvider>
|
|
1200
633
|
* ```
|
|
1201
634
|
*/
|
|
1202
|
-
function
|
|
1203
|
-
|
|
1204
|
-
}
|
|
1205
|
-
function _temp6(e) {
|
|
1206
|
-
e.currentTarget.style.display = "none";
|
|
1207
|
-
}
|
|
1208
|
-
function AdminSidebar(t0) {
|
|
1209
|
-
const $ = c(99);
|
|
1210
|
-
const { LinkComponent, activeRoute, basePath: t1, brandName: brandNameProp, className, renderBrand, renderNavItem, footer, onSearchOpen, afterBrand, beforeFooter, theme, setTheme, showThemeToggle, useActiveProps: t2 } = t0;
|
|
1211
|
-
const basePath = t1 === void 0 ? "/admin" : t1;
|
|
1212
|
-
const useActiveProps = t2 === void 0 ? true : t2;
|
|
1213
|
-
let t3;
|
|
1214
|
-
if ($[0] !== brandNameProp) {
|
|
1215
|
-
t3 = { brandName: brandNameProp };
|
|
1216
|
-
$[0] = brandNameProp;
|
|
1217
|
-
$[1] = t3;
|
|
1218
|
-
} else t3 = $[1];
|
|
1219
|
-
const { navigation, brandName, brandLogo } = useSidebarProps(t3);
|
|
635
|
+
function AdminSidebar({ LinkComponent, activeRoute, basePath = "/admin", brandName: brandNameProp, className, renderBrand, renderNavItem, footer, onSearchOpen, afterBrand, beforeFooter, theme, setTheme, showThemeToggle, useActiveProps = true }) {
|
|
636
|
+
const { navigation, brandName, brandLogo } = useSidebarProps({ brandName: brandNameProp });
|
|
1220
637
|
const { t } = useTranslation();
|
|
1221
638
|
const { state, isMobile, setOpenMobile, toggleSidebar } = useSidebar();
|
|
1222
639
|
const collapsed = state === "collapsed";
|
|
1223
640
|
const currentActiveRoute = activeRoute ?? (typeof window !== "undefined" ? window.location.pathname : void 0);
|
|
1224
641
|
const { isSectionCollapsed, toggleSection } = useSidebarCollapsedSections();
|
|
1225
642
|
const admin = useAdminStoreRaw()?.getState().admin;
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
} else t7 = $[9];
|
|
1253
|
-
const effectiveRenderNavItem = t7;
|
|
1254
|
-
let t8;
|
|
1255
|
-
if ($[10] !== isMobile || $[11] !== setOpenMobile) {
|
|
1256
|
-
t8 = () => {
|
|
1257
|
-
if (isMobile) setOpenMobile(false);
|
|
1258
|
-
};
|
|
1259
|
-
$[10] = isMobile;
|
|
1260
|
-
$[11] = setOpenMobile;
|
|
1261
|
-
$[12] = t8;
|
|
1262
|
-
} else t8 = $[12];
|
|
1263
|
-
const handleBrandClick = t8;
|
|
1264
|
-
let t9;
|
|
1265
|
-
if ($[13] !== brandLogo || $[14] !== brandName) {
|
|
1266
|
-
t9 = (isCollapsed) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BrandLogoMark, {
|
|
1267
|
-
logo: brandLogo,
|
|
1268
|
-
alt: brandName,
|
|
1269
|
-
fallback: /* @__PURE__ */ jsx(QuestpieSymbol, {})
|
|
1270
|
-
}), !isCollapsed && /* @__PURE__ */ jsx("div", {
|
|
1271
|
-
className: "grid flex-1 text-left leading-tight",
|
|
1272
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
1273
|
-
className: "qa-sidebar__brand-name font-chrome truncate text-sm font-medium",
|
|
1274
|
-
children: brandName
|
|
643
|
+
const { Component: BrandOverride } = useLazyComponent(admin?.getComponent("adminSidebarBrand"), { allowDynamicImportLoaders: false });
|
|
644
|
+
const { Component: NavItemOverride } = useLazyComponent(admin?.getComponent("adminSidebarNavItem"), { allowDynamicImportLoaders: false });
|
|
645
|
+
const effectiveRenderBrand = React.useMemo(() => renderBrand ?? (BrandOverride ? (props) => /* @__PURE__ */ jsx(BrandOverride, { ...props }) : void 0), [BrandOverride, renderBrand]);
|
|
646
|
+
const effectiveRenderNavItem = React.useMemo(() => renderNavItem ?? (NavItemOverride ? (props) => /* @__PURE__ */ jsx(NavItemOverride, { ...props }) : void 0), [NavItemOverride, renderNavItem]);
|
|
647
|
+
const handleBrandClick = React.useCallback(() => {
|
|
648
|
+
if (isMobile) setOpenMobile(false);
|
|
649
|
+
}, [isMobile, setOpenMobile]);
|
|
650
|
+
const renderBuiltInBrand = React.useCallback((isCollapsed) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BrandLogoMark, {
|
|
651
|
+
logo: brandLogo,
|
|
652
|
+
alt: brandName,
|
|
653
|
+
fallback: /* @__PURE__ */ jsx(QuestpieSymbol, {})
|
|
654
|
+
}), !isCollapsed && /* @__PURE__ */ jsx("div", {
|
|
655
|
+
className: "grid flex-1 text-left leading-tight",
|
|
656
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
657
|
+
className: "qa-sidebar__brand-name font-chrome truncate text-sm font-medium",
|
|
658
|
+
children: brandName
|
|
659
|
+
})
|
|
660
|
+
})] }), [brandLogo, brandName]);
|
|
661
|
+
const renderBrandContent = React.useCallback((isCollapsed) => {
|
|
662
|
+
const builtInBrand = renderBuiltInBrand(isCollapsed);
|
|
663
|
+
if (!effectiveRenderBrand) return builtInBrand;
|
|
664
|
+
return /* @__PURE__ */ jsx(React.Suspense, {
|
|
665
|
+
fallback: builtInBrand,
|
|
666
|
+
children: effectiveRenderBrand({
|
|
667
|
+
name: brandName,
|
|
668
|
+
collapsed: isCollapsed
|
|
1275
669
|
})
|
|
1276
|
-
})] });
|
|
1277
|
-
$[13] = brandLogo;
|
|
1278
|
-
$[14] = brandName;
|
|
1279
|
-
$[15] = t9;
|
|
1280
|
-
} else t9 = $[15];
|
|
1281
|
-
const renderBuiltInBrand = t9;
|
|
1282
|
-
let t10;
|
|
1283
|
-
if ($[16] !== brandName || $[17] !== effectiveRenderBrand || $[18] !== renderBuiltInBrand) {
|
|
1284
|
-
t10 = (isCollapsed_0) => {
|
|
1285
|
-
const builtInBrand = renderBuiltInBrand(isCollapsed_0);
|
|
1286
|
-
if (!effectiveRenderBrand) return builtInBrand;
|
|
1287
|
-
return /* @__PURE__ */ jsx(React.Suspense, {
|
|
1288
|
-
fallback: builtInBrand,
|
|
1289
|
-
children: effectiveRenderBrand({
|
|
1290
|
-
name: brandName,
|
|
1291
|
-
collapsed: isCollapsed_0
|
|
1292
|
-
})
|
|
1293
|
-
});
|
|
1294
|
-
};
|
|
1295
|
-
$[16] = brandName;
|
|
1296
|
-
$[17] = effectiveRenderBrand;
|
|
1297
|
-
$[18] = renderBuiltInBrand;
|
|
1298
|
-
$[19] = t10;
|
|
1299
|
-
} else t10 = $[19];
|
|
1300
|
-
const renderBrandContent = t10;
|
|
1301
|
-
let t11;
|
|
1302
|
-
if ($[20] !== collapsed || $[21] !== renderBrandContent) {
|
|
1303
|
-
t11 = renderBrandContent(collapsed);
|
|
1304
|
-
$[20] = collapsed;
|
|
1305
|
-
$[21] = renderBrandContent;
|
|
1306
|
-
$[22] = t11;
|
|
1307
|
-
} else t11 = $[22];
|
|
1308
|
-
const brandContent = t11;
|
|
1309
|
-
const t12 = collapsed && "justify-center";
|
|
1310
|
-
let t13;
|
|
1311
|
-
if ($[23] !== t12) {
|
|
1312
|
-
t13 = cn("qa-sidebar__brand flex items-center gap-2 rounded-md p-2 transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "hover:bg-sidebar-accent", t12);
|
|
1313
|
-
$[23] = t12;
|
|
1314
|
-
$[24] = t13;
|
|
1315
|
-
} else t13 = $[24];
|
|
1316
|
-
let t14;
|
|
1317
|
-
if ($[25] !== LinkComponent || $[26] !== basePath || $[27] !== brandContent || $[28] !== t13) {
|
|
1318
|
-
t14 = /* @__PURE__ */ jsx(LinkComponent, {
|
|
1319
|
-
to: basePath,
|
|
1320
|
-
className: t13,
|
|
1321
|
-
children: brandContent
|
|
1322
670
|
});
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
const brandLink =
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
671
|
+
}, [
|
|
672
|
+
brandName,
|
|
673
|
+
effectiveRenderBrand,
|
|
674
|
+
renderBuiltInBrand
|
|
675
|
+
]);
|
|
676
|
+
const brandContent = renderBrandContent(collapsed);
|
|
677
|
+
const brandLink = /* @__PURE__ */ jsx(LinkComponent, {
|
|
678
|
+
to: basePath,
|
|
679
|
+
className: cn("qa-sidebar__brand flex items-center gap-2 rounded-md p-2 transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "hover:bg-sidebar-accent", collapsed && "justify-center"),
|
|
680
|
+
children: brandContent
|
|
681
|
+
});
|
|
682
|
+
const sidebarActions = /* @__PURE__ */ jsxs("div", {
|
|
683
|
+
className: "qa-sidebar__header-actions flex shrink-0 items-center gap-1",
|
|
684
|
+
children: [onSearchOpen && /* @__PURE__ */ jsx(Button, {
|
|
1333
685
|
type: "button",
|
|
1334
686
|
variant: "ghost",
|
|
1335
687
|
size: "icon-xs",
|
|
@@ -1338,223 +690,89 @@ function AdminSidebar(t0) {
|
|
|
1338
690
|
title: t("common.search"),
|
|
1339
691
|
"aria-label": t("common.search"),
|
|
1340
692
|
children: /* @__PURE__ */ jsx(Icon, { icon: "ph:magnifying-glass" })
|
|
1341
|
-
})
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
if ($[38] !== LinkComponent || $[39] !== basePath || $[40] !== brandLink || $[41] !== brandName || $[42] !== collapsed || $[43] !== isMobile || $[44] !== renderBrandContent) {
|
|
1369
|
-
t19 = collapsed && !isMobile ? /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(LinkComponent, {
|
|
1370
|
-
to: basePath,
|
|
1371
|
-
className: cn("flex items-center gap-2 rounded-md p-2 transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "hover:bg-sidebar-accent", "justify-center"),
|
|
1372
|
-
children: renderBrandContent(true)
|
|
1373
|
-
}) }), /* @__PURE__ */ jsx(TooltipContent, {
|
|
1374
|
-
side: "right",
|
|
1375
|
-
children: brandName
|
|
1376
|
-
})] }) : brandLink;
|
|
1377
|
-
$[38] = LinkComponent;
|
|
1378
|
-
$[39] = basePath;
|
|
1379
|
-
$[40] = brandLink;
|
|
1380
|
-
$[41] = brandName;
|
|
1381
|
-
$[42] = collapsed;
|
|
1382
|
-
$[43] = isMobile;
|
|
1383
|
-
$[44] = renderBrandContent;
|
|
1384
|
-
$[45] = t19;
|
|
1385
|
-
} else t19 = $[45];
|
|
1386
|
-
let t20;
|
|
1387
|
-
if ($[46] !== handleBrandClick || $[47] !== t19) {
|
|
1388
|
-
t20 = /* @__PURE__ */ jsx(SidebarMenu, {
|
|
1389
|
-
className: "min-w-0 flex-1",
|
|
1390
|
-
children: /* @__PURE__ */ jsx(SidebarMenuItem, {
|
|
1391
|
-
onClickCapture: handleBrandClick,
|
|
1392
|
-
children: t19
|
|
1393
|
-
})
|
|
1394
|
-
});
|
|
1395
|
-
$[46] = handleBrandClick;
|
|
1396
|
-
$[47] = t19;
|
|
1397
|
-
$[48] = t20;
|
|
1398
|
-
} else t20 = $[48];
|
|
1399
|
-
const t21 = !collapsed && sidebarActions;
|
|
1400
|
-
let t22;
|
|
1401
|
-
if ($[49] !== t20 || $[50] !== t21) {
|
|
1402
|
-
t22 = /* @__PURE__ */ jsxs(SidebarHeader, {
|
|
1403
|
-
className: "qa-sidebar__header h-auto flex-row items-center gap-2 border-none px-3 pt-3 pb-1",
|
|
1404
|
-
children: [t20, t21]
|
|
1405
|
-
});
|
|
1406
|
-
$[49] = t20;
|
|
1407
|
-
$[50] = t21;
|
|
1408
|
-
$[51] = t22;
|
|
1409
|
-
} else t22 = $[51];
|
|
1410
|
-
let t23;
|
|
1411
|
-
if ($[52] !== collapsed || $[53] !== isMobile || $[54] !== onSearchOpen || $[55] !== t || $[56] !== toggleSidebar) {
|
|
1412
|
-
t23 = collapsed && !isMobile && /* @__PURE__ */ jsxs("div", {
|
|
1413
|
-
className: "qa-sidebar__collapsed-peek group/peek absolute top-4 -right-3 z-50 flex items-center",
|
|
1414
|
-
children: [/* @__PURE__ */ jsx(Button, {
|
|
1415
|
-
type: "button",
|
|
1416
|
-
variant: "ghost",
|
|
1417
|
-
size: "icon-xs",
|
|
1418
|
-
className: "border-sidebar-border/70 bg-sidebar text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground h-8 w-3 rounded-l-none rounded-r-md border border-l-0 p-0 shadow-[var(--floating-shadow)]",
|
|
1419
|
-
onClick: toggleSidebar,
|
|
1420
|
-
"aria-label": t("ui.expandSidebar"),
|
|
1421
|
-
children: /* @__PURE__ */ jsx("span", { className: "h-3 w-0.5 rounded-full bg-current opacity-55" })
|
|
1422
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
1423
|
-
className: "floating-surface ml-1 flex scale-95 items-center gap-1 p-1 opacity-0 transition-[opacity,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-enter)] group-focus-within/peek:scale-100 group-focus-within/peek:opacity-100 group-hover/peek:scale-100 group-hover/peek:opacity-100 motion-reduce:scale-100 motion-reduce:transition-none",
|
|
1424
|
-
children: [/* @__PURE__ */ jsx(SidebarTrigger, {
|
|
1425
|
-
className: "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
1426
|
-
"aria-label": t("ui.expandSidebar")
|
|
1427
|
-
}), onSearchOpen && /* @__PURE__ */ jsx(Button, {
|
|
693
|
+
}), /* @__PURE__ */ jsx(SidebarTrigger, { className: "text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground" })]
|
|
694
|
+
});
|
|
695
|
+
return /* @__PURE__ */ jsxs(Sidebar, {
|
|
696
|
+
collapsible: "icon",
|
|
697
|
+
variant: "inset",
|
|
698
|
+
className: cn("qa-sidebar bg-sidebar relative border-none", className),
|
|
699
|
+
children: [
|
|
700
|
+
/* @__PURE__ */ jsxs(SidebarHeader, {
|
|
701
|
+
className: "qa-sidebar__header h-auto flex-row items-center gap-2 border-none px-3 pt-3 pb-1",
|
|
702
|
+
children: [/* @__PURE__ */ jsx(SidebarMenu, {
|
|
703
|
+
className: "min-w-0 flex-1",
|
|
704
|
+
children: /* @__PURE__ */ jsx(SidebarMenuItem, {
|
|
705
|
+
onClickCapture: handleBrandClick,
|
|
706
|
+
children: collapsed && !isMobile ? /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(LinkComponent, {
|
|
707
|
+
to: basePath,
|
|
708
|
+
className: cn("flex items-center gap-2 rounded-md p-2 transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "hover:bg-sidebar-accent", "justify-center"),
|
|
709
|
+
children: renderBrandContent(true)
|
|
710
|
+
}) }), /* @__PURE__ */ jsx(TooltipContent, {
|
|
711
|
+
side: "right",
|
|
712
|
+
children: brandName
|
|
713
|
+
})] }) : brandLink
|
|
714
|
+
})
|
|
715
|
+
}), !collapsed && sidebarActions]
|
|
716
|
+
}),
|
|
717
|
+
collapsed && !isMobile && /* @__PURE__ */ jsxs("div", {
|
|
718
|
+
className: "qa-sidebar__collapsed-peek group/peek absolute top-4 -right-3 z-50 flex items-center",
|
|
719
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
1428
720
|
type: "button",
|
|
1429
721
|
variant: "ghost",
|
|
1430
|
-
size: "icon-
|
|
1431
|
-
className: "text-
|
|
1432
|
-
onClick:
|
|
1433
|
-
|
|
1434
|
-
"
|
|
1435
|
-
|
|
722
|
+
size: "icon-xs",
|
|
723
|
+
className: "border-sidebar-border/70 bg-sidebar text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground h-8 w-3 rounded-l-none rounded-r-md border border-l-0 p-0 shadow-[var(--floating-shadow)]",
|
|
724
|
+
onClick: toggleSidebar,
|
|
725
|
+
"aria-label": t("ui.expandSidebar"),
|
|
726
|
+
children: /* @__PURE__ */ jsx("span", { className: "h-3 w-0.5 rounded-full bg-current opacity-55" })
|
|
727
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
728
|
+
className: "floating-surface ml-1 flex scale-95 items-center gap-1 p-1 opacity-0 transition-[opacity,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-enter)] group-focus-within/peek:scale-100 group-focus-within/peek:opacity-100 group-hover/peek:scale-100 group-hover/peek:opacity-100 motion-reduce:scale-100 motion-reduce:transition-none",
|
|
729
|
+
children: [/* @__PURE__ */ jsx(SidebarTrigger, {
|
|
730
|
+
className: "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
731
|
+
"aria-label": t("ui.expandSidebar")
|
|
732
|
+
}), onSearchOpen && /* @__PURE__ */ jsx(Button, {
|
|
733
|
+
type: "button",
|
|
734
|
+
variant: "ghost",
|
|
735
|
+
size: "icon-sm",
|
|
736
|
+
className: "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
737
|
+
onClick: onSearchOpen,
|
|
738
|
+
title: t("common.search"),
|
|
739
|
+
"aria-label": t("common.search"),
|
|
740
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: "ph:magnifying-glass" })
|
|
741
|
+
})]
|
|
1436
742
|
})]
|
|
1437
|
-
})
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
group,
|
|
1468
|
-
activeRoute: currentActiveRoute,
|
|
1469
|
-
LinkComponent,
|
|
1470
|
-
renderNavItem: effectiveRenderNavItem,
|
|
1471
|
-
basePath,
|
|
1472
|
-
useActiveProps: useActiveProps && !currentActiveRoute,
|
|
1473
|
-
isSectionCollapsed,
|
|
1474
|
-
toggleSection
|
|
1475
|
-
}, group.id ?? `group-${index}`);
|
|
1476
|
-
$[72] = LinkComponent;
|
|
1477
|
-
$[73] = basePath;
|
|
1478
|
-
$[74] = currentActiveRoute;
|
|
1479
|
-
$[75] = effectiveRenderNavItem;
|
|
1480
|
-
$[76] = isSectionCollapsed;
|
|
1481
|
-
$[77] = toggleSection;
|
|
1482
|
-
$[78] = useActiveProps;
|
|
1483
|
-
$[79] = t27$1;
|
|
1484
|
-
} else t27$1 = $[79];
|
|
1485
|
-
t26 = navigation.map(t27$1);
|
|
1486
|
-
$[63] = LinkComponent;
|
|
1487
|
-
$[64] = basePath;
|
|
1488
|
-
$[65] = currentActiveRoute;
|
|
1489
|
-
$[66] = effectiveRenderNavItem;
|
|
1490
|
-
$[67] = isSectionCollapsed;
|
|
1491
|
-
$[68] = navigation;
|
|
1492
|
-
$[69] = toggleSection;
|
|
1493
|
-
$[70] = useActiveProps;
|
|
1494
|
-
$[71] = t26;
|
|
1495
|
-
} else t26 = $[71];
|
|
1496
|
-
let t27;
|
|
1497
|
-
if ($[80] !== t25 || $[81] !== t26) {
|
|
1498
|
-
t27 = /* @__PURE__ */ jsx(SidebarContent, {
|
|
1499
|
-
className: "qa-sidebar__content gap-3 px-2 py-3 group-data-[collapsible=icon]:gap-2",
|
|
1500
|
-
children: /* @__PURE__ */ jsx("nav", {
|
|
1501
|
-
"aria-label": t25,
|
|
1502
|
-
className: "qa-sidebar__nav",
|
|
1503
|
-
children: t26
|
|
743
|
+
}),
|
|
744
|
+
afterBrand && !collapsed && /* @__PURE__ */ jsx("div", {
|
|
745
|
+
className: "qa-sidebar__after-brand border-sidebar-border/70 border-b px-3 py-2",
|
|
746
|
+
children: afterBrand
|
|
747
|
+
}),
|
|
748
|
+
/* @__PURE__ */ jsx(SidebarContent, {
|
|
749
|
+
className: "qa-sidebar__content gap-3 px-2 py-3 group-data-[collapsible=icon]:gap-2",
|
|
750
|
+
children: /* @__PURE__ */ jsx("nav", {
|
|
751
|
+
"aria-label": t("nav.adminNavigation"),
|
|
752
|
+
className: "qa-sidebar__nav",
|
|
753
|
+
children: navigation.map((group, index) => /* @__PURE__ */ jsx(NavGroup, {
|
|
754
|
+
group,
|
|
755
|
+
activeRoute: currentActiveRoute,
|
|
756
|
+
LinkComponent,
|
|
757
|
+
renderNavItem: effectiveRenderNavItem,
|
|
758
|
+
basePath,
|
|
759
|
+
useActiveProps: useActiveProps && !currentActiveRoute,
|
|
760
|
+
isSectionCollapsed,
|
|
761
|
+
toggleSection
|
|
762
|
+
}, group.id ?? `group-${index}`))
|
|
763
|
+
})
|
|
764
|
+
}),
|
|
765
|
+
beforeFooter && !collapsed && /* @__PURE__ */ jsx("div", {
|
|
766
|
+
className: "qa-sidebar__before-footer border-sidebar-border/70 border-t px-3 py-2",
|
|
767
|
+
children: beforeFooter
|
|
768
|
+
}),
|
|
769
|
+
footer ?? /* @__PURE__ */ jsx(UserFooter, {
|
|
770
|
+
theme,
|
|
771
|
+
setTheme,
|
|
772
|
+
showThemeToggle
|
|
1504
773
|
})
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
$[81] = t26;
|
|
1508
|
-
$[82] = t27;
|
|
1509
|
-
} else t27 = $[82];
|
|
1510
|
-
let t28;
|
|
1511
|
-
if ($[83] !== beforeFooter || $[84] !== collapsed) {
|
|
1512
|
-
t28 = beforeFooter && !collapsed && /* @__PURE__ */ jsx("div", {
|
|
1513
|
-
className: "qa-sidebar__before-footer border-sidebar-border/70 border-t px-3 py-2",
|
|
1514
|
-
children: beforeFooter
|
|
1515
|
-
});
|
|
1516
|
-
$[83] = beforeFooter;
|
|
1517
|
-
$[84] = collapsed;
|
|
1518
|
-
$[85] = t28;
|
|
1519
|
-
} else t28 = $[85];
|
|
1520
|
-
let t29;
|
|
1521
|
-
if ($[86] !== footer || $[87] !== setTheme || $[88] !== showThemeToggle || $[89] !== theme) {
|
|
1522
|
-
t29 = footer ?? /* @__PURE__ */ jsx(UserFooter, {
|
|
1523
|
-
theme,
|
|
1524
|
-
setTheme,
|
|
1525
|
-
showThemeToggle
|
|
1526
|
-
});
|
|
1527
|
-
$[86] = footer;
|
|
1528
|
-
$[87] = setTheme;
|
|
1529
|
-
$[88] = showThemeToggle;
|
|
1530
|
-
$[89] = theme;
|
|
1531
|
-
$[90] = t29;
|
|
1532
|
-
} else t29 = $[90];
|
|
1533
|
-
let t30;
|
|
1534
|
-
if ($[91] !== t18 || $[92] !== t22 || $[93] !== t23 || $[94] !== t24 || $[95] !== t27 || $[96] !== t28 || $[97] !== t29) {
|
|
1535
|
-
t30 = /* @__PURE__ */ jsxs(Sidebar, {
|
|
1536
|
-
collapsible: "icon",
|
|
1537
|
-
variant: "inset",
|
|
1538
|
-
className: t18,
|
|
1539
|
-
children: [
|
|
1540
|
-
t22,
|
|
1541
|
-
t23,
|
|
1542
|
-
t24,
|
|
1543
|
-
t27,
|
|
1544
|
-
t28,
|
|
1545
|
-
t29
|
|
1546
|
-
]
|
|
1547
|
-
});
|
|
1548
|
-
$[91] = t18;
|
|
1549
|
-
$[92] = t22;
|
|
1550
|
-
$[93] = t23;
|
|
1551
|
-
$[94] = t24;
|
|
1552
|
-
$[95] = t27;
|
|
1553
|
-
$[96] = t28;
|
|
1554
|
-
$[97] = t29;
|
|
1555
|
-
$[98] = t30;
|
|
1556
|
-
} else t30 = $[98];
|
|
1557
|
-
return t30;
|
|
774
|
+
]
|
|
775
|
+
});
|
|
1558
776
|
}
|
|
1559
777
|
|
|
1560
778
|
//#endregion
|