@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,208 @@
|
|
|
1
|
+
import { createFieldRegistryProxy } from "./proxies.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/client/builder/validation.ts
|
|
5
|
+
/**
|
|
6
|
+
* Client-side Validation Schema Builder
|
|
7
|
+
*
|
|
8
|
+
* Generates Zod schemas from admin field configurations.
|
|
9
|
+
* Uses createZod from field definitions for automatic schema generation.
|
|
10
|
+
* Supports nested fields (object, array) via recursive schema building.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Build a string schema with validations (fallback)
|
|
14
|
+
*/
|
|
15
|
+
function buildStringSchema(validation) {
|
|
16
|
+
let schema = z.string();
|
|
17
|
+
if (validation) {
|
|
18
|
+
if (validation.minLength !== void 0) schema = schema.min(validation.minLength, `Must be at least ${validation.minLength} characters`);
|
|
19
|
+
if (validation.maxLength !== void 0) schema = schema.max(validation.maxLength, `Must be at most ${validation.maxLength} characters`);
|
|
20
|
+
if (validation.email) schema = schema.email("Invalid email address");
|
|
21
|
+
if (validation.url) schema = schema.url("Invalid URL");
|
|
22
|
+
if (validation.pattern) {
|
|
23
|
+
const regex = typeof validation.pattern === "string" ? new RegExp(validation.pattern) : validation.pattern;
|
|
24
|
+
schema = schema.regex(regex, validation.patternMessage || "Invalid format");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return schema;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Build a number schema with validations (fallback)
|
|
31
|
+
*/
|
|
32
|
+
function buildNumberSchema(validation) {
|
|
33
|
+
let schema = z.number();
|
|
34
|
+
if (validation) {
|
|
35
|
+
if (validation.min !== void 0) schema = schema.min(validation.min, `Must be at least ${validation.min}`);
|
|
36
|
+
if (validation.max !== void 0) schema = schema.max(validation.max, `Must be at most ${validation.max}`);
|
|
37
|
+
}
|
|
38
|
+
return schema;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Fallback schema builder for fields without createZod
|
|
42
|
+
*/
|
|
43
|
+
function buildFallbackSchema(fieldType, required, validation) {
|
|
44
|
+
let schema;
|
|
45
|
+
switch (fieldType) {
|
|
46
|
+
case "text":
|
|
47
|
+
case "textarea":
|
|
48
|
+
case "email":
|
|
49
|
+
case "password":
|
|
50
|
+
case "slug":
|
|
51
|
+
case "code":
|
|
52
|
+
case "time":
|
|
53
|
+
schema = buildStringSchema(validation);
|
|
54
|
+
break;
|
|
55
|
+
case "number":
|
|
56
|
+
case "currency":
|
|
57
|
+
schema = buildNumberSchema(validation);
|
|
58
|
+
break;
|
|
59
|
+
case "switch":
|
|
60
|
+
case "checkbox":
|
|
61
|
+
schema = z.boolean();
|
|
62
|
+
break;
|
|
63
|
+
case "date":
|
|
64
|
+
case "datetime":
|
|
65
|
+
schema = z.date().or(z.string());
|
|
66
|
+
break;
|
|
67
|
+
case "select":
|
|
68
|
+
schema = z.string().or(z.number());
|
|
69
|
+
break;
|
|
70
|
+
case "relation":
|
|
71
|
+
schema = z.string().or(z.array(z.string()));
|
|
72
|
+
break;
|
|
73
|
+
case "upload":
|
|
74
|
+
schema = z.string();
|
|
75
|
+
break;
|
|
76
|
+
case "uploadMany":
|
|
77
|
+
schema = z.array(z.string());
|
|
78
|
+
break;
|
|
79
|
+
case "array":
|
|
80
|
+
schema = z.array(z.any());
|
|
81
|
+
break;
|
|
82
|
+
case "object":
|
|
83
|
+
schema = z.record(z.string(), z.any());
|
|
84
|
+
break;
|
|
85
|
+
case "json":
|
|
86
|
+
case "richText":
|
|
87
|
+
schema = z.any();
|
|
88
|
+
break;
|
|
89
|
+
default: schema = z.any();
|
|
90
|
+
}
|
|
91
|
+
if (validation?.refine) schema = validation.refine(schema);
|
|
92
|
+
if (!required) schema = schema.optional().nullable();
|
|
93
|
+
return schema;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Creates the ZodBuildContext for recursive schema building
|
|
97
|
+
*/
|
|
98
|
+
function createBuildContext(registry) {
|
|
99
|
+
const ctx = {
|
|
100
|
+
registry,
|
|
101
|
+
buildSchema: (fieldDef) => {
|
|
102
|
+
const opts = fieldDef["~options"] || {};
|
|
103
|
+
if (fieldDef.createZod) return fieldDef.createZod(opts, ctx);
|
|
104
|
+
return buildFallbackSchema(fieldDef.name, opts.required, opts.validation);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return ctx;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Build a Zod schema from admin field definitions
|
|
111
|
+
*
|
|
112
|
+
* Uses createZod from each field definition if available,
|
|
113
|
+
* otherwise falls back to generic schema based on field type.
|
|
114
|
+
*
|
|
115
|
+
* @param fields - Field definitions from admin collection config
|
|
116
|
+
* @param registry - Field registry from admin builder
|
|
117
|
+
* @returns Zod object schema for the collection
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const schema = buildValidationSchema(collectionConfig.fields, admin.getFields());
|
|
122
|
+
*
|
|
123
|
+
* // Use with react-hook-form
|
|
124
|
+
* const form = useForm({
|
|
125
|
+
* resolver: zodResolver(schema),
|
|
126
|
+
* });
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
function buildValidationSchema(fields, registry) {
|
|
130
|
+
const ctx = createBuildContext(registry);
|
|
131
|
+
const shape = {};
|
|
132
|
+
for (const [name, fieldDef] of Object.entries(fields)) shape[name] = ctx.buildSchema(fieldDef);
|
|
133
|
+
return z.object(shape);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Build validation schema with custom validation functions
|
|
137
|
+
*
|
|
138
|
+
* This version supports the `validate` callback in FieldValidationConfig
|
|
139
|
+
* which receives form values for cross-field validation.
|
|
140
|
+
*
|
|
141
|
+
* @param fields - Field definitions from admin collection config
|
|
142
|
+
* @param registry - Field registry from admin builder
|
|
143
|
+
* @returns Zod schema with superRefine for custom validators
|
|
144
|
+
*/
|
|
145
|
+
function buildValidationSchemaWithCustom(fields, registry) {
|
|
146
|
+
const baseSchema = buildValidationSchema(fields, registry);
|
|
147
|
+
const customValidators = [];
|
|
148
|
+
for (const [name, fieldDef] of Object.entries(fields)) {
|
|
149
|
+
const options = fieldDef["~options"] || {};
|
|
150
|
+
if (options.validation?.validate) customValidators.push({
|
|
151
|
+
name,
|
|
152
|
+
validate: options.validation.validate
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (customValidators.length === 0) return baseSchema;
|
|
156
|
+
return baseSchema.superRefine((data, ctx) => {
|
|
157
|
+
for (const { name, validate } of customValidators) {
|
|
158
|
+
const error = validate(data[name], data);
|
|
159
|
+
if (error) ctx.addIssue({
|
|
160
|
+
code: z.ZodIssueCode.custom,
|
|
161
|
+
message: error,
|
|
162
|
+
path: [name]
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Create a Zod validation schema from admin field config
|
|
169
|
+
*
|
|
170
|
+
* Use with @hookform/resolvers/zod for react-hook-form integration.
|
|
171
|
+
*
|
|
172
|
+
* @param fields - Field definitions from admin collection config
|
|
173
|
+
* @param registry - Field registry from admin builder
|
|
174
|
+
* @returns Zod schema for form validation
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```tsx
|
|
178
|
+
* import { zodResolver } from "@hookform/resolvers/zod";
|
|
179
|
+
* import { createFormSchema } from "@questpie/admin/builder";
|
|
180
|
+
*
|
|
181
|
+
* // From collection config
|
|
182
|
+
* const schema = createFormSchema(collectionConfig.fields, admin.getFields());
|
|
183
|
+
*
|
|
184
|
+
* function MyForm() {
|
|
185
|
+
* const form = useForm({
|
|
186
|
+
* resolver: zodResolver(schema),
|
|
187
|
+
* });
|
|
188
|
+
* // ...
|
|
189
|
+
* }
|
|
190
|
+
*
|
|
191
|
+
* // Or use the hook
|
|
192
|
+
* import { useCollectionValidation } from "@questpie/admin/hooks";
|
|
193
|
+
*
|
|
194
|
+
* function MyCollectionForm() {
|
|
195
|
+
* const schema = useCollectionValidation("posts");
|
|
196
|
+
* const form = useForm({
|
|
197
|
+
* resolver: schema ? zodResolver(schema) : undefined,
|
|
198
|
+
* });
|
|
199
|
+
* }
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
function createFormSchema(fields, registry) {
|
|
203
|
+
return buildValidationSchemaWithCustom(fields, registry);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
//#endregion
|
|
207
|
+
export { buildValidationSchema, createFormSchema };
|
|
208
|
+
//# sourceMappingURL=validation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.mjs","names":["schema: z.ZodTypeAny","ctx: ZodBuildContext","shape: Record<string, z.ZodTypeAny>","customValidators: Array<{\n name: string;\n validate: NonNullable<FieldValidationConfig[\"validate\"]>;\n }>"],"sources":["../../../src/client/builder/validation.ts"],"sourcesContent":["/**\n * Client-side Validation Schema Builder\n *\n * Generates Zod schemas from admin field configurations.\n * Uses createZod from field definitions for automatic schema generation.\n * Supports nested fields (object, array) via recursive schema building.\n */\n\nimport { z } from \"zod\";\nimport type { FieldDefinition, ZodBuildContext } from \"./field/field\";\nimport type { FieldValidationConfig } from \"./types/field-types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Collection fields map (from admin config)\n */\ntype FieldsMap = Record<string, FieldDefinition>;\n\n/**\n * Field registry type\n */\ntype FieldRegistry = Record<string, any>;\n\n// ============================================================================\n// Fallback Schema Builders (for fields without createZod)\n// ============================================================================\n\n/**\n * Build a string schema with validations (fallback)\n */\nfunction buildStringSchema(validation?: FieldValidationConfig): z.ZodString {\n let schema = z.string();\n\n if (validation) {\n if (validation.minLength !== undefined) {\n schema = schema.min(\n validation.minLength,\n `Must be at least ${validation.minLength} characters`,\n );\n }\n if (validation.maxLength !== undefined) {\n schema = schema.max(\n validation.maxLength,\n `Must be at most ${validation.maxLength} characters`,\n );\n }\n if (validation.email) {\n schema = schema.email(\"Invalid email address\");\n }\n if (validation.url) {\n schema = schema.url(\"Invalid URL\");\n }\n if (validation.pattern) {\n const regex =\n typeof validation.pattern === \"string\"\n ? new RegExp(validation.pattern)\n : validation.pattern;\n schema = schema.regex(\n regex,\n validation.patternMessage || \"Invalid format\",\n );\n }\n }\n\n return schema;\n}\n\n/**\n * Build a number schema with validations (fallback)\n */\nfunction buildNumberSchema(validation?: FieldValidationConfig): z.ZodNumber {\n let schema = z.number();\n\n if (validation) {\n if (validation.min !== undefined) {\n schema = schema.min(validation.min, `Must be at least ${validation.min}`);\n }\n if (validation.max !== undefined) {\n schema = schema.max(validation.max, `Must be at most ${validation.max}`);\n }\n }\n\n return schema;\n}\n\n/**\n * Fallback schema builder for fields without createZod\n */\nfunction buildFallbackSchema(\n fieldType: string,\n required?: boolean,\n validation?: FieldValidationConfig,\n): z.ZodTypeAny {\n let schema: z.ZodTypeAny;\n\n switch (fieldType) {\n case \"text\":\n case \"textarea\":\n case \"email\":\n case \"password\":\n case \"slug\":\n case \"code\":\n case \"time\":\n schema = buildStringSchema(validation);\n break;\n\n case \"number\":\n case \"currency\":\n schema = buildNumberSchema(validation);\n break;\n\n case \"switch\":\n case \"checkbox\":\n schema = z.boolean();\n break;\n\n case \"date\":\n case \"datetime\":\n schema = z.date().or(z.string());\n break;\n\n case \"select\":\n schema = z.string().or(z.number());\n break;\n\n case \"relation\":\n schema = z.string().or(z.array(z.string()));\n break;\n\n case \"upload\":\n schema = z.string();\n break;\n\n case \"uploadMany\":\n schema = z.array(z.string());\n break;\n\n case \"array\":\n schema = z.array(z.any());\n break;\n\n case \"object\":\n schema = z.record(z.string(), z.any());\n break;\n\n case \"json\":\n case \"richText\":\n schema = z.any();\n break;\n\n default:\n schema = z.any();\n }\n\n // Apply custom refinement from validation config\n if (validation?.refine) {\n schema = validation.refine(schema);\n }\n\n // Handle required/optional\n if (!required) {\n schema = schema.optional().nullable();\n }\n\n return schema;\n}\n\n// ============================================================================\n// Main Schema Builder\n// ============================================================================\n\n/**\n * Creates the ZodBuildContext for recursive schema building\n */\nfunction createBuildContext(registry: FieldRegistry): ZodBuildContext {\n const ctx: ZodBuildContext = {\n registry,\n buildSchema: (fieldDef: FieldDefinition): z.ZodTypeAny => {\n const opts = fieldDef[\"~options\"] || {};\n\n // If field has createZod, use it\n if (fieldDef.createZod) {\n return fieldDef.createZod(opts, ctx);\n }\n\n // Fallback to generic schema based on field type name\n return buildFallbackSchema(fieldDef.name, opts.required, opts.validation);\n },\n };\n\n return ctx;\n}\n\n/**\n * Build a Zod schema from admin field definitions\n *\n * Uses createZod from each field definition if available,\n * otherwise falls back to generic schema based on field type.\n *\n * @param fields - Field definitions from admin collection config\n * @param registry - Field registry from admin builder\n * @returns Zod object schema for the collection\n *\n * @example\n * ```ts\n * const schema = buildValidationSchema(collectionConfig.fields, admin.getFields());\n *\n * // Use with react-hook-form\n * const form = useForm({\n * resolver: zodResolver(schema),\n * });\n * ```\n */\nexport function buildValidationSchema(\n fields: FieldsMap,\n registry: FieldRegistry,\n): z.ZodObject<Record<string, z.ZodTypeAny>> {\n const ctx = createBuildContext(registry);\n const shape: Record<string, z.ZodTypeAny> = {};\n\n for (const [name, fieldDef] of Object.entries(fields)) {\n shape[name] = ctx.buildSchema(fieldDef);\n }\n\n return z.object(shape);\n}\n\n/**\n * Build validation schema with custom validation functions\n *\n * This version supports the `validate` callback in FieldValidationConfig\n * which receives form values for cross-field validation.\n *\n * @param fields - Field definitions from admin collection config\n * @param registry - Field registry from admin builder\n * @returns Zod schema with superRefine for custom validators\n */\nexport function buildValidationSchemaWithCustom(\n fields: FieldsMap,\n registry: FieldRegistry,\n): z.ZodTypeAny {\n const baseSchema = buildValidationSchema(fields, registry);\n\n // Collect fields with custom validate functions\n const customValidators: Array<{\n name: string;\n validate: NonNullable<FieldValidationConfig[\"validate\"]>;\n }> = [];\n\n for (const [name, fieldDef] of Object.entries(fields)) {\n const options = fieldDef[\"~options\"] || {};\n if (options.validation?.validate) {\n customValidators.push({\n name,\n validate: options.validation.validate,\n });\n }\n }\n\n // If no custom validators, return base schema\n if (customValidators.length === 0) {\n return baseSchema;\n }\n\n // Apply custom validators via superRefine\n return baseSchema.superRefine((data, ctx) => {\n for (const { name, validate } of customValidators) {\n const error = validate(data[name], data);\n if (error) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: error,\n path: [name],\n });\n }\n }\n });\n}\n\n/**\n * Create a Zod validation schema from admin field config\n *\n * Use with @hookform/resolvers/zod for react-hook-form integration.\n *\n * @param fields - Field definitions from admin collection config\n * @param registry - Field registry from admin builder\n * @returns Zod schema for form validation\n *\n * @example\n * ```tsx\n * import { zodResolver } from \"@hookform/resolvers/zod\";\n * import { createFormSchema } from \"@questpie/admin/builder\";\n *\n * // From collection config\n * const schema = createFormSchema(collectionConfig.fields, admin.getFields());\n *\n * function MyForm() {\n * const form = useForm({\n * resolver: zodResolver(schema),\n * });\n * // ...\n * }\n *\n * // Or use the hook\n * import { useCollectionValidation } from \"@questpie/admin/hooks\";\n *\n * function MyCollectionForm() {\n * const schema = useCollectionValidation(\"posts\");\n * const form = useForm({\n * resolver: schema ? zodResolver(schema) : undefined,\n * });\n * }\n * ```\n */\nexport function createFormSchema(\n fields: FieldsMap,\n registry: FieldRegistry,\n): z.ZodTypeAny {\n return buildValidationSchemaWithCustom(fields, registry);\n}\n\n// ============================================================================\n// Re-exports for convenience\n// ============================================================================\n\nexport type { ZodBuildContext } from \"./field/field\";\nexport { createFieldRegistryProxy as createRegistryProxy } from \"./proxies\";\n"],"mappings":"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"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { MaybeLazyComponent } from "../types/common.mjs";
|
|
2
|
+
import { SetProperty } from "questpie/shared";
|
|
3
|
+
|
|
4
|
+
//#region src/client/builder/view/view.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Extract viewConfig type from a view component's props.
|
|
8
|
+
*
|
|
9
|
+
* Looks for `viewConfig?: T` prop and extracts T.
|
|
10
|
+
* Returns `unknown` if not found (will be refined by $config).
|
|
11
|
+
*/
|
|
12
|
+
type ExtractViewConfigFromComponent<TComponent> = TComponent extends React.ComponentType<infer P> ? P extends {
|
|
13
|
+
viewConfig?: infer C;
|
|
14
|
+
} ? C : unknown : unknown;
|
|
15
|
+
/**
|
|
16
|
+
* Extract config from lazy component: () => Promise<{ default: Component }>
|
|
17
|
+
*/
|
|
18
|
+
type ExtractViewConfigFromLazy<TComponent> = TComponent extends (() => Promise<{
|
|
19
|
+
default: infer C;
|
|
20
|
+
}>) ? ExtractViewConfigFromComponent<C> : ExtractViewConfigFromComponent<TComponent>;
|
|
21
|
+
/**
|
|
22
|
+
* List view definition
|
|
23
|
+
*/
|
|
24
|
+
interface ListViewDefinition<TName extends string = string, TConfig = unknown> {
|
|
25
|
+
readonly name: TName;
|
|
26
|
+
readonly kind: "list";
|
|
27
|
+
readonly "~config": TConfig;
|
|
28
|
+
readonly component: MaybeLazyComponent;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Edit view definition
|
|
32
|
+
*/
|
|
33
|
+
interface EditViewDefinition<TName extends string = string, TConfig = unknown> {
|
|
34
|
+
readonly name: TName;
|
|
35
|
+
readonly kind: "edit";
|
|
36
|
+
readonly "~config": TConfig;
|
|
37
|
+
readonly component: MaybeLazyComponent;
|
|
38
|
+
}
|
|
39
|
+
interface ListViewBuilderState<TConfig = unknown> {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly kind: "list";
|
|
42
|
+
readonly "~config": TConfig;
|
|
43
|
+
readonly component: MaybeLazyComponent;
|
|
44
|
+
}
|
|
45
|
+
interface EditViewBuilderState<TConfig = unknown> {
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly kind: "edit";
|
|
48
|
+
readonly "~config": TConfig;
|
|
49
|
+
readonly component: MaybeLazyComponent;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* List view builder - implements ListViewDefinition for unified type handling
|
|
53
|
+
*/
|
|
54
|
+
declare class ListViewBuilder<TState extends ListViewBuilderState> implements ListViewDefinition<TState["name"], TState["~config"]> {
|
|
55
|
+
readonly state: TState;
|
|
56
|
+
constructor(state: TState);
|
|
57
|
+
get name(): TState["name"];
|
|
58
|
+
get kind(): "list";
|
|
59
|
+
get "~config"(): TState["~config"];
|
|
60
|
+
get component(): TState["component"];
|
|
61
|
+
/**
|
|
62
|
+
* Set or override config value and type.
|
|
63
|
+
*
|
|
64
|
+
* @param config - Optional config value (for runtime) or omit for type-only override
|
|
65
|
+
*/
|
|
66
|
+
$config<TNewConfig>(config?: TNewConfig): ListViewBuilder<SetProperty<TState, "~config", TNewConfig>>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Edit view builder - implements EditViewDefinition for unified type handling
|
|
70
|
+
*/
|
|
71
|
+
declare class EditViewBuilder<TState extends EditViewBuilderState> implements EditViewDefinition<TState["name"], TState["~config"]> {
|
|
72
|
+
readonly state: TState;
|
|
73
|
+
constructor(state: TState);
|
|
74
|
+
get name(): TState["name"];
|
|
75
|
+
get kind(): "edit";
|
|
76
|
+
get "~config"(): TState["~config"];
|
|
77
|
+
get component(): TState["component"];
|
|
78
|
+
/**
|
|
79
|
+
* Set or override config value and type.
|
|
80
|
+
*
|
|
81
|
+
* @param config - Optional config value (for runtime) or omit for type-only override
|
|
82
|
+
*/
|
|
83
|
+
$config<TNewConfig>(config?: TNewConfig): EditViewBuilder<SetProperty<TState, "~config", TNewConfig>>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create a list view with automatic config type extraction.
|
|
87
|
+
*
|
|
88
|
+
* The config type is extracted from the component's `viewConfig` prop.
|
|
89
|
+
* If extraction fails, use `.$config<MyConfigType>()` to set it manually.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* // Auto-extraction from component props
|
|
94
|
+
* const tableView = listView("table", { component: TableView });
|
|
95
|
+
* // ^? ListViewBuilder<{ ~config: TableViewConfig }>
|
|
96
|
+
*
|
|
97
|
+
* // Manual config type for lazy imports
|
|
98
|
+
* const lazyTable = listView("table", { component: () => import('./TableView') })
|
|
99
|
+
* .$config<TableViewConfig>();
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
declare function listView<TName extends string, TComponent extends MaybeLazyComponent>(name: TName, config: {
|
|
103
|
+
component: TComponent;
|
|
104
|
+
}): ListViewBuilder<{
|
|
105
|
+
name: TName;
|
|
106
|
+
kind: "list";
|
|
107
|
+
"~config": ExtractViewConfigFromLazy<TComponent>;
|
|
108
|
+
component: TComponent;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* Create an edit view with automatic config type extraction.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* const formView = editView("form", { component: FormView });
|
|
116
|
+
* // ^? EditViewBuilder<{ ~config: FormViewRegistryConfig }>
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
declare function editView<TName extends string, TComponent extends MaybeLazyComponent>(name: TName, config: {
|
|
120
|
+
component: TComponent;
|
|
121
|
+
}): EditViewBuilder<{
|
|
122
|
+
name: TName;
|
|
123
|
+
kind: "edit";
|
|
124
|
+
"~config": ExtractViewConfigFromLazy<TComponent>;
|
|
125
|
+
component: TComponent;
|
|
126
|
+
}>;
|
|
127
|
+
//#endregion
|
|
128
|
+
export { EditViewBuilder, EditViewBuilderState, EditViewDefinition, ListViewBuilder, ListViewBuilderState, ListViewDefinition, editView, listView };
|
|
129
|
+
//# sourceMappingURL=view.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.mts","names":[],"sources":["../../../../src/client/builder/view/view.ts"],"sourcesContent":[],"mappings":"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"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
//#region src/client/builder/view/view.ts
|
|
2
|
+
/**
|
|
3
|
+
* List view builder - implements ListViewDefinition for unified type handling
|
|
4
|
+
*/
|
|
5
|
+
var ListViewBuilder = class ListViewBuilder {
|
|
6
|
+
constructor(state) {
|
|
7
|
+
this.state = state;
|
|
8
|
+
}
|
|
9
|
+
get name() {
|
|
10
|
+
return this.state.name;
|
|
11
|
+
}
|
|
12
|
+
get kind() {
|
|
13
|
+
return "list";
|
|
14
|
+
}
|
|
15
|
+
get "~config"() {
|
|
16
|
+
return this.state["~config"];
|
|
17
|
+
}
|
|
18
|
+
get component() {
|
|
19
|
+
return this.state.component;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Set or override config value and type.
|
|
23
|
+
*
|
|
24
|
+
* @param config - Optional config value (for runtime) or omit for type-only override
|
|
25
|
+
*/
|
|
26
|
+
$config(config) {
|
|
27
|
+
return new ListViewBuilder({
|
|
28
|
+
...this.state,
|
|
29
|
+
"~config": config ?? this.state["~config"]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Edit view builder - implements EditViewDefinition for unified type handling
|
|
35
|
+
*/
|
|
36
|
+
var EditViewBuilder = class EditViewBuilder {
|
|
37
|
+
constructor(state) {
|
|
38
|
+
this.state = state;
|
|
39
|
+
}
|
|
40
|
+
get name() {
|
|
41
|
+
return this.state.name;
|
|
42
|
+
}
|
|
43
|
+
get kind() {
|
|
44
|
+
return "edit";
|
|
45
|
+
}
|
|
46
|
+
get "~config"() {
|
|
47
|
+
return this.state["~config"];
|
|
48
|
+
}
|
|
49
|
+
get component() {
|
|
50
|
+
return this.state.component;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Set or override config value and type.
|
|
54
|
+
*
|
|
55
|
+
* @param config - Optional config value (for runtime) or omit for type-only override
|
|
56
|
+
*/
|
|
57
|
+
$config(config) {
|
|
58
|
+
return new EditViewBuilder({
|
|
59
|
+
...this.state,
|
|
60
|
+
"~config": config ?? this.state["~config"]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Create a list view with automatic config type extraction.
|
|
66
|
+
*
|
|
67
|
+
* The config type is extracted from the component's `viewConfig` prop.
|
|
68
|
+
* If extraction fails, use `.$config<MyConfigType>()` to set it manually.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* // Auto-extraction from component props
|
|
73
|
+
* const tableView = listView("table", { component: TableView });
|
|
74
|
+
* // ^? ListViewBuilder<{ ~config: TableViewConfig }>
|
|
75
|
+
*
|
|
76
|
+
* // Manual config type for lazy imports
|
|
77
|
+
* const lazyTable = listView("table", { component: () => import('./TableView') })
|
|
78
|
+
* .$config<TableViewConfig>();
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
function listView(name, config) {
|
|
82
|
+
return new ListViewBuilder({
|
|
83
|
+
name,
|
|
84
|
+
kind: "list",
|
|
85
|
+
"~config": {},
|
|
86
|
+
component: config.component
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Create an edit view with automatic config type extraction.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const formView = editView("form", { component: FormView });
|
|
95
|
+
* // ^? EditViewBuilder<{ ~config: FormViewRegistryConfig }>
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
function editView(name, config) {
|
|
99
|
+
return new EditViewBuilder({
|
|
100
|
+
name,
|
|
101
|
+
kind: "edit",
|
|
102
|
+
"~config": {},
|
|
103
|
+
component: config.component
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
export { EditViewBuilder, ListViewBuilder, editView, listView };
|
|
109
|
+
//# sourceMappingURL=view.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.mjs","names":["state: TState"],"sources":["../../../../src/client/builder/view/view.ts"],"sourcesContent":["/**\n * View Builders (List & Edit)\n *\n * Defines reusable view components for collections.\n */\n\nimport type { SetProperty } from \"questpie/shared\";\nimport type { MaybeLazyComponent } from \"../types/common\";\n\n// ============================================================================\n// Config Extraction Types\n// ============================================================================\n\n/**\n * Extract viewConfig type from a view component's props.\n *\n * Looks for `viewConfig?: T` prop and extracts T.\n * Returns `unknown` if not found (will be refined by $config).\n */\ntype ExtractViewConfigFromComponent<TComponent> =\n TComponent extends React.ComponentType<infer P>\n ? P extends { viewConfig?: infer C }\n ? C\n : unknown\n : unknown;\n\n/**\n * Extract config from lazy component: () => Promise<{ default: Component }>\n */\ntype ExtractViewConfigFromLazy<TComponent> = TComponent extends () => Promise<{\n default: infer C;\n}>\n ? ExtractViewConfigFromComponent<C>\n : ExtractViewConfigFromComponent<TComponent>;\n\n// ============================================================================\n// View Definitions\n// ============================================================================\n\n/**\n * List view definition\n */\nexport interface ListViewDefinition<\n TName extends string = string,\n TConfig = unknown,\n> {\n readonly name: TName;\n readonly kind: \"list\";\n readonly \"~config\": TConfig;\n readonly component: MaybeLazyComponent;\n}\n\n/**\n * Edit view definition\n */\nexport interface EditViewDefinition<\n TName extends string = string,\n TConfig = unknown,\n> {\n readonly name: TName;\n readonly kind: \"edit\";\n readonly \"~config\": TConfig;\n readonly component: MaybeLazyComponent;\n}\n\n// ============================================================================\n// Builder State Types\n// ============================================================================\n\nexport interface ListViewBuilderState<TConfig = unknown> {\n readonly name: string;\n readonly kind: \"list\";\n readonly \"~config\": TConfig;\n readonly component: MaybeLazyComponent;\n}\n\nexport interface EditViewBuilderState<TConfig = unknown> {\n readonly name: string;\n readonly kind: \"edit\";\n readonly \"~config\": TConfig;\n readonly component: MaybeLazyComponent;\n}\n\n// ============================================================================\n// View Builders\n// ============================================================================\n\n/**\n * List view builder - implements ListViewDefinition for unified type handling\n */\nexport class ListViewBuilder<\n TState extends ListViewBuilderState,\n> implements ListViewDefinition<TState[\"name\"], TState[\"~config\"]> {\n constructor(public readonly state: TState) {}\n\n get name(): TState[\"name\"] {\n return this.state.name;\n }\n\n get kind(): \"list\" {\n return \"list\";\n }\n\n get \"~config\"(): TState[\"~config\"] {\n return this.state[\"~config\"];\n }\n\n get component(): TState[\"component\"] {\n return this.state.component;\n }\n\n /**\n * Set or override config value and type.\n *\n * @param config - Optional config value (for runtime) or omit for type-only override\n */\n $config<TNewConfig>(\n config?: TNewConfig,\n ): ListViewBuilder<SetProperty<TState, \"~config\", TNewConfig>> {\n return new ListViewBuilder({\n ...this.state,\n \"~config\": config ?? this.state[\"~config\"],\n } as SetProperty<TState, \"~config\", TNewConfig>);\n }\n}\n\n/**\n * Edit view builder - implements EditViewDefinition for unified type handling\n */\nexport class EditViewBuilder<\n TState extends EditViewBuilderState,\n> implements EditViewDefinition<TState[\"name\"], TState[\"~config\"]> {\n constructor(public readonly state: TState) {}\n\n get name(): TState[\"name\"] {\n return this.state.name;\n }\n\n get kind(): \"edit\" {\n return \"edit\";\n }\n\n get \"~config\"(): TState[\"~config\"] {\n return this.state[\"~config\"];\n }\n\n get component(): TState[\"component\"] {\n return this.state.component;\n }\n\n /**\n * Set or override config value and type.\n *\n * @param config - Optional config value (for runtime) or omit for type-only override\n */\n $config<TNewConfig>(\n config?: TNewConfig,\n ): EditViewBuilder<SetProperty<TState, \"~config\", TNewConfig>> {\n return new EditViewBuilder({\n ...this.state,\n \"~config\": config ?? this.state[\"~config\"],\n } as SetProperty<TState, \"~config\", TNewConfig>);\n }\n}\n\n// ============================================================================\n// Factory Functions\n// ============================================================================\n\n/**\n * Create a list view with automatic config type extraction.\n *\n * The config type is extracted from the component's `viewConfig` prop.\n * If extraction fails, use `.$config<MyConfigType>()` to set it manually.\n *\n * @example\n * ```ts\n * // Auto-extraction from component props\n * const tableView = listView(\"table\", { component: TableView });\n * // ^? ListViewBuilder<{ ~config: TableViewConfig }>\n *\n * // Manual config type for lazy imports\n * const lazyTable = listView(\"table\", { component: () => import('./TableView') })\n * .$config<TableViewConfig>();\n * ```\n */\nexport function listView<\n TName extends string,\n TComponent extends MaybeLazyComponent,\n>(\n name: TName,\n config: { component: TComponent },\n): ListViewBuilder<{\n name: TName;\n kind: \"list\";\n \"~config\": ExtractViewConfigFromLazy<TComponent>;\n component: TComponent;\n}> {\n return new ListViewBuilder({\n name,\n kind: \"list\",\n \"~config\": {} as ExtractViewConfigFromLazy<TComponent>,\n component: config.component,\n });\n}\n\n/**\n * Create an edit view with automatic config type extraction.\n *\n * @example\n * ```ts\n * const formView = editView(\"form\", { component: FormView });\n * // ^? EditViewBuilder<{ ~config: FormViewRegistryConfig }>\n * ```\n */\nexport function editView<\n TName extends string,\n TComponent extends MaybeLazyComponent,\n>(\n name: TName,\n config: { component: TComponent },\n): EditViewBuilder<{\n name: TName;\n kind: \"edit\";\n \"~config\": ExtractViewConfigFromLazy<TComponent>;\n component: TComponent;\n}> {\n return new EditViewBuilder({\n name,\n kind: \"edit\",\n \"~config\": {} as ExtractViewConfigFromLazy<TComponent>,\n component: config.component,\n });\n}\n"],"mappings":";;;;AA0FA,IAAa,kBAAb,MAAa,gBAEsD;CACjE,YAAY,AAAgBA,OAAe;EAAf;;CAE5B,IAAI,OAAuB;AACzB,SAAO,KAAK,MAAM;;CAGpB,IAAI,OAAe;AACjB,SAAO;;CAGT,IAAI,YAA+B;AACjC,SAAO,KAAK,MAAM;;CAGpB,IAAI,YAAiC;AACnC,SAAO,KAAK,MAAM;;;;;;;CAQpB,QACE,QAC6D;AAC7D,SAAO,IAAI,gBAAgB;GACzB,GAAG,KAAK;GACR,WAAW,UAAU,KAAK,MAAM;GACjC,CAA+C;;;;;;AAOpD,IAAa,kBAAb,MAAa,gBAEsD;CACjE,YAAY,AAAgBA,OAAe;EAAf;;CAE5B,IAAI,OAAuB;AACzB,SAAO,KAAK,MAAM;;CAGpB,IAAI,OAAe;AACjB,SAAO;;CAGT,IAAI,YAA+B;AACjC,SAAO,KAAK,MAAM;;CAGpB,IAAI,YAAiC;AACnC,SAAO,KAAK,MAAM;;;;;;;CAQpB,QACE,QAC6D;AAC7D,SAAO,IAAI,gBAAgB;GACzB,GAAG,KAAK;GACR,WAAW,UAAU,KAAK,MAAM;GACjC,CAA+C;;;;;;;;;;;;;;;;;;;;AAyBpD,SAAgB,SAId,MACA,QAMC;AACD,QAAO,IAAI,gBAAgB;EACzB;EACA,MAAM;EACN,WAAW,EAAE;EACb,WAAW,OAAO;EACnB,CAAC;;;;;;;;;;;AAYJ,SAAgB,SAId,MACA,QAMC;AACD,QAAO,IAAI,gBAAgB;EACzB;EACA,MAAM;EACN,WAAW,EAAE;EACb,WAAW,OAAO;EACnB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MaybeLazyComponent } from "../types/common.mjs";
|
|
2
|
+
import { SetProperty } from "questpie/shared";
|
|
3
|
+
|
|
4
|
+
//#region src/client/builder/widget/widget.d.ts
|
|
5
|
+
|
|
6
|
+
interface WidgetDefinition<TName extends string = string, TConfig = any> {
|
|
7
|
+
readonly name: TName;
|
|
8
|
+
readonly component: any;
|
|
9
|
+
readonly "~config"?: TConfig;
|
|
10
|
+
}
|
|
11
|
+
interface WidgetBuilderState {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly "~config": any;
|
|
14
|
+
readonly component: any;
|
|
15
|
+
}
|
|
16
|
+
declare class WidgetBuilder<TState extends WidgetBuilderState> {
|
|
17
|
+
readonly state: TState;
|
|
18
|
+
constructor(state: TState);
|
|
19
|
+
$config<TNewConfig>(config: TNewConfig): WidgetBuilder<SetProperty<TState, "~config", TNewConfig>>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create a dashboard widget
|
|
23
|
+
*/
|
|
24
|
+
declare function widget<TName extends string, TComponent extends MaybeLazyComponent>(name: TName, config: {
|
|
25
|
+
component: TComponent;
|
|
26
|
+
}): WidgetBuilder<{
|
|
27
|
+
name: TName;
|
|
28
|
+
"~config": any;
|
|
29
|
+
component: TComponent;
|
|
30
|
+
}>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { WidgetBuilder, WidgetBuilderState, WidgetDefinition, widget };
|
|
33
|
+
//# sourceMappingURL=widget.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.d.mts","names":[],"sources":["../../../../src/client/builder/widget/widget.ts"],"sourcesContent":[],"mappings":";;;;;AAwB0C,UAfzB,gBAeyB,CAAA,cAAA,MAAA,GAAA,MAAA,EAAA,UAAA,GAAA,CAAA,CAAA;EACL,SAAA,IAAA,EAZpB,KAYoB;EAAA,SAAA,SAAA,EAAA,GAAA;EAGzB,SAAA,SAAA,CAAA,EAbW,OAaX;;AACsC,UAXjC,kBAAA,CAWiC;EAA/B,SAAA,IAAA,EAAA,MAAA;EAAd,SAAA,SAAA,EAAA,GAAA;EAAa,SAAA,SAAA,EAAA,GAAA;AAWlB;AAEqB,cAlBR,aAkBQ,CAAA,eAlBqB,kBAkBrB,CAAA,CAAA;EAEb,SAAA,KAAA,EAnB6B,MAmB7B;EACe,WAAA,CAAA,KAAA,EApBc,MAoBd;EAEf,OAAA,CAAA,UAAA,CAAA,CAAA,MAAA,EAnBI,UAmBJ,CAAA,EAlBH,aAkBG,CAlBW,WAkBX,CAlBuB,MAkBvB,EAAA,SAAA,EAlB0C,UAkB1C,CAAA,CAAA;;;;;iBAPQ,gDAEK,0BAEb;aACe;IACpB;QACK;;aAEK"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/client/builder/widget/widget.ts
|
|
2
|
+
var WidgetBuilder = class WidgetBuilder {
|
|
3
|
+
constructor(state) {
|
|
4
|
+
this.state = state;
|
|
5
|
+
}
|
|
6
|
+
$config(config) {
|
|
7
|
+
return new WidgetBuilder({
|
|
8
|
+
...this.state,
|
|
9
|
+
"~config": config
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Create a dashboard widget
|
|
15
|
+
*/
|
|
16
|
+
function widget(name, config) {
|
|
17
|
+
return new WidgetBuilder({
|
|
18
|
+
name,
|
|
19
|
+
"~config": {},
|
|
20
|
+
component: config.component
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { WidgetBuilder, widget };
|
|
26
|
+
//# sourceMappingURL=widget.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.mjs","names":["state: TState"],"sources":["../../../../src/client/builder/widget/widget.ts"],"sourcesContent":["/**\n * Widget Builder\n *\n * Defines dashboard widgets.\n */\n\nimport type { SetProperty } from \"questpie/shared\";\nimport type { MaybeLazyComponent } from \"../types/common\";\n\nexport interface WidgetDefinition<\n TName extends string = string,\n TConfig = any,\n> {\n readonly name: TName;\n readonly component: any;\n readonly \"~config\"?: TConfig;\n}\n\nexport interface WidgetBuilderState {\n readonly name: string;\n readonly \"~config\": any;\n readonly component: any;\n}\n\nexport class WidgetBuilder<TState extends WidgetBuilderState> {\n constructor(public readonly state: TState) {}\n\n $config<TNewConfig>(\n config: TNewConfig,\n ): WidgetBuilder<SetProperty<TState, \"~config\", TNewConfig>> {\n return new WidgetBuilder({\n ...this.state,\n \"~config\": config,\n } as any);\n }\n}\n\n/**\n * Create a dashboard widget\n */\nexport function widget<\n TName extends string,\n TComponent extends MaybeLazyComponent,\n>(\n name: TName,\n config: { component: TComponent },\n): WidgetBuilder<{\n name: TName;\n \"~config\": any;\n component: TComponent;\n}> {\n return new WidgetBuilder({\n name,\n \"~config\": {},\n component: config.component,\n } as any);\n}\n"],"mappings":";AAwBA,IAAa,gBAAb,MAAa,cAAiD;CAC5D,YAAY,AAAgBA,OAAe;EAAf;;CAE5B,QACE,QAC2D;AAC3D,SAAO,IAAI,cAAc;GACvB,GAAG,KAAK;GACR,WAAW;GACZ,CAAQ;;;;;;AAOb,SAAgB,OAId,MACA,QAKC;AACD,QAAO,IAAI,cAAc;EACvB;EACA,WAAW,EAAE;EACb,WAAW,OAAO;EACnB,CAAQ"}
|