@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 @@
|
|
|
1
|
+
{"version":3,"file":"value-widget.d.mts","names":[],"sources":["../../../../src/client/components/widgets/value-widget.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAuBA;AAkCwB,UAlCP,gBAAA,CAkCkB;EAAG,MAAA,EAjC5B,iBAiC4B;;;;;;;;;;;;;;;;;;;;;;iBAAd,WAAA;;GAAwB,mBAAgB,mBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useResolveText } from "../../i18n/hooks.mjs";
|
|
2
|
+
import { cn } from "../../lib/utils.mjs";
|
|
3
|
+
import { selectClient, useAdminStore } from "../../runtime/provider.mjs";
|
|
4
|
+
import { resolveIconElement } from "../component-renderer.mjs";
|
|
5
|
+
import { WidgetCard } from "../../views/dashboard/widget-card.mjs";
|
|
6
|
+
import { useServerWidgetData } from "../../hooks/use-server-widget-data.mjs";
|
|
7
|
+
import { ValueWidgetSkeleton } from "./widget-skeletons.mjs";
|
|
8
|
+
import { useQuery } from "@tanstack/react-query";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region src/client/components/widgets/value-widget.tsx
|
|
12
|
+
/**
|
|
13
|
+
* Value Widget
|
|
14
|
+
*
|
|
15
|
+
* Flexible widget with async data fetching and full Tailwind customization.
|
|
16
|
+
* Uses WidgetCard for consistent styling while allowing custom classNames.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Format value for display
|
|
20
|
+
*/
|
|
21
|
+
function formatValue(value) {
|
|
22
|
+
if (typeof value === "number") return value.toLocaleString();
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Value Widget Component
|
|
27
|
+
*
|
|
28
|
+
* Fetches data via async function and renders with full customization.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <ValueWidget
|
|
33
|
+
* config={{
|
|
34
|
+
* type: "value",
|
|
35
|
+
* id: "total-revenue",
|
|
36
|
+
* fetchFn: async (client) => ({
|
|
37
|
+
* value: 42,
|
|
38
|
+
* label: "Total",
|
|
39
|
+
* classNames: { root: "bg-blue-50" },
|
|
40
|
+
* }),
|
|
41
|
+
* }}
|
|
42
|
+
* />
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
function ValueWidget({ config }) {
|
|
46
|
+
const client = useAdminStore(selectClient);
|
|
47
|
+
const resolveText = useResolveText();
|
|
48
|
+
const useServerData = !!config.hasFetchFn;
|
|
49
|
+
const serverQuery = useServerWidgetData(config.id, {
|
|
50
|
+
enabled: useServerData,
|
|
51
|
+
refreshInterval: config.refreshInterval
|
|
52
|
+
});
|
|
53
|
+
const clientQuery = useQuery({
|
|
54
|
+
queryKey: [
|
|
55
|
+
"widget",
|
|
56
|
+
"value",
|
|
57
|
+
config.id
|
|
58
|
+
],
|
|
59
|
+
queryFn: () => config.fetchFn(client),
|
|
60
|
+
enabled: !useServerData && !!config.fetchFn,
|
|
61
|
+
refetchInterval: config.refreshInterval
|
|
62
|
+
});
|
|
63
|
+
const { data, isLoading, error, refetch, isFetching } = useServerData ? serverQuery : clientQuery;
|
|
64
|
+
const isFeatured = config.cardVariant === "featured";
|
|
65
|
+
if (isLoading || error || !data) return /* @__PURE__ */ jsx(WidgetCard, {
|
|
66
|
+
title: config.title ? resolveText(config.title) : void 0,
|
|
67
|
+
isLoading,
|
|
68
|
+
loadingSkeleton: /* @__PURE__ */ jsx(ValueWidgetSkeleton, { featured: isFeatured }),
|
|
69
|
+
error: error instanceof Error ? error : !data && !isLoading ? /* @__PURE__ */ new Error("No data returned") : null,
|
|
70
|
+
onRefresh: () => refetch(),
|
|
71
|
+
className: data?.classNames?.root
|
|
72
|
+
});
|
|
73
|
+
const cls = data.classNames ?? {};
|
|
74
|
+
const Icon = data.icon;
|
|
75
|
+
const TrendIcon = data.trend?.icon;
|
|
76
|
+
const label = data.label ? resolveText(data.label) : void 0;
|
|
77
|
+
const subtitle = data.subtitle ? resolveText(data.subtitle) : void 0;
|
|
78
|
+
const footer = data.footer ? resolveText(data.footer) : void 0;
|
|
79
|
+
return /* @__PURE__ */ jsx(WidgetCard, {
|
|
80
|
+
title: label,
|
|
81
|
+
icon: Icon,
|
|
82
|
+
onRefresh: () => refetch(),
|
|
83
|
+
isRefreshing: isFetching && !isLoading,
|
|
84
|
+
className: cls.root,
|
|
85
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
86
|
+
className: cn("space-y-1", cls.content),
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ jsx("div", {
|
|
89
|
+
className: cn("text-2xl font-bold", cls.value),
|
|
90
|
+
children: data.formatted ?? formatValue(data.value)
|
|
91
|
+
}),
|
|
92
|
+
data.trend && /* @__PURE__ */ jsxs("div", {
|
|
93
|
+
className: cn("flex items-center gap-1 text-sm", cls.trend),
|
|
94
|
+
children: [resolveIconElement(TrendIcon, { className: cn("h-3 w-3", cls.trendIcon) }), /* @__PURE__ */ jsx("span", { children: data.trend.value })]
|
|
95
|
+
}),
|
|
96
|
+
subtitle && /* @__PURE__ */ jsx("p", {
|
|
97
|
+
className: cn("text-xs text-muted-foreground", cls.subtitle),
|
|
98
|
+
children: subtitle
|
|
99
|
+
}),
|
|
100
|
+
footer && /* @__PURE__ */ jsx("p", {
|
|
101
|
+
className: cn("text-xs text-muted-foreground pt-2", cls.footer),
|
|
102
|
+
children: footer
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { ValueWidget as default };
|
|
111
|
+
//# sourceMappingURL=value-widget.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-widget.mjs","names":[],"sources":["../../../../src/client/components/widgets/value-widget.tsx"],"sourcesContent":["/**\n * Value Widget\n *\n * Flexible widget with async data fetching and full Tailwind customization.\n * Uses WidgetCard for consistent styling while allowing custom classNames.\n */\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n ValueWidgetConfig,\n ValueWidgetResult,\n} from \"../../builder/types/widget-types\";\nimport { resolveIconElement } from \"../../components/component-renderer\";\nimport { useServerWidgetData } from \"../../hooks/use-server-widget-data\";\nimport { useResolveText } from \"../../i18n/hooks\";\nimport { cn } from \"../../lib/utils\";\nimport { selectClient, useAdminStore } from \"../../runtime\";\nimport { WidgetCard } from \"../../views/dashboard/widget-card\";\nimport { ValueWidgetSkeleton } from \"./widget-skeletons\";\n\n/**\n * Value widget props\n */\nexport interface ValueWidgetProps {\n config: ValueWidgetConfig;\n}\n\n/**\n * Format value for display\n */\nfunction formatValue(value: number | string): string {\n if (typeof value === \"number\") {\n return value.toLocaleString();\n }\n return value;\n}\n\n/**\n * Value Widget Component\n *\n * Fetches data via async function and renders with full customization.\n *\n * @example\n * ```tsx\n * <ValueWidget\n * config={{\n * type: \"value\",\n * id: \"total-revenue\",\n * fetchFn: async (client) => ({\n * value: 42,\n * label: \"Total\",\n * classNames: { root: \"bg-blue-50\" },\n * }),\n * }}\n * />\n * ```\n */\nexport default function ValueWidget({ config }: ValueWidgetProps) {\n const client = useAdminStore(selectClient);\n const resolveText = useResolveText();\n\n const useServerData = !!config.hasFetchFn;\n const serverQuery = useServerWidgetData<ValueWidgetResult>(config.id, {\n enabled: useServerData,\n refreshInterval: config.refreshInterval,\n });\n const clientQuery = useQuery<ValueWidgetResult>({\n queryKey: [\"widget\", \"value\", config.id],\n queryFn: () => config.fetchFn!(client),\n enabled: !useServerData && !!config.fetchFn,\n refetchInterval: config.refreshInterval,\n });\n const { data, isLoading, error, refetch, isFetching } = useServerData\n ? serverQuery\n : clientQuery;\n\n // Determine if this is a featured variant based on config\n const isFeatured = config.cardVariant === \"featured\";\n\n // Handle loading/error via WidgetCard\n if (isLoading || error || !data) {\n return (\n <WidgetCard\n title={config.title ? resolveText(config.title) : undefined}\n isLoading={isLoading}\n loadingSkeleton={<ValueWidgetSkeleton featured={isFeatured} />}\n error={\n error instanceof Error\n ? error\n : !data && !isLoading\n ? new Error(\"No data returned\")\n : null\n }\n onRefresh={() => refetch()}\n className={data?.classNames?.root}\n />\n );\n }\n\n const cls = data.classNames ?? {};\n const Icon = data.icon;\n const TrendIcon = data.trend?.icon;\n\n // Resolve all text fields (supports both string and i18n objects)\n const label = data.label ? resolveText(data.label) : undefined;\n const subtitle = data.subtitle ? resolveText(data.subtitle) : undefined;\n const footer = data.footer ? resolveText(data.footer) : undefined;\n\n return (\n <WidgetCard\n title={label}\n icon={Icon}\n onRefresh={() => refetch()}\n isRefreshing={isFetching && !isLoading}\n className={cls.root}\n >\n <div className={cn(\"space-y-1\", cls.content)}>\n {/* Main value */}\n <div className={cn(\"text-2xl font-bold\", cls.value)}>\n {data.formatted ?? formatValue(data.value)}\n </div>\n\n {/* Trend indicator */}\n {data.trend && (\n <div className={cn(\"flex items-center gap-1 text-sm\", cls.trend)}>\n {resolveIconElement(TrendIcon, {\n className: cn(\"h-3 w-3\", cls.trendIcon),\n })}\n <span>{data.trend.value}</span>\n </div>\n )}\n\n {/* Subtitle */}\n {subtitle && (\n <p className={cn(\"text-xs text-muted-foreground\", cls.subtitle)}>\n {subtitle}\n </p>\n )}\n\n {/* Footer */}\n {footer && (\n <p className={cn(\"text-xs text-muted-foreground pt-2\", cls.footer)}>\n {footer}\n </p>\n )}\n </div>\n </WidgetCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8BA,SAAS,YAAY,OAAgC;AACnD,KAAI,OAAO,UAAU,SACnB,QAAO,MAAM,gBAAgB;AAE/B,QAAO;;;;;;;;;;;;;;;;;;;;;;AAuBT,SAAwB,YAAY,EAAE,UAA4B;CAChE,MAAM,SAAS,cAAc,aAAa;CAC1C,MAAM,cAAc,gBAAgB;CAEpC,MAAM,gBAAgB,CAAC,CAAC,OAAO;CAC/B,MAAM,cAAc,oBAAuC,OAAO,IAAI;EACpE,SAAS;EACT,iBAAiB,OAAO;EACzB,CAAC;CACF,MAAM,cAAc,SAA4B;EAC9C,UAAU;GAAC;GAAU;GAAS,OAAO;GAAG;EACxC,eAAe,OAAO,QAAS,OAAO;EACtC,SAAS,CAAC,iBAAiB,CAAC,CAAC,OAAO;EACpC,iBAAiB,OAAO;EACzB,CAAC;CACF,MAAM,EAAE,MAAM,WAAW,OAAO,SAAS,eAAe,gBACpD,cACA;CAGJ,MAAM,aAAa,OAAO,gBAAgB;AAG1C,KAAI,aAAa,SAAS,CAAC,KACzB,QACE,oBAAC;EACC,OAAO,OAAO,QAAQ,YAAY,OAAO,MAAM,GAAG;EACvC;EACX,iBAAiB,oBAAC,uBAAoB,UAAU,aAAc;EAC9D,OACE,iBAAiB,QACb,QACA,CAAC,QAAQ,CAAC,4BACR,IAAI,MAAM,mBAAmB,GAC7B;EAER,iBAAiB,SAAS;EAC1B,WAAW,MAAM,YAAY;GAC7B;CAIN,MAAM,MAAM,KAAK,cAAc,EAAE;CACjC,MAAM,OAAO,KAAK;CAClB,MAAM,YAAY,KAAK,OAAO;CAG9B,MAAM,QAAQ,KAAK,QAAQ,YAAY,KAAK,MAAM,GAAG;CACrD,MAAM,WAAW,KAAK,WAAW,YAAY,KAAK,SAAS,GAAG;CAC9D,MAAM,SAAS,KAAK,SAAS,YAAY,KAAK,OAAO,GAAG;AAExD,QACE,oBAAC;EACC,OAAO;EACP,MAAM;EACN,iBAAiB,SAAS;EAC1B,cAAc,cAAc,CAAC;EAC7B,WAAW,IAAI;YAEf,qBAAC;GAAI,WAAW,GAAG,aAAa,IAAI,QAAQ;;IAE1C,oBAAC;KAAI,WAAW,GAAG,sBAAsB,IAAI,MAAM;eAChD,KAAK,aAAa,YAAY,KAAK,MAAM;MACtC;IAGL,KAAK,SACJ,qBAAC;KAAI,WAAW,GAAG,mCAAmC,IAAI,MAAM;gBAC7D,mBAAmB,WAAW,EAC7B,WAAW,GAAG,WAAW,IAAI,UAAU,EACxC,CAAC,EACF,oBAAC,oBAAM,KAAK,MAAM,QAAa;MAC3B;IAIP,YACC,oBAAC;KAAE,WAAW,GAAG,iCAAiC,IAAI,SAAS;eAC5D;MACC;IAIL,UACC,oBAAC;KAAE,WAAW,GAAG,sCAAsC,IAAI,OAAO;eAC/D;MACC;;IAEF;GACK"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.mjs";
|
|
2
|
+
import { Skeleton } from "../ui/skeleton.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/client/components/widgets/widget-skeletons.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Widget Skeletons
|
|
8
|
+
*
|
|
9
|
+
* Loading skeleton components for different widget types.
|
|
10
|
+
* Provides visual feedback while data is being fetched.
|
|
11
|
+
*/
|
|
12
|
+
function StatsWidgetSkeleton() {
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
14
|
+
className: "space-y-3",
|
|
15
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-20" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-32" })]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function ChartWidgetSkeleton() {
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "h-48 w-full flex items-end gap-2 pt-4",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[40%]" }),
|
|
23
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[65%]" }),
|
|
24
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[45%]" }),
|
|
25
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[80%]" }),
|
|
26
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[55%]" }),
|
|
27
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[70%]" }),
|
|
28
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[50%]" }),
|
|
29
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[75%]" }),
|
|
30
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[60%]" }),
|
|
31
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "flex-1 rounded-t h-[85%]" })
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function RecentItemsWidgetSkeleton({ count = 5 }) {
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
37
|
+
className: "space-y-1",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsx(SkeletonRow, {}),
|
|
40
|
+
count > 1 && /* @__PURE__ */ jsx(SkeletonRow, {}),
|
|
41
|
+
count > 2 && /* @__PURE__ */ jsx(SkeletonRow, {}),
|
|
42
|
+
count > 3 && /* @__PURE__ */ jsx(SkeletonRow, {}),
|
|
43
|
+
count > 4 && /* @__PURE__ */ jsx(SkeletonRow, {})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function SkeletonRow() {
|
|
48
|
+
return /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: "flex items-center gap-3 p-2",
|
|
50
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
51
|
+
className: "flex-1 space-y-2",
|
|
52
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-1/2" })]
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function TableWidgetSkeleton({ rows = 5, columns = 3 }) {
|
|
57
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
58
|
+
className: "-mx-5",
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsxs("div", {
|
|
61
|
+
className: "flex gap-4 px-5 py-2 border-b border-border/50",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }),
|
|
64
|
+
columns > 1 && /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" }),
|
|
65
|
+
columns > 2 && /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" })
|
|
66
|
+
]
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ jsx(TableSkeletonRow, { columns }),
|
|
69
|
+
rows > 1 && /* @__PURE__ */ jsx(TableSkeletonRow, { columns }),
|
|
70
|
+
rows > 2 && /* @__PURE__ */ jsx(TableSkeletonRow, { columns }),
|
|
71
|
+
rows > 3 && /* @__PURE__ */ jsx(TableSkeletonRow, { columns }),
|
|
72
|
+
rows > 4 && /* @__PURE__ */ jsx(TableSkeletonRow, {
|
|
73
|
+
columns,
|
|
74
|
+
last: true
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function TableSkeletonRow({ columns = 3, last = false }) {
|
|
80
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
81
|
+
className: cn("flex gap-4 px-5 py-3 border-b border-border/30", last && "border-0"),
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" }),
|
|
84
|
+
columns > 1 && /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" }),
|
|
85
|
+
columns > 2 && /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1" })
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function TimelineWidgetSkeleton({ count = 5 }) {
|
|
90
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
91
|
+
className: "space-y-4",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ jsx(TimelineSkeletonItem, {}),
|
|
94
|
+
count > 1 && /* @__PURE__ */ jsx(TimelineSkeletonItem, {}),
|
|
95
|
+
count > 2 && /* @__PURE__ */ jsx(TimelineSkeletonItem, {}),
|
|
96
|
+
count > 3 && /* @__PURE__ */ jsx(TimelineSkeletonItem, {}),
|
|
97
|
+
count > 4 && /* @__PURE__ */ jsx(TimelineSkeletonItem, { last: true })
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function TimelineSkeletonItem({ last = false }) {
|
|
102
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
103
|
+
className: "flex gap-3",
|
|
104
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
105
|
+
className: "flex flex-col items-center",
|
|
106
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-3 rounded-full" }), !last && /* @__PURE__ */ jsx(Skeleton, { className: "w-0.5 flex-1 mt-1" })]
|
|
107
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
108
|
+
className: "flex-1 space-y-1 pb-4",
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4" }),
|
|
111
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-1/2" }),
|
|
112
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-20" })
|
|
113
|
+
]
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function ProgressWidgetSkeleton() {
|
|
118
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
119
|
+
className: "space-y-3",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ jsxs("div", {
|
|
122
|
+
className: "flex justify-between items-center",
|
|
123
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-32" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-12" })]
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-2 w-full rounded-full" }),
|
|
126
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-24" })
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function ValueWidgetSkeleton({ featured = false }) {
|
|
131
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
132
|
+
className: "space-y-3",
|
|
133
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
134
|
+
className: "flex items-start gap-3",
|
|
135
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-10 rounded-md shrink-0" }), /* @__PURE__ */ jsxs("div", {
|
|
136
|
+
className: "flex-1 space-y-2",
|
|
137
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }), /* @__PURE__ */ jsx(Skeleton, { className: cn("h-8", featured ? "w-40" : "w-24") })]
|
|
138
|
+
})]
|
|
139
|
+
}), /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-32" })]
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
//#endregion
|
|
144
|
+
export { ChartWidgetSkeleton, ProgressWidgetSkeleton, RecentItemsWidgetSkeleton, StatsWidgetSkeleton, TableWidgetSkeleton, TimelineWidgetSkeleton, ValueWidgetSkeleton };
|
|
145
|
+
//# sourceMappingURL=widget-skeletons.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-skeletons.mjs","names":[],"sources":["../../../../src/client/components/widgets/widget-skeletons.tsx"],"sourcesContent":["/**\n * Widget Skeletons\n *\n * Loading skeleton components for different widget types.\n * Provides visual feedback while data is being fetched.\n */\n\nimport { cn } from \"../../lib/utils\";\nimport { Skeleton } from \"../ui/skeleton\";\n\n// ============================================================================\n// Stats Widget Skeleton\n// ============================================================================\n\nexport function StatsWidgetSkeleton() {\n return (\n <div className=\"space-y-3\">\n <Skeleton className=\"h-8 w-20\" />\n <Skeleton className=\"h-4 w-32\" />\n </div>\n );\n}\n\n// ============================================================================\n// Chart Widget Skeleton\n// ============================================================================\n\nexport function ChartWidgetSkeleton() {\n return (\n <div className=\"h-48 w-full flex items-end gap-2 pt-4\">\n {/* Bar chart style skeleton */}\n <Skeleton className=\"flex-1 rounded-t h-[40%]\" />\n <Skeleton className=\"flex-1 rounded-t h-[65%]\" />\n <Skeleton className=\"flex-1 rounded-t h-[45%]\" />\n <Skeleton className=\"flex-1 rounded-t h-[80%]\" />\n <Skeleton className=\"flex-1 rounded-t h-[55%]\" />\n <Skeleton className=\"flex-1 rounded-t h-[70%]\" />\n <Skeleton className=\"flex-1 rounded-t h-[50%]\" />\n <Skeleton className=\"flex-1 rounded-t h-[75%]\" />\n <Skeleton className=\"flex-1 rounded-t h-[60%]\" />\n <Skeleton className=\"flex-1 rounded-t h-[85%]\" />\n </div>\n );\n}\n\n// ============================================================================\n// Recent Items Widget Skeleton\n// ============================================================================\n\nexport function RecentItemsWidgetSkeleton({ count = 5 }: { count?: number }) {\n return (\n <div className=\"space-y-1\">\n <SkeletonRow />\n {count > 1 && <SkeletonRow />}\n {count > 2 && <SkeletonRow />}\n {count > 3 && <SkeletonRow />}\n {count > 4 && <SkeletonRow />}\n </div>\n );\n}\n\nfunction SkeletonRow() {\n return (\n <div className=\"flex items-center gap-3 p-2\">\n <div className=\"flex-1 space-y-2\">\n <Skeleton className=\"h-4 w-3/4\" />\n <Skeleton className=\"h-3 w-1/2\" />\n </div>\n </div>\n );\n}\n\n// ============================================================================\n// Quick Actions Widget Skeleton\n// ============================================================================\n\nexport function QuickActionsWidgetSkeleton({\n count = 3,\n layout = \"list\",\n}: {\n count?: number;\n layout?: \"list\" | \"grid\";\n}) {\n if (layout === \"grid\") {\n return (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionGridItem />\n {count > 1 && <ActionGridItem />}\n {count > 2 && <ActionGridItem />}\n {count > 3 && <ActionGridItem />}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-1 -mx-1\">\n <ActionListItem />\n {count > 1 && <ActionListItem />}\n {count > 2 && <ActionListItem />}\n </div>\n );\n}\n\nfunction ActionGridItem() {\n return (\n <div className=\"flex flex-col items-center justify-center gap-2 p-3\">\n <Skeleton className=\"h-9 w-9 rounded-md\" />\n <Skeleton className=\"h-3 w-16\" />\n </div>\n );\n}\n\nfunction ActionListItem() {\n return (\n <div className=\"flex items-center gap-3 px-2 py-2\">\n <Skeleton className=\"h-8 w-8 rounded-md shrink-0\" />\n <Skeleton className=\"h-4 flex-1\" />\n </div>\n );\n}\n\n// ============================================================================\n// Table Widget Skeleton\n// ============================================================================\n\nexport function TableWidgetSkeleton({\n rows = 5,\n columns = 3,\n}: {\n rows?: number;\n columns?: number;\n}) {\n return (\n <div className=\"-mx-5\">\n {/* Header */}\n <div className=\"flex gap-4 px-5 py-2 border-b border-border/50\">\n <Skeleton className=\"h-4 w-24\" />\n {columns > 1 && <Skeleton className=\"h-4 flex-1\" />}\n {columns > 2 && <Skeleton className=\"h-4 flex-1\" />}\n </div>\n {/* Rows */}\n <TableSkeletonRow columns={columns} />\n {rows > 1 && <TableSkeletonRow columns={columns} />}\n {rows > 2 && <TableSkeletonRow columns={columns} />}\n {rows > 3 && <TableSkeletonRow columns={columns} />}\n {rows > 4 && <TableSkeletonRow columns={columns} last />}\n </div>\n );\n}\n\nfunction TableSkeletonRow({\n columns = 3,\n last = false,\n}: {\n columns?: number;\n last?: boolean;\n}) {\n return (\n <div\n className={cn(\n \"flex gap-4 px-5 py-3 border-b border-border/30\",\n last && \"border-0\",\n )}\n >\n <Skeleton className=\"h-4 w-20\" />\n {columns > 1 && <Skeleton className=\"h-4 flex-1\" />}\n {columns > 2 && <Skeleton className=\"h-4 flex-1\" />}\n </div>\n );\n}\n\n// ============================================================================\n// Timeline Widget Skeleton\n// ============================================================================\n\nexport function TimelineWidgetSkeleton({ count = 5 }: { count?: number }) {\n return (\n <div className=\"space-y-4\">\n <TimelineSkeletonItem />\n {count > 1 && <TimelineSkeletonItem />}\n {count > 2 && <TimelineSkeletonItem />}\n {count > 3 && <TimelineSkeletonItem />}\n {count > 4 && <TimelineSkeletonItem last />}\n </div>\n );\n}\n\nfunction TimelineSkeletonItem({ last = false }: { last?: boolean }) {\n return (\n <div className=\"flex gap-3\">\n {/* Timeline dot */}\n <div className=\"flex flex-col items-center\">\n <Skeleton className=\"h-3 w-3 rounded-full\" />\n {!last && <Skeleton className=\"w-0.5 flex-1 mt-1\" />}\n </div>\n {/* Content */}\n <div className=\"flex-1 space-y-1 pb-4\">\n <Skeleton className=\"h-4 w-3/4\" />\n <Skeleton className=\"h-3 w-1/2\" />\n <Skeleton className=\"h-3 w-20\" />\n </div>\n </div>\n );\n}\n\n// ============================================================================\n// Progress Widget Skeleton\n// ============================================================================\n\nexport function ProgressWidgetSkeleton() {\n return (\n <div className=\"space-y-3\">\n <div className=\"flex justify-between items-center\">\n <Skeleton className=\"h-4 w-32\" />\n <Skeleton className=\"h-4 w-12\" />\n </div>\n <Skeleton className=\"h-2 w-full rounded-full\" />\n <Skeleton className=\"h-3 w-24\" />\n </div>\n );\n}\n\n// ============================================================================\n// Value Widget Skeleton\n// ============================================================================\n\nexport function ValueWidgetSkeleton({\n featured = false,\n}: {\n featured?: boolean;\n}) {\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-start gap-3\">\n <Skeleton className=\"h-10 w-10 rounded-md shrink-0\" />\n <div className=\"flex-1 space-y-2\">\n <Skeleton className=\"h-4 w-24\" />\n <Skeleton className={cn(\"h-8\", featured ? \"w-40\" : \"w-24\")} />\n </div>\n </div>\n <Skeleton className=\"h-3 w-32\" />\n </div>\n );\n}\n\n// ============================================================================\n// Generic Widget Skeleton\n// ============================================================================\n\nexport function GenericWidgetSkeleton() {\n return (\n <div className=\"space-y-4\">\n <Skeleton className=\"h-20 w-full\" />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAcA,SAAgB,sBAAsB;AACpC,QACE,qBAAC;EAAI,WAAU;aACb,oBAAC,YAAS,WAAU,aAAa,EACjC,oBAAC,YAAS,WAAU,aAAa;GAC7B;;AAQV,SAAgB,sBAAsB;AACpC,QACE,qBAAC;EAAI,WAAU;;GAEb,oBAAC,YAAS,WAAU,6BAA6B;GACjD,oBAAC,YAAS,WAAU,6BAA6B;GACjD,oBAAC,YAAS,WAAU,6BAA6B;GACjD,oBAAC,YAAS,WAAU,6BAA6B;GACjD,oBAAC,YAAS,WAAU,6BAA6B;GACjD,oBAAC,YAAS,WAAU,6BAA6B;GACjD,oBAAC,YAAS,WAAU,6BAA6B;GACjD,oBAAC,YAAS,WAAU,6BAA6B;GACjD,oBAAC,YAAS,WAAU,6BAA6B;GACjD,oBAAC,YAAS,WAAU,6BAA6B;;GAC7C;;AAQV,SAAgB,0BAA0B,EAAE,QAAQ,KAAyB;AAC3E,QACE,qBAAC;EAAI,WAAU;;GACb,oBAAC,gBAAc;GACd,QAAQ,KAAK,oBAAC,gBAAc;GAC5B,QAAQ,KAAK,oBAAC,gBAAc;GAC5B,QAAQ,KAAK,oBAAC,gBAAc;GAC5B,QAAQ,KAAK,oBAAC,gBAAc;;GACzB;;AAIV,SAAS,cAAc;AACrB,QACE,oBAAC;EAAI,WAAU;YACb,qBAAC;GAAI,WAAU;cACb,oBAAC,YAAS,WAAU,cAAc,EAClC,oBAAC,YAAS,WAAU,cAAc;IAC9B;GACF;;AAyDV,SAAgB,oBAAoB,EAClC,OAAO,GACP,UAAU,KAIT;AACD,QACE,qBAAC;EAAI,WAAU;;GAEb,qBAAC;IAAI,WAAU;;KACb,oBAAC,YAAS,WAAU,aAAa;KAChC,UAAU,KAAK,oBAAC,YAAS,WAAU,eAAe;KAClD,UAAU,KAAK,oBAAC,YAAS,WAAU,eAAe;;KAC/C;GAEN,oBAAC,oBAA0B,UAAW;GACrC,OAAO,KAAK,oBAAC,oBAA0B,UAAW;GAClD,OAAO,KAAK,oBAAC,oBAA0B,UAAW;GAClD,OAAO,KAAK,oBAAC,oBAA0B,UAAW;GAClD,OAAO,KAAK,oBAAC;IAA0B;IAAS;KAAO;;GACpD;;AAIV,SAAS,iBAAiB,EACxB,UAAU,GACV,OAAO,SAIN;AACD,QACE,qBAAC;EACC,WAAW,GACT,kDACA,QAAQ,WACT;;GAED,oBAAC,YAAS,WAAU,aAAa;GAChC,UAAU,KAAK,oBAAC,YAAS,WAAU,eAAe;GAClD,UAAU,KAAK,oBAAC,YAAS,WAAU,eAAe;;GAC/C;;AAQV,SAAgB,uBAAuB,EAAE,QAAQ,KAAyB;AACxE,QACE,qBAAC;EAAI,WAAU;;GACb,oBAAC,yBAAuB;GACvB,QAAQ,KAAK,oBAAC,yBAAuB;GACrC,QAAQ,KAAK,oBAAC,yBAAuB;GACrC,QAAQ,KAAK,oBAAC,yBAAuB;GACrC,QAAQ,KAAK,oBAAC,wBAAqB,aAAO;;GACvC;;AAIV,SAAS,qBAAqB,EAAE,OAAO,SAA6B;AAClE,QACE,qBAAC;EAAI,WAAU;aAEb,qBAAC;GAAI,WAAU;cACb,oBAAC,YAAS,WAAU,yBAAyB,EAC5C,CAAC,QAAQ,oBAAC,YAAS,WAAU,sBAAsB;IAChD,EAEN,qBAAC;GAAI,WAAU;;IACb,oBAAC,YAAS,WAAU,cAAc;IAClC,oBAAC,YAAS,WAAU,cAAc;IAClC,oBAAC,YAAS,WAAU,aAAa;;IAC7B;GACF;;AAQV,SAAgB,yBAAyB;AACvC,QACE,qBAAC;EAAI,WAAU;;GACb,qBAAC;IAAI,WAAU;eACb,oBAAC,YAAS,WAAU,aAAa,EACjC,oBAAC,YAAS,WAAU,aAAa;KAC7B;GACN,oBAAC,YAAS,WAAU,4BAA4B;GAChD,oBAAC,YAAS,WAAU,aAAa;;GAC7B;;AAQV,SAAgB,oBAAoB,EAClC,WAAW,SAGV;AACD,QACE,qBAAC;EAAI,WAAU;aACb,qBAAC;GAAI,WAAU;cACb,oBAAC,YAAS,WAAU,kCAAkC,EACtD,qBAAC;IAAI,WAAU;eACb,oBAAC,YAAS,WAAU,aAAa,EACjC,oBAAC,YAAS,WAAW,GAAG,OAAO,WAAW,SAAS,OAAO,GAAI;KAC1D;IACF,EACN,oBAAC,YAAS,WAAU,aAAa;GAC7B"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/client/context/focus-context.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Focus state types:
|
|
8
|
+
* - idle: nothing focused
|
|
9
|
+
* - field: regular field focused (e.g., "title", "slug")
|
|
10
|
+
* - block: block field focused, optionally with specific field within block
|
|
11
|
+
* - relation: relation field focused (opens ResourceSheet for editing)
|
|
12
|
+
*/
|
|
13
|
+
type FocusState = {
|
|
14
|
+
type: "idle";
|
|
15
|
+
} | {
|
|
16
|
+
type: "field";
|
|
17
|
+
fieldPath: string;
|
|
18
|
+
} | {
|
|
19
|
+
type: "block";
|
|
20
|
+
blockId: string;
|
|
21
|
+
fieldPath?: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: "relation";
|
|
24
|
+
fieldPath: string;
|
|
25
|
+
targetCollection?: string;
|
|
26
|
+
};
|
|
27
|
+
type FocusContextValue = {
|
|
28
|
+
/** Current focus state */
|
|
29
|
+
state: FocusState;
|
|
30
|
+
/** Focus a regular field by path */
|
|
31
|
+
focusField: (fieldPath: string) => void;
|
|
32
|
+
/** Focus a block, optionally a specific field within it */
|
|
33
|
+
focusBlock: (blockId: string, fieldPath?: string) => void;
|
|
34
|
+
/** Focus a relation field (opens ResourceSheet) */
|
|
35
|
+
focusRelation: (fieldPath: string, targetCollection?: string) => void;
|
|
36
|
+
/** Clear focus */
|
|
37
|
+
clearFocus: () => void;
|
|
38
|
+
/** Check if a field is focused */
|
|
39
|
+
isFieldFocused: (fieldPath: string) => boolean;
|
|
40
|
+
/** Check if a block is focused */
|
|
41
|
+
isBlockFocused: (blockId: string) => boolean;
|
|
42
|
+
};
|
|
43
|
+
type FocusProviderProps = {
|
|
44
|
+
children: React$1.ReactNode;
|
|
45
|
+
/** Callback when focus changes - useful for scrolling to field */
|
|
46
|
+
onFocusChange?: (state: FocusState) => void;
|
|
47
|
+
};
|
|
48
|
+
declare function FocusProvider({
|
|
49
|
+
children,
|
|
50
|
+
onFocusChange
|
|
51
|
+
}: FocusProviderProps): react_jsx_runtime20.JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* Use the focus context
|
|
54
|
+
*/
|
|
55
|
+
declare function useFocus(): FocusContextValue;
|
|
56
|
+
/**
|
|
57
|
+
* Use focus context if available (doesn't throw)
|
|
58
|
+
*/
|
|
59
|
+
declare function useFocusOptional(): FocusContextValue | null;
|
|
60
|
+
/**
|
|
61
|
+
* Hook for checking if a specific field is focused
|
|
62
|
+
*/
|
|
63
|
+
declare function useIsFieldFocused(fieldPath: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Hook for checking if a specific block is focused
|
|
66
|
+
*/
|
|
67
|
+
declare function useIsBlockFocused(blockId: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Parse a preview field path into focus state with optional context hints
|
|
70
|
+
* Examples:
|
|
71
|
+
* - "title" → { type: "field", fieldPath: "title" }
|
|
72
|
+
* - "content._values.abc123.title" → { type: "block", blockId: "abc123", fieldPath: "title" }
|
|
73
|
+
* - "author" + { fieldType: "relation" } → { type: "relation", fieldPath: "author" }
|
|
74
|
+
* - "title" + { blockId: "abc123" } → { type: "block", blockId: "abc123", fieldPath: "title" }
|
|
75
|
+
*/
|
|
76
|
+
declare function parsePreviewFieldPath(path: string, context?: {
|
|
77
|
+
blockId?: string;
|
|
78
|
+
fieldType?: "regular" | "block" | "relation";
|
|
79
|
+
targetCollection?: string;
|
|
80
|
+
}): FocusState;
|
|
81
|
+
/**
|
|
82
|
+
* Scroll a field into view and focus it.
|
|
83
|
+
* Finds the field wrapper by data-field-path within the preview form scope.
|
|
84
|
+
*/
|
|
85
|
+
declare function scrollFieldIntoView(fieldPath: string): void;
|
|
86
|
+
//#endregion
|
|
87
|
+
export { FocusContextValue, FocusProvider, FocusProviderProps, FocusState, parsePreviewFieldPath, scrollFieldIntoView, useFocus, useFocusOptional, useIsBlockFocused, useIsFieldFocused };
|
|
88
|
+
//# sourceMappingURL=focus-context.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus-context.d.mts","names":[],"sources":["../../../src/client/context/focus-context.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;AA6IA;AAWA;AAOgB,KAxIJ,UAAA,GAwIqB;EASjB,IAAA,EAAA,MAAA;AAkBhB,CAAA,GAAgB;EAgEA,IAAA,EAAA,OAAA;;;;;;;;;;;KA7NJ,iBAAA;;SAEH;;;;;;;;;;;;;;KAyBG,kBAAA;YACA,OAAA,CAAM;;0BAEQ;;iBAGV,aAAA;;;GAA2C,qBAAkB,mBAAA,CAAA,GAAA,CAAA;;;;iBA+E7D,QAAA,CAAA,GAAY;;;;iBAWZ,gBAAA,CAAA,GAAoB;;;;iBAOpB,iBAAA;;;;iBASA,iBAAA;;;;;;;;;iBAkBA,qBAAA;;;;IAOb;;;;;iBAyDa,mBAAA"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/client/context/focus-context.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Focus Context
|
|
9
|
+
*
|
|
10
|
+
* State machine for managing field focus across the form editor.
|
|
11
|
+
* Supports focusing regular fields and nested block fields.
|
|
12
|
+
* Used for preview click-to-focus functionality.
|
|
13
|
+
*/
|
|
14
|
+
const FocusContext = React$1.createContext(null);
|
|
15
|
+
function FocusProvider({ children, onFocusChange }) {
|
|
16
|
+
const [state, setState] = React$1.useState({ type: "idle" });
|
|
17
|
+
const focusField = React$1.useCallback((fieldPath) => {
|
|
18
|
+
const newState = {
|
|
19
|
+
type: "field",
|
|
20
|
+
fieldPath
|
|
21
|
+
};
|
|
22
|
+
setState(newState);
|
|
23
|
+
onFocusChange?.(newState);
|
|
24
|
+
}, [onFocusChange]);
|
|
25
|
+
const focusBlock = React$1.useCallback((blockId, fieldPath) => {
|
|
26
|
+
const newState = {
|
|
27
|
+
type: "block",
|
|
28
|
+
blockId,
|
|
29
|
+
fieldPath
|
|
30
|
+
};
|
|
31
|
+
setState(newState);
|
|
32
|
+
onFocusChange?.(newState);
|
|
33
|
+
}, [onFocusChange]);
|
|
34
|
+
const focusRelation = React$1.useCallback((fieldPath, targetCollection) => {
|
|
35
|
+
const newState = {
|
|
36
|
+
type: "relation",
|
|
37
|
+
fieldPath,
|
|
38
|
+
targetCollection
|
|
39
|
+
};
|
|
40
|
+
setState(newState);
|
|
41
|
+
onFocusChange?.(newState);
|
|
42
|
+
}, [onFocusChange]);
|
|
43
|
+
const clearFocus = React$1.useCallback(() => {
|
|
44
|
+
const newState = { type: "idle" };
|
|
45
|
+
setState(newState);
|
|
46
|
+
onFocusChange?.(newState);
|
|
47
|
+
}, [onFocusChange]);
|
|
48
|
+
const focusedFieldPath = state.type === "field" ? state.fieldPath : void 0;
|
|
49
|
+
const focusedBlockId = state.type === "block" ? state.blockId : void 0;
|
|
50
|
+
const value = React$1.useMemo(() => ({
|
|
51
|
+
state,
|
|
52
|
+
focusField,
|
|
53
|
+
focusBlock,
|
|
54
|
+
focusRelation,
|
|
55
|
+
clearFocus,
|
|
56
|
+
isFieldFocused: (path) => focusedFieldPath === path,
|
|
57
|
+
isBlockFocused: (id) => focusedBlockId === id
|
|
58
|
+
}), [
|
|
59
|
+
state,
|
|
60
|
+
focusField,
|
|
61
|
+
focusBlock,
|
|
62
|
+
focusRelation,
|
|
63
|
+
clearFocus,
|
|
64
|
+
focusedFieldPath,
|
|
65
|
+
focusedBlockId
|
|
66
|
+
]);
|
|
67
|
+
return /* @__PURE__ */ jsx(FocusContext.Provider, {
|
|
68
|
+
value,
|
|
69
|
+
children
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Use the focus context
|
|
74
|
+
*/
|
|
75
|
+
function useFocus() {
|
|
76
|
+
const context = React$1.useContext(FocusContext);
|
|
77
|
+
if (!context) throw new Error("useFocus must be used within a FocusProvider");
|
|
78
|
+
return context;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Use focus context if available (doesn't throw)
|
|
82
|
+
*/
|
|
83
|
+
function useFocusOptional() {
|
|
84
|
+
return React$1.useContext(FocusContext);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Hook for checking if a specific field is focused
|
|
88
|
+
*/
|
|
89
|
+
function useIsFieldFocused(fieldPath) {
|
|
90
|
+
const context = React$1.useContext(FocusContext);
|
|
91
|
+
if (!context) return false;
|
|
92
|
+
return context.isFieldFocused(fieldPath);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Hook for checking if a specific block is focused
|
|
96
|
+
*/
|
|
97
|
+
function useIsBlockFocused(blockId) {
|
|
98
|
+
const context = React$1.useContext(FocusContext);
|
|
99
|
+
if (!context) return false;
|
|
100
|
+
return context.isBlockFocused(blockId);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Parse a preview field path into focus state with optional context hints
|
|
104
|
+
* Examples:
|
|
105
|
+
* - "title" → { type: "field", fieldPath: "title" }
|
|
106
|
+
* - "content._values.abc123.title" → { type: "block", blockId: "abc123", fieldPath: "title" }
|
|
107
|
+
* - "author" + { fieldType: "relation" } → { type: "relation", fieldPath: "author" }
|
|
108
|
+
* - "title" + { blockId: "abc123" } → { type: "block", blockId: "abc123", fieldPath: "title" }
|
|
109
|
+
*/
|
|
110
|
+
function parsePreviewFieldPath(path, context) {
|
|
111
|
+
if (context?.fieldType === "relation") return {
|
|
112
|
+
type: "relation",
|
|
113
|
+
fieldPath: path,
|
|
114
|
+
targetCollection: context.targetCollection
|
|
115
|
+
};
|
|
116
|
+
const blockMatch = path.match(/^content\._values\.([^.]+)(?:\.(.+))?$/);
|
|
117
|
+
if (blockMatch) {
|
|
118
|
+
const [, blockId, fieldPath] = blockMatch;
|
|
119
|
+
return {
|
|
120
|
+
type: "block",
|
|
121
|
+
blockId,
|
|
122
|
+
fieldPath
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const legacyBlockMatch = path.match(/^content\.blocks\.([^.]+)(?:\.(.+))?$/);
|
|
126
|
+
if (legacyBlockMatch) {
|
|
127
|
+
const [, blockId, fieldPath] = legacyBlockMatch;
|
|
128
|
+
return {
|
|
129
|
+
type: "block",
|
|
130
|
+
blockId,
|
|
131
|
+
fieldPath
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (context?.blockId) {
|
|
135
|
+
const relativeField = extractRelativeField(path, context.blockId);
|
|
136
|
+
return {
|
|
137
|
+
type: "block",
|
|
138
|
+
blockId: context.blockId,
|
|
139
|
+
fieldPath: relativeField
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
type: "field",
|
|
144
|
+
fieldPath: path
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Extract relative field path from a full path given a block ID
|
|
149
|
+
* Examples:
|
|
150
|
+
* - extractRelativeField("content._values.abc123.title", "abc123") → "title"
|
|
151
|
+
* - extractRelativeField("title", "abc123") → "title"
|
|
152
|
+
*/
|
|
153
|
+
function extractRelativeField(path, blockId) {
|
|
154
|
+
const prefix = `content._values.${blockId}.`;
|
|
155
|
+
if (path.startsWith(prefix)) return path.slice(prefix.length);
|
|
156
|
+
return path;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Scroll a field into view and focus it.
|
|
160
|
+
* Finds the field wrapper by data-field-path within the preview form scope.
|
|
161
|
+
*/
|
|
162
|
+
function scrollFieldIntoView(fieldPath) {
|
|
163
|
+
const wrapper = (document.querySelector("[data-preview-form-scope]") ?? document).querySelector(`[data-field-path="${fieldPath}"]`);
|
|
164
|
+
if (!wrapper) return;
|
|
165
|
+
const focusable = wrapper.querySelector("input:not([type=\"hidden\"]), textarea, button, select, [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]");
|
|
166
|
+
(focusable ?? wrapper).scrollIntoView({
|
|
167
|
+
behavior: "smooth",
|
|
168
|
+
block: "center"
|
|
169
|
+
});
|
|
170
|
+
if (focusable) requestAnimationFrame(() => {
|
|
171
|
+
window.focus();
|
|
172
|
+
focusable.focus();
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
//#endregion
|
|
177
|
+
export { FocusProvider, parsePreviewFieldPath, scrollFieldIntoView, useFocus, useFocusOptional, useIsBlockFocused, useIsFieldFocused };
|
|
178
|
+
//# sourceMappingURL=focus-context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus-context.mjs","names":["React","newState: FocusState"],"sources":["../../../src/client/context/focus-context.tsx"],"sourcesContent":["/**\n * Focus Context\n *\n * State machine for managing field focus across the form editor.\n * Supports focusing regular fields and nested block fields.\n * Used for preview click-to-focus functionality.\n */\n\n\"use client\";\n\nimport * as React from \"react\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Focus state types:\n * - idle: nothing focused\n * - field: regular field focused (e.g., \"title\", \"slug\")\n * - block: block field focused, optionally with specific field within block\n * - relation: relation field focused (opens ResourceSheet for editing)\n */\nexport type FocusState =\n | { type: \"idle\" }\n | { type: \"field\"; fieldPath: string }\n | { type: \"block\"; blockId: string; fieldPath?: string }\n | { type: \"relation\"; fieldPath: string; targetCollection?: string };\n\nexport type FocusContextValue = {\n /** Current focus state */\n state: FocusState;\n /** Focus a regular field by path */\n focusField: (fieldPath: string) => void;\n /** Focus a block, optionally a specific field within it */\n focusBlock: (blockId: string, fieldPath?: string) => void;\n /** Focus a relation field (opens ResourceSheet) */\n focusRelation: (fieldPath: string, targetCollection?: string) => void;\n /** Clear focus */\n clearFocus: () => void;\n /** Check if a field is focused */\n isFieldFocused: (fieldPath: string) => boolean;\n /** Check if a block is focused */\n isBlockFocused: (blockId: string) => boolean;\n};\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst FocusContext = React.createContext<FocusContextValue | null>(null);\n\n// ============================================================================\n// Provider\n// ============================================================================\n\nexport type FocusProviderProps = {\n children: React.ReactNode;\n /** Callback when focus changes - useful for scrolling to field */\n onFocusChange?: (state: FocusState) => void;\n};\n\nexport function FocusProvider({ children, onFocusChange }: FocusProviderProps) {\n const [state, setState] = React.useState<FocusState>({ type: \"idle\" });\n\n // Use functional setState for stable callbacks (React best practice)\n const focusField = React.useCallback(\n (fieldPath: string) => {\n const newState: FocusState = { type: \"field\", fieldPath };\n setState(newState);\n onFocusChange?.(newState);\n },\n [onFocusChange],\n );\n\n const focusBlock = React.useCallback(\n (blockId: string, fieldPath?: string) => {\n const newState: FocusState = { type: \"block\", blockId, fieldPath };\n setState(newState);\n onFocusChange?.(newState);\n },\n [onFocusChange],\n );\n\n const focusRelation = React.useCallback(\n (fieldPath: string, targetCollection?: string) => {\n const newState: FocusState = {\n type: \"relation\",\n fieldPath,\n targetCollection,\n };\n setState(newState);\n onFocusChange?.(newState);\n },\n [onFocusChange],\n );\n\n const clearFocus = React.useCallback(() => {\n const newState: FocusState = { type: \"idle\" };\n setState(newState);\n onFocusChange?.(newState);\n }, [onFocusChange]);\n\n // Derive focused field/block from state for direct comparison\n const focusedFieldPath = state.type === \"field\" ? state.fieldPath : undefined;\n const focusedBlockId = state.type === \"block\" ? state.blockId : undefined;\n\n const value = React.useMemo(\n (): FocusContextValue => ({\n state,\n focusField,\n focusBlock,\n focusRelation,\n clearFocus,\n // Simple equality checks - no callback overhead\n isFieldFocused: (path: string) => focusedFieldPath === path,\n isBlockFocused: (id: string) => focusedBlockId === id,\n }),\n [\n state,\n focusField,\n focusBlock,\n focusRelation,\n clearFocus,\n focusedFieldPath,\n focusedBlockId,\n ],\n );\n\n return (\n <FocusContext.Provider value={value}>{children}</FocusContext.Provider>\n );\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Use the focus context\n */\nexport function useFocus(): FocusContextValue {\n const context = React.useContext(FocusContext);\n if (!context) {\n throw new Error(\"useFocus must be used within a FocusProvider\");\n }\n return context;\n}\n\n/**\n * Use focus context if available (doesn't throw)\n */\nexport function useFocusOptional(): FocusContextValue | null {\n return React.useContext(FocusContext);\n}\n\n/**\n * Hook for checking if a specific field is focused\n */\nexport function useIsFieldFocused(fieldPath: string): boolean {\n const context = React.useContext(FocusContext);\n if (!context) return false;\n return context.isFieldFocused(fieldPath);\n}\n\n/**\n * Hook for checking if a specific block is focused\n */\nexport function useIsBlockFocused(blockId: string): boolean {\n const context = React.useContext(FocusContext);\n if (!context) return false;\n return context.isBlockFocused(blockId);\n}\n\n// ============================================================================\n// Utilities\n// ============================================================================\n\n/**\n * Parse a preview field path into focus state with optional context hints\n * Examples:\n * - \"title\" → { type: \"field\", fieldPath: \"title\" }\n * - \"content._values.abc123.title\" → { type: \"block\", blockId: \"abc123\", fieldPath: \"title\" }\n * - \"author\" + { fieldType: \"relation\" } → { type: \"relation\", fieldPath: \"author\" }\n * - \"title\" + { blockId: \"abc123\" } → { type: \"block\", blockId: \"abc123\", fieldPath: \"title\" }\n */\nexport function parsePreviewFieldPath(\n path: string,\n context?: {\n blockId?: string;\n fieldType?: \"regular\" | \"block\" | \"relation\";\n targetCollection?: string;\n },\n): FocusState {\n // Relation field from context\n if (context?.fieldType === \"relation\") {\n return {\n type: \"relation\",\n fieldPath: path,\n targetCollection: context.targetCollection,\n };\n }\n\n // Check if it's a block field path (content._values.{id}.{field})\n const blockMatch = path.match(/^content\\._values\\.([^.]+)(?:\\.(.+))?$/);\n if (blockMatch) {\n const [, blockId, fieldPath] = blockMatch;\n return { type: \"block\", blockId, fieldPath };\n }\n\n // Legacy block path format (content.blocks.{id}.{field})\n const legacyBlockMatch = path.match(/^content\\.blocks\\.([^.]+)(?:\\.(.+))?$/);\n if (legacyBlockMatch) {\n const [, blockId, fieldPath] = legacyBlockMatch;\n return { type: \"block\", blockId, fieldPath };\n }\n\n // Block field from context hint\n if (context?.blockId) {\n // Extract relative field path if present\n const relativeField = extractRelativeField(path, context.blockId);\n return {\n type: \"block\",\n blockId: context.blockId,\n fieldPath: relativeField,\n };\n }\n\n // Regular field\n return { type: \"field\", fieldPath: path };\n}\n\n/**\n * Extract relative field path from a full path given a block ID\n * Examples:\n * - extractRelativeField(\"content._values.abc123.title\", \"abc123\") → \"title\"\n * - extractRelativeField(\"title\", \"abc123\") → \"title\"\n */\nfunction extractRelativeField(path: string, blockId: string): string {\n const prefix = `content._values.${blockId}.`;\n if (path.startsWith(prefix)) {\n return path.slice(prefix.length);\n }\n return path;\n}\n\n/**\n * Scroll a field into view and focus it.\n * Finds the field wrapper by data-field-path within the preview form scope.\n */\nexport function scrollFieldIntoView(fieldPath: string): void {\n // First try to find within the preview form scope (to avoid matching fields in other forms)\n const formScope = document.querySelector<HTMLElement>(\n \"[data-preview-form-scope]\",\n );\n const searchRoot = formScope ?? document;\n\n const wrapper = searchRoot.querySelector<HTMLElement>(\n `[data-field-path=\"${fieldPath}\"]`,\n );\n if (!wrapper) return;\n\n // Find first focusable element inside the wrapper\n const focusable = wrapper.querySelector<HTMLElement>(\n 'input:not([type=\"hidden\"]), textarea, button, select, [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]',\n );\n\n const target = focusable ?? wrapper;\n target.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n\n if (focusable) {\n // Use requestAnimationFrame to focus after scroll starts\n requestAnimationFrame(() => {\n // Pull focus from iframe back to parent window\n window.focus();\n focusable.focus();\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAkDA,MAAM,eAAeA,QAAM,cAAwC,KAAK;AAYxE,SAAgB,cAAc,EAAE,UAAU,iBAAqC;CAC7E,MAAM,CAAC,OAAO,YAAYA,QAAM,SAAqB,EAAE,MAAM,QAAQ,CAAC;CAGtE,MAAM,aAAaA,QAAM,aACtB,cAAsB;EACrB,MAAMC,WAAuB;GAAE,MAAM;GAAS;GAAW;AACzD,WAAS,SAAS;AAClB,kBAAgB,SAAS;IAE3B,CAAC,cAAc,CAChB;CAED,MAAM,aAAaD,QAAM,aACtB,SAAiB,cAAuB;EACvC,MAAMC,WAAuB;GAAE,MAAM;GAAS;GAAS;GAAW;AAClE,WAAS,SAAS;AAClB,kBAAgB,SAAS;IAE3B,CAAC,cAAc,CAChB;CAED,MAAM,gBAAgBD,QAAM,aACzB,WAAmB,qBAA8B;EAChD,MAAMC,WAAuB;GAC3B,MAAM;GACN;GACA;GACD;AACD,WAAS,SAAS;AAClB,kBAAgB,SAAS;IAE3B,CAAC,cAAc,CAChB;CAED,MAAM,aAAaD,QAAM,kBAAkB;EACzC,MAAMC,WAAuB,EAAE,MAAM,QAAQ;AAC7C,WAAS,SAAS;AAClB,kBAAgB,SAAS;IACxB,CAAC,cAAc,CAAC;CAGnB,MAAM,mBAAmB,MAAM,SAAS,UAAU,MAAM,YAAY;CACpE,MAAM,iBAAiB,MAAM,SAAS,UAAU,MAAM,UAAU;CAEhE,MAAM,QAAQD,QAAM,eACQ;EACxB;EACA;EACA;EACA;EACA;EAEA,iBAAiB,SAAiB,qBAAqB;EACvD,iBAAiB,OAAe,mBAAmB;EACpD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,oBAAC,aAAa;EAAgB;EAAQ;GAAiC;;;;;AAW3E,SAAgB,WAA8B;CAC5C,MAAM,UAAUA,QAAM,WAAW,aAAa;AAC9C,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,+CAA+C;AAEjE,QAAO;;;;;AAMT,SAAgB,mBAA6C;AAC3D,QAAOA,QAAM,WAAW,aAAa;;;;;AAMvC,SAAgB,kBAAkB,WAA4B;CAC5D,MAAM,UAAUA,QAAM,WAAW,aAAa;AAC9C,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO,QAAQ,eAAe,UAAU;;;;;AAM1C,SAAgB,kBAAkB,SAA0B;CAC1D,MAAM,UAAUA,QAAM,WAAW,aAAa;AAC9C,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO,QAAQ,eAAe,QAAQ;;;;;;;;;;AAexC,SAAgB,sBACd,MACA,SAKY;AAEZ,KAAI,SAAS,cAAc,WACzB,QAAO;EACL,MAAM;EACN,WAAW;EACX,kBAAkB,QAAQ;EAC3B;CAIH,MAAM,aAAa,KAAK,MAAM,yCAAyC;AACvE,KAAI,YAAY;EACd,MAAM,GAAG,SAAS,aAAa;AAC/B,SAAO;GAAE,MAAM;GAAS;GAAS;GAAW;;CAI9C,MAAM,mBAAmB,KAAK,MAAM,wCAAwC;AAC5E,KAAI,kBAAkB;EACpB,MAAM,GAAG,SAAS,aAAa;AAC/B,SAAO;GAAE,MAAM;GAAS;GAAS;GAAW;;AAI9C,KAAI,SAAS,SAAS;EAEpB,MAAM,gBAAgB,qBAAqB,MAAM,QAAQ,QAAQ;AACjE,SAAO;GACL,MAAM;GACN,SAAS,QAAQ;GACjB,WAAW;GACZ;;AAIH,QAAO;EAAE,MAAM;EAAS,WAAW;EAAM;;;;;;;;AAS3C,SAAS,qBAAqB,MAAc,SAAyB;CACnE,MAAM,SAAS,mBAAmB,QAAQ;AAC1C,KAAI,KAAK,WAAW,OAAO,CACzB,QAAO,KAAK,MAAM,OAAO,OAAO;AAElC,QAAO;;;;;;AAOT,SAAgB,oBAAoB,WAAyB;CAO3D,MAAM,WALY,SAAS,cACzB,4BACD,IAC+B,UAEL,cACzB,qBAAqB,UAAU,IAChC;AACD,KAAI,CAAC,QAAS;CAGd,MAAM,YAAY,QAAQ,cACxB,wHACD;AAGD,EADe,aAAa,SACrB,eAAe;EAAE,UAAU;EAAU,OAAO;EAAU,CAAC;AAE9D,KAAI,UAEF,6BAA4B;AAE1B,SAAO,OAAO;AACd,YAAU,OAAO;GACjB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/client/contexts/breadcrumb-context.tsx
|
|
5
|
+
const BreadcrumbContext = React$1.createContext(null);
|
|
6
|
+
function BreadcrumbProvider({ children }) {
|
|
7
|
+
const [breadcrumbs, setBreadcrumbs] = React$1.useState([]);
|
|
8
|
+
const value = React$1.useMemo(() => ({
|
|
9
|
+
breadcrumbs,
|
|
10
|
+
setBreadcrumbs
|
|
11
|
+
}), [breadcrumbs]);
|
|
12
|
+
return /* @__PURE__ */ jsx(BreadcrumbContext.Provider, {
|
|
13
|
+
value,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get breadcrumb context (optional - returns null if not in provider)
|
|
19
|
+
*/
|
|
20
|
+
function useBreadcrumbContextOptional() {
|
|
21
|
+
return React$1.useContext(BreadcrumbContext);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get current breadcrumbs (read-only)
|
|
25
|
+
*/
|
|
26
|
+
function useCurrentBreadcrumbs() {
|
|
27
|
+
return useBreadcrumbContextOptional()?.breadcrumbs ?? [];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { BreadcrumbProvider, useCurrentBreadcrumbs };
|
|
32
|
+
//# sourceMappingURL=breadcrumb-context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb-context.mjs","names":["React"],"sources":["../../../src/client/contexts/breadcrumb-context.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { I18nText } from \"../i18n/types\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Simple icon component type for breadcrumbs\n */\ntype BreadcrumbIcon = React.ComponentType<{ className?: string }>;\n\n/**\n * Menu item for breadcrumb dropdown\n */\nexport interface BreadcrumbMenuItem {\n label: I18nText;\n href: string;\n icon?: BreadcrumbIcon;\n}\n\n/**\n * Single breadcrumb item\n */\nexport interface Breadcrumb {\n /**\n * Display label (supports I18nText for localization)\n */\n label: I18nText;\n\n /**\n * Navigation href (optional - last item usually doesn't have one)\n */\n href?: string;\n\n /**\n * Icon component (optional)\n */\n icon?: BreadcrumbIcon;\n\n /**\n * Dropdown menu items for quick navigation\n * e.g., switch between collections or items\n */\n menu?: {\n items: BreadcrumbMenuItem[];\n };\n}\n\n/**\n * Breadcrumb context value\n */\ninterface BreadcrumbContextValue {\n breadcrumbs: Breadcrumb[];\n setBreadcrumbs: (breadcrumbs: Breadcrumb[]) => void;\n}\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst BreadcrumbContext = React.createContext<BreadcrumbContextValue | null>(\n null,\n);\n\n// ============================================================================\n// Provider\n// ============================================================================\n\nexport interface BreadcrumbProviderProps {\n children: React.ReactNode;\n}\n\nexport function BreadcrumbProvider({\n children,\n}: BreadcrumbProviderProps): React.ReactElement {\n const [breadcrumbs, setBreadcrumbs] = React.useState<Breadcrumb[]>([]);\n\n const value = React.useMemo(\n () => ({\n breadcrumbs,\n setBreadcrumbs,\n }),\n [breadcrumbs],\n );\n\n return (\n <BreadcrumbContext.Provider value={value}>\n {children}\n </BreadcrumbContext.Provider>\n );\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Get breadcrumb context\n * @throws if used outside BreadcrumbProvider\n */\nexport function useBreadcrumbContext(): BreadcrumbContextValue {\n const context = React.useContext(BreadcrumbContext);\n if (!context) {\n throw new Error(\n \"useBreadcrumbContext must be used within a BreadcrumbProvider\",\n );\n }\n return context;\n}\n\n/**\n * Get breadcrumb context (optional - returns null if not in provider)\n */\nexport function useBreadcrumbContextOptional(): BreadcrumbContextValue | null {\n return React.useContext(BreadcrumbContext);\n}\n\n/**\n * Set breadcrumbs for the current page\n * Automatically cleans up on unmount\n *\n * @example\n * ```tsx\n * function PostsListPage() {\n * useBreadcrumbs([\n * { label: \"Dashboard\", href: \"/admin\", icon: House },\n * { label: \"Posts\", icon: Article },\n * ]);\n *\n * return <div>...</div>;\n * }\n * ```\n */\nexport function useBreadcrumbs(breadcrumbs: Breadcrumb[]): void {\n const context = useBreadcrumbContextOptional();\n\n React.useEffect(() => {\n if (!context) return;\n\n context.setBreadcrumbs(breadcrumbs);\n\n return () => {\n context.setBreadcrumbs([]);\n };\n }, [context, breadcrumbs]);\n}\n\n/**\n * Get current breadcrumbs (read-only)\n */\nexport function useCurrentBreadcrumbs(): Breadcrumb[] {\n const context = useBreadcrumbContextOptional();\n return context?.breadcrumbs ?? [];\n}\n"],"mappings":";;;;AA6DA,MAAM,oBAAoBA,QAAM,cAC9B,KACD;AAUD,SAAgB,mBAAmB,EACjC,YAC8C;CAC9C,MAAM,CAAC,aAAa,kBAAkBA,QAAM,SAAuB,EAAE,CAAC;CAEtE,MAAM,QAAQA,QAAM,eACX;EACL;EACA;EACD,GACD,CAAC,YAAY,CACd;AAED,QACE,oBAAC,kBAAkB;EAAgB;EAChC;GAC0B;;;;;AAyBjC,SAAgB,+BAA8D;AAC5E,QAAOA,QAAM,WAAW,kBAAkB;;;;;AAoC5C,SAAgB,wBAAsC;AAEpD,QADgB,8BAA8B,EAC9B,eAAe,EAAE"}
|