@questpie/admin 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +245 -474
- package/dist/_virtual/rolldown_runtime.mjs +18 -0
- package/dist/augmentation.d.mts +315 -0
- package/dist/augmentation.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.d.mts +199 -0
- package/dist/client/blocks/block-registry.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.mjs +88 -0
- package/dist/client/blocks/block-registry.mjs.map +1 -0
- package/dist/client/blocks/block-renderer.d.mts +52 -0
- package/dist/client/blocks/block-renderer.d.mts.map +1 -0
- package/dist/client/blocks/block-renderer.mjs +71 -0
- package/dist/client/blocks/block-renderer.mjs.map +1 -0
- package/dist/client/blocks/index.d.mts +4 -0
- package/dist/client/blocks/prefetch.d.mts +45 -0
- package/dist/client/blocks/prefetch.d.mts.map +1 -0
- package/dist/client/blocks/prefetch.mjs +26 -0
- package/dist/client/blocks/prefetch.mjs.map +1 -0
- package/dist/client/blocks/types.d.mts +69 -0
- package/dist/client/blocks/types.d.mts.map +1 -0
- package/dist/client/blocks/types.mjs +20 -0
- package/dist/client/blocks/types.mjs.map +1 -0
- package/dist/client/builder/admin-builder.d.mts +112 -0
- package/dist/client/builder/admin-builder.d.mts.map +1 -0
- package/dist/client/builder/admin-builder.mjs +185 -0
- package/dist/client/builder/admin-builder.mjs.map +1 -0
- package/dist/client/builder/admin-types.d.mts +73 -0
- package/dist/client/builder/admin-types.d.mts.map +1 -0
- package/dist/client/builder/admin.d.mts +121 -0
- package/dist/client/builder/admin.d.mts.map +1 -0
- package/dist/client/builder/admin.mjs +160 -0
- package/dist/client/builder/admin.mjs.map +1 -0
- package/dist/client/builder/defaults/components.mjs +20 -0
- package/dist/client/builder/defaults/components.mjs.map +1 -0
- package/dist/client/builder/defaults/core.d.mts +354 -0
- package/dist/client/builder/defaults/core.d.mts.map +1 -0
- package/dist/client/builder/defaults/core.mjs +49 -0
- package/dist/client/builder/defaults/core.mjs.map +1 -0
- package/dist/client/builder/defaults/fields.mjs +328 -0
- package/dist/client/builder/defaults/fields.mjs.map +1 -0
- package/dist/client/builder/defaults/pages.mjs +58 -0
- package/dist/client/builder/defaults/pages.mjs.map +1 -0
- package/dist/client/builder/defaults/starter.d.mts +351 -0
- package/dist/client/builder/defaults/starter.d.mts.map +1 -0
- package/dist/client/builder/defaults/starter.mjs +28 -0
- package/dist/client/builder/defaults/starter.mjs.map +1 -0
- package/dist/client/builder/defaults/views.mjs +27 -0
- package/dist/client/builder/defaults/views.mjs.map +1 -0
- package/dist/client/builder/defaults/widgets.mjs +31 -0
- package/dist/client/builder/defaults/widgets.mjs.map +1 -0
- package/dist/client/builder/field/field.d.mts +229 -0
- package/dist/client/builder/field/field.d.mts.map +1 -0
- package/dist/client/builder/field/field.mjs +83 -0
- package/dist/client/builder/field/field.mjs.map +1 -0
- package/dist/client/builder/index.d.mts +36 -0
- package/dist/client/builder/index.d.mts.map +1 -0
- package/dist/client/builder/page/page.d.mts +36 -0
- package/dist/client/builder/page/page.d.mts.map +1 -0
- package/dist/client/builder/page/page.mjs +27 -0
- package/dist/client/builder/page/page.mjs.map +1 -0
- package/dist/client/builder/proxies.d.mts +2 -0
- package/dist/client/builder/proxies.mjs +24 -0
- package/dist/client/builder/proxies.mjs.map +1 -0
- package/dist/client/builder/qa.d.mts +50 -0
- package/dist/client/builder/qa.d.mts.map +1 -0
- package/dist/client/builder/qa.mjs +42 -0
- package/dist/client/builder/qa.mjs.map +1 -0
- package/dist/client/builder/registry.d.mts +70 -0
- package/dist/client/builder/registry.d.mts.map +1 -0
- package/dist/client/builder/types/action-registry.d.mts +2 -0
- package/dist/client/builder/types/action-registry.mjs +142 -0
- package/dist/client/builder/types/action-registry.mjs.map +1 -0
- package/dist/client/builder/types/action-types.d.mts +253 -0
- package/dist/client/builder/types/action-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.d.mts +199 -0
- package/dist/client/builder/types/collection-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.mjs +11 -0
- package/dist/client/builder/types/collection-types.mjs.map +1 -0
- package/dist/client/builder/types/common.d.mts +60 -0
- package/dist/client/builder/types/common.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.d.mts +593 -0
- package/dist/client/builder/types/field-types.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.mjs +19 -0
- package/dist/client/builder/types/field-types.mjs.map +1 -0
- package/dist/client/builder/types/global-types.d.mts +22 -0
- package/dist/client/builder/types/global-types.d.mts.map +1 -0
- package/dist/client/builder/types/ui-config.d.mts +160 -0
- package/dist/client/builder/types/ui-config.d.mts.map +1 -0
- package/dist/client/builder/types/views.d.mts +89 -0
- package/dist/client/builder/types/views.d.mts.map +1 -0
- package/dist/client/builder/types/widget-types.d.mts +563 -0
- package/dist/client/builder/types/widget-types.d.mts.map +1 -0
- package/dist/client/builder/validation.d.mts +3 -0
- package/dist/client/builder/validation.mjs +208 -0
- package/dist/client/builder/validation.mjs.map +1 -0
- package/dist/client/builder/view/view.d.mts +129 -0
- package/dist/client/builder/view/view.d.mts.map +1 -0
- package/dist/client/builder/view/view.mjs +109 -0
- package/dist/client/builder/view/view.mjs.map +1 -0
- package/dist/client/builder/widget/widget.d.mts +33 -0
- package/dist/client/builder/widget/widget.d.mts.map +1 -0
- package/dist/client/builder/widget/widget.mjs +26 -0
- package/dist/client/builder/widget/widget.mjs.map +1 -0
- package/dist/client/components/actions/action-button.d.mts +2 -0
- package/dist/client/components/actions/action-button.mjs +135 -0
- package/dist/client/components/actions/action-button.mjs.map +1 -0
- package/dist/client/components/actions/action-dialog.d.mts +2 -0
- package/dist/client/components/actions/action-dialog.mjs +264 -0
- package/dist/client/components/actions/action-dialog.mjs.map +1 -0
- package/dist/client/components/actions/confirmation-dialog.d.mts +2 -0
- package/dist/client/components/actions/confirmation-dialog.mjs +82 -0
- package/dist/client/components/actions/confirmation-dialog.mjs.map +1 -0
- package/dist/client/components/actions/header-actions.d.mts +2 -0
- package/dist/client/components/actions/header-actions.mjs +117 -0
- package/dist/client/components/actions/header-actions.mjs.map +1 -0
- package/dist/client/components/actions/index.d.mts +4 -0
- package/dist/client/components/admin-link.d.mts +67 -0
- package/dist/client/components/admin-link.d.mts.map +1 -0
- package/dist/client/components/admin-link.mjs +92 -0
- package/dist/client/components/admin-link.mjs.map +1 -0
- package/dist/client/components/auth/auth-guard.d.mts +51 -0
- package/dist/client/components/auth/auth-guard.d.mts.map +1 -0
- package/dist/client/components/auth/auth-guard.mjs +60 -0
- package/dist/client/components/auth/auth-guard.mjs.map +1 -0
- package/dist/client/components/auth/auth-loading.d.mts +36 -0
- package/dist/client/components/auth/auth-loading.d.mts.map +1 -0
- package/dist/client/components/auth/auth-loading.mjs +27 -0
- package/dist/client/components/auth/auth-loading.mjs.map +1 -0
- package/dist/client/components/auth/index.d.mts +2 -0
- package/dist/client/components/blocks/block-canvas.mjs +90 -0
- package/dist/client/components/blocks/block-canvas.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-context.mjs +58 -0
- package/dist/client/components/blocks/block-editor-context.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-layout.mjs +82 -0
- package/dist/client/components/blocks/block-editor-layout.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-provider.mjs +155 -0
- package/dist/client/components/blocks/block-editor-provider.mjs.map +1 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs +70 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs.map +1 -0
- package/dist/client/components/blocks/block-insert-button.mjs +72 -0
- package/dist/client/components/blocks/block-insert-button.mjs.map +1 -0
- package/dist/client/components/blocks/block-item-menu.mjs +161 -0
- package/dist/client/components/blocks/block-item-menu.mjs.map +1 -0
- package/dist/client/components/blocks/block-item.mjs +187 -0
- package/dist/client/components/blocks/block-item.mjs.map +1 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs +190 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs.map +1 -0
- package/dist/client/components/blocks/block-tree.mjs +45 -0
- package/dist/client/components/blocks/block-tree.mjs.map +1 -0
- package/dist/client/components/blocks/block-type-icon.mjs +50 -0
- package/dist/client/components/blocks/block-type-icon.mjs.map +1 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs +186 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs.map +1 -0
- package/dist/client/components/component-renderer.d.mts +125 -0
- package/dist/client/components/component-renderer.d.mts.map +1 -0
- package/dist/client/components/component-renderer.mjs +145 -0
- package/dist/client/components/component-renderer.mjs.map +1 -0
- package/dist/client/components/error-boundary.mjs +92 -0
- package/dist/client/components/error-boundary.mjs.map +1 -0
- package/dist/client/components/fields/array-field.d.mts +44 -0
- package/dist/client/components/fields/array-field.d.mts.map +1 -0
- package/dist/client/components/fields/array-field.mjs +231 -0
- package/dist/client/components/fields/array-field.mjs.map +1 -0
- package/dist/client/components/fields/asset-preview-field.d.mts +52 -0
- package/dist/client/components/fields/asset-preview-field.d.mts.map +1 -0
- package/dist/client/components/fields/asset-preview-field.mjs +60 -0
- package/dist/client/components/fields/asset-preview-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts +41 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +101 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/index.d.mts +1 -0
- package/dist/client/components/fields/boolean-field.d.mts +30 -0
- package/dist/client/components/fields/boolean-field.d.mts.map +1 -0
- package/dist/client/components/fields/boolean-field.mjs +47 -0
- package/dist/client/components/fields/boolean-field.mjs.map +1 -0
- package/dist/client/components/fields/custom-field.d.mts +3 -0
- package/dist/client/components/fields/date-field.d.mts +22 -0
- package/dist/client/components/fields/date-field.d.mts.map +1 -0
- package/dist/client/components/fields/date-field.mjs +42 -0
- package/dist/client/components/fields/date-field.mjs.map +1 -0
- package/dist/client/components/fields/datetime-field.d.mts +23 -0
- package/dist/client/components/fields/datetime-field.d.mts.map +1 -0
- package/dist/client/components/fields/datetime-field.mjs +43 -0
- package/dist/client/components/fields/datetime-field.mjs.map +1 -0
- package/dist/client/components/fields/email-field.d.mts +19 -0
- package/dist/client/components/fields/email-field.d.mts.map +1 -0
- package/dist/client/components/fields/email-field.mjs +38 -0
- package/dist/client/components/fields/email-field.mjs.map +1 -0
- package/dist/client/components/fields/embedded-collection.d.mts +3 -0
- package/dist/client/components/fields/field-types.d.mts +571 -0
- package/dist/client/components/fields/field-types.d.mts.map +1 -0
- package/dist/client/components/fields/field-utils.d.mts +1 -0
- package/dist/client/components/fields/field-utils.mjs +65 -0
- package/dist/client/components/fields/field-utils.mjs.map +1 -0
- package/dist/client/components/fields/field-wrapper.d.mts +3 -0
- package/dist/client/components/fields/field-wrapper.mjs +49 -0
- package/dist/client/components/fields/field-wrapper.mjs.map +1 -0
- package/dist/client/components/fields/index.d.mts +33 -0
- package/dist/client/components/fields/json-field.d.mts +84 -0
- package/dist/client/components/fields/json-field.d.mts.map +1 -0
- package/dist/client/components/fields/json-field.mjs +248 -0
- package/dist/client/components/fields/json-field.mjs.map +1 -0
- package/dist/client/components/fields/locale-badge.d.mts +1 -0
- package/dist/client/components/fields/locale-badge.mjs +17 -0
- package/dist/client/components/fields/locale-badge.mjs.map +1 -0
- package/dist/client/components/fields/number-field.d.mts +23 -0
- package/dist/client/components/fields/number-field.d.mts.map +1 -0
- package/dist/client/components/fields/number-field.mjs +40 -0
- package/dist/client/components/fields/number-field.mjs.map +1 -0
- package/dist/client/components/fields/object-array-field.d.mts +2 -0
- package/dist/client/components/fields/object-array-field.mjs +313 -0
- package/dist/client/components/fields/object-array-field.mjs.map +1 -0
- package/dist/client/components/fields/object-field.d.mts +32 -0
- package/dist/client/components/fields/object-field.d.mts.map +1 -0
- package/dist/client/components/fields/object-field.mjs +128 -0
- package/dist/client/components/fields/object-field.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/cards-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs +140 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/chips-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs +100 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/grid-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs +114 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/index.d.mts +6 -0
- package/dist/client/components/fields/relation/displays/list-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs +128 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/table-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs +134 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/types.d.mts +22 -0
- package/dist/client/components/fields/relation/displays/types.d.mts.map +1 -0
- package/dist/client/components/fields/relation/displays/types.mjs +73 -0
- package/dist/client/components/fields/relation/displays/types.mjs.map +1 -0
- package/dist/client/components/fields/relation/index.d.mts +3 -0
- package/dist/client/components/fields/relation/relation-items-display.d.mts +5 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs +47 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs.map +1 -0
- package/dist/client/components/fields/relation-field.d.mts +134 -0
- package/dist/client/components/fields/relation-field.d.mts.map +1 -0
- package/dist/client/components/fields/relation-field.mjs +106 -0
- package/dist/client/components/fields/relation-field.mjs.map +1 -0
- package/dist/client/components/fields/relation-picker.d.mts +4 -0
- package/dist/client/components/fields/relation-picker.mjs +301 -0
- package/dist/client/components/fields/relation-picker.mjs.map +1 -0
- package/dist/client/components/fields/relation-select.d.mts +3 -0
- package/dist/client/components/fields/relation-select.mjs +219 -0
- package/dist/client/components/fields/relation-select.mjs.map +1 -0
- package/dist/client/components/fields/reverse-relation-field.d.mts +2 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +56 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +118 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +196 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +4 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +187 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +86 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +11 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +145 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +280 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts +78 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs +31 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs +51 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/variants.d.mts +2 -0
- package/dist/client/components/fields/rich-text-field.d.mts +14 -0
- package/dist/client/components/fields/rich-text-field.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-field.mjs +26 -0
- package/dist/client/components/fields/rich-text-field.mjs.map +1 -0
- package/dist/client/components/fields/select-field.d.mts +25 -0
- package/dist/client/components/fields/select-field.d.mts.map +1 -0
- package/dist/client/components/fields/select-field.mjs +53 -0
- package/dist/client/components/fields/select-field.mjs.map +1 -0
- package/dist/client/components/fields/status-field.d.mts +2 -0
- package/dist/client/components/fields/text-field.d.mts +22 -0
- package/dist/client/components/fields/text-field.d.mts.map +1 -0
- package/dist/client/components/fields/text-field.mjs +39 -0
- package/dist/client/components/fields/text-field.mjs.map +1 -0
- package/dist/client/components/fields/textarea-field.d.mts +22 -0
- package/dist/client/components/fields/textarea-field.d.mts.map +1 -0
- package/dist/client/components/fields/textarea-field.mjs +39 -0
- package/dist/client/components/fields/textarea-field.mjs.map +1 -0
- package/dist/client/components/fields/time-field.d.mts +20 -0
- package/dist/client/components/fields/time-field.d.mts.map +1 -0
- package/dist/client/components/fields/time-field.mjs +39 -0
- package/dist/client/components/fields/time-field.mjs.map +1 -0
- package/dist/client/components/fields/upload-field.d.mts +97 -0
- package/dist/client/components/fields/upload-field.d.mts.map +1 -0
- package/dist/client/components/fields/upload-field.mjs +497 -0
- package/dist/client/components/fields/upload-field.mjs.map +1 -0
- package/dist/client/components/filter-builder/columns-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/columns-tab.mjs +131 -0
- package/dist/client/components/filter-builder/columns-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.d.mts +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +157 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs.map +1 -0
- package/dist/client/components/filter-builder/filters-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/filters-tab.mjs +380 -0
- package/dist/client/components/filter-builder/filters-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/index.d.mts +5 -0
- package/dist/client/components/filter-builder/saved-views-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs +125 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs.map +1 -0
- package/dist/client/components/index.d.mts +80 -0
- package/dist/client/components/locale-switcher.d.mts +2 -0
- package/dist/client/components/locale-switcher.mjs +128 -0
- package/dist/client/components/locale-switcher.mjs.map +1 -0
- package/dist/client/components/media/media-grid.mjs +139 -0
- package/dist/client/components/media/media-grid.mjs.map +1 -0
- package/dist/client/components/media/media-picker-dialog.mjs +255 -0
- package/dist/client/components/media/media-picker-dialog.mjs.map +1 -0
- package/dist/client/components/preview/live-preview-mode.mjs +211 -0
- package/dist/client/components/preview/live-preview-mode.mjs.map +1 -0
- package/dist/client/components/preview/preview-pane.mjs +179 -0
- package/dist/client/components/preview/preview-pane.mjs.map +1 -0
- package/dist/client/components/primitives/asset-preview.mjs +363 -0
- package/dist/client/components/primitives/asset-preview.mjs.map +1 -0
- package/dist/client/components/primitives/checkbox-input.mjs +33 -0
- package/dist/client/components/primitives/checkbox-input.mjs.map +1 -0
- package/dist/client/components/primitives/date-input.mjs +218 -0
- package/dist/client/components/primitives/date-input.mjs.map +1 -0
- package/dist/client/components/primitives/dropzone.mjs +239 -0
- package/dist/client/components/primitives/dropzone.mjs.map +1 -0
- package/dist/client/components/primitives/number-input.mjs +113 -0
- package/dist/client/components/primitives/number-input.mjs.map +1 -0
- package/dist/client/components/primitives/select-multi.mjs +256 -0
- package/dist/client/components/primitives/select-multi.mjs.map +1 -0
- package/dist/client/components/primitives/select-single.mjs +183 -0
- package/dist/client/components/primitives/select-single.mjs.map +1 -0
- package/dist/client/components/primitives/text-input.mjs +40 -0
- package/dist/client/components/primitives/text-input.mjs.map +1 -0
- package/dist/client/components/primitives/textarea-input.mjs +38 -0
- package/dist/client/components/primitives/textarea-input.mjs.map +1 -0
- package/dist/client/components/primitives/time-input.mjs +72 -0
- package/dist/client/components/primitives/time-input.mjs.map +1 -0
- package/dist/client/components/primitives/toggle-input.mjs +31 -0
- package/dist/client/components/primitives/toggle-input.mjs.map +1 -0
- package/dist/client/components/primitives/types.d.mts +14 -0
- package/dist/client/components/primitives/types.d.mts.map +1 -0
- package/dist/client/components/primitives/types.mjs +13 -0
- package/dist/client/components/primitives/types.mjs.map +1 -0
- package/dist/client/components/sheets/index.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.mjs +78 -0
- package/dist/client/components/sheets/resource-sheet.mjs.map +1 -0
- package/dist/client/components/ui/accordion.d.mts +2 -0
- package/dist/client/components/ui/accordion.mjs +50 -0
- package/dist/client/components/ui/accordion.mjs.map +1 -0
- package/dist/client/components/ui/alert.mjs +32 -0
- package/dist/client/components/ui/alert.mjs.map +1 -0
- package/dist/client/components/ui/avatar.d.mts +3 -0
- package/dist/client/components/ui/badge.d.mts +3 -0
- package/dist/client/components/ui/badge.mjs +35 -0
- package/dist/client/components/ui/badge.mjs.map +1 -0
- package/dist/client/components/ui/button.d.mts +3 -0
- package/dist/client/components/ui/button.mjs +49 -0
- package/dist/client/components/ui/button.mjs.map +1 -0
- package/dist/client/components/ui/card.d.mts +2 -0
- package/dist/{card-BKHjBQfw.mjs → client/components/ui/card.mjs} +3 -10
- package/dist/{card-BKHjBQfw.mjs.map → client/components/ui/card.mjs.map} +1 -1
- package/dist/client/components/ui/checkbox.d.mts +2 -0
- package/dist/client/components/ui/checkbox.mjs +27 -0
- package/dist/client/components/ui/checkbox.mjs.map +1 -0
- package/dist/client/components/ui/combobox.d.mts +3 -0
- package/dist/client/components/ui/command.mjs +69 -0
- package/dist/client/components/ui/command.mjs.map +1 -0
- package/dist/client/components/ui/dialog.d.mts +3 -0
- package/dist/client/components/ui/dialog.mjs +83 -0
- package/dist/client/components/ui/dialog.mjs.map +1 -0
- package/dist/client/components/ui/drawer.mjs +75 -0
- package/dist/client/components/ui/drawer.mjs.map +1 -0
- package/dist/client/components/ui/dropdown-menu.d.mts +3 -0
- package/dist/client/components/ui/dropdown-menu.mjs +89 -0
- package/dist/client/components/ui/dropdown-menu.mjs.map +1 -0
- package/dist/client/components/ui/empty-state.mjs +53 -0
- package/dist/client/components/ui/empty-state.mjs.map +1 -0
- package/dist/client/components/ui/field.d.mts +3 -0
- package/dist/client/components/ui/field.mjs +78 -0
- package/dist/client/components/ui/field.mjs.map +1 -0
- package/dist/client/components/ui/input-group.d.mts +4 -0
- package/dist/client/components/ui/input-group.mjs +68 -0
- package/dist/client/components/ui/input-group.mjs.map +1 -0
- package/dist/client/components/ui/input.d.mts +2 -0
- package/dist/client/components/ui/input.mjs +17 -0
- package/dist/client/components/ui/input.mjs.map +1 -0
- package/dist/client/components/ui/kbd.mjs +24 -0
- package/dist/client/components/ui/kbd.mjs.map +1 -0
- package/dist/client/components/ui/label.d.mts +2 -0
- package/dist/client/components/ui/label.mjs +15 -0
- package/dist/client/components/ui/label.mjs.map +1 -0
- package/dist/client/components/ui/popover.d.mts +3 -0
- package/dist/client/components/ui/popover.mjs +49 -0
- package/dist/client/components/ui/popover.mjs.map +1 -0
- package/dist/client/components/ui/responsive-dialog.mjs +102 -0
- package/dist/client/components/ui/responsive-dialog.mjs.map +1 -0
- package/dist/client/components/ui/scroll-area.d.mts +2 -0
- package/dist/client/components/ui/search-input.mjs +74 -0
- package/dist/client/components/ui/search-input.mjs.map +1 -0
- package/dist/client/components/ui/select.d.mts +3 -0
- package/dist/client/components/ui/select.mjs +85 -0
- package/dist/client/components/ui/select.mjs.map +1 -0
- package/dist/client/components/ui/separator.d.mts +2 -0
- package/dist/client/components/ui/separator.mjs +17 -0
- package/dist/client/components/ui/separator.mjs.map +1 -0
- package/dist/client/components/ui/sheet.d.mts +3 -0
- package/dist/client/components/ui/sheet.mjs +78 -0
- package/dist/client/components/ui/sheet.mjs.map +1 -0
- package/dist/client/components/ui/sidebar.d.mts +8 -0
- package/dist/client/components/ui/sidebar.mjs +256 -0
- package/dist/client/components/ui/sidebar.mjs.map +1 -0
- package/dist/client/components/ui/skeleton.d.mts +1 -0
- package/dist/client/components/ui/skeleton.mjs +15 -0
- package/dist/client/components/ui/skeleton.mjs.map +1 -0
- package/dist/client/components/ui/sonner.d.mts +14 -0
- package/dist/client/components/ui/sonner.d.mts.map +1 -0
- package/dist/client/components/ui/sonner.mjs +55 -0
- package/dist/client/components/ui/sonner.mjs.map +1 -0
- package/dist/client/components/ui/spinner.d.mts +1 -0
- package/dist/client/components/ui/spinner.mjs +18 -0
- package/dist/client/components/ui/spinner.mjs.map +1 -0
- package/dist/client/components/ui/switch.d.mts +2 -0
- package/dist/client/components/ui/switch.mjs +23 -0
- package/dist/client/components/ui/switch.mjs.map +1 -0
- package/dist/client/components/ui/table.d.mts +2 -0
- package/dist/client/components/ui/table.mjs +66 -0
- package/dist/client/components/ui/table.mjs.map +1 -0
- package/dist/client/components/ui/tabs.d.mts +3 -0
- package/dist/client/components/ui/tabs.mjs +49 -0
- package/dist/client/components/ui/tabs.mjs.map +1 -0
- package/dist/client/components/ui/textarea.d.mts +2 -0
- package/dist/client/components/ui/textarea.mjs +15 -0
- package/dist/client/components/ui/textarea.mjs.map +1 -0
- package/dist/client/components/ui/toolbar.mjs +54 -0
- package/dist/client/components/ui/toolbar.mjs.map +1 -0
- package/dist/client/components/ui/tooltip.d.mts +2 -0
- package/dist/client/components/ui/tooltip.mjs +45 -0
- package/dist/client/components/ui/tooltip.mjs.map +1 -0
- package/dist/client/components/widgets/chart-widget.d.mts +57 -0
- package/dist/client/components/widgets/chart-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/chart-widget.mjs +282 -0
- package/dist/client/components/widgets/chart-widget.mjs.map +1 -0
- package/dist/client/components/widgets/progress-widget.d.mts +41 -0
- package/dist/client/components/widgets/progress-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/progress-widget.mjs +110 -0
- package/dist/client/components/widgets/progress-widget.mjs.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts +29 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs +121 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts +51 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.mjs +101 -0
- package/dist/client/components/widgets/recent-items-widget.mjs.map +1 -0
- package/dist/client/components/widgets/stats-widget.d.mts +55 -0
- package/dist/client/components/widgets/stats-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/stats-widget.mjs +150 -0
- package/dist/client/components/widgets/stats-widget.mjs.map +1 -0
- package/dist/client/components/widgets/table-widget.d.mts +31 -0
- package/dist/client/components/widgets/table-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/table-widget.mjs +139 -0
- package/dist/client/components/widgets/table-widget.mjs.map +1 -0
- package/dist/client/components/widgets/timeline-widget.d.mts +51 -0
- package/dist/client/components/widgets/timeline-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/timeline-widget.mjs +168 -0
- package/dist/client/components/widgets/timeline-widget.mjs.map +1 -0
- package/dist/client/components/widgets/value-widget.d.mts +39 -0
- package/dist/client/components/widgets/value-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/value-widget.mjs +111 -0
- package/dist/client/components/widgets/value-widget.mjs.map +1 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +145 -0
- package/dist/client/components/widgets/widget-skeletons.mjs.map +1 -0
- package/dist/client/context/focus-context.d.mts +88 -0
- package/dist/client/context/focus-context.d.mts.map +1 -0
- package/dist/client/context/focus-context.mjs +178 -0
- package/dist/client/context/focus-context.mjs.map +1 -0
- package/dist/client/contexts/breadcrumb-context.mjs +32 -0
- package/dist/client/contexts/breadcrumb-context.mjs.map +1 -0
- package/dist/client/hooks/typed-hooks.d.mts +84 -0
- package/dist/client/hooks/typed-hooks.d.mts.map +1 -0
- package/dist/client/hooks/typed-hooks.mjs +272 -0
- package/dist/client/hooks/typed-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-action.mjs +201 -0
- package/dist/client/hooks/use-action.mjs.map +1 -0
- package/dist/client/hooks/use-admin-config.mjs +40 -0
- package/dist/client/hooks/use-admin-config.mjs.map +1 -0
- package/dist/client/hooks/use-admin-preferences.mjs +68 -0
- package/dist/client/hooks/use-admin-preferences.mjs.map +1 -0
- package/dist/client/hooks/use-admin-routes.mjs +97 -0
- package/dist/client/hooks/use-admin-routes.mjs.map +1 -0
- package/dist/client/hooks/use-auth.d.mts +98 -0
- package/dist/client/hooks/use-auth.d.mts.map +1 -0
- package/dist/{use-auth-BoLmWtmU.mjs → client/hooks/use-auth.mjs} +3 -3
- package/dist/client/hooks/use-auth.mjs.map +1 -0
- package/dist/client/hooks/use-collection-fields.mjs +32 -0
- package/dist/client/hooks/use-collection-fields.mjs.map +1 -0
- package/dist/client/hooks/use-collection-meta.mjs +121 -0
- package/dist/client/hooks/use-collection-meta.mjs.map +1 -0
- package/dist/client/hooks/use-collection-schema.mjs +67 -0
- package/dist/client/hooks/use-collection-schema.mjs.map +1 -0
- package/dist/client/hooks/use-collection-validation.mjs +74 -0
- package/dist/client/hooks/use-collection-validation.mjs.map +1 -0
- package/dist/client/hooks/use-collection.d.mts +86 -0
- package/dist/client/hooks/use-collection.d.mts.map +1 -0
- package/dist/client/hooks/use-collection.mjs +214 -0
- package/dist/client/hooks/use-collection.mjs.map +1 -0
- package/dist/client/hooks/use-current-user.d.mts +57 -0
- package/dist/client/hooks/use-current-user.d.mts.map +1 -0
- package/dist/client/hooks/use-current-user.mjs +79 -0
- package/dist/client/hooks/use-current-user.mjs.map +1 -0
- package/dist/client/hooks/use-field-hooks.mjs +191 -0
- package/dist/client/hooks/use-field-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-field-options.d.mts +90 -0
- package/dist/client/hooks/use-field-options.d.mts.map +1 -0
- package/dist/client/hooks/use-field-options.mjs +184 -0
- package/dist/client/hooks/use-field-options.mjs.map +1 -0
- package/dist/client/hooks/use-global-fields.mjs +27 -0
- package/dist/client/hooks/use-global-fields.mjs.map +1 -0
- package/dist/client/hooks/use-global-meta.mjs +59 -0
- package/dist/client/hooks/use-global-meta.mjs.map +1 -0
- package/dist/client/hooks/use-global-schema.mjs +33 -0
- package/dist/client/hooks/use-global-schema.mjs.map +1 -0
- package/dist/client/hooks/use-global.d.mts +40 -0
- package/dist/client/hooks/use-global.d.mts.map +1 -0
- package/dist/client/hooks/use-global.mjs +74 -0
- package/dist/client/hooks/use-global.mjs.map +1 -0
- package/dist/client/hooks/use-locks.mjs +245 -0
- package/dist/client/hooks/use-locks.mjs.map +1 -0
- package/dist/client/hooks/use-media-query.d.mts +23 -0
- package/dist/client/hooks/use-media-query.d.mts.map +1 -0
- package/dist/client/hooks/use-media-query.mjs +62 -0
- package/dist/client/hooks/use-media-query.mjs.map +1 -0
- package/dist/client/hooks/use-prefill-params.mjs +47 -0
- package/dist/client/hooks/use-prefill-params.mjs.map +1 -0
- package/dist/client/hooks/use-questpie-query-options.mjs +28 -0
- package/dist/client/hooks/use-questpie-query-options.mjs.map +1 -0
- package/dist/client/hooks/use-reactive-fields.d.mts +75 -0
- package/dist/client/hooks/use-reactive-fields.d.mts.map +1 -0
- package/dist/client/hooks/use-reactive-fields.mjs +164 -0
- package/dist/client/hooks/use-reactive-fields.mjs.map +1 -0
- package/dist/client/hooks/use-realtime-highlight.mjs +96 -0
- package/dist/client/hooks/use-realtime-highlight.mjs.map +1 -0
- package/dist/client/hooks/use-saved-views.mjs +65 -0
- package/dist/client/hooks/use-saved-views.mjs.map +1 -0
- package/dist/client/hooks/use-search.mjs +147 -0
- package/dist/client/hooks/use-search.mjs.map +1 -0
- package/dist/client/hooks/use-server-validation.mjs +199 -0
- package/dist/client/hooks/use-server-validation.mjs.map +1 -0
- package/dist/client/hooks/use-server-widget-data.d.mts +26 -0
- package/dist/client/hooks/use-server-widget-data.d.mts.map +1 -0
- package/dist/client/hooks/use-server-widget-data.mjs +40 -0
- package/dist/client/hooks/use-server-widget-data.mjs.map +1 -0
- package/dist/client/hooks/use-setup-status.d.mts +39 -0
- package/dist/client/hooks/use-setup-status.d.mts.map +1 -0
- package/dist/client/hooks/use-setup-status.mjs +50 -0
- package/dist/client/hooks/use-setup-status.mjs.map +1 -0
- package/dist/client/hooks/use-upload-collection.mjs +32 -0
- package/dist/client/hooks/use-upload-collection.mjs.map +1 -0
- package/dist/client/hooks/use-upload.d.mts +23 -0
- package/dist/client/hooks/use-upload.d.mts.map +1 -0
- package/dist/client/hooks/use-upload.mjs +145 -0
- package/dist/client/hooks/use-upload.mjs.map +1 -0
- package/dist/client/hooks/use-validation-error-map.mjs +53 -0
- package/dist/client/hooks/use-validation-error-map.mjs.map +1 -0
- package/dist/client/hooks/use-view-state.mjs +261 -0
- package/dist/client/hooks/use-view-state.mjs.map +1 -0
- package/dist/client/i18n/hooks.mjs +160 -0
- package/dist/client/i18n/hooks.mjs.map +1 -0
- package/dist/client/i18n/intl-cache.mjs +65 -0
- package/dist/client/i18n/intl-cache.mjs.map +1 -0
- package/dist/client/i18n/messages.mjs +7 -0
- package/dist/client/i18n/messages.mjs.map +1 -0
- package/dist/client/i18n/simple.d.mts +22 -0
- package/dist/client/i18n/simple.d.mts.map +1 -0
- package/dist/client/i18n/simple.mjs +157 -0
- package/dist/client/i18n/simple.mjs.map +1 -0
- package/dist/client/i18n/types.d.mts +110 -0
- package/dist/client/i18n/types.d.mts.map +1 -0
- package/dist/client/lib/utils.d.mts +1 -0
- package/dist/client/lib/utils.mjs +28 -0
- package/dist/client/lib/utils.mjs.map +1 -0
- package/dist/client/preview/block-scope-context.d.mts +74 -0
- package/dist/client/preview/block-scope-context.d.mts.map +1 -0
- package/dist/client/preview/block-scope-context.mjs +93 -0
- package/dist/client/preview/block-scope-context.mjs.map +1 -0
- package/dist/client/preview/index.d.mts +5 -0
- package/dist/client/preview/preview-banner.d.mts +46 -0
- package/dist/client/preview/preview-banner.d.mts.map +1 -0
- package/dist/client/preview/preview-banner.mjs +95 -0
- package/dist/client/preview/preview-banner.mjs.map +1 -0
- package/dist/client/preview/preview-field.d.mts +108 -0
- package/dist/client/preview/preview-field.d.mts.map +1 -0
- package/dist/client/preview/preview-field.mjs +125 -0
- package/dist/client/preview/preview-field.mjs.map +1 -0
- package/dist/client/preview/types.d.mts +115 -0
- package/dist/client/preview/types.d.mts.map +1 -0
- package/dist/client/preview/types.mjs +21 -0
- package/dist/client/preview/types.mjs.map +1 -0
- package/dist/client/preview/use-collection-preview.d.mts +71 -0
- package/dist/client/preview/use-collection-preview.d.mts.map +1 -0
- package/dist/client/preview/use-collection-preview.mjs +114 -0
- package/dist/client/preview/use-collection-preview.mjs.map +1 -0
- package/dist/client/runtime/content-locales-provider.d.mts +1 -0
- package/dist/client/runtime/content-locales-provider.mjs +85 -0
- package/dist/client/runtime/content-locales-provider.mjs.map +1 -0
- package/dist/client/runtime/index.d.mts +7 -0
- package/dist/client/runtime/index.mjs +8 -0
- package/dist/client/runtime/locale-scope.d.mts +2 -0
- package/dist/{runtime-6VZM878K.mjs → client/runtime/locale-scope.mjs} +3 -4
- package/dist/client/runtime/locale-scope.mjs.map +1 -0
- package/dist/client/runtime/provider.d.mts +10107 -0
- package/dist/client/runtime/provider.d.mts.map +1 -0
- package/dist/client/runtime/provider.mjs +229 -0
- package/dist/client/runtime/provider.mjs.map +1 -0
- package/dist/client/runtime/routes.d.mts +49 -0
- package/dist/client/runtime/routes.d.mts.map +1 -0
- package/dist/client/runtime/routes.mjs +107 -0
- package/dist/client/runtime/routes.mjs.map +1 -0
- package/dist/client/runtime/translations-provider.d.mts +2 -0
- package/dist/client/runtime/translations-provider.mjs +181 -0
- package/dist/client/runtime/translations-provider.mjs.map +1 -0
- package/dist/client/scope/index.d.mts +3 -0
- package/dist/client/scope/picker.d.mts +54 -0
- package/dist/client/scope/picker.d.mts.map +1 -0
- package/dist/client/scope/picker.mjs +161 -0
- package/dist/client/scope/picker.mjs.map +1 -0
- package/dist/client/scope/provider.d.mts +104 -0
- package/dist/client/scope/provider.d.mts.map +1 -0
- package/dist/client/scope/provider.mjs +159 -0
- package/dist/client/scope/provider.mjs.map +1 -0
- package/dist/client/scope/types.d.mts +112 -0
- package/dist/client/scope/types.d.mts.map +1 -0
- package/dist/client/styles/index.css +80 -0
- package/dist/client/utils/auto-expand-fields.mjs +65 -0
- package/dist/client/utils/auto-expand-fields.mjs.map +1 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs +256 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs.map +1 -0
- package/dist/client/utils/detect-relations.mjs +46 -0
- package/dist/client/utils/detect-relations.mjs.map +1 -0
- package/dist/client/utils/locale-to-flag.d.mts +118 -0
- package/dist/client/utils/locale-to-flag.d.mts.map +1 -0
- package/dist/client/utils/locale-to-flag.mjs +130 -0
- package/dist/client/utils/locale-to-flag.mjs.map +1 -0
- package/dist/client/utils/routes.mjs +196 -0
- package/dist/client/utils/routes.mjs.map +1 -0
- package/dist/client/views/auth/accept-invite-form.d.mts +73 -0
- package/dist/client/views/auth/accept-invite-form.d.mts.map +1 -0
- package/dist/client/views/auth/accept-invite-form.mjs +180 -0
- package/dist/client/views/auth/accept-invite-form.mjs.map +1 -0
- package/dist/client/views/auth/auth-layout.d.mts +44 -0
- package/dist/client/views/auth/auth-layout.d.mts.map +1 -0
- package/dist/client/views/auth/auth-layout.mjs +53 -0
- package/dist/client/views/auth/auth-layout.mjs.map +1 -0
- package/dist/client/views/auth/forgot-password-form.d.mts +59 -0
- package/dist/client/views/auth/forgot-password-form.d.mts.map +1 -0
- package/dist/{forgot-password-page-Bcp-An4Y.mjs → client/views/auth/forgot-password-form.mjs} +22 -89
- package/dist/client/views/auth/forgot-password-form.mjs.map +1 -0
- package/dist/client/views/auth/index.d.mts +7 -0
- package/dist/client/views/auth/invite-form.d.mts +1 -0
- package/dist/client/views/auth/invite-form.mjs +155 -0
- package/dist/client/views/auth/invite-form.mjs.map +1 -0
- package/dist/client/views/auth/login-form.d.mts +76 -0
- package/dist/client/views/auth/login-form.d.mts.map +1 -0
- package/dist/client/views/auth/login-form.mjs +167 -0
- package/dist/client/views/auth/login-form.mjs.map +1 -0
- package/dist/client/views/auth/reset-password-form.d.mts +66 -0
- package/dist/client/views/auth/reset-password-form.d.mts.map +1 -0
- package/dist/client/views/auth/reset-password-form.mjs +188 -0
- package/dist/client/views/auth/reset-password-form.mjs.map +1 -0
- package/dist/client/views/auth/setup-form.d.mts +61 -0
- package/dist/client/views/auth/setup-form.d.mts.map +1 -0
- package/dist/{setup-page-YAP_fzqh.mjs → client/views/auth/setup-form.mjs} +46 -124
- package/dist/client/views/auth/setup-form.mjs.map +1 -0
- package/dist/client/views/collection/auto-form-fields.d.mts +4 -0
- package/dist/client/views/collection/auto-form-fields.mjs +453 -0
- package/dist/client/views/collection/auto-form-fields.mjs.map +1 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs +291 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts +46 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.mjs +327 -0
- package/dist/client/views/collection/cells/complex-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/index.d.mts +7 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts +76 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs +165 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts +21 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.mjs +105 -0
- package/dist/client/views/collection/cells/relation-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +189 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.d.mts +2 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs +78 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +37 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts +25 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.mjs +20 -0
- package/dist/client/views/collection/cells/upload-cells.mjs.map +1 -0
- package/dist/client/views/collection/columns/build-columns.d.mts +2 -0
- package/dist/client/views/collection/columns/build-columns.mjs +156 -0
- package/dist/client/views/collection/columns/build-columns.mjs.map +1 -0
- package/dist/client/views/collection/columns/column-defaults.d.mts +2 -0
- package/dist/client/views/collection/columns/column-defaults.mjs +108 -0
- package/dist/client/views/collection/columns/column-defaults.mjs.map +1 -0
- package/dist/client/views/collection/columns/index.d.mts +3 -0
- package/dist/client/views/collection/columns/types.d.mts +2 -0
- package/dist/client/views/collection/field-context.mjs +127 -0
- package/dist/client/views/collection/field-context.mjs.map +1 -0
- package/dist/client/views/collection/field-renderer.mjs +171 -0
- package/dist/client/views/collection/field-renderer.mjs.map +1 -0
- package/dist/client/views/collection/form-view.d.mts +112 -0
- package/dist/client/views/collection/form-view.d.mts.map +1 -0
- package/dist/client/views/collection/form-view.mjs +903 -0
- package/dist/client/views/collection/form-view.mjs.map +1 -0
- package/dist/client/views/collection/index.d.mts +9 -0
- package/dist/client/views/collection/table-view.d.mts +102 -0
- package/dist/client/views/collection/table-view.d.mts.map +1 -0
- package/dist/client/views/collection/table-view.mjs +695 -0
- package/dist/client/views/collection/table-view.mjs.map +1 -0
- package/dist/client/views/collection/view-skeletons.mjs +121 -0
- package/dist/client/views/collection/view-skeletons.mjs.map +1 -0
- package/dist/client/views/common/global-search.d.mts +1 -0
- package/dist/client/views/common/global-search.mjs +376 -0
- package/dist/client/views/common/global-search.mjs.map +1 -0
- package/dist/client/views/common/index.d.mts +1 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs +385 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs.map +1 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs +178 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs.map +1 -0
- package/dist/client/views/dashboard/widget-card.mjs +159 -0
- package/dist/client/views/dashboard/widget-card.mjs.map +1 -0
- package/dist/client/views/globals/global-form-view.d.mts +74 -0
- package/dist/client/views/globals/global-form-view.d.mts.map +1 -0
- package/dist/client/views/globals/global-form-view.mjs +181 -0
- package/dist/client/views/globals/global-form-view.mjs.map +1 -0
- package/dist/client/views/index.d.mts +28 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts +140 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout-provider.mjs +90 -0
- package/dist/client/views/layout/admin-layout-provider.mjs.map +1 -0
- package/dist/client/views/layout/admin-layout.d.mts +151 -0
- package/dist/client/views/layout/admin-layout.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout.mjs +144 -0
- package/dist/client/views/layout/admin-layout.mjs.map +1 -0
- package/dist/client/views/layout/admin-root.d.mts +7 -0
- package/dist/client/views/layout/admin-router.d.mts +125 -0
- package/dist/client/views/layout/admin-router.d.mts.map +1 -0
- package/dist/client/views/layout/admin-router.mjs +594 -0
- package/dist/client/views/layout/admin-router.mjs.map +1 -0
- package/dist/client/views/layout/admin-sidebar.d.mts +105 -0
- package/dist/client/views/layout/admin-sidebar.d.mts.map +1 -0
- package/dist/client/views/layout/admin-sidebar.mjs +550 -0
- package/dist/client/views/layout/admin-sidebar.mjs.map +1 -0
- package/dist/client/views/layout/admin-topbar.mjs +128 -0
- package/dist/client/views/layout/admin-topbar.mjs.map +1 -0
- package/dist/client/views/layout/index.d.mts +5 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +67 -0
- package/dist/client/views/pages/accept-invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/accept-invite-page.mjs +143 -0
- package/dist/client/views/pages/accept-invite-page.mjs.map +1 -0
- package/dist/client/views/pages/dashboard-page.d.mts +52 -0
- package/dist/client/views/pages/dashboard-page.d.mts.map +1 -0
- package/dist/client/views/pages/dashboard-page.mjs +45 -0
- package/dist/client/views/pages/dashboard-page.mjs.map +1 -0
- package/dist/client/views/pages/forgot-password-page.d.mts +59 -0
- package/dist/client/views/pages/forgot-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/forgot-password-page.mjs +80 -0
- package/dist/client/views/pages/forgot-password-page.mjs.map +1 -0
- package/dist/client/views/pages/index.d.mts +7 -0
- package/dist/client/views/pages/invite-page.d.mts +71 -0
- package/dist/client/views/pages/invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/invite-page.mjs +86 -0
- package/dist/client/views/pages/invite-page.mjs.map +1 -0
- package/dist/client/views/pages/login-page.d.mts +76 -0
- package/dist/client/views/pages/login-page.d.mts.map +1 -0
- package/dist/client/views/pages/login-page.mjs +98 -0
- package/dist/client/views/pages/login-page.mjs.map +1 -0
- package/dist/client/views/pages/reset-password-page.d.mts +66 -0
- package/dist/client/views/pages/reset-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/reset-password-page.mjs +105 -0
- package/dist/client/views/pages/reset-password-page.mjs.map +1 -0
- package/dist/client/views/pages/setup-page.d.mts +64 -0
- package/dist/client/views/pages/setup-page.d.mts.map +1 -0
- package/dist/client/views/pages/setup-page.mjs +91 -0
- package/dist/client/views/pages/setup-page.mjs.map +1 -0
- package/dist/client.d.mts +92 -3
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +54 -12
- package/dist/components/rich-text/index.d.mts +1 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts +104 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts.map +1 -0
- package/dist/components/rich-text/rich-text-renderer.mjs +210 -0
- package/dist/components/rich-text/rich-text-renderer.mjs.map +1 -0
- package/dist/index.d.mts +62 -3
- package/dist/index.mjs +54 -12
- package/dist/server/adapters/nextjs.d.mts +121 -0
- package/dist/server/adapters/nextjs.d.mts.map +1 -0
- package/dist/server/adapters/nextjs.mjs +111 -0
- package/dist/server/adapters/nextjs.mjs.map +1 -0
- package/dist/server/adapters/tanstack.d.mts +133 -0
- package/dist/server/adapters/tanstack.d.mts.map +1 -0
- package/dist/server/adapters/tanstack.mjs +90 -0
- package/dist/server/adapters/tanstack.mjs.map +1 -0
- package/dist/server/augmentation.d.mts +1523 -0
- package/dist/server/augmentation.d.mts.map +1 -0
- package/dist/server/auth-helpers.d.mts +143 -0
- package/dist/server/auth-helpers.d.mts.map +1 -0
- package/dist/server/auth-helpers.mjs +108 -0
- package/dist/server/auth-helpers.mjs.map +1 -0
- package/dist/server/block/block-builder.d.mts +319 -0
- package/dist/server/block/block-builder.d.mts.map +1 -0
- package/dist/server/block/block-builder.mjs +217 -0
- package/dist/server/block/block-builder.mjs.map +1 -0
- package/dist/server/block/index.d.mts +3 -0
- package/dist/server/block/introspection.d.mts +84 -0
- package/dist/server/block/introspection.d.mts.map +1 -0
- package/dist/server/block/introspection.mjs +89 -0
- package/dist/server/block/introspection.mjs.map +1 -0
- package/dist/server/block/prefetch.d.mts +78 -0
- package/dist/server/block/prefetch.d.mts.map +1 -0
- package/dist/server/block/prefetch.mjs +240 -0
- package/dist/server/block/prefetch.mjs.map +1 -0
- package/dist/server/fields/blocks.d.mts +139 -0
- package/dist/server/fields/blocks.d.mts.map +1 -0
- package/dist/server/fields/blocks.mjs +192 -0
- package/dist/server/fields/blocks.mjs.map +1 -0
- package/dist/server/fields/index.d.mts +48 -0
- package/dist/server/fields/index.d.mts.map +1 -0
- package/dist/server/fields/index.mjs +16 -0
- package/dist/server/fields/index.mjs.map +1 -0
- package/dist/server/fields/rich-text.d.mts +135 -0
- package/dist/server/fields/rich-text.d.mts.map +1 -0
- package/dist/server/fields/rich-text.mjs +188 -0
- package/dist/server/fields/rich-text.mjs.map +1 -0
- package/dist/server/i18n/index.d.mts +16 -0
- package/dist/server/i18n/index.d.mts.map +1 -0
- package/dist/server/i18n/index.mjs +44 -0
- package/dist/server/i18n/index.mjs.map +1 -0
- package/dist/server/i18n/messages/cs.mjs +461 -0
- package/dist/server/i18n/messages/cs.mjs.map +1 -0
- package/dist/server/i18n/messages/de.mjs +461 -0
- package/dist/server/i18n/messages/de.mjs.map +1 -0
- package/dist/server/i18n/messages/en.mjs +493 -0
- package/dist/server/i18n/messages/en.mjs.map +1 -0
- package/dist/server/i18n/messages/es.mjs +461 -0
- package/dist/server/i18n/messages/es.mjs.map +1 -0
- package/dist/server/i18n/messages/fr.mjs +461 -0
- package/dist/server/i18n/messages/fr.mjs.map +1 -0
- package/dist/server/i18n/messages/index.mjs +24 -0
- package/dist/server/i18n/messages/index.mjs.map +1 -0
- package/dist/server/i18n/messages/pl.mjs +461 -0
- package/dist/server/i18n/messages/pl.mjs.map +1 -0
- package/dist/server/i18n/messages/pt.mjs +464 -0
- package/dist/server/i18n/messages/pt.mjs.map +1 -0
- package/dist/server/i18n/messages/sk.mjs +490 -0
- package/dist/server/i18n/messages/sk.mjs.map +1 -0
- package/dist/server/index.d.mts +20 -0
- package/dist/server/modules/admin/functions/admin-config.mjs +348 -0
- package/dist/server/modules/admin/functions/admin-config.mjs.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts +107 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.mjs +331 -0
- package/dist/server/modules/admin/functions/execute-action.mjs.map +1 -0
- package/dist/server/modules/admin/functions/locales.mjs +80 -0
- package/dist/server/modules/admin/functions/locales.mjs.map +1 -0
- package/dist/server/modules/admin/functions/preview.d.mts +70 -0
- package/dist/server/modules/admin/functions/preview.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/preview.mjs +243 -0
- package/dist/server/modules/admin/functions/preview.mjs.map +1 -0
- package/dist/server/modules/admin/functions/reactive.d.mts +99 -0
- package/dist/server/modules/admin/functions/reactive.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/reactive.mjs +378 -0
- package/dist/server/modules/admin/functions/reactive.mjs.map +1 -0
- package/dist/server/modules/admin/functions/setup.d.mts +84 -0
- package/dist/server/modules/admin/functions/setup.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/setup.mjs +131 -0
- package/dist/server/modules/admin/functions/setup.mjs.map +1 -0
- package/dist/server/modules/admin/functions/translations.mjs +125 -0
- package/dist/server/modules/admin/functions/translations.mjs.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts +33 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.mjs +70 -0
- package/dist/server/modules/admin/functions/widget-data.mjs.map +1 -0
- package/dist/server/modules/admin/index.d.mts +16879 -0
- package/dist/server/modules/admin/index.d.mts.map +1 -0
- package/dist/server/modules/admin/index.mjs +249 -0
- package/dist/server/modules/admin/index.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs +48 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs +79 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts +1490 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs +57 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs.map +1 -0
- package/dist/server/patch.d.mts +100 -0
- package/dist/server/patch.d.mts.map +1 -0
- package/dist/server/patch.mjs +1062 -0
- package/dist/server/patch.mjs.map +1 -0
- package/dist/server.d.mts +21 -250
- package/dist/server.mjs +19 -832
- package/dist/shared/preview-utils.d.mts +54 -0
- package/dist/shared/preview-utils.d.mts.map +1 -0
- package/dist/{preview-utils-BKQ9-TMa.mjs → shared/preview-utils.mjs} +2 -2
- package/dist/shared/preview-utils.mjs.map +1 -0
- package/dist/{saved-views.types-BMsz5mCy.d.mts → shared/types/saved-views.types.d.mts} +7 -2
- package/dist/shared/types/saved-views.types.d.mts.map +1 -0
- package/dist/shared.d.mts +3 -57
- package/dist/shared.mjs +1 -1
- package/package.json +12 -17
- package/dist/auth-layout-M8K8_q5R.mjs +0 -181
- package/dist/auth-layout-M8K8_q5R.mjs.map +0 -1
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +0 -273
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +0 -1
- package/dist/client-B7r47hEd.d.mts +0 -13403
- package/dist/client-B7r47hEd.d.mts.map +0 -1
- package/dist/client-njX1rZmi.mjs +0 -22612
- package/dist/client-njX1rZmi.mjs.map +0 -1
- package/dist/content-locales-provider-BXvuIgfg.mjs +0 -1650
- package/dist/content-locales-provider-BXvuIgfg.mjs.map +0 -1
- package/dist/dashboard-page-B4PGEdc2.mjs +0 -2500
- package/dist/dashboard-page-B4PGEdc2.mjs.map +0 -1
- package/dist/dashboard-page-mCY0pgZv.mjs +0 -3
- package/dist/dropzone-Do3awXKd.mjs +0 -634
- package/dist/dropzone-Do3awXKd.mjs.map +0 -1
- package/dist/forgot-password-page-Bcp-An4Y.mjs.map +0 -1
- package/dist/forgot-password-page-CEwsdLwn.mjs +0 -3
- package/dist/index-BYyqkWtn.d.mts +0 -2753
- package/dist/index-BYyqkWtn.d.mts.map +0 -1
- package/dist/login-page-BUnpCbCa.mjs +0 -3
- package/dist/login-page-CP4gA-dl.mjs +0 -298
- package/dist/login-page-CP4gA-dl.mjs.map +0 -1
- package/dist/preview-utils-BKQ9-TMa.mjs.map +0 -1
- package/dist/reset-password-page-BqfDmLxA.mjs +0 -281
- package/dist/reset-password-page-BqfDmLxA.mjs.map +0 -1
- package/dist/reset-password-page-CufHz3h3.mjs +0 -3
- package/dist/runtime-6VZM878K.mjs.map +0 -1
- package/dist/saved-views.types-BMsz5mCy.d.mts.map +0 -1
- package/dist/server.d.mts.map +0 -1
- package/dist/server.mjs.map +0 -1
- package/dist/setup-page-BNNzt_Z6.mjs +0 -3
- package/dist/setup-page-YAP_fzqh.mjs.map +0 -1
- package/dist/shared.d.mts.map +0 -1
- package/dist/use-auth-BoLmWtmU.mjs.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FieldDefinition } from "../../../builder/field/field.mjs";
|
|
2
|
+
import * as react_jsx_runtime200 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/client/views/collection/cells/relation-cells.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Relation cell - displays relation as clickable chips
|
|
8
|
+
* Supports both single relations and arrays
|
|
9
|
+
* Opens detail sheet on click
|
|
10
|
+
*/
|
|
11
|
+
declare function RelationCell({
|
|
12
|
+
value,
|
|
13
|
+
fieldDef
|
|
14
|
+
}: {
|
|
15
|
+
value: unknown;
|
|
16
|
+
row?: unknown;
|
|
17
|
+
fieldDef?: FieldDefinition;
|
|
18
|
+
}): react_jsx_runtime200.JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { RelationCell };
|
|
21
|
+
//# sourceMappingURL=relation-cells.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation-cells.d.mts","names":[],"sources":["../../../../../src/client/views/collection/cells/relation-cells.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;iBA+BgB,YAAA;;;;;;aAMJ;IACX,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useResolveText } from "../../../i18n/hooks.mjs";
|
|
2
|
+
import { Badge } from "../../../components/ui/badge.mjs";
|
|
3
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.mjs";
|
|
4
|
+
import { getRelationItemId, getRelationItemLabel } from "./shared/cell-helpers.mjs";
|
|
5
|
+
import { ResourceSheet } from "../../../components/sheets/resource-sheet.mjs";
|
|
6
|
+
import { RelationChip } from "./shared/relation-chip.mjs";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
//#region src/client/views/collection/cells/relation-cells.tsx
|
|
11
|
+
/**
|
|
12
|
+
* Relation Cell Components
|
|
13
|
+
*
|
|
14
|
+
* Cells for displaying relation fields:
|
|
15
|
+
* - RelationCell - forward relations (belongs-to, has-one, has-many)
|
|
16
|
+
* - ReverseRelationCell - reverse relations (computed from other collections)
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Relation cell - displays relation as clickable chips
|
|
20
|
+
* Supports both single relations and arrays
|
|
21
|
+
* Opens detail sheet on click
|
|
22
|
+
*/
|
|
23
|
+
function RelationCell({ value, fieldDef }) {
|
|
24
|
+
const resolveText = useResolveText();
|
|
25
|
+
const targetCollection = fieldDef?.["~options"]?.targetCollection;
|
|
26
|
+
const [sheetOpen, setSheetOpen] = React$1.useState(false);
|
|
27
|
+
const [sheetItemId, setSheetItemId] = React$1.useState();
|
|
28
|
+
const [sheetCollection, setSheetCollection] = React$1.useState();
|
|
29
|
+
const handleChipClick = React$1.useCallback((itemId, collection) => {
|
|
30
|
+
setSheetItemId(itemId);
|
|
31
|
+
setSheetCollection(collection);
|
|
32
|
+
setSheetOpen(true);
|
|
33
|
+
}, []);
|
|
34
|
+
if (value === null || value === void 0) return /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: "text-muted-foreground",
|
|
36
|
+
children: "-"
|
|
37
|
+
});
|
|
38
|
+
if (Array.isArray(value)) {
|
|
39
|
+
if (value.length === 0) return /* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: "text-muted-foreground",
|
|
41
|
+
children: "-"
|
|
42
|
+
});
|
|
43
|
+
const visibleItems = value.slice(0, 3);
|
|
44
|
+
const remainingCount = value.length - 3;
|
|
45
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs("span", {
|
|
46
|
+
className: "inline-flex items-center gap-1 max-w-[250px] overflow-hidden",
|
|
47
|
+
children: [visibleItems.map((item, idx) => /* @__PURE__ */ jsx(RelationChip, {
|
|
48
|
+
item,
|
|
49
|
+
targetCollection,
|
|
50
|
+
onClick: handleChipClick,
|
|
51
|
+
className: "shrink-0"
|
|
52
|
+
}, idx)), remainingCount > 0 && /* @__PURE__ */ jsxs(Badge, {
|
|
53
|
+
variant: "secondary",
|
|
54
|
+
className: "h-5 px-1.5 text-[10px] shrink-0",
|
|
55
|
+
children: ["+", remainingCount]
|
|
56
|
+
})]
|
|
57
|
+
}) }), value.length > 3 && /* @__PURE__ */ jsx(TooltipContent, {
|
|
58
|
+
side: "bottom",
|
|
59
|
+
align: "start",
|
|
60
|
+
className: "p-0 w-56",
|
|
61
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
62
|
+
className: "max-h-[200px] overflow-y-auto p-2 space-y-1",
|
|
63
|
+
children: value.map((item, idx) => {
|
|
64
|
+
const label = resolveText(getRelationItemLabel(item));
|
|
65
|
+
const id = getRelationItemId(item);
|
|
66
|
+
const canNavigate = targetCollection && id;
|
|
67
|
+
const key = id ?? label ?? `item-${idx}`;
|
|
68
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
69
|
+
className: "flex items-center gap-1.5 text-xs",
|
|
70
|
+
children: [/* @__PURE__ */ jsx("span", { className: "size-1 rounded-full bg-foreground/60" }), canNavigate ? /* @__PURE__ */ jsx("button", {
|
|
71
|
+
type: "button",
|
|
72
|
+
onClick: (e) => {
|
|
73
|
+
e.stopPropagation();
|
|
74
|
+
handleChipClick(id, targetCollection);
|
|
75
|
+
},
|
|
76
|
+
className: "text-primary hover:underline text-left",
|
|
77
|
+
children: label
|
|
78
|
+
}) : /* @__PURE__ */ jsx("span", { children: label })]
|
|
79
|
+
}, key);
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
})] }), sheetCollection && sheetItemId && /* @__PURE__ */ jsx(ResourceSheet, {
|
|
83
|
+
type: "collection",
|
|
84
|
+
collection: sheetCollection,
|
|
85
|
+
itemId: sheetItemId,
|
|
86
|
+
open: sheetOpen,
|
|
87
|
+
onOpenChange: setSheetOpen
|
|
88
|
+
})] });
|
|
89
|
+
}
|
|
90
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(RelationChip, {
|
|
91
|
+
item: value,
|
|
92
|
+
targetCollection,
|
|
93
|
+
onClick: handleChipClick
|
|
94
|
+
}), sheetCollection && sheetItemId && /* @__PURE__ */ jsx(ResourceSheet, {
|
|
95
|
+
type: "collection",
|
|
96
|
+
collection: sheetCollection,
|
|
97
|
+
itemId: sheetItemId,
|
|
98
|
+
open: sheetOpen,
|
|
99
|
+
onOpenChange: setSheetOpen
|
|
100
|
+
})] });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
export { RelationCell };
|
|
105
|
+
//# sourceMappingURL=relation-cells.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation-cells.mjs","names":["React"],"sources":["../../../../../src/client/views/collection/cells/relation-cells.tsx"],"sourcesContent":["/**\n * Relation Cell Components\n *\n * Cells for displaying relation fields:\n * - RelationCell - forward relations (belongs-to, has-one, has-many)\n * - ReverseRelationCell - reverse relations (computed from other collections)\n */\n\nimport * as React from \"react\";\nimport type { FieldDefinition } from \"../../../builder/field/field\";\nimport { ResourceSheet } from \"../../../components/sheets\";\nimport { Badge } from \"../../../components/ui/badge\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"../../../components/ui/tooltip\";\nimport { useResolveText } from \"../../../i18n/hooks\";\nimport { cn } from \"../../../lib/utils\";\nimport { getRelationItemId, getRelationItemLabel } from \"./shared/cell-helpers\";\nimport { RelationChip } from \"./shared/relation-chip\";\n\n// ============================================================================\n// Relation Cell\n// ============================================================================\n\n/**\n * Relation cell - displays relation as clickable chips\n * Supports both single relations and arrays\n * Opens detail sheet on click\n */\nexport function RelationCell({\n\tvalue,\n\tfieldDef,\n}: {\n\tvalue: unknown;\n\trow?: unknown;\n\tfieldDef?: FieldDefinition;\n}) {\n\tconst resolveText = useResolveText();\n\tconst targetCollection = fieldDef?.[\"~options\"]?.targetCollection as\n\t\t| string\n\t\t| undefined;\n\n\t// Sheet state\n\tconst [sheetOpen, setSheetOpen] = React.useState(false);\n\tconst [sheetItemId, setSheetItemId] = React.useState<string | undefined>();\n\tconst [sheetCollection, setSheetCollection] = React.useState<\n\t\tstring | undefined\n\t>();\n\n\tconst handleChipClick = React.useCallback(\n\t\t(itemId: string, collection: string) => {\n\t\t\tsetSheetItemId(itemId);\n\t\t\tsetSheetCollection(collection);\n\t\t\tsetSheetOpen(true);\n\t\t},\n\t\t[],\n\t);\n\n\tif (value === null || value === undefined) {\n\t\treturn <span className=\"text-muted-foreground\">-</span>;\n\t}\n\n\t// Handle array of relations (multiple)\n\tif (Array.isArray(value)) {\n\t\tif (value.length === 0) {\n\t\t\treturn <span className=\"text-muted-foreground\">-</span>;\n\t\t}\n\n\t\tconst visibleItems = value.slice(0, 3);\n\t\tconst remainingCount = value.length - 3;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Tooltip>\n\t\t\t\t\t<TooltipTrigger\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<span className=\"inline-flex items-center gap-1 max-w-[250px] overflow-hidden\">\n\t\t\t\t\t\t\t\t{visibleItems.map((item, idx) => (\n\t\t\t\t\t\t\t\t\t<RelationChip\n\t\t\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: stable array from backend\n\t\t\t\t\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\t\ttargetCollection={targetCollection}\n\t\t\t\t\t\t\t\t\t\tonClick={handleChipClick}\n\t\t\t\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t{remainingCount > 0 && (\n\t\t\t\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"h-5 px-1.5 text-[10px] shrink-0\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t+{remainingCount}\n\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{value.length > 3 && (\n\t\t\t\t\t\t<TooltipContent side=\"bottom\" align=\"start\" className=\"p-0 w-56\">\n\t\t\t\t\t\t\t<div className=\"max-h-[200px] overflow-y-auto p-2 space-y-1\">\n\t\t\t\t\t\t\t\t{value.map((item, idx) => {\n\t\t\t\t\t\t\t\t\tconst label = resolveText(getRelationItemLabel(item));\n\t\t\t\t\t\t\t\t\tconst id = getRelationItemId(item);\n\t\t\t\t\t\t\t\t\tconst canNavigate = targetCollection && id;\n\t\t\t\t\t\t\t\t\tconst key = id ?? label ?? `item-${idx}`;\n\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"flex items-center gap-1.5 text-xs\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"size-1 rounded-full bg-foreground/60\" />\n\t\t\t\t\t\t\t\t\t\t\t{canNavigate ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thandleChipClick(id, targetCollection);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"text-primary hover:underline text-left\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t<span>{label}</span>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</TooltipContent>\n\t\t\t\t\t)}\n\t\t\t\t</Tooltip>\n\n\t\t\t\t{/* Detail sheet */}\n\t\t\t\t{sheetCollection && sheetItemId && (\n\t\t\t\t\t<ResourceSheet\n\t\t\t\t\t\ttype=\"collection\"\n\t\t\t\t\t\tcollection={sheetCollection}\n\t\t\t\t\t\titemId={sheetItemId}\n\t\t\t\t\t\topen={sheetOpen}\n\t\t\t\t\t\tonOpenChange={setSheetOpen}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t}\n\n\t// Handle single relation\n\treturn (\n\t\t<>\n\t\t\t<RelationChip\n\t\t\t\titem={value}\n\t\t\t\ttargetCollection={targetCollection}\n\t\t\t\tonClick={handleChipClick}\n\t\t\t/>\n\t\t\t{/* Detail sheet */}\n\t\t\t{sheetCollection && sheetItemId && (\n\t\t\t\t<ResourceSheet\n\t\t\t\t\ttype=\"collection\"\n\t\t\t\t\tcollection={sheetCollection}\n\t\t\t\t\titemId={sheetItemId}\n\t\t\t\t\topen={sheetOpen}\n\t\t\t\t\tonOpenChange={setSheetOpen}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\n// ============================================================================\n// Reverse Relation Cell\n// ============================================================================\n\n/**\n * Reverse relation cell - displays related items as clickable chips\n * Shows count badge with tooltip listing all items for navigation\n * Opens detail sheet on click\n */\nexport function ReverseRelationCell({\n\tvalue,\n\tfieldDef,\n}: {\n\tvalue: unknown;\n\trow?: unknown;\n\tfieldDef?: FieldDefinition;\n}) {\n\tconst resolveText = useResolveText();\n\t// Get source collection from fieldDef (the collection that has the relation pointing here)\n\tconst sourceCollection = fieldDef?.[\"~options\"]?.sourceCollection as\n\t\t| string\n\t\t| undefined;\n\n\t// Sheet state\n\tconst [sheetOpen, setSheetOpen] = React.useState(false);\n\tconst [sheetItemId, setSheetItemId] = React.useState<string | undefined>();\n\tconst [sheetCollection, setSheetCollection] = React.useState<\n\t\tstring | undefined\n\t>();\n\n\tconst handleChipClick = React.useCallback(\n\t\t(itemId: string, collection: string) => {\n\t\t\tsetSheetItemId(itemId);\n\t\t\tsetSheetCollection(collection);\n\t\t\tsetSheetOpen(true);\n\t\t},\n\t\t[],\n\t);\n\n\tif (value === null || value === undefined) {\n\t\treturn <span className=\"text-muted-foreground\">-</span>;\n\t}\n\n\t// Handle count-only value (when items not fetched)\n\tif (typeof value === \"number\") {\n\t\treturn (\n\t\t\t<Badge variant=\"secondary\">\n\t\t\t\t{value} item{value !== 1 ? \"s\" : \"\"}\n\t\t\t</Badge>\n\t\t);\n\t}\n\n\t// Handle array of related items\n\tif (Array.isArray(value)) {\n\t\tif (value.length === 0) {\n\t\t\treturn <span className=\"text-muted-foreground\">-</span>;\n\t\t}\n\n\t\t// For small counts, show chips inline\n\t\tif (value.length <= 2) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<span className=\"inline-flex flex-wrap items-center gap-1\">\n\t\t\t\t\t\t{value.map((item, idx) => (\n\t\t\t\t\t\t\t<RelationChip\n\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: stable array from backend\n\t\t\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\ttargetCollection={sourceCollection}\n\t\t\t\t\t\t\t\tonClick={handleChipClick}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</span>\n\t\t\t\t\t{/* Detail sheet */}\n\t\t\t\t\t{sheetCollection && sheetItemId && (\n\t\t\t\t\t\t<ResourceSheet\n\t\t\t\t\t\t\ttype=\"collection\"\n\t\t\t\t\t\t\tcollection={sheetCollection}\n\t\t\t\t\t\t\titemId={sheetItemId}\n\t\t\t\t\t\t\topen={sheetOpen}\n\t\t\t\t\t\t\tonOpenChange={setSheetOpen}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\n\t\t// For larger counts, show count badge with tooltip\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Tooltip>\n\t\t\t\t\t<TooltipTrigger\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\"inline-flex items-center gap-1.5 cursor-default\",\n\t\t\t\t\t\t\t\t\t\"text-muted-foreground hover:text-foreground transition-colors\",\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Badge variant=\"secondary\" className=\"h-5 px-1.5 text-xs\">\n\t\t\t\t\t\t\t\t\t{value.length}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t<span className=\"text-xs\">\n\t\t\t\t\t\t\t\t\t{resolveText(getRelationItemLabel(value[0]))}\n\t\t\t\t\t\t\t\t\t{value.length > 1 && ` +${value.length - 1}`}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<TooltipContent side=\"bottom\" align=\"start\" className=\"p-0 w-56\">\n\t\t\t\t\t\t<div className=\"max-h-[200px] overflow-y-auto p-2 space-y-1\">\n\t\t\t\t\t\t\t{value.slice(0, 15).map((item, idx) => {\n\t\t\t\t\t\t\t\tconst label = resolveText(getRelationItemLabel(item));\n\t\t\t\t\t\t\t\tconst id = getRelationItemId(item);\n\t\t\t\t\t\t\t\tconst canNavigate = sourceCollection && id;\n\t\t\t\t\t\t\t\tconst key = id ?? label ?? `item-${idx}`;\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<div key={key} className=\"flex items-center gap-1.5 text-xs\">\n\t\t\t\t\t\t\t\t\t\t<span className=\"size-1 rounded-full bg-foreground/60\" />\n\t\t\t\t\t\t\t\t\t\t{canNavigate ? (\n\t\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t\t\thandleChipClick(id, sourceCollection);\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"text-primary hover:underline text-left truncate\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"truncate\">{label}</span>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{value.length > 15 && (\n\t\t\t\t\t\t\t\t<div className=\"text-[11px] text-muted-foreground text-center pt-1 border-t border-border/50 mt-1\">\n\t\t\t\t\t\t\t\t\t+{value.length - 15} more\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</TooltipContent>\n\t\t\t\t</Tooltip>\n\n\t\t\t\t{/* Detail sheet */}\n\t\t\t\t{sheetCollection && sheetItemId && (\n\t\t\t\t\t<ResourceSheet\n\t\t\t\t\t\ttype=\"collection\"\n\t\t\t\t\t\tcollection={sheetCollection}\n\t\t\t\t\t\titemId={sheetItemId}\n\t\t\t\t\t\topen={sheetOpen}\n\t\t\t\t\t\tonOpenChange={setSheetOpen}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn <span className=\"text-muted-foreground\">-</span>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,aAAa,EAC5B,OACA,YAKE;CACF,MAAM,cAAc,gBAAgB;CACpC,MAAM,mBAAmB,WAAW,aAAa;CAKjD,MAAM,CAAC,WAAW,gBAAgBA,QAAM,SAAS,MAAM;CACvD,MAAM,CAAC,aAAa,kBAAkBA,QAAM,UAA8B;CAC1E,MAAM,CAAC,iBAAiB,sBAAsBA,QAAM,UAEjD;CAEH,MAAM,kBAAkBA,QAAM,aAC5B,QAAgB,eAAuB;AACvC,iBAAe,OAAO;AACtB,qBAAmB,WAAW;AAC9B,eAAa,KAAK;IAEnB,EAAE,CACF;AAED,KAAI,UAAU,QAAQ,UAAU,OAC/B,QAAO,oBAAC;EAAK,WAAU;YAAwB;GAAQ;AAIxD,KAAI,MAAM,QAAQ,MAAM,EAAE;AACzB,MAAI,MAAM,WAAW,EACpB,QAAO,oBAAC;GAAK,WAAU;aAAwB;IAAQ;EAGxD,MAAM,eAAe,MAAM,MAAM,GAAG,EAAE;EACtC,MAAM,iBAAiB,MAAM,SAAS;AAEtC,SACC,4CACC,qBAAC,sBACA,oBAAC,kBACA,QACC,qBAAC;GAAK,WAAU;cACd,aAAa,KAAK,MAAM,QACxB,oBAAC;IAGM;IACY;IAClB,SAAS;IACT,WAAU;MAJL,IAKJ,CACD,EACD,iBAAiB,KACjB,qBAAC;IACA,SAAQ;IACR,WAAU;eACV,KACE;KACK;IAEH,GAEP,EACD,MAAM,SAAS,KACf,oBAAC;GAAe,MAAK;GAAS,OAAM;GAAQ,WAAU;aACrD,oBAAC;IAAI,WAAU;cACb,MAAM,KAAK,MAAM,QAAQ;KACzB,MAAM,QAAQ,YAAY,qBAAqB,KAAK,CAAC;KACrD,MAAM,KAAK,kBAAkB,KAAK;KAClC,MAAM,cAAc,oBAAoB;KACxC,MAAM,MAAM,MAAM,SAAS,QAAQ;AAEnC,YACC,qBAAC;MAEA,WAAU;iBAEV,oBAAC,UAAK,WAAU,yCAAyC,EACxD,cACA,oBAAC;OACA,MAAK;OACL,UAAU,MAAM;AACf,UAAE,iBAAiB;AACnB,wBAAgB,IAAI,iBAAiB;;OAEtC,WAAU;iBAET;QACO,GAET,oBAAC,oBAAM,QAAa;QAhBhB,IAkBA;MAEN;KACG;IACU,IAET,EAGT,mBAAmB,eACnB,oBAAC;GACA,MAAK;GACL,YAAY;GACZ,QAAQ;GACR,MAAM;GACN,cAAc;IACb,IAED;;AAKL,QACC,4CACC,oBAAC;EACA,MAAM;EACY;EAClB,SAAS;GACR,EAED,mBAAmB,eACnB,oBAAC;EACA,MAAK;EACL,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,cAAc;GACb,IAED"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { cn } from "../../../../lib/utils.mjs";
|
|
2
|
+
import { Button } from "../../../../components/ui/button.mjs";
|
|
3
|
+
import { Icon } from "@iconify/react";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/client/views/collection/cells/shared/asset-thumbnail.tsx
|
|
8
|
+
function getFileIcon(mimeType) {
|
|
9
|
+
if (!mimeType) return "ph:file";
|
|
10
|
+
const type = mimeType.toLowerCase();
|
|
11
|
+
if (type.startsWith("image/")) return "ph:file-image";
|
|
12
|
+
if (type.startsWith("video/")) return "ph:file-video";
|
|
13
|
+
if (type.startsWith("audio/")) return "ph:file-audio";
|
|
14
|
+
if (type === "application/pdf") return "ph:file-pdf";
|
|
15
|
+
if (type.includes("zip") || type.includes("compressed") || type.includes("archive")) return "ph:file-zip";
|
|
16
|
+
if (type.includes("word") || type.includes("document") || type === "application/rtf") return "ph:file-doc";
|
|
17
|
+
if (type.includes("json") || type.includes("javascript") || type.includes("typescript") || type.includes("xml") || type.includes("html")) return "ph:file-code";
|
|
18
|
+
return "ph:file";
|
|
19
|
+
}
|
|
20
|
+
function isImage(mimeType) {
|
|
21
|
+
return !!mimeType?.toLowerCase().startsWith("image/");
|
|
22
|
+
}
|
|
23
|
+
function isVideo(mimeType) {
|
|
24
|
+
return !!mimeType?.toLowerCase().startsWith("video/");
|
|
25
|
+
}
|
|
26
|
+
function isAudio(mimeType) {
|
|
27
|
+
return !!mimeType?.toLowerCase().startsWith("audio/");
|
|
28
|
+
}
|
|
29
|
+
function AssetThumbnail({ asset, size = "sm", showFilename = false, showControls = false, onClick, className }) {
|
|
30
|
+
if (asset === null || asset === void 0) return /* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: "text-muted-foreground",
|
|
32
|
+
children: "-"
|
|
33
|
+
});
|
|
34
|
+
if (typeof asset === "string") return /* @__PURE__ */ jsxs("span", {
|
|
35
|
+
className: "font-mono text-xs text-muted-foreground truncate max-w-[100px]",
|
|
36
|
+
title: asset,
|
|
37
|
+
children: [asset.slice(0, 8), "..."]
|
|
38
|
+
});
|
|
39
|
+
const assetObj = asset;
|
|
40
|
+
const url = assetObj.url;
|
|
41
|
+
const filename = assetObj.filename;
|
|
42
|
+
const mimeType = assetObj.mimeType;
|
|
43
|
+
const alt = assetObj.alt;
|
|
44
|
+
const isImageType = isImage(mimeType);
|
|
45
|
+
const isVideoType = isVideo(mimeType);
|
|
46
|
+
const isAudioType = isAudio(mimeType);
|
|
47
|
+
const fileIcon = getFileIcon(mimeType);
|
|
48
|
+
if (!url) {
|
|
49
|
+
if (assetObj.id) return /* @__PURE__ */ jsxs("span", {
|
|
50
|
+
className: "font-mono text-xs text-muted-foreground",
|
|
51
|
+
children: [String(assetObj.id).slice(0, 8), "..."]
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ jsx("span", {
|
|
54
|
+
className: "text-muted-foreground",
|
|
55
|
+
children: "-"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (size === "sm") {
|
|
59
|
+
const assetId = assetObj.id;
|
|
60
|
+
const handleClick = onClick && assetId ? () => onClick(assetId) : void 0;
|
|
61
|
+
if (isImageType) return /* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: cn("flex items-center gap-2", onClick && "cursor-pointer hover:opacity-80", className),
|
|
63
|
+
onClick: handleClick,
|
|
64
|
+
children: [/* @__PURE__ */ jsx("img", {
|
|
65
|
+
src: url,
|
|
66
|
+
alt: filename || "Asset",
|
|
67
|
+
className: "size-8 rounded object-cover border"
|
|
68
|
+
}), showFilename && filename && /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: "text-xs truncate max-w-[100px]",
|
|
70
|
+
title: filename,
|
|
71
|
+
children: filename
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
if (showFilename && filename) return /* @__PURE__ */ jsx("span", {
|
|
75
|
+
className: "text-sm truncate max-w-[150px]",
|
|
76
|
+
title: filename,
|
|
77
|
+
children: filename
|
|
78
|
+
});
|
|
79
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
80
|
+
className: "font-mono text-xs text-muted-foreground",
|
|
81
|
+
children: [String(assetObj.id || "").slice(0, 8), "..."]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (size === "md") {
|
|
85
|
+
const assetId = assetObj.id;
|
|
86
|
+
const handleClick = onClick && assetId ? () => onClick(assetId) : void 0;
|
|
87
|
+
if (isImageType) return /* @__PURE__ */ jsx("div", {
|
|
88
|
+
className: cn("flex items-center justify-center", onClick && "cursor-pointer hover:opacity-80", className),
|
|
89
|
+
onClick: handleClick,
|
|
90
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
91
|
+
src: url,
|
|
92
|
+
alt: filename || "Asset",
|
|
93
|
+
className: "size-10 rounded object-cover border"
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
return /* @__PURE__ */ jsx("div", {
|
|
97
|
+
className: cn("flex items-center justify-center", onClick && "cursor-pointer hover:opacity-80", className),
|
|
98
|
+
onClick: handleClick,
|
|
99
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
100
|
+
className: "size-10 rounded border bg-muted flex items-center justify-center",
|
|
101
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
102
|
+
icon: fileIcon,
|
|
103
|
+
className: "size-5 text-muted-foreground"
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
109
|
+
className: cn("relative overflow-hidden rounded-lg border bg-muted/30", className),
|
|
110
|
+
children: [
|
|
111
|
+
isImageType && /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: "relative",
|
|
113
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
114
|
+
src: url,
|
|
115
|
+
alt: alt || filename || "Asset preview",
|
|
116
|
+
className: "max-h-[400px] w-full object-contain"
|
|
117
|
+
})
|
|
118
|
+
}),
|
|
119
|
+
isVideoType && /* @__PURE__ */ jsx("div", {
|
|
120
|
+
className: "relative",
|
|
121
|
+
children: showControls ? /* @__PURE__ */ jsxs("video", {
|
|
122
|
+
src: url,
|
|
123
|
+
controls: true,
|
|
124
|
+
className: "max-h-[400px] w-full",
|
|
125
|
+
preload: "metadata",
|
|
126
|
+
children: [/* @__PURE__ */ jsx("track", { kind: "captions" }), "Your browser does not support the video tag."]
|
|
127
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
128
|
+
className: "flex flex-col items-center justify-center gap-4 p-12",
|
|
129
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
130
|
+
icon: fileIcon,
|
|
131
|
+
className: "size-20 text-muted-foreground"
|
|
132
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
133
|
+
className: "text-sm text-muted-foreground",
|
|
134
|
+
children: filename || "Video"
|
|
135
|
+
})]
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
isAudioType && /* @__PURE__ */ jsxs("div", {
|
|
139
|
+
className: "flex flex-col items-center justify-center gap-4 p-8",
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
142
|
+
icon: fileIcon,
|
|
143
|
+
className: "size-16 text-muted-foreground"
|
|
144
|
+
}),
|
|
145
|
+
showControls && /* @__PURE__ */ jsx("audio", {
|
|
146
|
+
src: url,
|
|
147
|
+
controls: true,
|
|
148
|
+
className: "w-full max-w-md",
|
|
149
|
+
preload: "metadata",
|
|
150
|
+
children: "Your browser does not support the audio tag."
|
|
151
|
+
}),
|
|
152
|
+
!showControls && /* @__PURE__ */ jsx("p", {
|
|
153
|
+
className: "text-sm text-muted-foreground",
|
|
154
|
+
children: filename || "Audio"
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
}),
|
|
158
|
+
!isImageType && !isVideoType && !isAudioType && /* @__PURE__ */ jsxs("div", {
|
|
159
|
+
className: "flex flex-col items-center justify-center gap-4 p-12",
|
|
160
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
161
|
+
icon: fileIcon,
|
|
162
|
+
className: "size-20 text-muted-foreground"
|
|
163
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
164
|
+
className: "text-sm text-muted-foreground",
|
|
165
|
+
children: filename || "File"
|
|
166
|
+
})]
|
|
167
|
+
}),
|
|
168
|
+
/* @__PURE__ */ jsx("div", {
|
|
169
|
+
className: "absolute right-2 top-2",
|
|
170
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
171
|
+
type: "button",
|
|
172
|
+
variant: "secondary",
|
|
173
|
+
size: "icon-sm",
|
|
174
|
+
nativeButton: false,
|
|
175
|
+
render: /* @__PURE__ */ jsx("a", {
|
|
176
|
+
href: url,
|
|
177
|
+
target: "_blank",
|
|
178
|
+
rel: "noopener noreferrer"
|
|
179
|
+
}),
|
|
180
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: "ph:arrow-square-out-bold" })
|
|
181
|
+
})
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
//#endregion
|
|
188
|
+
export { AssetThumbnail };
|
|
189
|
+
//# sourceMappingURL=asset-thumbnail.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-thumbnail.mjs","names":[],"sources":["../../../../../../src/client/views/collection/cells/shared/asset-thumbnail.tsx"],"sourcesContent":["/**\n * AssetThumbnail Component\n *\n * Unified asset display component for all contexts.\n * Replaces 3 duplicate implementations:\n * - UploadCell (32px table)\n * - AssetPreviewCell (40px preview)\n * - AssetPreviewField (400px form preview)\n */\n\nimport * as React from \"react\";\nimport { Icon } from \"@iconify/react\";\nimport { Button } from \"../../../../components/ui/button\";\nimport { cn } from \"../../../../lib/utils\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface AssetThumbnailProps {\n /**\n * Asset object or ID\n */\n asset: unknown;\n\n /**\n * Size variant\n * - sm: 32px (table cells)\n * - md: 40px/64px (preview)\n * - lg: 400px (form preview with controls)\n */\n size?: \"sm\" | \"md\" | \"lg\";\n\n /**\n * Show filename next to thumbnail (sm/md sizes only)\n */\n showFilename?: boolean;\n\n /**\n * Show video/audio controls (lg size only)\n */\n showControls?: boolean;\n\n /**\n * Called when the thumbnail is clicked\n */\n onClick?: (id: string) => void;\n\n /**\n * Additional className\n */\n className?: string;\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction getFileIcon(mimeType?: string): string {\n if (!mimeType) return \"ph:file\";\n\n const type = mimeType.toLowerCase();\n\n if (type.startsWith(\"image/\")) return \"ph:file-image\";\n if (type.startsWith(\"video/\")) return \"ph:file-video\";\n if (type.startsWith(\"audio/\")) return \"ph:file-audio\";\n if (type === \"application/pdf\") return \"ph:file-pdf\";\n if (\n type.includes(\"zip\") ||\n type.includes(\"compressed\") ||\n type.includes(\"archive\")\n )\n return \"ph:file-zip\";\n if (\n type.includes(\"word\") ||\n type.includes(\"document\") ||\n type === \"application/rtf\"\n )\n return \"ph:file-doc\";\n if (\n type.includes(\"json\") ||\n type.includes(\"javascript\") ||\n type.includes(\"typescript\") ||\n type.includes(\"xml\") ||\n type.includes(\"html\")\n )\n return \"ph:file-code\";\n\n return \"ph:file\";\n}\n\nfunction isImage(mimeType?: string): boolean {\n return !!mimeType?.toLowerCase().startsWith(\"image/\");\n}\n\nfunction isVideo(mimeType?: string): boolean {\n return !!mimeType?.toLowerCase().startsWith(\"video/\");\n}\n\nfunction isAudio(mimeType?: string): boolean {\n return !!mimeType?.toLowerCase().startsWith(\"audio/\");\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function AssetThumbnail({\n asset,\n size = \"sm\",\n showFilename = false,\n showControls = false,\n onClick,\n className,\n}: AssetThumbnailProps) {\n // Handle null/undefined\n if (asset === null || asset === undefined) {\n return <span className=\"text-muted-foreground\">-</span>;\n }\n\n // If asset is just an ID string\n if (typeof asset === \"string\") {\n return (\n <span\n className=\"font-mono text-xs text-muted-foreground truncate max-w-[100px]\"\n title={asset}\n >\n {asset.slice(0, 8)}...\n </span>\n );\n }\n\n // Extract asset properties\n const assetObj = asset as Record<string, unknown>;\n const url = assetObj.url as string | undefined;\n const filename = assetObj.filename as string | undefined;\n const mimeType = assetObj.mimeType as string | undefined;\n const alt = assetObj.alt as string | undefined;\n\n const isImageType = isImage(mimeType);\n const isVideoType = isVideo(mimeType);\n const isAudioType = isAudio(mimeType);\n const fileIcon = getFileIcon(mimeType);\n\n // No URL means no preview\n if (!url) {\n if (assetObj.id) {\n return (\n <span className=\"font-mono text-xs text-muted-foreground\">\n {String(assetObj.id).slice(0, 8)}...\n </span>\n );\n }\n return <span className=\"text-muted-foreground\">-</span>;\n }\n\n // ========== SM SIZE (32px) - Table cells ==========\n if (size === \"sm\") {\n const assetId = assetObj.id as string | undefined;\n const handleClick = onClick && assetId ? () => onClick(assetId) : undefined;\n\n if (isImageType) {\n return (\n <div\n className={cn(\n \"flex items-center gap-2\",\n onClick && \"cursor-pointer hover:opacity-80\",\n className,\n )}\n onClick={handleClick}\n >\n <img\n src={url}\n alt={filename || \"Asset\"}\n className=\"size-8 rounded object-cover border\"\n />\n {showFilename && filename && (\n <span className=\"text-xs truncate max-w-[100px]\" title={filename}>\n {filename}\n </span>\n )}\n </div>\n );\n }\n\n // Non-image files\n if (showFilename && filename) {\n return (\n <span className=\"text-sm truncate max-w-[150px]\" title={filename}>\n {filename}\n </span>\n );\n }\n\n return (\n <span className=\"font-mono text-xs text-muted-foreground\">\n {String(assetObj.id || \"\").slice(0, 8)}...\n </span>\n );\n }\n\n // ========== MD SIZE (40px) - Preview/Icon ==========\n if (size === \"md\") {\n const assetId = assetObj.id as string | undefined;\n const handleClick = onClick && assetId ? () => onClick(assetId) : undefined;\n\n if (isImageType) {\n return (\n <div\n className={cn(\n \"flex items-center justify-center\",\n onClick && \"cursor-pointer hover:opacity-80\",\n className,\n )}\n onClick={handleClick}\n >\n <img\n src={url}\n alt={filename || \"Asset\"}\n className=\"size-10 rounded object-cover border\"\n />\n </div>\n );\n }\n\n // Show icon for non-images\n return (\n <div\n className={cn(\n \"flex items-center justify-center\",\n onClick && \"cursor-pointer hover:opacity-80\",\n className,\n )}\n onClick={handleClick}\n >\n <div className=\"size-10 rounded border bg-muted flex items-center justify-center\">\n <Icon icon={fileIcon} className=\"size-5 text-muted-foreground\" />\n </div>\n </div>\n );\n }\n\n // ========== LG SIZE (400px) - Full preview with controls ==========\n return (\n <div\n className={cn(\n \"relative overflow-hidden rounded-lg border bg-muted/30\",\n className,\n )}\n >\n {/* Image Preview */}\n {isImageType && (\n <div className=\"relative\">\n <img\n src={url}\n alt={alt || filename || \"Asset preview\"}\n className=\"max-h-[400px] w-full object-contain\"\n />\n </div>\n )}\n\n {/* Video Preview */}\n {isVideoType && (\n <div className=\"relative\">\n {showControls ? (\n <video\n src={url}\n controls\n className=\"max-h-[400px] w-full\"\n preload=\"metadata\"\n >\n <track kind=\"captions\" />\n Your browser does not support the video tag.\n </video>\n ) : (\n <div className=\"flex flex-col items-center justify-center gap-4 p-12\">\n <Icon icon={fileIcon} className=\"size-20 text-muted-foreground\" />\n <p className=\"text-sm text-muted-foreground\">\n {filename || \"Video\"}\n </p>\n </div>\n )}\n </div>\n )}\n\n {/* Audio Preview */}\n {isAudioType && (\n <div className=\"flex flex-col items-center justify-center gap-4 p-8\">\n <Icon icon={fileIcon} className=\"size-16 text-muted-foreground\" />\n {showControls && (\n <audio\n src={url}\n controls\n className=\"w-full max-w-md\"\n preload=\"metadata\"\n >\n Your browser does not support the audio tag.\n </audio>\n )}\n {!showControls && (\n <p className=\"text-sm text-muted-foreground\">\n {filename || \"Audio\"}\n </p>\n )}\n </div>\n )}\n\n {/* Other File Types */}\n {!isImageType && !isVideoType && !isAudioType && (\n <div className=\"flex flex-col items-center justify-center gap-4 p-12\">\n <Icon icon={fileIcon} className=\"size-20 text-muted-foreground\" />\n <p className=\"text-sm text-muted-foreground\">{filename || \"File\"}</p>\n </div>\n )}\n\n {/* Open in new tab button (lg size only) */}\n <div className=\"absolute right-2 top-2\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"icon-sm\"\n nativeButton={false}\n render={<a href={url} target=\"_blank\" rel=\"noopener noreferrer\" />}\n >\n <Icon icon=\"ph:arrow-square-out-bold\" />\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AA0DA,SAAS,YAAY,UAA2B;AAC9C,KAAI,CAAC,SAAU,QAAO;CAEtB,MAAM,OAAO,SAAS,aAAa;AAEnC,KAAI,KAAK,WAAW,SAAS,CAAE,QAAO;AACtC,KAAI,KAAK,WAAW,SAAS,CAAE,QAAO;AACtC,KAAI,KAAK,WAAW,SAAS,CAAE,QAAO;AACtC,KAAI,SAAS,kBAAmB,QAAO;AACvC,KACE,KAAK,SAAS,MAAM,IACpB,KAAK,SAAS,aAAa,IAC3B,KAAK,SAAS,UAAU,CAExB,QAAO;AACT,KACE,KAAK,SAAS,OAAO,IACrB,KAAK,SAAS,WAAW,IACzB,SAAS,kBAET,QAAO;AACT,KACE,KAAK,SAAS,OAAO,IACrB,KAAK,SAAS,aAAa,IAC3B,KAAK,SAAS,aAAa,IAC3B,KAAK,SAAS,MAAM,IACpB,KAAK,SAAS,OAAO,CAErB,QAAO;AAET,QAAO;;AAGT,SAAS,QAAQ,UAA4B;AAC3C,QAAO,CAAC,CAAC,UAAU,aAAa,CAAC,WAAW,SAAS;;AAGvD,SAAS,QAAQ,UAA4B;AAC3C,QAAO,CAAC,CAAC,UAAU,aAAa,CAAC,WAAW,SAAS;;AAGvD,SAAS,QAAQ,UAA4B;AAC3C,QAAO,CAAC,CAAC,UAAU,aAAa,CAAC,WAAW,SAAS;;AAOvD,SAAgB,eAAe,EAC7B,OACA,OAAO,MACP,eAAe,OACf,eAAe,OACf,SACA,aACsB;AAEtB,KAAI,UAAU,QAAQ,UAAU,OAC9B,QAAO,oBAAC;EAAK,WAAU;YAAwB;GAAQ;AAIzD,KAAI,OAAO,UAAU,SACnB,QACE,qBAAC;EACC,WAAU;EACV,OAAO;aAEN,MAAM,MAAM,GAAG,EAAE,EAAC;GACd;CAKX,MAAM,WAAW;CACjB,MAAM,MAAM,SAAS;CACrB,MAAM,WAAW,SAAS;CAC1B,MAAM,WAAW,SAAS;CAC1B,MAAM,MAAM,SAAS;CAErB,MAAM,cAAc,QAAQ,SAAS;CACrC,MAAM,cAAc,QAAQ,SAAS;CACrC,MAAM,cAAc,QAAQ,SAAS;CACrC,MAAM,WAAW,YAAY,SAAS;AAGtC,KAAI,CAAC,KAAK;AACR,MAAI,SAAS,GACX,QACE,qBAAC;GAAK,WAAU;cACb,OAAO,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,EAAC;IAC5B;AAGX,SAAO,oBAAC;GAAK,WAAU;aAAwB;IAAQ;;AAIzD,KAAI,SAAS,MAAM;EACjB,MAAM,UAAU,SAAS;EACzB,MAAM,cAAc,WAAW,gBAAgB,QAAQ,QAAQ,GAAG;AAElE,MAAI,YACF,QACE,qBAAC;GACC,WAAW,GACT,2BACA,WAAW,mCACX,UACD;GACD,SAAS;cAET,oBAAC;IACC,KAAK;IACL,KAAK,YAAY;IACjB,WAAU;KACV,EACD,gBAAgB,YACf,oBAAC;IAAK,WAAU;IAAiC,OAAO;cACrD;KACI;IAEL;AAKV,MAAI,gBAAgB,SAClB,QACE,oBAAC;GAAK,WAAU;GAAiC,OAAO;aACrD;IACI;AAIX,SACE,qBAAC;GAAK,WAAU;cACb,OAAO,SAAS,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,EAAC;IAClC;;AAKX,KAAI,SAAS,MAAM;EACjB,MAAM,UAAU,SAAS;EACzB,MAAM,cAAc,WAAW,gBAAgB,QAAQ,QAAQ,GAAG;AAElE,MAAI,YACF,QACE,oBAAC;GACC,WAAW,GACT,oCACA,WAAW,mCACX,UACD;GACD,SAAS;aAET,oBAAC;IACC,KAAK;IACL,KAAK,YAAY;IACjB,WAAU;KACV;IACE;AAKV,SACE,oBAAC;GACC,WAAW,GACT,oCACA,WAAW,mCACX,UACD;GACD,SAAS;aAET,oBAAC;IAAI,WAAU;cACb,oBAAC;KAAK,MAAM;KAAU,WAAU;MAAiC;KAC7D;IACF;;AAKV,QACE,qBAAC;EACC,WAAW,GACT,0DACA,UACD;;GAGA,eACC,oBAAC;IAAI,WAAU;cACb,oBAAC;KACC,KAAK;KACL,KAAK,OAAO,YAAY;KACxB,WAAU;MACV;KACE;GAIP,eACC,oBAAC;IAAI,WAAU;cACZ,eACC,qBAAC;KACC,KAAK;KACL;KACA,WAAU;KACV,SAAQ;gBAER,oBAAC,WAAM,MAAK,aAAa;MAEnB,GAER,qBAAC;KAAI,WAAU;gBACb,oBAAC;MAAK,MAAM;MAAU,WAAU;OAAkC,EAClE,oBAAC;MAAE,WAAU;gBACV,YAAY;OACX;MACA;KAEJ;GAIP,eACC,qBAAC;IAAI,WAAU;;KACb,oBAAC;MAAK,MAAM;MAAU,WAAU;OAAkC;KACjE,gBACC,oBAAC;MACC,KAAK;MACL;MACA,WAAU;MACV,SAAQ;gBACT;OAEO;KAET,CAAC,gBACA,oBAAC;MAAE,WAAU;gBACV,YAAY;OACX;;KAEF;GAIP,CAAC,eAAe,CAAC,eAAe,CAAC,eAChC,qBAAC;IAAI,WAAU;eACb,oBAAC;KAAK,MAAM;KAAU,WAAU;MAAkC,EAClE,oBAAC;KAAE,WAAU;eAAiC,YAAY;MAAW;KACjE;GAIR,oBAAC;IAAI,WAAU;cACb,oBAAC;KACC,MAAK;KACL,SAAQ;KACR,MAAK;KACL,cAAc;KACd,QAAQ,oBAAC;MAAE,MAAM;MAAK,QAAO;MAAS,KAAI;OAAwB;eAElE,oBAAC,QAAK,MAAK,6BAA6B;MACjC;KACL;;GACF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { formatLabel } from "../../../../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/client/views/collection/cells/shared/cell-helpers.ts
|
|
4
|
+
/**
|
|
5
|
+
* Get display label for a relation item
|
|
6
|
+
* Prefers _title (backend computed), then common label fields, then id
|
|
7
|
+
*/
|
|
8
|
+
function getRelationItemLabel(item) {
|
|
9
|
+
if (typeof item === "object" && item !== null) {
|
|
10
|
+
const obj = item;
|
|
11
|
+
return String(obj._title || obj.name || obj.title || obj.id || "-");
|
|
12
|
+
}
|
|
13
|
+
return String(item);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get ID from a relation item
|
|
17
|
+
*/
|
|
18
|
+
function getRelationItemId(item) {
|
|
19
|
+
if (typeof item === "object" && item !== null) {
|
|
20
|
+
const obj = item;
|
|
21
|
+
return obj.id ? String(obj.id) : null;
|
|
22
|
+
}
|
|
23
|
+
if (typeof item === "string" || typeof item === "number") return String(item);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Format a field key as a readable label (camelCase -> Title Case)
|
|
28
|
+
* @deprecated Use `formatLabel` from `@/lib/utils` instead
|
|
29
|
+
*/
|
|
30
|
+
const formatFieldLabel = formatLabel;
|
|
31
|
+
/**
|
|
32
|
+
* Get label for a field from field definition or format from key
|
|
33
|
+
*/
|
|
34
|
+
function getFieldLabel(key, fieldDef) {
|
|
35
|
+
if (fieldDef?.["~options"]?.label) return fieldDef["~options"].label;
|
|
36
|
+
return formatFieldLabel(key);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Format a primitive value for display
|
|
40
|
+
*/
|
|
41
|
+
function formatPrimitiveValue(value) {
|
|
42
|
+
if (value === null || value === void 0) return "-";
|
|
43
|
+
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
44
|
+
if (value instanceof Date) return value.toLocaleDateString();
|
|
45
|
+
if (typeof value === "number") return value.toLocaleString();
|
|
46
|
+
return String(value);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Summarize a value for inline preview
|
|
50
|
+
*/
|
|
51
|
+
function summarizeValue(val) {
|
|
52
|
+
if (val === null || val === void 0) return "-";
|
|
53
|
+
if (typeof val === "boolean") return val ? "Yes" : "No";
|
|
54
|
+
if (typeof val === "number") return val.toLocaleString();
|
|
55
|
+
if (typeof val === "string") return val.length > 25 ? `${val.slice(0, 25)}…` : val;
|
|
56
|
+
if (Array.isArray(val)) return `${val.length} items`;
|
|
57
|
+
if (typeof val === "object") return `${Object.keys(val).length} fields`;
|
|
58
|
+
return String(val);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get item label from various sources (used in array cells)
|
|
62
|
+
*/
|
|
63
|
+
function getItemLabel(item, idx, itemLabelFn) {
|
|
64
|
+
if (itemLabelFn) try {
|
|
65
|
+
return itemLabelFn(item) || `Item ${idx + 1}`;
|
|
66
|
+
} catch {
|
|
67
|
+
return `Item ${idx + 1}`;
|
|
68
|
+
}
|
|
69
|
+
if (typeof item === "object" && item !== null) {
|
|
70
|
+
const obj = item;
|
|
71
|
+
return String(obj.name || obj.title || obj.label || obj.platform || obj.type || "") || `Item ${idx + 1}`;
|
|
72
|
+
}
|
|
73
|
+
return formatPrimitiveValue(item);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { formatFieldLabel, formatPrimitiveValue, getFieldLabel, getItemLabel, getRelationItemId, getRelationItemLabel, summarizeValue };
|
|
78
|
+
//# sourceMappingURL=cell-helpers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-helpers.mjs","names":[],"sources":["../../../../../../src/client/views/collection/cells/shared/cell-helpers.ts"],"sourcesContent":["/**\n * Shared helper functions for cell rendering\n * Extracted from build-columns.tsx to reduce duplication\n */\n\nimport type { FieldDefinition } from \"../../../../builder/field/field\";\nimport { formatLabel } from \"../../../../lib/utils\";\n\n/**\n * Get display label for a relation item\n * Prefers _title (backend computed), then common label fields, then id\n */\nexport function getRelationItemLabel(item: unknown): string {\n if (typeof item === \"object\" && item !== null) {\n const obj = item as Record<string, unknown>;\n // Prefer _title computed field from backend\n return String(obj._title || obj.name || obj.title || obj.id || \"-\");\n }\n return String(item);\n}\n\n/**\n * Get ID from a relation item\n */\nexport function getRelationItemId(item: unknown): string | null {\n if (typeof item === \"object\" && item !== null) {\n const obj = item as Record<string, unknown>;\n return obj.id ? String(obj.id) : null;\n }\n if (typeof item === \"string\" || typeof item === \"number\") {\n return String(item);\n }\n return null;\n}\n\n/**\n * Format a field key as a readable label (camelCase -> Title Case)\n * @deprecated Use `formatLabel` from `@/lib/utils` instead\n */\nexport const formatFieldLabel = formatLabel;\n\n/**\n * Get label for a field from field definition or format from key\n */\nexport function getFieldLabel(key: string, fieldDef?: FieldDefinition): string {\n if (fieldDef?.[\"~options\"]?.label) {\n return fieldDef[\"~options\"].label;\n }\n return formatFieldLabel(key);\n}\n\n/**\n * Format a primitive value for display\n */\nexport function formatPrimitiveValue(value: unknown): string {\n if (value === null || value === undefined) return \"-\";\n if (typeof value === \"boolean\") return value ? \"Yes\" : \"No\";\n if (value instanceof Date) return value.toLocaleDateString();\n if (typeof value === \"number\") return value.toLocaleString();\n return String(value);\n}\n\n/**\n * Summarize a value for inline preview\n */\nexport function summarizeValue(val: unknown): string {\n if (val === null || val === undefined) return \"-\";\n if (typeof val === \"boolean\") return val ? \"Yes\" : \"No\";\n if (typeof val === \"number\") return val.toLocaleString();\n if (typeof val === \"string\")\n return val.length > 25 ? `${val.slice(0, 25)}…` : val;\n if (Array.isArray(val)) return `${val.length} items`;\n if (typeof val === \"object\") return `${Object.keys(val).length} fields`;\n return String(val);\n}\n\n/**\n * Get item label from various sources (used in array cells)\n */\nexport function getItemLabel(\n item: unknown,\n idx: number,\n itemLabelFn?: (item: unknown) => string,\n): string {\n if (itemLabelFn) {\n try {\n return itemLabelFn(item) || `Item ${idx + 1}`;\n } catch {\n return `Item ${idx + 1}`;\n }\n }\n if (typeof item === \"object\" && item !== null) {\n const obj = item as Record<string, unknown>;\n return (\n String(\n obj.name || obj.title || obj.label || obj.platform || obj.type || \"\",\n ) || `Item ${idx + 1}`\n );\n }\n return formatPrimitiveValue(item);\n}\n"],"mappings":";;;;;;;AAYA,SAAgB,qBAAqB,MAAuB;AAC1D,KAAI,OAAO,SAAS,YAAY,SAAS,MAAM;EAC7C,MAAM,MAAM;AAEZ,SAAO,OAAO,IAAI,UAAU,IAAI,QAAQ,IAAI,SAAS,IAAI,MAAM,IAAI;;AAErE,QAAO,OAAO,KAAK;;;;;AAMrB,SAAgB,kBAAkB,MAA8B;AAC9D,KAAI,OAAO,SAAS,YAAY,SAAS,MAAM;EAC7C,MAAM,MAAM;AACZ,SAAO,IAAI,KAAK,OAAO,IAAI,GAAG,GAAG;;AAEnC,KAAI,OAAO,SAAS,YAAY,OAAO,SAAS,SAC9C,QAAO,OAAO,KAAK;AAErB,QAAO;;;;;;AAOT,MAAa,mBAAmB;;;;AAKhC,SAAgB,cAAc,KAAa,UAAoC;AAC7E,KAAI,WAAW,aAAa,MAC1B,QAAO,SAAS,YAAY;AAE9B,QAAO,iBAAiB,IAAI;;;;;AAM9B,SAAgB,qBAAqB,OAAwB;AAC3D,KAAI,UAAU,QAAQ,UAAU,OAAW,QAAO;AAClD,KAAI,OAAO,UAAU,UAAW,QAAO,QAAQ,QAAQ;AACvD,KAAI,iBAAiB,KAAM,QAAO,MAAM,oBAAoB;AAC5D,KAAI,OAAO,UAAU,SAAU,QAAO,MAAM,gBAAgB;AAC5D,QAAO,OAAO,MAAM;;;;;AAMtB,SAAgB,eAAe,KAAsB;AACnD,KAAI,QAAQ,QAAQ,QAAQ,OAAW,QAAO;AAC9C,KAAI,OAAO,QAAQ,UAAW,QAAO,MAAM,QAAQ;AACnD,KAAI,OAAO,QAAQ,SAAU,QAAO,IAAI,gBAAgB;AACxD,KAAI,OAAO,QAAQ,SACjB,QAAO,IAAI,SAAS,KAAK,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC,KAAK;AACpD,KAAI,MAAM,QAAQ,IAAI,CAAE,QAAO,GAAG,IAAI,OAAO;AAC7C,KAAI,OAAO,QAAQ,SAAU,QAAO,GAAG,OAAO,KAAK,IAAI,CAAC,OAAO;AAC/D,QAAO,OAAO,IAAI;;;;;AAMpB,SAAgB,aACd,MACA,KACA,aACQ;AACR,KAAI,YACF,KAAI;AACF,SAAO,YAAY,KAAK,IAAI,QAAQ,MAAM;SACpC;AACN,SAAO,QAAQ,MAAM;;AAGzB,KAAI,OAAO,SAAS,YAAY,SAAS,MAAM;EAC7C,MAAM,MAAM;AACZ,SACE,OACE,IAAI,QAAQ,IAAI,SAAS,IAAI,SAAS,IAAI,YAAY,IAAI,QAAQ,GACnE,IAAI,QAAQ,MAAM;;AAGvB,QAAO,qBAAqB,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useResolveText } from "../../../../i18n/hooks.mjs";
|
|
2
|
+
import { cn } from "../../../../lib/utils.mjs";
|
|
3
|
+
import { getRelationItemId, getRelationItemLabel } from "./cell-helpers.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/client/views/collection/cells/shared/relation-chip.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Clickable relation chip component
|
|
9
|
+
* Shows label and navigates to related item on click (or opens sheet if onClick provided)
|
|
10
|
+
*/
|
|
11
|
+
function RelationChip({ item, targetCollection, onClick, className }) {
|
|
12
|
+
const label = useResolveText()(getRelationItemLabel(item));
|
|
13
|
+
const id = getRelationItemId(item);
|
|
14
|
+
const canInteract = targetCollection && id;
|
|
15
|
+
const handleClick = (e) => {
|
|
16
|
+
e.stopPropagation();
|
|
17
|
+
if (onClick && id && targetCollection) {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
onClick(id, targetCollection);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
if (canInteract) return /* @__PURE__ */ jsx("a", {
|
|
23
|
+
href: `/admin/collections/${targetCollection}/${id}`,
|
|
24
|
+
onClick: handleClick,
|
|
25
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
26
|
+
className: cn("inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs", "bg-primary/10 text-primary hover:bg-primary/20", "transition-colors cursor-pointer", "border border-primary/20 hover:border-primary/40", className),
|
|
27
|
+
children: label
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: cn("inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs", "bg-muted text-muted-foreground", "border border-border", className),
|
|
31
|
+
children: label
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { RelationChip };
|
|
37
|
+
//# sourceMappingURL=relation-chip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation-chip.mjs","names":[],"sources":["../../../../../../src/client/views/collection/cells/shared/relation-chip.tsx"],"sourcesContent":["/**\n * RelationChip Component\n *\n * Clickable chip for displaying relation items.\n * Extracted from RelationCell to eliminate duplication.\n * Used by RelationCell and ReverseRelationCell.\n */\n\nimport type * as React from \"react\";\nimport { useResolveText } from \"../../../../i18n/hooks\";\nimport { cn } from \"../../../../lib/utils\";\nimport { getRelationItemId, getRelationItemLabel } from \"./cell-helpers\";\n\nexport interface RelationChipProps {\n\t/**\n\t * Relation item (object with id, name, title, etc.)\n\t */\n\titem: unknown;\n\n\t/**\n\t * Target collection name for navigation\n\t */\n\ttargetCollection?: string;\n\n\t/**\n\t * Click handler (if provided, prevents default navigation)\n\t * Receives item ID and collection name\n\t */\n\tonClick?: (itemId: string, collection: string) => void;\n\n\t/**\n\t * Additional CSS classes\n\t */\n\tclassName?: string;\n}\n\n/**\n * Clickable relation chip component\n * Shows label and navigates to related item on click (or opens sheet if onClick provided)\n */\nexport function RelationChip({\n\titem,\n\ttargetCollection,\n\tonClick,\n\tclassName,\n}: RelationChipProps) {\n\tconst resolveText = useResolveText();\n\tconst label = resolveText(getRelationItemLabel(item));\n\tconst id = getRelationItemId(item);\n\tconst canInteract = targetCollection && id;\n\n\tconst handleClick = (e: React.MouseEvent) => {\n\t\te.stopPropagation();\n\t\tif (onClick && id && targetCollection) {\n\t\t\te.preventDefault();\n\t\t\tonClick(id, targetCollection);\n\t\t}\n\t};\n\n\tif (canInteract) {\n\t\tconst href = `/admin/collections/${targetCollection}/${id}`;\n\t\tconst chipClassName = cn(\n\t\t\t\"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs\",\n\t\t\t\"bg-primary/10 text-primary hover:bg-primary/20\",\n\t\t\t\"transition-colors cursor-pointer\",\n\t\t\t\"border border-primary/20 hover:border-primary/40\",\n\t\t\tclassName,\n\t\t);\n\n\t\t// If onClick provided, use button-like behavior but keep href for accessibility\n\t\treturn (\n\t\t\t<a\n\t\t\t\thref={href}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonPointerDown={(e) => e.stopPropagation()}\n\t\t\t\tclassName={chipClassName}\n\t\t\t>\n\t\t\t\t{label}\n\t\t\t</a>\n\t\t);\n\t}\n\n\t// Non-clickable chip (no target collection or id)\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs\",\n\t\t\t\t\"bg-muted text-muted-foreground\",\n\t\t\t\t\"border border-border\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{label}\n\t\t</span>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAwCA,SAAgB,aAAa,EAC5B,MACA,kBACA,SACA,aACqB;CAErB,MAAM,QADc,gBAAgB,CACV,qBAAqB,KAAK,CAAC;CACrD,MAAM,KAAK,kBAAkB,KAAK;CAClC,MAAM,cAAc,oBAAoB;CAExC,MAAM,eAAe,MAAwB;AAC5C,IAAE,iBAAiB;AACnB,MAAI,WAAW,MAAM,kBAAkB;AACtC,KAAE,gBAAgB;AAClB,WAAQ,IAAI,iBAAiB;;;AAI/B,KAAI,YAWH,QACC,oBAAC;EACA,MAZW,sBAAsB,iBAAiB,GAAG;EAarD,SAAS;EACT,gBAAgB,MAAM,EAAE,iBAAiB;EACzC,WAdoB,GACrB,iEACA,kDACA,oCACA,oDACA,UACA;YAUE;GACE;AAKN,QACC,oBAAC;EACA,WAAW,GACV,iEACA,kCACA,wBACA,UACA;YAEA;GACK"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime197 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/client/views/collection/cells/upload-cells.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Upload Cell Components
|
|
7
|
+
*
|
|
8
|
+
* Cells for displaying asset/upload fields:
|
|
9
|
+
* - UploadCell - single asset
|
|
10
|
+
* - UploadManyCell - multiple assets
|
|
11
|
+
*
|
|
12
|
+
* Uses unified AssetThumbnail component
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Upload cell - displays single asset thumbnail or file info
|
|
16
|
+
* Uses AssetThumbnail with size="sm"
|
|
17
|
+
*/
|
|
18
|
+
declare function UploadCell({
|
|
19
|
+
value
|
|
20
|
+
}: {
|
|
21
|
+
value: unknown;
|
|
22
|
+
}): react_jsx_runtime197.JSX.Element;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { UploadCell };
|
|
25
|
+
//# sourceMappingURL=upload-cells.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-cells.d.mts","names":[],"sources":["../../../../../src/client/views/collection/cells/upload-cells.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAsBA;;;;;;;;;;iBAAgB,UAAA;;;;IAAwC,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AssetThumbnail } from "./shared/asset-thumbnail.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/client/views/collection/cells/upload-cells.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Upload cell - displays single asset thumbnail or file info
|
|
8
|
+
* Uses AssetThumbnail with size="sm"
|
|
9
|
+
*/
|
|
10
|
+
function UploadCell({ value }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(AssetThumbnail, {
|
|
12
|
+
asset: value,
|
|
13
|
+
size: "sm",
|
|
14
|
+
showFilename: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { UploadCell };
|
|
20
|
+
//# sourceMappingURL=upload-cells.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-cells.mjs","names":[],"sources":["../../../../../src/client/views/collection/cells/upload-cells.tsx"],"sourcesContent":["/**\n * Upload Cell Components\n *\n * Cells for displaying asset/upload fields:\n * - UploadCell - single asset\n * - UploadManyCell - multiple assets\n *\n * Uses unified AssetThumbnail component\n */\n\nimport * as React from \"react\";\nimport { Badge } from \"../../../components/ui/badge\";\nimport { AssetThumbnail } from \"./shared/asset-thumbnail\";\n\n// ============================================================================\n// Upload Cell\n// ============================================================================\n\n/**\n * Upload cell - displays single asset thumbnail or file info\n * Uses AssetThumbnail with size=\"sm\"\n */\nexport function UploadCell({ value }: { value: unknown }) {\n return <AssetThumbnail asset={value} size=\"sm\" showFilename />;\n}\n\n// ============================================================================\n// Upload Many Cell\n// ============================================================================\n\n/**\n * Upload many cell - displays multiple assets count or thumbnails\n */\nexport function UploadManyCell({ value }: { value: unknown }) {\n if (value === null || value === undefined) {\n return <span className=\"text-muted-foreground\">-</span>;\n }\n\n if (!Array.isArray(value)) {\n return <span className=\"text-muted-foreground\">-</span>;\n }\n\n if (value.length === 0) {\n return <span className=\"text-muted-foreground\">-</span>;\n }\n\n // Get image assets for preview\n const imageAssets = value\n .filter((item): item is Record<string, unknown> => {\n if (typeof item !== \"object\" || item === null) return false;\n const mimeType = (item as Record<string, unknown>).mimeType;\n return typeof mimeType === \"string\" && mimeType.startsWith(\"image/\");\n })\n .slice(0, 3);\n\n // Show mini grid of thumbnails for images\n if (imageAssets.length > 0) {\n const remaining = value.length - imageAssets.length;\n return (\n <div className=\"flex items-center gap-1\">\n <div className=\"flex -space-x-2\">\n {imageAssets.map((asset, index) => (\n <img\n key={(asset.id as string) || index}\n src={asset.url as string}\n alt={(asset.filename as string) || \"Asset\"}\n className=\"size-6 rounded border bg-background object-cover\"\n />\n ))}\n </div>\n {remaining > 0 && (\n <span className=\"text-xs text-muted-foreground ml-1\">\n +{remaining}\n </span>\n )}\n </div>\n );\n }\n\n // Show count badge for non-images\n return (\n <Badge variant=\"secondary\">\n {value.length} file{value.length !== 1 ? \"s\" : \"\"}\n </Badge>\n );\n}\n"],"mappings":";;;;;;;;;AAsBA,SAAgB,WAAW,EAAE,SAA6B;AACxD,QAAO,oBAAC;EAAe,OAAO;EAAO,MAAK;EAAK;GAAe"}
|