@questpie/admin 2.0.0 → 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 +119 -122
- package/dist/augmentation.d.mts +110 -11
- package/dist/client/blocks/block-renderer.d.mts +5 -12
- package/dist/client/blocks/block-renderer.mjs +89 -55
- package/dist/client/blocks/index.d.mts +2 -4
- package/dist/client/blocks/types.d.mts +3 -4
- package/dist/client/blocks/types.mjs +1 -2
- package/dist/client/builder/admin-types.d.mts +11 -44
- package/dist/client/builder/admin.d.mts +34 -45
- package/dist/client/builder/admin.mjs +35 -44
- package/dist/client/builder/field/field.d.mts +27 -205
- package/dist/client/builder/field/field.mjs +22 -68
- package/dist/client/builder/index.d.mts +23 -28
- package/dist/client/builder/page/page.d.mts +15 -27
- package/dist/client/builder/page/page.mjs +21 -17
- package/dist/client/builder/registry.d.mts +14 -34
- package/dist/client/builder/types/action-registry.mjs +148 -14
- package/dist/client/builder/types/action-types.d.mts +8 -35
- package/dist/client/builder/types/collection-types.mjs +1 -2
- package/dist/client/builder/types/common.d.mts +6 -20
- package/dist/client/builder/types/field-types.d.mts +4 -5
- package/dist/client/builder/types/field-types.mjs +1 -2
- package/dist/client/builder/types/ui-config.d.mts +3 -5
- package/dist/client/builder/types/widget-types.d.mts +19 -20
- package/dist/client/builder/validation.d.mts +33 -3
- package/dist/client/builder/validation.mjs +169 -150
- package/dist/client/builder/view/view.d.mts +26 -106
- package/dist/client/builder/view/view.mjs +14 -96
- package/dist/client/builder/widget/widget.d.mts +16 -22
- package/dist/client/builder/widget/widget.mjs +11 -16
- package/dist/client/components/actions/action-button.mjs +207 -97
- package/dist/client/components/actions/action-dialog.mjs +471 -176
- package/dist/client/components/actions/confirmation-dialog.mjs +166 -47
- package/dist/client/components/actions/header-actions.mjs +164 -71
- package/dist/client/components/admin-link.d.mts +8 -9
- package/dist/client/components/admin-link.mjs +127 -48
- package/dist/client/components/auth/auth-guard.d.mts +6 -7
- package/dist/client/components/auth/auth-guard.mjs +9 -9
- package/dist/client/components/auth/auth-loading.d.mts +3 -4
- package/dist/client/components/auth/auth-loading.mjs +38 -10
- package/dist/client/components/blocks/block-canvas.mjs +111 -42
- package/dist/client/components/blocks/block-editor-context.mjs +90 -23
- package/dist/client/components/blocks/block-editor-layout.mjs +176 -59
- package/dist/client/components/blocks/block-editor-provider.mjs +219 -139
- package/dist/client/components/blocks/block-fields-renderer.mjs +212 -42
- package/dist/client/components/blocks/block-insert-button.mjs +168 -51
- package/dist/client/components/blocks/block-item-menu.mjs +312 -110
- package/dist/client/components/blocks/block-item.mjs +372 -125
- package/dist/client/components/blocks/block-library-sidebar.mjs +209 -114
- package/dist/client/components/blocks/block-tree.mjs +73 -15
- package/dist/client/components/blocks/block-type-icon.mjs +65 -20
- package/dist/client/components/blocks/utils/tree-utils.mjs +1 -2
- package/dist/client/components/component-renderer.d.mts +11 -22
- package/dist/client/components/component-renderer.mjs +151 -38
- package/dist/client/components/error-boundary.mjs +77 -25
- package/dist/client/components/fields/array-field.mjs +474 -199
- package/dist/client/components/fields/asset-preview-field.mjs +143 -44
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +143 -35
- package/dist/client/components/fields/boolean-field.mjs +62 -32
- package/dist/client/components/fields/date-field.mjs +46 -12
- package/dist/client/components/fields/datetime-field.mjs +42 -11
- package/dist/client/components/fields/email-field.mjs +57 -28
- package/dist/client/components/fields/field-utils.mjs +1 -2
- package/dist/client/components/fields/field-wrapper.mjs +107 -32
- package/dist/client/components/fields/json-field.mjs +323 -110
- package/dist/client/components/fields/locale-badge.mjs +16 -8
- package/dist/client/components/fields/number-field.mjs +63 -30
- package/dist/client/components/fields/object-array-field.mjs +666 -272
- package/dist/client/components/fields/object-field.mjs +656 -98
- package/dist/client/components/fields/relation/displays/cards-display.mjs +225 -111
- package/dist/client/components/fields/relation/displays/chips-display.mjs +150 -77
- package/dist/client/components/fields/relation/displays/grid-display.mjs +186 -91
- package/dist/client/components/fields/relation/displays/list-display.mjs +230 -111
- package/dist/client/components/fields/relation/displays/table-display.mjs +241 -66
- package/dist/client/components/fields/relation/displays/types.mjs +2 -3
- package/dist/client/components/fields/relation/relation-items-display.mjs +131 -35
- package/dist/client/components/fields/relation-field.mjs +70 -15
- package/dist/client/components/fields/relation-picker.mjs +93 -98
- package/dist/client/components/fields/relation-select.mjs +42 -29
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +90 -41
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +33 -7
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +48 -23
- package/dist/client/components/fields/rich-text-editor/index.mjs +491 -158
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +13 -14
- package/dist/client/components/fields/rich-text-editor/presets.mjs +1 -2
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +96 -53
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +416 -107
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +476 -215
- package/dist/client/components/fields/rich-text-editor/types.mjs +1 -2
- package/dist/client/components/fields/rich-text-editor/utils.mjs +1 -2
- package/dist/client/components/fields/rich-text-field.mjs +55 -17
- package/dist/client/components/fields/select-field.mjs +79 -44
- package/dist/client/components/fields/text-field.mjs +62 -29
- package/dist/client/components/fields/textarea-field.mjs +61 -29
- package/dist/client/components/fields/time-field.mjs +39 -11
- package/dist/client/components/fields/upload-field.mjs +253 -129
- package/dist/client/components/filter-builder/columns-tab.mjs +287 -93
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +437 -138
- package/dist/client/components/filter-builder/filters-tab.mjs +409 -126
- package/dist/client/components/filter-builder/saved-views-tab.mjs +259 -106
- 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 +231 -108
- package/dist/client/components/media/media-grid.mjs +259 -84
- package/dist/client/components/media/media-picker-dialog.mjs +500 -192
- package/dist/client/components/preview/live-preview-mode.mjs +416 -124
- package/dist/client/components/preview/preview-pane.mjs +353 -144
- package/dist/client/components/primitives/asset-preview.mjs +665 -257
- package/dist/client/components/primitives/checkbox-input.mjs +37 -11
- package/dist/client/components/primitives/date-input.mjs +392 -149
- package/dist/client/components/primitives/dropzone.mjs +314 -185
- package/dist/client/components/primitives/number-input.mjs +14 -10
- package/dist/client/components/primitives/select-multi.mjs +519 -185
- package/dist/client/components/primitives/select-single.mjs +416 -126
- package/dist/client/components/primitives/text-input.mjs +10 -5
- package/dist/client/components/primitives/textarea-input.mjs +10 -5
- package/dist/client/components/primitives/time-input.mjs +118 -45
- package/dist/client/components/primitives/toggle-input.mjs +31 -11
- package/dist/client/components/primitives/types.mjs +1 -2
- package/dist/client/components/sheets/resource-sheet.mjs +72 -64
- package/dist/client/components/ui/accordion.mjs +156 -37
- package/dist/client/components/ui/alert.mjs +70 -17
- package/dist/client/components/ui/badge.mjs +57 -16
- package/dist/client/components/ui/button.mjs +49 -14
- package/dist/client/components/ui/card.mjs +194 -39
- package/dist/client/components/ui/checkbox.mjs +71 -16
- package/dist/client/components/ui/command.mjs +220 -50
- package/dist/client/components/ui/dialog.mjs +265 -52
- package/dist/client/components/ui/drawer.mjs +260 -57
- package/dist/client/components/ui/dropdown-menu.mjs +293 -67
- package/dist/client/components/ui/empty-state.mjs +72 -26
- package/dist/client/components/ui/field.mjs +332 -56
- package/dist/client/components/ui/input-group.mjs +174 -41
- package/dist/client/components/ui/input.mjs +38 -9
- package/dist/client/components/ui/kbd.mjs +37 -8
- package/dist/client/components/ui/label.mjs +38 -8
- package/dist/client/components/ui/popover.mjs +162 -35
- package/dist/client/components/ui/responsive-dialog.mjs +277 -71
- package/dist/client/components/ui/search-input.mjs +101 -36
- package/dist/client/components/ui/select.mjs +297 -57
- package/dist/client/components/ui/separator.mjs +39 -9
- package/dist/client/components/ui/sheet.mjs +253 -51
- package/dist/client/components/ui/sidebar.mjs +700 -182
- package/dist/client/components/ui/skeleton.mjs +33 -8
- package/dist/client/components/ui/sonner.d.mts +2 -3
- package/dist/client/components/ui/sonner.mjs +45 -15
- package/dist/client/components/ui/spinner.mjs +44 -10
- package/dist/client/components/ui/switch.mjs +47 -12
- package/dist/client/components/ui/table.mjs +260 -50
- package/dist/client/components/ui/tabs.mjs +140 -29
- package/dist/client/components/ui/textarea.mjs +33 -8
- package/dist/client/components/ui/toolbar.mjs +105 -23
- package/dist/client/components/ui/tooltip.mjs +130 -29
- package/dist/client/components/widgets/chart-widget.mjs +456 -156
- package/dist/client/components/widgets/progress-widget.mjs +150 -60
- package/dist/client/components/widgets/quick-actions-widget.mjs +175 -87
- package/dist/client/components/widgets/recent-items-widget.mjs +157 -62
- package/dist/client/components/widgets/stats-widget.mjs +153 -42
- package/dist/client/components/widgets/table-widget.mjs +198 -64
- package/dist/client/components/widgets/timeline-widget.mjs +193 -82
- package/dist/client/components/widgets/value-widget.mjs +257 -56
- package/dist/client/components/widgets/widget-skeletons.mjs +390 -108
- package/dist/client/contexts/breadcrumb-context.mjs +44 -16
- package/dist/client/{context → contexts}/focus-context.d.mts +6 -7
- package/dist/client/{context → contexts}/focus-context.mjs +134 -62
- package/dist/client/hooks/typed-hooks.d.mts +38 -12
- package/dist/client/hooks/typed-hooks.mjs +758 -142
- package/dist/client/hooks/use-action.mjs +197 -69
- package/dist/client/hooks/use-admin-config.mjs +39 -10
- package/dist/client/hooks/use-admin-preferences.mjs +118 -15
- package/dist/client/hooks/use-admin-routes.mjs +60 -27
- package/dist/client/hooks/use-audit-history.mjs +157 -0
- package/dist/client/hooks/use-auth.d.mts +14 -15
- package/dist/client/hooks/use-auth.mjs +8 -9
- package/dist/client/hooks/use-collection-fields.mjs +58 -19
- package/dist/client/hooks/use-collection-meta.mjs +45 -13
- package/dist/client/hooks/use-collection-schema.mjs +34 -11
- package/dist/client/hooks/use-collection-validation.mjs +39 -25
- package/dist/client/hooks/use-collection.d.mts +18 -8
- package/dist/client/hooks/use-collection.mjs +560 -101
- package/dist/client/hooks/use-current-user.d.mts +6 -3
- package/dist/client/hooks/use-current-user.mjs +2 -2
- package/dist/client/hooks/use-field-hooks.mjs +73 -65
- package/dist/client/hooks/use-field-options.d.mts +1 -34
- package/dist/client/hooks/use-field-options.mjs +233 -148
- package/dist/client/hooks/use-global-fields.mjs +47 -16
- package/dist/client/hooks/use-global-meta.mjs +57 -11
- package/dist/client/hooks/use-global-schema.mjs +31 -11
- package/dist/client/hooks/use-global.d.mts +13 -2
- package/dist/client/hooks/use-global.mjs +244 -34
- package/dist/client/hooks/use-locks.mjs +331 -124
- package/dist/client/hooks/use-media-query.d.mts +1 -2
- package/dist/client/hooks/use-media-query.mjs +38 -19
- package/dist/client/hooks/use-prefill-params.mjs +2 -2
- package/dist/client/hooks/use-questpie-query-options.mjs +33 -11
- package/dist/client/hooks/use-reactive-fields.d.mts +6 -3
- package/dist/client/hooks/use-reactive-fields.mjs +130 -93
- package/dist/client/hooks/use-realtime-highlight.mjs +115 -53
- package/dist/client/hooks/use-saved-views.mjs +109 -34
- 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 +147 -36
- package/dist/client/hooks/use-server-actions.mjs +191 -0
- package/dist/client/hooks/use-server-validation.mjs +164 -72
- package/dist/client/hooks/use-server-widget-data.d.mts +2 -3
- package/dist/client/hooks/use-server-widget-data.mjs +36 -11
- package/dist/client/hooks/use-setup-status.d.mts +3 -4
- package/dist/client/hooks/use-setup-status.mjs +28 -16
- 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 +1 -2
- package/dist/client/hooks/use-upload.mjs +189 -125
- package/dist/client/hooks/use-validation-error-map.mjs +10 -6
- package/dist/client/hooks/use-view-state.mjs +380 -162
- package/dist/client/i18n/hooks.mjs +191 -67
- package/dist/client/i18n/intl-cache.mjs +1 -2
- package/dist/client/i18n/messages.mjs +1 -2
- package/dist/client/i18n/simple.d.mts +1 -2
- package/dist/client/i18n/simple.mjs +1 -2
- package/dist/client/i18n/types.d.mts +1 -2
- 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 +1 -6
- package/dist/client/preview/block-scope-context.d.mts +5 -6
- package/dist/client/preview/block-scope-context.mjs +50 -27
- package/dist/client/preview/index.d.mts +2 -2
- package/dist/client/preview/preview-banner.d.mts +3 -4
- package/dist/client/preview/preview-banner.mjs +74 -35
- package/dist/client/preview/preview-field.d.mts +9 -10
- package/dist/client/preview/preview-field.mjs +163 -61
- package/dist/client/preview/types.d.mts +1 -2
- package/dist/client/preview/types.mjs +1 -2
- package/dist/client/preview/use-collection-preview.d.mts +1 -2
- package/dist/client/preview/use-collection-preview.mjs +105 -56
- package/dist/client/runtime/content-locales-provider.mjs +87 -36
- package/dist/client/runtime/index.d.mts +1 -3
- package/dist/client/runtime/index.mjs +1 -3
- package/dist/client/runtime/locale-scope.mjs +69 -29
- package/dist/client/runtime/provider.d.mts +18 -9922
- package/dist/client/runtime/provider.mjs +250 -86
- package/dist/client/runtime/routes.d.mts +7 -7
- package/dist/client/runtime/routes.mjs +4 -20
- package/dist/client/runtime/translations-provider.mjs +114 -53
- package/dist/client/scope/picker.d.mts +3 -4
- package/dist/client/scope/picker.mjs +324 -90
- package/dist/client/scope/provider.d.mts +4 -5
- package/dist/client/scope/provider.mjs +30 -22
- package/dist/client/scope/types.d.mts +1 -2
- package/dist/client/styles/index.css +301 -225
- package/dist/client/utils/auto-expand-fields.mjs +23 -5
- package/dist/client/utils/build-field-definitions-from-schema.mjs +10 -7
- package/dist/client/utils/dependency-tracker.mjs +61 -0
- package/dist/client/utils/detect-relations.mjs +1 -2
- package/dist/client/utils/locale-to-flag.d.mts +8 -7
- package/dist/client/utils/locale-to-flag.mjs +1 -2
- package/dist/client/utils/routes.mjs +1 -2
- package/dist/client/views/auth/accept-invite-form.d.mts +3 -4
- package/dist/client/views/auth/accept-invite-form.mjs +414 -121
- package/dist/client/views/auth/auth-layout.d.mts +7 -8
- package/dist/client/views/auth/auth-layout.mjs +93 -30
- package/dist/client/views/auth/forgot-password-form.d.mts +4 -5
- package/dist/client/views/auth/forgot-password-form.mjs +332 -100
- package/dist/client/views/auth/invite-form.mjs +447 -105
- package/dist/client/views/auth/login-form.d.mts +4 -5
- package/dist/client/views/auth/login-form.mjs +340 -120
- package/dist/client/views/auth/reset-password-form.d.mts +4 -5
- package/dist/client/views/auth/reset-password-form.mjs +458 -131
- package/dist/client/views/auth/setup-form.d.mts +4 -5
- package/dist/client/views/auth/setup-form.mjs +481 -141
- package/dist/client/views/collection/auto-form-fields.mjs +686 -266
- package/dist/client/views/collection/bulk-action-toolbar.mjs +392 -203
- package/dist/client/views/collection/cells/complex-cells.mjs +635 -216
- package/dist/client/views/collection/cells/primitive-cells.mjs +332 -102
- package/dist/client/views/collection/cells/relation-cells.mjs +227 -72
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +456 -136
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs +49 -2
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +109 -25
- package/dist/client/views/collection/cells/upload-cells.mjs +16 -8
- package/dist/client/views/collection/columns/build-columns.mjs +51 -12
- package/dist/client/views/collection/columns/column-defaults.mjs +17 -2
- package/dist/client/views/collection/field-context.mjs +10 -11
- package/dist/client/views/collection/field-renderer.mjs +237 -40
- package/dist/client/views/collection/form-view.mjs +1108 -445
- package/dist/client/views/collection/table-view.mjs +300 -163
- package/dist/client/views/collection/view-skeletons.mjs +181 -87
- package/dist/client/views/common/global-search.mjs +557 -233
- package/dist/client/views/dashboard/dashboard-grid.mjs +707 -211
- package/dist/client/views/dashboard/dashboard-widget.mjs +145 -58
- package/dist/client/views/dashboard/widget-card.mjs +315 -102
- package/dist/client/views/globals/global-form-view.mjs +1256 -131
- package/dist/client/views/layout/admin-layout-provider.d.mts +18 -21
- package/dist/client/views/layout/admin-layout-provider.mjs +135 -32
- package/dist/client/views/layout/admin-layout.d.mts +14 -32
- package/dist/client/views/layout/admin-layout.mjs +254 -96
- package/dist/client/views/layout/admin-router.d.mts +10 -42
- package/dist/client/views/layout/admin-router.mjs +1086 -426
- package/dist/client/views/layout/admin-sidebar.d.mts +10 -16
- package/dist/client/views/layout/admin-sidebar.mjs +1211 -382
- package/dist/client/views/layout/admin-topbar.mjs +220 -112
- package/dist/client/views/pages/accept-invite-page.d.mts +5 -6
- package/dist/client/views/pages/accept-invite-page.mjs +302 -96
- package/dist/client/views/pages/dashboard-page.d.mts +7 -16
- package/dist/client/views/pages/dashboard-page.mjs +62 -23
- package/dist/client/views/pages/forgot-password-page.d.mts +7 -10
- package/dist/client/views/pages/forgot-password-page.mjs +112 -40
- package/dist/client/views/pages/invite-page.d.mts +6 -7
- package/dist/client/views/pages/invite-page.mjs +121 -46
- package/dist/client/views/pages/login-page.d.mts +8 -15
- package/dist/client/views/pages/login-page.mjs +152 -57
- package/dist/client/views/pages/reset-password-page.d.mts +7 -10
- package/dist/client/views/pages/reset-password-page.mjs +209 -57
- package/dist/client/views/pages/setup-page.d.mts +7 -10
- package/dist/client/views/pages/setup-page.mjs +108 -43
- package/dist/client-module.d.mts +3 -0
- package/dist/client-module.mjs +3 -0
- package/dist/client.d.mts +55 -48
- package/dist/client.mjs +26 -28
- package/dist/components/rich-text/rich-text-renderer.d.mts +3 -4
- package/dist/components/rich-text/rich-text-renderer.mjs +97 -70
- package/dist/index.d.mts +36 -39
- package/dist/index.mjs +26 -28
- package/dist/plugin.d.mts +2 -0
- package/dist/plugin.mjs +3 -0
- package/dist/server/adapters/nextjs.d.mts +13 -14
- package/dist/server/adapters/nextjs.mjs +12 -13
- package/dist/server/adapters/tanstack.d.mts +10 -11
- package/dist/server/adapters/tanstack.mjs +11 -12
- 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 -1523
- package/dist/server/block/index.d.mts +4 -3
- 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 +10 -78
- package/dist/server/fields/blocks.mjs +74 -115
- package/dist/server/fields/index.d.mts +6 -39
- package/dist/server/fields/index.mjs +6 -7
- package/dist/server/fields/rich-text.d.mts +10 -77
- package/dist/server/fields/rich-text.mjs +59 -100
- package/dist/server/i18n/index.mjs +8 -9
- package/dist/server/i18n/messages/cs.mjs +3 -3
- package/dist/server/i18n/messages/de.mjs +3 -3
- package/dist/server/i18n/messages/en.mjs +217 -3
- package/dist/server/i18n/messages/es.mjs +3 -3
- package/dist/server/i18n/messages/fr.mjs +3 -3
- package/dist/server/i18n/messages/index.mjs +1 -2
- package/dist/server/i18n/messages/pl.mjs +3 -3
- package/dist/server/i18n/messages/pt.mjs +3 -3
- package/dist/server/i18n/messages/sk.mjs +202 -3
- 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/{auth-helpers.d.mts → modules/admin/auth-helpers.d.mts} +13 -14
- package/dist/server/{auth-helpers.mjs → modules/admin/auth-helpers.mjs} +15 -16
- package/dist/server/{block → modules/admin/block}/block-builder.d.mts +96 -32
- package/dist/server/{block → modules/admin/block}/block-builder.mjs +113 -15
- package/dist/server/modules/admin/block/index.d.mts +3 -0
- package/dist/server/{block → modules/admin/block}/introspection.d.mts +10 -5
- package/dist/server/{block → modules/admin/block}/introspection.mjs +18 -7
- package/dist/server/{block → modules/admin/block}/prefetch.d.mts +17 -17
- package/dist/server/{block → modules/admin/block}/prefetch.mjs +17 -16
- 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 +1060 -16846
- package/dist/server/modules/admin/index.mjs +17 -240
- 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/{functions → routes}/execute-action.d.mts +17 -32
- package/dist/server/modules/admin/{functions → routes}/execute-action.mjs +146 -44
- 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/{functions → routes}/preview.d.mts +25 -15
- package/dist/server/modules/admin/{functions → routes}/preview.mjs +84 -97
- package/dist/server/modules/admin/{functions → routes}/reactive.d.mts +19 -44
- package/dist/server/modules/admin/{functions → routes}/reactive.mjs +89 -117
- 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/{functions → routes}/setup.d.mts +11 -32
- 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.collection.mjs → admin-preferences.mjs} +13 -24
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs +18 -42
- 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 +30 -18
- package/dist/server.mjs +19 -16
- package/dist/shared/preview-utils.d.mts +2 -3
- package/dist/shared/preview-utils.mjs +2 -3
- package/dist/shared/types/saved-views.types.d.mts +2 -2
- package/package.json +50 -40
- 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/_virtual/rolldown_runtime.mjs +0 -18
- package/dist/augmentation.d.mts.map +0 -1
- package/dist/client/blocks/block-registry.d.mts +0 -199
- package/dist/client/blocks/block-registry.d.mts.map +0 -1
- package/dist/client/blocks/block-registry.mjs +0 -88
- package/dist/client/blocks/block-registry.mjs.map +0 -1
- package/dist/client/blocks/block-renderer.d.mts.map +0 -1
- package/dist/client/blocks/block-renderer.mjs.map +0 -1
- package/dist/client/blocks/prefetch.d.mts +0 -45
- package/dist/client/blocks/prefetch.d.mts.map +0 -1
- package/dist/client/blocks/prefetch.mjs +0 -26
- package/dist/client/blocks/prefetch.mjs.map +0 -1
- package/dist/client/blocks/types.d.mts.map +0 -1
- package/dist/client/blocks/types.mjs.map +0 -1
- package/dist/client/builder/admin-builder.d.mts +0 -112
- package/dist/client/builder/admin-builder.d.mts.map +0 -1
- package/dist/client/builder/admin-builder.mjs +0 -185
- package/dist/client/builder/admin-builder.mjs.map +0 -1
- package/dist/client/builder/admin-types.d.mts.map +0 -1
- package/dist/client/builder/admin.d.mts.map +0 -1
- package/dist/client/builder/admin.mjs.map +0 -1
- package/dist/client/builder/defaults/components.mjs +0 -20
- package/dist/client/builder/defaults/components.mjs.map +0 -1
- package/dist/client/builder/defaults/core.d.mts +0 -354
- package/dist/client/builder/defaults/core.d.mts.map +0 -1
- package/dist/client/builder/defaults/core.mjs +0 -49
- package/dist/client/builder/defaults/core.mjs.map +0 -1
- package/dist/client/builder/defaults/fields.mjs +0 -328
- package/dist/client/builder/defaults/fields.mjs.map +0 -1
- package/dist/client/builder/defaults/pages.mjs +0 -58
- package/dist/client/builder/defaults/pages.mjs.map +0 -1
- package/dist/client/builder/defaults/starter.d.mts +0 -351
- package/dist/client/builder/defaults/starter.d.mts.map +0 -1
- package/dist/client/builder/defaults/starter.mjs +0 -28
- package/dist/client/builder/defaults/starter.mjs.map +0 -1
- package/dist/client/builder/defaults/views.mjs +0 -27
- package/dist/client/builder/defaults/views.mjs.map +0 -1
- package/dist/client/builder/defaults/widgets.mjs +0 -31
- package/dist/client/builder/defaults/widgets.mjs.map +0 -1
- package/dist/client/builder/field/field.d.mts.map +0 -1
- package/dist/client/builder/field/field.mjs.map +0 -1
- package/dist/client/builder/index.d.mts.map +0 -1
- package/dist/client/builder/page/page.d.mts.map +0 -1
- package/dist/client/builder/page/page.mjs.map +0 -1
- package/dist/client/builder/proxies.d.mts +0 -2
- package/dist/client/builder/proxies.mjs +0 -24
- package/dist/client/builder/proxies.mjs.map +0 -1
- package/dist/client/builder/qa.d.mts +0 -50
- package/dist/client/builder/qa.d.mts.map +0 -1
- package/dist/client/builder/qa.mjs +0 -42
- package/dist/client/builder/qa.mjs.map +0 -1
- package/dist/client/builder/registry.d.mts.map +0 -1
- package/dist/client/builder/types/action-registry.d.mts +0 -2
- package/dist/client/builder/types/action-registry.mjs.map +0 -1
- package/dist/client/builder/types/action-types.d.mts.map +0 -1
- package/dist/client/builder/types/collection-types.d.mts +0 -199
- package/dist/client/builder/types/collection-types.d.mts.map +0 -1
- package/dist/client/builder/types/collection-types.mjs.map +0 -1
- package/dist/client/builder/types/common.d.mts.map +0 -1
- package/dist/client/builder/types/field-types.d.mts.map +0 -1
- package/dist/client/builder/types/field-types.mjs.map +0 -1
- package/dist/client/builder/types/global-types.d.mts +0 -22
- package/dist/client/builder/types/global-types.d.mts.map +0 -1
- package/dist/client/builder/types/ui-config.d.mts.map +0 -1
- package/dist/client/builder/types/views.d.mts +0 -89
- package/dist/client/builder/types/views.d.mts.map +0 -1
- package/dist/client/builder/types/widget-types.d.mts.map +0 -1
- package/dist/client/builder/validation.mjs.map +0 -1
- package/dist/client/builder/view/view.d.mts.map +0 -1
- package/dist/client/builder/view/view.mjs.map +0 -1
- package/dist/client/builder/widget/widget.d.mts.map +0 -1
- package/dist/client/builder/widget/widget.mjs.map +0 -1
- package/dist/client/components/actions/action-button.d.mts +0 -2
- package/dist/client/components/actions/action-button.mjs.map +0 -1
- package/dist/client/components/actions/action-dialog.d.mts +0 -2
- package/dist/client/components/actions/action-dialog.mjs.map +0 -1
- package/dist/client/components/actions/confirmation-dialog.d.mts +0 -2
- package/dist/client/components/actions/confirmation-dialog.mjs.map +0 -1
- package/dist/client/components/actions/header-actions.d.mts +0 -2
- package/dist/client/components/actions/header-actions.mjs.map +0 -1
- package/dist/client/components/actions/index.d.mts +0 -4
- package/dist/client/components/admin-link.d.mts.map +0 -1
- package/dist/client/components/admin-link.mjs.map +0 -1
- package/dist/client/components/auth/auth-guard.d.mts.map +0 -1
- package/dist/client/components/auth/auth-guard.mjs.map +0 -1
- package/dist/client/components/auth/auth-loading.d.mts.map +0 -1
- package/dist/client/components/auth/auth-loading.mjs.map +0 -1
- package/dist/client/components/auth/index.d.mts +0 -2
- package/dist/client/components/blocks/block-canvas.mjs.map +0 -1
- package/dist/client/components/blocks/block-editor-context.mjs.map +0 -1
- package/dist/client/components/blocks/block-editor-layout.mjs.map +0 -1
- package/dist/client/components/blocks/block-editor-provider.mjs.map +0 -1
- package/dist/client/components/blocks/block-fields-renderer.mjs.map +0 -1
- package/dist/client/components/blocks/block-insert-button.mjs.map +0 -1
- package/dist/client/components/blocks/block-item-menu.mjs.map +0 -1
- package/dist/client/components/blocks/block-item.mjs.map +0 -1
- package/dist/client/components/blocks/block-library-sidebar.mjs.map +0 -1
- package/dist/client/components/blocks/block-tree.mjs.map +0 -1
- package/dist/client/components/blocks/block-type-icon.mjs.map +0 -1
- package/dist/client/components/blocks/utils/tree-utils.mjs.map +0 -1
- package/dist/client/components/component-renderer.d.mts.map +0 -1
- package/dist/client/components/component-renderer.mjs.map +0 -1
- package/dist/client/components/error-boundary.mjs.map +0 -1
- package/dist/client/components/fields/array-field.d.mts +0 -44
- package/dist/client/components/fields/array-field.d.mts.map +0 -1
- package/dist/client/components/fields/array-field.mjs.map +0 -1
- package/dist/client/components/fields/asset-preview-field.d.mts +0 -52
- package/dist/client/components/fields/asset-preview-field.d.mts.map +0 -1
- package/dist/client/components/fields/asset-preview-field.mjs.map +0 -1
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts +0 -41
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts.map +0 -1
- package/dist/client/components/fields/blocks-field/blocks-field.mjs.map +0 -1
- package/dist/client/components/fields/blocks-field/index.d.mts +0 -1
- package/dist/client/components/fields/boolean-field.d.mts +0 -30
- package/dist/client/components/fields/boolean-field.d.mts.map +0 -1
- package/dist/client/components/fields/boolean-field.mjs.map +0 -1
- package/dist/client/components/fields/custom-field.d.mts +0 -3
- package/dist/client/components/fields/date-field.d.mts +0 -22
- package/dist/client/components/fields/date-field.d.mts.map +0 -1
- package/dist/client/components/fields/date-field.mjs.map +0 -1
- package/dist/client/components/fields/datetime-field.d.mts +0 -23
- package/dist/client/components/fields/datetime-field.d.mts.map +0 -1
- package/dist/client/components/fields/datetime-field.mjs.map +0 -1
- package/dist/client/components/fields/email-field.d.mts +0 -19
- package/dist/client/components/fields/email-field.d.mts.map +0 -1
- package/dist/client/components/fields/email-field.mjs.map +0 -1
- package/dist/client/components/fields/embedded-collection.d.mts +0 -3
- package/dist/client/components/fields/field-types.d.mts +0 -571
- package/dist/client/components/fields/field-types.d.mts.map +0 -1
- package/dist/client/components/fields/field-utils.d.mts +0 -1
- package/dist/client/components/fields/field-utils.mjs.map +0 -1
- package/dist/client/components/fields/field-wrapper.d.mts +0 -3
- package/dist/client/components/fields/field-wrapper.mjs.map +0 -1
- package/dist/client/components/fields/index.d.mts +0 -33
- package/dist/client/components/fields/json-field.d.mts +0 -84
- package/dist/client/components/fields/json-field.d.mts.map +0 -1
- package/dist/client/components/fields/json-field.mjs.map +0 -1
- package/dist/client/components/fields/locale-badge.d.mts +0 -1
- package/dist/client/components/fields/locale-badge.mjs.map +0 -1
- package/dist/client/components/fields/number-field.d.mts +0 -23
- package/dist/client/components/fields/number-field.d.mts.map +0 -1
- package/dist/client/components/fields/number-field.mjs.map +0 -1
- package/dist/client/components/fields/object-array-field.d.mts +0 -2
- package/dist/client/components/fields/object-array-field.mjs.map +0 -1
- package/dist/client/components/fields/object-field.d.mts +0 -32
- package/dist/client/components/fields/object-field.d.mts.map +0 -1
- package/dist/client/components/fields/object-field.mjs.map +0 -1
- package/dist/client/components/fields/relation/displays/cards-display.d.mts +0 -2
- package/dist/client/components/fields/relation/displays/cards-display.mjs.map +0 -1
- package/dist/client/components/fields/relation/displays/chips-display.d.mts +0 -2
- package/dist/client/components/fields/relation/displays/chips-display.mjs.map +0 -1
- package/dist/client/components/fields/relation/displays/grid-display.d.mts +0 -2
- package/dist/client/components/fields/relation/displays/grid-display.mjs.map +0 -1
- package/dist/client/components/fields/relation/displays/index.d.mts +0 -6
- package/dist/client/components/fields/relation/displays/list-display.d.mts +0 -2
- package/dist/client/components/fields/relation/displays/list-display.mjs.map +0 -1
- package/dist/client/components/fields/relation/displays/table-display.d.mts +0 -2
- package/dist/client/components/fields/relation/displays/table-display.mjs.map +0 -1
- package/dist/client/components/fields/relation/displays/types.d.mts +0 -22
- package/dist/client/components/fields/relation/displays/types.d.mts.map +0 -1
- package/dist/client/components/fields/relation/displays/types.mjs.map +0 -1
- package/dist/client/components/fields/relation/index.d.mts +0 -3
- package/dist/client/components/fields/relation/relation-items-display.d.mts +0 -5
- package/dist/client/components/fields/relation/relation-items-display.mjs.map +0 -1
- package/dist/client/components/fields/relation-field.d.mts +0 -134
- package/dist/client/components/fields/relation-field.d.mts.map +0 -1
- package/dist/client/components/fields/relation-field.mjs.map +0 -1
- package/dist/client/components/fields/relation-picker.d.mts +0 -4
- package/dist/client/components/fields/relation-picker.mjs.map +0 -1
- package/dist/client/components/fields/relation-select.d.mts +0 -3
- package/dist/client/components/fields/relation-select.mjs.map +0 -1
- package/dist/client/components/fields/reverse-relation-field.d.mts +0 -2
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/extensions.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/index.d.mts +0 -4
- package/dist/client/components/fields/rich-text-editor/index.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +0 -11
- package/dist/client/components/fields/rich-text-editor/presets.d.mts.map +0 -1
- package/dist/client/components/fields/rich-text-editor/presets.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/types.d.mts +0 -78
- package/dist/client/components/fields/rich-text-editor/types.d.mts.map +0 -1
- package/dist/client/components/fields/rich-text-editor/types.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/utils.mjs.map +0 -1
- package/dist/client/components/fields/rich-text-editor/variants.d.mts +0 -2
- package/dist/client/components/fields/rich-text-field.d.mts +0 -14
- package/dist/client/components/fields/rich-text-field.d.mts.map +0 -1
- package/dist/client/components/fields/rich-text-field.mjs.map +0 -1
- package/dist/client/components/fields/select-field.d.mts +0 -25
- package/dist/client/components/fields/select-field.d.mts.map +0 -1
- package/dist/client/components/fields/select-field.mjs.map +0 -1
- package/dist/client/components/fields/status-field.d.mts +0 -2
- package/dist/client/components/fields/text-field.d.mts +0 -22
- package/dist/client/components/fields/text-field.d.mts.map +0 -1
- package/dist/client/components/fields/text-field.mjs.map +0 -1
- package/dist/client/components/fields/textarea-field.d.mts +0 -22
- package/dist/client/components/fields/textarea-field.d.mts.map +0 -1
- package/dist/client/components/fields/textarea-field.mjs.map +0 -1
- package/dist/client/components/fields/time-field.d.mts +0 -20
- package/dist/client/components/fields/time-field.d.mts.map +0 -1
- package/dist/client/components/fields/time-field.mjs.map +0 -1
- package/dist/client/components/fields/upload-field.d.mts +0 -97
- package/dist/client/components/fields/upload-field.d.mts.map +0 -1
- package/dist/client/components/fields/upload-field.mjs.map +0 -1
- package/dist/client/components/filter-builder/columns-tab.d.mts +0 -1
- package/dist/client/components/filter-builder/columns-tab.mjs.map +0 -1
- package/dist/client/components/filter-builder/filter-builder-sheet.d.mts +0 -1
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs.map +0 -1
- package/dist/client/components/filter-builder/filters-tab.d.mts +0 -1
- package/dist/client/components/filter-builder/filters-tab.mjs.map +0 -1
- package/dist/client/components/filter-builder/index.d.mts +0 -5
- package/dist/client/components/filter-builder/saved-views-tab.d.mts +0 -1
- package/dist/client/components/filter-builder/saved-views-tab.mjs.map +0 -1
- package/dist/client/components/index.d.mts +0 -80
- package/dist/client/components/locale-switcher.d.mts +0 -2
- package/dist/client/components/locale-switcher.mjs.map +0 -1
- package/dist/client/components/media/media-grid.mjs.map +0 -1
- package/dist/client/components/media/media-picker-dialog.mjs.map +0 -1
- package/dist/client/components/preview/live-preview-mode.mjs.map +0 -1
- package/dist/client/components/preview/preview-pane.mjs.map +0 -1
- package/dist/client/components/primitives/asset-preview.mjs.map +0 -1
- package/dist/client/components/primitives/checkbox-input.mjs.map +0 -1
- package/dist/client/components/primitives/date-input.mjs.map +0 -1
- package/dist/client/components/primitives/dropzone.mjs.map +0 -1
- package/dist/client/components/primitives/number-input.mjs.map +0 -1
- package/dist/client/components/primitives/select-multi.mjs.map +0 -1
- package/dist/client/components/primitives/select-single.mjs.map +0 -1
- package/dist/client/components/primitives/text-input.mjs.map +0 -1
- package/dist/client/components/primitives/textarea-input.mjs.map +0 -1
- package/dist/client/components/primitives/time-input.mjs.map +0 -1
- package/dist/client/components/primitives/toggle-input.mjs.map +0 -1
- package/dist/client/components/primitives/types.d.mts +0 -14
- package/dist/client/components/primitives/types.d.mts.map +0 -1
- package/dist/client/components/primitives/types.mjs.map +0 -1
- package/dist/client/components/sheets/index.d.mts +0 -1
- package/dist/client/components/sheets/resource-sheet.d.mts +0 -1
- package/dist/client/components/sheets/resource-sheet.mjs.map +0 -1
- package/dist/client/components/ui/accordion.d.mts +0 -2
- package/dist/client/components/ui/accordion.mjs.map +0 -1
- package/dist/client/components/ui/alert.mjs.map +0 -1
- package/dist/client/components/ui/avatar.d.mts +0 -3
- package/dist/client/components/ui/badge.d.mts +0 -3
- package/dist/client/components/ui/badge.mjs.map +0 -1
- package/dist/client/components/ui/button.d.mts +0 -3
- package/dist/client/components/ui/button.mjs.map +0 -1
- package/dist/client/components/ui/card.d.mts +0 -2
- package/dist/client/components/ui/card.mjs.map +0 -1
- package/dist/client/components/ui/checkbox.d.mts +0 -2
- package/dist/client/components/ui/checkbox.mjs.map +0 -1
- package/dist/client/components/ui/combobox.d.mts +0 -3
- package/dist/client/components/ui/command.mjs.map +0 -1
- package/dist/client/components/ui/dialog.d.mts +0 -3
- package/dist/client/components/ui/dialog.mjs.map +0 -1
- package/dist/client/components/ui/drawer.mjs.map +0 -1
- package/dist/client/components/ui/dropdown-menu.d.mts +0 -3
- package/dist/client/components/ui/dropdown-menu.mjs.map +0 -1
- package/dist/client/components/ui/empty-state.mjs.map +0 -1
- package/dist/client/components/ui/field.d.mts +0 -3
- package/dist/client/components/ui/field.mjs.map +0 -1
- package/dist/client/components/ui/input-group.d.mts +0 -4
- package/dist/client/components/ui/input-group.mjs.map +0 -1
- package/dist/client/components/ui/input.d.mts +0 -2
- package/dist/client/components/ui/input.mjs.map +0 -1
- package/dist/client/components/ui/kbd.mjs.map +0 -1
- package/dist/client/components/ui/label.d.mts +0 -2
- package/dist/client/components/ui/label.mjs.map +0 -1
- package/dist/client/components/ui/popover.d.mts +0 -3
- package/dist/client/components/ui/popover.mjs.map +0 -1
- package/dist/client/components/ui/responsive-dialog.mjs.map +0 -1
- package/dist/client/components/ui/scroll-area.d.mts +0 -2
- package/dist/client/components/ui/search-input.mjs.map +0 -1
- package/dist/client/components/ui/select.d.mts +0 -3
- package/dist/client/components/ui/select.mjs.map +0 -1
- package/dist/client/components/ui/separator.d.mts +0 -2
- package/dist/client/components/ui/separator.mjs.map +0 -1
- package/dist/client/components/ui/sheet.d.mts +0 -3
- package/dist/client/components/ui/sheet.mjs.map +0 -1
- package/dist/client/components/ui/sidebar.d.mts +0 -8
- package/dist/client/components/ui/sidebar.mjs.map +0 -1
- package/dist/client/components/ui/skeleton.d.mts +0 -1
- package/dist/client/components/ui/skeleton.mjs.map +0 -1
- package/dist/client/components/ui/sonner.d.mts.map +0 -1
- package/dist/client/components/ui/sonner.mjs.map +0 -1
- package/dist/client/components/ui/spinner.d.mts +0 -1
- package/dist/client/components/ui/spinner.mjs.map +0 -1
- package/dist/client/components/ui/switch.d.mts +0 -2
- package/dist/client/components/ui/switch.mjs.map +0 -1
- package/dist/client/components/ui/table.d.mts +0 -2
- package/dist/client/components/ui/table.mjs.map +0 -1
- package/dist/client/components/ui/tabs.d.mts +0 -3
- package/dist/client/components/ui/tabs.mjs.map +0 -1
- package/dist/client/components/ui/textarea.d.mts +0 -2
- package/dist/client/components/ui/textarea.mjs.map +0 -1
- package/dist/client/components/ui/toolbar.mjs.map +0 -1
- package/dist/client/components/ui/tooltip.d.mts +0 -2
- package/dist/client/components/ui/tooltip.mjs.map +0 -1
- package/dist/client/components/widgets/chart-widget.d.mts +0 -57
- package/dist/client/components/widgets/chart-widget.d.mts.map +0 -1
- package/dist/client/components/widgets/chart-widget.mjs.map +0 -1
- package/dist/client/components/widgets/progress-widget.d.mts +0 -41
- package/dist/client/components/widgets/progress-widget.d.mts.map +0 -1
- package/dist/client/components/widgets/progress-widget.mjs.map +0 -1
- package/dist/client/components/widgets/quick-actions-widget.d.mts +0 -29
- package/dist/client/components/widgets/quick-actions-widget.d.mts.map +0 -1
- package/dist/client/components/widgets/quick-actions-widget.mjs.map +0 -1
- package/dist/client/components/widgets/recent-items-widget.d.mts +0 -51
- package/dist/client/components/widgets/recent-items-widget.d.mts.map +0 -1
- package/dist/client/components/widgets/recent-items-widget.mjs.map +0 -1
- package/dist/client/components/widgets/stats-widget.d.mts +0 -55
- package/dist/client/components/widgets/stats-widget.d.mts.map +0 -1
- package/dist/client/components/widgets/stats-widget.mjs.map +0 -1
- package/dist/client/components/widgets/table-widget.d.mts +0 -31
- package/dist/client/components/widgets/table-widget.d.mts.map +0 -1
- package/dist/client/components/widgets/table-widget.mjs.map +0 -1
- package/dist/client/components/widgets/timeline-widget.d.mts +0 -51
- package/dist/client/components/widgets/timeline-widget.d.mts.map +0 -1
- package/dist/client/components/widgets/timeline-widget.mjs.map +0 -1
- package/dist/client/components/widgets/value-widget.d.mts +0 -39
- package/dist/client/components/widgets/value-widget.d.mts.map +0 -1
- package/dist/client/components/widgets/value-widget.mjs.map +0 -1
- package/dist/client/components/widgets/widget-skeletons.mjs.map +0 -1
- package/dist/client/context/focus-context.d.mts.map +0 -1
- package/dist/client/context/focus-context.mjs.map +0 -1
- package/dist/client/contexts/breadcrumb-context.mjs.map +0 -1
- package/dist/client/hooks/typed-hooks.d.mts.map +0 -1
- package/dist/client/hooks/typed-hooks.mjs.map +0 -1
- package/dist/client/hooks/use-action.mjs.map +0 -1
- package/dist/client/hooks/use-admin-config.mjs.map +0 -1
- package/dist/client/hooks/use-admin-preferences.mjs.map +0 -1
- package/dist/client/hooks/use-admin-routes.mjs.map +0 -1
- package/dist/client/hooks/use-auth.d.mts.map +0 -1
- package/dist/client/hooks/use-auth.mjs.map +0 -1
- package/dist/client/hooks/use-collection-fields.mjs.map +0 -1
- package/dist/client/hooks/use-collection-meta.mjs.map +0 -1
- package/dist/client/hooks/use-collection-schema.mjs.map +0 -1
- package/dist/client/hooks/use-collection-validation.mjs.map +0 -1
- package/dist/client/hooks/use-collection.d.mts.map +0 -1
- package/dist/client/hooks/use-collection.mjs.map +0 -1
- package/dist/client/hooks/use-current-user.d.mts.map +0 -1
- package/dist/client/hooks/use-current-user.mjs.map +0 -1
- package/dist/client/hooks/use-field-hooks.mjs.map +0 -1
- package/dist/client/hooks/use-field-options.d.mts.map +0 -1
- package/dist/client/hooks/use-field-options.mjs.map +0 -1
- package/dist/client/hooks/use-global-fields.mjs.map +0 -1
- package/dist/client/hooks/use-global-meta.mjs.map +0 -1
- package/dist/client/hooks/use-global-schema.mjs.map +0 -1
- package/dist/client/hooks/use-global.d.mts.map +0 -1
- package/dist/client/hooks/use-global.mjs.map +0 -1
- package/dist/client/hooks/use-locks.mjs.map +0 -1
- package/dist/client/hooks/use-media-query.d.mts.map +0 -1
- package/dist/client/hooks/use-media-query.mjs.map +0 -1
- package/dist/client/hooks/use-prefill-params.mjs.map +0 -1
- package/dist/client/hooks/use-questpie-query-options.mjs.map +0 -1
- package/dist/client/hooks/use-reactive-fields.d.mts.map +0 -1
- package/dist/client/hooks/use-reactive-fields.mjs.map +0 -1
- package/dist/client/hooks/use-realtime-highlight.mjs.map +0 -1
- package/dist/client/hooks/use-saved-views.mjs.map +0 -1
- package/dist/client/hooks/use-search.mjs.map +0 -1
- package/dist/client/hooks/use-server-validation.mjs.map +0 -1
- package/dist/client/hooks/use-server-widget-data.d.mts.map +0 -1
- package/dist/client/hooks/use-server-widget-data.mjs.map +0 -1
- package/dist/client/hooks/use-setup-status.d.mts.map +0 -1
- package/dist/client/hooks/use-setup-status.mjs.map +0 -1
- package/dist/client/hooks/use-upload-collection.mjs.map +0 -1
- package/dist/client/hooks/use-upload.d.mts +0 -23
- package/dist/client/hooks/use-upload.d.mts.map +0 -1
- package/dist/client/hooks/use-upload.mjs.map +0 -1
- package/dist/client/hooks/use-validation-error-map.mjs.map +0 -1
- package/dist/client/hooks/use-view-state.mjs.map +0 -1
- package/dist/client/i18n/hooks.mjs.map +0 -1
- package/dist/client/i18n/intl-cache.mjs.map +0 -1
- package/dist/client/i18n/messages.mjs.map +0 -1
- package/dist/client/i18n/simple.d.mts.map +0 -1
- package/dist/client/i18n/simple.mjs.map +0 -1
- package/dist/client/i18n/types.d.mts.map +0 -1
- package/dist/client/lib/utils.d.mts +0 -1
- package/dist/client/lib/utils.mjs.map +0 -1
- package/dist/client/preview/block-scope-context.d.mts.map +0 -1
- package/dist/client/preview/block-scope-context.mjs.map +0 -1
- package/dist/client/preview/preview-banner.d.mts.map +0 -1
- package/dist/client/preview/preview-banner.mjs.map +0 -1
- package/dist/client/preview/preview-field.d.mts.map +0 -1
- package/dist/client/preview/preview-field.mjs.map +0 -1
- package/dist/client/preview/types.d.mts.map +0 -1
- package/dist/client/preview/types.mjs.map +0 -1
- package/dist/client/preview/use-collection-preview.d.mts.map +0 -1
- package/dist/client/preview/use-collection-preview.mjs.map +0 -1
- package/dist/client/runtime/content-locales-provider.mjs.map +0 -1
- package/dist/client/runtime/locale-scope.mjs.map +0 -1
- package/dist/client/runtime/provider.d.mts.map +0 -1
- package/dist/client/runtime/provider.mjs.map +0 -1
- package/dist/client/runtime/routes.d.mts.map +0 -1
- package/dist/client/runtime/routes.mjs.map +0 -1
- package/dist/client/runtime/translations-provider.d.mts +0 -2
- package/dist/client/runtime/translations-provider.mjs.map +0 -1
- package/dist/client/scope/picker.d.mts.map +0 -1
- package/dist/client/scope/picker.mjs.map +0 -1
- package/dist/client/scope/provider.d.mts.map +0 -1
- package/dist/client/scope/provider.mjs.map +0 -1
- package/dist/client/scope/types.d.mts.map +0 -1
- package/dist/client/utils/auto-expand-fields.mjs.map +0 -1
- package/dist/client/utils/build-field-definitions-from-schema.mjs.map +0 -1
- package/dist/client/utils/detect-relations.mjs.map +0 -1
- package/dist/client/utils/locale-to-flag.d.mts.map +0 -1
- package/dist/client/utils/locale-to-flag.mjs.map +0 -1
- package/dist/client/utils/routes.mjs.map +0 -1
- package/dist/client/views/auth/accept-invite-form.d.mts.map +0 -1
- package/dist/client/views/auth/accept-invite-form.mjs.map +0 -1
- package/dist/client/views/auth/auth-layout.d.mts.map +0 -1
- package/dist/client/views/auth/auth-layout.mjs.map +0 -1
- package/dist/client/views/auth/forgot-password-form.d.mts.map +0 -1
- package/dist/client/views/auth/forgot-password-form.mjs.map +0 -1
- package/dist/client/views/auth/index.d.mts +0 -7
- package/dist/client/views/auth/invite-form.d.mts +0 -1
- package/dist/client/views/auth/invite-form.mjs.map +0 -1
- package/dist/client/views/auth/login-form.d.mts.map +0 -1
- package/dist/client/views/auth/login-form.mjs.map +0 -1
- package/dist/client/views/auth/reset-password-form.d.mts.map +0 -1
- package/dist/client/views/auth/reset-password-form.mjs.map +0 -1
- package/dist/client/views/auth/setup-form.d.mts.map +0 -1
- package/dist/client/views/auth/setup-form.mjs.map +0 -1
- package/dist/client/views/collection/auto-form-fields.d.mts +0 -4
- package/dist/client/views/collection/auto-form-fields.mjs.map +0 -1
- package/dist/client/views/collection/bulk-action-toolbar.mjs.map +0 -1
- package/dist/client/views/collection/cells/complex-cells.d.mts +0 -46
- package/dist/client/views/collection/cells/complex-cells.d.mts.map +0 -1
- package/dist/client/views/collection/cells/complex-cells.mjs.map +0 -1
- package/dist/client/views/collection/cells/index.d.mts +0 -7
- package/dist/client/views/collection/cells/primitive-cells.d.mts +0 -76
- package/dist/client/views/collection/cells/primitive-cells.d.mts.map +0 -1
- package/dist/client/views/collection/cells/primitive-cells.mjs.map +0 -1
- package/dist/client/views/collection/cells/relation-cells.d.mts +0 -21
- package/dist/client/views/collection/cells/relation-cells.d.mts.map +0 -1
- package/dist/client/views/collection/cells/relation-cells.mjs.map +0 -1
- package/dist/client/views/collection/cells/shared/asset-thumbnail.d.mts +0 -1
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs.map +0 -1
- package/dist/client/views/collection/cells/shared/cell-helpers.d.mts +0 -2
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs.map +0 -1
- package/dist/client/views/collection/cells/shared/relation-chip.d.mts +0 -1
- package/dist/client/views/collection/cells/shared/relation-chip.mjs.map +0 -1
- package/dist/client/views/collection/cells/upload-cells.d.mts +0 -25
- package/dist/client/views/collection/cells/upload-cells.d.mts.map +0 -1
- package/dist/client/views/collection/cells/upload-cells.mjs.map +0 -1
- package/dist/client/views/collection/columns/build-columns.d.mts +0 -2
- package/dist/client/views/collection/columns/build-columns.mjs.map +0 -1
- package/dist/client/views/collection/columns/column-defaults.d.mts +0 -2
- package/dist/client/views/collection/columns/column-defaults.mjs.map +0 -1
- package/dist/client/views/collection/columns/index.d.mts +0 -3
- package/dist/client/views/collection/columns/types.d.mts +0 -2
- package/dist/client/views/collection/field-context.mjs.map +0 -1
- package/dist/client/views/collection/field-renderer.mjs.map +0 -1
- package/dist/client/views/collection/form-view.d.mts +0 -112
- package/dist/client/views/collection/form-view.d.mts.map +0 -1
- package/dist/client/views/collection/form-view.mjs.map +0 -1
- package/dist/client/views/collection/index.d.mts +0 -9
- package/dist/client/views/collection/table-view.d.mts +0 -102
- package/dist/client/views/collection/table-view.d.mts.map +0 -1
- package/dist/client/views/collection/table-view.mjs.map +0 -1
- package/dist/client/views/collection/view-skeletons.mjs.map +0 -1
- package/dist/client/views/common/global-search.d.mts +0 -1
- package/dist/client/views/common/global-search.mjs.map +0 -1
- package/dist/client/views/common/index.d.mts +0 -1
- package/dist/client/views/dashboard/dashboard-grid.mjs.map +0 -1
- package/dist/client/views/dashboard/dashboard-widget.mjs.map +0 -1
- package/dist/client/views/dashboard/widget-card.mjs.map +0 -1
- package/dist/client/views/globals/global-form-view.d.mts +0 -74
- package/dist/client/views/globals/global-form-view.d.mts.map +0 -1
- package/dist/client/views/globals/global-form-view.mjs.map +0 -1
- package/dist/client/views/index.d.mts +0 -28
- package/dist/client/views/layout/admin-layout-provider.d.mts.map +0 -1
- package/dist/client/views/layout/admin-layout-provider.mjs.map +0 -1
- package/dist/client/views/layout/admin-layout.d.mts.map +0 -1
- package/dist/client/views/layout/admin-layout.mjs.map +0 -1
- package/dist/client/views/layout/admin-root.d.mts +0 -7
- package/dist/client/views/layout/admin-router.d.mts.map +0 -1
- package/dist/client/views/layout/admin-router.mjs.map +0 -1
- package/dist/client/views/layout/admin-sidebar.d.mts.map +0 -1
- package/dist/client/views/layout/admin-sidebar.mjs.map +0 -1
- package/dist/client/views/layout/admin-topbar.mjs.map +0 -1
- package/dist/client/views/layout/index.d.mts +0 -5
- package/dist/client/views/pages/accept-invite-page.d.mts.map +0 -1
- package/dist/client/views/pages/accept-invite-page.mjs.map +0 -1
- package/dist/client/views/pages/dashboard-page.d.mts.map +0 -1
- package/dist/client/views/pages/dashboard-page.mjs.map +0 -1
- package/dist/client/views/pages/forgot-password-page.d.mts.map +0 -1
- package/dist/client/views/pages/forgot-password-page.mjs.map +0 -1
- package/dist/client/views/pages/index.d.mts +0 -7
- package/dist/client/views/pages/invite-page.d.mts.map +0 -1
- package/dist/client/views/pages/invite-page.mjs.map +0 -1
- package/dist/client/views/pages/login-page.d.mts.map +0 -1
- package/dist/client/views/pages/login-page.mjs.map +0 -1
- package/dist/client/views/pages/reset-password-page.d.mts.map +0 -1
- package/dist/client/views/pages/reset-password-page.mjs.map +0 -1
- package/dist/client/views/pages/setup-page.d.mts.map +0 -1
- package/dist/client/views/pages/setup-page.mjs.map +0 -1
- package/dist/client.d.mts.map +0 -1
- package/dist/components/rich-text/rich-text-renderer.d.mts.map +0 -1
- package/dist/components/rich-text/rich-text-renderer.mjs.map +0 -1
- package/dist/server/adapters/nextjs.d.mts.map +0 -1
- package/dist/server/adapters/nextjs.mjs.map +0 -1
- package/dist/server/adapters/tanstack.d.mts.map +0 -1
- package/dist/server/adapters/tanstack.mjs.map +0 -1
- package/dist/server/augmentation.d.mts.map +0 -1
- package/dist/server/auth-helpers.d.mts.map +0 -1
- package/dist/server/auth-helpers.mjs.map +0 -1
- package/dist/server/block/block-builder.d.mts.map +0 -1
- package/dist/server/block/block-builder.mjs.map +0 -1
- package/dist/server/block/introspection.d.mts.map +0 -1
- package/dist/server/block/introspection.mjs.map +0 -1
- package/dist/server/block/prefetch.d.mts.map +0 -1
- package/dist/server/block/prefetch.mjs.map +0 -1
- package/dist/server/fields/blocks.d.mts.map +0 -1
- package/dist/server/fields/blocks.mjs.map +0 -1
- package/dist/server/fields/index.d.mts.map +0 -1
- package/dist/server/fields/index.mjs.map +0 -1
- package/dist/server/fields/rich-text.d.mts.map +0 -1
- package/dist/server/fields/rich-text.mjs.map +0 -1
- package/dist/server/i18n/index.d.mts +0 -16
- package/dist/server/i18n/index.d.mts.map +0 -1
- package/dist/server/i18n/index.mjs.map +0 -1
- package/dist/server/i18n/messages/cs.mjs.map +0 -1
- package/dist/server/i18n/messages/de.mjs.map +0 -1
- package/dist/server/i18n/messages/en.mjs.map +0 -1
- package/dist/server/i18n/messages/es.mjs.map +0 -1
- package/dist/server/i18n/messages/fr.mjs.map +0 -1
- package/dist/server/i18n/messages/index.mjs.map +0 -1
- package/dist/server/i18n/messages/pl.mjs.map +0 -1
- package/dist/server/i18n/messages/pt.mjs.map +0 -1
- package/dist/server/i18n/messages/sk.mjs.map +0 -1
- package/dist/server/index.d.mts +0 -20
- package/dist/server/modules/admin/functions/admin-config.mjs +0 -348
- package/dist/server/modules/admin/functions/admin-config.mjs.map +0 -1
- package/dist/server/modules/admin/functions/execute-action.d.mts.map +0 -1
- package/dist/server/modules/admin/functions/execute-action.mjs.map +0 -1
- package/dist/server/modules/admin/functions/locales.mjs +0 -80
- package/dist/server/modules/admin/functions/locales.mjs.map +0 -1
- package/dist/server/modules/admin/functions/preview.d.mts.map +0 -1
- package/dist/server/modules/admin/functions/preview.mjs.map +0 -1
- package/dist/server/modules/admin/functions/reactive.d.mts.map +0 -1
- package/dist/server/modules/admin/functions/reactive.mjs.map +0 -1
- package/dist/server/modules/admin/functions/setup.d.mts.map +0 -1
- package/dist/server/modules/admin/functions/setup.mjs +0 -131
- package/dist/server/modules/admin/functions/setup.mjs.map +0 -1
- package/dist/server/modules/admin/functions/translations.mjs +0 -125
- package/dist/server/modules/admin/functions/translations.mjs.map +0 -1
- package/dist/server/modules/admin/functions/widget-data.d.mts +0 -33
- package/dist/server/modules/admin/functions/widget-data.d.mts.map +0 -1
- package/dist/server/modules/admin/functions/widget-data.mjs +0 -70
- package/dist/server/modules/admin/functions/widget-data.mjs.map +0 -1
- package/dist/server/modules/admin/index.d.mts.map +0 -1
- package/dist/server/modules/admin/index.mjs.map +0 -1
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.d.mts +0 -3
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs.map +0 -1
- package/dist/server/modules/admin-preferences/collections/locks.collection.d.mts +0 -3
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs.map +0 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts +0 -1490
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts.map +0 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs +0 -57
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs.map +0 -1
- package/dist/server/patch.d.mts +0 -100
- package/dist/server/patch.d.mts.map +0 -1
- package/dist/server/patch.mjs +0 -1062
- package/dist/server/patch.mjs.map +0 -1
- package/dist/shared/preview-utils.d.mts.map +0 -1
- package/dist/shared/preview-utils.mjs.map +0 -1
- package/dist/shared/types/saved-views.types.d.mts.map +0 -1
|
@@ -1,36 +1,46 @@
|
|
|
1
|
-
import { getDefaultFormActions } from "../../builder/types/action-registry.mjs";
|
|
2
1
|
import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
|
|
3
|
-
import {
|
|
2
|
+
import { selectBasePath, selectClient, selectNavigate, useAdminStore } from "../../runtime/provider.mjs";
|
|
4
3
|
import { useSafeContentLocales } from "../../runtime/content-locales-provider.mjs";
|
|
5
4
|
import { useScopedLocale } from "../../runtime/locale-scope.mjs";
|
|
6
5
|
import { resolveIconElement } from "../../components/component-renderer.mjs";
|
|
7
6
|
import { Button } from "../../components/ui/button.mjs";
|
|
7
|
+
import { Badge } from "../../components/ui/badge.mjs";
|
|
8
8
|
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../../components/ui/dialog.mjs";
|
|
9
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../components/ui/dropdown-menu.mjs";
|
|
10
|
+
import { LocaleSwitcher } from "../../components/locale-switcher.mjs";
|
|
11
|
+
import { Label } from "../../components/ui/label.mjs";
|
|
12
|
+
import { RenderProfiler } from "../../lib/render-profiler.mjs";
|
|
13
|
+
import { Checkbox } from "../../components/ui/checkbox.mjs";
|
|
14
|
+
import { DateTimeInput } from "../../components/primitives/date-input.mjs";
|
|
15
|
+
import { getDefaultFormActions } from "../../builder/types/action-registry.mjs";
|
|
9
16
|
import { ConfirmationDialog } from "../../components/actions/confirmation-dialog.mjs";
|
|
10
17
|
import { ActionButton } from "../../components/actions/action-button.mjs";
|
|
11
18
|
import { useCollectionFields } from "../../hooks/use-collection-fields.mjs";
|
|
12
|
-
import { detectManyToManyRelations, hasManyToManyRelations } from "../../utils/detect-relations.mjs";
|
|
13
|
-
import { useAdminConfig } from "../../hooks/use-admin-config.mjs";
|
|
14
19
|
import { AutoFormFields } from "./auto-form-fields.mjs";
|
|
15
20
|
import { ActionDialog } from "../../components/actions/action-dialog.mjs";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { LivePreviewMode, useLivePreviewContext } from "../../components/preview/live-preview-mode.mjs";
|
|
19
|
-
import { Badge } from "../../components/ui/badge.mjs";
|
|
20
|
-
import { useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionUpdate } from "../../hooks/use-collection.mjs";
|
|
21
|
+
import { HistorySidebar } from "../../components/history-sidebar.mjs";
|
|
22
|
+
import { LivePreviewMode } from "../../components/preview/live-preview-mode.mjs";
|
|
21
23
|
import { useCollectionValidation } from "../../hooks/use-collection-validation.mjs";
|
|
22
|
-
import {
|
|
24
|
+
import { useSearchParamToggle } from "../../hooks/use-search-param-toggle.mjs";
|
|
23
25
|
import { usePreferServerValidation } from "../../hooks/use-server-validation.mjs";
|
|
26
|
+
import { useSidebarSearchParam } from "../../hooks/use-sidebar-search-param.mjs";
|
|
27
|
+
import { useCollectionAuditHistory } from "../../hooks/use-audit-history.mjs";
|
|
28
|
+
import { useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions } from "../../hooks/use-collection.mjs";
|
|
29
|
+
import { getLockUser, useLock } from "../../hooks/use-locks.mjs";
|
|
24
30
|
import { useReactiveFields } from "../../hooks/use-reactive-fields.mjs";
|
|
31
|
+
import { useServerActions } from "../../hooks/use-server-actions.mjs";
|
|
32
|
+
import { useTransitionStage } from "../../hooks/use-transition-stage.mjs";
|
|
33
|
+
import { detectManyToManyRelations, hasManyToManyRelations } from "../../utils/detect-relations.mjs";
|
|
25
34
|
import { FormViewSkeleton } from "./view-skeletons.mjs";
|
|
35
|
+
import { c } from "react/compiler-runtime";
|
|
26
36
|
import { Icon } from "@iconify/react";
|
|
37
|
+
import * as React from "react";
|
|
38
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
39
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
40
|
+
import { FormProvider, useForm, useFormState } from "react-hook-form";
|
|
41
|
+
import { toast } from "sonner";
|
|
27
42
|
import { createQuestpieQueryOptions } from "@questpie/tanstack-query";
|
|
28
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
29
43
|
import { QuestpieClientError } from "questpie/client";
|
|
30
|
-
import * as React$1 from "react";
|
|
31
|
-
import { FormProvider, useForm, useWatch } from "react-hook-form";
|
|
32
|
-
import { toast } from "sonner";
|
|
33
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
34
44
|
|
|
35
45
|
//#region src/client/views/collection/form-view.tsx
|
|
36
46
|
/**
|
|
@@ -39,7 +49,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
39
49
|
* Renders collection item edit/create form with sections, tabs, validation.
|
|
40
50
|
* This is the default edit view registered in the admin view registry.
|
|
41
51
|
*/
|
|
42
|
-
/** Query key prefix for
|
|
52
|
+
/** Query key prefix for app queries (used for cache invalidation) */
|
|
43
53
|
const QUERY_KEY_PREFIX = ["questpie", "collections"];
|
|
44
54
|
/**
|
|
45
55
|
* Extract reactive configs from collection schema fields.
|
|
@@ -55,16 +65,366 @@ function extractReactiveConfigs(schema) {
|
|
|
55
65
|
* Component that manages reactive field states.
|
|
56
66
|
* Must be rendered inside FormProvider to access form context.
|
|
57
67
|
*/
|
|
58
|
-
function ReactiveFieldsManager(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
function ReactiveFieldsManager(t0) {
|
|
69
|
+
const $ = c(8);
|
|
70
|
+
const { collection, mode: t1, reactiveConfigs, enabled } = t0;
|
|
71
|
+
const mode = t1 === void 0 ? "collection" : t1;
|
|
72
|
+
let t2;
|
|
73
|
+
if ($[0] !== enabled || $[1] !== reactiveConfigs) {
|
|
74
|
+
t2 = enabled && Object.keys(reactiveConfigs).length > 0;
|
|
75
|
+
$[0] = enabled;
|
|
76
|
+
$[1] = reactiveConfigs;
|
|
77
|
+
$[2] = t2;
|
|
78
|
+
} else t2 = $[2];
|
|
79
|
+
let t3;
|
|
80
|
+
if ($[3] !== collection || $[4] !== mode || $[5] !== reactiveConfigs || $[6] !== t2) {
|
|
81
|
+
t3 = {
|
|
82
|
+
collection,
|
|
83
|
+
mode,
|
|
84
|
+
reactiveConfigs,
|
|
85
|
+
enabled: t2,
|
|
86
|
+
debounce: 300
|
|
87
|
+
};
|
|
88
|
+
$[3] = collection;
|
|
89
|
+
$[4] = mode;
|
|
90
|
+
$[5] = reactiveConfigs;
|
|
91
|
+
$[6] = t2;
|
|
92
|
+
$[7] = t3;
|
|
93
|
+
} else t3 = $[7];
|
|
94
|
+
useReactiveFields(t3);
|
|
66
95
|
return null;
|
|
67
96
|
}
|
|
97
|
+
const FormFieldsContent = React.memo(function FormFieldsContent$1(t0) {
|
|
98
|
+
const $ = c(8);
|
|
99
|
+
const { collection, config, registry, allCollectionsConfig } = t0;
|
|
100
|
+
const t1 = `form.fields.${collection}`;
|
|
101
|
+
const t2 = collection;
|
|
102
|
+
const t3 = config;
|
|
103
|
+
const t4 = allCollectionsConfig;
|
|
104
|
+
let t5;
|
|
105
|
+
if ($[0] !== registry || $[1] !== t2 || $[2] !== t3 || $[3] !== t4) {
|
|
106
|
+
t5 = /* @__PURE__ */ jsx(AutoFormFields, {
|
|
107
|
+
collection: t2,
|
|
108
|
+
config: t3,
|
|
109
|
+
registry,
|
|
110
|
+
allCollectionsConfig: t4
|
|
111
|
+
});
|
|
112
|
+
$[0] = registry;
|
|
113
|
+
$[1] = t2;
|
|
114
|
+
$[2] = t3;
|
|
115
|
+
$[3] = t4;
|
|
116
|
+
$[4] = t5;
|
|
117
|
+
} else t5 = $[4];
|
|
118
|
+
let t6;
|
|
119
|
+
if ($[5] !== t1 || $[6] !== t5) {
|
|
120
|
+
t6 = /* @__PURE__ */ jsx(RenderProfiler, {
|
|
121
|
+
id: t1,
|
|
122
|
+
minDurationMs: 10,
|
|
123
|
+
children: t5
|
|
124
|
+
});
|
|
125
|
+
$[5] = t1;
|
|
126
|
+
$[6] = t5;
|
|
127
|
+
$[7] = t6;
|
|
128
|
+
} else t6 = $[7];
|
|
129
|
+
return t6;
|
|
130
|
+
});
|
|
131
|
+
const FormStateRefBridge = React.memo(function FormStateRefBridge$1(t0) {
|
|
132
|
+
const $ = c(10);
|
|
133
|
+
const { control, onDirtyChange, onSubmittingChange } = t0;
|
|
134
|
+
let t1;
|
|
135
|
+
if ($[0] !== control) {
|
|
136
|
+
t1 = { control };
|
|
137
|
+
$[0] = control;
|
|
138
|
+
$[1] = t1;
|
|
139
|
+
} else t1 = $[1];
|
|
140
|
+
const { isDirty, isSubmitting } = useFormState(t1);
|
|
141
|
+
let t2;
|
|
142
|
+
let t3;
|
|
143
|
+
if ($[2] !== isDirty || $[3] !== onDirtyChange) {
|
|
144
|
+
t2 = () => {
|
|
145
|
+
onDirtyChange(isDirty);
|
|
146
|
+
};
|
|
147
|
+
t3 = [isDirty, onDirtyChange];
|
|
148
|
+
$[2] = isDirty;
|
|
149
|
+
$[3] = onDirtyChange;
|
|
150
|
+
$[4] = t2;
|
|
151
|
+
$[5] = t3;
|
|
152
|
+
} else {
|
|
153
|
+
t2 = $[4];
|
|
154
|
+
t3 = $[5];
|
|
155
|
+
}
|
|
156
|
+
React.useEffect(t2, t3);
|
|
157
|
+
let t4;
|
|
158
|
+
let t5;
|
|
159
|
+
if ($[6] !== isSubmitting || $[7] !== onSubmittingChange) {
|
|
160
|
+
t4 = () => {
|
|
161
|
+
onSubmittingChange(isSubmitting);
|
|
162
|
+
};
|
|
163
|
+
t5 = [isSubmitting, onSubmittingChange];
|
|
164
|
+
$[6] = isSubmitting;
|
|
165
|
+
$[7] = onSubmittingChange;
|
|
166
|
+
$[8] = t4;
|
|
167
|
+
$[9] = t5;
|
|
168
|
+
} else {
|
|
169
|
+
t4 = $[8];
|
|
170
|
+
t5 = $[9];
|
|
171
|
+
}
|
|
172
|
+
React.useEffect(t4, t5);
|
|
173
|
+
return null;
|
|
174
|
+
});
|
|
175
|
+
const AutosaveManager = React.memo(function AutosaveManager$1(t0) {
|
|
176
|
+
const $ = c(18);
|
|
177
|
+
const { form, formElementRef, isEditMode, id, enabled, debounce, isDirtyRef, isSubmittingRef, updateMutation, onPreviewRefresh, onSavingChange, onSaved } = t0;
|
|
178
|
+
const { t } = useTranslation();
|
|
179
|
+
const timerRef = React.useRef(null);
|
|
180
|
+
let t1;
|
|
181
|
+
if ($[0] !== form || $[1] !== id || $[2] !== isDirtyRef || $[3] !== isSubmittingRef || $[4] !== onPreviewRefresh || $[5] !== onSaved || $[6] !== onSavingChange || $[7] !== t || $[8] !== updateMutation) {
|
|
182
|
+
t1 = async () => {
|
|
183
|
+
if (!id || !isDirtyRef.current || isSubmittingRef.current) return;
|
|
184
|
+
try {
|
|
185
|
+
onSavingChange(true);
|
|
186
|
+
await form.handleSubmit(async (data) => {
|
|
187
|
+
const result = await updateMutation.mutateAsync({
|
|
188
|
+
id,
|
|
189
|
+
data
|
|
190
|
+
});
|
|
191
|
+
form.reset(result, { keepTouched: true });
|
|
192
|
+
onPreviewRefresh?.();
|
|
193
|
+
onSaved(/* @__PURE__ */ new Date());
|
|
194
|
+
onSavingChange(false);
|
|
195
|
+
}, () => {
|
|
196
|
+
onSavingChange(false);
|
|
197
|
+
})();
|
|
198
|
+
} catch (t2$1) {
|
|
199
|
+
const error = t2$1;
|
|
200
|
+
onSavingChange(false);
|
|
201
|
+
console.error("Autosave failed:", error);
|
|
202
|
+
toast.error(t("error.autosaveFailed"), { description: error instanceof Error ? error.message : void 0 });
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
$[0] = form;
|
|
206
|
+
$[1] = id;
|
|
207
|
+
$[2] = isDirtyRef;
|
|
208
|
+
$[3] = isSubmittingRef;
|
|
209
|
+
$[4] = onPreviewRefresh;
|
|
210
|
+
$[5] = onSaved;
|
|
211
|
+
$[6] = onSavingChange;
|
|
212
|
+
$[7] = t;
|
|
213
|
+
$[8] = updateMutation;
|
|
214
|
+
$[9] = t1;
|
|
215
|
+
} else t1 = $[9];
|
|
216
|
+
const runAutosave = t1;
|
|
217
|
+
let t2;
|
|
218
|
+
let t3;
|
|
219
|
+
if ($[10] !== debounce || $[11] !== enabled || $[12] !== formElementRef || $[13] !== id || $[14] !== isEditMode || $[15] !== runAutosave) {
|
|
220
|
+
t2 = () => {
|
|
221
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
222
|
+
if (!enabled || !isEditMode || !id) return;
|
|
223
|
+
const target = formElementRef.current;
|
|
224
|
+
if (!target) return;
|
|
225
|
+
const scheduleAutosave = () => {
|
|
226
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
227
|
+
timerRef.current = setTimeout(() => {
|
|
228
|
+
runAutosave();
|
|
229
|
+
}, debounce);
|
|
230
|
+
};
|
|
231
|
+
target.addEventListener("input", scheduleAutosave, { capture: true });
|
|
232
|
+
target.addEventListener("change", scheduleAutosave, { capture: true });
|
|
233
|
+
return () => {
|
|
234
|
+
target.removeEventListener("input", scheduleAutosave, { capture: true });
|
|
235
|
+
target.removeEventListener("change", scheduleAutosave, { capture: true });
|
|
236
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
t3 = [
|
|
240
|
+
debounce,
|
|
241
|
+
enabled,
|
|
242
|
+
formElementRef,
|
|
243
|
+
id,
|
|
244
|
+
isEditMode,
|
|
245
|
+
runAutosave
|
|
246
|
+
];
|
|
247
|
+
$[10] = debounce;
|
|
248
|
+
$[11] = enabled;
|
|
249
|
+
$[12] = formElementRef;
|
|
250
|
+
$[13] = id;
|
|
251
|
+
$[14] = isEditMode;
|
|
252
|
+
$[15] = runAutosave;
|
|
253
|
+
$[16] = t2;
|
|
254
|
+
$[17] = t3;
|
|
255
|
+
} else {
|
|
256
|
+
t2 = $[16];
|
|
257
|
+
t3 = $[17];
|
|
258
|
+
}
|
|
259
|
+
React.useEffect(t2, t3);
|
|
260
|
+
return null;
|
|
261
|
+
});
|
|
262
|
+
const AutosaveIndicator = React.memo(function AutosaveIndicator$1(t0) {
|
|
263
|
+
const $ = c(26);
|
|
264
|
+
const { control, enabled, indicator, isEditMode, isSaving, lastSaved, formatTimeAgo, t } = t0;
|
|
265
|
+
let t1;
|
|
266
|
+
if ($[0] !== control) {
|
|
267
|
+
t1 = { control };
|
|
268
|
+
$[0] = control;
|
|
269
|
+
$[1] = t1;
|
|
270
|
+
} else t1 = $[1];
|
|
271
|
+
const { isDirty } = useFormState(t1);
|
|
272
|
+
const [, forceUpdate] = React.useReducer(_temp, 0);
|
|
273
|
+
let t2;
|
|
274
|
+
if ($[2] !== forceUpdate || $[3] !== lastSaved) {
|
|
275
|
+
t2 = () => {
|
|
276
|
+
if (!lastSaved) return;
|
|
277
|
+
const interval = setInterval(forceUpdate, 1e4);
|
|
278
|
+
return () => clearInterval(interval);
|
|
279
|
+
};
|
|
280
|
+
$[2] = forceUpdate;
|
|
281
|
+
$[3] = lastSaved;
|
|
282
|
+
$[4] = t2;
|
|
283
|
+
} else t2 = $[4];
|
|
284
|
+
let t3;
|
|
285
|
+
if ($[5] !== lastSaved) {
|
|
286
|
+
t3 = [lastSaved];
|
|
287
|
+
$[5] = lastSaved;
|
|
288
|
+
$[6] = t3;
|
|
289
|
+
} else t3 = $[6];
|
|
290
|
+
React.useEffect(t2, t3);
|
|
291
|
+
if (!enabled || !indicator || !isEditMode) return null;
|
|
292
|
+
if (isSaving) {
|
|
293
|
+
let t4;
|
|
294
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295
|
+
t4 = /* @__PURE__ */ jsx(Icon, {
|
|
296
|
+
icon: "ph:spinner-gap",
|
|
297
|
+
className: "size-3 animate-spin"
|
|
298
|
+
});
|
|
299
|
+
$[7] = t4;
|
|
300
|
+
} else t4 = $[7];
|
|
301
|
+
let t5;
|
|
302
|
+
if ($[8] !== t) {
|
|
303
|
+
t5 = t("autosave.saving");
|
|
304
|
+
$[8] = t;
|
|
305
|
+
$[9] = t5;
|
|
306
|
+
} else t5 = $[9];
|
|
307
|
+
let t6;
|
|
308
|
+
if ($[10] !== t5) {
|
|
309
|
+
t6 = /* @__PURE__ */ jsxs(Badge, {
|
|
310
|
+
variant: "secondary",
|
|
311
|
+
className: "gap-1.5",
|
|
312
|
+
children: [t4, t5]
|
|
313
|
+
});
|
|
314
|
+
$[10] = t5;
|
|
315
|
+
$[11] = t6;
|
|
316
|
+
} else t6 = $[11];
|
|
317
|
+
return t6;
|
|
318
|
+
}
|
|
319
|
+
if (isDirty) {
|
|
320
|
+
let t4;
|
|
321
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
322
|
+
t4 = /* @__PURE__ */ jsx(Icon, {
|
|
323
|
+
icon: "ph:clock-counter-clockwise",
|
|
324
|
+
className: "size-3"
|
|
325
|
+
});
|
|
326
|
+
$[12] = t4;
|
|
327
|
+
} else t4 = $[12];
|
|
328
|
+
let t5;
|
|
329
|
+
if ($[13] !== t) {
|
|
330
|
+
t5 = t("autosave.unsavedChanges");
|
|
331
|
+
$[13] = t;
|
|
332
|
+
$[14] = t5;
|
|
333
|
+
} else t5 = $[14];
|
|
334
|
+
let t6;
|
|
335
|
+
if ($[15] !== t5) {
|
|
336
|
+
t6 = /* @__PURE__ */ jsxs(Badge, {
|
|
337
|
+
variant: "outline",
|
|
338
|
+
className: "gap-1.5",
|
|
339
|
+
children: [t4, t5]
|
|
340
|
+
});
|
|
341
|
+
$[15] = t5;
|
|
342
|
+
$[16] = t6;
|
|
343
|
+
} else t6 = $[16];
|
|
344
|
+
return t6;
|
|
345
|
+
}
|
|
346
|
+
if (lastSaved) {
|
|
347
|
+
let t4;
|
|
348
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
349
|
+
t4 = /* @__PURE__ */ jsx(Icon, {
|
|
350
|
+
icon: "ph:check",
|
|
351
|
+
className: "size-3"
|
|
352
|
+
});
|
|
353
|
+
$[17] = t4;
|
|
354
|
+
} else t4 = $[17];
|
|
355
|
+
let t5;
|
|
356
|
+
if ($[18] !== t) {
|
|
357
|
+
t5 = t("autosave.saved");
|
|
358
|
+
$[18] = t;
|
|
359
|
+
$[19] = t5;
|
|
360
|
+
} else t5 = $[19];
|
|
361
|
+
let t6;
|
|
362
|
+
if ($[20] !== formatTimeAgo || $[21] !== lastSaved) {
|
|
363
|
+
t6 = formatTimeAgo(lastSaved);
|
|
364
|
+
$[20] = formatTimeAgo;
|
|
365
|
+
$[21] = lastSaved;
|
|
366
|
+
$[22] = t6;
|
|
367
|
+
} else t6 = $[22];
|
|
368
|
+
let t7;
|
|
369
|
+
if ($[23] !== t5 || $[24] !== t6) {
|
|
370
|
+
t7 = /* @__PURE__ */ jsxs(Badge, {
|
|
371
|
+
variant: "secondary",
|
|
372
|
+
className: "text-muted-foreground gap-1.5",
|
|
373
|
+
children: [
|
|
374
|
+
t4,
|
|
375
|
+
t5,
|
|
376
|
+
" ",
|
|
377
|
+
t6
|
|
378
|
+
]
|
|
379
|
+
});
|
|
380
|
+
$[23] = t5;
|
|
381
|
+
$[24] = t6;
|
|
382
|
+
$[25] = t7;
|
|
383
|
+
} else t7 = $[25];
|
|
384
|
+
return t7;
|
|
385
|
+
}
|
|
386
|
+
return null;
|
|
387
|
+
});
|
|
388
|
+
const SaveSubmitButton = React.memo(function SaveSubmitButton$1(t0) {
|
|
389
|
+
const $ = c(8);
|
|
390
|
+
const { control, isMutationPending, t } = t0;
|
|
391
|
+
let t1;
|
|
392
|
+
if ($[0] !== control) {
|
|
393
|
+
t1 = { control };
|
|
394
|
+
$[0] = control;
|
|
395
|
+
$[1] = t1;
|
|
396
|
+
} else t1 = $[1];
|
|
397
|
+
const { isDirty, isSubmitting } = useFormState(t1);
|
|
398
|
+
const isSubmittingNow = isMutationPending || isSubmitting;
|
|
399
|
+
const t2 = isSubmittingNow || !isDirty;
|
|
400
|
+
let t3;
|
|
401
|
+
if ($[2] !== isSubmittingNow || $[3] !== t) {
|
|
402
|
+
t3 = isSubmittingNow ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
403
|
+
icon: "ph:spinner-gap",
|
|
404
|
+
className: "size-4 animate-spin"
|
|
405
|
+
}), t("common.loading")] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
406
|
+
icon: "ph:check",
|
|
407
|
+
width: 16,
|
|
408
|
+
height: 16
|
|
409
|
+
}), t("common.save")] });
|
|
410
|
+
$[2] = isSubmittingNow;
|
|
411
|
+
$[3] = t;
|
|
412
|
+
$[4] = t3;
|
|
413
|
+
} else t3 = $[4];
|
|
414
|
+
let t4;
|
|
415
|
+
if ($[5] !== t2 || $[6] !== t3) {
|
|
416
|
+
t4 = /* @__PURE__ */ jsx(Button, {
|
|
417
|
+
type: "submit",
|
|
418
|
+
disabled: t2,
|
|
419
|
+
className: "gap-2",
|
|
420
|
+
children: t3
|
|
421
|
+
});
|
|
422
|
+
$[5] = t2;
|
|
423
|
+
$[6] = t3;
|
|
424
|
+
$[7] = t4;
|
|
425
|
+
} else t4 = $[7];
|
|
426
|
+
return t4;
|
|
427
|
+
});
|
|
68
428
|
/**
|
|
69
429
|
* FormView - Default form-based edit/create view for collections
|
|
70
430
|
*
|
|
@@ -91,42 +451,55 @@ function ReactiveFieldsManager({ collection, mode = "collection", reactiveConfig
|
|
|
91
451
|
function FormView({ collection, id, config, viewConfig, navigate, basePath = "/admin", defaultValues: defaultValuesProp, registry, allCollectionsConfig, showMeta = true, headerActions, onSuccess, onError }) {
|
|
92
452
|
const { t } = useTranslation();
|
|
93
453
|
const resolveText = useResolveText();
|
|
94
|
-
const admin = useAdminStore(selectAdmin);
|
|
95
|
-
const { data: adminConfig } = useAdminConfig();
|
|
96
454
|
const isEditMode = !!id;
|
|
97
455
|
const { fields: resolvedFields, schema } = useCollectionFields(collection, { fallbackFields: config?.fields });
|
|
98
|
-
const resolvedFormConfig = React
|
|
456
|
+
const resolvedFormConfig = React.useMemo(() => viewConfig ?? (config?.form)?.["~config"] ?? config?.form ?? schema?.admin?.form, [
|
|
99
457
|
viewConfig,
|
|
100
458
|
config?.form,
|
|
101
459
|
schema?.admin?.form
|
|
102
460
|
]);
|
|
103
|
-
const formConfigBridge = React
|
|
461
|
+
const formConfigBridge = React.useMemo(() => {
|
|
104
462
|
if (!resolvedFormConfig) return config;
|
|
105
463
|
return {
|
|
106
464
|
...config ?? {},
|
|
107
465
|
form: resolvedFormConfig
|
|
108
466
|
};
|
|
109
467
|
}, [config, resolvedFormConfig]);
|
|
110
|
-
const reactiveConfigs = React
|
|
111
|
-
const previewContext = useLivePreviewContext();
|
|
468
|
+
const reactiveConfigs = React.useMemo(() => extractReactiveConfigs(schema), [schema]);
|
|
112
469
|
const schemaPreview = schema?.admin?.preview;
|
|
113
|
-
const
|
|
114
|
-
const [isLivePreviewOpen, setIsLivePreviewOpen] = React
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (isLivePreviewOpen)
|
|
122
|
-
|
|
123
|
-
window.history.replaceState({}, "", url.toString());
|
|
470
|
+
const canUseLivePreview = !!schemaPreview?.hasUrlBuilder && schemaPreview?.enabled !== false && isEditMode && !!id;
|
|
471
|
+
const [isLivePreviewOpen, setIsLivePreviewOpen] = useSearchParamToggle("preview", React.useMemo(() => ({ legacyKeys: [{
|
|
472
|
+
key: "sidebar",
|
|
473
|
+
trueValue: "preview"
|
|
474
|
+
}] }), []));
|
|
475
|
+
const [isHistoryOpen, setIsHistoryOpen] = useSidebarSearchParam("history", { legacyKey: "history" });
|
|
476
|
+
const previewRef = React.useRef(null);
|
|
477
|
+
const triggerPreviewRefresh = React.useCallback(() => {
|
|
478
|
+
if (!isLivePreviewOpen) return;
|
|
479
|
+
previewRef.current?.triggerRefresh();
|
|
124
480
|
}, [isLivePreviewOpen]);
|
|
125
|
-
|
|
481
|
+
React.useEffect(() => {
|
|
482
|
+
if (!schema) return;
|
|
483
|
+
if (!canUseLivePreview && isLivePreviewOpen) setIsLivePreviewOpen(false);
|
|
484
|
+
}, [
|
|
485
|
+
canUseLivePreview,
|
|
486
|
+
isLivePreviewOpen,
|
|
487
|
+
setIsLivePreviewOpen,
|
|
488
|
+
schema
|
|
489
|
+
]);
|
|
490
|
+
React.useEffect(() => {
|
|
491
|
+
if ((!isEditMode || !id) && isHistoryOpen) setIsHistoryOpen(false);
|
|
492
|
+
}, [
|
|
493
|
+
isEditMode,
|
|
494
|
+
id,
|
|
495
|
+
isHistoryOpen,
|
|
496
|
+
setIsHistoryOpen
|
|
497
|
+
]);
|
|
498
|
+
const withRelations = React.useMemo(() => detectManyToManyRelations({
|
|
126
499
|
fields: resolvedFields,
|
|
127
500
|
schema
|
|
128
501
|
}), [resolvedFields, schema]);
|
|
129
|
-
const { data: item, isLoading } = useCollectionItem(collection, id ?? "", hasManyToManyRelations(withRelations) ? {
|
|
502
|
+
const { data: item, isLoading, error: itemError } = useCollectionItem(collection, id ?? "", hasManyToManyRelations(withRelations) ? {
|
|
130
503
|
with: withRelations,
|
|
131
504
|
localeFallback: false
|
|
132
505
|
} : { localeFallback: false }, { enabled: isEditMode });
|
|
@@ -137,7 +510,7 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
137
510
|
autoAcquire: isEditMode
|
|
138
511
|
});
|
|
139
512
|
const blockedByUser = blockedBy ? getLockUser(blockedBy) : null;
|
|
140
|
-
const transformedItem = React
|
|
513
|
+
const transformedItem = React.useMemo(() => {
|
|
141
514
|
if (!item || !hasManyToManyRelations(withRelations)) return item;
|
|
142
515
|
const result = { ...item };
|
|
143
516
|
for (const key of Object.keys(withRelations)) {
|
|
@@ -149,20 +522,99 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
149
522
|
const createMutation = useCollectionCreate(collection);
|
|
150
523
|
const updateMutation = useCollectionUpdate(collection);
|
|
151
524
|
const deleteMutation = useCollectionDelete(collection);
|
|
525
|
+
const restoreMutation = useCollectionRestore(collection);
|
|
526
|
+
const revertVersionMutation = useCollectionRevertVersion(collection);
|
|
527
|
+
const [pendingRevertVersion, setPendingRevertVersion] = React.useState(null);
|
|
528
|
+
const { data: versionsData, isLoading: versionsLoading } = useCollectionVersions(collection, id ?? "", { limit: 50 }, { enabled: isEditMode && !!id && isHistoryOpen && !!schema?.options?.versioning });
|
|
529
|
+
const { data: auditData, isLoading: auditLoading } = useCollectionAuditHistory(collection, id ?? "", { limit: 50 }, { enabled: isEditMode && !!id && isHistoryOpen });
|
|
530
|
+
const workflowConfig = schema?.options?.workflow;
|
|
531
|
+
const workflowEnabled = !!workflowConfig?.enabled;
|
|
532
|
+
/**
|
|
533
|
+
* Lightweight versions query (limit: 1) just to read the current
|
|
534
|
+
* `versionStage`. Runs whenever workflow is enabled and we have an item id.
|
|
535
|
+
* The full 50-version query is still lazy-loaded behind the History sidebar.
|
|
536
|
+
*/
|
|
537
|
+
const { data: latestVersionData } = useCollectionVersions(collection, id ?? "", { limit: 1 }, { enabled: workflowEnabled && isEditMode && !!id });
|
|
538
|
+
const currentStage = latestVersionData?.[0]?.versionStage ?? workflowConfig?.initialStage ?? null;
|
|
539
|
+
const currentStageConfig = React.useMemo(() => workflowConfig?.stages?.find((s) => s.name === currentStage) ?? null, [workflowConfig?.stages, currentStage]);
|
|
540
|
+
const currentStageLabel = currentStageConfig?.label ?? currentStage ?? "";
|
|
541
|
+
/**
|
|
542
|
+
* Allowed transitions from the current stage.
|
|
543
|
+
* If the stage defines explicit `transitions`, only those are reachable.
|
|
544
|
+
* Otherwise fall back to all other stages (unrestricted).
|
|
545
|
+
*/
|
|
546
|
+
const allowedTransitions = React.useMemo(() => {
|
|
547
|
+
if (!workflowConfig?.stages || !currentStage) return [];
|
|
548
|
+
const stageNames = currentStageConfig?.transitions;
|
|
549
|
+
if (stageNames && stageNames.length > 0) return stageNames.map((name) => workflowConfig.stages.find((s_0) => s_0.name === name)).filter(Boolean);
|
|
550
|
+
return workflowConfig.stages.filter((s_1) => s_1.name !== currentStage);
|
|
551
|
+
}, [
|
|
552
|
+
workflowConfig,
|
|
553
|
+
currentStage,
|
|
554
|
+
currentStageConfig
|
|
555
|
+
]);
|
|
556
|
+
const transitionMutation = useTransitionStage(collection);
|
|
557
|
+
const [transitionTarget, setTransitionTarget] = React.useState(null);
|
|
558
|
+
const [transitionSchedule, setTransitionSchedule] = React.useState(false);
|
|
559
|
+
const [transitionScheduledAt, setTransitionScheduledAt] = React.useState(null);
|
|
152
560
|
const clientResolver = useCollectionValidation(collection);
|
|
153
561
|
const resolver = usePreferServerValidation(collection, { mode: isEditMode ? "update" : "create" }, clientResolver);
|
|
154
562
|
const form = useForm({
|
|
155
563
|
defaultValues: transformedItem ?? defaultValuesProp ?? {},
|
|
156
|
-
resolver
|
|
564
|
+
resolver,
|
|
565
|
+
mode: "onBlur"
|
|
157
566
|
});
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const
|
|
567
|
+
/**
|
|
568
|
+
* Execute the confirmed workflow transition (immediate or scheduled).
|
|
569
|
+
*/
|
|
570
|
+
const confirmTransition = () => {
|
|
571
|
+
if (!transitionTarget || !id) return;
|
|
572
|
+
const params = {
|
|
573
|
+
id,
|
|
574
|
+
stage: transitionTarget.name
|
|
575
|
+
};
|
|
576
|
+
if (transitionSchedule) {
|
|
577
|
+
if (transitionScheduledAt) params.scheduledAt = transitionScheduledAt;
|
|
578
|
+
}
|
|
579
|
+
const stageLabel = transitionTarget.label ? transitionTarget.label : transitionTarget.name;
|
|
580
|
+
const resetTransitionState = () => {
|
|
581
|
+
setTransitionTarget(null);
|
|
582
|
+
setTransitionSchedule(false);
|
|
583
|
+
setTransitionScheduledAt(null);
|
|
584
|
+
};
|
|
585
|
+
transitionMutation.mutateAsync(params).then((result_0) => {
|
|
586
|
+
if (result_0) {
|
|
587
|
+
if (typeof result_0 === "object") {
|
|
588
|
+
if ("id" in result_0) form.reset(result_0);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
if (transitionSchedule) if (transitionScheduledAt) toast.success(t("workflow.scheduledSuccess", {
|
|
592
|
+
stage: stageLabel,
|
|
593
|
+
date: transitionScheduledAt.toLocaleString()
|
|
594
|
+
}));
|
|
595
|
+
else toast.success(t("workflow.transitionSuccess", { stage: stageLabel }));
|
|
596
|
+
else toast.success(t("workflow.transitionSuccess", { stage: stageLabel }));
|
|
597
|
+
resetTransitionState();
|
|
598
|
+
}, (err) => {
|
|
599
|
+
let description;
|
|
600
|
+
if (err instanceof Error) description = err.message;
|
|
601
|
+
else description = t("error.unknown");
|
|
602
|
+
toast.error(t("workflow.transitionFailed"), { description });
|
|
603
|
+
resetTransitionState();
|
|
604
|
+
});
|
|
605
|
+
};
|
|
606
|
+
const [isSaving, setIsSaving] = React.useState(false);
|
|
607
|
+
const [lastSaved, setLastSaved] = React.useState(null);
|
|
608
|
+
const formElementRef = React.useRef(null);
|
|
609
|
+
const formIsDirtyRef = React.useRef(false);
|
|
610
|
+
const formIsSubmittingRef = React.useRef(false);
|
|
611
|
+
const autoSaveConfig = React.useMemo(() => {
|
|
162
612
|
const cfg = config?.autoSave;
|
|
163
613
|
if (!cfg) return {
|
|
164
614
|
enabled: false,
|
|
165
|
-
debounce: 500
|
|
615
|
+
debounce: 500,
|
|
616
|
+
indicator: false,
|
|
617
|
+
preventNavigation: false
|
|
166
618
|
};
|
|
167
619
|
return {
|
|
168
620
|
enabled: cfg.enabled !== false,
|
|
@@ -171,21 +623,27 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
171
623
|
preventNavigation: cfg.preventNavigation !== false
|
|
172
624
|
};
|
|
173
625
|
}, [config]);
|
|
174
|
-
const { locale: contentLocale, setLocale: setContentLocale
|
|
626
|
+
const { locale: contentLocale, setLocale: setContentLocale } = useScopedLocale();
|
|
175
627
|
const localeOptions = useSafeContentLocales()?.locales ?? [];
|
|
176
|
-
const prevLocaleRef = React
|
|
177
|
-
const [localeChangeDialog, setLocaleChangeDialog] = React
|
|
628
|
+
const prevLocaleRef = React.useRef(contentLocale);
|
|
629
|
+
const [localeChangeDialog, setLocaleChangeDialog] = React.useState({
|
|
178
630
|
open: false,
|
|
179
631
|
pendingLocale: null
|
|
180
632
|
});
|
|
181
|
-
const localeChangeSnapshotRef = React
|
|
182
|
-
const skipItemResetRef = React
|
|
183
|
-
React
|
|
633
|
+
const localeChangeSnapshotRef = React.useRef(null);
|
|
634
|
+
const skipItemResetRef = React.useRef(false);
|
|
635
|
+
const handleFormDirtyChange = React.useCallback((isDirty) => {
|
|
636
|
+
formIsDirtyRef.current = isDirty;
|
|
637
|
+
}, []);
|
|
638
|
+
const handleFormSubmittingChange = React.useCallback((isSubmitting) => {
|
|
639
|
+
formIsSubmittingRef.current = isSubmitting;
|
|
640
|
+
}, []);
|
|
641
|
+
React.useEffect(() => {
|
|
184
642
|
if (!isEditMode) {
|
|
185
643
|
prevLocaleRef.current = contentLocale;
|
|
186
644
|
return;
|
|
187
645
|
}
|
|
188
|
-
if (prevLocaleRef.current !== contentLocale) if (
|
|
646
|
+
if (prevLocaleRef.current !== contentLocale) if (formIsDirtyRef.current && !localeChangeDialog.open) {
|
|
189
647
|
skipItemResetRef.current = true;
|
|
190
648
|
localeChangeSnapshotRef.current = form.getValues();
|
|
191
649
|
setLocaleChangeDialog({
|
|
@@ -199,34 +657,42 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
199
657
|
}
|
|
200
658
|
}, [
|
|
201
659
|
contentLocale,
|
|
202
|
-
form.formState.isDirty,
|
|
203
660
|
form.getValues,
|
|
204
661
|
setContentLocale,
|
|
205
662
|
localeChangeDialog.open,
|
|
206
663
|
isEditMode
|
|
207
664
|
]);
|
|
208
|
-
React
|
|
209
|
-
if (skipItemResetRef.current) return;
|
|
665
|
+
React.useEffect(() => {
|
|
666
|
+
if (skipItemResetRef.current || isLoading) return;
|
|
210
667
|
if (transformedItem) form.reset(transformedItem);
|
|
211
|
-
else if (defaultValuesProp) form.reset(defaultValuesProp);
|
|
668
|
+
else if (!isEditMode && defaultValuesProp) form.reset(defaultValuesProp);
|
|
212
669
|
}, [
|
|
213
670
|
form,
|
|
214
671
|
transformedItem,
|
|
215
|
-
defaultValuesProp
|
|
672
|
+
defaultValuesProp,
|
|
673
|
+
isLoading,
|
|
674
|
+
isEditMode
|
|
216
675
|
]);
|
|
217
|
-
const
|
|
676
|
+
const localeQueryClient = useQueryClient();
|
|
677
|
+
const handleLocaleChangeConfirm = React.useCallback(() => {
|
|
218
678
|
skipItemResetRef.current = false;
|
|
219
679
|
localeChangeSnapshotRef.current = null;
|
|
220
680
|
if (localeChangeDialog.pendingLocale) {
|
|
221
681
|
prevLocaleRef.current = localeChangeDialog.pendingLocale;
|
|
222
682
|
setContentLocale(localeChangeDialog.pendingLocale);
|
|
683
|
+
localeQueryClient.invalidateQueries({ queryKey: ["collections", collection] });
|
|
223
684
|
}
|
|
224
685
|
setLocaleChangeDialog({
|
|
225
686
|
open: false,
|
|
226
687
|
pendingLocale: null
|
|
227
688
|
});
|
|
228
|
-
}, [
|
|
229
|
-
|
|
689
|
+
}, [
|
|
690
|
+
localeChangeDialog.pendingLocale,
|
|
691
|
+
setContentLocale,
|
|
692
|
+
localeQueryClient,
|
|
693
|
+
collection
|
|
694
|
+
]);
|
|
695
|
+
const handleLocaleChangeCancel = React.useCallback(() => {
|
|
230
696
|
skipItemResetRef.current = false;
|
|
231
697
|
if (localeChangeSnapshotRef.current) form.reset(localeChangeSnapshotRef.current, {
|
|
232
698
|
keepDirty: true,
|
|
@@ -240,9 +706,9 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
240
706
|
pendingLocale: null
|
|
241
707
|
});
|
|
242
708
|
}, [form]);
|
|
243
|
-
const onSubmit = React
|
|
709
|
+
const onSubmit = React.useEffectEvent(async (data) => {
|
|
244
710
|
const savePromise = async () => {
|
|
245
|
-
if (isEditMode) return await updateMutation.mutateAsync({
|
|
711
|
+
if (isEditMode && id) return await updateMutation.mutateAsync({
|
|
246
712
|
id,
|
|
247
713
|
data
|
|
248
714
|
});
|
|
@@ -250,12 +716,12 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
250
716
|
};
|
|
251
717
|
toast.promise(savePromise(), {
|
|
252
718
|
loading: isEditMode ? t("toast.saving") : t("toast.creating"),
|
|
253
|
-
success: (
|
|
254
|
-
if (onSuccess) onSuccess(
|
|
719
|
+
success: (result_1) => {
|
|
720
|
+
if (onSuccess) onSuccess(result_1);
|
|
255
721
|
else if (isEditMode) {
|
|
256
|
-
form.reset(
|
|
257
|
-
|
|
258
|
-
} else if (
|
|
722
|
+
form.reset(result_1);
|
|
723
|
+
triggerPreviewRefresh();
|
|
724
|
+
} else if (result_1?.id) navigate(`${basePath}/collections/${collection}/${result_1.id}`);
|
|
259
725
|
else navigate(`${basePath}/collections/${collection}`);
|
|
260
726
|
return isEditMode ? t("toast.saveSuccess") : t("toast.createSuccess");
|
|
261
727
|
},
|
|
@@ -273,65 +739,27 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
273
739
|
}
|
|
274
740
|
});
|
|
275
741
|
});
|
|
276
|
-
React
|
|
277
|
-
if (autoSaveTimerRef.current) clearTimeout(autoSaveTimerRef.current);
|
|
278
|
-
if (!autoSaveConfig.enabled || !form.formState.isDirty || form.formState.isSubmitting || !isEditMode) return;
|
|
279
|
-
autoSaveTimerRef.current = setTimeout(async () => {
|
|
280
|
-
try {
|
|
281
|
-
setIsSaving(true);
|
|
282
|
-
await form.handleSubmit(async (data) => {
|
|
283
|
-
const result = await updateMutation.mutateAsync({
|
|
284
|
-
id,
|
|
285
|
-
data
|
|
286
|
-
});
|
|
287
|
-
form.reset(result);
|
|
288
|
-
if (previewContext) previewContext.triggerPreviewRefresh();
|
|
289
|
-
setLastSaved(/* @__PURE__ */ new Date());
|
|
290
|
-
setIsSaving(false);
|
|
291
|
-
})();
|
|
292
|
-
} catch (error) {
|
|
293
|
-
setIsSaving(false);
|
|
294
|
-
console.error("Autosave failed:", error);
|
|
295
|
-
}
|
|
296
|
-
}, autoSaveConfig.debounce);
|
|
297
|
-
return () => {
|
|
298
|
-
if (autoSaveTimerRef.current) clearTimeout(autoSaveTimerRef.current);
|
|
299
|
-
};
|
|
300
|
-
}, [
|
|
301
|
-
form.formState.isDirty,
|
|
302
|
-
form.formState.isSubmitting,
|
|
303
|
-
form,
|
|
304
|
-
autoSaveConfig.enabled,
|
|
305
|
-
autoSaveConfig.debounce,
|
|
306
|
-
isEditMode,
|
|
307
|
-
updateMutation,
|
|
308
|
-
resolvedFields,
|
|
309
|
-
adminConfig?.blocks,
|
|
310
|
-
id,
|
|
311
|
-
previewContext,
|
|
312
|
-
admin
|
|
313
|
-
]);
|
|
314
|
-
React$1.useEffect(() => {
|
|
742
|
+
React.useEffect(() => {
|
|
315
743
|
if (!autoSaveConfig.preventNavigation || !autoSaveConfig.enabled) return;
|
|
316
744
|
const handleBeforeUnload = (e) => {
|
|
317
|
-
if (
|
|
745
|
+
if (formIsDirtyRef.current) {
|
|
318
746
|
e.preventDefault();
|
|
319
747
|
e.returnValue = "";
|
|
320
748
|
}
|
|
321
749
|
};
|
|
322
750
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
323
751
|
return () => window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
324
|
-
}, [
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
React
|
|
330
|
-
const handleKeyDown = (
|
|
331
|
-
if ((
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
form.handleSubmit(
|
|
752
|
+
}, [autoSaveConfig.preventNavigation, autoSaveConfig.enabled]);
|
|
753
|
+
const onSubmitRef = React.useRef(onSubmit);
|
|
754
|
+
React.useEffect(() => {
|
|
755
|
+
onSubmitRef.current = onSubmit;
|
|
756
|
+
});
|
|
757
|
+
React.useEffect(() => {
|
|
758
|
+
const handleKeyDown = (e_0) => {
|
|
759
|
+
if ((e_0.metaKey || e_0.ctrlKey) && e_0.key === "s") {
|
|
760
|
+
e_0.preventDefault();
|
|
761
|
+
e_0.stopPropagation();
|
|
762
|
+
form.handleSubmit(onSubmitRef.current, (errors) => {
|
|
335
763
|
console.warn("[FormView] Validation errors:", errors);
|
|
336
764
|
toast.error(t("toast.validationFailed"));
|
|
337
765
|
})();
|
|
@@ -339,34 +767,53 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
339
767
|
};
|
|
340
768
|
document.addEventListener("keydown", handleKeyDown);
|
|
341
769
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
342
|
-
}, [form,
|
|
343
|
-
const
|
|
770
|
+
}, [form, t]);
|
|
771
|
+
const isMutationPending = createMutation.isPending || updateMutation.isPending;
|
|
344
772
|
const configFormActions = resolvedFormConfig?.actions;
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
773
|
+
const { serverActions } = useServerActions({ collection });
|
|
774
|
+
const scopedServerFormActions = React.useMemo(() => isEditMode ? serverActions.filter((action) => {
|
|
775
|
+
const scope = action.scope;
|
|
776
|
+
return scope === "single" || scope === "row";
|
|
777
|
+
}) : [], [isEditMode, serverActions]);
|
|
778
|
+
const formActions = React.useMemo(() => {
|
|
779
|
+
const base = configFormActions ?? (!isEditMode ? {
|
|
348
780
|
primary: [],
|
|
349
781
|
secondary: []
|
|
782
|
+
} : getDefaultFormActions());
|
|
783
|
+
const primary = [...base.primary ?? []];
|
|
784
|
+
const secondary = [...base.secondary ?? []];
|
|
785
|
+
const existingIds = new Set([...primary, ...secondary].map((a) => a.id));
|
|
786
|
+
for (const action_0 of scopedServerFormActions) {
|
|
787
|
+
if (existingIds.has(action_0.id)) continue;
|
|
788
|
+
secondary.push(action_0);
|
|
789
|
+
existingIds.add(action_0.id);
|
|
790
|
+
}
|
|
791
|
+
return {
|
|
792
|
+
primary,
|
|
793
|
+
secondary
|
|
350
794
|
};
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
795
|
+
}, [
|
|
796
|
+
configFormActions,
|
|
797
|
+
isEditMode,
|
|
798
|
+
scopedServerFormActions
|
|
799
|
+
]);
|
|
800
|
+
const [dialogAction, setDialogAction] = React.useState(null);
|
|
801
|
+
const [confirmAction, setConfirmAction] = React.useState(null);
|
|
802
|
+
const [actionLoading, setActionLoading] = React.useState(false);
|
|
356
803
|
const storeNavigate = useAdminStore(selectNavigate);
|
|
357
804
|
const storeBasePath = useAdminStore(selectBasePath);
|
|
358
805
|
const client = useAdminStore(selectClient);
|
|
359
806
|
const queryClient = useQueryClient();
|
|
360
|
-
const queryOpts = React
|
|
807
|
+
const queryOpts = React.useMemo(() => createQuestpieQueryOptions(client, {
|
|
361
808
|
keyPrefix: QUERY_KEY_PREFIX,
|
|
362
809
|
locale: contentLocale
|
|
363
810
|
}), [client, contentLocale]);
|
|
364
|
-
const actionQueryClient = React
|
|
811
|
+
const actionQueryClient = React.useMemo(() => ({
|
|
365
812
|
invalidateQueries: (filters) => queryClient.invalidateQueries(filters),
|
|
366
|
-
refetchQueries: (
|
|
367
|
-
resetQueries: (
|
|
813
|
+
refetchQueries: (filters_0) => queryClient.refetchQueries(filters_0),
|
|
814
|
+
resetQueries: (filters_1) => queryClient.resetQueries(filters_1)
|
|
368
815
|
}), [queryClient]);
|
|
369
|
-
const actionHelpers = React
|
|
816
|
+
const actionHelpers = React.useMemo(() => ({
|
|
370
817
|
navigate: storeNavigate,
|
|
371
818
|
toast: {
|
|
372
819
|
success: toast.success,
|
|
@@ -390,18 +837,18 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
390
837
|
contentLocale
|
|
391
838
|
]) });
|
|
392
839
|
},
|
|
393
|
-
invalidateItem: async (itemId,
|
|
394
|
-
const
|
|
840
|
+
invalidateItem: async (itemId, targetCollection_0) => {
|
|
841
|
+
const col_0 = targetCollection_0 || collection;
|
|
395
842
|
await queryClient.invalidateQueries({ queryKey: queryOpts.key([
|
|
396
843
|
"collections",
|
|
397
|
-
|
|
844
|
+
col_0,
|
|
398
845
|
"findOne",
|
|
399
846
|
contentLocale,
|
|
400
847
|
{ id: itemId }
|
|
401
848
|
]) });
|
|
402
849
|
await queryClient.invalidateQueries({ queryKey: queryOpts.key([
|
|
403
850
|
"collections",
|
|
404
|
-
|
|
851
|
+
col_0,
|
|
405
852
|
"find",
|
|
406
853
|
contentLocale
|
|
407
854
|
]) });
|
|
@@ -430,53 +877,72 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
430
877
|
basePath: storeBasePath || basePath
|
|
431
878
|
}), [
|
|
432
879
|
storeNavigate,
|
|
433
|
-
|
|
434
|
-
|
|
880
|
+
t,
|
|
881
|
+
collection,
|
|
435
882
|
queryClient,
|
|
436
883
|
queryOpts,
|
|
437
|
-
collection,
|
|
438
884
|
contentLocale,
|
|
439
|
-
|
|
885
|
+
storeBasePath,
|
|
886
|
+
basePath
|
|
440
887
|
]);
|
|
441
|
-
const
|
|
442
|
-
|
|
888
|
+
const transformedItemRef = React.useRef(transformedItem);
|
|
889
|
+
transformedItemRef.current = transformedItem;
|
|
890
|
+
const actionContext = React.useMemo(() => ({
|
|
891
|
+
get item() {
|
|
892
|
+
return transformedItemRef.current;
|
|
893
|
+
},
|
|
443
894
|
collection,
|
|
444
895
|
helpers: actionHelpers,
|
|
445
896
|
queryClient: actionQueryClient
|
|
446
897
|
}), [
|
|
447
|
-
transformedItem,
|
|
448
898
|
collection,
|
|
449
899
|
actionHelpers,
|
|
450
900
|
actionQueryClient
|
|
451
901
|
]);
|
|
452
|
-
const filterVisibleActions = React
|
|
902
|
+
const filterVisibleActions = React.useCallback((actions) => {
|
|
453
903
|
if (!actions) return [];
|
|
454
|
-
return actions.filter((
|
|
455
|
-
if (
|
|
456
|
-
if (typeof
|
|
457
|
-
return
|
|
904
|
+
return actions.filter((action_1) => {
|
|
905
|
+
if (action_1.visible === void 0) return true;
|
|
906
|
+
if (typeof action_1.visible === "function") return action_1.visible(actionContext);
|
|
907
|
+
return action_1.visible;
|
|
458
908
|
});
|
|
459
909
|
}, [actionContext]);
|
|
460
|
-
const visiblePrimaryActions = React
|
|
461
|
-
const visibleSecondaryActions = React
|
|
462
|
-
const regularSecondary = visibleSecondaryActions.filter((
|
|
463
|
-
const destructiveSecondary = visibleSecondaryActions.filter((
|
|
464
|
-
const executeAction =
|
|
465
|
-
const { handler } =
|
|
466
|
-
const actionLabel = resolveText(
|
|
910
|
+
const visiblePrimaryActions = React.useMemo(() => filterVisibleActions(formActions.primary), [formActions.primary, filterVisibleActions]);
|
|
911
|
+
const visibleSecondaryActions = React.useMemo(() => filterVisibleActions(formActions.secondary), [formActions.secondary, filterVisibleActions]);
|
|
912
|
+
const regularSecondary = visibleSecondaryActions.filter((a_0) => a_0.variant !== "destructive");
|
|
913
|
+
const destructiveSecondary = visibleSecondaryActions.filter((a_1) => a_1.variant === "destructive");
|
|
914
|
+
const executeAction = async (action_2) => {
|
|
915
|
+
const { handler } = action_2;
|
|
916
|
+
const actionLabel = resolveText(action_2.label, action_2.id);
|
|
467
917
|
switch (handler.type) {
|
|
468
918
|
case "navigate":
|
|
469
919
|
storeNavigate(typeof handler.path === "function" ? handler.path(transformedItem) : handler.path);
|
|
470
920
|
break;
|
|
471
921
|
case "api":
|
|
922
|
+
if (handler.method === "POST" && handler.endpoint === "{id}/restore") {
|
|
923
|
+
const itemId_0 = transformedItem?.id || id;
|
|
924
|
+
if (!itemId_0) {
|
|
925
|
+
toast.error(t("collection.restoreError"));
|
|
926
|
+
break;
|
|
927
|
+
}
|
|
928
|
+
setActionLoading(true);
|
|
929
|
+
toast.promise(restoreMutation.mutateAsync({ id: itemId_0 }).finally(() => {
|
|
930
|
+
setActionLoading(false);
|
|
931
|
+
}), {
|
|
932
|
+
loading: t("collection.restoring"),
|
|
933
|
+
success: t("collection.restoreSuccess"),
|
|
934
|
+
error: (err_1) => err_1.message || t("collection.restoreError")
|
|
935
|
+
});
|
|
936
|
+
break;
|
|
937
|
+
}
|
|
472
938
|
if (handler.method === "DELETE") {
|
|
473
|
-
const
|
|
474
|
-
if (!
|
|
939
|
+
const itemId_1 = transformedItem?.id || id;
|
|
940
|
+
if (!itemId_1) {
|
|
475
941
|
toast.error(t("toast.deleteFailed"));
|
|
476
942
|
break;
|
|
477
943
|
}
|
|
478
944
|
setActionLoading(true);
|
|
479
|
-
toast.promise(deleteMutation.mutateAsync(
|
|
945
|
+
toast.promise(deleteMutation.mutateAsync(itemId_1).finally(() => {
|
|
480
946
|
setActionLoading(false);
|
|
481
947
|
}), {
|
|
482
948
|
loading: t("toast.deleting"),
|
|
@@ -484,32 +950,46 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
484
950
|
navigate(`${basePath}/collections/${collection}`);
|
|
485
951
|
return t("toast.deleteSuccess");
|
|
486
952
|
},
|
|
487
|
-
error: (
|
|
953
|
+
error: (err_2) => err_2.message || t("toast.deleteFailed")
|
|
488
954
|
});
|
|
489
955
|
} else {
|
|
490
|
-
|
|
956
|
+
let itemId_;
|
|
957
|
+
if (transformedItem?.id) itemId_ = String(transformedItem.id);
|
|
958
|
+
else itemId_ = String(id);
|
|
959
|
+
const endpoint = handler.endpoint.replace("{id}", itemId_);
|
|
960
|
+
const method = handler.method ? handler.method : "POST";
|
|
961
|
+
let body;
|
|
962
|
+
if (handler.body) body = JSON.stringify(handler.body(actionContext));
|
|
491
963
|
setActionLoading(true);
|
|
492
964
|
const apiPromise = async () => {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
965
|
+
const url = `${storeBasePath}/${collection}/${endpoint}`;
|
|
966
|
+
const response = await fetch(url, {
|
|
967
|
+
method,
|
|
968
|
+
headers: { "Content-Type": "application/json" },
|
|
969
|
+
body
|
|
970
|
+
});
|
|
971
|
+
if (!response.ok) {
|
|
972
|
+
let errorBody = {};
|
|
973
|
+
try {
|
|
974
|
+
errorBody = await response.json();
|
|
975
|
+
} catch (_parseErr) {}
|
|
976
|
+
let errorMessage;
|
|
977
|
+
if (errorBody.message) if (typeof errorBody.message === "string") errorMessage = errorBody.message;
|
|
978
|
+
else errorMessage = t("toast.actionFailed");
|
|
979
|
+
else errorMessage = t("toast.actionFailed");
|
|
980
|
+
throw new Error(errorMessage);
|
|
507
981
|
}
|
|
982
|
+
return response.json();
|
|
508
983
|
};
|
|
509
|
-
|
|
984
|
+
const p = apiPromise();
|
|
985
|
+
p.then(() => setActionLoading(false), () => setActionLoading(false));
|
|
986
|
+
toast.promise(p, {
|
|
510
987
|
loading: `${actionLabel}...`,
|
|
511
988
|
success: t("toast.actionSuccess"),
|
|
512
|
-
error: (
|
|
989
|
+
error: (err_3) => {
|
|
990
|
+
if (err_3.message) return err_3.message;
|
|
991
|
+
return t("toast.actionFailed");
|
|
992
|
+
}
|
|
513
993
|
});
|
|
514
994
|
}
|
|
515
995
|
break;
|
|
@@ -520,34 +1000,36 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
520
1000
|
toast.promise(customPromise.finally(() => setActionLoading(false)), {
|
|
521
1001
|
loading: `${actionLabel}...`,
|
|
522
1002
|
success: t("toast.actionSuccess"),
|
|
523
|
-
error: (
|
|
1003
|
+
error: (err_0) => err_0.message || t("toast.actionFailed")
|
|
524
1004
|
});
|
|
525
1005
|
}
|
|
526
1006
|
break;
|
|
527
1007
|
}
|
|
528
1008
|
}
|
|
529
1009
|
setConfirmAction(null);
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
1010
|
+
};
|
|
1011
|
+
const handleRevertVersion = (version) => {
|
|
1012
|
+
setPendingRevertVersion(version);
|
|
1013
|
+
};
|
|
1014
|
+
const confirmRevertVersion = async () => {
|
|
1015
|
+
if (!pendingRevertVersion || !id) return;
|
|
1016
|
+
const payload = { id };
|
|
1017
|
+
if (typeof pendingRevertVersion.versionId === "string") payload.versionId = pendingRevertVersion.versionId;
|
|
1018
|
+
else if (typeof pendingRevertVersion.versionNumber === "number") payload.version = pendingRevertVersion.versionNumber;
|
|
1019
|
+
const result_2 = await revertVersionMutation.mutateAsync(payload);
|
|
1020
|
+
form.reset(result_2);
|
|
1021
|
+
triggerPreviewRefresh();
|
|
1022
|
+
toast.success(t("version.revertSuccess"));
|
|
1023
|
+
setPendingRevertVersion(null);
|
|
1024
|
+
};
|
|
1025
|
+
const handleActionClick = (action_3) => {
|
|
1026
|
+
if (action_3.confirmation) setConfirmAction(action_3);
|
|
1027
|
+
else if (action_3.handler.type === "dialog" || action_3.handler.type === "form") setDialogAction(action_3);
|
|
1028
|
+
else executeAction(action_3);
|
|
1029
|
+
};
|
|
1030
|
+
const handleConfirm = async () => {
|
|
549
1031
|
if (confirmAction) await executeAction(confirmAction);
|
|
550
|
-
}
|
|
1032
|
+
};
|
|
551
1033
|
const formatDate = (date) => {
|
|
552
1034
|
return new Date(date).toLocaleDateString(void 0, {
|
|
553
1035
|
year: "numeric",
|
|
@@ -557,293 +1039,368 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
557
1039
|
minute: "2-digit"
|
|
558
1040
|
});
|
|
559
1041
|
};
|
|
560
|
-
const formatTimeAgo = (
|
|
561
|
-
const seconds = Math.floor((Date.now() -
|
|
1042
|
+
const formatTimeAgo = (date_0) => {
|
|
1043
|
+
const seconds = Math.floor((Date.now() - date_0.getTime()) / 1e3);
|
|
562
1044
|
if (seconds < 10) return t("autosave.justNow");
|
|
563
1045
|
if (seconds < 60) return t("autosave.secondsAgo", { count: seconds });
|
|
564
1046
|
const minutes = Math.floor(seconds / 60);
|
|
565
1047
|
if (minutes < 60) return t("autosave.minutesAgo", { count: minutes });
|
|
566
1048
|
return t("autosave.hoursAgo", { count: Math.floor(minutes / 60) });
|
|
567
1049
|
};
|
|
568
|
-
const
|
|
569
|
-
React
|
|
570
|
-
if (!lastSaved || !autoSaveConfig.indicator) return;
|
|
571
|
-
const interval = setInterval(forceUpdate, 1e4);
|
|
572
|
-
return () => clearInterval(interval);
|
|
573
|
-
}, [lastSaved, autoSaveConfig.indicator]);
|
|
574
|
-
const watchedValues = useWatch({ control: form.control });
|
|
575
|
-
const lockRefreshTimerRef = React$1.useRef(null);
|
|
576
|
-
React$1.useEffect(() => {
|
|
1050
|
+
const lockRefreshTimerRef = React.useRef(null);
|
|
1051
|
+
React.useEffect(() => {
|
|
577
1052
|
if (!isEditMode || isBlocked) return;
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
1053
|
+
const scheduleLockRefresh = () => {
|
|
1054
|
+
if (lockRefreshTimerRef.current) clearTimeout(lockRefreshTimerRef.current);
|
|
1055
|
+
lockRefreshTimerRef.current = setTimeout(() => {
|
|
1056
|
+
refreshLock();
|
|
1057
|
+
}, 1e3);
|
|
1058
|
+
};
|
|
1059
|
+
const events = [
|
|
1060
|
+
"input",
|
|
1061
|
+
"change",
|
|
1062
|
+
"keydown",
|
|
1063
|
+
"pointerdown"
|
|
1064
|
+
];
|
|
1065
|
+
const target = formElementRef.current ?? document;
|
|
1066
|
+
for (const event of events) target.addEventListener(event, scheduleLockRefresh, { capture: true });
|
|
1067
|
+
scheduleLockRefresh();
|
|
582
1068
|
return () => {
|
|
1069
|
+
for (const event_0 of events) target.removeEventListener(event_0, scheduleLockRefresh, { capture: true });
|
|
583
1070
|
if (lockRefreshTimerRef.current) clearTimeout(lockRefreshTimerRef.current);
|
|
584
1071
|
};
|
|
585
1072
|
}, [
|
|
586
|
-
watchedValues,
|
|
587
1073
|
isEditMode,
|
|
588
1074
|
isBlocked,
|
|
589
1075
|
refreshLock
|
|
590
1076
|
]);
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
1077
|
+
const { data: previewUrl = null } = useQuery({
|
|
1078
|
+
queryKey: [
|
|
1079
|
+
"questpie",
|
|
1080
|
+
"preview-url",
|
|
1081
|
+
collection,
|
|
1082
|
+
transformedItem?.id,
|
|
1083
|
+
contentLocale
|
|
1084
|
+
],
|
|
1085
|
+
queryFn: async () => {
|
|
1086
|
+
return (await client.routes.getPreviewUrl({
|
|
1087
|
+
collection,
|
|
1088
|
+
record: transformedItem,
|
|
1089
|
+
locale: contentLocale
|
|
1090
|
+
}))?.url ?? null;
|
|
1091
|
+
},
|
|
1092
|
+
enabled: isLivePreviewOpen && canUseLivePreview && !!client && !!transformedItem,
|
|
1093
|
+
staleTime: 3e4
|
|
1094
|
+
});
|
|
1095
|
+
if (isEditMode && itemError) {
|
|
1096
|
+
const is404 = itemError != null && typeof itemError === "object" && "status" in itemError && itemError.status === 404;
|
|
1097
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1098
|
+
className: "text-muted-foreground flex h-64 flex-col items-center justify-center gap-3",
|
|
1099
|
+
children: [
|
|
1100
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
1101
|
+
icon: is404 ? "ph:file-dashed" : "ph:warning-circle",
|
|
1102
|
+
className: "text-destructive size-8"
|
|
1103
|
+
}),
|
|
1104
|
+
/* @__PURE__ */ jsx("p", {
|
|
1105
|
+
className: "text-sm",
|
|
1106
|
+
children: is404 ? t("errors.notFound") : itemError instanceof Error ? itemError.message : t("errors.failedToLoad")
|
|
1107
|
+
}),
|
|
1108
|
+
is404 && /* @__PURE__ */ jsx(Button, {
|
|
1109
|
+
variant: "outline",
|
|
1110
|
+
size: "sm",
|
|
1111
|
+
onClick: () => navigate(`${basePath}/collections/${collection}`),
|
|
1112
|
+
children: t("common.backToList")
|
|
1113
|
+
})
|
|
1114
|
+
]
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
617
1117
|
if (isEditMode && isLoading) return /* @__PURE__ */ jsx(FormViewSkeleton, {});
|
|
618
1118
|
const collectionLabel = resolveText(config?.label ?? schema?.admin?.config?.label, collection);
|
|
619
1119
|
const title = isEditMode ? item?._title || item?.id || t("collection.edit", { name: collectionLabel }) : t("collection.new", { name: collectionLabel });
|
|
620
|
-
|
|
621
|
-
className: "w-full",
|
|
1120
|
+
const formShell = /* @__PURE__ */ jsx("div", {
|
|
1121
|
+
className: "qa-form-view w-full",
|
|
622
1122
|
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
623
1123
|
isBlocked && blockedByUser && /* @__PURE__ */ jsxs("div", {
|
|
624
|
-
className: "
|
|
1124
|
+
className: "qa-form-view__lock-banner bg-warning/10 border-warning/30 mb-4 flex items-center gap-3 border p-3",
|
|
625
1125
|
children: [
|
|
626
1126
|
blockedByUser.image ? /* @__PURE__ */ jsx("img", {
|
|
627
1127
|
src: blockedByUser.image,
|
|
628
1128
|
alt: "",
|
|
629
1129
|
className: "size-8 rounded-full"
|
|
630
1130
|
}) : /* @__PURE__ */ jsx("div", {
|
|
631
|
-
className: "
|
|
1131
|
+
className: "bg-warning/20 flex size-8 items-center justify-center rounded-full",
|
|
632
1132
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
633
1133
|
icon: "ph:user",
|
|
634
|
-
className: "size-4
|
|
1134
|
+
className: "text-warning size-4"
|
|
635
1135
|
})
|
|
636
1136
|
}),
|
|
637
1137
|
/* @__PURE__ */ jsxs("div", {
|
|
638
|
-
className: "
|
|
1138
|
+
className: "min-w-0 flex-1",
|
|
639
1139
|
children: [/* @__PURE__ */ jsx("p", {
|
|
640
|
-
className: "text-sm font-medium
|
|
1140
|
+
className: "text-warning text-sm font-medium",
|
|
641
1141
|
children: t("lock.blockedTitle", { name: blockedByUser.name ?? blockedByUser.email })
|
|
642
1142
|
}), /* @__PURE__ */ jsx("p", {
|
|
643
|
-
className: "text-
|
|
1143
|
+
className: "text-warning/80 text-xs",
|
|
644
1144
|
children: t("lock.blockedDescription")
|
|
645
1145
|
})]
|
|
646
1146
|
}),
|
|
647
1147
|
/* @__PURE__ */ jsx(Icon, {
|
|
648
1148
|
icon: "ph:lock-simple",
|
|
649
|
-
className: "size-5
|
|
1149
|
+
className: "text-warning size-5"
|
|
650
1150
|
})
|
|
651
1151
|
]
|
|
652
1152
|
}),
|
|
653
1153
|
isOpenElsewhere && /* @__PURE__ */ jsxs("div", {
|
|
654
|
-
className: "
|
|
1154
|
+
className: "bg-info/10 border-info/30 mb-4 flex items-center gap-3 border p-3",
|
|
655
1155
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
656
1156
|
icon: "ph:browser",
|
|
657
|
-
className: "size-5
|
|
1157
|
+
className: "text-info size-5"
|
|
658
1158
|
}), /* @__PURE__ */ jsx("p", {
|
|
659
|
-
className: "text-
|
|
1159
|
+
className: "text-info text-sm",
|
|
660
1160
|
children: t("lock.openElsewhere")
|
|
661
1161
|
})]
|
|
662
1162
|
}),
|
|
663
1163
|
/* @__PURE__ */ jsxs(FormProvider, {
|
|
664
1164
|
...form,
|
|
665
|
-
children: [
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
}),
|
|
716
|
-
!isSaving && !form.formState.isDirty && lastSaved && /* @__PURE__ */ jsxs(Badge, {
|
|
717
|
-
variant: "secondary",
|
|
718
|
-
className: "gap-1.5 text-muted-foreground",
|
|
1165
|
+
children: [
|
|
1166
|
+
/* @__PURE__ */ jsx(FormStateRefBridge, {
|
|
1167
|
+
control: form.control,
|
|
1168
|
+
onDirtyChange: handleFormDirtyChange,
|
|
1169
|
+
onSubmittingChange: handleFormSubmittingChange
|
|
1170
|
+
}),
|
|
1171
|
+
/* @__PURE__ */ jsx(AutosaveManager, {
|
|
1172
|
+
form,
|
|
1173
|
+
formElementRef,
|
|
1174
|
+
isEditMode,
|
|
1175
|
+
id,
|
|
1176
|
+
enabled: autoSaveConfig.enabled,
|
|
1177
|
+
debounce: autoSaveConfig.debounce,
|
|
1178
|
+
isDirtyRef: formIsDirtyRef,
|
|
1179
|
+
isSubmittingRef: formIsSubmittingRef,
|
|
1180
|
+
updateMutation,
|
|
1181
|
+
onPreviewRefresh: triggerPreviewRefresh,
|
|
1182
|
+
onSavingChange: setIsSaving,
|
|
1183
|
+
onSaved: setLastSaved
|
|
1184
|
+
}),
|
|
1185
|
+
/* @__PURE__ */ jsx(ReactiveFieldsManager, {
|
|
1186
|
+
collection,
|
|
1187
|
+
reactiveConfigs,
|
|
1188
|
+
enabled: !isBlocked && !isMutationPending
|
|
1189
|
+
}),
|
|
1190
|
+
/* @__PURE__ */ jsx(RenderProfiler, {
|
|
1191
|
+
id: `form.shell.${collection}`,
|
|
1192
|
+
minDurationMs: 12,
|
|
1193
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
1194
|
+
ref: formElementRef,
|
|
1195
|
+
onSubmit: (e_1) => {
|
|
1196
|
+
e_1.stopPropagation();
|
|
1197
|
+
if (isBlocked) {
|
|
1198
|
+
e_1.preventDefault();
|
|
1199
|
+
toast.error(t("lock.cannotSave"));
|
|
1200
|
+
return;
|
|
1201
|
+
}
|
|
1202
|
+
form.handleSubmit(onSubmit, (errors_0) => {
|
|
1203
|
+
console.warn("[FormView] Validation errors:", errors_0);
|
|
1204
|
+
toast.error(t("toast.validationFailed"), { description: t("toast.validationDescription") });
|
|
1205
|
+
})(e_1);
|
|
1206
|
+
},
|
|
1207
|
+
className: "qa-form-view__form space-y-4",
|
|
1208
|
+
children: [
|
|
1209
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1210
|
+
className: "qa-form-view__header flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
1211
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1212
|
+
className: "min-w-0 flex-1",
|
|
1213
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1214
|
+
className: "flex flex-wrap items-center gap-3",
|
|
719
1215
|
children: [
|
|
720
|
-
/* @__PURE__ */ jsx(
|
|
721
|
-
|
|
722
|
-
|
|
1216
|
+
/* @__PURE__ */ jsx("h1", {
|
|
1217
|
+
className: "qa-form-view__title truncate text-2xl font-extrabold tracking-tight md:text-3xl",
|
|
1218
|
+
children: title
|
|
1219
|
+
}),
|
|
1220
|
+
localeOptions.length > 0 && /* @__PURE__ */ jsx(LocaleSwitcher, {
|
|
1221
|
+
locales: localeOptions,
|
|
1222
|
+
value: contentLocale,
|
|
1223
|
+
onChange: setContentLocale
|
|
1224
|
+
}),
|
|
1225
|
+
/* @__PURE__ */ jsx(AutosaveIndicator, {
|
|
1226
|
+
control: form.control,
|
|
1227
|
+
enabled: autoSaveConfig.enabled,
|
|
1228
|
+
indicator: autoSaveConfig.indicator,
|
|
1229
|
+
isEditMode,
|
|
1230
|
+
isSaving,
|
|
1231
|
+
lastSaved,
|
|
1232
|
+
formatTimeAgo,
|
|
1233
|
+
t
|
|
723
1234
|
}),
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
1235
|
+
workflowEnabled && currentStage && /* @__PURE__ */ jsxs(Badge, {
|
|
1236
|
+
variant: "outline",
|
|
1237
|
+
className: "gap-1.5",
|
|
1238
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1239
|
+
icon: "ph:git-branch",
|
|
1240
|
+
className: "size-3"
|
|
1241
|
+
}), currentStageLabel]
|
|
1242
|
+
})
|
|
727
1243
|
]
|
|
728
|
-
})
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
})
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
1244
|
+
}), showMeta && item && /* @__PURE__ */ jsx("div", {
|
|
1245
|
+
className: "qa-form-view__meta no-scrollbar mt-1 overflow-x-auto",
|
|
1246
|
+
children: /* @__PURE__ */ jsxs("p", {
|
|
1247
|
+
className: "text-muted-foreground flex items-center gap-2 font-mono text-xs whitespace-nowrap",
|
|
1248
|
+
children: [
|
|
1249
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1250
|
+
className: "opacity-60",
|
|
1251
|
+
children: [t("form.id"), ":"]
|
|
1252
|
+
}),
|
|
1253
|
+
/* @__PURE__ */ jsx("button", {
|
|
1254
|
+
type: "button",
|
|
1255
|
+
className: "hover:text-foreground cursor-pointer transition-colors",
|
|
1256
|
+
onClick: () => {
|
|
1257
|
+
navigator.clipboard.writeText(String(item.id)).then(() => toast.success(t("toast.idCopied")), () => toast.error(t("toast.copyFailed")));
|
|
1258
|
+
},
|
|
1259
|
+
title: t("common.copy"),
|
|
1260
|
+
children: item.id
|
|
1261
|
+
}),
|
|
1262
|
+
item.createdAt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
1263
|
+
className: "opacity-40",
|
|
1264
|
+
children: "·"
|
|
1265
|
+
}), /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsxs("span", {
|
|
1266
|
+
className: "opacity-60",
|
|
1267
|
+
children: [t("form.created"), " "]
|
|
1268
|
+
}), formatDate(item.createdAt)] })] }),
|
|
1269
|
+
item.updatedAt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
1270
|
+
className: "opacity-40",
|
|
1271
|
+
children: "·"
|
|
1272
|
+
}), /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsxs("span", {
|
|
1273
|
+
className: "opacity-60",
|
|
1274
|
+
children: [t("form.updated"), " "]
|
|
1275
|
+
}), formatDate(item.updatedAt)] })] })
|
|
1276
|
+
]
|
|
1277
|
+
})
|
|
1278
|
+
})]
|
|
1279
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1280
|
+
className: "qa-form-view__actions flex w-auto shrink-0 items-center gap-2",
|
|
1281
|
+
children: [
|
|
1282
|
+
headerActions,
|
|
1283
|
+
canUseLivePreview && /* @__PURE__ */ jsxs(Button, {
|
|
1284
|
+
type: "button",
|
|
1285
|
+
variant: "outline",
|
|
1286
|
+
size: "icon",
|
|
1287
|
+
className: "size-9",
|
|
1288
|
+
onClick: () => setIsLivePreviewOpen(true),
|
|
1289
|
+
title: t("preview.livePreview"),
|
|
1290
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1291
|
+
icon: "ph:eye",
|
|
1292
|
+
className: "size-4"
|
|
1293
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1294
|
+
className: "sr-only",
|
|
1295
|
+
children: t("preview.livePreview")
|
|
1296
|
+
})]
|
|
1297
|
+
}),
|
|
1298
|
+
isEditMode && id && schema?.options?.versioning && /* @__PURE__ */ jsxs(Button, {
|
|
1299
|
+
type: "button",
|
|
1300
|
+
variant: "outline",
|
|
1301
|
+
size: "icon",
|
|
1302
|
+
className: "size-9",
|
|
1303
|
+
onClick: () => setIsHistoryOpen(true),
|
|
1304
|
+
title: t("history.title"),
|
|
1305
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1306
|
+
icon: "ph:clock-counter-clockwise",
|
|
1307
|
+
className: "size-4"
|
|
1308
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1309
|
+
className: "sr-only",
|
|
1310
|
+
children: t("history.title")
|
|
1311
|
+
})]
|
|
1312
|
+
}),
|
|
1313
|
+
workflowEnabled && isEditMode && id && allowedTransitions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
1314
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
1315
|
+
type: "button",
|
|
1316
|
+
variant: "outline",
|
|
1317
|
+
className: "gap-2"
|
|
1318
|
+
}),
|
|
1319
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1320
|
+
icon: "ph:arrows-left-right",
|
|
1321
|
+
className: "size-4"
|
|
1322
|
+
}), t("workflow.transition")]
|
|
1323
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
1324
|
+
align: "end",
|
|
1325
|
+
children: allowedTransitions.map((stage) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
1326
|
+
onClick: () => setTransitionTarget({
|
|
1327
|
+
name: stage.name,
|
|
1328
|
+
label: stage.label
|
|
1329
|
+
}),
|
|
1330
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1331
|
+
icon: "ph:arrow-right",
|
|
1332
|
+
className: "mr-2 size-4"
|
|
1333
|
+
}), stage.label || stage.name]
|
|
1334
|
+
}, stage.name))
|
|
1335
|
+
})] }),
|
|
1336
|
+
visiblePrimaryActions.map((action_4) => /* @__PURE__ */ jsx(ActionButton, {
|
|
1337
|
+
action: action_4,
|
|
1338
|
+
collection,
|
|
1339
|
+
helpers: actionHelpers,
|
|
1340
|
+
onOpenDialog: (a_2) => setDialogAction(a_2)
|
|
1341
|
+
}, action_4.id)),
|
|
1342
|
+
/* @__PURE__ */ jsx(SaveSubmitButton, {
|
|
1343
|
+
control: form.control,
|
|
1344
|
+
isMutationPending,
|
|
1345
|
+
t
|
|
1346
|
+
}),
|
|
1347
|
+
visibleSecondaryActions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
1348
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
1349
|
+
variant: "outline",
|
|
1350
|
+
size: "icon",
|
|
1351
|
+
className: "size-9"
|
|
1352
|
+
}),
|
|
1353
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1354
|
+
icon: "ph:dots-three-vertical",
|
|
1355
|
+
className: "size-4"
|
|
1356
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1357
|
+
className: "sr-only",
|
|
1358
|
+
children: t("common.moreActions")
|
|
1359
|
+
})]
|
|
1360
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
1361
|
+
align: "end",
|
|
1362
|
+
children: [
|
|
1363
|
+
regularSecondary.map((action_5) => {
|
|
1364
|
+
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
1365
|
+
onClick: () => handleActionClick(action_5),
|
|
1366
|
+
disabled: actionLoading,
|
|
1367
|
+
children: [resolveIconElement(action_5.icon, { className: "mr-2 size-4" }), resolveText(action_5.label)]
|
|
1368
|
+
}, action_5.id);
|
|
1369
|
+
}),
|
|
1370
|
+
regularSecondary.length > 0 && destructiveSecondary.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
1371
|
+
destructiveSecondary.map((action_6) => {
|
|
1372
|
+
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
1373
|
+
variant: "destructive",
|
|
1374
|
+
onClick: () => handleActionClick(action_6),
|
|
1375
|
+
disabled: actionLoading,
|
|
1376
|
+
children: [resolveIconElement(action_6.icon, { className: "mr-2 size-4" }), resolveText(action_6.label)]
|
|
1377
|
+
}, action_6.id);
|
|
1378
|
+
})
|
|
1379
|
+
]
|
|
1380
|
+
})] })
|
|
1381
|
+
]
|
|
783
1382
|
})]
|
|
784
1383
|
}),
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
collection,
|
|
788
|
-
helpers: actionHelpers,
|
|
789
|
-
onOpenDialog: (a) => setDialogAction(a)
|
|
790
|
-
}, action.id)),
|
|
791
|
-
/* @__PURE__ */ jsx(Button, {
|
|
792
|
-
type: "submit",
|
|
793
|
-
disabled: isSubmitting || !form.formState.isDirty,
|
|
794
|
-
className: "gap-2",
|
|
795
|
-
children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
796
|
-
icon: "ph:spinner-gap",
|
|
797
|
-
className: "size-4 animate-spin"
|
|
798
|
-
}), t("common.loading")] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
799
|
-
icon: "ph:check",
|
|
800
|
-
width: 16,
|
|
801
|
-
height: 16
|
|
802
|
-
}), t("common.save")] })
|
|
803
|
-
}),
|
|
804
|
-
visibleSecondaryActions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
805
|
-
render: /* @__PURE__ */ jsx(Button, {
|
|
806
|
-
variant: "outline",
|
|
807
|
-
size: "icon",
|
|
808
|
-
className: "size-9"
|
|
809
|
-
}),
|
|
1384
|
+
item?.deletedAt && /* @__PURE__ */ jsxs("div", {
|
|
1385
|
+
className: "qa-form-view__deleted-banner border-destructive/30 bg-destructive/5 text-destructive flex items-center gap-2 border px-4 py-3 text-sm",
|
|
810
1386
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
811
|
-
icon: "ph:
|
|
812
|
-
className: "size-4"
|
|
813
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
})]
|
|
817
|
-
}),
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
children: [resolveIconElement(action.icon, { className: "mr-2 size-4" }), resolveText(action.label)]
|
|
825
|
-
}, action.id);
|
|
826
|
-
}),
|
|
827
|
-
regularSecondary.length > 0 && destructiveSecondary.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
828
|
-
destructiveSecondary.map((action) => {
|
|
829
|
-
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
830
|
-
variant: "destructive",
|
|
831
|
-
onClick: () => handleActionClick(action),
|
|
832
|
-
disabled: actionLoading,
|
|
833
|
-
children: [resolveIconElement(action.icon, { className: "mr-2 size-4" }), resolveText(action.label)]
|
|
834
|
-
}, action.id);
|
|
835
|
-
})
|
|
836
|
-
]
|
|
837
|
-
})] })
|
|
1387
|
+
icon: "ph:trash",
|
|
1388
|
+
className: "size-4 shrink-0"
|
|
1389
|
+
}), /* @__PURE__ */ jsx("span", { children: t("form.deletedBanner", {
|
|
1390
|
+
date: formatDate(item.deletedAt),
|
|
1391
|
+
defaultValue: `This record was deleted on ${formatDate(item.deletedAt)}. Use the Restore action to make it active again.`
|
|
1392
|
+
}) })]
|
|
1393
|
+
}),
|
|
1394
|
+
/* @__PURE__ */ jsx(FormFieldsContent, {
|
|
1395
|
+
collection,
|
|
1396
|
+
config: formConfigBridge,
|
|
1397
|
+
registry,
|
|
1398
|
+
allCollectionsConfig
|
|
1399
|
+
})
|
|
838
1400
|
]
|
|
839
|
-
})
|
|
840
|
-
})
|
|
841
|
-
|
|
842
|
-
config: formConfigBridge,
|
|
843
|
-
registry,
|
|
844
|
-
allCollectionsConfig
|
|
845
|
-
})]
|
|
846
|
-
})]
|
|
1401
|
+
})
|
|
1402
|
+
})
|
|
1403
|
+
]
|
|
847
1404
|
}),
|
|
848
1405
|
/* @__PURE__ */ jsx(Dialog, {
|
|
849
1406
|
open: localeChangeDialog.open,
|
|
@@ -856,7 +1413,7 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
856
1413
|
className: "flex items-center gap-2",
|
|
857
1414
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
858
1415
|
icon: "ph:warning-fill",
|
|
859
|
-
className: "size-5
|
|
1416
|
+
className: "text-warning size-5"
|
|
860
1417
|
}), t("confirm.localeChange")]
|
|
861
1418
|
}), /* @__PURE__ */ jsx(DialogDescription, { children: t("confirm.localeChangeDescription") })] }), /* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(Button, {
|
|
862
1419
|
variant: "outline",
|
|
@@ -871,33 +1428,139 @@ function FormView({ collection, id, config, viewConfig, navigate, basePath = "/a
|
|
|
871
1428
|
}),
|
|
872
1429
|
confirmAction?.confirmation && /* @__PURE__ */ jsx(ConfirmationDialog, {
|
|
873
1430
|
open: !!confirmAction,
|
|
874
|
-
onOpenChange: (
|
|
1431
|
+
onOpenChange: (open_0) => !open_0 && setConfirmAction(null),
|
|
875
1432
|
config: confirmAction.confirmation,
|
|
876
1433
|
onConfirm: handleConfirm,
|
|
877
1434
|
loading: actionLoading
|
|
878
1435
|
}),
|
|
879
1436
|
dialogAction && /* @__PURE__ */ jsx(ActionDialog, {
|
|
880
1437
|
open: !!dialogAction,
|
|
881
|
-
onOpenChange: (
|
|
1438
|
+
onOpenChange: (open_1) => !open_1 && setDialogAction(null),
|
|
882
1439
|
action: dialogAction,
|
|
883
1440
|
collection,
|
|
884
1441
|
item: transformedItem,
|
|
885
1442
|
helpers: actionHelpers
|
|
1443
|
+
}),
|
|
1444
|
+
/* @__PURE__ */ jsx(HistorySidebar, {
|
|
1445
|
+
open: isHistoryOpen,
|
|
1446
|
+
onOpenChange: setIsHistoryOpen,
|
|
1447
|
+
auditEntries: auditData ?? [],
|
|
1448
|
+
isLoadingAudit: auditLoading,
|
|
1449
|
+
versions: versionsData ?? [],
|
|
1450
|
+
isLoadingVersions: versionsLoading,
|
|
1451
|
+
isReverting: revertVersionMutation.isPending,
|
|
1452
|
+
onRevert: async (version_0) => {
|
|
1453
|
+
handleRevertVersion(version_0);
|
|
1454
|
+
},
|
|
1455
|
+
showVersionsTab: !!schema?.options?.versioning
|
|
1456
|
+
}),
|
|
1457
|
+
/* @__PURE__ */ jsx(ConfirmationDialog, {
|
|
1458
|
+
open: !!pendingRevertVersion,
|
|
1459
|
+
onOpenChange: (open_2) => {
|
|
1460
|
+
if (!open_2) setPendingRevertVersion(null);
|
|
1461
|
+
},
|
|
1462
|
+
config: {
|
|
1463
|
+
title: t("version.revertConfirmTitle"),
|
|
1464
|
+
description: t("version.revertConfirmDescription", { number: pendingRevertVersion?.versionNumber ?? pendingRevertVersion?.versionId ?? "-" }),
|
|
1465
|
+
confirmLabel: t("version.revert"),
|
|
1466
|
+
cancelLabel: t("common.cancel"),
|
|
1467
|
+
destructive: false
|
|
1468
|
+
},
|
|
1469
|
+
onConfirm: confirmRevertVersion,
|
|
1470
|
+
loading: revertVersionMutation.isPending
|
|
1471
|
+
}),
|
|
1472
|
+
/* @__PURE__ */ jsx(Dialog, {
|
|
1473
|
+
open: !!transitionTarget,
|
|
1474
|
+
onOpenChange: (open_3) => {
|
|
1475
|
+
if (!open_3) {
|
|
1476
|
+
setTransitionTarget(null);
|
|
1477
|
+
setTransitionSchedule(false);
|
|
1478
|
+
setTransitionScheduledAt(null);
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
1482
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsxs(DialogTitle, {
|
|
1483
|
+
className: "flex items-center gap-2",
|
|
1484
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1485
|
+
icon: "ph:arrows-left-right",
|
|
1486
|
+
className: "size-5"
|
|
1487
|
+
}), t("workflow.transitionTo", { stage: transitionTarget?.label ?? transitionTarget?.name ?? "" })]
|
|
1488
|
+
}), /* @__PURE__ */ jsx(DialogDescription, { children: t("workflow.transitionDescription", {
|
|
1489
|
+
from: currentStageLabel,
|
|
1490
|
+
to: transitionTarget?.label ?? transitionTarget?.name ?? ""
|
|
1491
|
+
}) })] }),
|
|
1492
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1493
|
+
className: "space-y-3 py-2",
|
|
1494
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1495
|
+
className: "flex items-center gap-2",
|
|
1496
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
1497
|
+
checked: transitionSchedule,
|
|
1498
|
+
onCheckedChange: (val) => {
|
|
1499
|
+
setTransitionSchedule(!!val);
|
|
1500
|
+
if (!val) setTransitionScheduledAt(null);
|
|
1501
|
+
},
|
|
1502
|
+
id: "transition-schedule"
|
|
1503
|
+
}), /* @__PURE__ */ jsx(Label, {
|
|
1504
|
+
htmlFor: "transition-schedule",
|
|
1505
|
+
className: "cursor-pointer text-sm",
|
|
1506
|
+
children: t("workflow.scheduleLabel")
|
|
1507
|
+
})]
|
|
1508
|
+
}), transitionSchedule && /* @__PURE__ */ jsxs("div", {
|
|
1509
|
+
className: "space-y-1.5 pl-6",
|
|
1510
|
+
children: [
|
|
1511
|
+
/* @__PURE__ */ jsx(Label, {
|
|
1512
|
+
className: "text-muted-foreground text-xs",
|
|
1513
|
+
children: t("workflow.scheduledAt")
|
|
1514
|
+
}),
|
|
1515
|
+
/* @__PURE__ */ jsx(DateTimeInput, {
|
|
1516
|
+
value: transitionScheduledAt,
|
|
1517
|
+
onChange: setTransitionScheduledAt,
|
|
1518
|
+
minDate: /* @__PURE__ */ new Date()
|
|
1519
|
+
}),
|
|
1520
|
+
/* @__PURE__ */ jsx("p", {
|
|
1521
|
+
className: "text-muted-foreground text-xs",
|
|
1522
|
+
children: t("workflow.scheduledDescription")
|
|
1523
|
+
})
|
|
1524
|
+
]
|
|
1525
|
+
})]
|
|
1526
|
+
}),
|
|
1527
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(Button, {
|
|
1528
|
+
type: "button",
|
|
1529
|
+
variant: "outline",
|
|
1530
|
+
onClick: () => {
|
|
1531
|
+
setTransitionTarget(null);
|
|
1532
|
+
setTransitionSchedule(false);
|
|
1533
|
+
setTransitionScheduledAt(null);
|
|
1534
|
+
},
|
|
1535
|
+
children: t("common.cancel")
|
|
1536
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
1537
|
+
type: "button",
|
|
1538
|
+
onClick: confirmTransition,
|
|
1539
|
+
disabled: transitionMutation.isPending || transitionSchedule && !transitionScheduledAt,
|
|
1540
|
+
className: "gap-2",
|
|
1541
|
+
children: [transitionMutation.isPending && /* @__PURE__ */ jsx(Icon, {
|
|
1542
|
+
icon: "ph:spinner-gap",
|
|
1543
|
+
className: "size-4 animate-spin"
|
|
1544
|
+
}), transitionSchedule ? t("workflow.scheduleLabel") : t("workflow.transition")]
|
|
1545
|
+
})] })
|
|
1546
|
+
] })
|
|
886
1547
|
})
|
|
887
1548
|
] })
|
|
888
|
-
})
|
|
1549
|
+
});
|
|
1550
|
+
if (!canUseLivePreview) return formShell;
|
|
1551
|
+
return /* @__PURE__ */ jsx(LivePreviewMode, {
|
|
889
1552
|
open: isLivePreviewOpen,
|
|
890
1553
|
onClose: () => setIsLivePreviewOpen(false),
|
|
891
|
-
collection,
|
|
892
|
-
itemId: id,
|
|
893
|
-
config,
|
|
894
|
-
allCollectionsConfig,
|
|
895
|
-
registry,
|
|
896
1554
|
previewUrl,
|
|
897
|
-
|
|
898
|
-
|
|
1555
|
+
previewRef,
|
|
1556
|
+
defaultSize: schemaPreview?.defaultSize,
|
|
1557
|
+
minSize: schemaPreview?.minSize,
|
|
1558
|
+
children: formShell
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
function _temp(x) {
|
|
1562
|
+
return x + 1;
|
|
899
1563
|
}
|
|
900
1564
|
|
|
901
1565
|
//#endregion
|
|
902
|
-
export { FormView as default };
|
|
903
|
-
//# sourceMappingURL=form-view.mjs.map
|
|
1566
|
+
export { FormView as default };
|