@questpie/admin 1.1.1 → 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-D1DqawtP.d.mts +0 -13403
- package/dist/client-D1DqawtP.d.mts.map +0 -1
- package/dist/client-njX1rZmi.mjs +0 -22612
- package/dist/client-njX1rZmi.mjs.map +0 -1
- package/dist/content-locales-provider-BXvuIgfg.mjs +0 -1650
- package/dist/content-locales-provider-BXvuIgfg.mjs.map +0 -1
- package/dist/dashboard-page-B4PGEdc2.mjs +0 -2500
- package/dist/dashboard-page-B4PGEdc2.mjs.map +0 -1
- package/dist/dashboard-page-mCY0pgZv.mjs +0 -3
- package/dist/dropzone-Do3awXKd.mjs +0 -634
- package/dist/dropzone-Do3awXKd.mjs.map +0 -1
- package/dist/forgot-password-page-Bcp-An4Y.mjs.map +0 -1
- package/dist/forgot-password-page-CEwsdLwn.mjs +0 -3
- package/dist/index-B4H3amCD.d.mts +0 -2753
- package/dist/index-B4H3amCD.d.mts.map +0 -1
- package/dist/login-page-BUnpCbCa.mjs +0 -3
- package/dist/login-page-CP4gA-dl.mjs +0 -298
- package/dist/login-page-CP4gA-dl.mjs.map +0 -1
- package/dist/preview-utils-BKQ9-TMa.mjs.map +0 -1
- package/dist/reset-password-page-BqfDmLxA.mjs +0 -281
- package/dist/reset-password-page-BqfDmLxA.mjs.map +0 -1
- package/dist/reset-password-page-CufHz3h3.mjs +0 -3
- package/dist/runtime-6VZM878K.mjs.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,178 @@
|
|
|
1
|
+
import { selectAdmin, useAdminStore } from "../../runtime/provider.mjs";
|
|
2
|
+
import { WidgetErrorBoundary } from "../../components/error-boundary.mjs";
|
|
3
|
+
import { WidgetCard } from "./widget-card.mjs";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/client/views/dashboard/dashboard-widget.tsx
|
|
8
|
+
/**
|
|
9
|
+
* DashboardWidget Component
|
|
10
|
+
*
|
|
11
|
+
* Renders individual dashboard widgets based on their type configuration.
|
|
12
|
+
* Resolves widgets from the registry (built-in + custom).
|
|
13
|
+
*/
|
|
14
|
+
function UnknownWidget({ type }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(WidgetCard, {
|
|
16
|
+
title: "Unknown Widget",
|
|
17
|
+
className: "border-warning/20 bg-warning/5",
|
|
18
|
+
children: /* @__PURE__ */ jsxs("p", {
|
|
19
|
+
className: "text-xs text-muted-foreground",
|
|
20
|
+
children: [
|
|
21
|
+
"Widget type \"",
|
|
22
|
+
type,
|
|
23
|
+
"\" is not recognized."
|
|
24
|
+
]
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function RegistryWidgetRenderer({ loader, widgetConfig, basePath, navigate }) {
|
|
29
|
+
const [state, setState] = React$1.useState({
|
|
30
|
+
Component: null,
|
|
31
|
+
loading: true,
|
|
32
|
+
error: null
|
|
33
|
+
});
|
|
34
|
+
React$1.useEffect(() => {
|
|
35
|
+
if (!loader) {
|
|
36
|
+
setState({
|
|
37
|
+
Component: null,
|
|
38
|
+
loading: false,
|
|
39
|
+
error: null
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (!(typeof loader === "function" && !loader.prototype?.render && !loader.prototype?.isReactComponent && loader.length === 0)) {
|
|
44
|
+
setState({
|
|
45
|
+
Component: loader,
|
|
46
|
+
loading: false,
|
|
47
|
+
error: null
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
let mounted = true;
|
|
52
|
+
(async () => {
|
|
53
|
+
try {
|
|
54
|
+
const result = await loader();
|
|
55
|
+
if (mounted) setState({
|
|
56
|
+
Component: result.default || result,
|
|
57
|
+
loading: false,
|
|
58
|
+
error: null
|
|
59
|
+
});
|
|
60
|
+
} catch (err) {
|
|
61
|
+
if (mounted) setState({
|
|
62
|
+
Component: null,
|
|
63
|
+
loading: false,
|
|
64
|
+
error: err instanceof Error ? err : /* @__PURE__ */ new Error("Failed to load component")
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
})();
|
|
68
|
+
return () => {
|
|
69
|
+
mounted = false;
|
|
70
|
+
};
|
|
71
|
+
}, [loader]);
|
|
72
|
+
if (state.loading) return /* @__PURE__ */ jsx(WidgetCard, { isLoading: true });
|
|
73
|
+
if (state.error) return /* @__PURE__ */ jsx(WidgetCard, { error: state.error });
|
|
74
|
+
if (!state.Component) return /* @__PURE__ */ jsx(WidgetCard, { error: /* @__PURE__ */ new Error("Component not found") });
|
|
75
|
+
const Component = state.Component;
|
|
76
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
77
|
+
config: widgetConfig,
|
|
78
|
+
basePath,
|
|
79
|
+
navigate,
|
|
80
|
+
span: widgetConfig.span
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function CustomWidgetRenderer({ loader, widgetConfig, span }) {
|
|
84
|
+
const [state, setState] = React$1.useState({
|
|
85
|
+
Component: null,
|
|
86
|
+
loading: true,
|
|
87
|
+
error: null
|
|
88
|
+
});
|
|
89
|
+
React$1.useEffect(() => {
|
|
90
|
+
if (!loader) {
|
|
91
|
+
setState({
|
|
92
|
+
Component: null,
|
|
93
|
+
loading: false,
|
|
94
|
+
error: null
|
|
95
|
+
});
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (!(typeof loader === "function" && !loader.prototype?.render && !loader.prototype?.isReactComponent && loader.length === 0)) {
|
|
99
|
+
setState({
|
|
100
|
+
Component: loader,
|
|
101
|
+
loading: false,
|
|
102
|
+
error: null
|
|
103
|
+
});
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
let mounted = true;
|
|
107
|
+
(async () => {
|
|
108
|
+
try {
|
|
109
|
+
const result = await loader();
|
|
110
|
+
if (mounted) setState({
|
|
111
|
+
Component: result.default || result,
|
|
112
|
+
loading: false,
|
|
113
|
+
error: null
|
|
114
|
+
});
|
|
115
|
+
} catch (err) {
|
|
116
|
+
if (mounted) setState({
|
|
117
|
+
Component: null,
|
|
118
|
+
loading: false,
|
|
119
|
+
error: err instanceof Error ? err : /* @__PURE__ */ new Error("Failed to load component")
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
})();
|
|
123
|
+
return () => {
|
|
124
|
+
mounted = false;
|
|
125
|
+
};
|
|
126
|
+
}, [loader]);
|
|
127
|
+
if (state.loading) return /* @__PURE__ */ jsx(WidgetCard, { isLoading: true });
|
|
128
|
+
if (state.error) return /* @__PURE__ */ jsx(WidgetCard, { error: state.error });
|
|
129
|
+
if (!state.Component) return /* @__PURE__ */ jsx(WidgetCard, { error: /* @__PURE__ */ new Error("Component not found") });
|
|
130
|
+
const Component = state.Component;
|
|
131
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
132
|
+
config: widgetConfig,
|
|
133
|
+
span
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* DashboardWidget - Renders a single widget based on its configuration.
|
|
138
|
+
*
|
|
139
|
+
* Resolves widgets from the admin store's widget registry (populated by
|
|
140
|
+
* coreAdminModule and user extensions). Falls back to widgetRegistry prop
|
|
141
|
+
* for overrides.
|
|
142
|
+
*/
|
|
143
|
+
function DashboardWidget({ config, basePath = "/admin", navigate, widgetRegistry }) {
|
|
144
|
+
const registeredWidgets = useAdminStore(selectAdmin).getWidgets();
|
|
145
|
+
const renderWidget = () => {
|
|
146
|
+
if (config.type === "custom") return /* @__PURE__ */ jsx(CustomWidgetRenderer, {
|
|
147
|
+
loader: config.component,
|
|
148
|
+
widgetConfig: config.config || {},
|
|
149
|
+
span: config.span
|
|
150
|
+
});
|
|
151
|
+
if (widgetRegistry?.[config.type]) {
|
|
152
|
+
const CustomWidget = widgetRegistry[config.type];
|
|
153
|
+
return /* @__PURE__ */ jsx(CustomWidget, {
|
|
154
|
+
config,
|
|
155
|
+
span: config.span
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const widgetDef = registeredWidgets[config.type];
|
|
159
|
+
if (widgetDef) {
|
|
160
|
+
const component = widgetDef.component ?? widgetDef.state?.component;
|
|
161
|
+
if (component) return /* @__PURE__ */ jsx(RegistryWidgetRenderer, {
|
|
162
|
+
loader: component,
|
|
163
|
+
widgetConfig: config,
|
|
164
|
+
basePath,
|
|
165
|
+
navigate
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
return /* @__PURE__ */ jsx(UnknownWidget, { type: config.type });
|
|
169
|
+
};
|
|
170
|
+
return /* @__PURE__ */ jsx(WidgetErrorBoundary, {
|
|
171
|
+
widgetType: config.type,
|
|
172
|
+
children: renderWidget()
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
//#endregion
|
|
177
|
+
export { DashboardWidget };
|
|
178
|
+
//# sourceMappingURL=dashboard-widget.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-widget.mjs","names":["React"],"sources":["../../../../src/client/views/dashboard/dashboard-widget.tsx"],"sourcesContent":["/**\n * DashboardWidget Component\n *\n * Renders individual dashboard widgets based on their type configuration.\n * Resolves widgets from the registry (built-in + custom).\n */\n\nimport * as React from \"react\";\nimport type { AnyWidgetConfig, WidgetComponentProps } from \"../../builder\";\nimport { WidgetErrorBoundary } from \"../../components/error-boundary\";\nimport { selectAdmin, useAdminStore } from \"../../runtime\";\nimport { WidgetCard } from \"./widget-card\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface DashboardWidgetProps {\n\t/**\n\t * Widget configuration\n\t */\n\tconfig: AnyWidgetConfig;\n\n\t/**\n\t * Base path for navigation links\n\t */\n\tbasePath?: string;\n\n\t/**\n\t * Navigate function for item clicks\n\t */\n\tnavigate?: (path: string) => void;\n\n\t/**\n\t * Custom widget registry for overrides\n\t */\n\twidgetRegistry?: Record<string, React.ComponentType<WidgetComponentProps>>;\n}\n\n// ============================================================================\n// Loading & Error States\n// ============================================================================\n\nfunction UnknownWidget({ type }: { type: string }) {\n\treturn (\n\t\t<WidgetCard\n\t\t\ttitle=\"Unknown Widget\"\n\t\t\tclassName=\"border-warning/20 bg-warning/5\"\n\t\t>\n\t\t\t<p className=\"text-xs text-muted-foreground\">\n\t\t\t\tWidget type \"{type}\" is not recognized.\n\t\t\t</p>\n\t\t</WidgetCard>\n\t);\n}\n\n// ============================================================================\n// Widget Renderer (handles lazy loading from registry)\n// ============================================================================\n\ninterface RegistryWidgetRendererProps {\n\tloader: any;\n\twidgetConfig: AnyWidgetConfig;\n\tbasePath: string;\n\tnavigate?: (path: string) => void;\n}\n\nfunction RegistryWidgetRenderer({\n\tloader,\n\twidgetConfig,\n\tbasePath,\n\tnavigate,\n}: RegistryWidgetRendererProps) {\n\tconst [state, setState] = React.useState<{\n\t\tComponent: React.ComponentType<any> | null;\n\t\tloading: boolean;\n\t\terror: Error | null;\n\t}>({\n\t\tComponent: null,\n\t\tloading: true,\n\t\terror: null,\n\t});\n\n\tReact.useEffect(() => {\n\t\tif (!loader) {\n\t\t\tsetState({ Component: null, loading: false, error: null });\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if it's already a component (not a lazy loader function)\n\t\tconst isLazyLoader =\n\t\t\ttypeof loader === \"function\" &&\n\t\t\t!loader.prototype?.render &&\n\t\t\t!loader.prototype?.isReactComponent &&\n\t\t\tloader.length === 0;\n\n\t\tif (!isLazyLoader) {\n\t\t\tsetState({ Component: loader, loading: false, error: null });\n\t\t\treturn;\n\t\t}\n\n\t\t// Load lazy component\n\t\tlet mounted = true;\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tconst result = await loader();\n\t\t\t\tif (mounted) {\n\t\t\t\t\tconst Component = result.default || result;\n\t\t\t\t\tsetState({ Component, loading: false, error: null });\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tif (mounted) {\n\t\t\t\t\tsetState({\n\t\t\t\t\t\tComponent: null,\n\t\t\t\t\t\tloading: false,\n\t\t\t\t\t\terror:\n\t\t\t\t\t\t\terr instanceof Error\n\t\t\t\t\t\t\t\t? err\n\t\t\t\t\t\t\t\t: new Error(\"Failed to load component\"),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\n\t\treturn () => {\n\t\t\tmounted = false;\n\t\t};\n\t}, [loader]);\n\n\tif (state.loading) {\n\t\treturn <WidgetCard isLoading />;\n\t}\n\n\tif (state.error) {\n\t\treturn <WidgetCard error={state.error} />;\n\t}\n\n\tif (!state.Component) {\n\t\treturn <WidgetCard error={new Error(\"Component not found\")} />;\n\t}\n\n\tconst Component = state.Component;\n\treturn (\n\t\t<Component\n\t\t\tconfig={widgetConfig}\n\t\t\tbasePath={basePath}\n\t\t\tnavigate={navigate}\n\t\t\tspan={widgetConfig.span}\n\t\t/>\n\t);\n}\n\n// ============================================================================\n// Custom Widget Renderer (for type=\"custom\" with inline component)\n// ============================================================================\n\ninterface CustomWidgetRendererProps {\n\tloader: any;\n\twidgetConfig: Record<string, any>;\n\tspan?: number;\n}\n\nfunction CustomWidgetRenderer({\n\tloader,\n\twidgetConfig,\n\tspan,\n}: CustomWidgetRendererProps) {\n\tconst [state, setState] = React.useState<{\n\t\tComponent: React.ComponentType<WidgetComponentProps> | null;\n\t\tloading: boolean;\n\t\terror: Error | null;\n\t}>({\n\t\tComponent: null,\n\t\tloading: true,\n\t\terror: null,\n\t});\n\n\tReact.useEffect(() => {\n\t\tif (!loader) {\n\t\t\tsetState({ Component: null, loading: false, error: null });\n\t\t\treturn;\n\t\t}\n\n\t\tconst isLazyLoader =\n\t\t\ttypeof loader === \"function\" &&\n\t\t\t!loader.prototype?.render &&\n\t\t\t!loader.prototype?.isReactComponent &&\n\t\t\tloader.length === 0;\n\n\t\tif (!isLazyLoader) {\n\t\t\tsetState({ Component: loader, loading: false, error: null });\n\t\t\treturn;\n\t\t}\n\n\t\tlet mounted = true;\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tconst result = await loader();\n\t\t\t\tif (mounted) {\n\t\t\t\t\tconst Component = result.default || result;\n\t\t\t\t\tsetState({ Component, loading: false, error: null });\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tif (mounted) {\n\t\t\t\t\tsetState({\n\t\t\t\t\t\tComponent: null,\n\t\t\t\t\t\tloading: false,\n\t\t\t\t\t\terror:\n\t\t\t\t\t\t\terr instanceof Error\n\t\t\t\t\t\t\t\t? err\n\t\t\t\t\t\t\t\t: new Error(\"Failed to load component\"),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\n\t\treturn () => {\n\t\t\tmounted = false;\n\t\t};\n\t}, [loader]);\n\n\tif (state.loading) {\n\t\treturn <WidgetCard isLoading />;\n\t}\n\n\tif (state.error) {\n\t\treturn <WidgetCard error={state.error} />;\n\t}\n\n\tif (!state.Component) {\n\t\treturn <WidgetCard error={new Error(\"Component not found\")} />;\n\t}\n\n\tconst Component = state.Component;\n\treturn <Component config={widgetConfig} span={span} />;\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\n/**\n * DashboardWidget - Renders a single widget based on its configuration.\n *\n * Resolves widgets from the admin store's widget registry (populated by\n * coreAdminModule and user extensions). Falls back to widgetRegistry prop\n * for overrides.\n */\nexport function DashboardWidget({\n\tconfig,\n\tbasePath = \"/admin\",\n\tnavigate,\n\twidgetRegistry,\n}: DashboardWidgetProps): React.ReactElement {\n\tconst admin = useAdminStore(selectAdmin);\n\tconst registeredWidgets = admin.getWidgets() as Record<string, any>;\n\n\tconst renderWidget = (): React.ReactElement => {\n\t\t// Handle custom widget type (inline component, not from registry)\n\t\tif (config.type === \"custom\") {\n\t\t\treturn (\n\t\t\t\t<CustomWidgetRenderer\n\t\t\t\t\tloader={config.component}\n\t\t\t\t\twidgetConfig={config.config || {}}\n\t\t\t\t\tspan={config.span}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\t// Check prop-based registry for overrides first\n\t\tif (widgetRegistry?.[config.type]) {\n\t\t\tconst CustomWidget = widgetRegistry[config.type];\n\t\t\treturn <CustomWidget config={config as any} span={config.span} />;\n\t\t}\n\n\t\t// Look up widget in the admin store registry (built-in + user-registered)\n\t\tconst widgetDef = registeredWidgets[config.type];\n\t\tif (widgetDef) {\n\t\t\tconst component = widgetDef.component ?? widgetDef.state?.component;\n\t\t\tif (component) {\n\t\t\t\treturn (\n\t\t\t\t\t<RegistryWidgetRenderer\n\t\t\t\t\t\tloader={component}\n\t\t\t\t\t\twidgetConfig={config}\n\t\t\t\t\t\tbasePath={basePath}\n\t\t\t\t\t\tnavigate={navigate}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn <UnknownWidget type={config.type} />;\n\t};\n\n\treturn (\n\t\t<WidgetErrorBoundary widgetType={config.type}>\n\t\t\t{renderWidget()}\n\t\t</WidgetErrorBoundary>\n\t);\n}\n\nexport default DashboardWidget;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.mjs";
|
|
2
|
+
import { resolveIconElement } from "../../components/component-renderer.mjs";
|
|
3
|
+
import { Button } from "../../components/ui/button.mjs";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../components/ui/dropdown-menu.mjs";
|
|
5
|
+
import { Skeleton } from "../../components/ui/skeleton.mjs";
|
|
6
|
+
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/ui/card.mjs";
|
|
7
|
+
import { Icon } from "@iconify/react";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
//#region src/client/views/dashboard/widget-card.tsx
|
|
11
|
+
/**
|
|
12
|
+
* WidgetCard Component
|
|
13
|
+
*
|
|
14
|
+
* Standardized card wrapper for dashboard widgets with multiple variants.
|
|
15
|
+
* Provides consistent styling, header actions, and loading/error states.
|
|
16
|
+
*/
|
|
17
|
+
const variantStyles = {
|
|
18
|
+
default: "",
|
|
19
|
+
compact: "py-3 gap-3",
|
|
20
|
+
featured: "border-primary/30 bg-gradient-to-br from-primary/5 to-transparent shadow-sm"
|
|
21
|
+
};
|
|
22
|
+
const variantContentStyles = {
|
|
23
|
+
default: "",
|
|
24
|
+
compact: "pt-0",
|
|
25
|
+
featured: ""
|
|
26
|
+
};
|
|
27
|
+
function WidgetCardLoading({ variant = "default" }) {
|
|
28
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
29
|
+
className: cn("h-full flex flex-col", variantStyles[variant]),
|
|
30
|
+
children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }) }), /* @__PURE__ */ jsx(CardContent, {
|
|
31
|
+
className: cn("flex-1", variantContentStyles[variant]),
|
|
32
|
+
children: /* @__PURE__ */ jsx(Skeleton, { className: "h-20 w-full" })
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function WidgetCardError({ error, variant = "default", onRetry }) {
|
|
37
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
38
|
+
className: cn("h-full flex flex-col border-destructive/20 bg-destructive/5", variantStyles[variant]),
|
|
39
|
+
children: [/* @__PURE__ */ jsxs(CardHeader, { children: [/* @__PURE__ */ jsx(CardTitle, {
|
|
40
|
+
className: "text-sm font-medium text-destructive",
|
|
41
|
+
children: "Error"
|
|
42
|
+
}), onRetry && /* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsx(Button, {
|
|
43
|
+
variant: "ghost",
|
|
44
|
+
size: "icon-xs",
|
|
45
|
+
onClick: onRetry,
|
|
46
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
47
|
+
icon: "ph:arrow-clockwise",
|
|
48
|
+
className: "h-3.5 w-3.5"
|
|
49
|
+
})
|
|
50
|
+
}) })] }), /* @__PURE__ */ jsx(CardContent, {
|
|
51
|
+
className: cn("flex-1", variantContentStyles[variant]),
|
|
52
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
53
|
+
className: "text-xs text-muted-foreground",
|
|
54
|
+
children: error.message
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* WidgetCard - Standardized card wrapper for dashboard widgets
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <WidgetCard
|
|
65
|
+
* title="Revenue"
|
|
66
|
+
* description="Monthly sales total"
|
|
67
|
+
* variant="featured"
|
|
68
|
+
* onRefresh={() => refetch()}
|
|
69
|
+
* >
|
|
70
|
+
* <div className="text-2xl font-bold">$12,345</div>
|
|
71
|
+
* </WidgetCard>
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
function WidgetCard({ title, description, icon, variant = "default", isLoading, isRefreshing, error, onRefresh, onExpand, actions, className, loadingSkeleton, children }) {
|
|
75
|
+
if (isLoading) {
|
|
76
|
+
if (loadingSkeleton) return /* @__PURE__ */ jsxs(Card, {
|
|
77
|
+
className: cn("h-full flex flex-col", variantStyles[variant], className),
|
|
78
|
+
children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }) }), /* @__PURE__ */ jsx(CardContent, {
|
|
79
|
+
className: cn("flex-1", variantContentStyles[variant]),
|
|
80
|
+
children: loadingSkeleton
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
83
|
+
return /* @__PURE__ */ jsx(WidgetCardLoading, { variant });
|
|
84
|
+
}
|
|
85
|
+
if (error) return /* @__PURE__ */ jsx(WidgetCardError, {
|
|
86
|
+
error,
|
|
87
|
+
variant,
|
|
88
|
+
onRetry: onRefresh
|
|
89
|
+
});
|
|
90
|
+
const hasHeader = title || description || icon || onRefresh || onExpand || actions?.length;
|
|
91
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
92
|
+
className: cn("h-full flex flex-col", variantStyles[variant], className),
|
|
93
|
+
children: [hasHeader && /* @__PURE__ */ jsxs(CardHeader, { children: [/* @__PURE__ */ jsxs("div", {
|
|
94
|
+
className: "flex items-center gap-2",
|
|
95
|
+
children: [resolveIconElement(icon, { className: "h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ jsxs("div", {
|
|
96
|
+
className: "flex-1 min-w-0",
|
|
97
|
+
children: [title && /* @__PURE__ */ jsx(CardTitle, {
|
|
98
|
+
className: "text-sm font-medium truncate",
|
|
99
|
+
children: title
|
|
100
|
+
}), description && /* @__PURE__ */ jsx(CardDescription, {
|
|
101
|
+
className: "truncate",
|
|
102
|
+
children: description
|
|
103
|
+
})]
|
|
104
|
+
})]
|
|
105
|
+
}), (onRefresh || onExpand || actions?.length) && /* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsxs("div", {
|
|
106
|
+
className: "flex items-center gap-1",
|
|
107
|
+
children: [
|
|
108
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
109
|
+
variant: "ghost",
|
|
110
|
+
size: "icon-xs",
|
|
111
|
+
onClick: actions[0].onClick,
|
|
112
|
+
title: actions[0].label,
|
|
113
|
+
children: resolveIconElement(actions[0].icon, { className: "h-3.5 w-3.5" })
|
|
114
|
+
}, actions[0].id), actions.length > 1 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx(Button, {
|
|
115
|
+
variant: "ghost",
|
|
116
|
+
size: "icon-xs",
|
|
117
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
118
|
+
icon: "ph:dots-three-vertical",
|
|
119
|
+
className: "h-3.5 w-3.5"
|
|
120
|
+
})
|
|
121
|
+
}) }), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
122
|
+
align: "end",
|
|
123
|
+
children: actions.slice(1).map((action) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
124
|
+
onClick: action.onClick,
|
|
125
|
+
children: [resolveIconElement(action.icon, { className: "h-3.5 w-3.5 mr-2" }), action.label]
|
|
126
|
+
}, action.id))
|
|
127
|
+
})] })] }),
|
|
128
|
+
onRefresh && /* @__PURE__ */ jsx(Button, {
|
|
129
|
+
variant: "ghost",
|
|
130
|
+
size: "icon-xs",
|
|
131
|
+
onClick: onRefresh,
|
|
132
|
+
title: "Refresh",
|
|
133
|
+
disabled: isRefreshing,
|
|
134
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
135
|
+
icon: "ph:arrow-clockwise",
|
|
136
|
+
className: cn("h-3.5 w-3.5", isRefreshing && "animate-spin")
|
|
137
|
+
})
|
|
138
|
+
}),
|
|
139
|
+
onExpand && /* @__PURE__ */ jsx(Button, {
|
|
140
|
+
variant: "ghost",
|
|
141
|
+
size: "icon-xs",
|
|
142
|
+
onClick: onExpand,
|
|
143
|
+
title: "Expand",
|
|
144
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
145
|
+
icon: "ph:arrows-out-simple",
|
|
146
|
+
className: "h-3.5 w-3.5"
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
}) })] }), /* @__PURE__ */ jsx(CardContent, {
|
|
151
|
+
className: cn("flex-1", variantContentStyles[variant], !hasHeader && "pt-0"),
|
|
152
|
+
children
|
|
153
|
+
})]
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
//#endregion
|
|
158
|
+
export { WidgetCard };
|
|
159
|
+
//# sourceMappingURL=widget-card.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-card.mjs","names":["variantStyles: Record<WidgetCardVariant, string>","variantContentStyles: Record<WidgetCardVariant, string>"],"sources":["../../../../src/client/views/dashboard/widget-card.tsx"],"sourcesContent":["/**\n * WidgetCard Component\n *\n * Standardized card wrapper for dashboard widgets with multiple variants.\n * Provides consistent styling, header actions, and loading/error states.\n */\n\nimport { Icon } from \"@iconify/react\";\nimport type * as React from \"react\";\nimport type { WidgetAction, WidgetCardVariant } from \"../../builder\";\nimport { resolveIconElement } from \"../../components/component-renderer\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n\tCard,\n\tCardAction,\n\tCardContent,\n\tCardDescription,\n\tCardHeader,\n\tCardTitle,\n} from \"../../components/ui/card\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuTrigger,\n} from \"../../components/ui/dropdown-menu\";\nimport { Skeleton } from \"../../components/ui/skeleton\";\nimport { cn } from \"../../lib/utils\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface WidgetCardProps {\n\t/** Widget title */\n\ttitle?: string;\n\t/** Widget description */\n\tdescription?: string;\n\t/** Widget icon */\n\ticon?: WidgetAction[\"icon\"];\n\t/** Card visual variant */\n\tvariant?: WidgetCardVariant;\n\t/** Loading state (initial load) */\n\tisLoading?: boolean;\n\t/** Refreshing state (background refetch) */\n\tisRefreshing?: boolean;\n\t/** Error state */\n\terror?: Error | null;\n\t/** Refresh handler */\n\tonRefresh?: () => void;\n\t/** Expand handler (for full screen view) */\n\tonExpand?: () => void;\n\t/** Header actions */\n\tactions?: WidgetAction[];\n\t/** Custom CSS class */\n\tclassName?: string;\n\t/** Custom loading skeleton */\n\tloadingSkeleton?: React.ReactNode;\n\t/** Children content (optional when loading/error) */\n\tchildren?: React.ReactNode;\n}\n\n// ============================================================================\n// Variant Styles\n// ============================================================================\n\nconst variantStyles: Record<WidgetCardVariant, string> = {\n\tdefault: \"\",\n\tcompact: \"py-3 gap-3\",\n\tfeatured:\n\t\t\"border-primary/30 bg-gradient-to-br from-primary/5 to-transparent shadow-sm\",\n};\n\nconst variantContentStyles: Record<WidgetCardVariant, string> = {\n\tdefault: \"\",\n\tcompact: \"pt-0\",\n\tfeatured: \"\",\n};\n\n// ============================================================================\n// Sub-components\n// ============================================================================\n\nfunction WidgetCardLoading({\n\tvariant = \"default\",\n}: {\n\tvariant?: WidgetCardVariant;\n}) {\n\treturn (\n\t\t<Card className={cn(\"h-full flex flex-col\", variantStyles[variant])}>\n\t\t\t<CardHeader>\n\t\t\t\t<Skeleton className=\"h-4 w-24\" />\n\t\t\t</CardHeader>\n\t\t\t<CardContent className={cn(\"flex-1\", variantContentStyles[variant])}>\n\t\t\t\t<Skeleton className=\"h-20 w-full\" />\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n}\n\nfunction WidgetCardError({\n\terror,\n\tvariant = \"default\",\n\tonRetry,\n}: {\n\terror: Error;\n\tvariant?: WidgetCardVariant;\n\tonRetry?: () => void;\n}) {\n\treturn (\n\t\t<Card\n\t\t\tclassName={cn(\n\t\t\t\t\"h-full flex flex-col border-destructive/20 bg-destructive/5\",\n\t\t\t\tvariantStyles[variant],\n\t\t\t)}\n\t\t>\n\t\t\t<CardHeader>\n\t\t\t\t<CardTitle className=\"text-sm font-medium text-destructive\">\n\t\t\t\t\tError\n\t\t\t\t</CardTitle>\n\t\t\t\t{onRetry && (\n\t\t\t\t\t<CardAction>\n\t\t\t\t\t\t<Button variant=\"ghost\" size=\"icon-xs\" onClick={onRetry}>\n\t\t\t\t\t\t\t<Icon icon=\"ph:arrow-clockwise\" className=\"h-3.5 w-3.5\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</CardAction>\n\t\t\t\t)}\n\t\t\t</CardHeader>\n\t\t\t<CardContent className={cn(\"flex-1\", variantContentStyles[variant])}>\n\t\t\t\t<p className=\"text-xs text-muted-foreground\">{error.message}</p>\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\n/**\n * WidgetCard - Standardized card wrapper for dashboard widgets\n *\n * @example\n * ```tsx\n * <WidgetCard\n * title=\"Revenue\"\n * description=\"Monthly sales total\"\n * variant=\"featured\"\n * onRefresh={() => refetch()}\n * >\n * <div className=\"text-2xl font-bold\">$12,345</div>\n * </WidgetCard>\n * ```\n */\nexport function WidgetCard({\n\ttitle,\n\tdescription,\n\ticon,\n\tvariant = \"default\",\n\tisLoading,\n\tisRefreshing,\n\terror,\n\tonRefresh,\n\tonExpand,\n\tactions,\n\tclassName,\n\tloadingSkeleton,\n\tchildren,\n}: WidgetCardProps): React.ReactElement {\n\t// Loading state\n\tif (isLoading) {\n\t\tif (loadingSkeleton) {\n\t\t\treturn (\n\t\t\t\t<Card\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"h-full flex flex-col\",\n\t\t\t\t\t\tvariantStyles[variant],\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<CardHeader>\n\t\t\t\t\t\t<Skeleton className=\"h-4 w-24\" />\n\t\t\t\t\t</CardHeader>\n\t\t\t\t\t<CardContent className={cn(\"flex-1\", variantContentStyles[variant])}>\n\t\t\t\t\t\t{loadingSkeleton}\n\t\t\t\t\t</CardContent>\n\t\t\t\t</Card>\n\t\t\t);\n\t\t}\n\t\treturn <WidgetCardLoading variant={variant} />;\n\t}\n\n\t// Error state\n\tif (error) {\n\t\treturn (\n\t\t\t<WidgetCardError error={error} variant={variant} onRetry={onRefresh} />\n\t\t);\n\t}\n\n\tconst hasHeader =\n\t\ttitle || description || icon || onRefresh || onExpand || actions?.length;\n\n\treturn (\n\t\t<Card\n\t\t\tclassName={cn(\"h-full flex flex-col\", variantStyles[variant], className)}\n\t\t>\n\t\t\t{hasHeader && (\n\t\t\t\t<CardHeader>\n\t\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t\t{resolveIconElement(icon, {\n\t\t\t\t\t\t\tclassName: \"h-4 w-4 text-muted-foreground\",\n\t\t\t\t\t\t})}\n\t\t\t\t\t\t<div className=\"flex-1 min-w-0\">\n\t\t\t\t\t\t\t{title && (\n\t\t\t\t\t\t\t\t<CardTitle className=\"text-sm font-medium truncate\">\n\t\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\t</CardTitle>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{description && (\n\t\t\t\t\t\t\t\t<CardDescription className=\"truncate\">\n\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t</CardDescription>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t{(onRefresh || onExpand || actions?.length) && (\n\t\t\t\t\t\t<CardAction>\n\t\t\t\t\t\t\t<div className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t\t{/* Show first action directly, rest in dropdown on small widgets */}\n\t\t\t\t\t\t\t\t{actions && actions.length > 0 && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{/* First action always visible */}\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tkey={actions[0].id}\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"icon-xs\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={actions[0].onClick}\n\t\t\t\t\t\t\t\t\t\t\ttitle={actions[0].label}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{resolveIconElement(actions[0].icon, {\n\t\t\t\t\t\t\t\t\t\t\t\tclassName: \"h-3.5 w-3.5\",\n\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t{/* Additional actions in dropdown */}\n\t\t\t\t\t\t\t\t\t\t{actions.length > 1 && (\n\t\t\t\t\t\t\t\t\t\t\t<DropdownMenu>\n\t\t\t\t\t\t\t\t\t\t\t\t<DropdownMenuTrigger\n\t\t\t\t\t\t\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Button variant=\"ghost\" size=\"icon-xs\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon=\"ph:dots-three-vertical\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"h-3.5 w-3.5\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{actions.slice(1).map((action) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={action.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={action.onClick}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{resolveIconElement(action.icon, {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName: \"h-3.5 w-3.5 mr-2\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{action.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t\t\t</DropdownMenuContent>\n\t\t\t\t\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{onRefresh && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\tsize=\"icon-xs\"\n\t\t\t\t\t\t\t\t\t\tonClick={onRefresh}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Refresh\"\n\t\t\t\t\t\t\t\t\t\tdisabled={isRefreshing}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\ticon=\"ph:arrow-clockwise\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\"h-3.5 w-3.5\",\n\t\t\t\t\t\t\t\t\t\t\t\tisRefreshing && \"animate-spin\",\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{onExpand && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\tsize=\"icon-xs\"\n\t\t\t\t\t\t\t\t\t\tonClick={onExpand}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Icon icon=\"ph:arrows-out-simple\" className=\"h-3.5 w-3.5\" />\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</CardAction>\n\t\t\t\t\t)}\n\t\t\t\t</CardHeader>\n\t\t\t)}\n\t\t\t<CardContent\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"flex-1\",\n\t\t\t\t\tvariantContentStyles[variant],\n\t\t\t\t\t!hasHeader && \"pt-0\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n}\n\nexport default WidgetCard;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ComponentRegistry, FormViewConfig } from "../../builder/types/field-types.mjs";
|
|
2
|
+
import { GlobalBuilderState } from "../../builder/types/global-types.mjs";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import * as react_jsx_runtime34 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/client/views/globals/global-form-view.d.ts
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for GlobalFormView component
|
|
10
|
+
*/
|
|
11
|
+
interface GlobalFormViewProps {
|
|
12
|
+
/**
|
|
13
|
+
* Global name
|
|
14
|
+
*/
|
|
15
|
+
global: string;
|
|
16
|
+
/**
|
|
17
|
+
* Global configuration from admin builder
|
|
18
|
+
* Accepts GlobalBuilderState or any compatible config object
|
|
19
|
+
*/
|
|
20
|
+
config?: Partial<GlobalBuilderState> | Record<string, any>;
|
|
21
|
+
/**
|
|
22
|
+
* View-specific configuration from registry/schema
|
|
23
|
+
*/
|
|
24
|
+
viewConfig?: FormViewConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Navigate function for routing
|
|
27
|
+
*/
|
|
28
|
+
navigate: (path: string) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Base path for admin routes (e.g., "/admin")
|
|
31
|
+
*/
|
|
32
|
+
basePath?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Component registry for custom field types
|
|
35
|
+
*/
|
|
36
|
+
registry?: ComponentRegistry;
|
|
37
|
+
/**
|
|
38
|
+
* All globals config (for potential cross-references)
|
|
39
|
+
*/
|
|
40
|
+
allGlobalsConfig?: Record<string, Partial<GlobalBuilderState> | Record<string, any>>;
|
|
41
|
+
/**
|
|
42
|
+
* Show metadata (updated dates)
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
showMeta?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Custom header actions (in addition to default Save button)
|
|
48
|
+
*/
|
|
49
|
+
headerActions?: React$1.ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Callback on successful save
|
|
52
|
+
*/
|
|
53
|
+
onSuccess?: (data: any) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Callback on error
|
|
56
|
+
*/
|
|
57
|
+
onError?: (error: Error) => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* GlobalFormView - Default form-based edit view for globals
|
|
61
|
+
*/
|
|
62
|
+
declare function GlobalFormView({
|
|
63
|
+
global: globalName,
|
|
64
|
+
config,
|
|
65
|
+
viewConfig,
|
|
66
|
+
registry,
|
|
67
|
+
showMeta,
|
|
68
|
+
headerActions,
|
|
69
|
+
onSuccess,
|
|
70
|
+
onError
|
|
71
|
+
}: GlobalFormViewProps): react_jsx_runtime34.JSX.Element;
|
|
72
|
+
//#endregion
|
|
73
|
+
export { GlobalFormView };
|
|
74
|
+
//# sourceMappingURL=global-form-view.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-form-view.d.mts","names":[],"sources":["../../../../src/client/views/globals/global-form-view.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;AA6FU,UArCO,mBAAA,CAqCP;EAAR;;;EAYe,MAAM,EAAA,MAAA;EAUJ;;AAClB;;EAWA,MAAA,CAAA,EA7DS,OA6DT,CA7DiB,kBA6DjB,CAAA,GA7DuC,MA6DvC,CAAA,MAAA,EAAA,GAAA,CAAA;EACA;;;EAGA,UAAA,CAAA,EA5Da,cA4Db;EACA;;;EAEqB,QAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,GAAA,IAAA;EAAA;;;;;;;aAhDV;;;;qBAKQ,eAElB,QAAQ,sBAAsB;;;;;;;;;kBAYf,OAAA,CAAM;;;;;;;;oBAUJ;;;;;iBAUK,cAAA;UACf;;;;;;;;GAQN,sBAAmB,mBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
|
|
2
|
+
import { useSafeContentLocales } from "../../runtime/content-locales-provider.mjs";
|
|
3
|
+
import { useScopedLocale } from "../../runtime/locale-scope.mjs";
|
|
4
|
+
import { Button } from "../../components/ui/button.mjs";
|
|
5
|
+
import { useGlobalFields } from "../../hooks/use-global-fields.mjs";
|
|
6
|
+
import { AutoFormFields } from "../collection/auto-form-fields.mjs";
|
|
7
|
+
import { LocaleSwitcher } from "../../components/locale-switcher.mjs";
|
|
8
|
+
import { useGlobal, useGlobalUpdate } from "../../hooks/use-global.mjs";
|
|
9
|
+
import { useGlobalServerValidation } from "../../hooks/use-server-validation.mjs";
|
|
10
|
+
import { useReactiveFields } from "../../hooks/use-reactive-fields.mjs";
|
|
11
|
+
import { Icon } from "@iconify/react";
|
|
12
|
+
import { QuestpieClientError } from "questpie/client";
|
|
13
|
+
import * as React$1 from "react";
|
|
14
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
15
|
+
import { toast } from "sonner";
|
|
16
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
|
|
18
|
+
//#region src/client/views/globals/global-form-view.tsx
|
|
19
|
+
/**
|
|
20
|
+
* Global Form View - Default edit view component for globals
|
|
21
|
+
*
|
|
22
|
+
* Mirrors FormView for collections but adapted for singleton globals.
|
|
23
|
+
* Renders global settings form with sections, tabs, sidebar, validation.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Extract reactive configs from global schema fields.
|
|
27
|
+
* Used to determine which fields have server-side reactive behaviors.
|
|
28
|
+
*/
|
|
29
|
+
function extractReactiveConfigs(schema) {
|
|
30
|
+
if (!schema?.fields) return {};
|
|
31
|
+
const configs = {};
|
|
32
|
+
for (const [fieldName, fieldDef] of Object.entries(schema.fields)) if (fieldDef.reactive) configs[fieldName] = fieldDef.reactive;
|
|
33
|
+
return configs;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* GlobalFormView - Default form-based edit view for globals
|
|
37
|
+
*/
|
|
38
|
+
function GlobalFormView({ global: globalName, config, viewConfig, registry, showMeta = true, headerActions, onSuccess, onError }) {
|
|
39
|
+
const { t } = useTranslation();
|
|
40
|
+
const resolveText = useResolveText();
|
|
41
|
+
const { data: globalData, isLoading: dataLoading } = useGlobal(globalName);
|
|
42
|
+
const { fields: schemaFields } = useGlobalFields(globalName);
|
|
43
|
+
const { locale: contentLocale, setLocale: setContentLocale } = useScopedLocale();
|
|
44
|
+
const localeOptions = useSafeContentLocales()?.locales ?? [];
|
|
45
|
+
const updateMutation = useGlobalUpdate(globalName, {
|
|
46
|
+
onSuccess: (data) => {
|
|
47
|
+
toast.success(t("toast.saveSuccess"));
|
|
48
|
+
onSuccess?.(data);
|
|
49
|
+
},
|
|
50
|
+
onError: (error) => {
|
|
51
|
+
onError?.(error);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const { resolver } = useGlobalServerValidation(globalName);
|
|
55
|
+
const form = useForm({
|
|
56
|
+
defaultValues: globalData ?? {},
|
|
57
|
+
resolver
|
|
58
|
+
});
|
|
59
|
+
React$1.useEffect(() => {
|
|
60
|
+
if (globalData) form.reset(globalData);
|
|
61
|
+
}, [form, globalData]);
|
|
62
|
+
const reactiveConfigs = React$1.useMemo(() => extractReactiveConfigs(schemaFields), [schemaFields]);
|
|
63
|
+
useReactiveFields({
|
|
64
|
+
collection: globalName,
|
|
65
|
+
mode: "global",
|
|
66
|
+
reactiveConfigs,
|
|
67
|
+
enabled: !dataLoading && Object.keys(reactiveConfigs).length > 0,
|
|
68
|
+
debounce: 300
|
|
69
|
+
});
|
|
70
|
+
const resolvedConfig = React$1.useMemo(() => {
|
|
71
|
+
if (!viewConfig) return config;
|
|
72
|
+
return {
|
|
73
|
+
...config ?? {},
|
|
74
|
+
form: viewConfig
|
|
75
|
+
};
|
|
76
|
+
}, [config, viewConfig]);
|
|
77
|
+
const onSubmit = React$1.useCallback(async (data) => {
|
|
78
|
+
try {
|
|
79
|
+
const result = await updateMutation.mutateAsync({ data });
|
|
80
|
+
if (result) form.reset(result);
|
|
81
|
+
} catch (error) {
|
|
82
|
+
if (error instanceof QuestpieClientError && error.fieldErrors && error.fieldErrors.length > 0) {
|
|
83
|
+
for (const fieldError of error.fieldErrors) form.setError(fieldError.path, {
|
|
84
|
+
type: "server",
|
|
85
|
+
message: fieldError.message
|
|
86
|
+
});
|
|
87
|
+
toast.error(t("toast.validationFailed"), { description: t("toast.validationDescription") });
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const message = error instanceof Error ? error.message : t("error.unknown");
|
|
91
|
+
toast.error(t("toast.settingsSaveFailed") || "Failed to save settings", { description: message });
|
|
92
|
+
}
|
|
93
|
+
}, [
|
|
94
|
+
updateMutation,
|
|
95
|
+
form,
|
|
96
|
+
t
|
|
97
|
+
]);
|
|
98
|
+
React$1.useEffect(() => {
|
|
99
|
+
const handleKeyDown = (e) => {
|
|
100
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "s") {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
form.handleSubmit(onSubmit)();
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
106
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
107
|
+
}, [form, onSubmit]);
|
|
108
|
+
const isSubmitting = updateMutation.isPending || form.formState.isSubmitting;
|
|
109
|
+
const formatDate = (date) => {
|
|
110
|
+
return new Date(date).toLocaleDateString(void 0, {
|
|
111
|
+
year: "numeric",
|
|
112
|
+
month: "short",
|
|
113
|
+
day: "numeric",
|
|
114
|
+
hour: "2-digit",
|
|
115
|
+
minute: "2-digit"
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
if (dataLoading) return /* @__PURE__ */ jsx("div", {
|
|
119
|
+
className: "flex h-64 items-center justify-center text-muted-foreground",
|
|
120
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
121
|
+
icon: "ph:spinner-gap",
|
|
122
|
+
className: "size-6 animate-spin"
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
const globalLabel = resolveText(resolvedConfig?.label ?? schemaFields?._globalLabel, globalName);
|
|
126
|
+
return /* @__PURE__ */ jsx(FormProvider, {
|
|
127
|
+
...form,
|
|
128
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
129
|
+
onSubmit: form.handleSubmit(onSubmit),
|
|
130
|
+
className: "w-full space-y-4",
|
|
131
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
132
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
133
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
134
|
+
className: "min-w-0 flex-1",
|
|
135
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
136
|
+
className: "flex items-center gap-3",
|
|
137
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
138
|
+
className: "text-2xl md:text-3xl font-extrabold tracking-tight",
|
|
139
|
+
children: globalLabel
|
|
140
|
+
}), localeOptions.length > 0 && /* @__PURE__ */ jsx(LocaleSwitcher, {
|
|
141
|
+
locales: localeOptions,
|
|
142
|
+
value: contentLocale,
|
|
143
|
+
onChange: setContentLocale
|
|
144
|
+
})]
|
|
145
|
+
}), showMeta && globalData?.updatedAt && /* @__PURE__ */ jsxs("p", {
|
|
146
|
+
className: "mt-1 text-xs text-muted-foreground",
|
|
147
|
+
children: [
|
|
148
|
+
t("form.lastUpdated"),
|
|
149
|
+
": ",
|
|
150
|
+
formatDate(globalData.updatedAt)
|
|
151
|
+
]
|
|
152
|
+
})]
|
|
153
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
154
|
+
className: "flex items-center gap-2 shrink-0",
|
|
155
|
+
children: [headerActions, /* @__PURE__ */ jsx(Button, {
|
|
156
|
+
type: "submit",
|
|
157
|
+
disabled: isSubmitting,
|
|
158
|
+
className: "gap-2",
|
|
159
|
+
children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
160
|
+
icon: "ph:spinner-gap",
|
|
161
|
+
className: "size-4 animate-spin"
|
|
162
|
+
}), t("common.loading")] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
163
|
+
icon: "ph:check",
|
|
164
|
+
width: 16,
|
|
165
|
+
height: 16
|
|
166
|
+
}), t("common.save")] })
|
|
167
|
+
})]
|
|
168
|
+
})]
|
|
169
|
+
}), /* @__PURE__ */ jsx(AutoFormFields, {
|
|
170
|
+
collection: globalName,
|
|
171
|
+
mode: "global",
|
|
172
|
+
config: resolvedConfig,
|
|
173
|
+
registry
|
|
174
|
+
})]
|
|
175
|
+
})
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
//#endregion
|
|
180
|
+
export { GlobalFormView as default };
|
|
181
|
+
//# sourceMappingURL=global-form-view.mjs.map
|