@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-B4H3amCD.d.mts","names":[],"sources":["../src/server/auth-helpers.ts","../src/server/modules/admin-preferences/collections/saved-views.collection.ts","../src/server/modules/admin/functions/preview.ts","../src/server/modules/admin/functions/setup.ts","../src/server/modules/admin/index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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAd1r0a,WAAA,CAAA"}
|
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import { a as selectBasePath, b as useTranslation, f as useAdminStore, g as cn, h as Button, l as selectNavigate, o as selectBrandName, s as selectClient } from "./content-locales-provider-BXvuIgfg.mjs";
|
|
2
|
-
import { a as FieldContent, c as FieldGroup, f as Input, i as Field, l as FieldLabel, n as Alert, r as AlertDescription, s as FieldError, t as AuthLayout } from "./auth-layout-M8K8_q5R.mjs";
|
|
3
|
-
import { n as useAuthClient } from "./use-auth-BoLmWtmU.mjs";
|
|
4
|
-
import { Envelope, Lock, SpinnerGap, WarningCircle } from "@phosphor-icons/react";
|
|
5
|
-
import * as React$1 from "react";
|
|
6
|
-
import { useForm } from "react-hook-form";
|
|
7
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { useQuery } from "@tanstack/react-query";
|
|
9
|
-
|
|
10
|
-
//#region src/client/hooks/use-setup-status.ts
|
|
11
|
-
/**
|
|
12
|
-
* Setup Status Hook
|
|
13
|
-
*
|
|
14
|
-
* Hook to check if the CMS setup is required (no users exist).
|
|
15
|
-
* Useful for redirecting to setup page on first visit.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Check if CMS setup is required.
|
|
19
|
-
*
|
|
20
|
-
* Returns `required: true` if no users exist in the system,
|
|
21
|
-
* meaning the setup page should be shown to create the first admin.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```tsx
|
|
25
|
-
* function App() {
|
|
26
|
-
* const { data, isLoading } = useSetupStatus();
|
|
27
|
-
*
|
|
28
|
-
* if (isLoading) return <LoadingSpinner />;
|
|
29
|
-
*
|
|
30
|
-
* if (data?.required) {
|
|
31
|
-
* return <Navigate to="/admin/setup" />;
|
|
32
|
-
* }
|
|
33
|
-
*
|
|
34
|
-
* return <AdminPanel />;
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
function useSetupStatus() {
|
|
39
|
-
const client = useAdminStore(selectClient);
|
|
40
|
-
return useQuery({
|
|
41
|
-
queryKey: ["questpie", "setup-status"],
|
|
42
|
-
queryFn: async () => {
|
|
43
|
-
try {
|
|
44
|
-
return { required: (await client.functions.isSetupRequired({})).required };
|
|
45
|
-
} catch {
|
|
46
|
-
return { required: false };
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
staleTime: 1e3 * 60,
|
|
50
|
-
retry: false
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/client/views/auth/login-form.tsx
|
|
56
|
-
/**
|
|
57
|
-
* Login Form - email/password authentication
|
|
58
|
-
*/
|
|
59
|
-
/**
|
|
60
|
-
* Login form with email and password fields
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```tsx
|
|
64
|
-
* const authClient = createAdminAuthClient<typeof cms>({ baseURL: '...' })
|
|
65
|
-
*
|
|
66
|
-
* function LoginPage() {
|
|
67
|
-
* const [error, setError] = useState<string | null>(null)
|
|
68
|
-
*
|
|
69
|
-
* const handleLogin = async (values: LoginFormValues) => {
|
|
70
|
-
* const result = await authClient.signIn.email({
|
|
71
|
-
* email: values.email,
|
|
72
|
-
* password: values.password,
|
|
73
|
-
* })
|
|
74
|
-
* if (result.error) {
|
|
75
|
-
* setError(result.error.message)
|
|
76
|
-
* }
|
|
77
|
-
* }
|
|
78
|
-
*
|
|
79
|
-
* return (
|
|
80
|
-
* <AuthLayout title="Sign in">
|
|
81
|
-
* <LoginForm onSubmit={handleLogin} error={error} />
|
|
82
|
-
* </AuthLayout>
|
|
83
|
-
* )
|
|
84
|
-
* }
|
|
85
|
-
* ```
|
|
86
|
-
*/
|
|
87
|
-
function LoginForm({ onSubmit, onSignUpClick, onForgotPasswordClick, showRememberMe = false, showSignUp = true, showForgotPassword = true, defaultValues, className, error }) {
|
|
88
|
-
const { t } = useTranslation();
|
|
89
|
-
const { register, handleSubmit, formState: { errors, isSubmitting } } = useForm({ defaultValues: {
|
|
90
|
-
email: "",
|
|
91
|
-
password: "",
|
|
92
|
-
rememberMe: false,
|
|
93
|
-
...defaultValues
|
|
94
|
-
} });
|
|
95
|
-
return /* @__PURE__ */ jsxs("form", {
|
|
96
|
-
onSubmit: handleSubmit(async (values) => {
|
|
97
|
-
await onSubmit(values);
|
|
98
|
-
}),
|
|
99
|
-
className: cn("space-y-4", className),
|
|
100
|
-
children: [
|
|
101
|
-
/* @__PURE__ */ jsxs(FieldGroup, { children: [
|
|
102
|
-
/* @__PURE__ */ jsxs(Field, {
|
|
103
|
-
"data-invalid": !!errors.email,
|
|
104
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
105
|
-
htmlFor: "email",
|
|
106
|
-
children: t("auth.email")
|
|
107
|
-
}), /* @__PURE__ */ jsxs(FieldContent, { children: [/* @__PURE__ */ jsxs("div", {
|
|
108
|
-
className: "relative",
|
|
109
|
-
children: [/* @__PURE__ */ jsx(Envelope, {
|
|
110
|
-
className: "text-muted-foreground absolute left-2 top-1/2 size-4 -translate-y-1/2",
|
|
111
|
-
weight: "duotone"
|
|
112
|
-
}), /* @__PURE__ */ jsx(Input, {
|
|
113
|
-
id: "email",
|
|
114
|
-
type: "email",
|
|
115
|
-
placeholder: t("auth.emailPlaceholder"),
|
|
116
|
-
className: "pl-8",
|
|
117
|
-
autoComplete: "email",
|
|
118
|
-
"aria-invalid": !!errors.email,
|
|
119
|
-
...register("email", {
|
|
120
|
-
required: t("auth.emailRequired"),
|
|
121
|
-
pattern: {
|
|
122
|
-
value: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
123
|
-
message: t("auth.invalidEmail")
|
|
124
|
-
}
|
|
125
|
-
})
|
|
126
|
-
})]
|
|
127
|
-
}), /* @__PURE__ */ jsx(FieldError, { children: errors.email?.message })] })]
|
|
128
|
-
}),
|
|
129
|
-
/* @__PURE__ */ jsxs(Field, {
|
|
130
|
-
"data-invalid": !!errors.password,
|
|
131
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
132
|
-
htmlFor: "password",
|
|
133
|
-
children: t("auth.password")
|
|
134
|
-
}), /* @__PURE__ */ jsxs(FieldContent, { children: [/* @__PURE__ */ jsxs("div", {
|
|
135
|
-
className: "relative",
|
|
136
|
-
children: [/* @__PURE__ */ jsx(Lock, {
|
|
137
|
-
className: "text-muted-foreground absolute left-2 top-1/2 size-4 -translate-y-1/2",
|
|
138
|
-
weight: "duotone"
|
|
139
|
-
}), /* @__PURE__ */ jsx(Input, {
|
|
140
|
-
id: "password",
|
|
141
|
-
type: "password",
|
|
142
|
-
placeholder: t("auth.passwordPlaceholder"),
|
|
143
|
-
className: "pl-8",
|
|
144
|
-
autoComplete: "current-password",
|
|
145
|
-
"aria-invalid": !!errors.password,
|
|
146
|
-
...register("password", {
|
|
147
|
-
required: t("auth.passwordRequired"),
|
|
148
|
-
minLength: {
|
|
149
|
-
value: 6,
|
|
150
|
-
message: t("auth.passwordMinLength", { min: 6 })
|
|
151
|
-
}
|
|
152
|
-
})
|
|
153
|
-
})]
|
|
154
|
-
}), /* @__PURE__ */ jsx(FieldError, { children: errors.password?.message })] })]
|
|
155
|
-
}),
|
|
156
|
-
(showRememberMe || showForgotPassword) && /* @__PURE__ */ jsxs("div", {
|
|
157
|
-
className: "flex items-center justify-between",
|
|
158
|
-
children: [showRememberMe && /* @__PURE__ */ jsxs("label", {
|
|
159
|
-
className: "text-muted-foreground flex items-center gap-2 text-xs",
|
|
160
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
161
|
-
type: "checkbox",
|
|
162
|
-
className: "rounded border-gray-300",
|
|
163
|
-
...register("rememberMe")
|
|
164
|
-
}), t("auth.rememberMe")]
|
|
165
|
-
}), showForgotPassword && /* @__PURE__ */ jsx(Button, {
|
|
166
|
-
type: "button",
|
|
167
|
-
variant: "link",
|
|
168
|
-
size: "sm",
|
|
169
|
-
onClick: onForgotPasswordClick,
|
|
170
|
-
className: "h-auto p-0 text-xs",
|
|
171
|
-
children: t("auth.forgotPassword")
|
|
172
|
-
})]
|
|
173
|
-
})
|
|
174
|
-
] }),
|
|
175
|
-
error && /* @__PURE__ */ jsxs(Alert, {
|
|
176
|
-
variant: "destructive",
|
|
177
|
-
children: [/* @__PURE__ */ jsx(WarningCircle, {}), /* @__PURE__ */ jsx(AlertDescription, { children: error })]
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ jsx(Button, {
|
|
180
|
-
type: "submit",
|
|
181
|
-
className: "w-full",
|
|
182
|
-
size: "lg",
|
|
183
|
-
disabled: isSubmitting,
|
|
184
|
-
children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerGap, {
|
|
185
|
-
className: "animate-spin",
|
|
186
|
-
weight: "bold"
|
|
187
|
-
}), t("auth.signingIn")] }) : t("auth.signIn")
|
|
188
|
-
}),
|
|
189
|
-
showSignUp && /* @__PURE__ */ jsxs("p", {
|
|
190
|
-
className: "text-muted-foreground text-center text-xs",
|
|
191
|
-
children: [
|
|
192
|
-
t("auth.dontHaveAccount"),
|
|
193
|
-
" ",
|
|
194
|
-
/* @__PURE__ */ jsx(Button, {
|
|
195
|
-
type: "button",
|
|
196
|
-
variant: "link",
|
|
197
|
-
size: "sm",
|
|
198
|
-
onClick: onSignUpClick,
|
|
199
|
-
className: "h-auto p-0 text-xs",
|
|
200
|
-
children: t("auth.signUp")
|
|
201
|
-
})
|
|
202
|
-
]
|
|
203
|
-
})
|
|
204
|
-
]
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region src/client/views/pages/login-page.tsx
|
|
210
|
-
/**
|
|
211
|
-
* Login Page
|
|
212
|
-
*
|
|
213
|
-
* Default login page that uses AuthLayout and LoginForm.
|
|
214
|
-
* Integrates with authClient from AdminProvider context.
|
|
215
|
-
*
|
|
216
|
-
* Automatically redirects to setup page if no users exist.
|
|
217
|
-
*/
|
|
218
|
-
/**
|
|
219
|
-
* Default login page component.
|
|
220
|
-
*
|
|
221
|
-
* Uses authClient from AdminProvider to handle authentication.
|
|
222
|
-
* Automatically redirects to setup page if no users exist.
|
|
223
|
-
*
|
|
224
|
-
* @example
|
|
225
|
-
* ```tsx
|
|
226
|
-
* // In your admin config
|
|
227
|
-
* const admin = qa<AppCMS>()
|
|
228
|
-
* .use(adminModule)
|
|
229
|
-
* .pages({
|
|
230
|
-
* login: page("login", { component: LoginPage }).path("/login"),
|
|
231
|
-
* })
|
|
232
|
-
* ```
|
|
233
|
-
*/
|
|
234
|
-
function LoginPage({ title = "Sign in", description = "Enter your credentials to access the admin panel", logo, redirectTo, forgotPasswordPath, signUpPath, showForgotPassword = true, showSignUp = false }) {
|
|
235
|
-
const authClient = useAuthClient();
|
|
236
|
-
const navigate = useAdminStore(selectNavigate);
|
|
237
|
-
const basePath = useAdminStore(selectBasePath);
|
|
238
|
-
const brandName = useAdminStore(selectBrandName);
|
|
239
|
-
const [error, setError] = React$1.useState(null);
|
|
240
|
-
const { data: setupStatus, isLoading: isCheckingSetup } = useSetupStatus();
|
|
241
|
-
React$1.useEffect(() => {
|
|
242
|
-
if (!isCheckingSetup && setupStatus?.required) navigate(`${basePath}/setup`);
|
|
243
|
-
}, [
|
|
244
|
-
isCheckingSetup,
|
|
245
|
-
setupStatus,
|
|
246
|
-
navigate,
|
|
247
|
-
basePath
|
|
248
|
-
]);
|
|
249
|
-
const handleSubmit = async (values) => {
|
|
250
|
-
setError(null);
|
|
251
|
-
try {
|
|
252
|
-
const result = await authClient.signIn.email({
|
|
253
|
-
email: values.email,
|
|
254
|
-
password: values.password
|
|
255
|
-
});
|
|
256
|
-
if (result.error) {
|
|
257
|
-
setError(result.error.message || "Invalid credentials");
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
navigate(redirectTo ?? basePath);
|
|
261
|
-
} catch (err) {
|
|
262
|
-
setError(err instanceof Error ? err.message : "An error occurred");
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
const handleForgotPasswordClick = () => {
|
|
266
|
-
navigate(forgotPasswordPath ?? `${basePath}/forgot-password`);
|
|
267
|
-
};
|
|
268
|
-
const handleSignUpClick = () => {
|
|
269
|
-
if (signUpPath) navigate(signUpPath);
|
|
270
|
-
};
|
|
271
|
-
return /* @__PURE__ */ jsx(AuthLayout, {
|
|
272
|
-
title,
|
|
273
|
-
description,
|
|
274
|
-
logo: logo ?? /* @__PURE__ */ jsx(DefaultLogo, { brandName }),
|
|
275
|
-
children: /* @__PURE__ */ jsx(LoginForm, {
|
|
276
|
-
onSubmit: handleSubmit,
|
|
277
|
-
onForgotPasswordClick: handleForgotPasswordClick,
|
|
278
|
-
onSignUpClick: handleSignUpClick,
|
|
279
|
-
showForgotPassword,
|
|
280
|
-
showSignUp,
|
|
281
|
-
error
|
|
282
|
-
})
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
function DefaultLogo({ brandName }) {
|
|
286
|
-
return /* @__PURE__ */ jsx("div", {
|
|
287
|
-
className: "text-center",
|
|
288
|
-
children: /* @__PURE__ */ jsx("h1", {
|
|
289
|
-
className: "text-xl font-bold",
|
|
290
|
-
children: brandName
|
|
291
|
-
})
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
var login_page_default = LoginPage;
|
|
295
|
-
|
|
296
|
-
//#endregion
|
|
297
|
-
export { useSetupStatus as i, login_page_default as n, LoginForm as r, LoginPage as t };
|
|
298
|
-
//# sourceMappingURL=login-page-CP4gA-dl.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-page-CP4gA-dl.mjs","names":["React"],"sources":["../src/client/hooks/use-setup-status.ts","../src/client/views/auth/login-form.tsx","../src/client/views/pages/login-page.tsx"],"sourcesContent":["/**\n * Setup Status Hook\n *\n * Hook to check if the CMS setup is required (no users exist).\n * Useful for redirecting to setup page on first visit.\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { selectClient, useAdminStore } from \"../runtime/provider\";\n\nexport interface SetupStatus {\n /** Whether setup is required (no users exist) */\n required: boolean;\n}\n\n/**\n * Check if CMS setup is required.\n *\n * Returns `required: true` if no users exist in the system,\n * meaning the setup page should be shown to create the first admin.\n *\n * @example\n * ```tsx\n * function App() {\n * const { data, isLoading } = useSetupStatus();\n *\n * if (isLoading) return <LoadingSpinner />;\n *\n * if (data?.required) {\n * return <Navigate to=\"/admin/setup\" />;\n * }\n *\n * return <AdminPanel />;\n * }\n * ```\n */\nexport function useSetupStatus() {\n const client = useAdminStore(selectClient);\n\n return useQuery<SetupStatus>({\n queryKey: [\"questpie\", \"setup-status\"],\n queryFn: async () => {\n try {\n const result = await (client as any).functions.isSetupRequired({});\n return { required: result.required };\n } catch {\n // If the function doesn't exist, setup is not required\n return { required: false };\n }\n },\n staleTime: 1000 * 60, // Cache for 1 minute\n retry: false,\n });\n}\n","/**\n * Login Form - email/password authentication\n */\n\nimport {\n\tEnvelope,\n\tLock,\n\tSpinnerGap,\n\tWarningCircle,\n} from \"@phosphor-icons/react\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { Alert, AlertDescription } from \"../../components/ui/alert\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n\tField,\n\tFieldContent,\n\tFieldDescription,\n\tFieldError,\n\tFieldGroup,\n\tFieldLabel,\n} from \"../../components/ui/field\";\nimport { Input } from \"../../components/ui/input\";\nimport { useTranslation } from \"../../i18n/hooks\";\nimport { cn } from \"../../lib/utils\";\n\nexport type LoginFormValues = {\n\temail: string;\n\tpassword: string;\n\trememberMe?: boolean;\n};\n\nexport type LoginFormProps = {\n\t/** Called when form is submitted with valid data */\n\tonSubmit: (values: LoginFormValues) => Promise<void>;\n\t/** Called when sign up link is clicked */\n\tonSignUpClick?: () => void;\n\t/** Called when forgot password link is clicked */\n\tonForgotPasswordClick?: () => void;\n\t/** Show remember me checkbox */\n\tshowRememberMe?: boolean;\n\t/** Show sign up link */\n\tshowSignUp?: boolean;\n\t/** Show forgot password link */\n\tshowForgotPassword?: boolean;\n\t/** Default values */\n\tdefaultValues?: Partial<LoginFormValues>;\n\t/** Additional class name */\n\tclassName?: string;\n\t/** Error message from auth */\n\terror?: string | null;\n};\n\n/**\n * Login form with email and password fields\n *\n * @example\n * ```tsx\n * const authClient = createAdminAuthClient<typeof cms>({ baseURL: '...' })\n *\n * function LoginPage() {\n * const [error, setError] = useState<string | null>(null)\n *\n * const handleLogin = async (values: LoginFormValues) => {\n * const result = await authClient.signIn.email({\n * email: values.email,\n * password: values.password,\n * })\n * if (result.error) {\n * setError(result.error.message)\n * }\n * }\n *\n * return (\n * <AuthLayout title=\"Sign in\">\n * <LoginForm onSubmit={handleLogin} error={error} />\n * </AuthLayout>\n * )\n * }\n * ```\n */\nexport function LoginForm({\n\tonSubmit,\n\tonSignUpClick,\n\tonForgotPasswordClick,\n\tshowRememberMe = false,\n\tshowSignUp = true,\n\tshowForgotPassword = true,\n\tdefaultValues,\n\tclassName,\n\terror,\n}: LoginFormProps) {\n\tconst { t } = useTranslation();\n\tconst {\n\t\tregister,\n\t\thandleSubmit,\n\t\tformState: { errors, isSubmitting },\n\t} = useForm<LoginFormValues>({\n\t\tdefaultValues: {\n\t\t\temail: \"\",\n\t\t\tpassword: \"\",\n\t\t\trememberMe: false,\n\t\t\t...defaultValues,\n\t\t},\n\t});\n\n\tconst handleFormSubmit = handleSubmit(async (values) => {\n\t\tawait onSubmit(values);\n\t});\n\n\treturn (\n\t\t<form onSubmit={handleFormSubmit} className={cn(\"space-y-4\", className)}>\n\t\t\t<FieldGroup>\n\t\t\t\t{/* Email Field */}\n\t\t\t\t<Field data-invalid={!!errors.email}>\n\t\t\t\t\t<FieldLabel htmlFor=\"email\">{t(\"auth.email\")}</FieldLabel>\n\t\t\t\t\t<FieldContent>\n\t\t\t\t\t\t<div className=\"relative\">\n\t\t\t\t\t\t\t<Envelope\n\t\t\t\t\t\t\t\tclassName=\"text-muted-foreground absolute left-2 top-1/2 size-4 -translate-y-1/2\"\n\t\t\t\t\t\t\t\tweight=\"duotone\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid=\"email\"\n\t\t\t\t\t\t\t\ttype=\"email\"\n\t\t\t\t\t\t\t\tplaceholder={t(\"auth.emailPlaceholder\")}\n\t\t\t\t\t\t\t\tclassName=\"pl-8\"\n\t\t\t\t\t\t\t\tautoComplete=\"email\"\n\t\t\t\t\t\t\t\taria-invalid={!!errors.email}\n\t\t\t\t\t\t\t\t{...register(\"email\", {\n\t\t\t\t\t\t\t\t\trequired: t(\"auth.emailRequired\"),\n\t\t\t\t\t\t\t\t\tpattern: {\n\t\t\t\t\t\t\t\t\t\tvalue: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,\n\t\t\t\t\t\t\t\t\t\tmessage: t(\"auth.invalidEmail\"),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<FieldError>{errors.email?.message}</FieldError>\n\t\t\t\t\t</FieldContent>\n\t\t\t\t</Field>\n\n\t\t\t\t{/* Password Field */}\n\t\t\t\t<Field data-invalid={!!errors.password}>\n\t\t\t\t\t<FieldLabel htmlFor=\"password\">{t(\"auth.password\")}</FieldLabel>\n\t\t\t\t\t<FieldContent>\n\t\t\t\t\t\t<div className=\"relative\">\n\t\t\t\t\t\t\t<Lock\n\t\t\t\t\t\t\t\tclassName=\"text-muted-foreground absolute left-2 top-1/2 size-4 -translate-y-1/2\"\n\t\t\t\t\t\t\t\tweight=\"duotone\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid=\"password\"\n\t\t\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\t\t\tplaceholder={t(\"auth.passwordPlaceholder\")}\n\t\t\t\t\t\t\t\tclassName=\"pl-8\"\n\t\t\t\t\t\t\t\tautoComplete=\"current-password\"\n\t\t\t\t\t\t\t\taria-invalid={!!errors.password}\n\t\t\t\t\t\t\t\t{...register(\"password\", {\n\t\t\t\t\t\t\t\t\trequired: t(\"auth.passwordRequired\"),\n\t\t\t\t\t\t\t\t\tminLength: {\n\t\t\t\t\t\t\t\t\t\tvalue: 6,\n\t\t\t\t\t\t\t\t\t\tmessage: t(\"auth.passwordMinLength\", { min: 6 }),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<FieldError>{errors.password?.message}</FieldError>\n\t\t\t\t\t</FieldContent>\n\t\t\t\t</Field>\n\n\t\t\t\t{/* Remember Me & Forgot Password */}\n\t\t\t\t{(showRememberMe || showForgotPassword) && (\n\t\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t\t{showRememberMe && (\n\t\t\t\t\t\t\t<label className=\"text-muted-foreground flex items-center gap-2 text-xs\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t\tclassName=\"rounded border-gray-300\"\n\t\t\t\t\t\t\t\t\t{...register(\"rememberMe\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{t(\"auth.rememberMe\")}\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{showForgotPassword && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\tonClick={onForgotPasswordClick}\n\t\t\t\t\t\t\t\tclassName=\"h-auto p-0 text-xs\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{t(\"auth.forgotPassword\")}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</FieldGroup>\n\n\t\t\t{/* Error Message */}\n\t\t\t{error && (\n\t\t\t\t<Alert variant=\"destructive\">\n\t\t\t\t\t<WarningCircle />\n\t\t\t\t\t<AlertDescription>{error}</AlertDescription>\n\t\t\t\t</Alert>\n\t\t\t)}\n\n\t\t\t{/* Submit Button */}\n\t\t\t<Button\n\t\t\t\ttype=\"submit\"\n\t\t\t\tclassName=\"w-full\"\n\t\t\t\tsize=\"lg\"\n\t\t\t\tdisabled={isSubmitting}\n\t\t\t>\n\t\t\t\t{isSubmitting ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<SpinnerGap className=\"animate-spin\" weight=\"bold\" />\n\t\t\t\t\t\t{t(\"auth.signingIn\")}\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tt(\"auth.signIn\")\n\t\t\t\t)}\n\t\t\t</Button>\n\n\t\t\t{/* Sign Up Link */}\n\t\t\t{showSignUp && (\n\t\t\t\t<p className=\"text-muted-foreground text-center text-xs\">\n\t\t\t\t\t{t(\"auth.dontHaveAccount\")}{\" \"}\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tonClick={onSignUpClick}\n\t\t\t\t\t\tclassName=\"h-auto p-0 text-xs\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{t(\"auth.signUp\")}\n\t\t\t\t\t</Button>\n\t\t\t\t</p>\n\t\t\t)}\n\t\t</form>\n\t);\n}\n","/**\n * Login Page\n *\n * Default login page that uses AuthLayout and LoginForm.\n * Integrates with authClient from AdminProvider context.\n *\n * Automatically redirects to setup page if no users exist.\n */\n\nimport * as React from \"react\";\nimport { useAuthClient } from \"../../hooks/use-auth\";\nimport { useSetupStatus } from \"../../hooks/use-setup-status\";\nimport {\n selectBasePath,\n selectBrandName,\n selectNavigate,\n useAdminStore,\n} from \"../../runtime/provider\";\nimport { AuthLayout } from \"../auth/auth-layout\";\nimport { LoginForm, type LoginFormValues } from \"../auth/login-form\";\n\nexport interface LoginPageProps {\n /**\n * Title shown on the login page\n * @default \"Sign in\"\n */\n title?: string;\n\n /**\n * Description shown below the title\n * @default \"Enter your credentials to access the admin panel\"\n */\n description?: string;\n\n /**\n * Logo component to show above the form\n */\n logo?: React.ReactNode;\n\n /**\n * Path to redirect after successful login\n * @default basePath (e.g., \"/admin\")\n */\n redirectTo?: string;\n\n /**\n * Path to forgot password page\n * @default \"{basePath}/forgot-password\"\n */\n forgotPasswordPath?: string;\n\n /**\n * Path to sign up page (if enabled)\n */\n signUpPath?: string;\n\n /**\n * Show forgot password link\n * @default true\n */\n showForgotPassword?: boolean;\n\n /**\n * Show sign up link\n * @default false\n */\n showSignUp?: boolean;\n}\n\n/**\n * Default login page component.\n *\n * Uses authClient from AdminProvider to handle authentication.\n * Automatically redirects to setup page if no users exist.\n *\n * @example\n * ```tsx\n * // In your admin config\n * const admin = qa<AppCMS>()\n * .use(adminModule)\n * .pages({\n * login: page(\"login\", { component: LoginPage }).path(\"/login\"),\n * })\n * ```\n */\nexport function LoginPage({\n title = \"Sign in\",\n description = \"Enter your credentials to access the admin panel\",\n logo,\n redirectTo,\n forgotPasswordPath,\n signUpPath,\n showForgotPassword = true,\n showSignUp = false,\n}: LoginPageProps) {\n const authClient = useAuthClient();\n const navigate = useAdminStore(selectNavigate);\n const basePath = useAdminStore(selectBasePath);\n const brandName = useAdminStore(selectBrandName);\n\n const [error, setError] = React.useState<string | null>(null);\n\n // Check if setup is required (no users exist)\n const { data: setupStatus, isLoading: isCheckingSetup } = useSetupStatus();\n\n // Redirect to setup page if no users exist\n React.useEffect(() => {\n if (!isCheckingSetup && setupStatus?.required) {\n navigate(`${basePath}/setup`);\n }\n }, [isCheckingSetup, setupStatus, navigate, basePath]);\n\n const handleSubmit = async (values: LoginFormValues) => {\n setError(null);\n\n try {\n const result = await authClient.signIn.email({\n email: values.email,\n password: values.password,\n });\n\n if (result.error) {\n setError(result.error.message || \"Invalid credentials\");\n return;\n }\n\n // Redirect on success\n navigate(redirectTo ?? basePath);\n } catch (err) {\n setError(err instanceof Error ? err.message : \"An error occurred\");\n }\n };\n\n const handleForgotPasswordClick = () => {\n navigate(forgotPasswordPath ?? `${basePath}/forgot-password`);\n };\n\n const handleSignUpClick = () => {\n if (signUpPath) {\n navigate(signUpPath);\n }\n };\n\n return (\n <AuthLayout\n title={title}\n description={description}\n logo={logo ?? <DefaultLogo brandName={brandName} />}\n >\n <LoginForm\n onSubmit={handleSubmit}\n onForgotPasswordClick={handleForgotPasswordClick}\n onSignUpClick={handleSignUpClick}\n showForgotPassword={showForgotPassword}\n showSignUp={showSignUp}\n error={error}\n />\n </AuthLayout>\n );\n}\n\nfunction DefaultLogo({ brandName }: { brandName: string }) {\n return (\n <div className=\"text-center\">\n <h1 className=\"text-xl font-bold\">{brandName}</h1>\n </div>\n );\n}\n\nexport default LoginPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAgB,iBAAiB;CAC/B,MAAM,SAAS,cAAc,aAAa;AAE1C,QAAO,SAAsB;EAC3B,UAAU,CAAC,YAAY,eAAe;EACtC,SAAS,YA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MAAM,YAAY,cAAc,gBAAgB;CAEhD,MAAM,CAAC,OAAO,YAAYA,QAAM,SAAwB,KAAK;CAG7D,MAAM,EAAE,MAAM,aAAa,WAAW,oBAAoB,gBAAgB;AAG1E,SAAM,gBAAgB;AACpB,MAAI,CAAC,mBAAmB,aAAa,SACnC,UAAS,GAAG,SAAS,QAAQ;IAE9B;EAAC;EAAiB;EAAa;EAAU;EAAS,CAAC;CAEtD,MAAM,eAAe,OAAO,WAA4B;AACtD,WAAS,KAAK;AAEd,MAAI;GACF,MAAM,SAAS,MAAM,WAAW,OAAO,MAAM;IAC3C,OAAO,OAAO;IACd,UAAU,OAAO;IAClB,CAAC;AAEF,OAAI,OAAO,OAAO;AAChB,aAAS,OAAO,MAAM,WAAW,sBAAsB;AACvD;;AAIF,YAAS,cAAc,SAAS;WACzB,KAAK;AACZ,YAAS,eAAe,QAAQ,IAAI,UAAU,oBAAoB;;;CAItE,MAAM,kCAAkC;AACtC,WAAS,sBAAsB,GAAG,SAAS,kBAAkB;;CAG/D,MAAM,0BAA0B;AAC9B,MAAI,WACF,UAAS,WAAW;;AAIxB,QACE,oBAAC;EACQ;EACM;EACb,MAAM,QAAQ,oBAAC,eAAuB,YAAa;YAEnD,oBAAC;GACC,UAAU;GACV,uBAAuB;GACvB,eAAe;GACK;GACR;GACL;IACP;GACS;;AAIjB,SAAS,YAAY,EAAE,aAAoC;AACzD,QACE,oBAAC;EAAI,WAAU;YACb,oBAAC;GAAG,WAAU;aAAqB;IAAe;GAC9C;;AAIV,yBAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-utils-BKQ9-TMa.mjs","names":[],"sources":["../src/shared/preview-utils.ts"],"sourcesContent":["/**\n * Preview Utilities - Browser-safe\n *\n * Utilities that can run in both browser and server environments.\n * No Node.js dependencies (crypto, etc.)\n */\n\n// ============================================================================\n// Constants\n// ============================================================================\n\n/**\n * Cookie name for draft mode.\n * Set by /api/preview route, checked by page loaders.\n */\nexport const DRAFT_MODE_COOKIE = \"__draft_mode\";\n\n// ============================================================================\n// Browser-Safe Utilities\n// ============================================================================\n\n/**\n * Check if draft mode is enabled from cookie header.\n *\n * @param cookieHeader - The Cookie header value from request\n * @returns true if draft mode cookie is present and set to \"true\"\n *\n * @example\n * ```ts\n * const isDraft = isDraftMode(request.headers.get(\"cookie\"));\n * const page = await cms.pages.findOne({\n * where: isDraft ? { slug } : { slug, isPublished: true }\n * });\n * ```\n */\nexport function isDraftMode(cookieHeader: string | null | undefined): boolean {\n\tif (!cookieHeader) return false;\n\treturn cookieHeader.includes(`${DRAFT_MODE_COOKIE}=true`);\n}\n\n/**\n * Create Set-Cookie header value for draft mode.\n *\n * @param enabled - Whether to enable or disable draft mode\n * @param maxAge - Cookie max age in seconds (default: 1 hour)\n * @returns Set-Cookie header value\n *\n * @example\n * ```ts\n * // Enable draft mode\n * headers.set(\"Set-Cookie\", createDraftModeCookie(true));\n *\n * // Disable draft mode\n * headers.set(\"Set-Cookie\", createDraftModeCookie(false));\n * ```\n */\nexport function createDraftModeCookie(enabled: boolean, maxAge = 3600): string {\n\tif (enabled) {\n\t\treturn `${DRAFT_MODE_COOKIE}=true; Path=/; Max-Age=${maxAge}; SameSite=Lax; HttpOnly`;\n\t}\n\t// Delete cookie by setting Max-Age=0\n\treturn `${DRAFT_MODE_COOKIE}=; Path=/; Max-Age=0; SameSite=Lax; HttpOnly`;\n}\n\n/**\n * Get preview secret from environment variables.\n * Falls back to SECRET if PREVIEW_SECRET is not set.\n *\n * @returns The preview secret\n */\nexport function getPreviewSecret(): string {\n\tconst secret =\n\t\tprocess.env.PREVIEW_SECRET || process.env.SECRET || \"dev-preview-secret\";\n\n\tif (\n\t\tprocess.env.NODE_ENV === \"production\" &&\n\t\tsecret === \"dev-preview-secret\"\n\t) {\n\t\tconsole.warn(\n\t\t\t\"[preview] Using default secret in production. Set PREVIEW_SECRET or SECRET env var.\",\n\t\t);\n\t}\n\n\treturn secret;\n}\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,oBAAoB;;;;;;;;;;;;;;;AAoBjC,SAAgB,YAAY,cAAkD;AAC7E,KAAI,CAAC,aAAc,QAAO;AAC1B,QAAO,aAAa,SAAS,GAAG,kBAAkB,OAAO;;;;;;;;;;;;;;;;;;AAmB1D,SAAgB,sBAAsB,SAAkB,SAAS,MAAc;AAC9E,KAAI,QACH,QAAO,GAAG,kBAAkB,yBAAyB,OAAO;AAG7D,QAAO,GAAG,kBAAkB;;;;;;;;AAS7B,SAAgB,mBAA2B;CAC1C,MAAM,SACL,QAAQ,IAAI,kBAAkB,QAAQ,IAAI,UAAU;AAErD,KACC,QAAQ,IAAI,aAAa,gBACzB,WAAW,qBAEX,SAAQ,KACP,sFACA;AAGF,QAAO"}
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { a as selectBasePath, f as useAdminStore, g as cn, h as Button, l as selectNavigate, o as selectBrandName } from "./content-locales-provider-BXvuIgfg.mjs";
|
|
2
|
-
import { a as FieldContent, c as FieldGroup, f as Input, i as Field, l as FieldLabel, n as Alert, o as FieldDescription, r as AlertDescription, s as FieldError, t as AuthLayout } from "./auth-layout-M8K8_q5R.mjs";
|
|
3
|
-
import { n as useAuthClient } from "./use-auth-BoLmWtmU.mjs";
|
|
4
|
-
import { CheckCircle, Lock, SpinnerGap, WarningCircle } from "@phosphor-icons/react";
|
|
5
|
-
import * as React$1 from "react";
|
|
6
|
-
import { useForm } from "react-hook-form";
|
|
7
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
|
-
//#region src/client/views/auth/reset-password-form.tsx
|
|
10
|
-
/**
|
|
11
|
-
* Reset Password Form - set new password with token
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Reset password form with password confirmation
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* const authClient = createAdminAuthClient<typeof cms>({ baseURL: '...' })
|
|
19
|
-
*
|
|
20
|
-
* function ResetPasswordPage() {
|
|
21
|
-
* const token = useSearchParams().get('token')
|
|
22
|
-
* const [error, setError] = useState<string | null>(null)
|
|
23
|
-
*
|
|
24
|
-
* const handleSubmit = async (values) => {
|
|
25
|
-
* const result = await authClient.resetPassword({
|
|
26
|
-
* token: values.token,
|
|
27
|
-
* newPassword: values.password,
|
|
28
|
-
* })
|
|
29
|
-
* if (result.error) {
|
|
30
|
-
* setError(result.error.message)
|
|
31
|
-
* }
|
|
32
|
-
* }
|
|
33
|
-
*
|
|
34
|
-
* return (
|
|
35
|
-
* <AuthLayout title="Reset password">
|
|
36
|
-
* <ResetPasswordForm token={token} onSubmit={handleSubmit} error={error} />
|
|
37
|
-
* </AuthLayout>
|
|
38
|
-
* )
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
function ResetPasswordForm({ token, onSubmit, onBackToLoginClick, minPasswordLength = 8, className, error }) {
|
|
43
|
-
const [isSuccess, setIsSuccess] = React$1.useState(false);
|
|
44
|
-
const { register, handleSubmit, watch, formState: { errors, isSubmitting } } = useForm({ defaultValues: {
|
|
45
|
-
password: "",
|
|
46
|
-
confirmPassword: ""
|
|
47
|
-
} });
|
|
48
|
-
const password = watch("password");
|
|
49
|
-
const handleFormSubmit = handleSubmit(async (values) => {
|
|
50
|
-
await onSubmit({
|
|
51
|
-
...values,
|
|
52
|
-
token
|
|
53
|
-
});
|
|
54
|
-
if (!error) setIsSuccess(true);
|
|
55
|
-
});
|
|
56
|
-
if (isSuccess) return /* @__PURE__ */ jsxs("div", {
|
|
57
|
-
className: cn("space-y-4 text-center", className),
|
|
58
|
-
children: [
|
|
59
|
-
/* @__PURE__ */ jsx("div", {
|
|
60
|
-
className: "bg-primary/10 mx-auto flex size-12 items-center justify-center",
|
|
61
|
-
children: /* @__PURE__ */ jsx(CheckCircle, {
|
|
62
|
-
className: "text-primary size-6",
|
|
63
|
-
weight: "duotone"
|
|
64
|
-
})
|
|
65
|
-
}),
|
|
66
|
-
/* @__PURE__ */ jsxs("div", {
|
|
67
|
-
className: "space-y-2",
|
|
68
|
-
children: [/* @__PURE__ */ jsx("h3", {
|
|
69
|
-
className: "text-sm font-medium",
|
|
70
|
-
children: "Password reset successful"
|
|
71
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
72
|
-
className: "text-muted-foreground text-xs",
|
|
73
|
-
children: "Your password has been reset successfully. You can now sign in with your new password."
|
|
74
|
-
})]
|
|
75
|
-
}),
|
|
76
|
-
/* @__PURE__ */ jsx(Button, {
|
|
77
|
-
type: "button",
|
|
78
|
-
className: "w-full",
|
|
79
|
-
size: "lg",
|
|
80
|
-
onClick: onBackToLoginClick,
|
|
81
|
-
children: "Sign in"
|
|
82
|
-
})
|
|
83
|
-
]
|
|
84
|
-
});
|
|
85
|
-
return /* @__PURE__ */ jsxs("form", {
|
|
86
|
-
onSubmit: handleFormSubmit,
|
|
87
|
-
className: cn("space-y-4", className),
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ jsx("p", {
|
|
90
|
-
className: "text-muted-foreground text-xs",
|
|
91
|
-
children: "Enter your new password below."
|
|
92
|
-
}),
|
|
93
|
-
/* @__PURE__ */ jsxs(FieldGroup, { children: [/* @__PURE__ */ jsxs(Field, {
|
|
94
|
-
"data-invalid": !!errors.password,
|
|
95
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
96
|
-
htmlFor: "password",
|
|
97
|
-
children: "New password"
|
|
98
|
-
}), /* @__PURE__ */ jsxs(FieldContent, { children: [
|
|
99
|
-
/* @__PURE__ */ jsxs("div", {
|
|
100
|
-
className: "relative",
|
|
101
|
-
children: [/* @__PURE__ */ jsx(Lock, {
|
|
102
|
-
className: "text-muted-foreground absolute left-2 top-1/2 size-4 -translate-y-1/2",
|
|
103
|
-
weight: "duotone"
|
|
104
|
-
}), /* @__PURE__ */ jsx(Input, {
|
|
105
|
-
id: "password",
|
|
106
|
-
type: "password",
|
|
107
|
-
placeholder: "Enter new password",
|
|
108
|
-
className: "pl-8",
|
|
109
|
-
autoComplete: "new-password",
|
|
110
|
-
"aria-invalid": !!errors.password,
|
|
111
|
-
...register("password", {
|
|
112
|
-
required: "Password is required",
|
|
113
|
-
minLength: {
|
|
114
|
-
value: minPasswordLength,
|
|
115
|
-
message: `Password must be at least ${minPasswordLength} characters`
|
|
116
|
-
}
|
|
117
|
-
})
|
|
118
|
-
})]
|
|
119
|
-
}),
|
|
120
|
-
/* @__PURE__ */ jsxs(FieldDescription, { children: [
|
|
121
|
-
"Must be at least ",
|
|
122
|
-
minPasswordLength,
|
|
123
|
-
" characters"
|
|
124
|
-
] }),
|
|
125
|
-
/* @__PURE__ */ jsx(FieldError, { children: errors.password?.message })
|
|
126
|
-
] })]
|
|
127
|
-
}), /* @__PURE__ */ jsxs(Field, {
|
|
128
|
-
"data-invalid": !!errors.confirmPassword,
|
|
129
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
130
|
-
htmlFor: "confirmPassword",
|
|
131
|
-
children: "Confirm password"
|
|
132
|
-
}), /* @__PURE__ */ jsxs(FieldContent, { children: [/* @__PURE__ */ jsxs("div", {
|
|
133
|
-
className: "relative",
|
|
134
|
-
children: [/* @__PURE__ */ jsx(Lock, {
|
|
135
|
-
className: "text-muted-foreground absolute left-2 top-1/2 size-4 -translate-y-1/2",
|
|
136
|
-
weight: "duotone"
|
|
137
|
-
}), /* @__PURE__ */ jsx(Input, {
|
|
138
|
-
id: "confirmPassword",
|
|
139
|
-
type: "password",
|
|
140
|
-
placeholder: "Confirm new password",
|
|
141
|
-
className: "pl-8",
|
|
142
|
-
autoComplete: "new-password",
|
|
143
|
-
"aria-invalid": !!errors.confirmPassword,
|
|
144
|
-
...register("confirmPassword", {
|
|
145
|
-
required: "Please confirm your password",
|
|
146
|
-
validate: (value) => value === password || "Passwords do not match"
|
|
147
|
-
})
|
|
148
|
-
})]
|
|
149
|
-
}), /* @__PURE__ */ jsx(FieldError, { children: errors.confirmPassword?.message })] })]
|
|
150
|
-
})] }),
|
|
151
|
-
error && /* @__PURE__ */ jsxs(Alert, {
|
|
152
|
-
variant: "destructive",
|
|
153
|
-
children: [/* @__PURE__ */ jsx(WarningCircle, {}), /* @__PURE__ */ jsx(AlertDescription, { children: error })]
|
|
154
|
-
}),
|
|
155
|
-
/* @__PURE__ */ jsx(Button, {
|
|
156
|
-
type: "submit",
|
|
157
|
-
className: "w-full",
|
|
158
|
-
size: "lg",
|
|
159
|
-
disabled: isSubmitting,
|
|
160
|
-
children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerGap, {
|
|
161
|
-
className: "animate-spin",
|
|
162
|
-
weight: "bold"
|
|
163
|
-
}), "Resetting..."] }) : "Reset password"
|
|
164
|
-
}),
|
|
165
|
-
/* @__PURE__ */ jsxs("p", {
|
|
166
|
-
className: "text-muted-foreground text-center text-xs",
|
|
167
|
-
children: [
|
|
168
|
-
"Remember your password?",
|
|
169
|
-
" ",
|
|
170
|
-
/* @__PURE__ */ jsx(Button, {
|
|
171
|
-
type: "button",
|
|
172
|
-
variant: "link",
|
|
173
|
-
size: "sm",
|
|
174
|
-
onClick: onBackToLoginClick,
|
|
175
|
-
className: "h-auto p-0 text-xs",
|
|
176
|
-
children: "Back to login"
|
|
177
|
-
})
|
|
178
|
-
]
|
|
179
|
-
})
|
|
180
|
-
]
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
//#endregion
|
|
185
|
-
//#region src/client/views/pages/reset-password-page.tsx
|
|
186
|
-
/**
|
|
187
|
-
* Reset Password Page
|
|
188
|
-
*
|
|
189
|
-
* Default reset password page that uses AuthLayout and ResetPasswordForm.
|
|
190
|
-
* Integrates with authClient from AdminProvider context.
|
|
191
|
-
*/
|
|
192
|
-
/**
|
|
193
|
-
* Default reset password page component.
|
|
194
|
-
*
|
|
195
|
-
* Uses authClient from AdminProvider to handle password reset.
|
|
196
|
-
* Expects a token in the URL query params (?token=...).
|
|
197
|
-
*
|
|
198
|
-
* @example
|
|
199
|
-
* ```tsx
|
|
200
|
-
* // In your admin config
|
|
201
|
-
* const admin = qa<AppCMS>()
|
|
202
|
-
* .use(coreAdminModule)
|
|
203
|
-
* .pages({
|
|
204
|
-
* resetPassword: page("reset-password", { component: ResetPasswordPage })
|
|
205
|
-
* .path("/reset-password"),
|
|
206
|
-
* })
|
|
207
|
-
* ```
|
|
208
|
-
*/
|
|
209
|
-
function ResetPasswordPage({ title = "Reset password", description = "Enter your new password", logo, loginPath, minPasswordLength = 8, getToken }) {
|
|
210
|
-
const authClient = useAuthClient();
|
|
211
|
-
const navigate = useAdminStore(selectNavigate);
|
|
212
|
-
const basePath = useAdminStore(selectBasePath);
|
|
213
|
-
const brandName = useAdminStore(selectBrandName);
|
|
214
|
-
const [error, setError] = React$1.useState(null);
|
|
215
|
-
const token = React$1.useMemo(() => {
|
|
216
|
-
if (getToken) return getToken();
|
|
217
|
-
if (typeof window !== "undefined") return new URLSearchParams(window.location.search).get("token");
|
|
218
|
-
return null;
|
|
219
|
-
}, [getToken]);
|
|
220
|
-
const handleSubmit = async (values) => {
|
|
221
|
-
setError(null);
|
|
222
|
-
try {
|
|
223
|
-
const result = await authClient.resetPassword({
|
|
224
|
-
token: values.token,
|
|
225
|
-
newPassword: values.password
|
|
226
|
-
});
|
|
227
|
-
if (result.error) {
|
|
228
|
-
setError(result.error.message || "Failed to reset password");
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
} catch (err) {
|
|
232
|
-
setError(err instanceof Error ? err.message : "An error occurred");
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
const handleBackToLoginClick = () => {
|
|
236
|
-
navigate(loginPath ?? `${basePath}/login`);
|
|
237
|
-
};
|
|
238
|
-
if (!token) return /* @__PURE__ */ jsx(AuthLayout, {
|
|
239
|
-
title: "Invalid Link",
|
|
240
|
-
description: "The password reset link is invalid or has expired.",
|
|
241
|
-
logo: logo ?? /* @__PURE__ */ jsx(DefaultLogo, { brandName }),
|
|
242
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
243
|
-
className: "space-y-4 text-center",
|
|
244
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
245
|
-
className: "text-muted-foreground text-sm",
|
|
246
|
-
children: "Please request a new password reset link."
|
|
247
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
248
|
-
type: "button",
|
|
249
|
-
variant: "link",
|
|
250
|
-
onClick: handleBackToLoginClick,
|
|
251
|
-
children: "Back to login"
|
|
252
|
-
})]
|
|
253
|
-
})
|
|
254
|
-
});
|
|
255
|
-
return /* @__PURE__ */ jsx(AuthLayout, {
|
|
256
|
-
title,
|
|
257
|
-
description,
|
|
258
|
-
logo: logo ?? /* @__PURE__ */ jsx(DefaultLogo, { brandName }),
|
|
259
|
-
children: /* @__PURE__ */ jsx(ResetPasswordForm, {
|
|
260
|
-
token,
|
|
261
|
-
onSubmit: handleSubmit,
|
|
262
|
-
onBackToLoginClick: handleBackToLoginClick,
|
|
263
|
-
minPasswordLength,
|
|
264
|
-
error
|
|
265
|
-
})
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
function DefaultLogo({ brandName }) {
|
|
269
|
-
return /* @__PURE__ */ jsx("div", {
|
|
270
|
-
className: "text-center",
|
|
271
|
-
children: /* @__PURE__ */ jsx("h1", {
|
|
272
|
-
className: "text-xl font-bold",
|
|
273
|
-
children: brandName
|
|
274
|
-
})
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
var reset_password_page_default = ResetPasswordPage;
|
|
278
|
-
|
|
279
|
-
//#endregion
|
|
280
|
-
export { reset_password_page_default as n, ResetPasswordForm as r, ResetPasswordPage as t };
|
|
281
|
-
//# sourceMappingURL=reset-password-page-BqfDmLxA.mjs.map
|