@questpie/admin 1.1.1 → 3.0.0
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 +256 -488
- package/dist/augmentation.d.mts +414 -0
- package/dist/client/blocks/block-renderer.d.mts +45 -0
- package/dist/client/blocks/block-renderer.mjs +105 -0
- package/dist/client/blocks/index.d.mts +2 -0
- package/dist/client/blocks/types.d.mts +68 -0
- package/dist/client/blocks/types.mjs +19 -0
- package/dist/client/builder/admin-types.d.mts +40 -0
- package/dist/client/builder/admin.d.mts +110 -0
- package/dist/client/builder/admin.mjs +151 -0
- package/dist/client/builder/field/field.d.mts +51 -0
- package/dist/client/builder/field/field.mjs +37 -0
- package/dist/client/builder/index.d.mts +31 -0
- package/dist/client/builder/page/page.d.mts +24 -0
- package/dist/client/builder/page/page.mjs +31 -0
- package/dist/client/builder/registry.d.mts +50 -0
- package/dist/client/builder/types/action-registry.mjs +276 -0
- package/dist/client/builder/types/action-types.d.mts +226 -0
- package/dist/client/builder/types/collection-types.mjs +10 -0
- package/dist/client/builder/types/common.d.mts +46 -0
- package/dist/client/builder/types/field-types.d.mts +592 -0
- package/dist/client/builder/types/field-types.mjs +18 -0
- package/dist/client/builder/types/ui-config.d.mts +158 -0
- package/dist/client/builder/types/widget-types.d.mts +562 -0
- package/dist/client/builder/validation.d.mts +33 -0
- package/dist/client/builder/validation.mjs +227 -0
- package/dist/client/builder/view/view.d.mts +49 -0
- package/dist/client/builder/view/view.mjs +27 -0
- package/dist/client/builder/widget/widget.d.mts +27 -0
- package/dist/client/builder/widget/widget.mjs +21 -0
- package/dist/client/components/actions/action-button.mjs +245 -0
- package/dist/client/components/actions/action-dialog.mjs +559 -0
- package/dist/client/components/actions/confirmation-dialog.mjs +201 -0
- package/dist/client/components/actions/header-actions.mjs +210 -0
- package/dist/client/components/admin-link.d.mts +66 -0
- package/dist/client/components/admin-link.mjs +171 -0
- package/dist/client/components/auth/auth-guard.d.mts +50 -0
- package/dist/client/components/auth/auth-guard.mjs +60 -0
- package/dist/client/components/auth/auth-loading.d.mts +35 -0
- package/dist/client/components/auth/auth-loading.mjs +55 -0
- package/dist/client/components/blocks/block-canvas.mjs +159 -0
- package/dist/client/components/blocks/block-editor-context.mjs +125 -0
- package/dist/client/components/blocks/block-editor-layout.mjs +199 -0
- package/dist/client/components/blocks/block-editor-provider.mjs +235 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs +240 -0
- package/dist/client/components/blocks/block-insert-button.mjs +189 -0
- package/dist/client/components/blocks/block-item-menu.mjs +363 -0
- package/dist/client/components/blocks/block-item.mjs +434 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs +285 -0
- package/dist/client/components/blocks/block-tree.mjs +103 -0
- package/dist/client/components/blocks/block-type-icon.mjs +95 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs +185 -0
- package/dist/client/components/component-renderer.d.mts +114 -0
- package/dist/client/components/component-renderer.mjs +258 -0
- package/dist/client/components/error-boundary.mjs +144 -0
- package/dist/client/components/fields/array-field.mjs +506 -0
- package/dist/client/components/fields/asset-preview-field.mjs +159 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +209 -0
- package/dist/client/components/fields/boolean-field.mjs +77 -0
- package/dist/client/components/fields/date-field.mjs +76 -0
- package/dist/client/components/fields/datetime-field.mjs +74 -0
- package/dist/client/components/fields/email-field.mjs +67 -0
- package/dist/client/components/fields/field-utils.mjs +64 -0
- package/dist/client/components/fields/field-wrapper.mjs +124 -0
- package/dist/client/components/fields/json-field.mjs +461 -0
- package/dist/client/components/fields/locale-badge.mjs +25 -0
- package/dist/client/components/fields/number-field.mjs +73 -0
- package/dist/client/components/fields/object-array-field.mjs +707 -0
- package/dist/client/components/fields/object-field.mjs +686 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs +254 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs +173 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs +209 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs +247 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs +309 -0
- package/dist/client/components/fields/relation/displays/types.mjs +72 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs +143 -0
- package/dist/client/components/fields/relation-field.mjs +161 -0
- package/dist/client/components/fields/relation-picker.mjs +296 -0
- package/dist/client/components/fields/relation-select.mjs +232 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +105 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +144 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +221 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +520 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +85 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs +123 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +188 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +433 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +541 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs +30 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs +50 -0
- package/dist/client/components/fields/rich-text-field.mjs +64 -0
- package/dist/client/components/fields/select-field.mjs +88 -0
- package/dist/client/components/fields/text-field.mjs +72 -0
- package/dist/client/components/fields/textarea-field.mjs +71 -0
- package/dist/client/components/fields/time-field.mjs +67 -0
- package/dist/client/components/fields/upload-field.mjs +621 -0
- package/dist/client/components/filter-builder/columns-tab.mjs +325 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +456 -0
- package/dist/client/components/filter-builder/filters-tab.mjs +663 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs +278 -0
- package/dist/client/components/history-sidebar.mjs +496 -0
- package/dist/client/components/layout/field-layout-renderer.mjs +301 -0
- package/dist/client/components/locale-switcher.mjs +251 -0
- package/dist/client/components/media/media-grid.mjs +314 -0
- package/dist/client/components/media/media-picker-dialog.mjs +563 -0
- package/dist/client/components/preview/live-preview-mode.mjs +503 -0
- package/dist/client/components/preview/preview-pane.mjs +388 -0
- package/dist/client/components/primitives/asset-preview.mjs +771 -0
- package/dist/client/components/primitives/checkbox-input.mjs +59 -0
- package/dist/client/components/primitives/date-input.mjs +461 -0
- package/dist/client/components/primitives/dropzone.mjs +368 -0
- package/dist/client/components/primitives/number-input.mjs +117 -0
- package/dist/client/components/primitives/select-multi.mjs +590 -0
- package/dist/client/components/primitives/select-single.mjs +473 -0
- package/dist/client/components/primitives/text-input.mjs +45 -0
- package/dist/client/components/primitives/textarea-input.mjs +43 -0
- package/dist/client/components/primitives/time-input.mjs +145 -0
- package/dist/client/components/primitives/toggle-input.mjs +51 -0
- package/dist/client/components/primitives/types.mjs +12 -0
- package/dist/client/components/sheets/resource-sheet.mjs +86 -0
- package/dist/client/components/ui/accordion.mjs +169 -0
- package/dist/client/components/ui/alert.mjs +85 -0
- package/dist/client/components/ui/badge.mjs +76 -0
- package/dist/client/components/ui/button.mjs +84 -0
- package/dist/client/components/ui/card.mjs +206 -0
- package/dist/client/components/ui/checkbox.mjs +82 -0
- package/dist/client/components/ui/command.mjs +239 -0
- package/dist/client/components/ui/dialog.mjs +296 -0
- package/dist/client/components/ui/drawer.mjs +278 -0
- package/dist/client/components/ui/dropdown-menu.mjs +315 -0
- package/dist/client/components/ui/empty-state.mjs +99 -0
- package/dist/client/components/ui/field.mjs +354 -0
- package/dist/client/components/ui/input-group.mjs +201 -0
- package/dist/client/components/ui/input.mjs +46 -0
- package/dist/client/components/ui/kbd.mjs +53 -0
- package/dist/client/components/ui/label.mjs +45 -0
- package/dist/client/components/ui/popover.mjs +176 -0
- package/dist/client/components/ui/responsive-dialog.mjs +308 -0
- package/dist/client/components/ui/search-input.mjs +139 -0
- package/dist/client/components/ui/select.mjs +325 -0
- package/dist/client/components/ui/separator.mjs +47 -0
- package/dist/client/components/ui/sheet.mjs +280 -0
- package/dist/client/components/ui/sidebar.mjs +774 -0
- package/dist/client/components/ui/skeleton.mjs +40 -0
- package/dist/client/components/ui/sonner.d.mts +13 -0
- package/dist/client/components/ui/sonner.mjs +85 -0
- package/dist/client/components/ui/spinner.mjs +52 -0
- package/dist/client/components/ui/switch.mjs +58 -0
- package/dist/client/components/ui/table.mjs +276 -0
- package/dist/client/components/ui/tabs.mjs +160 -0
- package/dist/client/components/ui/textarea.mjs +40 -0
- package/dist/client/components/ui/toolbar.mjs +136 -0
- package/dist/client/components/ui/tooltip.mjs +146 -0
- package/dist/client/components/widgets/chart-widget.mjs +582 -0
- package/dist/client/components/widgets/progress-widget.mjs +200 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs +209 -0
- package/dist/client/components/widgets/recent-items-widget.mjs +196 -0
- package/dist/client/components/widgets/stats-widget.mjs +261 -0
- package/dist/client/components/widgets/table-widget.mjs +273 -0
- package/dist/client/components/widgets/timeline-widget.mjs +279 -0
- package/dist/client/components/widgets/value-widget.mjs +312 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +427 -0
- package/dist/client/contexts/breadcrumb-context.mjs +60 -0
- package/dist/client/contexts/focus-context.d.mts +87 -0
- package/dist/client/contexts/focus-context.mjs +250 -0
- package/dist/client/hooks/typed-hooks.d.mts +110 -0
- package/dist/client/hooks/typed-hooks.mjs +888 -0
- package/dist/client/hooks/use-action.mjs +329 -0
- package/dist/client/hooks/use-admin-config.mjs +69 -0
- package/dist/client/hooks/use-admin-preferences.mjs +171 -0
- package/dist/client/hooks/use-admin-routes.mjs +130 -0
- package/dist/client/hooks/use-audit-history.mjs +157 -0
- package/dist/client/hooks/use-auth.d.mts +97 -0
- package/dist/{use-auth-BoLmWtmU.mjs → client/hooks/use-auth.mjs} +9 -10
- package/dist/client/hooks/use-collection-fields.mjs +71 -0
- package/dist/client/hooks/use-collection-meta.mjs +153 -0
- package/dist/client/hooks/use-collection-schema.mjs +90 -0
- package/dist/client/hooks/use-collection-validation.mjs +88 -0
- package/dist/client/hooks/use-collection.d.mts +96 -0
- package/dist/client/hooks/use-collection.mjs +673 -0
- package/dist/client/hooks/use-current-user.d.mts +60 -0
- package/dist/client/hooks/use-current-user.mjs +79 -0
- package/dist/client/hooks/use-field-hooks.mjs +199 -0
- package/dist/client/hooks/use-field-options.d.mts +57 -0
- package/dist/client/hooks/use-field-options.mjs +269 -0
- package/dist/client/hooks/use-global-fields.mjs +58 -0
- package/dist/client/hooks/use-global-meta.mjs +105 -0
- package/dist/client/hooks/use-global-schema.mjs +53 -0
- package/dist/client/hooks/use-global.d.mts +51 -0
- package/dist/client/hooks/use-global.mjs +284 -0
- package/dist/client/hooks/use-locks.mjs +452 -0
- package/dist/client/hooks/use-media-query.d.mts +22 -0
- package/dist/client/hooks/use-media-query.mjs +81 -0
- package/dist/client/hooks/use-prefill-params.mjs +47 -0
- package/dist/client/hooks/use-questpie-query-options.mjs +50 -0
- package/dist/client/hooks/use-reactive-fields.d.mts +78 -0
- package/dist/client/hooks/use-reactive-fields.mjs +201 -0
- package/dist/client/hooks/use-realtime-highlight.mjs +158 -0
- package/dist/client/hooks/use-saved-views.mjs +140 -0
- package/dist/client/hooks/use-search-param-toggle.d.mts +12 -0
- package/dist/client/hooks/use-search-param-toggle.mjs +115 -0
- package/dist/client/hooks/use-search.mjs +258 -0
- package/dist/client/hooks/use-server-actions.mjs +191 -0
- package/dist/client/hooks/use-server-validation.mjs +291 -0
- package/dist/client/hooks/use-server-widget-data.d.mts +25 -0
- package/dist/client/hooks/use-server-widget-data.mjs +65 -0
- package/dist/client/hooks/use-setup-status.d.mts +38 -0
- package/dist/client/hooks/use-setup-status.mjs +62 -0
- package/dist/client/hooks/use-sidebar-search-param.d.mts +9 -0
- package/dist/client/hooks/use-sidebar-search-param.mjs +104 -0
- package/dist/client/hooks/use-transition-stage.mjs +125 -0
- package/dist/client/hooks/use-upload-collection.mjs +31 -0
- package/dist/client/hooks/use-upload.mjs +209 -0
- package/dist/client/hooks/use-validation-error-map.mjs +57 -0
- package/dist/client/hooks/use-view-state.mjs +479 -0
- package/dist/client/i18n/hooks.mjs +284 -0
- package/dist/client/i18n/intl-cache.mjs +64 -0
- package/dist/client/i18n/messages.mjs +6 -0
- package/dist/client/i18n/simple.d.mts +21 -0
- package/dist/client/i18n/simple.mjs +156 -0
- package/dist/client/i18n/types.d.mts +109 -0
- package/dist/client/lib/cookies.mjs +9 -0
- package/dist/client/lib/events.mjs +5 -0
- package/dist/client/lib/render-profiler.mjs +51 -0
- package/dist/client/lib/utils.mjs +23 -0
- package/dist/client/preview/block-scope-context.d.mts +73 -0
- package/dist/client/preview/block-scope-context.mjs +116 -0
- package/dist/client/preview/index.d.mts +5 -0
- package/dist/client/preview/preview-banner.d.mts +45 -0
- package/dist/client/preview/preview-banner.mjs +134 -0
- package/dist/client/preview/preview-field.d.mts +107 -0
- package/dist/client/preview/preview-field.mjs +227 -0
- package/dist/client/preview/types.d.mts +114 -0
- package/dist/client/preview/types.mjs +20 -0
- package/dist/client/preview/use-collection-preview.d.mts +70 -0
- package/dist/client/preview/use-collection-preview.mjs +163 -0
- package/dist/client/runtime/content-locales-provider.d.mts +1 -0
- package/dist/client/runtime/content-locales-provider.mjs +136 -0
- package/dist/client/runtime/index.d.mts +5 -0
- package/dist/client/runtime/index.mjs +6 -0
- package/dist/client/runtime/locale-scope.d.mts +2 -0
- package/dist/client/runtime/locale-scope.mjs +108 -0
- package/dist/client/runtime/provider.d.mts +203 -0
- package/dist/client/runtime/provider.mjs +393 -0
- package/dist/client/runtime/routes.d.mts +49 -0
- package/dist/client/runtime/routes.mjs +91 -0
- package/dist/client/runtime/translations-provider.mjs +242 -0
- package/dist/client/scope/index.d.mts +3 -0
- package/dist/client/scope/picker.d.mts +53 -0
- package/dist/client/scope/picker.mjs +395 -0
- package/dist/client/scope/provider.d.mts +103 -0
- package/dist/client/scope/provider.mjs +167 -0
- package/dist/client/scope/types.d.mts +111 -0
- package/dist/client/styles/index.css +344 -188
- package/dist/client/utils/auto-expand-fields.mjs +83 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs +259 -0
- package/dist/client/utils/dependency-tracker.mjs +61 -0
- package/dist/client/utils/detect-relations.mjs +45 -0
- package/dist/client/utils/locale-to-flag.d.mts +119 -0
- package/dist/client/utils/locale-to-flag.mjs +129 -0
- package/dist/client/utils/routes.mjs +195 -0
- package/dist/client/views/auth/accept-invite-form.d.mts +72 -0
- package/dist/client/views/auth/accept-invite-form.mjs +473 -0
- package/dist/client/views/auth/auth-layout.d.mts +43 -0
- package/dist/client/views/auth/auth-layout.mjs +116 -0
- package/dist/client/views/auth/forgot-password-form.d.mts +58 -0
- package/dist/client/views/auth/forgot-password-form.mjs +386 -0
- package/dist/client/views/auth/invite-form.mjs +497 -0
- package/dist/client/views/auth/login-form.d.mts +75 -0
- package/dist/client/views/auth/login-form.mjs +387 -0
- package/dist/client/views/auth/reset-password-form.d.mts +65 -0
- package/dist/client/views/auth/reset-password-form.mjs +515 -0
- package/dist/client/views/auth/setup-form.d.mts +60 -0
- package/dist/client/views/auth/setup-form.mjs +526 -0
- package/dist/client/views/collection/auto-form-fields.mjs +873 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs +480 -0
- package/dist/client/views/collection/cells/complex-cells.mjs +746 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs +395 -0
- package/dist/client/views/collection/cells/relation-cells.mjs +260 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +509 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs +125 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +121 -0
- package/dist/client/views/collection/cells/upload-cells.mjs +28 -0
- package/dist/client/views/collection/columns/build-columns.mjs +195 -0
- package/dist/client/views/collection/columns/column-defaults.mjs +123 -0
- package/dist/client/views/collection/field-context.mjs +126 -0
- package/dist/client/views/collection/field-renderer.mjs +368 -0
- package/dist/client/views/collection/form-view.mjs +1566 -0
- package/dist/client/views/collection/table-view.mjs +832 -0
- package/dist/client/views/collection/view-skeletons.mjs +215 -0
- package/dist/client/views/common/global-search.mjs +700 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs +881 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs +265 -0
- package/dist/client/views/dashboard/widget-card.mjs +372 -0
- package/dist/client/views/globals/global-form-view.mjs +1306 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts +137 -0
- package/dist/client/views/layout/admin-layout-provider.mjs +193 -0
- package/dist/client/views/layout/admin-layout.d.mts +133 -0
- package/dist/client/views/layout/admin-layout.mjs +302 -0
- package/dist/client/views/layout/admin-router.d.mts +93 -0
- package/dist/client/views/layout/admin-router.mjs +1254 -0
- package/dist/client/views/layout/admin-sidebar.d.mts +99 -0
- package/dist/client/views/layout/admin-sidebar.mjs +1379 -0
- package/dist/client/views/layout/admin-topbar.mjs +236 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +66 -0
- package/dist/client/views/pages/accept-invite-page.mjs +349 -0
- package/dist/client/views/pages/dashboard-page.d.mts +43 -0
- package/dist/client/views/pages/dashboard-page.mjs +84 -0
- package/dist/client/views/pages/forgot-password-page.d.mts +56 -0
- package/dist/client/views/pages/forgot-password-page.mjs +152 -0
- package/dist/client/views/pages/invite-page.d.mts +70 -0
- package/dist/client/views/pages/invite-page.mjs +161 -0
- package/dist/client/views/pages/login-page.d.mts +69 -0
- package/dist/client/views/pages/login-page.mjs +193 -0
- package/dist/client/views/pages/reset-password-page.d.mts +63 -0
- package/dist/client/views/pages/reset-password-page.mjs +257 -0
- package/dist/client/views/pages/setup-page.d.mts +61 -0
- package/dist/client/views/pages/setup-page.mjs +156 -0
- package/dist/client-module.d.mts +3 -0
- package/dist/client-module.mjs +3 -0
- package/dist/client.d.mts +99 -3
- package/dist/client.mjs +52 -12
- package/dist/components/rich-text/index.d.mts +1 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts +103 -0
- package/dist/components/rich-text/rich-text-renderer.mjs +237 -0
- package/dist/index.d.mts +59 -3
- package/dist/index.mjs +52 -12
- package/dist/plugin.d.mts +2 -0
- package/dist/plugin.mjs +3 -0
- package/dist/server/adapters/nextjs.d.mts +120 -0
- package/dist/server/adapters/nextjs.mjs +110 -0
- package/dist/server/adapters/tanstack.d.mts +132 -0
- package/dist/server/adapters/tanstack.mjs +89 -0
- package/dist/server/augmentation/actions.d.mts +279 -0
- package/dist/server/augmentation/common.d.mts +76 -0
- package/dist/server/augmentation/dashboard.d.mts +547 -0
- package/dist/server/augmentation/form-layout.d.mts +303 -0
- package/dist/server/augmentation/index.d.mts +44 -0
- package/dist/server/augmentation/index.mjs +10 -0
- package/dist/server/augmentation/sidebar.d.mts +181 -0
- package/dist/server/augmentation/views.d.mts +237 -0
- package/dist/server/augmentation.d.mts +7 -0
- package/dist/server/block/index.d.mts +4 -0
- package/dist/server/codegen/admin-client-template.mjs +93 -0
- package/dist/server/codegen/projection-validator.mjs +67 -0
- package/dist/server/fields/blocks.d.mts +71 -0
- package/dist/server/fields/blocks.mjs +151 -0
- package/dist/server/fields/index.d.mts +15 -0
- package/dist/server/fields/index.mjs +15 -0
- package/dist/server/fields/rich-text.d.mts +68 -0
- package/dist/server/fields/rich-text.mjs +147 -0
- package/dist/server/i18n/index.mjs +43 -0
- package/dist/server/i18n/messages/cs.mjs +461 -0
- package/dist/server/i18n/messages/de.mjs +461 -0
- package/dist/server/i18n/messages/en.mjs +707 -0
- package/dist/server/i18n/messages/es.mjs +461 -0
- package/dist/server/i18n/messages/fr.mjs +461 -0
- package/dist/server/i18n/messages/index.mjs +23 -0
- package/dist/server/i18n/messages/pl.mjs +461 -0
- package/dist/server/i18n/messages/pt.mjs +464 -0
- package/dist/server/i18n/messages/sk.mjs +689 -0
- package/dist/server/modules/admin/.generated/module.d.mts +52 -0
- package/dist/server/modules/admin/.generated/module.mjs +78 -0
- package/dist/server/modules/admin/.generated/registries.d.mts +22 -0
- package/dist/server/modules/admin/auth-helpers.d.mts +142 -0
- package/dist/server/modules/admin/auth-helpers.mjs +107 -0
- package/dist/server/modules/admin/block/block-builder.d.mts +383 -0
- package/dist/server/modules/admin/block/block-builder.mjs +315 -0
- package/dist/server/modules/admin/block/index.d.mts +3 -0
- package/dist/server/modules/admin/block/introspection.d.mts +89 -0
- package/dist/server/modules/admin/block/introspection.mjs +100 -0
- package/dist/server/modules/admin/block/prefetch.d.mts +78 -0
- package/dist/server/modules/admin/block/prefetch.mjs +241 -0
- package/dist/server/modules/admin/client/.generated/module.d.mts +94 -0
- package/dist/server/modules/admin/client/.generated/module.mjs +91 -0
- package/dist/server/modules/admin/client/components/badge.d.mts +1 -0
- package/dist/server/modules/admin/client/components/icon.d.mts +1 -0
- package/dist/server/modules/admin/client/fields/array.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/array.mjs +12 -0
- package/dist/server/modules/admin/client/fields/assetPreview.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/assetPreview.mjs +18 -0
- package/dist/server/modules/admin/client/fields/blocks.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/blocks.mjs +12 -0
- package/dist/server/modules/admin/client/fields/boolean.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/boolean.mjs +12 -0
- package/dist/server/modules/admin/client/fields/date.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/date.mjs +12 -0
- package/dist/server/modules/admin/client/fields/datetime.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/datetime.mjs +12 -0
- package/dist/server/modules/admin/client/fields/email.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/email.mjs +12 -0
- package/dist/server/modules/admin/client/fields/json.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/json.mjs +11 -0
- package/dist/server/modules/admin/client/fields/number.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/number.mjs +12 -0
- package/dist/server/modules/admin/client/fields/object.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/object.mjs +12 -0
- package/dist/server/modules/admin/client/fields/relation.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/relation.mjs +12 -0
- package/dist/server/modules/admin/client/fields/richText.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/richText.mjs +11 -0
- package/dist/server/modules/admin/client/fields/select.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/select.mjs +12 -0
- package/dist/server/modules/admin/client/fields/text.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/text.mjs +12 -0
- package/dist/server/modules/admin/client/fields/textarea.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/textarea.mjs +12 -0
- package/dist/server/modules/admin/client/fields/time.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/time.mjs +12 -0
- package/dist/server/modules/admin/client/fields/upload.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/upload.mjs +12 -0
- package/dist/server/modules/admin/client/fields/url.d.mts +6 -0
- package/dist/server/modules/admin/client/fields/url.mjs +12 -0
- package/dist/server/modules/admin/client/index.d.mts +1 -0
- package/dist/server/modules/admin/client/pages/dashboard.d.mts +6 -0
- package/dist/server/modules/admin/client/pages/dashboard.mjs +11 -0
- package/dist/server/modules/admin/client/pages/forgotPassword.d.mts +6 -0
- package/dist/server/modules/admin/client/pages/forgotPassword.mjs +11 -0
- package/dist/server/modules/admin/client/pages/login.d.mts +6 -0
- package/dist/server/modules/admin/client/pages/login.mjs +11 -0
- package/dist/server/modules/admin/client/pages/resetPassword.d.mts +6 -0
- package/dist/server/modules/admin/client/pages/resetPassword.mjs +11 -0
- package/dist/server/modules/admin/client/pages/setup.d.mts +6 -0
- package/dist/server/modules/admin/client/pages/setup.mjs +11 -0
- package/dist/server/modules/admin/client/views/collection-form.mjs +10 -0
- package/dist/server/modules/admin/client/views/collection-table.mjs +10 -0
- package/dist/server/modules/admin/client/views/global-form.mjs +10 -0
- package/dist/server/modules/admin/client/widgets/chart.d.mts +6 -0
- package/dist/server/modules/admin/client/widgets/chart.mjs +7 -0
- package/dist/server/modules/admin/client/widgets/progress.d.mts +6 -0
- package/dist/server/modules/admin/client/widgets/progress.mjs +7 -0
- package/dist/server/modules/admin/client/widgets/quickActions.d.mts +6 -0
- package/dist/server/modules/admin/client/widgets/quickActions.mjs +7 -0
- package/dist/server/modules/admin/client/widgets/recentItems.d.mts +6 -0
- package/dist/server/modules/admin/client/widgets/recentItems.mjs +7 -0
- package/dist/server/modules/admin/client/widgets/stats.d.mts +6 -0
- package/dist/server/modules/admin/client/widgets/stats.mjs +7 -0
- package/dist/server/modules/admin/client/widgets/table.d.mts +6 -0
- package/dist/server/modules/admin/client/widgets/table.mjs +7 -0
- package/dist/server/modules/admin/client/widgets/timeline.d.mts +6 -0
- package/dist/server/modules/admin/client/widgets/timeline.mjs +7 -0
- package/dist/server/modules/admin/client/widgets/value.d.mts +6 -0
- package/dist/server/modules/admin/client/widgets/value.mjs +7 -0
- package/dist/server/modules/admin/collections/account.d.mts +77 -0
- package/dist/server/modules/admin/collections/account.mjs +23 -0
- package/dist/server/modules/admin/collections/admin-locks.d.mts +90 -0
- package/dist/server/modules/admin/collections/admin-locks.mjs +16 -0
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +69 -0
- package/dist/server/modules/admin/collections/admin-preferences.mjs +16 -0
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +83 -0
- package/dist/server/modules/admin/collections/admin-saved-views.mjs +16 -0
- package/dist/server/modules/admin/collections/apikey.d.mts +99 -0
- package/dist/server/modules/admin/collections/apikey.mjs +15 -0
- package/dist/server/modules/admin/collections/assets.d.mts +72 -0
- package/dist/server/modules/admin/collections/assets.mjs +71 -0
- package/dist/server/modules/admin/collections/session.d.mts +69 -0
- package/dist/server/modules/admin/collections/session.mjs +15 -0
- package/dist/server/modules/admin/collections/user.d.mts +85 -0
- package/dist/server/modules/admin/collections/user.mjs +204 -0
- package/dist/server/modules/admin/collections/verification.d.mts +63 -0
- package/dist/server/modules/admin/collections/verification.mjs +15 -0
- package/dist/server/modules/admin/components/badge.d.mts +10 -0
- package/dist/server/modules/admin/components/badge.mjs +10 -0
- package/dist/server/modules/admin/components/icon.d.mts +9 -0
- package/dist/server/modules/admin/components/icon.mjs +11 -0
- package/dist/server/modules/admin/config/admin.mjs +34 -0
- package/dist/server/modules/admin/dto/admin-config.dto.mjs +102 -0
- package/dist/server/modules/admin/factories.mjs +172 -0
- package/dist/server/modules/admin/index.d.mts +1093 -0
- package/dist/server/modules/admin/index.mjs +26 -0
- package/dist/server/modules/admin/modules.mjs +11 -0
- package/dist/server/modules/admin/plugin.mjs +13 -0
- package/dist/server/modules/admin/routes/admin-config.d.mts +28 -0
- package/dist/server/modules/admin/routes/admin-config.mjs +552 -0
- package/dist/server/modules/admin/routes/execute-action.d.mts +92 -0
- package/dist/server/modules/admin/routes/execute-action.mjs +433 -0
- package/dist/server/modules/admin/routes/locales.d.mts +18 -0
- package/dist/server/modules/admin/routes/locales.mjs +69 -0
- package/dist/server/modules/admin/routes/preview.d.mts +80 -0
- package/dist/server/modules/admin/routes/preview.mjs +230 -0
- package/dist/server/modules/admin/routes/reactive.d.mts +74 -0
- package/dist/server/modules/admin/routes/reactive.mjs +350 -0
- package/dist/server/modules/admin/routes/route-helpers.d.mts +23 -0
- package/dist/server/modules/admin/routes/route-helpers.mjs +76 -0
- package/dist/server/modules/admin/routes/setup.d.mts +63 -0
- package/dist/server/modules/admin/routes/setup.mjs +114 -0
- package/dist/server/modules/admin/routes/translations.d.mts +26 -0
- package/dist/server/modules/admin/routes/translations.mjs +114 -0
- package/dist/server/modules/admin/routes/widget-data.d.mts +32 -0
- package/dist/server/modules/admin/routes/widget-data.mjs +62 -0
- package/dist/server/modules/admin/views/form.d.mts +8 -0
- package/dist/server/modules/admin/views/form.mjs +7 -0
- package/dist/server/modules/admin/views/global-form.d.mts +8 -0
- package/dist/server/modules/admin/views/global-form.mjs +7 -0
- package/dist/server/modules/admin/views/table.d.mts +8 -0
- package/dist/server/modules/admin/views/table.mjs +7 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +37 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs +55 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +99 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.mjs +38 -0
- package/dist/server/modules/audit/.generated/module.d.mts +60 -0
- package/dist/server/modules/audit/.generated/module.mjs +30 -0
- package/dist/server/modules/audit/collections/audit-log.d.mts +214 -0
- package/dist/server/modules/audit/collections/audit-log.mjs +107 -0
- package/dist/server/modules/audit/config/admin.mjs +21 -0
- package/dist/server/modules/audit/config/app.mjs +262 -0
- package/dist/server/modules/audit/index.d.mts +2 -0
- package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +13 -0
- package/dist/server/modules/audit/jobs/audit-cleanup.mjs +28 -0
- package/dist/server/plugin.d.mts +26 -0
- package/dist/server/plugin.mjs +385 -0
- package/dist/server/proxy-factories.d.mts +85 -0
- package/dist/server/proxy-factories.mjs +302 -0
- package/dist/server/registry-helpers.d.mts +83 -0
- package/dist/server/registry-helpers.mjs +104 -0
- package/dist/server.d.mts +33 -250
- package/dist/server.mjs +22 -832
- package/dist/shared/preview-utils.d.mts +53 -0
- package/dist/{preview-utils-BKQ9-TMa.mjs → shared/preview-utils.mjs} +2 -3
- package/dist/{saved-views.types-BMsz5mCy.d.mts → shared/types/saved-views.types.d.mts} +7 -2
- package/dist/shared.d.mts +3 -57
- package/dist/shared.mjs +1 -1
- package/package.json +56 -51
- package/skills/questpie-admin/SKILL.md +397 -0
- package/skills/questpie-admin/blocks/SKILL.md +305 -0
- package/skills/questpie-admin/custom-ui/SKILL.md +307 -0
- package/skills/questpie-admin/views/SKILL.md +442 -0
- package/dist/auth-layout-M8K8_q5R.mjs +0 -181
- package/dist/auth-layout-M8K8_q5R.mjs.map +0 -1
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +0 -273
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +0 -1
- package/dist/card-BKHjBQfw.mjs +0 -58
- package/dist/card-BKHjBQfw.mjs.map +0 -1
- package/dist/client-D1DqawtP.d.mts +0 -13403
- package/dist/client-D1DqawtP.d.mts.map +0 -1
- package/dist/client-njX1rZmi.mjs +0 -22612
- package/dist/client-njX1rZmi.mjs.map +0 -1
- package/dist/content-locales-provider-BXvuIgfg.mjs +0 -1650
- package/dist/content-locales-provider-BXvuIgfg.mjs.map +0 -1
- package/dist/dashboard-page-B4PGEdc2.mjs +0 -2500
- package/dist/dashboard-page-B4PGEdc2.mjs.map +0 -1
- package/dist/dashboard-page-mCY0pgZv.mjs +0 -3
- package/dist/dropzone-Do3awXKd.mjs +0 -634
- package/dist/dropzone-Do3awXKd.mjs.map +0 -1
- package/dist/forgot-password-page-Bcp-An4Y.mjs +0 -221
- package/dist/forgot-password-page-Bcp-An4Y.mjs.map +0 -1
- package/dist/forgot-password-page-CEwsdLwn.mjs +0 -3
- package/dist/index-B4H3amCD.d.mts +0 -2753
- package/dist/index-B4H3amCD.d.mts.map +0 -1
- package/dist/login-page-BUnpCbCa.mjs +0 -3
- package/dist/login-page-CP4gA-dl.mjs +0 -298
- package/dist/login-page-CP4gA-dl.mjs.map +0 -1
- package/dist/preview-utils-BKQ9-TMa.mjs.map +0 -1
- package/dist/reset-password-page-BqfDmLxA.mjs +0 -281
- package/dist/reset-password-page-BqfDmLxA.mjs.map +0 -1
- package/dist/reset-password-page-CufHz3h3.mjs +0 -3
- package/dist/runtime-6VZM878K.mjs +0 -69
- package/dist/runtime-6VZM878K.mjs.map +0 -1
- package/dist/saved-views.types-BMsz5mCy.d.mts.map +0 -1
- package/dist/server.d.mts.map +0 -1
- package/dist/server.mjs.map +0 -1
- package/dist/setup-page-BNNzt_Z6.mjs +0 -3
- package/dist/setup-page-YAP_fzqh.mjs +0 -264
- package/dist/setup-page-YAP_fzqh.mjs.map +0 -1
- package/dist/shared.d.mts.map +0 -1
- package/dist/use-auth-BoLmWtmU.mjs.map +0 -1
|
@@ -0,0 +1,1379 @@
|
|
|
1
|
+
import { useResolveText, useSafeI18n, useTranslation } from "../../i18n/hooks.mjs";
|
|
2
|
+
import { cn, formatLabel } from "../../lib/utils.mjs";
|
|
3
|
+
import { selectAdmin, selectBasePath, selectContentLocale, selectNavigate, selectSetContentLocale, useAdminStore } from "../../runtime/provider.mjs";
|
|
4
|
+
import { useSafeContentLocales } from "../../runtime/content-locales-provider.mjs";
|
|
5
|
+
import { ComponentRenderer } from "../../components/component-renderer.mjs";
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../components/ui/tooltip.mjs";
|
|
7
|
+
import { useAdminConfig } from "../../hooks/use-admin-config.mjs";
|
|
8
|
+
import { getFlagUrl } from "../../utils/locale-to-flag.mjs";
|
|
9
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "../../components/ui/dropdown-menu.mjs";
|
|
10
|
+
import { useAuthClientSafe } from "../../hooks/use-auth.mjs";
|
|
11
|
+
import { useCurrentUser, useSessionState } from "../../hooks/use-current-user.mjs";
|
|
12
|
+
import { Skeleton } from "../../components/ui/skeleton.mjs";
|
|
13
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuItem, SidebarSeparator, useSidebar } from "../../components/ui/sidebar.mjs";
|
|
14
|
+
import { getAdminPreferenceQueryKey, useAdminPreference, useSetAdminPreference } from "../../hooks/use-admin-preferences.mjs";
|
|
15
|
+
import { c } from "react/compiler-runtime";
|
|
16
|
+
import { Icon } from "@iconify/react";
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
19
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { toast } from "sonner";
|
|
21
|
+
|
|
22
|
+
//#region src/client/views/layout/admin-sidebar.tsx
|
|
23
|
+
/**
|
|
24
|
+
* AdminSidebar Component
|
|
25
|
+
*
|
|
26
|
+
* Navigation sidebar for the admin UI using shadcn sidebar primitives.
|
|
27
|
+
* Automatically reads from AdminProvider context when props are not provided.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Extract typed props from untyped sidebar config items.
|
|
31
|
+
* Server sidebar items come as plain objects without strict typing.
|
|
32
|
+
*/
|
|
33
|
+
function getSidebarItemProps(item) {
|
|
34
|
+
const i = item;
|
|
35
|
+
return {
|
|
36
|
+
collection: i.collection,
|
|
37
|
+
global: i.global,
|
|
38
|
+
pageId: i.pageId,
|
|
39
|
+
label: i.label,
|
|
40
|
+
icon: i.icon,
|
|
41
|
+
href: i.href
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Build NavigationGroup[] from server sidebar config, using server
|
|
46
|
+
* collection/global metadata for labels/icons and local navigation
|
|
47
|
+
* only for page items (which are client-only).
|
|
48
|
+
*/
|
|
49
|
+
function useServerNavigation() {
|
|
50
|
+
const $ = c(6);
|
|
51
|
+
const { data: serverConfig } = useAdminConfig();
|
|
52
|
+
const storeNavigation = useAdminStore(_temp);
|
|
53
|
+
const basePath = useAdminStore(selectBasePath);
|
|
54
|
+
let t0;
|
|
55
|
+
bb0: {
|
|
56
|
+
const sections = serverConfig?.sidebar?.sections;
|
|
57
|
+
if (!sections?.length) {
|
|
58
|
+
t0 = void 0;
|
|
59
|
+
break bb0;
|
|
60
|
+
}
|
|
61
|
+
let t1;
|
|
62
|
+
if ($[0] !== basePath || $[1] !== sections || $[2] !== serverConfig?.collections || $[3] !== serverConfig?.globals || $[4] !== storeNavigation) {
|
|
63
|
+
const pageMap = /* @__PURE__ */ new Map();
|
|
64
|
+
for (const group of storeNavigation ?? []) for (const element of group.items ?? []) if (element.type !== "divider" && "id" in element) {
|
|
65
|
+
const navItem = element;
|
|
66
|
+
if (navItem.type === "page") pageMap.set(navItem.id, navItem);
|
|
67
|
+
}
|
|
68
|
+
const convertItem = function convertItem$1(item) {
|
|
69
|
+
const props = getSidebarItemProps(item);
|
|
70
|
+
switch (item.type) {
|
|
71
|
+
case "collection": {
|
|
72
|
+
const collectionName = props.collection;
|
|
73
|
+
const meta_0 = serverConfig?.collections?.[collectionName];
|
|
74
|
+
return {
|
|
75
|
+
id: `collection:${collectionName}`,
|
|
76
|
+
label: props.label ?? meta_0?.label ?? formatLabel(collectionName),
|
|
77
|
+
href: `${basePath}/collections/${collectionName}`,
|
|
78
|
+
icon: props.icon ?? meta_0?.icon,
|
|
79
|
+
type: "collection",
|
|
80
|
+
order: 0
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
case "global": {
|
|
84
|
+
const globalName = props.global;
|
|
85
|
+
const meta = serverConfig?.globals?.[globalName];
|
|
86
|
+
return {
|
|
87
|
+
id: `global:${globalName}`,
|
|
88
|
+
label: props.label ?? meta?.label ?? formatLabel(globalName),
|
|
89
|
+
href: `${basePath}/globals/${globalName}`,
|
|
90
|
+
icon: props.icon ?? meta?.icon,
|
|
91
|
+
type: "global",
|
|
92
|
+
order: 0
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
case "page": {
|
|
96
|
+
const found = pageMap.get(`page:${props.pageId}`);
|
|
97
|
+
if (!found) return;
|
|
98
|
+
return {
|
|
99
|
+
...found,
|
|
100
|
+
label: props.label ?? found.label,
|
|
101
|
+
icon: props.icon ?? found.icon
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
case "link": return {
|
|
105
|
+
id: `link:${props.href}`,
|
|
106
|
+
label: props.label ?? "",
|
|
107
|
+
href: props.href,
|
|
108
|
+
icon: props.icon,
|
|
109
|
+
type: "link",
|
|
110
|
+
order: 0
|
|
111
|
+
};
|
|
112
|
+
case "divider": return { type: "divider" };
|
|
113
|
+
default: return;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
function convertSection(section) {
|
|
117
|
+
return {
|
|
118
|
+
id: section.id,
|
|
119
|
+
label: section.title,
|
|
120
|
+
icon: section.icon,
|
|
121
|
+
collapsible: section.collapsible,
|
|
122
|
+
items: (section.items ?? []).map(convertItem).filter(_temp2),
|
|
123
|
+
sections: section.sections?.map(convertSection)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
t1 = sections.map(convertSection);
|
|
127
|
+
$[0] = basePath;
|
|
128
|
+
$[1] = sections;
|
|
129
|
+
$[2] = serverConfig?.collections;
|
|
130
|
+
$[3] = serverConfig?.globals;
|
|
131
|
+
$[4] = storeNavigation;
|
|
132
|
+
$[5] = t1;
|
|
133
|
+
} else t1 = $[5];
|
|
134
|
+
t0 = t1;
|
|
135
|
+
}
|
|
136
|
+
return t0;
|
|
137
|
+
}
|
|
138
|
+
function _temp2(i) {
|
|
139
|
+
return i !== void 0;
|
|
140
|
+
}
|
|
141
|
+
function _temp(s) {
|
|
142
|
+
return s.navigation;
|
|
143
|
+
}
|
|
144
|
+
function useSidebarProps(props) {
|
|
145
|
+
const $ = c(6);
|
|
146
|
+
const storeNavigation = useAdminStore(_temp3);
|
|
147
|
+
const storeBrandName = useAdminStore(_temp4);
|
|
148
|
+
const serverNavigation = useServerNavigation();
|
|
149
|
+
let t0;
|
|
150
|
+
if ($[0] !== serverNavigation || $[1] !== storeNavigation) {
|
|
151
|
+
t0 = serverNavigation ?? storeNavigation ?? [];
|
|
152
|
+
$[0] = serverNavigation;
|
|
153
|
+
$[1] = storeNavigation;
|
|
154
|
+
$[2] = t0;
|
|
155
|
+
} else t0 = $[2];
|
|
156
|
+
const t1 = props.brandName ?? storeBrandName ?? "Admin";
|
|
157
|
+
let t2;
|
|
158
|
+
if ($[3] !== t0 || $[4] !== t1) {
|
|
159
|
+
t2 = {
|
|
160
|
+
navigation: t0,
|
|
161
|
+
brandName: t1
|
|
162
|
+
};
|
|
163
|
+
$[3] = t0;
|
|
164
|
+
$[4] = t1;
|
|
165
|
+
$[5] = t2;
|
|
166
|
+
} else t2 = $[5];
|
|
167
|
+
return t2;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Render an icon - handles ComponentReference and React components.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```tsx
|
|
174
|
+
* // React component
|
|
175
|
+
* <RenderIcon icon={UsersIcon} />
|
|
176
|
+
*
|
|
177
|
+
* // Server-defined reference
|
|
178
|
+
* <RenderIcon icon={{ type: "icon", props: { name: "ph:users" } }} />
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
function _temp4(s_0) {
|
|
182
|
+
return s_0.brandName;
|
|
183
|
+
}
|
|
184
|
+
function _temp3(s) {
|
|
185
|
+
return s.navigation;
|
|
186
|
+
}
|
|
187
|
+
function areIconValuesEqual(a, b) {
|
|
188
|
+
if (a === b) return true;
|
|
189
|
+
if (!a || !b) return false;
|
|
190
|
+
if (typeof a === "object" && typeof b === "object" && "type" in a && "type" in b) {
|
|
191
|
+
const aRef = a;
|
|
192
|
+
const bRef = b;
|
|
193
|
+
if (aRef.type !== bRef.type) return false;
|
|
194
|
+
const aProps = aRef.props ?? {};
|
|
195
|
+
const bProps = bRef.props ?? {};
|
|
196
|
+
const aKeys = Object.keys(aProps);
|
|
197
|
+
const bKeys = Object.keys(bProps);
|
|
198
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
199
|
+
for (const key of aKeys) if (aProps[key] !== bProps[key]) return false;
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
const RenderIcon = React.memo(function RenderIcon$1(props) {
|
|
205
|
+
const $ = c(10);
|
|
206
|
+
const { icon, className } = props;
|
|
207
|
+
let t0;
|
|
208
|
+
if ($[0] !== className) {
|
|
209
|
+
t0 = cn("size-4 shrink-0", className);
|
|
210
|
+
$[0] = className;
|
|
211
|
+
$[1] = t0;
|
|
212
|
+
} else t0 = $[1];
|
|
213
|
+
const mergedClassName = t0;
|
|
214
|
+
let t1;
|
|
215
|
+
if ($[2] !== mergedClassName) {
|
|
216
|
+
t1 = { className: mergedClassName };
|
|
217
|
+
$[2] = mergedClassName;
|
|
218
|
+
$[3] = t1;
|
|
219
|
+
} else t1 = $[3];
|
|
220
|
+
const additionalProps = t1;
|
|
221
|
+
if (!icon) return null;
|
|
222
|
+
if (typeof icon === "object" && icon !== null && "type" in icon) {
|
|
223
|
+
const t2$1 = icon;
|
|
224
|
+
let t3;
|
|
225
|
+
if ($[4] !== additionalProps || $[5] !== t2$1) {
|
|
226
|
+
t3 = /* @__PURE__ */ jsx(ComponentRenderer, {
|
|
227
|
+
reference: t2$1,
|
|
228
|
+
additionalProps
|
|
229
|
+
});
|
|
230
|
+
$[4] = additionalProps;
|
|
231
|
+
$[5] = t2$1;
|
|
232
|
+
$[6] = t3;
|
|
233
|
+
} else t3 = $[6];
|
|
234
|
+
return t3;
|
|
235
|
+
}
|
|
236
|
+
const IconComp = icon;
|
|
237
|
+
let t2;
|
|
238
|
+
if ($[7] !== IconComp || $[8] !== mergedClassName) {
|
|
239
|
+
t2 = /* @__PURE__ */ jsx(IconComp, { className: mergedClassName });
|
|
240
|
+
$[7] = IconComp;
|
|
241
|
+
$[8] = mergedClassName;
|
|
242
|
+
$[9] = t2;
|
|
243
|
+
} else t2 = $[9];
|
|
244
|
+
return t2;
|
|
245
|
+
}, (prev, next) => {
|
|
246
|
+
if (prev.className !== next.className) return false;
|
|
247
|
+
return areIconValuesEqual(prev.icon, next.icon);
|
|
248
|
+
});
|
|
249
|
+
function QuestpieSymbol(t0) {
|
|
250
|
+
const $ = c(7);
|
|
251
|
+
const { className } = t0;
|
|
252
|
+
let t1;
|
|
253
|
+
if ($[0] !== className) {
|
|
254
|
+
t1 = cn("size-6 shrink-0", className);
|
|
255
|
+
$[0] = className;
|
|
256
|
+
$[1] = t1;
|
|
257
|
+
} else t1 = $[1];
|
|
258
|
+
let t2;
|
|
259
|
+
let t3;
|
|
260
|
+
let t4;
|
|
261
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
262
|
+
t2 = /* @__PURE__ */ jsx("title", { children: "QUESTPIE" });
|
|
263
|
+
t3 = /* @__PURE__ */ jsx("path", {
|
|
264
|
+
d: "M22 10V2H2V22H10",
|
|
265
|
+
stroke: "currentColor",
|
|
266
|
+
strokeWidth: "2",
|
|
267
|
+
strokeLinecap: "square",
|
|
268
|
+
className: "text-[#0a0a0a] dark:text-white"
|
|
269
|
+
});
|
|
270
|
+
t4 = /* @__PURE__ */ jsx("path", {
|
|
271
|
+
d: "M23 13H13V23H23V13Z",
|
|
272
|
+
fill: "#B700FF"
|
|
273
|
+
});
|
|
274
|
+
$[2] = t2;
|
|
275
|
+
$[3] = t3;
|
|
276
|
+
$[4] = t4;
|
|
277
|
+
} else {
|
|
278
|
+
t2 = $[2];
|
|
279
|
+
t3 = $[3];
|
|
280
|
+
t4 = $[4];
|
|
281
|
+
}
|
|
282
|
+
let t5;
|
|
283
|
+
if ($[5] !== t1) {
|
|
284
|
+
t5 = /* @__PURE__ */ jsxs("svg", {
|
|
285
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
286
|
+
viewBox: "0 0 24 24",
|
|
287
|
+
fill: "none",
|
|
288
|
+
className: t1,
|
|
289
|
+
children: [
|
|
290
|
+
t2,
|
|
291
|
+
t3,
|
|
292
|
+
t4
|
|
293
|
+
]
|
|
294
|
+
});
|
|
295
|
+
$[5] = t1;
|
|
296
|
+
$[6] = t5;
|
|
297
|
+
} else t5 = $[6];
|
|
298
|
+
return t5;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Check if element is a navigation item (not divider)
|
|
302
|
+
*/
|
|
303
|
+
function isNavigationItem(element) {
|
|
304
|
+
return element.type !== "divider";
|
|
305
|
+
}
|
|
306
|
+
function normalizeRoute(route) {
|
|
307
|
+
return route?.replace(/\/+$/, "");
|
|
308
|
+
}
|
|
309
|
+
function isRouteActive(activeRoute, itemHref, basePath, exact = false) {
|
|
310
|
+
if (!activeRoute) return false;
|
|
311
|
+
const normalizedActive = normalizeRoute(activeRoute);
|
|
312
|
+
const normalizedItem = normalizeRoute(itemHref);
|
|
313
|
+
const normalizedBase = normalizeRoute(basePath);
|
|
314
|
+
if (!normalizedActive || !normalizedItem) return false;
|
|
315
|
+
if (normalizedActive === normalizedItem) return true;
|
|
316
|
+
if (exact || normalizedItem === normalizedBase) return false;
|
|
317
|
+
return normalizedActive.startsWith(`${normalizedItem}/`);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Menu button styles - QUESTPIE design: clean, technical look
|
|
321
|
+
*/
|
|
322
|
+
const menuButtonStyles = cn("flex w-full items-center gap-2.5 px-3 py-2 text-sm font-medium transition-colors duration-150", "text-sidebar-foreground hover:text-sidebar-foreground hover:bg-sidebar-accent", "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");
|
|
323
|
+
const menuButtonActiveStyles = cn("bg-sidebar-primary/10 text-sidebar-primary");
|
|
324
|
+
/**
|
|
325
|
+
* Active indicator bar positioned at the sidebar group edge.
|
|
326
|
+
* Uses negative left offset to compensate for SidebarGroupContent nesting padding.
|
|
327
|
+
*/
|
|
328
|
+
function ActiveIndicator(t0) {
|
|
329
|
+
const $ = c(2);
|
|
330
|
+
const { depth } = t0;
|
|
331
|
+
const t1 = `${-depth * .75}rem`;
|
|
332
|
+
let t2;
|
|
333
|
+
if ($[0] !== t1) {
|
|
334
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
335
|
+
className: "bg-sidebar-primary absolute top-0 bottom-0 w-0.5",
|
|
336
|
+
style: { left: t1 },
|
|
337
|
+
"aria-hidden": "true"
|
|
338
|
+
});
|
|
339
|
+
$[0] = t1;
|
|
340
|
+
$[1] = t2;
|
|
341
|
+
} else t2 = $[1];
|
|
342
|
+
return t2;
|
|
343
|
+
}
|
|
344
|
+
function NavItem(t0) {
|
|
345
|
+
const $ = c(66);
|
|
346
|
+
const { item, isActive, LinkComponent, renderNavItem, useActiveProps, className, depth: t1 } = t0;
|
|
347
|
+
const depth = t1 === void 0 ? 0 : t1;
|
|
348
|
+
const { state, isMobile, setOpenMobile } = useSidebar();
|
|
349
|
+
const collapsed = state === "collapsed";
|
|
350
|
+
const resolveText = useResolveText();
|
|
351
|
+
let t2;
|
|
352
|
+
if ($[0] !== isMobile || $[1] !== setOpenMobile) {
|
|
353
|
+
t2 = () => {
|
|
354
|
+
if (isMobile) setOpenMobile(false);
|
|
355
|
+
};
|
|
356
|
+
$[0] = isMobile;
|
|
357
|
+
$[1] = setOpenMobile;
|
|
358
|
+
$[2] = t2;
|
|
359
|
+
} else t2 = $[2];
|
|
360
|
+
const handleClick = t2;
|
|
361
|
+
if (renderNavItem) {
|
|
362
|
+
const NavItemRenderer = renderNavItem;
|
|
363
|
+
let t3$1;
|
|
364
|
+
if ($[3] !== NavItemRenderer || $[4] !== collapsed || $[5] !== isActive || $[6] !== item) {
|
|
365
|
+
t3$1 = /* @__PURE__ */ jsx(NavItemRenderer, {
|
|
366
|
+
item,
|
|
367
|
+
isActive,
|
|
368
|
+
collapsed
|
|
369
|
+
});
|
|
370
|
+
$[3] = NavItemRenderer;
|
|
371
|
+
$[4] = collapsed;
|
|
372
|
+
$[5] = isActive;
|
|
373
|
+
$[6] = item;
|
|
374
|
+
$[7] = t3$1;
|
|
375
|
+
} else t3$1 = $[7];
|
|
376
|
+
return t3$1;
|
|
377
|
+
}
|
|
378
|
+
let t3;
|
|
379
|
+
if ($[8] !== item.label || $[9] !== resolveText) {
|
|
380
|
+
t3 = resolveText(item.label);
|
|
381
|
+
$[8] = item.label;
|
|
382
|
+
$[9] = resolveText;
|
|
383
|
+
$[10] = t3;
|
|
384
|
+
} else t3 = $[10];
|
|
385
|
+
const label = t3;
|
|
386
|
+
const shouldUseExact = item.type === "link" || item.type === "page";
|
|
387
|
+
let t4;
|
|
388
|
+
if ($[11] !== shouldUseExact || $[12] !== useActiveProps) {
|
|
389
|
+
t4 = useActiveProps ? {
|
|
390
|
+
activeProps: { className: menuButtonActiveStyles },
|
|
391
|
+
activeOptions: { exact: shouldUseExact }
|
|
392
|
+
} : {};
|
|
393
|
+
$[11] = shouldUseExact;
|
|
394
|
+
$[12] = useActiveProps;
|
|
395
|
+
$[13] = t4;
|
|
396
|
+
} else t4 = $[13];
|
|
397
|
+
const linkActiveProps = t4;
|
|
398
|
+
const ariaCurrent = isActive ? "page" : void 0;
|
|
399
|
+
const t5 = item.href;
|
|
400
|
+
const t6 = collapsed ? label : void 0;
|
|
401
|
+
const t7 = isActive && "qa-sidebar__nav-link--active";
|
|
402
|
+
const t8 = isActive && menuButtonActiveStyles;
|
|
403
|
+
let t9;
|
|
404
|
+
if ($[14] !== t7 || $[15] !== t8) {
|
|
405
|
+
t9 = cn("qa-sidebar__nav-link", menuButtonStyles, t7, t8);
|
|
406
|
+
$[14] = t7;
|
|
407
|
+
$[15] = t8;
|
|
408
|
+
$[16] = t9;
|
|
409
|
+
} else t9 = $[16];
|
|
410
|
+
let t10;
|
|
411
|
+
if ($[17] !== item.icon) {
|
|
412
|
+
t10 = item.icon && /* @__PURE__ */ jsx(RenderIcon, {
|
|
413
|
+
icon: item.icon,
|
|
414
|
+
className: "qa-sidebar__nav-icon"
|
|
415
|
+
});
|
|
416
|
+
$[17] = item.icon;
|
|
417
|
+
$[18] = t10;
|
|
418
|
+
} else t10 = $[18];
|
|
419
|
+
let t11;
|
|
420
|
+
if ($[19] !== label) {
|
|
421
|
+
t11 = /* @__PURE__ */ jsx("span", {
|
|
422
|
+
className: "qa-sidebar__nav-label truncate group-data-[collapsible=icon]:hidden",
|
|
423
|
+
children: label
|
|
424
|
+
});
|
|
425
|
+
$[19] = label;
|
|
426
|
+
$[20] = t11;
|
|
427
|
+
} else t11 = $[20];
|
|
428
|
+
let t12;
|
|
429
|
+
if ($[21] !== LinkComponent || $[22] !== item.href || $[23] !== linkActiveProps || $[24] !== t10 || $[25] !== t11 || $[26] !== t6 || $[27] !== t9) {
|
|
430
|
+
t12 = /* @__PURE__ */ jsxs(LinkComponent, {
|
|
431
|
+
to: t5,
|
|
432
|
+
"aria-label": t6,
|
|
433
|
+
className: t9,
|
|
434
|
+
...linkActiveProps,
|
|
435
|
+
children: [t10, t11]
|
|
436
|
+
});
|
|
437
|
+
$[21] = LinkComponent;
|
|
438
|
+
$[22] = item.href;
|
|
439
|
+
$[23] = linkActiveProps;
|
|
440
|
+
$[24] = t10;
|
|
441
|
+
$[25] = t11;
|
|
442
|
+
$[26] = t6;
|
|
443
|
+
$[27] = t9;
|
|
444
|
+
$[28] = t12;
|
|
445
|
+
} else t12 = $[28];
|
|
446
|
+
const linkContent = t12;
|
|
447
|
+
if (collapsed && !isMobile) {
|
|
448
|
+
let t13$1;
|
|
449
|
+
if ($[29] !== isActive) {
|
|
450
|
+
t13$1 = isActive && /* @__PURE__ */ jsx(ActiveIndicator, { depth: 0 });
|
|
451
|
+
$[29] = isActive;
|
|
452
|
+
$[30] = t13$1;
|
|
453
|
+
} else t13$1 = $[30];
|
|
454
|
+
const t14$1 = item.href;
|
|
455
|
+
const t15$1 = isActive && "qa-sidebar__nav-link--active";
|
|
456
|
+
const t16 = isActive && menuButtonActiveStyles;
|
|
457
|
+
let t17;
|
|
458
|
+
if ($[31] !== t15$1 || $[32] !== t16) {
|
|
459
|
+
t17 = cn("qa-sidebar__nav-link", menuButtonStyles, t15$1, t16);
|
|
460
|
+
$[31] = t15$1;
|
|
461
|
+
$[32] = t16;
|
|
462
|
+
$[33] = t17;
|
|
463
|
+
} else t17 = $[33];
|
|
464
|
+
let t18;
|
|
465
|
+
if ($[34] !== item.icon) {
|
|
466
|
+
t18 = item.icon && /* @__PURE__ */ jsx(RenderIcon, { icon: item.icon });
|
|
467
|
+
$[34] = item.icon;
|
|
468
|
+
$[35] = t18;
|
|
469
|
+
} else t18 = $[35];
|
|
470
|
+
let t19;
|
|
471
|
+
if ($[36] !== label) {
|
|
472
|
+
t19 = /* @__PURE__ */ jsx("span", {
|
|
473
|
+
className: "truncate group-data-[collapsible=icon]:hidden",
|
|
474
|
+
children: label
|
|
475
|
+
});
|
|
476
|
+
$[36] = label;
|
|
477
|
+
$[37] = t19;
|
|
478
|
+
} else t19 = $[37];
|
|
479
|
+
let t20;
|
|
480
|
+
if ($[38] !== LinkComponent || $[39] !== item.href || $[40] !== linkActiveProps || $[41] !== t17 || $[42] !== t18 || $[43] !== t19) {
|
|
481
|
+
t20 = /* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs(LinkComponent, {
|
|
482
|
+
to: t14$1,
|
|
483
|
+
className: t17,
|
|
484
|
+
...linkActiveProps,
|
|
485
|
+
children: [t18, t19]
|
|
486
|
+
}) });
|
|
487
|
+
$[38] = LinkComponent;
|
|
488
|
+
$[39] = item.href;
|
|
489
|
+
$[40] = linkActiveProps;
|
|
490
|
+
$[41] = t17;
|
|
491
|
+
$[42] = t18;
|
|
492
|
+
$[43] = t19;
|
|
493
|
+
$[44] = t20;
|
|
494
|
+
} else t20 = $[44];
|
|
495
|
+
let t21;
|
|
496
|
+
if ($[45] !== label) {
|
|
497
|
+
t21 = /* @__PURE__ */ jsx(TooltipContent, {
|
|
498
|
+
side: "right",
|
|
499
|
+
align: "center",
|
|
500
|
+
children: label
|
|
501
|
+
});
|
|
502
|
+
$[45] = label;
|
|
503
|
+
$[46] = t21;
|
|
504
|
+
} else t21 = $[46];
|
|
505
|
+
let t22;
|
|
506
|
+
if ($[47] !== t20 || $[48] !== t21) {
|
|
507
|
+
t22 = /* @__PURE__ */ jsxs(Tooltip, { children: [t20, t21] });
|
|
508
|
+
$[47] = t20;
|
|
509
|
+
$[48] = t21;
|
|
510
|
+
$[49] = t22;
|
|
511
|
+
} else t22 = $[49];
|
|
512
|
+
let t23;
|
|
513
|
+
if ($[50] !== ariaCurrent || $[51] !== handleClick || $[52] !== t13$1 || $[53] !== t22) {
|
|
514
|
+
t23 = /* @__PURE__ */ jsxs(SidebarMenuItem, {
|
|
515
|
+
className: "qa-sidebar__nav-item",
|
|
516
|
+
onClickCapture: handleClick,
|
|
517
|
+
"aria-current": ariaCurrent,
|
|
518
|
+
children: [t13$1, t22]
|
|
519
|
+
});
|
|
520
|
+
$[50] = ariaCurrent;
|
|
521
|
+
$[51] = handleClick;
|
|
522
|
+
$[52] = t13$1;
|
|
523
|
+
$[53] = t22;
|
|
524
|
+
$[54] = t23;
|
|
525
|
+
} else t23 = $[54];
|
|
526
|
+
return t23;
|
|
527
|
+
}
|
|
528
|
+
let t13;
|
|
529
|
+
if ($[55] !== className) {
|
|
530
|
+
t13 = cn("qa-sidebar__nav-item", className);
|
|
531
|
+
$[55] = className;
|
|
532
|
+
$[56] = t13;
|
|
533
|
+
} else t13 = $[56];
|
|
534
|
+
let t14;
|
|
535
|
+
if ($[57] !== depth || $[58] !== isActive) {
|
|
536
|
+
t14 = isActive && /* @__PURE__ */ jsx(ActiveIndicator, { depth });
|
|
537
|
+
$[57] = depth;
|
|
538
|
+
$[58] = isActive;
|
|
539
|
+
$[59] = t14;
|
|
540
|
+
} else t14 = $[59];
|
|
541
|
+
let t15;
|
|
542
|
+
if ($[60] !== ariaCurrent || $[61] !== handleClick || $[62] !== linkContent || $[63] !== t13 || $[64] !== t14) {
|
|
543
|
+
t15 = /* @__PURE__ */ jsxs(SidebarMenuItem, {
|
|
544
|
+
className: t13,
|
|
545
|
+
onClickCapture: handleClick,
|
|
546
|
+
"aria-current": ariaCurrent,
|
|
547
|
+
children: [t14, linkContent]
|
|
548
|
+
});
|
|
549
|
+
$[60] = ariaCurrent;
|
|
550
|
+
$[61] = handleClick;
|
|
551
|
+
$[62] = linkContent;
|
|
552
|
+
$[63] = t13;
|
|
553
|
+
$[64] = t14;
|
|
554
|
+
$[65] = t15;
|
|
555
|
+
} else t15 = $[65];
|
|
556
|
+
return t15;
|
|
557
|
+
}
|
|
558
|
+
const SIDEBAR_COLLAPSED_SECTIONS_KEY = "sidebar:collapsed-sections";
|
|
559
|
+
/**
|
|
560
|
+
* Hook to manage sidebar section collapse state, persisted in admin preferences.
|
|
561
|
+
* Returns the collapsed map and a toggle function.
|
|
562
|
+
* Collapsible sections default to collapsed (true) when no preference is stored.
|
|
563
|
+
*/
|
|
564
|
+
function useSidebarCollapsedSections() {
|
|
565
|
+
const $ = c(13);
|
|
566
|
+
const user = useCurrentUser();
|
|
567
|
+
const queryClient = useQueryClient();
|
|
568
|
+
const { data: stored, isLoading } = useAdminPreference(SIDEBAR_COLLAPSED_SECTIONS_KEY);
|
|
569
|
+
const { mutate: persist } = useSetAdminPreference(SIDEBAR_COLLAPSED_SECTIONS_KEY);
|
|
570
|
+
const t0 = user?.id;
|
|
571
|
+
let t1;
|
|
572
|
+
if ($[0] !== t0) {
|
|
573
|
+
t1 = getAdminPreferenceQueryKey(t0, SIDEBAR_COLLAPSED_SECTIONS_KEY);
|
|
574
|
+
$[0] = t0;
|
|
575
|
+
$[1] = t1;
|
|
576
|
+
} else t1 = $[1];
|
|
577
|
+
const queryKey = t1;
|
|
578
|
+
let t2;
|
|
579
|
+
if ($[2] !== stored) {
|
|
580
|
+
t2 = (sectionId, collapsible) => {
|
|
581
|
+
if (!collapsible || !sectionId) return false;
|
|
582
|
+
return stored?.[sectionId] ?? false;
|
|
583
|
+
};
|
|
584
|
+
$[2] = stored;
|
|
585
|
+
$[3] = t2;
|
|
586
|
+
} else t2 = $[3];
|
|
587
|
+
const isSectionCollapsed = t2;
|
|
588
|
+
let t3;
|
|
589
|
+
if ($[4] !== persist || $[5] !== queryClient || $[6] !== queryKey || $[7] !== stored) {
|
|
590
|
+
t3 = (sectionId_0) => {
|
|
591
|
+
const current = stored ?? {};
|
|
592
|
+
const isCurrentlyCollapsed = current[sectionId_0] ?? false;
|
|
593
|
+
const next = {
|
|
594
|
+
...current,
|
|
595
|
+
[sectionId_0]: !isCurrentlyCollapsed
|
|
596
|
+
};
|
|
597
|
+
queryClient.setQueryData(queryKey, next);
|
|
598
|
+
persist(next);
|
|
599
|
+
};
|
|
600
|
+
$[4] = persist;
|
|
601
|
+
$[5] = queryClient;
|
|
602
|
+
$[6] = queryKey;
|
|
603
|
+
$[7] = stored;
|
|
604
|
+
$[8] = t3;
|
|
605
|
+
} else t3 = $[8];
|
|
606
|
+
const toggleSection = t3;
|
|
607
|
+
let t4;
|
|
608
|
+
if ($[9] !== isLoading || $[10] !== isSectionCollapsed || $[11] !== toggleSection) {
|
|
609
|
+
t4 = {
|
|
610
|
+
isSectionCollapsed,
|
|
611
|
+
toggleSection,
|
|
612
|
+
isLoading
|
|
613
|
+
};
|
|
614
|
+
$[9] = isLoading;
|
|
615
|
+
$[10] = isSectionCollapsed;
|
|
616
|
+
$[11] = toggleSection;
|
|
617
|
+
$[12] = t4;
|
|
618
|
+
} else t4 = $[12];
|
|
619
|
+
return t4;
|
|
620
|
+
}
|
|
621
|
+
function NavGroup(t0) {
|
|
622
|
+
const $ = c(26);
|
|
623
|
+
const { group, activeRoute, LinkComponent, renderNavItem, basePath, useActiveProps, isSectionCollapsed, toggleSection, depth: t1 } = t0;
|
|
624
|
+
const depth = t1 === void 0 ? 0 : t1;
|
|
625
|
+
const isCollapsed = isSectionCollapsed(group.id, group.collapsible);
|
|
626
|
+
const resolveText = useResolveText();
|
|
627
|
+
let t2;
|
|
628
|
+
if ($[0] !== group.label || $[1] !== resolveText) {
|
|
629
|
+
t2 = resolveText(group.label);
|
|
630
|
+
$[0] = group.label;
|
|
631
|
+
$[1] = resolveText;
|
|
632
|
+
$[2] = t2;
|
|
633
|
+
} else t2 = $[2];
|
|
634
|
+
const groupLabel = t2;
|
|
635
|
+
let t3;
|
|
636
|
+
if ($[3] !== group.items) {
|
|
637
|
+
t3 = group.items ?? [];
|
|
638
|
+
$[3] = group.items;
|
|
639
|
+
$[4] = t3;
|
|
640
|
+
} else t3 = $[4];
|
|
641
|
+
const items = t3;
|
|
642
|
+
let t4;
|
|
643
|
+
if ($[5] !== group.sections) {
|
|
644
|
+
t4 = group.sections ?? [];
|
|
645
|
+
$[5] = group.sections;
|
|
646
|
+
$[6] = t4;
|
|
647
|
+
} else t4 = $[6];
|
|
648
|
+
const sections = t4;
|
|
649
|
+
const hasContent = items.length > 0 || sections.length > 0;
|
|
650
|
+
const T0 = SidebarGroup;
|
|
651
|
+
const t5 = "qa-sidebar__group";
|
|
652
|
+
const t6 = groupLabel && /* @__PURE__ */ jsxs(SidebarGroupLabel, {
|
|
653
|
+
className: cn("qa-sidebar__group-label mt-2 gap-2 px-3", group.collapsible && "hover:text-sidebar-foreground cursor-pointer", depth > 0 && "pl-6"),
|
|
654
|
+
role: group.collapsible ? "button" : void 0,
|
|
655
|
+
tabIndex: group.collapsible ? 0 : void 0,
|
|
656
|
+
"aria-expanded": group.collapsible ? !isCollapsed : void 0,
|
|
657
|
+
onClick: group.collapsible && group.id ? () => toggleSection(group.id) : void 0,
|
|
658
|
+
onKeyDown: group.collapsible && group.id ? (e) => {
|
|
659
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
660
|
+
e.preventDefault();
|
|
661
|
+
toggleSection(group.id);
|
|
662
|
+
}
|
|
663
|
+
} : void 0,
|
|
664
|
+
children: [
|
|
665
|
+
group.icon && /* @__PURE__ */ jsx(RenderIcon, {
|
|
666
|
+
icon: group.icon,
|
|
667
|
+
className: "size-3.5"
|
|
668
|
+
}),
|
|
669
|
+
/* @__PURE__ */ jsx("span", {
|
|
670
|
+
className: "flex-1 text-left font-mono",
|
|
671
|
+
children: groupLabel
|
|
672
|
+
}),
|
|
673
|
+
group.collapsible && /* @__PURE__ */ jsx(Icon, {
|
|
674
|
+
icon: "ph:caret-down",
|
|
675
|
+
className: cn("size-3.5 transition-transform", isCollapsed && "-rotate-90"),
|
|
676
|
+
"aria-hidden": "true"
|
|
677
|
+
})
|
|
678
|
+
]
|
|
679
|
+
});
|
|
680
|
+
let t7;
|
|
681
|
+
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) {
|
|
682
|
+
t7 = !isCollapsed && hasContent && /* @__PURE__ */ jsxs(SidebarGroupContent, {
|
|
683
|
+
className: cn(depth > 0 && "pl-3"),
|
|
684
|
+
children: [items.length > 0 && /* @__PURE__ */ jsx(SidebarMenu, { children: items.map((element, elementIndex) => {
|
|
685
|
+
if (!isNavigationItem(element)) return /* @__PURE__ */ jsx(SidebarSeparator, { className: "my-2" }, `${group.id ?? groupLabel ?? "group"}-divider-${elementIndex}`);
|
|
686
|
+
const shouldUseExact = element.type === "link" || element.type === "page";
|
|
687
|
+
return /* @__PURE__ */ jsx(NavItem, {
|
|
688
|
+
item: element,
|
|
689
|
+
isActive: isRouteActive(activeRoute, element.href, basePath, shouldUseExact),
|
|
690
|
+
LinkComponent,
|
|
691
|
+
renderNavItem,
|
|
692
|
+
useActiveProps,
|
|
693
|
+
depth
|
|
694
|
+
}, element.id);
|
|
695
|
+
}) }), sections.map((subSection) => /* @__PURE__ */ jsx(NavGroup, {
|
|
696
|
+
group: subSection,
|
|
697
|
+
activeRoute,
|
|
698
|
+
LinkComponent,
|
|
699
|
+
renderNavItem,
|
|
700
|
+
basePath,
|
|
701
|
+
useActiveProps,
|
|
702
|
+
isSectionCollapsed,
|
|
703
|
+
toggleSection,
|
|
704
|
+
depth: depth + 1
|
|
705
|
+
}, subSection.id))]
|
|
706
|
+
});
|
|
707
|
+
$[7] = LinkComponent;
|
|
708
|
+
$[8] = activeRoute;
|
|
709
|
+
$[9] = basePath;
|
|
710
|
+
$[10] = depth;
|
|
711
|
+
$[11] = group.id;
|
|
712
|
+
$[12] = groupLabel;
|
|
713
|
+
$[13] = hasContent;
|
|
714
|
+
$[14] = isCollapsed;
|
|
715
|
+
$[15] = isSectionCollapsed;
|
|
716
|
+
$[16] = items;
|
|
717
|
+
$[17] = renderNavItem;
|
|
718
|
+
$[18] = sections;
|
|
719
|
+
$[19] = toggleSection;
|
|
720
|
+
$[20] = useActiveProps;
|
|
721
|
+
$[21] = t7;
|
|
722
|
+
} else t7 = $[21];
|
|
723
|
+
let t8;
|
|
724
|
+
if ($[22] !== T0 || $[23] !== t6 || $[24] !== t7) {
|
|
725
|
+
t8 = /* @__PURE__ */ jsxs(T0, {
|
|
726
|
+
className: t5,
|
|
727
|
+
children: [t6, t7]
|
|
728
|
+
});
|
|
729
|
+
$[22] = T0;
|
|
730
|
+
$[23] = t6;
|
|
731
|
+
$[24] = t7;
|
|
732
|
+
$[25] = t8;
|
|
733
|
+
} else t8 = $[25];
|
|
734
|
+
return t8;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Loading skeleton for UserFooter
|
|
738
|
+
*/
|
|
739
|
+
function UserFooterSkeleton(t0) {
|
|
740
|
+
const $ = c(8);
|
|
741
|
+
const { collapsed } = t0;
|
|
742
|
+
const t1 = collapsed && "justify-center";
|
|
743
|
+
let t2;
|
|
744
|
+
if ($[0] !== t1) {
|
|
745
|
+
t2 = cn("flex items-center gap-2.5 p-2", t1);
|
|
746
|
+
$[0] = t1;
|
|
747
|
+
$[1] = t2;
|
|
748
|
+
} else t2 = $[1];
|
|
749
|
+
let t3;
|
|
750
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
751
|
+
t3 = /* @__PURE__ */ jsx(Skeleton, { className: "size-8 shrink-0" });
|
|
752
|
+
$[2] = t3;
|
|
753
|
+
} else t3 = $[2];
|
|
754
|
+
let t4;
|
|
755
|
+
if ($[3] !== collapsed) {
|
|
756
|
+
t4 = !collapsed && /* @__PURE__ */ jsxs("div", {
|
|
757
|
+
className: "grid flex-1 gap-1",
|
|
758
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-24" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-2 w-32" })]
|
|
759
|
+
});
|
|
760
|
+
$[3] = collapsed;
|
|
761
|
+
$[4] = t4;
|
|
762
|
+
} else t4 = $[4];
|
|
763
|
+
let t5;
|
|
764
|
+
if ($[5] !== t2 || $[6] !== t4) {
|
|
765
|
+
t5 = /* @__PURE__ */ jsx(SidebarFooter, {
|
|
766
|
+
className: "border-sidebar-border border-t p-2",
|
|
767
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
768
|
+
className: t2,
|
|
769
|
+
children: [t3, t4]
|
|
770
|
+
})
|
|
771
|
+
});
|
|
772
|
+
$[5] = t2;
|
|
773
|
+
$[6] = t4;
|
|
774
|
+
$[7] = t5;
|
|
775
|
+
} else t5 = $[7];
|
|
776
|
+
return t5;
|
|
777
|
+
}
|
|
778
|
+
function UserFooter() {
|
|
779
|
+
const $ = c(84);
|
|
780
|
+
const { state, isMobile, setOpenMobile } = useSidebar();
|
|
781
|
+
const collapsed = state === "collapsed";
|
|
782
|
+
const authClient = useAuthClientSafe();
|
|
783
|
+
const { user, isPending } = useSessionState();
|
|
784
|
+
const navigate = useAdminStore(selectNavigate);
|
|
785
|
+
const basePath = useAdminStore(selectBasePath);
|
|
786
|
+
const admin = useAdminStore(selectAdmin);
|
|
787
|
+
const { t, locale: uiLocale, setLocale: setUiLocale, getLocaleName } = useTranslation();
|
|
788
|
+
const i18nAdapter = useSafeI18n();
|
|
789
|
+
const localeConfig = admin.getLocale();
|
|
790
|
+
const uiLocales = i18nAdapter?.locales ?? localeConfig.supported ?? ["en"];
|
|
791
|
+
const hasMultipleUiLocales = uiLocales.length > 1;
|
|
792
|
+
let t0;
|
|
793
|
+
if ($[0] !== getLocaleName) {
|
|
794
|
+
t0 = (code) => ({
|
|
795
|
+
code,
|
|
796
|
+
label: getLocaleName(code)
|
|
797
|
+
});
|
|
798
|
+
$[0] = getLocaleName;
|
|
799
|
+
$[1] = t0;
|
|
800
|
+
} else t0 = $[1];
|
|
801
|
+
const uiLocaleOptions = uiLocales.map(t0);
|
|
802
|
+
const contentLocales = useSafeContentLocales();
|
|
803
|
+
const contentLocale = useAdminStore(selectContentLocale);
|
|
804
|
+
const setContentLocale = useAdminStore(selectSetContentLocale);
|
|
805
|
+
const hasMultipleContentLocales = (contentLocales?.locales?.length ?? 0) > 1;
|
|
806
|
+
let t1;
|
|
807
|
+
if ($[2] !== isMobile || $[3] !== setOpenMobile) {
|
|
808
|
+
t1 = () => {
|
|
809
|
+
if (isMobile) setOpenMobile(false);
|
|
810
|
+
};
|
|
811
|
+
$[2] = isMobile;
|
|
812
|
+
$[3] = setOpenMobile;
|
|
813
|
+
$[4] = t1;
|
|
814
|
+
} else t1 = $[4];
|
|
815
|
+
const closeSidebarOnMobile = t1;
|
|
816
|
+
let t2;
|
|
817
|
+
if ($[5] !== authClient || $[6] !== basePath || $[7] !== closeSidebarOnMobile || $[8] !== navigate || $[9] !== t) {
|
|
818
|
+
t2 = async () => {
|
|
819
|
+
if (!authClient) return;
|
|
820
|
+
try {
|
|
821
|
+
await authClient.signOut();
|
|
822
|
+
closeSidebarOnMobile();
|
|
823
|
+
navigate(`${basePath}/login`);
|
|
824
|
+
} catch (t3$1) {
|
|
825
|
+
toast.error(t("auth.logoutFailed"));
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
$[5] = authClient;
|
|
829
|
+
$[6] = basePath;
|
|
830
|
+
$[7] = closeSidebarOnMobile;
|
|
831
|
+
$[8] = navigate;
|
|
832
|
+
$[9] = t;
|
|
833
|
+
$[10] = t2;
|
|
834
|
+
} else t2 = $[10];
|
|
835
|
+
const handleLogout = t2;
|
|
836
|
+
let t3;
|
|
837
|
+
if ($[11] !== basePath || $[12] !== closeSidebarOnMobile || $[13] !== navigate || $[14] !== user) {
|
|
838
|
+
t3 = () => {
|
|
839
|
+
if (user?.id) {
|
|
840
|
+
closeSidebarOnMobile();
|
|
841
|
+
navigate(`${basePath}/collections/user/${user.id}`);
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
$[11] = basePath;
|
|
845
|
+
$[12] = closeSidebarOnMobile;
|
|
846
|
+
$[13] = navigate;
|
|
847
|
+
$[14] = user;
|
|
848
|
+
$[15] = t3;
|
|
849
|
+
} else t3 = $[15];
|
|
850
|
+
const handleMyAccount = t3;
|
|
851
|
+
if (isPending) {
|
|
852
|
+
let t4$1;
|
|
853
|
+
if ($[16] !== collapsed) {
|
|
854
|
+
t4$1 = /* @__PURE__ */ jsx(UserFooterSkeleton, { collapsed });
|
|
855
|
+
$[16] = collapsed;
|
|
856
|
+
$[17] = t4$1;
|
|
857
|
+
} else t4$1 = $[17];
|
|
858
|
+
return t4$1;
|
|
859
|
+
}
|
|
860
|
+
if (!authClient || !user) return null;
|
|
861
|
+
let t4;
|
|
862
|
+
if ($[18] !== user.email || $[19] !== user.name) {
|
|
863
|
+
t4 = user.name || user.email?.split("@")[0] || "User";
|
|
864
|
+
$[18] = user.email;
|
|
865
|
+
$[19] = user.name;
|
|
866
|
+
$[20] = t4;
|
|
867
|
+
} else t4 = $[20];
|
|
868
|
+
const displayName = t4;
|
|
869
|
+
const displayEmail = user.email || "";
|
|
870
|
+
const T0 = SidebarFooter;
|
|
871
|
+
const t5 = "qa-sidebar__footer border-sidebar-border border-t p-2";
|
|
872
|
+
const T1 = SidebarMenu;
|
|
873
|
+
const T2 = SidebarMenuItem;
|
|
874
|
+
const T3 = DropdownMenu;
|
|
875
|
+
const t6 = collapsed && "justify-center";
|
|
876
|
+
let t7;
|
|
877
|
+
if ($[21] !== t6) {
|
|
878
|
+
t7 = cn("flex w-full items-center gap-2.5 p-2 text-left transition-colors duration-150", "hover:bg-sidebar-accent text-sidebar-foreground", "focus-visible:ring-sidebar-ring focus-visible:ring-1 focus-visible:outline-none", t6);
|
|
879
|
+
$[21] = t6;
|
|
880
|
+
$[22] = t7;
|
|
881
|
+
} else t7 = $[22];
|
|
882
|
+
let t8;
|
|
883
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
884
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
885
|
+
className: "qa-sidebar__user-avatar bg-sidebar-primary/10 text-sidebar-primary border-sidebar-primary/20 flex size-8 shrink-0 items-center justify-center border",
|
|
886
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
887
|
+
icon: "ph:user-bold",
|
|
888
|
+
className: "size-4"
|
|
889
|
+
})
|
|
890
|
+
});
|
|
891
|
+
$[23] = t8;
|
|
892
|
+
} else t8 = $[23];
|
|
893
|
+
let t9;
|
|
894
|
+
if ($[24] !== collapsed || $[25] !== displayEmail || $[26] !== displayName) {
|
|
895
|
+
t9 = !collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
896
|
+
className: "grid flex-1 text-left leading-tight",
|
|
897
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
898
|
+
className: "qa-sidebar__user-name truncate text-xs font-medium",
|
|
899
|
+
children: displayName
|
|
900
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
901
|
+
className: "qa-sidebar__user-email text-sidebar-foreground/70 truncate text-[10px]",
|
|
902
|
+
children: displayEmail
|
|
903
|
+
})]
|
|
904
|
+
}), /* @__PURE__ */ jsx(Icon, {
|
|
905
|
+
icon: "ph:caret-up-down",
|
|
906
|
+
className: "text-sidebar-foreground/60 ml-auto size-3.5",
|
|
907
|
+
"aria-hidden": "true"
|
|
908
|
+
})] });
|
|
909
|
+
$[24] = collapsed;
|
|
910
|
+
$[25] = displayEmail;
|
|
911
|
+
$[26] = displayName;
|
|
912
|
+
$[27] = t9;
|
|
913
|
+
} else t9 = $[27];
|
|
914
|
+
let t10;
|
|
915
|
+
if ($[28] !== t7 || $[29] !== t9) {
|
|
916
|
+
t10 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
917
|
+
className: t7,
|
|
918
|
+
children: [t8, t9]
|
|
919
|
+
});
|
|
920
|
+
$[28] = t7;
|
|
921
|
+
$[29] = t9;
|
|
922
|
+
$[30] = t10;
|
|
923
|
+
} else t10 = $[30];
|
|
924
|
+
const T4 = DropdownMenuContent;
|
|
925
|
+
const t11 = collapsed ? "right" : "top";
|
|
926
|
+
const t12 = collapsed ? "start" : "start";
|
|
927
|
+
const t13 = "w-56";
|
|
928
|
+
let t14;
|
|
929
|
+
if ($[31] !== displayName) {
|
|
930
|
+
t14 = /* @__PURE__ */ jsx("p", {
|
|
931
|
+
className: "text-xs font-medium",
|
|
932
|
+
children: displayName
|
|
933
|
+
});
|
|
934
|
+
$[31] = displayName;
|
|
935
|
+
$[32] = t14;
|
|
936
|
+
} else t14 = $[32];
|
|
937
|
+
let t15;
|
|
938
|
+
if ($[33] !== displayEmail) {
|
|
939
|
+
t15 = /* @__PURE__ */ jsx("p", {
|
|
940
|
+
className: "text-muted-foreground text-[10px]",
|
|
941
|
+
children: displayEmail
|
|
942
|
+
});
|
|
943
|
+
$[33] = displayEmail;
|
|
944
|
+
$[34] = t15;
|
|
945
|
+
} else t15 = $[34];
|
|
946
|
+
let t16;
|
|
947
|
+
if ($[35] !== user.role) {
|
|
948
|
+
t16 = user.role && /* @__PURE__ */ jsx("p", {
|
|
949
|
+
className: "text-muted-foreground mt-0.5 text-[10px] capitalize",
|
|
950
|
+
children: user.role
|
|
951
|
+
});
|
|
952
|
+
$[35] = user.role;
|
|
953
|
+
$[36] = t16;
|
|
954
|
+
} else t16 = $[36];
|
|
955
|
+
let t17;
|
|
956
|
+
if ($[37] !== t14 || $[38] !== t15 || $[39] !== t16) {
|
|
957
|
+
t17 = /* @__PURE__ */ jsxs("div", {
|
|
958
|
+
className: "px-2 py-1.5",
|
|
959
|
+
children: [
|
|
960
|
+
t14,
|
|
961
|
+
t15,
|
|
962
|
+
t16
|
|
963
|
+
]
|
|
964
|
+
});
|
|
965
|
+
$[37] = t14;
|
|
966
|
+
$[38] = t15;
|
|
967
|
+
$[39] = t16;
|
|
968
|
+
$[40] = t17;
|
|
969
|
+
} else t17 = $[40];
|
|
970
|
+
let t18;
|
|
971
|
+
if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
|
|
972
|
+
t18 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
|
|
973
|
+
$[41] = t18;
|
|
974
|
+
} else t18 = $[41];
|
|
975
|
+
let t19;
|
|
976
|
+
if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
|
|
977
|
+
t19 = /* @__PURE__ */ jsx(Icon, {
|
|
978
|
+
icon: "ph:user-circle",
|
|
979
|
+
className: "size-4"
|
|
980
|
+
});
|
|
981
|
+
$[42] = t19;
|
|
982
|
+
} else t19 = $[42];
|
|
983
|
+
let t20;
|
|
984
|
+
if ($[43] !== t) {
|
|
985
|
+
t20 = t("auth.myAccount");
|
|
986
|
+
$[43] = t;
|
|
987
|
+
$[44] = t20;
|
|
988
|
+
} else t20 = $[44];
|
|
989
|
+
let t21;
|
|
990
|
+
if ($[45] !== handleMyAccount || $[46] !== t20) {
|
|
991
|
+
t21 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
992
|
+
onClick: handleMyAccount,
|
|
993
|
+
children: [t19, t20]
|
|
994
|
+
});
|
|
995
|
+
$[45] = handleMyAccount;
|
|
996
|
+
$[46] = t20;
|
|
997
|
+
$[47] = t21;
|
|
998
|
+
} else t21 = $[47];
|
|
999
|
+
const t22 = 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, {
|
|
1000
|
+
onClick: () => setUiLocale(locale.code),
|
|
1001
|
+
children: [
|
|
1002
|
+
/* @__PURE__ */ jsx("img", {
|
|
1003
|
+
src: getFlagUrl(locale.code),
|
|
1004
|
+
alt: locale.code,
|
|
1005
|
+
className: "h-3 w-4 object-cover",
|
|
1006
|
+
onError: _temp5
|
|
1007
|
+
}),
|
|
1008
|
+
/* @__PURE__ */ jsx("span", {
|
|
1009
|
+
className: "w-6 text-xs font-medium uppercase",
|
|
1010
|
+
children: locale.code
|
|
1011
|
+
}),
|
|
1012
|
+
/* @__PURE__ */ jsx("span", {
|
|
1013
|
+
className: "flex-1",
|
|
1014
|
+
children: locale.label
|
|
1015
|
+
}),
|
|
1016
|
+
locale.code === uiLocale && /* @__PURE__ */ jsx(Icon, {
|
|
1017
|
+
icon: "ph:check",
|
|
1018
|
+
className: "text-primary size-4"
|
|
1019
|
+
})
|
|
1020
|
+
]
|
|
1021
|
+
}, locale.code)) })] });
|
|
1022
|
+
let t23;
|
|
1023
|
+
if ($[48] !== contentLocale || $[49] !== contentLocales || $[50] !== hasMultipleContentLocales || $[51] !== setContentLocale || $[52] !== t) {
|
|
1024
|
+
t23 = 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, {
|
|
1025
|
+
onClick: () => setContentLocale(locale_0.code),
|
|
1026
|
+
children: [
|
|
1027
|
+
/* @__PURE__ */ jsx("img", {
|
|
1028
|
+
src: getFlagUrl(locale_0.flagCountryCode ?? locale_0.code),
|
|
1029
|
+
alt: locale_0.code,
|
|
1030
|
+
className: "h-3 w-4 object-cover",
|
|
1031
|
+
onError: _temp6
|
|
1032
|
+
}),
|
|
1033
|
+
/* @__PURE__ */ jsx("span", {
|
|
1034
|
+
className: "w-6 text-xs font-medium uppercase",
|
|
1035
|
+
children: locale_0.code
|
|
1036
|
+
}),
|
|
1037
|
+
/* @__PURE__ */ jsx("span", {
|
|
1038
|
+
className: "flex-1",
|
|
1039
|
+
children: locale_0.label ?? locale_0.code
|
|
1040
|
+
}),
|
|
1041
|
+
locale_0.code === contentLocale && /* @__PURE__ */ jsx(Icon, {
|
|
1042
|
+
icon: "ph:check",
|
|
1043
|
+
className: "text-primary size-4"
|
|
1044
|
+
})
|
|
1045
|
+
]
|
|
1046
|
+
}, locale_0.code)) })] });
|
|
1047
|
+
$[48] = contentLocale;
|
|
1048
|
+
$[49] = contentLocales;
|
|
1049
|
+
$[50] = hasMultipleContentLocales;
|
|
1050
|
+
$[51] = setContentLocale;
|
|
1051
|
+
$[52] = t;
|
|
1052
|
+
$[53] = t23;
|
|
1053
|
+
} else t23 = $[53];
|
|
1054
|
+
let t24;
|
|
1055
|
+
if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1056
|
+
t24 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
|
|
1057
|
+
$[54] = t24;
|
|
1058
|
+
} else t24 = $[54];
|
|
1059
|
+
let t25;
|
|
1060
|
+
if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1061
|
+
t25 = /* @__PURE__ */ jsx(Icon, {
|
|
1062
|
+
icon: "ph:sign-out",
|
|
1063
|
+
className: "size-4"
|
|
1064
|
+
});
|
|
1065
|
+
$[55] = t25;
|
|
1066
|
+
} else t25 = $[55];
|
|
1067
|
+
let t26;
|
|
1068
|
+
if ($[56] !== t) {
|
|
1069
|
+
t26 = t("auth.logout");
|
|
1070
|
+
$[56] = t;
|
|
1071
|
+
$[57] = t26;
|
|
1072
|
+
} else t26 = $[57];
|
|
1073
|
+
let t27;
|
|
1074
|
+
if ($[58] !== handleLogout || $[59] !== t26) {
|
|
1075
|
+
t27 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
1076
|
+
variant: "destructive",
|
|
1077
|
+
onClick: handleLogout,
|
|
1078
|
+
children: [t25, t26]
|
|
1079
|
+
});
|
|
1080
|
+
$[58] = handleLogout;
|
|
1081
|
+
$[59] = t26;
|
|
1082
|
+
$[60] = t27;
|
|
1083
|
+
} else t27 = $[60];
|
|
1084
|
+
let t28;
|
|
1085
|
+
if ($[61] !== T4 || $[62] !== t11 || $[63] !== t12 || $[64] !== t17 || $[65] !== t18 || $[66] !== t21 || $[67] !== t22 || $[68] !== t23 || $[69] !== t27) {
|
|
1086
|
+
t28 = /* @__PURE__ */ jsxs(T4, {
|
|
1087
|
+
side: t11,
|
|
1088
|
+
align: t12,
|
|
1089
|
+
className: t13,
|
|
1090
|
+
children: [
|
|
1091
|
+
t17,
|
|
1092
|
+
t18,
|
|
1093
|
+
t21,
|
|
1094
|
+
t22,
|
|
1095
|
+
t23,
|
|
1096
|
+
t24,
|
|
1097
|
+
t27
|
|
1098
|
+
]
|
|
1099
|
+
});
|
|
1100
|
+
$[61] = T4;
|
|
1101
|
+
$[62] = t11;
|
|
1102
|
+
$[63] = t12;
|
|
1103
|
+
$[64] = t17;
|
|
1104
|
+
$[65] = t18;
|
|
1105
|
+
$[66] = t21;
|
|
1106
|
+
$[67] = t22;
|
|
1107
|
+
$[68] = t23;
|
|
1108
|
+
$[69] = t27;
|
|
1109
|
+
$[70] = t28;
|
|
1110
|
+
} else t28 = $[70];
|
|
1111
|
+
let t29;
|
|
1112
|
+
if ($[71] !== T3 || $[72] !== t10 || $[73] !== t28) {
|
|
1113
|
+
t29 = /* @__PURE__ */ jsxs(T3, { children: [t10, t28] });
|
|
1114
|
+
$[71] = T3;
|
|
1115
|
+
$[72] = t10;
|
|
1116
|
+
$[73] = t28;
|
|
1117
|
+
$[74] = t29;
|
|
1118
|
+
} else t29 = $[74];
|
|
1119
|
+
let t30;
|
|
1120
|
+
if ($[75] !== T2 || $[76] !== t29) {
|
|
1121
|
+
t30 = /* @__PURE__ */ jsx(T2, { children: t29 });
|
|
1122
|
+
$[75] = T2;
|
|
1123
|
+
$[76] = t29;
|
|
1124
|
+
$[77] = t30;
|
|
1125
|
+
} else t30 = $[77];
|
|
1126
|
+
let t31;
|
|
1127
|
+
if ($[78] !== T1 || $[79] !== t30) {
|
|
1128
|
+
t31 = /* @__PURE__ */ jsx(T1, { children: t30 });
|
|
1129
|
+
$[78] = T1;
|
|
1130
|
+
$[79] = t30;
|
|
1131
|
+
$[80] = t31;
|
|
1132
|
+
} else t31 = $[80];
|
|
1133
|
+
let t32;
|
|
1134
|
+
if ($[81] !== T0 || $[82] !== t31) {
|
|
1135
|
+
t32 = /* @__PURE__ */ jsx(T0, {
|
|
1136
|
+
className: t5,
|
|
1137
|
+
children: t31
|
|
1138
|
+
});
|
|
1139
|
+
$[81] = T0;
|
|
1140
|
+
$[82] = t31;
|
|
1141
|
+
$[83] = t32;
|
|
1142
|
+
} else t32 = $[83];
|
|
1143
|
+
return t32;
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* AdminSidebar Component
|
|
1147
|
+
*
|
|
1148
|
+
* When used inside AdminProvider, navigation and brandName are automatically
|
|
1149
|
+
* read from context if not provided as props.
|
|
1150
|
+
*
|
|
1151
|
+
* @example
|
|
1152
|
+
* ```tsx
|
|
1153
|
+
* // With AdminProvider (automatic)
|
|
1154
|
+
* <AdminProvider admin={admin} client={client}>
|
|
1155
|
+
* <SidebarProvider>
|
|
1156
|
+
* <AdminSidebar LinkComponent={Link} activeRoute="/admin/posts" />
|
|
1157
|
+
* </SidebarProvider>
|
|
1158
|
+
* </AdminProvider>
|
|
1159
|
+
*
|
|
1160
|
+
* // Without AdminProvider (manual)
|
|
1161
|
+
* <SidebarProvider>
|
|
1162
|
+
* <AdminSidebar
|
|
1163
|
+
* LinkComponent={Link}
|
|
1164
|
+
* activeRoute="/admin/posts"
|
|
1165
|
+
* brandName="My App"
|
|
1166
|
+
* />
|
|
1167
|
+
* </SidebarProvider>
|
|
1168
|
+
* ```
|
|
1169
|
+
*/
|
|
1170
|
+
function _temp6(e_0) {
|
|
1171
|
+
e_0.currentTarget.style.display = "none";
|
|
1172
|
+
}
|
|
1173
|
+
function _temp5(e) {
|
|
1174
|
+
e.currentTarget.style.display = "none";
|
|
1175
|
+
}
|
|
1176
|
+
function AdminSidebar(t0) {
|
|
1177
|
+
const $ = c(63);
|
|
1178
|
+
const { LinkComponent, activeRoute, basePath: t1, brandName: brandNameProp, className, renderBrand, renderNavItem, footer, afterBrand, beforeFooter, useActiveProps: t2 } = t0;
|
|
1179
|
+
const basePath = t1 === void 0 ? "/admin" : t1;
|
|
1180
|
+
const useActiveProps = t2 === void 0 ? true : t2;
|
|
1181
|
+
let t3;
|
|
1182
|
+
if ($[0] !== brandNameProp) {
|
|
1183
|
+
t3 = { brandName: brandNameProp };
|
|
1184
|
+
$[0] = brandNameProp;
|
|
1185
|
+
$[1] = t3;
|
|
1186
|
+
} else t3 = $[1];
|
|
1187
|
+
const { navigation, brandName } = useSidebarProps(t3);
|
|
1188
|
+
const { state, isMobile, setOpenMobile } = useSidebar();
|
|
1189
|
+
const collapsed = state === "collapsed";
|
|
1190
|
+
const { isSectionCollapsed, toggleSection } = useSidebarCollapsedSections();
|
|
1191
|
+
let t4;
|
|
1192
|
+
if ($[2] !== isMobile || $[3] !== setOpenMobile) {
|
|
1193
|
+
t4 = () => {
|
|
1194
|
+
if (isMobile) setOpenMobile(false);
|
|
1195
|
+
};
|
|
1196
|
+
$[2] = isMobile;
|
|
1197
|
+
$[3] = setOpenMobile;
|
|
1198
|
+
$[4] = t4;
|
|
1199
|
+
} else t4 = $[4];
|
|
1200
|
+
const handleBrandClick = t4;
|
|
1201
|
+
let t5;
|
|
1202
|
+
if ($[5] !== brandName || $[6] !== collapsed || $[7] !== renderBrand) {
|
|
1203
|
+
t5 = renderBrand ? renderBrand({
|
|
1204
|
+
name: brandName,
|
|
1205
|
+
collapsed
|
|
1206
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(QuestpieSymbol, {}), !collapsed && /* @__PURE__ */ jsx("div", {
|
|
1207
|
+
className: "grid flex-1 text-left leading-tight",
|
|
1208
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
1209
|
+
className: "truncate font-bold tracking-tight",
|
|
1210
|
+
children: brandName
|
|
1211
|
+
})
|
|
1212
|
+
})] });
|
|
1213
|
+
$[5] = brandName;
|
|
1214
|
+
$[6] = collapsed;
|
|
1215
|
+
$[7] = renderBrand;
|
|
1216
|
+
$[8] = t5;
|
|
1217
|
+
} else t5 = $[8];
|
|
1218
|
+
const brandContent = t5;
|
|
1219
|
+
const t6 = collapsed && "justify-center";
|
|
1220
|
+
let t7;
|
|
1221
|
+
if ($[9] !== t6) {
|
|
1222
|
+
t7 = cn("qa-sidebar__brand flex items-center gap-2.5 p-2 transition-colors duration-150", "hover:bg-sidebar-accent", t6);
|
|
1223
|
+
$[9] = t6;
|
|
1224
|
+
$[10] = t7;
|
|
1225
|
+
} else t7 = $[10];
|
|
1226
|
+
let t8;
|
|
1227
|
+
if ($[11] !== LinkComponent || $[12] !== basePath || $[13] !== brandContent || $[14] !== t7) {
|
|
1228
|
+
t8 = /* @__PURE__ */ jsx(LinkComponent, {
|
|
1229
|
+
to: basePath,
|
|
1230
|
+
className: t7,
|
|
1231
|
+
children: brandContent
|
|
1232
|
+
});
|
|
1233
|
+
$[11] = LinkComponent;
|
|
1234
|
+
$[12] = basePath;
|
|
1235
|
+
$[13] = brandContent;
|
|
1236
|
+
$[14] = t7;
|
|
1237
|
+
$[15] = t8;
|
|
1238
|
+
} else t8 = $[15];
|
|
1239
|
+
const brandLink = t8;
|
|
1240
|
+
let t9;
|
|
1241
|
+
if ($[16] !== className) {
|
|
1242
|
+
t9 = cn("qa-sidebar", className);
|
|
1243
|
+
$[16] = className;
|
|
1244
|
+
$[17] = t9;
|
|
1245
|
+
} else t9 = $[17];
|
|
1246
|
+
let t10;
|
|
1247
|
+
if ($[18] !== LinkComponent || $[19] !== basePath || $[20] !== brandLink || $[21] !== brandName || $[22] !== collapsed || $[23] !== isMobile || $[24] !== renderBrand) {
|
|
1248
|
+
t10 = collapsed && !isMobile ? /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(LinkComponent, {
|
|
1249
|
+
to: basePath,
|
|
1250
|
+
className: cn("flex items-center gap-2.5 p-2 transition-colors duration-150", "hover:bg-sidebar-accent", "justify-center"),
|
|
1251
|
+
children: renderBrand ? renderBrand({
|
|
1252
|
+
name: brandName,
|
|
1253
|
+
collapsed: true
|
|
1254
|
+
}) : /* @__PURE__ */ jsx(QuestpieSymbol, {})
|
|
1255
|
+
}) }), /* @__PURE__ */ jsx(TooltipContent, {
|
|
1256
|
+
side: "right",
|
|
1257
|
+
children: brandName
|
|
1258
|
+
})] }) : brandLink;
|
|
1259
|
+
$[18] = LinkComponent;
|
|
1260
|
+
$[19] = basePath;
|
|
1261
|
+
$[20] = brandLink;
|
|
1262
|
+
$[21] = brandName;
|
|
1263
|
+
$[22] = collapsed;
|
|
1264
|
+
$[23] = isMobile;
|
|
1265
|
+
$[24] = renderBrand;
|
|
1266
|
+
$[25] = t10;
|
|
1267
|
+
} else t10 = $[25];
|
|
1268
|
+
let t11;
|
|
1269
|
+
if ($[26] !== handleBrandClick || $[27] !== t10) {
|
|
1270
|
+
t11 = /* @__PURE__ */ jsx(SidebarHeader, {
|
|
1271
|
+
className: "qa-sidebar__header border-sidebar-border border-b p-2",
|
|
1272
|
+
children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, {
|
|
1273
|
+
onClickCapture: handleBrandClick,
|
|
1274
|
+
children: t10
|
|
1275
|
+
}) })
|
|
1276
|
+
});
|
|
1277
|
+
$[26] = handleBrandClick;
|
|
1278
|
+
$[27] = t10;
|
|
1279
|
+
$[28] = t11;
|
|
1280
|
+
} else t11 = $[28];
|
|
1281
|
+
let t12;
|
|
1282
|
+
if ($[29] !== afterBrand || $[30] !== collapsed) {
|
|
1283
|
+
t12 = afterBrand && !collapsed && /* @__PURE__ */ jsx("div", {
|
|
1284
|
+
className: "qa-sidebar__after-brand border-sidebar-border border-b px-3 py-2",
|
|
1285
|
+
children: afterBrand
|
|
1286
|
+
});
|
|
1287
|
+
$[29] = afterBrand;
|
|
1288
|
+
$[30] = collapsed;
|
|
1289
|
+
$[31] = t12;
|
|
1290
|
+
} else t12 = $[31];
|
|
1291
|
+
let t13;
|
|
1292
|
+
if ($[32] !== LinkComponent || $[33] !== activeRoute || $[34] !== basePath || $[35] !== isSectionCollapsed || $[36] !== navigation || $[37] !== renderNavItem || $[38] !== toggleSection || $[39] !== useActiveProps) {
|
|
1293
|
+
let t14$1;
|
|
1294
|
+
if ($[41] !== LinkComponent || $[42] !== activeRoute || $[43] !== basePath || $[44] !== isSectionCollapsed || $[45] !== renderNavItem || $[46] !== toggleSection || $[47] !== useActiveProps) {
|
|
1295
|
+
t14$1 = (group, index) => /* @__PURE__ */ jsx(NavGroup, {
|
|
1296
|
+
group,
|
|
1297
|
+
activeRoute,
|
|
1298
|
+
LinkComponent,
|
|
1299
|
+
renderNavItem,
|
|
1300
|
+
basePath,
|
|
1301
|
+
useActiveProps,
|
|
1302
|
+
isSectionCollapsed,
|
|
1303
|
+
toggleSection
|
|
1304
|
+
}, group.id ?? `group-${index}`);
|
|
1305
|
+
$[41] = LinkComponent;
|
|
1306
|
+
$[42] = activeRoute;
|
|
1307
|
+
$[43] = basePath;
|
|
1308
|
+
$[44] = isSectionCollapsed;
|
|
1309
|
+
$[45] = renderNavItem;
|
|
1310
|
+
$[46] = toggleSection;
|
|
1311
|
+
$[47] = useActiveProps;
|
|
1312
|
+
$[48] = t14$1;
|
|
1313
|
+
} else t14$1 = $[48];
|
|
1314
|
+
t13 = navigation.map(t14$1);
|
|
1315
|
+
$[32] = LinkComponent;
|
|
1316
|
+
$[33] = activeRoute;
|
|
1317
|
+
$[34] = basePath;
|
|
1318
|
+
$[35] = isSectionCollapsed;
|
|
1319
|
+
$[36] = navigation;
|
|
1320
|
+
$[37] = renderNavItem;
|
|
1321
|
+
$[38] = toggleSection;
|
|
1322
|
+
$[39] = useActiveProps;
|
|
1323
|
+
$[40] = t13;
|
|
1324
|
+
} else t13 = $[40];
|
|
1325
|
+
let t14;
|
|
1326
|
+
if ($[49] !== t13) {
|
|
1327
|
+
t14 = /* @__PURE__ */ jsx(SidebarContent, {
|
|
1328
|
+
className: "qa-sidebar__content",
|
|
1329
|
+
children: /* @__PURE__ */ jsx("nav", {
|
|
1330
|
+
"aria-label": "Admin navigation",
|
|
1331
|
+
className: "qa-sidebar__nav",
|
|
1332
|
+
children: t13
|
|
1333
|
+
})
|
|
1334
|
+
});
|
|
1335
|
+
$[49] = t13;
|
|
1336
|
+
$[50] = t14;
|
|
1337
|
+
} else t14 = $[50];
|
|
1338
|
+
let t15;
|
|
1339
|
+
if ($[51] !== beforeFooter || $[52] !== collapsed) {
|
|
1340
|
+
t15 = beforeFooter && !collapsed && /* @__PURE__ */ jsx("div", {
|
|
1341
|
+
className: "qa-sidebar__before-footer border-sidebar-border border-t px-3 py-2",
|
|
1342
|
+
children: beforeFooter
|
|
1343
|
+
});
|
|
1344
|
+
$[51] = beforeFooter;
|
|
1345
|
+
$[52] = collapsed;
|
|
1346
|
+
$[53] = t15;
|
|
1347
|
+
} else t15 = $[53];
|
|
1348
|
+
let t16;
|
|
1349
|
+
if ($[54] !== footer) {
|
|
1350
|
+
t16 = footer ?? /* @__PURE__ */ jsx(UserFooter, {});
|
|
1351
|
+
$[54] = footer;
|
|
1352
|
+
$[55] = t16;
|
|
1353
|
+
} else t16 = $[55];
|
|
1354
|
+
let t17;
|
|
1355
|
+
if ($[56] !== t11 || $[57] !== t12 || $[58] !== t14 || $[59] !== t15 || $[60] !== t16 || $[61] !== t9) {
|
|
1356
|
+
t17 = /* @__PURE__ */ jsxs(Sidebar, {
|
|
1357
|
+
collapsible: "icon",
|
|
1358
|
+
className: t9,
|
|
1359
|
+
children: [
|
|
1360
|
+
t11,
|
|
1361
|
+
t12,
|
|
1362
|
+
t14,
|
|
1363
|
+
t15,
|
|
1364
|
+
t16
|
|
1365
|
+
]
|
|
1366
|
+
});
|
|
1367
|
+
$[56] = t11;
|
|
1368
|
+
$[57] = t12;
|
|
1369
|
+
$[58] = t14;
|
|
1370
|
+
$[59] = t15;
|
|
1371
|
+
$[60] = t16;
|
|
1372
|
+
$[61] = t9;
|
|
1373
|
+
$[62] = t17;
|
|
1374
|
+
} else t17 = $[62];
|
|
1375
|
+
return t17;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
//#endregion
|
|
1379
|
+
export { AdminSidebar };
|