@questpie/admin 1.1.0 → 2.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 +245 -474
- package/dist/_virtual/rolldown_runtime.mjs +18 -0
- package/dist/augmentation.d.mts +315 -0
- package/dist/augmentation.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.d.mts +199 -0
- package/dist/client/blocks/block-registry.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.mjs +88 -0
- package/dist/client/blocks/block-registry.mjs.map +1 -0
- package/dist/client/blocks/block-renderer.d.mts +52 -0
- package/dist/client/blocks/block-renderer.d.mts.map +1 -0
- package/dist/client/blocks/block-renderer.mjs +71 -0
- package/dist/client/blocks/block-renderer.mjs.map +1 -0
- package/dist/client/blocks/index.d.mts +4 -0
- package/dist/client/blocks/prefetch.d.mts +45 -0
- package/dist/client/blocks/prefetch.d.mts.map +1 -0
- package/dist/client/blocks/prefetch.mjs +26 -0
- package/dist/client/blocks/prefetch.mjs.map +1 -0
- package/dist/client/blocks/types.d.mts +69 -0
- package/dist/client/blocks/types.d.mts.map +1 -0
- package/dist/client/blocks/types.mjs +20 -0
- package/dist/client/blocks/types.mjs.map +1 -0
- package/dist/client/builder/admin-builder.d.mts +112 -0
- package/dist/client/builder/admin-builder.d.mts.map +1 -0
- package/dist/client/builder/admin-builder.mjs +185 -0
- package/dist/client/builder/admin-builder.mjs.map +1 -0
- package/dist/client/builder/admin-types.d.mts +73 -0
- package/dist/client/builder/admin-types.d.mts.map +1 -0
- package/dist/client/builder/admin.d.mts +121 -0
- package/dist/client/builder/admin.d.mts.map +1 -0
- package/dist/client/builder/admin.mjs +160 -0
- package/dist/client/builder/admin.mjs.map +1 -0
- package/dist/client/builder/defaults/components.mjs +20 -0
- package/dist/client/builder/defaults/components.mjs.map +1 -0
- package/dist/client/builder/defaults/core.d.mts +354 -0
- package/dist/client/builder/defaults/core.d.mts.map +1 -0
- package/dist/client/builder/defaults/core.mjs +49 -0
- package/dist/client/builder/defaults/core.mjs.map +1 -0
- package/dist/client/builder/defaults/fields.mjs +328 -0
- package/dist/client/builder/defaults/fields.mjs.map +1 -0
- package/dist/client/builder/defaults/pages.mjs +58 -0
- package/dist/client/builder/defaults/pages.mjs.map +1 -0
- package/dist/client/builder/defaults/starter.d.mts +351 -0
- package/dist/client/builder/defaults/starter.d.mts.map +1 -0
- package/dist/client/builder/defaults/starter.mjs +28 -0
- package/dist/client/builder/defaults/starter.mjs.map +1 -0
- package/dist/client/builder/defaults/views.mjs +27 -0
- package/dist/client/builder/defaults/views.mjs.map +1 -0
- package/dist/client/builder/defaults/widgets.mjs +31 -0
- package/dist/client/builder/defaults/widgets.mjs.map +1 -0
- package/dist/client/builder/field/field.d.mts +229 -0
- package/dist/client/builder/field/field.d.mts.map +1 -0
- package/dist/client/builder/field/field.mjs +83 -0
- package/dist/client/builder/field/field.mjs.map +1 -0
- package/dist/client/builder/index.d.mts +36 -0
- package/dist/client/builder/index.d.mts.map +1 -0
- package/dist/client/builder/page/page.d.mts +36 -0
- package/dist/client/builder/page/page.d.mts.map +1 -0
- package/dist/client/builder/page/page.mjs +27 -0
- package/dist/client/builder/page/page.mjs.map +1 -0
- package/dist/client/builder/proxies.d.mts +2 -0
- package/dist/client/builder/proxies.mjs +24 -0
- package/dist/client/builder/proxies.mjs.map +1 -0
- package/dist/client/builder/qa.d.mts +50 -0
- package/dist/client/builder/qa.d.mts.map +1 -0
- package/dist/client/builder/qa.mjs +42 -0
- package/dist/client/builder/qa.mjs.map +1 -0
- package/dist/client/builder/registry.d.mts +70 -0
- package/dist/client/builder/registry.d.mts.map +1 -0
- package/dist/client/builder/types/action-registry.d.mts +2 -0
- package/dist/client/builder/types/action-registry.mjs +142 -0
- package/dist/client/builder/types/action-registry.mjs.map +1 -0
- package/dist/client/builder/types/action-types.d.mts +253 -0
- package/dist/client/builder/types/action-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.d.mts +199 -0
- package/dist/client/builder/types/collection-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.mjs +11 -0
- package/dist/client/builder/types/collection-types.mjs.map +1 -0
- package/dist/client/builder/types/common.d.mts +60 -0
- package/dist/client/builder/types/common.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.d.mts +593 -0
- package/dist/client/builder/types/field-types.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.mjs +19 -0
- package/dist/client/builder/types/field-types.mjs.map +1 -0
- package/dist/client/builder/types/global-types.d.mts +22 -0
- package/dist/client/builder/types/global-types.d.mts.map +1 -0
- package/dist/client/builder/types/ui-config.d.mts +160 -0
- package/dist/client/builder/types/ui-config.d.mts.map +1 -0
- package/dist/client/builder/types/views.d.mts +89 -0
- package/dist/client/builder/types/views.d.mts.map +1 -0
- package/dist/client/builder/types/widget-types.d.mts +563 -0
- package/dist/client/builder/types/widget-types.d.mts.map +1 -0
- package/dist/client/builder/validation.d.mts +3 -0
- package/dist/client/builder/validation.mjs +208 -0
- package/dist/client/builder/validation.mjs.map +1 -0
- package/dist/client/builder/view/view.d.mts +129 -0
- package/dist/client/builder/view/view.d.mts.map +1 -0
- package/dist/client/builder/view/view.mjs +109 -0
- package/dist/client/builder/view/view.mjs.map +1 -0
- package/dist/client/builder/widget/widget.d.mts +33 -0
- package/dist/client/builder/widget/widget.d.mts.map +1 -0
- package/dist/client/builder/widget/widget.mjs +26 -0
- package/dist/client/builder/widget/widget.mjs.map +1 -0
- package/dist/client/components/actions/action-button.d.mts +2 -0
- package/dist/client/components/actions/action-button.mjs +135 -0
- package/dist/client/components/actions/action-button.mjs.map +1 -0
- package/dist/client/components/actions/action-dialog.d.mts +2 -0
- package/dist/client/components/actions/action-dialog.mjs +264 -0
- package/dist/client/components/actions/action-dialog.mjs.map +1 -0
- package/dist/client/components/actions/confirmation-dialog.d.mts +2 -0
- package/dist/client/components/actions/confirmation-dialog.mjs +82 -0
- package/dist/client/components/actions/confirmation-dialog.mjs.map +1 -0
- package/dist/client/components/actions/header-actions.d.mts +2 -0
- package/dist/client/components/actions/header-actions.mjs +117 -0
- package/dist/client/components/actions/header-actions.mjs.map +1 -0
- package/dist/client/components/actions/index.d.mts +4 -0
- package/dist/client/components/admin-link.d.mts +67 -0
- package/dist/client/components/admin-link.d.mts.map +1 -0
- package/dist/client/components/admin-link.mjs +92 -0
- package/dist/client/components/admin-link.mjs.map +1 -0
- package/dist/client/components/auth/auth-guard.d.mts +51 -0
- package/dist/client/components/auth/auth-guard.d.mts.map +1 -0
- package/dist/client/components/auth/auth-guard.mjs +60 -0
- package/dist/client/components/auth/auth-guard.mjs.map +1 -0
- package/dist/client/components/auth/auth-loading.d.mts +36 -0
- package/dist/client/components/auth/auth-loading.d.mts.map +1 -0
- package/dist/client/components/auth/auth-loading.mjs +27 -0
- package/dist/client/components/auth/auth-loading.mjs.map +1 -0
- package/dist/client/components/auth/index.d.mts +2 -0
- package/dist/client/components/blocks/block-canvas.mjs +90 -0
- package/dist/client/components/blocks/block-canvas.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-context.mjs +58 -0
- package/dist/client/components/blocks/block-editor-context.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-layout.mjs +82 -0
- package/dist/client/components/blocks/block-editor-layout.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-provider.mjs +155 -0
- package/dist/client/components/blocks/block-editor-provider.mjs.map +1 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs +70 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs.map +1 -0
- package/dist/client/components/blocks/block-insert-button.mjs +72 -0
- package/dist/client/components/blocks/block-insert-button.mjs.map +1 -0
- package/dist/client/components/blocks/block-item-menu.mjs +161 -0
- package/dist/client/components/blocks/block-item-menu.mjs.map +1 -0
- package/dist/client/components/blocks/block-item.mjs +187 -0
- package/dist/client/components/blocks/block-item.mjs.map +1 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs +190 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs.map +1 -0
- package/dist/client/components/blocks/block-tree.mjs +45 -0
- package/dist/client/components/blocks/block-tree.mjs.map +1 -0
- package/dist/client/components/blocks/block-type-icon.mjs +50 -0
- package/dist/client/components/blocks/block-type-icon.mjs.map +1 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs +186 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs.map +1 -0
- package/dist/client/components/component-renderer.d.mts +125 -0
- package/dist/client/components/component-renderer.d.mts.map +1 -0
- package/dist/client/components/component-renderer.mjs +145 -0
- package/dist/client/components/component-renderer.mjs.map +1 -0
- package/dist/client/components/error-boundary.mjs +92 -0
- package/dist/client/components/error-boundary.mjs.map +1 -0
- package/dist/client/components/fields/array-field.d.mts +44 -0
- package/dist/client/components/fields/array-field.d.mts.map +1 -0
- package/dist/client/components/fields/array-field.mjs +231 -0
- package/dist/client/components/fields/array-field.mjs.map +1 -0
- package/dist/client/components/fields/asset-preview-field.d.mts +52 -0
- package/dist/client/components/fields/asset-preview-field.d.mts.map +1 -0
- package/dist/client/components/fields/asset-preview-field.mjs +60 -0
- package/dist/client/components/fields/asset-preview-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts +41 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +101 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/index.d.mts +1 -0
- package/dist/client/components/fields/boolean-field.d.mts +30 -0
- package/dist/client/components/fields/boolean-field.d.mts.map +1 -0
- package/dist/client/components/fields/boolean-field.mjs +47 -0
- package/dist/client/components/fields/boolean-field.mjs.map +1 -0
- package/dist/client/components/fields/custom-field.d.mts +3 -0
- package/dist/client/components/fields/date-field.d.mts +22 -0
- package/dist/client/components/fields/date-field.d.mts.map +1 -0
- package/dist/client/components/fields/date-field.mjs +42 -0
- package/dist/client/components/fields/date-field.mjs.map +1 -0
- package/dist/client/components/fields/datetime-field.d.mts +23 -0
- package/dist/client/components/fields/datetime-field.d.mts.map +1 -0
- package/dist/client/components/fields/datetime-field.mjs +43 -0
- package/dist/client/components/fields/datetime-field.mjs.map +1 -0
- package/dist/client/components/fields/email-field.d.mts +19 -0
- package/dist/client/components/fields/email-field.d.mts.map +1 -0
- package/dist/client/components/fields/email-field.mjs +38 -0
- package/dist/client/components/fields/email-field.mjs.map +1 -0
- package/dist/client/components/fields/embedded-collection.d.mts +3 -0
- package/dist/client/components/fields/field-types.d.mts +571 -0
- package/dist/client/components/fields/field-types.d.mts.map +1 -0
- package/dist/client/components/fields/field-utils.d.mts +1 -0
- package/dist/client/components/fields/field-utils.mjs +65 -0
- package/dist/client/components/fields/field-utils.mjs.map +1 -0
- package/dist/client/components/fields/field-wrapper.d.mts +3 -0
- package/dist/client/components/fields/field-wrapper.mjs +49 -0
- package/dist/client/components/fields/field-wrapper.mjs.map +1 -0
- package/dist/client/components/fields/index.d.mts +33 -0
- package/dist/client/components/fields/json-field.d.mts +84 -0
- package/dist/client/components/fields/json-field.d.mts.map +1 -0
- package/dist/client/components/fields/json-field.mjs +248 -0
- package/dist/client/components/fields/json-field.mjs.map +1 -0
- package/dist/client/components/fields/locale-badge.d.mts +1 -0
- package/dist/client/components/fields/locale-badge.mjs +17 -0
- package/dist/client/components/fields/locale-badge.mjs.map +1 -0
- package/dist/client/components/fields/number-field.d.mts +23 -0
- package/dist/client/components/fields/number-field.d.mts.map +1 -0
- package/dist/client/components/fields/number-field.mjs +40 -0
- package/dist/client/components/fields/number-field.mjs.map +1 -0
- package/dist/client/components/fields/object-array-field.d.mts +2 -0
- package/dist/client/components/fields/object-array-field.mjs +313 -0
- package/dist/client/components/fields/object-array-field.mjs.map +1 -0
- package/dist/client/components/fields/object-field.d.mts +32 -0
- package/dist/client/components/fields/object-field.d.mts.map +1 -0
- package/dist/client/components/fields/object-field.mjs +128 -0
- package/dist/client/components/fields/object-field.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/cards-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs +140 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/chips-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs +100 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/grid-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs +114 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/index.d.mts +6 -0
- package/dist/client/components/fields/relation/displays/list-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs +128 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/table-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs +134 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/types.d.mts +22 -0
- package/dist/client/components/fields/relation/displays/types.d.mts.map +1 -0
- package/dist/client/components/fields/relation/displays/types.mjs +73 -0
- package/dist/client/components/fields/relation/displays/types.mjs.map +1 -0
- package/dist/client/components/fields/relation/index.d.mts +3 -0
- package/dist/client/components/fields/relation/relation-items-display.d.mts +5 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs +47 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs.map +1 -0
- package/dist/client/components/fields/relation-field.d.mts +134 -0
- package/dist/client/components/fields/relation-field.d.mts.map +1 -0
- package/dist/client/components/fields/relation-field.mjs +106 -0
- package/dist/client/components/fields/relation-field.mjs.map +1 -0
- package/dist/client/components/fields/relation-picker.d.mts +4 -0
- package/dist/client/components/fields/relation-picker.mjs +301 -0
- package/dist/client/components/fields/relation-picker.mjs.map +1 -0
- package/dist/client/components/fields/relation-select.d.mts +3 -0
- package/dist/client/components/fields/relation-select.mjs +219 -0
- package/dist/client/components/fields/relation-select.mjs.map +1 -0
- package/dist/client/components/fields/reverse-relation-field.d.mts +2 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +56 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +118 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +196 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +4 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +187 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +86 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +11 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +145 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +280 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts +78 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs +31 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs +51 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/variants.d.mts +2 -0
- package/dist/client/components/fields/rich-text-field.d.mts +14 -0
- package/dist/client/components/fields/rich-text-field.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-field.mjs +26 -0
- package/dist/client/components/fields/rich-text-field.mjs.map +1 -0
- package/dist/client/components/fields/select-field.d.mts +25 -0
- package/dist/client/components/fields/select-field.d.mts.map +1 -0
- package/dist/client/components/fields/select-field.mjs +53 -0
- package/dist/client/components/fields/select-field.mjs.map +1 -0
- package/dist/client/components/fields/status-field.d.mts +2 -0
- package/dist/client/components/fields/text-field.d.mts +22 -0
- package/dist/client/components/fields/text-field.d.mts.map +1 -0
- package/dist/client/components/fields/text-field.mjs +39 -0
- package/dist/client/components/fields/text-field.mjs.map +1 -0
- package/dist/client/components/fields/textarea-field.d.mts +22 -0
- package/dist/client/components/fields/textarea-field.d.mts.map +1 -0
- package/dist/client/components/fields/textarea-field.mjs +39 -0
- package/dist/client/components/fields/textarea-field.mjs.map +1 -0
- package/dist/client/components/fields/time-field.d.mts +20 -0
- package/dist/client/components/fields/time-field.d.mts.map +1 -0
- package/dist/client/components/fields/time-field.mjs +39 -0
- package/dist/client/components/fields/time-field.mjs.map +1 -0
- package/dist/client/components/fields/upload-field.d.mts +97 -0
- package/dist/client/components/fields/upload-field.d.mts.map +1 -0
- package/dist/client/components/fields/upload-field.mjs +497 -0
- package/dist/client/components/fields/upload-field.mjs.map +1 -0
- package/dist/client/components/filter-builder/columns-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/columns-tab.mjs +131 -0
- package/dist/client/components/filter-builder/columns-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.d.mts +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +157 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs.map +1 -0
- package/dist/client/components/filter-builder/filters-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/filters-tab.mjs +380 -0
- package/dist/client/components/filter-builder/filters-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/index.d.mts +5 -0
- package/dist/client/components/filter-builder/saved-views-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs +125 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs.map +1 -0
- package/dist/client/components/index.d.mts +80 -0
- package/dist/client/components/locale-switcher.d.mts +2 -0
- package/dist/client/components/locale-switcher.mjs +128 -0
- package/dist/client/components/locale-switcher.mjs.map +1 -0
- package/dist/client/components/media/media-grid.mjs +139 -0
- package/dist/client/components/media/media-grid.mjs.map +1 -0
- package/dist/client/components/media/media-picker-dialog.mjs +255 -0
- package/dist/client/components/media/media-picker-dialog.mjs.map +1 -0
- package/dist/client/components/preview/live-preview-mode.mjs +211 -0
- package/dist/client/components/preview/live-preview-mode.mjs.map +1 -0
- package/dist/client/components/preview/preview-pane.mjs +179 -0
- package/dist/client/components/preview/preview-pane.mjs.map +1 -0
- package/dist/client/components/primitives/asset-preview.mjs +363 -0
- package/dist/client/components/primitives/asset-preview.mjs.map +1 -0
- package/dist/client/components/primitives/checkbox-input.mjs +33 -0
- package/dist/client/components/primitives/checkbox-input.mjs.map +1 -0
- package/dist/client/components/primitives/date-input.mjs +218 -0
- package/dist/client/components/primitives/date-input.mjs.map +1 -0
- package/dist/client/components/primitives/dropzone.mjs +239 -0
- package/dist/client/components/primitives/dropzone.mjs.map +1 -0
- package/dist/client/components/primitives/number-input.mjs +113 -0
- package/dist/client/components/primitives/number-input.mjs.map +1 -0
- package/dist/client/components/primitives/select-multi.mjs +256 -0
- package/dist/client/components/primitives/select-multi.mjs.map +1 -0
- package/dist/client/components/primitives/select-single.mjs +183 -0
- package/dist/client/components/primitives/select-single.mjs.map +1 -0
- package/dist/client/components/primitives/text-input.mjs +40 -0
- package/dist/client/components/primitives/text-input.mjs.map +1 -0
- package/dist/client/components/primitives/textarea-input.mjs +38 -0
- package/dist/client/components/primitives/textarea-input.mjs.map +1 -0
- package/dist/client/components/primitives/time-input.mjs +72 -0
- package/dist/client/components/primitives/time-input.mjs.map +1 -0
- package/dist/client/components/primitives/toggle-input.mjs +31 -0
- package/dist/client/components/primitives/toggle-input.mjs.map +1 -0
- package/dist/client/components/primitives/types.d.mts +14 -0
- package/dist/client/components/primitives/types.d.mts.map +1 -0
- package/dist/client/components/primitives/types.mjs +13 -0
- package/dist/client/components/primitives/types.mjs.map +1 -0
- package/dist/client/components/sheets/index.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.mjs +78 -0
- package/dist/client/components/sheets/resource-sheet.mjs.map +1 -0
- package/dist/client/components/ui/accordion.d.mts +2 -0
- package/dist/client/components/ui/accordion.mjs +50 -0
- package/dist/client/components/ui/accordion.mjs.map +1 -0
- package/dist/client/components/ui/alert.mjs +32 -0
- package/dist/client/components/ui/alert.mjs.map +1 -0
- package/dist/client/components/ui/avatar.d.mts +3 -0
- package/dist/client/components/ui/badge.d.mts +3 -0
- package/dist/client/components/ui/badge.mjs +35 -0
- package/dist/client/components/ui/badge.mjs.map +1 -0
- package/dist/client/components/ui/button.d.mts +3 -0
- package/dist/client/components/ui/button.mjs +49 -0
- package/dist/client/components/ui/button.mjs.map +1 -0
- package/dist/client/components/ui/card.d.mts +2 -0
- package/dist/{card-BKHjBQfw.mjs → client/components/ui/card.mjs} +3 -10
- package/dist/{card-BKHjBQfw.mjs.map → client/components/ui/card.mjs.map} +1 -1
- package/dist/client/components/ui/checkbox.d.mts +2 -0
- package/dist/client/components/ui/checkbox.mjs +27 -0
- package/dist/client/components/ui/checkbox.mjs.map +1 -0
- package/dist/client/components/ui/combobox.d.mts +3 -0
- package/dist/client/components/ui/command.mjs +69 -0
- package/dist/client/components/ui/command.mjs.map +1 -0
- package/dist/client/components/ui/dialog.d.mts +3 -0
- package/dist/client/components/ui/dialog.mjs +83 -0
- package/dist/client/components/ui/dialog.mjs.map +1 -0
- package/dist/client/components/ui/drawer.mjs +75 -0
- package/dist/client/components/ui/drawer.mjs.map +1 -0
- package/dist/client/components/ui/dropdown-menu.d.mts +3 -0
- package/dist/client/components/ui/dropdown-menu.mjs +89 -0
- package/dist/client/components/ui/dropdown-menu.mjs.map +1 -0
- package/dist/client/components/ui/empty-state.mjs +53 -0
- package/dist/client/components/ui/empty-state.mjs.map +1 -0
- package/dist/client/components/ui/field.d.mts +3 -0
- package/dist/client/components/ui/field.mjs +78 -0
- package/dist/client/components/ui/field.mjs.map +1 -0
- package/dist/client/components/ui/input-group.d.mts +4 -0
- package/dist/client/components/ui/input-group.mjs +68 -0
- package/dist/client/components/ui/input-group.mjs.map +1 -0
- package/dist/client/components/ui/input.d.mts +2 -0
- package/dist/client/components/ui/input.mjs +17 -0
- package/dist/client/components/ui/input.mjs.map +1 -0
- package/dist/client/components/ui/kbd.mjs +24 -0
- package/dist/client/components/ui/kbd.mjs.map +1 -0
- package/dist/client/components/ui/label.d.mts +2 -0
- package/dist/client/components/ui/label.mjs +15 -0
- package/dist/client/components/ui/label.mjs.map +1 -0
- package/dist/client/components/ui/popover.d.mts +3 -0
- package/dist/client/components/ui/popover.mjs +49 -0
- package/dist/client/components/ui/popover.mjs.map +1 -0
- package/dist/client/components/ui/responsive-dialog.mjs +102 -0
- package/dist/client/components/ui/responsive-dialog.mjs.map +1 -0
- package/dist/client/components/ui/scroll-area.d.mts +2 -0
- package/dist/client/components/ui/search-input.mjs +74 -0
- package/dist/client/components/ui/search-input.mjs.map +1 -0
- package/dist/client/components/ui/select.d.mts +3 -0
- package/dist/client/components/ui/select.mjs +85 -0
- package/dist/client/components/ui/select.mjs.map +1 -0
- package/dist/client/components/ui/separator.d.mts +2 -0
- package/dist/client/components/ui/separator.mjs +17 -0
- package/dist/client/components/ui/separator.mjs.map +1 -0
- package/dist/client/components/ui/sheet.d.mts +3 -0
- package/dist/client/components/ui/sheet.mjs +78 -0
- package/dist/client/components/ui/sheet.mjs.map +1 -0
- package/dist/client/components/ui/sidebar.d.mts +8 -0
- package/dist/client/components/ui/sidebar.mjs +256 -0
- package/dist/client/components/ui/sidebar.mjs.map +1 -0
- package/dist/client/components/ui/skeleton.d.mts +1 -0
- package/dist/client/components/ui/skeleton.mjs +15 -0
- package/dist/client/components/ui/skeleton.mjs.map +1 -0
- package/dist/client/components/ui/sonner.d.mts +14 -0
- package/dist/client/components/ui/sonner.d.mts.map +1 -0
- package/dist/client/components/ui/sonner.mjs +55 -0
- package/dist/client/components/ui/sonner.mjs.map +1 -0
- package/dist/client/components/ui/spinner.d.mts +1 -0
- package/dist/client/components/ui/spinner.mjs +18 -0
- package/dist/client/components/ui/spinner.mjs.map +1 -0
- package/dist/client/components/ui/switch.d.mts +2 -0
- package/dist/client/components/ui/switch.mjs +23 -0
- package/dist/client/components/ui/switch.mjs.map +1 -0
- package/dist/client/components/ui/table.d.mts +2 -0
- package/dist/client/components/ui/table.mjs +66 -0
- package/dist/client/components/ui/table.mjs.map +1 -0
- package/dist/client/components/ui/tabs.d.mts +3 -0
- package/dist/client/components/ui/tabs.mjs +49 -0
- package/dist/client/components/ui/tabs.mjs.map +1 -0
- package/dist/client/components/ui/textarea.d.mts +2 -0
- package/dist/client/components/ui/textarea.mjs +15 -0
- package/dist/client/components/ui/textarea.mjs.map +1 -0
- package/dist/client/components/ui/toolbar.mjs +54 -0
- package/dist/client/components/ui/toolbar.mjs.map +1 -0
- package/dist/client/components/ui/tooltip.d.mts +2 -0
- package/dist/client/components/ui/tooltip.mjs +45 -0
- package/dist/client/components/ui/tooltip.mjs.map +1 -0
- package/dist/client/components/widgets/chart-widget.d.mts +57 -0
- package/dist/client/components/widgets/chart-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/chart-widget.mjs +282 -0
- package/dist/client/components/widgets/chart-widget.mjs.map +1 -0
- package/dist/client/components/widgets/progress-widget.d.mts +41 -0
- package/dist/client/components/widgets/progress-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/progress-widget.mjs +110 -0
- package/dist/client/components/widgets/progress-widget.mjs.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts +29 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs +121 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts +51 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.mjs +101 -0
- package/dist/client/components/widgets/recent-items-widget.mjs.map +1 -0
- package/dist/client/components/widgets/stats-widget.d.mts +55 -0
- package/dist/client/components/widgets/stats-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/stats-widget.mjs +150 -0
- package/dist/client/components/widgets/stats-widget.mjs.map +1 -0
- package/dist/client/components/widgets/table-widget.d.mts +31 -0
- package/dist/client/components/widgets/table-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/table-widget.mjs +139 -0
- package/dist/client/components/widgets/table-widget.mjs.map +1 -0
- package/dist/client/components/widgets/timeline-widget.d.mts +51 -0
- package/dist/client/components/widgets/timeline-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/timeline-widget.mjs +168 -0
- package/dist/client/components/widgets/timeline-widget.mjs.map +1 -0
- package/dist/client/components/widgets/value-widget.d.mts +39 -0
- package/dist/client/components/widgets/value-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/value-widget.mjs +111 -0
- package/dist/client/components/widgets/value-widget.mjs.map +1 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +145 -0
- package/dist/client/components/widgets/widget-skeletons.mjs.map +1 -0
- package/dist/client/context/focus-context.d.mts +88 -0
- package/dist/client/context/focus-context.d.mts.map +1 -0
- package/dist/client/context/focus-context.mjs +178 -0
- package/dist/client/context/focus-context.mjs.map +1 -0
- package/dist/client/contexts/breadcrumb-context.mjs +32 -0
- package/dist/client/contexts/breadcrumb-context.mjs.map +1 -0
- package/dist/client/hooks/typed-hooks.d.mts +84 -0
- package/dist/client/hooks/typed-hooks.d.mts.map +1 -0
- package/dist/client/hooks/typed-hooks.mjs +272 -0
- package/dist/client/hooks/typed-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-action.mjs +201 -0
- package/dist/client/hooks/use-action.mjs.map +1 -0
- package/dist/client/hooks/use-admin-config.mjs +40 -0
- package/dist/client/hooks/use-admin-config.mjs.map +1 -0
- package/dist/client/hooks/use-admin-preferences.mjs +68 -0
- package/dist/client/hooks/use-admin-preferences.mjs.map +1 -0
- package/dist/client/hooks/use-admin-routes.mjs +97 -0
- package/dist/client/hooks/use-admin-routes.mjs.map +1 -0
- package/dist/client/hooks/use-auth.d.mts +98 -0
- package/dist/client/hooks/use-auth.d.mts.map +1 -0
- package/dist/{use-auth-BoLmWtmU.mjs → client/hooks/use-auth.mjs} +3 -3
- package/dist/client/hooks/use-auth.mjs.map +1 -0
- package/dist/client/hooks/use-collection-fields.mjs +32 -0
- package/dist/client/hooks/use-collection-fields.mjs.map +1 -0
- package/dist/client/hooks/use-collection-meta.mjs +121 -0
- package/dist/client/hooks/use-collection-meta.mjs.map +1 -0
- package/dist/client/hooks/use-collection-schema.mjs +67 -0
- package/dist/client/hooks/use-collection-schema.mjs.map +1 -0
- package/dist/client/hooks/use-collection-validation.mjs +74 -0
- package/dist/client/hooks/use-collection-validation.mjs.map +1 -0
- package/dist/client/hooks/use-collection.d.mts +86 -0
- package/dist/client/hooks/use-collection.d.mts.map +1 -0
- package/dist/client/hooks/use-collection.mjs +214 -0
- package/dist/client/hooks/use-collection.mjs.map +1 -0
- package/dist/client/hooks/use-current-user.d.mts +57 -0
- package/dist/client/hooks/use-current-user.d.mts.map +1 -0
- package/dist/client/hooks/use-current-user.mjs +79 -0
- package/dist/client/hooks/use-current-user.mjs.map +1 -0
- package/dist/client/hooks/use-field-hooks.mjs +191 -0
- package/dist/client/hooks/use-field-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-field-options.d.mts +90 -0
- package/dist/client/hooks/use-field-options.d.mts.map +1 -0
- package/dist/client/hooks/use-field-options.mjs +184 -0
- package/dist/client/hooks/use-field-options.mjs.map +1 -0
- package/dist/client/hooks/use-global-fields.mjs +27 -0
- package/dist/client/hooks/use-global-fields.mjs.map +1 -0
- package/dist/client/hooks/use-global-meta.mjs +59 -0
- package/dist/client/hooks/use-global-meta.mjs.map +1 -0
- package/dist/client/hooks/use-global-schema.mjs +33 -0
- package/dist/client/hooks/use-global-schema.mjs.map +1 -0
- package/dist/client/hooks/use-global.d.mts +40 -0
- package/dist/client/hooks/use-global.d.mts.map +1 -0
- package/dist/client/hooks/use-global.mjs +74 -0
- package/dist/client/hooks/use-global.mjs.map +1 -0
- package/dist/client/hooks/use-locks.mjs +245 -0
- package/dist/client/hooks/use-locks.mjs.map +1 -0
- package/dist/client/hooks/use-media-query.d.mts +23 -0
- package/dist/client/hooks/use-media-query.d.mts.map +1 -0
- package/dist/client/hooks/use-media-query.mjs +62 -0
- package/dist/client/hooks/use-media-query.mjs.map +1 -0
- package/dist/client/hooks/use-prefill-params.mjs +47 -0
- package/dist/client/hooks/use-prefill-params.mjs.map +1 -0
- package/dist/client/hooks/use-questpie-query-options.mjs +28 -0
- package/dist/client/hooks/use-questpie-query-options.mjs.map +1 -0
- package/dist/client/hooks/use-reactive-fields.d.mts +75 -0
- package/dist/client/hooks/use-reactive-fields.d.mts.map +1 -0
- package/dist/client/hooks/use-reactive-fields.mjs +164 -0
- package/dist/client/hooks/use-reactive-fields.mjs.map +1 -0
- package/dist/client/hooks/use-realtime-highlight.mjs +96 -0
- package/dist/client/hooks/use-realtime-highlight.mjs.map +1 -0
- package/dist/client/hooks/use-saved-views.mjs +65 -0
- package/dist/client/hooks/use-saved-views.mjs.map +1 -0
- package/dist/client/hooks/use-search.mjs +147 -0
- package/dist/client/hooks/use-search.mjs.map +1 -0
- package/dist/client/hooks/use-server-validation.mjs +199 -0
- package/dist/client/hooks/use-server-validation.mjs.map +1 -0
- package/dist/client/hooks/use-server-widget-data.d.mts +26 -0
- package/dist/client/hooks/use-server-widget-data.d.mts.map +1 -0
- package/dist/client/hooks/use-server-widget-data.mjs +40 -0
- package/dist/client/hooks/use-server-widget-data.mjs.map +1 -0
- package/dist/client/hooks/use-setup-status.d.mts +39 -0
- package/dist/client/hooks/use-setup-status.d.mts.map +1 -0
- package/dist/client/hooks/use-setup-status.mjs +50 -0
- package/dist/client/hooks/use-setup-status.mjs.map +1 -0
- package/dist/client/hooks/use-upload-collection.mjs +32 -0
- package/dist/client/hooks/use-upload-collection.mjs.map +1 -0
- package/dist/client/hooks/use-upload.d.mts +23 -0
- package/dist/client/hooks/use-upload.d.mts.map +1 -0
- package/dist/client/hooks/use-upload.mjs +145 -0
- package/dist/client/hooks/use-upload.mjs.map +1 -0
- package/dist/client/hooks/use-validation-error-map.mjs +53 -0
- package/dist/client/hooks/use-validation-error-map.mjs.map +1 -0
- package/dist/client/hooks/use-view-state.mjs +261 -0
- package/dist/client/hooks/use-view-state.mjs.map +1 -0
- package/dist/client/i18n/hooks.mjs +160 -0
- package/dist/client/i18n/hooks.mjs.map +1 -0
- package/dist/client/i18n/intl-cache.mjs +65 -0
- package/dist/client/i18n/intl-cache.mjs.map +1 -0
- package/dist/client/i18n/messages.mjs +7 -0
- package/dist/client/i18n/messages.mjs.map +1 -0
- package/dist/client/i18n/simple.d.mts +22 -0
- package/dist/client/i18n/simple.d.mts.map +1 -0
- package/dist/client/i18n/simple.mjs +157 -0
- package/dist/client/i18n/simple.mjs.map +1 -0
- package/dist/client/i18n/types.d.mts +110 -0
- package/dist/client/i18n/types.d.mts.map +1 -0
- package/dist/client/lib/utils.d.mts +1 -0
- package/dist/client/lib/utils.mjs +28 -0
- package/dist/client/lib/utils.mjs.map +1 -0
- package/dist/client/preview/block-scope-context.d.mts +74 -0
- package/dist/client/preview/block-scope-context.d.mts.map +1 -0
- package/dist/client/preview/block-scope-context.mjs +93 -0
- package/dist/client/preview/block-scope-context.mjs.map +1 -0
- package/dist/client/preview/index.d.mts +5 -0
- package/dist/client/preview/preview-banner.d.mts +46 -0
- package/dist/client/preview/preview-banner.d.mts.map +1 -0
- package/dist/client/preview/preview-banner.mjs +95 -0
- package/dist/client/preview/preview-banner.mjs.map +1 -0
- package/dist/client/preview/preview-field.d.mts +108 -0
- package/dist/client/preview/preview-field.d.mts.map +1 -0
- package/dist/client/preview/preview-field.mjs +125 -0
- package/dist/client/preview/preview-field.mjs.map +1 -0
- package/dist/client/preview/types.d.mts +115 -0
- package/dist/client/preview/types.d.mts.map +1 -0
- package/dist/client/preview/types.mjs +21 -0
- package/dist/client/preview/types.mjs.map +1 -0
- package/dist/client/preview/use-collection-preview.d.mts +71 -0
- package/dist/client/preview/use-collection-preview.d.mts.map +1 -0
- package/dist/client/preview/use-collection-preview.mjs +114 -0
- package/dist/client/preview/use-collection-preview.mjs.map +1 -0
- package/dist/client/runtime/content-locales-provider.d.mts +1 -0
- package/dist/client/runtime/content-locales-provider.mjs +85 -0
- package/dist/client/runtime/content-locales-provider.mjs.map +1 -0
- package/dist/client/runtime/index.d.mts +7 -0
- package/dist/client/runtime/index.mjs +8 -0
- package/dist/client/runtime/locale-scope.d.mts +2 -0
- package/dist/{runtime-6VZM878K.mjs → client/runtime/locale-scope.mjs} +3 -4
- package/dist/client/runtime/locale-scope.mjs.map +1 -0
- package/dist/client/runtime/provider.d.mts +10107 -0
- package/dist/client/runtime/provider.d.mts.map +1 -0
- package/dist/client/runtime/provider.mjs +229 -0
- package/dist/client/runtime/provider.mjs.map +1 -0
- package/dist/client/runtime/routes.d.mts +49 -0
- package/dist/client/runtime/routes.d.mts.map +1 -0
- package/dist/client/runtime/routes.mjs +107 -0
- package/dist/client/runtime/routes.mjs.map +1 -0
- package/dist/client/runtime/translations-provider.d.mts +2 -0
- package/dist/client/runtime/translations-provider.mjs +181 -0
- package/dist/client/runtime/translations-provider.mjs.map +1 -0
- package/dist/client/scope/index.d.mts +3 -0
- package/dist/client/scope/picker.d.mts +54 -0
- package/dist/client/scope/picker.d.mts.map +1 -0
- package/dist/client/scope/picker.mjs +161 -0
- package/dist/client/scope/picker.mjs.map +1 -0
- package/dist/client/scope/provider.d.mts +104 -0
- package/dist/client/scope/provider.d.mts.map +1 -0
- package/dist/client/scope/provider.mjs +159 -0
- package/dist/client/scope/provider.mjs.map +1 -0
- package/dist/client/scope/types.d.mts +112 -0
- package/dist/client/scope/types.d.mts.map +1 -0
- package/dist/client/styles/index.css +80 -0
- package/dist/client/utils/auto-expand-fields.mjs +65 -0
- package/dist/client/utils/auto-expand-fields.mjs.map +1 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs +256 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs.map +1 -0
- package/dist/client/utils/detect-relations.mjs +46 -0
- package/dist/client/utils/detect-relations.mjs.map +1 -0
- package/dist/client/utils/locale-to-flag.d.mts +118 -0
- package/dist/client/utils/locale-to-flag.d.mts.map +1 -0
- package/dist/client/utils/locale-to-flag.mjs +130 -0
- package/dist/client/utils/locale-to-flag.mjs.map +1 -0
- package/dist/client/utils/routes.mjs +196 -0
- package/dist/client/utils/routes.mjs.map +1 -0
- package/dist/client/views/auth/accept-invite-form.d.mts +73 -0
- package/dist/client/views/auth/accept-invite-form.d.mts.map +1 -0
- package/dist/client/views/auth/accept-invite-form.mjs +180 -0
- package/dist/client/views/auth/accept-invite-form.mjs.map +1 -0
- package/dist/client/views/auth/auth-layout.d.mts +44 -0
- package/dist/client/views/auth/auth-layout.d.mts.map +1 -0
- package/dist/client/views/auth/auth-layout.mjs +53 -0
- package/dist/client/views/auth/auth-layout.mjs.map +1 -0
- package/dist/client/views/auth/forgot-password-form.d.mts +59 -0
- package/dist/client/views/auth/forgot-password-form.d.mts.map +1 -0
- package/dist/{forgot-password-page-Bcp-An4Y.mjs → client/views/auth/forgot-password-form.mjs} +22 -89
- package/dist/client/views/auth/forgot-password-form.mjs.map +1 -0
- package/dist/client/views/auth/index.d.mts +7 -0
- package/dist/client/views/auth/invite-form.d.mts +1 -0
- package/dist/client/views/auth/invite-form.mjs +155 -0
- package/dist/client/views/auth/invite-form.mjs.map +1 -0
- package/dist/client/views/auth/login-form.d.mts +76 -0
- package/dist/client/views/auth/login-form.d.mts.map +1 -0
- package/dist/client/views/auth/login-form.mjs +167 -0
- package/dist/client/views/auth/login-form.mjs.map +1 -0
- package/dist/client/views/auth/reset-password-form.d.mts +66 -0
- package/dist/client/views/auth/reset-password-form.d.mts.map +1 -0
- package/dist/client/views/auth/reset-password-form.mjs +188 -0
- package/dist/client/views/auth/reset-password-form.mjs.map +1 -0
- package/dist/client/views/auth/setup-form.d.mts +61 -0
- package/dist/client/views/auth/setup-form.d.mts.map +1 -0
- package/dist/{setup-page-YAP_fzqh.mjs → client/views/auth/setup-form.mjs} +46 -124
- package/dist/client/views/auth/setup-form.mjs.map +1 -0
- package/dist/client/views/collection/auto-form-fields.d.mts +4 -0
- package/dist/client/views/collection/auto-form-fields.mjs +453 -0
- package/dist/client/views/collection/auto-form-fields.mjs.map +1 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs +291 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts +46 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.mjs +327 -0
- package/dist/client/views/collection/cells/complex-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/index.d.mts +7 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts +76 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs +165 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts +21 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.mjs +105 -0
- package/dist/client/views/collection/cells/relation-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +189 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.d.mts +2 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs +78 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +37 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts +25 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.mjs +20 -0
- package/dist/client/views/collection/cells/upload-cells.mjs.map +1 -0
- package/dist/client/views/collection/columns/build-columns.d.mts +2 -0
- package/dist/client/views/collection/columns/build-columns.mjs +156 -0
- package/dist/client/views/collection/columns/build-columns.mjs.map +1 -0
- package/dist/client/views/collection/columns/column-defaults.d.mts +2 -0
- package/dist/client/views/collection/columns/column-defaults.mjs +108 -0
- package/dist/client/views/collection/columns/column-defaults.mjs.map +1 -0
- package/dist/client/views/collection/columns/index.d.mts +3 -0
- package/dist/client/views/collection/columns/types.d.mts +2 -0
- package/dist/client/views/collection/field-context.mjs +127 -0
- package/dist/client/views/collection/field-context.mjs.map +1 -0
- package/dist/client/views/collection/field-renderer.mjs +171 -0
- package/dist/client/views/collection/field-renderer.mjs.map +1 -0
- package/dist/client/views/collection/form-view.d.mts +112 -0
- package/dist/client/views/collection/form-view.d.mts.map +1 -0
- package/dist/client/views/collection/form-view.mjs +903 -0
- package/dist/client/views/collection/form-view.mjs.map +1 -0
- package/dist/client/views/collection/index.d.mts +9 -0
- package/dist/client/views/collection/table-view.d.mts +102 -0
- package/dist/client/views/collection/table-view.d.mts.map +1 -0
- package/dist/client/views/collection/table-view.mjs +695 -0
- package/dist/client/views/collection/table-view.mjs.map +1 -0
- package/dist/client/views/collection/view-skeletons.mjs +121 -0
- package/dist/client/views/collection/view-skeletons.mjs.map +1 -0
- package/dist/client/views/common/global-search.d.mts +1 -0
- package/dist/client/views/common/global-search.mjs +376 -0
- package/dist/client/views/common/global-search.mjs.map +1 -0
- package/dist/client/views/common/index.d.mts +1 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs +385 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs.map +1 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs +178 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs.map +1 -0
- package/dist/client/views/dashboard/widget-card.mjs +159 -0
- package/dist/client/views/dashboard/widget-card.mjs.map +1 -0
- package/dist/client/views/globals/global-form-view.d.mts +74 -0
- package/dist/client/views/globals/global-form-view.d.mts.map +1 -0
- package/dist/client/views/globals/global-form-view.mjs +181 -0
- package/dist/client/views/globals/global-form-view.mjs.map +1 -0
- package/dist/client/views/index.d.mts +28 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts +140 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout-provider.mjs +90 -0
- package/dist/client/views/layout/admin-layout-provider.mjs.map +1 -0
- package/dist/client/views/layout/admin-layout.d.mts +151 -0
- package/dist/client/views/layout/admin-layout.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout.mjs +144 -0
- package/dist/client/views/layout/admin-layout.mjs.map +1 -0
- package/dist/client/views/layout/admin-root.d.mts +7 -0
- package/dist/client/views/layout/admin-router.d.mts +125 -0
- package/dist/client/views/layout/admin-router.d.mts.map +1 -0
- package/dist/client/views/layout/admin-router.mjs +594 -0
- package/dist/client/views/layout/admin-router.mjs.map +1 -0
- package/dist/client/views/layout/admin-sidebar.d.mts +105 -0
- package/dist/client/views/layout/admin-sidebar.d.mts.map +1 -0
- package/dist/client/views/layout/admin-sidebar.mjs +550 -0
- package/dist/client/views/layout/admin-sidebar.mjs.map +1 -0
- package/dist/client/views/layout/admin-topbar.mjs +128 -0
- package/dist/client/views/layout/admin-topbar.mjs.map +1 -0
- package/dist/client/views/layout/index.d.mts +5 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +67 -0
- package/dist/client/views/pages/accept-invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/accept-invite-page.mjs +143 -0
- package/dist/client/views/pages/accept-invite-page.mjs.map +1 -0
- package/dist/client/views/pages/dashboard-page.d.mts +52 -0
- package/dist/client/views/pages/dashboard-page.d.mts.map +1 -0
- package/dist/client/views/pages/dashboard-page.mjs +45 -0
- package/dist/client/views/pages/dashboard-page.mjs.map +1 -0
- package/dist/client/views/pages/forgot-password-page.d.mts +59 -0
- package/dist/client/views/pages/forgot-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/forgot-password-page.mjs +80 -0
- package/dist/client/views/pages/forgot-password-page.mjs.map +1 -0
- package/dist/client/views/pages/index.d.mts +7 -0
- package/dist/client/views/pages/invite-page.d.mts +71 -0
- package/dist/client/views/pages/invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/invite-page.mjs +86 -0
- package/dist/client/views/pages/invite-page.mjs.map +1 -0
- package/dist/client/views/pages/login-page.d.mts +76 -0
- package/dist/client/views/pages/login-page.d.mts.map +1 -0
- package/dist/client/views/pages/login-page.mjs +98 -0
- package/dist/client/views/pages/login-page.mjs.map +1 -0
- package/dist/client/views/pages/reset-password-page.d.mts +66 -0
- package/dist/client/views/pages/reset-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/reset-password-page.mjs +105 -0
- package/dist/client/views/pages/reset-password-page.mjs.map +1 -0
- package/dist/client/views/pages/setup-page.d.mts +64 -0
- package/dist/client/views/pages/setup-page.d.mts.map +1 -0
- package/dist/client/views/pages/setup-page.mjs +91 -0
- package/dist/client/views/pages/setup-page.mjs.map +1 -0
- package/dist/client.d.mts +92 -3
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +54 -12
- package/dist/components/rich-text/index.d.mts +1 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts +104 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts.map +1 -0
- package/dist/components/rich-text/rich-text-renderer.mjs +210 -0
- package/dist/components/rich-text/rich-text-renderer.mjs.map +1 -0
- package/dist/index.d.mts +62 -3
- package/dist/index.mjs +54 -12
- package/dist/server/adapters/nextjs.d.mts +121 -0
- package/dist/server/adapters/nextjs.d.mts.map +1 -0
- package/dist/server/adapters/nextjs.mjs +111 -0
- package/dist/server/adapters/nextjs.mjs.map +1 -0
- package/dist/server/adapters/tanstack.d.mts +133 -0
- package/dist/server/adapters/tanstack.d.mts.map +1 -0
- package/dist/server/adapters/tanstack.mjs +90 -0
- package/dist/server/adapters/tanstack.mjs.map +1 -0
- package/dist/server/augmentation.d.mts +1523 -0
- package/dist/server/augmentation.d.mts.map +1 -0
- package/dist/server/auth-helpers.d.mts +143 -0
- package/dist/server/auth-helpers.d.mts.map +1 -0
- package/dist/server/auth-helpers.mjs +108 -0
- package/dist/server/auth-helpers.mjs.map +1 -0
- package/dist/server/block/block-builder.d.mts +319 -0
- package/dist/server/block/block-builder.d.mts.map +1 -0
- package/dist/server/block/block-builder.mjs +217 -0
- package/dist/server/block/block-builder.mjs.map +1 -0
- package/dist/server/block/index.d.mts +3 -0
- package/dist/server/block/introspection.d.mts +84 -0
- package/dist/server/block/introspection.d.mts.map +1 -0
- package/dist/server/block/introspection.mjs +89 -0
- package/dist/server/block/introspection.mjs.map +1 -0
- package/dist/server/block/prefetch.d.mts +78 -0
- package/dist/server/block/prefetch.d.mts.map +1 -0
- package/dist/server/block/prefetch.mjs +240 -0
- package/dist/server/block/prefetch.mjs.map +1 -0
- package/dist/server/fields/blocks.d.mts +139 -0
- package/dist/server/fields/blocks.d.mts.map +1 -0
- package/dist/server/fields/blocks.mjs +192 -0
- package/dist/server/fields/blocks.mjs.map +1 -0
- package/dist/server/fields/index.d.mts +48 -0
- package/dist/server/fields/index.d.mts.map +1 -0
- package/dist/server/fields/index.mjs +16 -0
- package/dist/server/fields/index.mjs.map +1 -0
- package/dist/server/fields/rich-text.d.mts +135 -0
- package/dist/server/fields/rich-text.d.mts.map +1 -0
- package/dist/server/fields/rich-text.mjs +188 -0
- package/dist/server/fields/rich-text.mjs.map +1 -0
- package/dist/server/i18n/index.d.mts +16 -0
- package/dist/server/i18n/index.d.mts.map +1 -0
- package/dist/server/i18n/index.mjs +44 -0
- package/dist/server/i18n/index.mjs.map +1 -0
- package/dist/server/i18n/messages/cs.mjs +461 -0
- package/dist/server/i18n/messages/cs.mjs.map +1 -0
- package/dist/server/i18n/messages/de.mjs +461 -0
- package/dist/server/i18n/messages/de.mjs.map +1 -0
- package/dist/server/i18n/messages/en.mjs +493 -0
- package/dist/server/i18n/messages/en.mjs.map +1 -0
- package/dist/server/i18n/messages/es.mjs +461 -0
- package/dist/server/i18n/messages/es.mjs.map +1 -0
- package/dist/server/i18n/messages/fr.mjs +461 -0
- package/dist/server/i18n/messages/fr.mjs.map +1 -0
- package/dist/server/i18n/messages/index.mjs +24 -0
- package/dist/server/i18n/messages/index.mjs.map +1 -0
- package/dist/server/i18n/messages/pl.mjs +461 -0
- package/dist/server/i18n/messages/pl.mjs.map +1 -0
- package/dist/server/i18n/messages/pt.mjs +464 -0
- package/dist/server/i18n/messages/pt.mjs.map +1 -0
- package/dist/server/i18n/messages/sk.mjs +490 -0
- package/dist/server/i18n/messages/sk.mjs.map +1 -0
- package/dist/server/index.d.mts +20 -0
- package/dist/server/modules/admin/functions/admin-config.mjs +348 -0
- package/dist/server/modules/admin/functions/admin-config.mjs.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts +107 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.mjs +331 -0
- package/dist/server/modules/admin/functions/execute-action.mjs.map +1 -0
- package/dist/server/modules/admin/functions/locales.mjs +80 -0
- package/dist/server/modules/admin/functions/locales.mjs.map +1 -0
- package/dist/server/modules/admin/functions/preview.d.mts +70 -0
- package/dist/server/modules/admin/functions/preview.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/preview.mjs +243 -0
- package/dist/server/modules/admin/functions/preview.mjs.map +1 -0
- package/dist/server/modules/admin/functions/reactive.d.mts +99 -0
- package/dist/server/modules/admin/functions/reactive.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/reactive.mjs +378 -0
- package/dist/server/modules/admin/functions/reactive.mjs.map +1 -0
- package/dist/server/modules/admin/functions/setup.d.mts +84 -0
- package/dist/server/modules/admin/functions/setup.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/setup.mjs +131 -0
- package/dist/server/modules/admin/functions/setup.mjs.map +1 -0
- package/dist/server/modules/admin/functions/translations.mjs +125 -0
- package/dist/server/modules/admin/functions/translations.mjs.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts +33 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.mjs +70 -0
- package/dist/server/modules/admin/functions/widget-data.mjs.map +1 -0
- package/dist/server/modules/admin/index.d.mts +16879 -0
- package/dist/server/modules/admin/index.d.mts.map +1 -0
- package/dist/server/modules/admin/index.mjs +249 -0
- package/dist/server/modules/admin/index.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs +48 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs +79 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts +1490 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs +57 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs.map +1 -0
- package/dist/server/patch.d.mts +100 -0
- package/dist/server/patch.d.mts.map +1 -0
- package/dist/server/patch.mjs +1062 -0
- package/dist/server/patch.mjs.map +1 -0
- package/dist/server.d.mts +21 -250
- package/dist/server.mjs +19 -832
- package/dist/shared/preview-utils.d.mts +54 -0
- package/dist/shared/preview-utils.d.mts.map +1 -0
- package/dist/{preview-utils-BKQ9-TMa.mjs → shared/preview-utils.mjs} +2 -2
- package/dist/shared/preview-utils.mjs.map +1 -0
- package/dist/{saved-views.types-BMsz5mCy.d.mts → shared/types/saved-views.types.d.mts} +7 -2
- package/dist/shared/types/saved-views.types.d.mts.map +1 -0
- package/dist/shared.d.mts +3 -57
- package/dist/shared.mjs +1 -1
- package/package.json +12 -17
- package/dist/auth-layout-M8K8_q5R.mjs +0 -181
- package/dist/auth-layout-M8K8_q5R.mjs.map +0 -1
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +0 -273
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +0 -1
- package/dist/client-B7r47hEd.d.mts +0 -13403
- package/dist/client-B7r47hEd.d.mts.map +0 -1
- package/dist/client-njX1rZmi.mjs +0 -22612
- package/dist/client-njX1rZmi.mjs.map +0 -1
- package/dist/content-locales-provider-BXvuIgfg.mjs +0 -1650
- package/dist/content-locales-provider-BXvuIgfg.mjs.map +0 -1
- package/dist/dashboard-page-B4PGEdc2.mjs +0 -2500
- package/dist/dashboard-page-B4PGEdc2.mjs.map +0 -1
- package/dist/dashboard-page-mCY0pgZv.mjs +0 -3
- package/dist/dropzone-Do3awXKd.mjs +0 -634
- package/dist/dropzone-Do3awXKd.mjs.map +0 -1
- package/dist/forgot-password-page-Bcp-An4Y.mjs.map +0 -1
- package/dist/forgot-password-page-CEwsdLwn.mjs +0 -3
- package/dist/index-BYyqkWtn.d.mts +0 -2753
- package/dist/index-BYyqkWtn.d.mts.map +0 -1
- package/dist/login-page-BUnpCbCa.mjs +0 -3
- package/dist/login-page-CP4gA-dl.mjs +0 -298
- package/dist/login-page-CP4gA-dl.mjs.map +0 -1
- package/dist/preview-utils-BKQ9-TMa.mjs.map +0 -1
- package/dist/reset-password-page-BqfDmLxA.mjs +0 -281
- package/dist/reset-password-page-BqfDmLxA.mjs.map +0 -1
- package/dist/reset-password-page-CufHz3h3.mjs +0 -3
- package/dist/runtime-6VZM878K.mjs.map +0 -1
- package/dist/saved-views.types-BMsz5mCy.d.mts.map +0 -1
- package/dist/server.d.mts.map +0 -1
- package/dist/server.mjs.map +0 -1
- package/dist/setup-page-BNNzt_Z6.mjs +0 -3
- package/dist/setup-page-YAP_fzqh.mjs.map +0 -1
- package/dist/shared.d.mts.map +0 -1
- package/dist/use-auth-BoLmWtmU.mjs.map +0 -1
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { fn } from "questpie";
|
|
3
|
+
|
|
4
|
+
//#region src/server/modules/admin/functions/execute-action.ts
|
|
5
|
+
/**
|
|
6
|
+
* Action Execution Functions
|
|
7
|
+
*
|
|
8
|
+
* Server-side functions for executing collection actions.
|
|
9
|
+
* Actions can be built-in (create, delete, etc.) or custom with forms.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Execute a custom action
|
|
14
|
+
* const result = await executeAction(app, {
|
|
15
|
+
* collection: "posts",
|
|
16
|
+
* actionId: "publish",
|
|
17
|
+
* itemId: "123",
|
|
18
|
+
* data: {},
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Get action configuration for introspection.
|
|
24
|
+
* Returns action definitions without handlers (for client-side rendering).
|
|
25
|
+
*/
|
|
26
|
+
function getActionsConfig(app, collectionSlug) {
|
|
27
|
+
const collection = app.state.collections?.[collectionSlug];
|
|
28
|
+
if (!collection) return null;
|
|
29
|
+
const actionsConfig = (collection.state || collection).adminActions;
|
|
30
|
+
if (!actionsConfig) return {
|
|
31
|
+
builtin: [
|
|
32
|
+
"create",
|
|
33
|
+
"save",
|
|
34
|
+
"delete",
|
|
35
|
+
"deleteMany"
|
|
36
|
+
],
|
|
37
|
+
custom: []
|
|
38
|
+
};
|
|
39
|
+
const customWithoutHandlers = (actionsConfig.custom || []).map((action) => {
|
|
40
|
+
const { handler, ...rest } = action;
|
|
41
|
+
return rest;
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
builtin: actionsConfig.builtin || [
|
|
45
|
+
"create",
|
|
46
|
+
"save",
|
|
47
|
+
"delete",
|
|
48
|
+
"deleteMany"
|
|
49
|
+
],
|
|
50
|
+
custom: customWithoutHandlers
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Execute a collection action.
|
|
55
|
+
* Handles both built-in actions and custom actions.
|
|
56
|
+
*/
|
|
57
|
+
async function executeAction(app, request, session) {
|
|
58
|
+
const { collection: collectionSlug, actionId, itemId, itemIds, data, locale } = request;
|
|
59
|
+
const collection = app.state.collections?.[collectionSlug];
|
|
60
|
+
if (!collection) return {
|
|
61
|
+
success: false,
|
|
62
|
+
error: `Collection "${collectionSlug}" not found`
|
|
63
|
+
};
|
|
64
|
+
const actionsConfig = (collection.state || collection).adminActions;
|
|
65
|
+
if ((actionsConfig?.builtin || [
|
|
66
|
+
"create",
|
|
67
|
+
"save",
|
|
68
|
+
"delete",
|
|
69
|
+
"deleteMany",
|
|
70
|
+
"duplicate"
|
|
71
|
+
]).includes(actionId)) return executeBuiltinAction(app, {
|
|
72
|
+
collectionSlug,
|
|
73
|
+
actionId,
|
|
74
|
+
itemId,
|
|
75
|
+
itemIds,
|
|
76
|
+
data,
|
|
77
|
+
locale,
|
|
78
|
+
session
|
|
79
|
+
});
|
|
80
|
+
const customAction = actionsConfig?.custom?.find((a) => a.id === actionId);
|
|
81
|
+
if (!customAction) return {
|
|
82
|
+
success: false,
|
|
83
|
+
error: `Action "${actionId}" not found on collection "${collectionSlug}"`
|
|
84
|
+
};
|
|
85
|
+
if (customAction.form) {
|
|
86
|
+
const validationError = validateActionFormData(customAction.form.fields, data || {});
|
|
87
|
+
if (validationError) return {
|
|
88
|
+
success: false,
|
|
89
|
+
result: {
|
|
90
|
+
type: "error",
|
|
91
|
+
toast: { message: validationError }
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
const context = {
|
|
97
|
+
data: data || {},
|
|
98
|
+
itemId,
|
|
99
|
+
itemIds,
|
|
100
|
+
app,
|
|
101
|
+
db: app.db,
|
|
102
|
+
session,
|
|
103
|
+
locale
|
|
104
|
+
};
|
|
105
|
+
const result = await customAction.handler(context);
|
|
106
|
+
return {
|
|
107
|
+
success: result.type === "success" || result.type === "redirect",
|
|
108
|
+
result
|
|
109
|
+
};
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error(`Action "${actionId}" failed:`, error);
|
|
112
|
+
return {
|
|
113
|
+
success: false,
|
|
114
|
+
result: {
|
|
115
|
+
type: "error",
|
|
116
|
+
toast: { message: error instanceof Error ? error.message : "Action execution failed" }
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Execute a built-in action.
|
|
123
|
+
*/
|
|
124
|
+
async function executeBuiltinAction(app, params) {
|
|
125
|
+
const { collectionSlug, actionId, itemId, itemIds, data } = params;
|
|
126
|
+
try {
|
|
127
|
+
switch (actionId) {
|
|
128
|
+
case "create": {
|
|
129
|
+
const result = await app.create(collectionSlug, data || {});
|
|
130
|
+
return {
|
|
131
|
+
success: true,
|
|
132
|
+
result: {
|
|
133
|
+
type: "success",
|
|
134
|
+
toast: { message: "Item created successfully" },
|
|
135
|
+
effects: {
|
|
136
|
+
invalidate: [collectionSlug],
|
|
137
|
+
redirect: `/admin/collections/${collectionSlug}/${result.id}`
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
case "save":
|
|
143
|
+
if (!itemId) return {
|
|
144
|
+
success: false,
|
|
145
|
+
result: {
|
|
146
|
+
type: "error",
|
|
147
|
+
toast: { message: "Item ID is required for save action" }
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
await app.update(collectionSlug, itemId, data || {});
|
|
151
|
+
return {
|
|
152
|
+
success: true,
|
|
153
|
+
result: {
|
|
154
|
+
type: "success",
|
|
155
|
+
toast: { message: "Item saved successfully" },
|
|
156
|
+
effects: { invalidate: [collectionSlug] }
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
case "delete":
|
|
160
|
+
if (!itemId) return {
|
|
161
|
+
success: false,
|
|
162
|
+
result: {
|
|
163
|
+
type: "error",
|
|
164
|
+
toast: { message: "Item ID is required for delete action" }
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
await app.delete(collectionSlug, itemId);
|
|
168
|
+
return {
|
|
169
|
+
success: true,
|
|
170
|
+
result: {
|
|
171
|
+
type: "success",
|
|
172
|
+
toast: { message: "Item deleted successfully" },
|
|
173
|
+
effects: {
|
|
174
|
+
invalidate: [collectionSlug],
|
|
175
|
+
redirect: `/admin/collections/${collectionSlug}`
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
case "deleteMany":
|
|
180
|
+
if (!itemIds || itemIds.length === 0) return {
|
|
181
|
+
success: false,
|
|
182
|
+
result: {
|
|
183
|
+
type: "error",
|
|
184
|
+
toast: { message: "Item IDs are required for bulk delete action" }
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
await Promise.all(itemIds.map((id) => app.delete(collectionSlug, id)));
|
|
188
|
+
return {
|
|
189
|
+
success: true,
|
|
190
|
+
result: {
|
|
191
|
+
type: "success",
|
|
192
|
+
toast: { message: `${itemIds.length} items deleted successfully` },
|
|
193
|
+
effects: { invalidate: [collectionSlug] }
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
case "duplicate": {
|
|
197
|
+
if (!itemId) return {
|
|
198
|
+
success: false,
|
|
199
|
+
result: {
|
|
200
|
+
type: "error",
|
|
201
|
+
toast: { message: "Item ID is required for duplicate action" }
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
const original = await app.findById(collectionSlug, itemId);
|
|
205
|
+
if (!original) return {
|
|
206
|
+
success: false,
|
|
207
|
+
result: {
|
|
208
|
+
type: "error",
|
|
209
|
+
toast: { message: "Item not found" }
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const { id, createdAt, updatedAt, ...duplicateData } = original;
|
|
213
|
+
const duplicated = await app.create(collectionSlug, duplicateData);
|
|
214
|
+
return {
|
|
215
|
+
success: true,
|
|
216
|
+
result: {
|
|
217
|
+
type: "success",
|
|
218
|
+
toast: { message: "Item duplicated successfully" },
|
|
219
|
+
effects: {
|
|
220
|
+
invalidate: [collectionSlug],
|
|
221
|
+
redirect: `/admin/collections/${collectionSlug}/${duplicated.id}`
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
default: return {
|
|
227
|
+
success: false,
|
|
228
|
+
result: {
|
|
229
|
+
type: "error",
|
|
230
|
+
toast: { message: `Unknown built-in action: ${actionId}` }
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
} catch (error) {
|
|
235
|
+
console.error(`Built-in action "${actionId}" failed:`, error);
|
|
236
|
+
return {
|
|
237
|
+
success: false,
|
|
238
|
+
result: {
|
|
239
|
+
type: "error",
|
|
240
|
+
toast: { message: error instanceof Error ? error.message : "Action execution failed" }
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Check if a field is a ServerActionFormFieldDefinition (has getMetadata)
|
|
247
|
+
*/
|
|
248
|
+
function isFieldDefinition(field$1) {
|
|
249
|
+
return typeof field$1.getMetadata === "function";
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Extract required status from a form field (handles both config and definition)
|
|
253
|
+
*/
|
|
254
|
+
function isFieldRequired(field$1) {
|
|
255
|
+
if (isFieldDefinition(field$1)) return !!field$1.state?.required;
|
|
256
|
+
return !!field$1.required;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Validate form data against action form fields.
|
|
260
|
+
* Returns error message if validation fails, null if valid.
|
|
261
|
+
*/
|
|
262
|
+
function validateActionFormData(fields, data) {
|
|
263
|
+
for (const [fieldName, fieldConfig] of Object.entries(fields)) if (isFieldRequired(fieldConfig) && !data[fieldName]) return `Field "${fieldName}" is required`;
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
const executeActionRequestSchema = z.object({
|
|
267
|
+
collection: z.string(),
|
|
268
|
+
actionId: z.string(),
|
|
269
|
+
itemId: z.string().optional(),
|
|
270
|
+
itemIds: z.array(z.string()).optional(),
|
|
271
|
+
data: z.record(z.string(), z.unknown()).optional(),
|
|
272
|
+
locale: z.string().optional()
|
|
273
|
+
});
|
|
274
|
+
const executeActionResponseSchema = z.object({
|
|
275
|
+
success: z.boolean(),
|
|
276
|
+
result: z.unknown().optional(),
|
|
277
|
+
error: z.string().optional()
|
|
278
|
+
});
|
|
279
|
+
const getActionsConfigRequestSchema = z.object({ collection: z.string() });
|
|
280
|
+
const getActionsConfigResponseSchema = z.object({
|
|
281
|
+
builtin: z.array(z.string()),
|
|
282
|
+
custom: z.array(z.unknown())
|
|
283
|
+
}).nullable();
|
|
284
|
+
/**
|
|
285
|
+
* Execute a collection action.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```ts
|
|
289
|
+
* // From client
|
|
290
|
+
* const result = await cms.api.functions.executeAction({
|
|
291
|
+
* collection: "posts",
|
|
292
|
+
* actionId: "publish",
|
|
293
|
+
* itemId: "123",
|
|
294
|
+
* });
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
const executeActionFn = fn({
|
|
298
|
+
type: "mutation",
|
|
299
|
+
schema: executeActionRequestSchema,
|
|
300
|
+
outputSchema: executeActionResponseSchema,
|
|
301
|
+
handler: async (ctx) => {
|
|
302
|
+
const app = ctx.app;
|
|
303
|
+
const session = ctx.session;
|
|
304
|
+
return executeAction(app, ctx.input, session);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
/**
|
|
308
|
+
* Get actions configuration for a collection.
|
|
309
|
+
* Returns action definitions without handlers for client rendering.
|
|
310
|
+
*/
|
|
311
|
+
const getActionsConfigFn = fn({
|
|
312
|
+
type: "query",
|
|
313
|
+
schema: getActionsConfigRequestSchema,
|
|
314
|
+
outputSchema: getActionsConfigResponseSchema,
|
|
315
|
+
handler: (ctx) => {
|
|
316
|
+
const app = ctx.app;
|
|
317
|
+
return getActionsConfig(app, ctx.input.collection);
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
/**
|
|
321
|
+
* CMS functions for action execution.
|
|
322
|
+
* These are registered on the adminModule.
|
|
323
|
+
*/
|
|
324
|
+
const actionFunctions = {
|
|
325
|
+
executeAction: executeActionFn,
|
|
326
|
+
getActionsConfig: getActionsConfigFn
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
//#endregion
|
|
330
|
+
export { actionFunctions, executeAction, executeActionFn, getActionsConfig, getActionsConfigFn };
|
|
331
|
+
//# sourceMappingURL=execute-action.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-action.mjs","names":["actionsConfig: ServerActionsConfig | undefined","context: ServerActionContext","field"],"sources":["../../../../../src/server/modules/admin/functions/execute-action.ts"],"sourcesContent":["/**\n * Action Execution Functions\n *\n * Server-side functions for executing collection actions.\n * Actions can be built-in (create, delete, etc.) or custom with forms.\n *\n * @example\n * ```ts\n * // Execute a custom action\n * const result = await executeAction(app, {\n * collection: \"posts\",\n * actionId: \"publish\",\n * itemId: \"123\",\n * data: {},\n * });\n * ```\n */\n\nimport { fn, type Questpie } from \"questpie\";\nimport { z } from \"zod\";\nimport type {\n ServerActionContext,\n ServerActionDefinition,\n ServerActionFormField,\n ServerActionResult,\n ServerActionsConfig,\n} from \"../../../augmentation.js\";\n\n// Type alias for the CMS app\ntype App = Questpie<any>;\n\n/**\n * Request to execute an action\n */\nexport interface ExecuteActionRequest {\n /** Collection slug */\n collection: string;\n /** Action ID (builtin: \"create\", \"delete\", etc. or custom id) */\n actionId: string;\n /** Single item ID (for single-item actions) */\n itemId?: string;\n /** Multiple item IDs (for bulk actions) */\n itemIds?: string[];\n /** Form data (for actions with forms) */\n data?: Record<string, unknown>;\n /** Current locale */\n locale?: string;\n}\n\n/**\n * Response from action execution\n */\nexport interface ExecuteActionResponse {\n success: boolean;\n result?: ServerActionResult;\n error?: string;\n}\n\n/**\n * Get action configuration for introspection.\n * Returns action definitions without handlers (for client-side rendering).\n */\nexport function getActionsConfig(\n app: App,\n collectionSlug: string,\n): {\n builtin: string[];\n custom: Array<Omit<ServerActionDefinition, \"handler\">>;\n} | null {\n const state = (app as any).state as any;\n const collection = state.collections?.[collectionSlug];\n\n if (!collection) {\n return null;\n }\n\n const collectionState = collection.state || collection;\n const actionsConfig: ServerActionsConfig | undefined =\n collectionState.adminActions;\n\n if (!actionsConfig) {\n // Return default built-in actions if no config\n return {\n builtin: [\"create\", \"save\", \"delete\", \"deleteMany\"],\n custom: [],\n };\n }\n\n // Strip handlers from custom actions for client\n const customWithoutHandlers = (actionsConfig.custom || []).map((action) => {\n const { handler, ...rest } = action;\n return rest;\n });\n\n return {\n builtin: actionsConfig.builtin || [\n \"create\",\n \"save\",\n \"delete\",\n \"deleteMany\",\n ],\n custom: customWithoutHandlers,\n };\n}\n\n/**\n * Execute a collection action.\n * Handles both built-in actions and custom actions.\n */\nexport async function executeAction(\n app: App,\n request: ExecuteActionRequest,\n session?: unknown,\n): Promise<ExecuteActionResponse> {\n const {\n collection: collectionSlug,\n actionId,\n itemId,\n itemIds,\n data,\n locale,\n } = request;\n\n const state = (app as any).state as any;\n const collection = state.collections?.[collectionSlug];\n\n if (!collection) {\n return {\n success: false,\n error: `Collection \"${collectionSlug}\" not found`,\n };\n }\n\n const collectionState = collection.state || collection;\n const actionsConfig: ServerActionsConfig | undefined =\n collectionState.adminActions;\n\n // Handle built-in actions\n const builtinActions = actionsConfig?.builtin || [\n \"create\",\n \"save\",\n \"delete\",\n \"deleteMany\",\n \"duplicate\",\n ];\n\n if (builtinActions.includes(actionId as any)) {\n return executeBuiltinAction(app, {\n collectionSlug,\n actionId,\n itemId,\n itemIds,\n data,\n locale,\n session,\n });\n }\n\n // Find custom action\n const customAction = actionsConfig?.custom?.find((a) => a.id === actionId);\n\n if (!customAction) {\n return {\n success: false,\n error: `Action \"${actionId}\" not found on collection \"${collectionSlug}\"`,\n };\n }\n\n // Validate form data if action has a form\n if (customAction.form) {\n const validationError = validateActionFormData(\n customAction.form.fields,\n data || {},\n );\n if (validationError) {\n return {\n success: false,\n result: {\n type: \"error\",\n toast: { message: validationError },\n },\n };\n }\n }\n\n // Execute custom action handler\n try {\n const context: ServerActionContext = {\n data: data || {},\n itemId,\n itemIds,\n app,\n db: (app as any).db,\n session,\n locale,\n };\n\n const result = await customAction.handler(context);\n\n return {\n success: result.type === \"success\" || result.type === \"redirect\",\n result,\n };\n } catch (error) {\n console.error(`Action \"${actionId}\" failed:`, error);\n return {\n success: false,\n result: {\n type: \"error\",\n toast: {\n message:\n error instanceof Error ? error.message : \"Action execution failed\",\n },\n },\n };\n }\n}\n\n/**\n * Execute a built-in action.\n */\nasync function executeBuiltinAction(\n app: App,\n params: {\n collectionSlug: string;\n actionId: string;\n itemId?: string;\n itemIds?: string[];\n data?: Record<string, unknown>;\n locale?: string;\n session?: unknown;\n },\n): Promise<ExecuteActionResponse> {\n const { collectionSlug, actionId, itemId, itemIds, data } = params;\n\n try {\n switch (actionId) {\n case \"create\": {\n const result = await (app as any).create(collectionSlug, data || {});\n return {\n success: true,\n result: {\n type: \"success\",\n toast: { message: \"Item created successfully\" },\n effects: {\n invalidate: [collectionSlug],\n redirect: `/admin/collections/${collectionSlug}/${result.id}`,\n },\n },\n };\n }\n\n case \"save\": {\n if (!itemId) {\n return {\n success: false,\n result: {\n type: \"error\",\n toast: { message: \"Item ID is required for save action\" },\n },\n };\n }\n await (app as any).update(collectionSlug, itemId, data || {});\n return {\n success: true,\n result: {\n type: \"success\",\n toast: { message: \"Item saved successfully\" },\n effects: { invalidate: [collectionSlug] },\n },\n };\n }\n\n case \"delete\": {\n if (!itemId) {\n return {\n success: false,\n result: {\n type: \"error\",\n toast: { message: \"Item ID is required for delete action\" },\n },\n };\n }\n await (app as any).delete(collectionSlug, itemId);\n return {\n success: true,\n result: {\n type: \"success\",\n toast: { message: \"Item deleted successfully\" },\n effects: {\n invalidate: [collectionSlug],\n redirect: `/admin/collections/${collectionSlug}`,\n },\n },\n };\n }\n\n case \"deleteMany\": {\n if (!itemIds || itemIds.length === 0) {\n return {\n success: false,\n result: {\n type: \"error\",\n toast: {\n message: \"Item IDs are required for bulk delete action\",\n },\n },\n };\n }\n // Delete items in parallel\n await Promise.all(\n itemIds.map((id) => (app as any).delete(collectionSlug, id)),\n );\n return {\n success: true,\n result: {\n type: \"success\",\n toast: { message: `${itemIds.length} items deleted successfully` },\n effects: { invalidate: [collectionSlug] },\n },\n };\n }\n\n case \"duplicate\": {\n if (!itemId) {\n return {\n success: false,\n result: {\n type: \"error\",\n toast: { message: \"Item ID is required for duplicate action\" },\n },\n };\n }\n const original = await (app as any).findById(collectionSlug, itemId);\n if (!original) {\n return {\n success: false,\n result: {\n type: \"error\",\n toast: { message: \"Item not found\" },\n },\n };\n }\n // Remove id and timestamps for duplication\n const { id, createdAt, updatedAt, ...duplicateData } = original;\n const duplicated = await (app as any).create(\n collectionSlug,\n duplicateData,\n );\n return {\n success: true,\n result: {\n type: \"success\",\n toast: { message: \"Item duplicated successfully\" },\n effects: {\n invalidate: [collectionSlug],\n redirect: `/admin/collections/${collectionSlug}/${duplicated.id}`,\n },\n },\n };\n }\n\n default:\n return {\n success: false,\n result: {\n type: \"error\",\n toast: { message: `Unknown built-in action: ${actionId}` },\n },\n };\n }\n } catch (error) {\n console.error(`Built-in action \"${actionId}\" failed:`, error);\n return {\n success: false,\n result: {\n type: \"error\",\n toast: {\n message:\n error instanceof Error ? error.message : \"Action execution failed\",\n },\n },\n };\n }\n}\n\n/**\n * Check if a field is a ServerActionFormFieldDefinition (has getMetadata)\n */\nfunction isFieldDefinition(\n field: ServerActionFormField,\n): field is { state: any; getMetadata(): any; toZodSchema(): unknown } {\n return typeof (field as any).getMetadata === \"function\";\n}\n\n/**\n * Extract required status from a form field (handles both config and definition)\n */\nfunction isFieldRequired(field: ServerActionFormField): boolean {\n if (isFieldDefinition(field)) {\n return !!field.state?.required;\n }\n return !!field.required;\n}\n\n/**\n * Validate form data against action form fields.\n * Returns error message if validation fails, null if valid.\n */\nfunction validateActionFormData(\n fields: Record<string, ServerActionFormField>,\n data: Record<string, unknown>,\n): string | null {\n for (const [fieldName, fieldConfig] of Object.entries(fields)) {\n if (isFieldRequired(fieldConfig) && !data[fieldName]) {\n return `Field \"${fieldName}\" is required`;\n }\n }\n return null;\n}\n\n// ============================================================================\n// Schema Definitions\n// ============================================================================\n\nconst executeActionRequestSchema = z.object({\n collection: z.string(),\n actionId: z.string(),\n itemId: z.string().optional(),\n itemIds: z.array(z.string()).optional(),\n data: z.record(z.string(), z.unknown()).optional(),\n locale: z.string().optional(),\n});\n\nconst executeActionResponseSchema = z.object({\n success: z.boolean(),\n result: z.unknown().optional(),\n error: z.string().optional(),\n});\n\nconst getActionsConfigRequestSchema = z.object({\n collection: z.string(),\n});\n\nconst getActionsConfigResponseSchema = z\n .object({\n builtin: z.array(z.string()),\n custom: z.array(z.unknown()),\n })\n .nullable();\n\n// ============================================================================\n// CMS Functions\n// ============================================================================\n\n/**\n * Execute a collection action.\n *\n * @example\n * ```ts\n * // From client\n * const result = await cms.api.functions.executeAction({\n * collection: \"posts\",\n * actionId: \"publish\",\n * itemId: \"123\",\n * });\n * ```\n */\nexport const executeActionFn = fn({\n type: \"mutation\",\n schema: executeActionRequestSchema,\n outputSchema: executeActionResponseSchema,\n handler: async (ctx) => {\n const app = ctx.app as App;\n const session = (ctx as any).session;\n return executeAction(app, ctx.input, session);\n },\n});\n\n/**\n * Get actions configuration for a collection.\n * Returns action definitions without handlers for client rendering.\n */\nexport const getActionsConfigFn = fn({\n type: \"query\",\n schema: getActionsConfigRequestSchema,\n outputSchema: getActionsConfigResponseSchema,\n handler: (ctx) => {\n const app = ctx.app as App;\n return getActionsConfig(app, ctx.input.collection);\n },\n});\n\n/**\n * CMS functions for action execution.\n * These are registered on the adminModule.\n */\nexport const actionFunctions = {\n executeAction: executeActionFn,\n getActionsConfig: getActionsConfigFn,\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { fn } from "questpie";
|
|
3
|
+
|
|
4
|
+
//#region src/server/modules/admin/functions/locales.ts
|
|
5
|
+
/**
|
|
6
|
+
* Content Locales Functions
|
|
7
|
+
*
|
|
8
|
+
* Functions for retrieving available content locales from the CMS configuration.
|
|
9
|
+
* Used by the admin panel to populate locale switchers and validate locale selection.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Helper to get typed CMS app from handler context.
|
|
13
|
+
*/
|
|
14
|
+
function getApp(ctx) {
|
|
15
|
+
return ctx.app;
|
|
16
|
+
}
|
|
17
|
+
const getContentLocalesSchema = z.object({}).optional();
|
|
18
|
+
const getContentLocalesOutputSchema = z.object({
|
|
19
|
+
locales: z.array(z.object({
|
|
20
|
+
code: z.string(),
|
|
21
|
+
label: z.string().optional(),
|
|
22
|
+
fallback: z.boolean().optional(),
|
|
23
|
+
flagCountryCode: z.string().optional()
|
|
24
|
+
})),
|
|
25
|
+
defaultLocale: z.string(),
|
|
26
|
+
fallbacks: z.record(z.string(), z.string()).optional()
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Get available content locales from CMS configuration.
|
|
30
|
+
*
|
|
31
|
+
* Returns the list of available locales for content localization,
|
|
32
|
+
* the default locale, and any fallback mappings.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const result = await client.rpc.getContentLocales({});
|
|
37
|
+
* // {
|
|
38
|
+
* // locales: [
|
|
39
|
+
* // { code: "en", label: "English", fallback: true },
|
|
40
|
+
* // { code: "sk", label: "Slovenčina" },
|
|
41
|
+
* // ],
|
|
42
|
+
* // defaultLocale: "en",
|
|
43
|
+
* // fallbacks: { "en-GB": "en" },
|
|
44
|
+
* // }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
const getContentLocales = fn({
|
|
48
|
+
type: "query",
|
|
49
|
+
schema: getContentLocalesSchema,
|
|
50
|
+
outputSchema: getContentLocalesOutputSchema,
|
|
51
|
+
handler: async (ctx) => {
|
|
52
|
+
const localeConfig = getApp(ctx).config.locale;
|
|
53
|
+
if (!localeConfig) return {
|
|
54
|
+
locales: [{
|
|
55
|
+
code: "en",
|
|
56
|
+
label: "English",
|
|
57
|
+
fallback: true
|
|
58
|
+
}],
|
|
59
|
+
defaultLocale: "en"
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
locales: (typeof localeConfig.locales === "function" ? await localeConfig.locales() : localeConfig.locales).map((l) => ({
|
|
63
|
+
code: l.code,
|
|
64
|
+
label: l.label,
|
|
65
|
+
fallback: l.fallback,
|
|
66
|
+
flagCountryCode: l.flagCountryCode
|
|
67
|
+
})),
|
|
68
|
+
defaultLocale: localeConfig.defaultLocale,
|
|
69
|
+
fallbacks: localeConfig.fallbacks
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Bundle of locale-related functions.
|
|
75
|
+
*/
|
|
76
|
+
const localeFunctions = { getContentLocales };
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
export { getContentLocales, localeFunctions };
|
|
80
|
+
//# sourceMappingURL=locales.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales.mjs","names":[],"sources":["../../../../../src/server/modules/admin/functions/locales.ts"],"sourcesContent":["/**\n * Content Locales Functions\n *\n * Functions for retrieving available content locales from the CMS configuration.\n * Used by the admin panel to populate locale switchers and validate locale selection.\n */\n\nimport { fn, type Questpie } from \"questpie\";\nimport { z } from \"zod\";\n\n// ============================================================================\n// Type Helpers\n// ============================================================================\n\n/**\n * Helper to get typed CMS app from handler context.\n */\nfunction getApp(ctx: { app: unknown }): Questpie<any> {\n return ctx.app as Questpie<any>;\n}\n\n// ============================================================================\n// Schema Definitions\n// ============================================================================\n\nconst getContentLocalesSchema = z.object({}).optional();\n\nconst getContentLocalesOutputSchema = z.object({\n locales: z.array(\n z.object({\n code: z.string(),\n label: z.string().optional(),\n fallback: z.boolean().optional(),\n flagCountryCode: z.string().optional(),\n }),\n ),\n defaultLocale: z.string(),\n fallbacks: z.record(z.string(), z.string()).optional(),\n});\n\n// ============================================================================\n// Functions\n// ============================================================================\n\n/**\n * Get available content locales from CMS configuration.\n *\n * Returns the list of available locales for content localization,\n * the default locale, and any fallback mappings.\n *\n * @example\n * ```ts\n * const result = await client.rpc.getContentLocales({});\n * // {\n * // locales: [\n * // { code: \"en\", label: \"English\", fallback: true },\n * // { code: \"sk\", label: \"Slovenčina\" },\n * // ],\n * // defaultLocale: \"en\",\n * // fallbacks: { \"en-GB\": \"en\" },\n * // }\n * ```\n */\nexport const getContentLocales = fn({\n type: \"query\",\n schema: getContentLocalesSchema,\n outputSchema: getContentLocalesOutputSchema,\n handler: async (ctx) => {\n const cms = getApp(ctx);\n const localeConfig = cms.config.locale;\n\n // If no locale config, return sensible defaults\n if (!localeConfig) {\n return {\n locales: [{ code: \"en\", label: \"English\", fallback: true }],\n defaultLocale: \"en\",\n };\n }\n\n // Resolve locales (can be async function)\n const locales =\n typeof localeConfig.locales === \"function\"\n ? await localeConfig.locales()\n : localeConfig.locales;\n\n return {\n locales: locales.map(\n (l: {\n code: string;\n label?: string;\n fallback?: boolean;\n flagCountryCode?: string;\n }) => ({\n code: l.code,\n label: l.label,\n fallback: l.fallback,\n flagCountryCode: l.flagCountryCode,\n }),\n ),\n defaultLocale: localeConfig.defaultLocale,\n fallbacks: localeConfig.fallbacks,\n };\n },\n});\n\n// ============================================================================\n// Export Bundle\n// ============================================================================\n\n/**\n * Bundle of locale-related functions.\n */\nexport const localeFunctions = {\n getContentLocales,\n} as const;\n"],"mappings":";;;;;;;;;;;;;AAiBA,SAAS,OAAO,KAAsC;AACpD,QAAO,IAAI;;AAOb,MAAM,0BAA0B,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU;AAEvD,MAAM,gCAAgC,EAAE,OAAO;CAC7C,SAAS,EAAE,MACT,EAAE,OAAO;EACP,MAAM,EAAE,QAAQ;EAChB,OAAO,EAAE,QAAQ,CAAC,UAAU;EAC5B,UAAU,EAAE,SAAS,CAAC,UAAU;EAChC,iBAAiB,EAAE,QAAQ,CAAC,UAAU;EACvC,CAAC,CACH;CACD,eAAe,EAAE,QAAQ;CACzB,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,UAAU;CACvD,CAAC;;;;;;;;;;;;;;;;;;;;AAyBF,MAAa,oBAAoB,GAAG;CAClC,MAAM;CACN,QAAQ;CACR,cAAc;CACd,SAAS,OAAO,QAAQ;EAEtB,MAAM,eADM,OAAO,IAAI,CACE,OAAO;AAGhC,MAAI,CAAC,aACH,QAAO;GACL,SAAS,CAAC;IAAE,MAAM;IAAM,OAAO;IAAW,UAAU;IAAM,CAAC;GAC3D,eAAe;GAChB;AASH,SAAO;GACL,UALA,OAAO,aAAa,YAAY,aAC5B,MAAM,aAAa,SAAS,GAC5B,aAAa,SAGA,KACd,OAKM;IACL,MAAM,EAAE;IACR,OAAO,EAAE;IACT,UAAU,EAAE;IACZ,iBAAiB,EAAE;IACpB,EACF;GACD,eAAe,aAAa;GAC5B,WAAW,aAAa;GACzB;;CAEJ,CAAC;;;;AASF,MAAa,kBAAkB,EAC7B,mBACD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as questpie18964 from "questpie";
|
|
2
|
+
|
|
3
|
+
//#region src/server/modules/admin/functions/preview.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Preview Functions - Server-side
|
|
7
|
+
*
|
|
8
|
+
* RPC functions for draft mode preview.
|
|
9
|
+
* Handles token minting for secure, shareable preview links.
|
|
10
|
+
*
|
|
11
|
+
* Browser-safe utilities (isDraftMode, createDraftModeCookie, etc.) are in @questpie/admin/shared
|
|
12
|
+
*/
|
|
13
|
+
interface PreviewTokenPayload {
|
|
14
|
+
path: string;
|
|
15
|
+
exp: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create preview-related RPC functions.
|
|
19
|
+
*
|
|
20
|
+
* @param secret - Secret key for signing tokens
|
|
21
|
+
* @returns Object with preview functions
|
|
22
|
+
*/
|
|
23
|
+
declare function createPreviewFunctions(secret: string): {
|
|
24
|
+
mintPreviewToken: questpie18964.JsonFunctionDefinition<{
|
|
25
|
+
path: string;
|
|
26
|
+
ttlMs?: number | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
token: string;
|
|
29
|
+
expiresAt: number;
|
|
30
|
+
}>;
|
|
31
|
+
verifyPreviewToken: questpie18964.JsonFunctionDefinition<{
|
|
32
|
+
token: string;
|
|
33
|
+
}, {
|
|
34
|
+
valid: boolean;
|
|
35
|
+
path?: string | undefined;
|
|
36
|
+
error?: string | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Verify a preview token without RPC.
|
|
41
|
+
* Used directly in route handlers where RPC is not available.
|
|
42
|
+
*
|
|
43
|
+
* @param token - The preview token to verify
|
|
44
|
+
* @param secret - The secret used to sign the token
|
|
45
|
+
* @returns The payload if valid, null otherwise
|
|
46
|
+
*/
|
|
47
|
+
declare function verifyPreviewTokenDirect(token: string, secret: string): PreviewTokenPayload | null;
|
|
48
|
+
/**
|
|
49
|
+
* Create a preview token verifier with bound secret.
|
|
50
|
+
* Use this in route handlers to avoid passing secret repeatedly.
|
|
51
|
+
*
|
|
52
|
+
* @param secret - The secret used to sign tokens (optional, uses env if not provided)
|
|
53
|
+
* @returns A verify function that only needs the token
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* // Create once at module level
|
|
58
|
+
* const verifyPreviewToken = createPreviewTokenVerifier();
|
|
59
|
+
*
|
|
60
|
+
* // Use in route handler
|
|
61
|
+
* const payload = verifyPreviewToken(token);
|
|
62
|
+
* if (!payload) {
|
|
63
|
+
* return new Response("Invalid token", { status: 401 });
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
declare function createPreviewTokenVerifier(secret?: string): (token: string) => PreviewTokenPayload | null;
|
|
68
|
+
//#endregion
|
|
69
|
+
export { PreviewTokenPayload, createPreviewFunctions, createPreviewTokenVerifier, verifyPreviewTokenDirect };
|
|
70
|
+
//# sourceMappingURL=preview.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.mts","names":[],"sources":["../../../../../src/server/modules/admin/functions/preview.ts"],"sourcesContent":[],"mappings":";;;;;;;AAiEA;AAiBA;AAgIA;AAuDA;;UAxMiB,mBAAA;;;;;;;;;;iBAiBD,sBAAA;oBAAsB,aAAA,CAAA;;;;;;;sBAAA,aAAA,CAAA;;;;;;;;;;;;;;;;iBAgItB,wBAAA,iCAGb;;;;;;;;;;;;;;;;;;;;iBAoDa,0BAAA,sCAGS"}
|