@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,80 @@
|
|
|
1
|
+
import { FilterOperator, FilterRule, SortConfig, ViewConfiguration } from "../../shared/types/saved-views.types.mjs";
|
|
2
|
+
import { RelationDisplayFields, RelationDisplayMode } from "./fields/relation/displays/types.mjs";
|
|
3
|
+
import { BooleanField, BooleanFieldProps } from "./fields/boolean-field.mjs";
|
|
4
|
+
import { ArrayFieldConfig, ArrayItemType, BaseFieldProps, DateFieldProps, DateTimeFieldProps, NumberFieldProps, ObjectFieldConfig, ObjectFieldLayout, RelationFieldConfig, RichTextFieldConfig, SelectFieldProps, SelectOption, TextFieldProps, TextareaFieldProps, TimeFieldConfig, TimeFieldProps, UploadFieldConfig } from "./fields/field-types.mjs";
|
|
5
|
+
import { AuthLayout, AuthLayoutProps } from "../views/auth/auth-layout.mjs";
|
|
6
|
+
import { LoginForm, LoginFormProps, LoginFormValues } from "../views/auth/login-form.mjs";
|
|
7
|
+
import { ForgotPasswordForm, ForgotPasswordFormProps, ForgotPasswordFormValues } from "../views/auth/forgot-password-form.mjs";
|
|
8
|
+
import { ResetPasswordForm, ResetPasswordFormProps, ResetPasswordFormValues } from "../views/auth/reset-password-form.mjs";
|
|
9
|
+
import { AcceptInviteForm, AcceptInviteFormProps, AcceptInviteFormValues } from "../views/auth/accept-invite-form.mjs";
|
|
10
|
+
import { SetupForm, SetupFormProps, SetupFormValues } from "../views/auth/setup-form.mjs";
|
|
11
|
+
import { ArrayCell, JsonCell, ObjectCell } from "../views/collection/cells/complex-cells.mjs";
|
|
12
|
+
import { BooleanCell, DateCell, DateTimeCell, EmailCell, NumberCell, RichTextCell, SelectCell, TextCell, TimeCell } from "../views/collection/cells/primitive-cells.mjs";
|
|
13
|
+
import { RelationCell } from "../views/collection/cells/relation-cells.mjs";
|
|
14
|
+
import { UploadCell } from "../views/collection/cells/upload-cells.mjs";
|
|
15
|
+
import { FormView, FormViewProps, FormViewRegistryConfig } from "../views/collection/form-view.mjs";
|
|
16
|
+
import { TableView, TableViewConfig, TableViewProps } from "../views/collection/table-view.mjs";
|
|
17
|
+
import { AdminSidebarProps, LinkComponentProps } from "../views/layout/admin-sidebar.mjs";
|
|
18
|
+
import { AdminLayout, AdminLayoutProps } from "../views/layout/admin-layout.mjs";
|
|
19
|
+
import { AdminLayoutProvider, AdminLayoutProviderProps } from "../views/layout/admin-layout-provider.mjs";
|
|
20
|
+
import { AdminRouter, AdminRouterProps } from "../views/layout/admin-router.mjs";
|
|
21
|
+
import { DashboardPage, DashboardPageProps } from "../views/pages/dashboard-page.mjs";
|
|
22
|
+
import { LoginPage, LoginPageProps } from "../views/pages/login-page.mjs";
|
|
23
|
+
import { ForgotPasswordPage, ForgotPasswordPageProps } from "../views/pages/forgot-password-page.mjs";
|
|
24
|
+
import { ResetPasswordPage, ResetPasswordPageProps } from "../views/pages/reset-password-page.mjs";
|
|
25
|
+
import { InvitePage, InvitePageProps } from "../views/pages/invite-page.mjs";
|
|
26
|
+
import { AcceptInvitePage, AcceptInvitePageProps } from "../views/pages/accept-invite-page.mjs";
|
|
27
|
+
import { SetupPage, SetupPageProps } from "../views/pages/setup-page.mjs";
|
|
28
|
+
import "../views/index.mjs";
|
|
29
|
+
import "./actions/index.mjs";
|
|
30
|
+
import { AdminLink, AdminLinkProps } from "./admin-link.mjs";
|
|
31
|
+
import { AuthGuard, AuthGuardProps } from "./auth/auth-guard.mjs";
|
|
32
|
+
import { AuthLoading, AuthLoadingProps } from "./auth/auth-loading.mjs";
|
|
33
|
+
import "./auth/index.mjs";
|
|
34
|
+
import { ArrayField, ArrayFieldItemType, ArrayFieldProps } from "./fields/array-field.mjs";
|
|
35
|
+
import { AssetPreviewField, AssetPreviewFieldProps } from "./fields/asset-preview-field.mjs";
|
|
36
|
+
import { BlocksField, BlocksFieldConfig, BlocksFieldProps } from "./fields/blocks-field/blocks-field.mjs";
|
|
37
|
+
import { DateField } from "./fields/date-field.mjs";
|
|
38
|
+
import { DatetimeField } from "./fields/datetime-field.mjs";
|
|
39
|
+
import { EmailField } from "./fields/email-field.mjs";
|
|
40
|
+
import { JsonField, JsonFieldMode, JsonFieldProps } from "./fields/json-field.mjs";
|
|
41
|
+
import { NumberField } from "./fields/number-field.mjs";
|
|
42
|
+
import { ObjectField, ObjectFieldProps } from "./fields/object-field.mjs";
|
|
43
|
+
import { RelationField, RelationFieldProps } from "./fields/relation-field.mjs";
|
|
44
|
+
import { RichTextEditorProps, RichTextFeatures } from "./fields/rich-text-editor/types.mjs";
|
|
45
|
+
import { RichTextField } from "./fields/rich-text-field.mjs";
|
|
46
|
+
import { SelectField } from "./fields/select-field.mjs";
|
|
47
|
+
import { TextField } from "./fields/text-field.mjs";
|
|
48
|
+
import { TextareaField } from "./fields/textarea-field.mjs";
|
|
49
|
+
import { TimeField } from "./fields/time-field.mjs";
|
|
50
|
+
import { UploadField, UploadFieldProps } from "./fields/upload-field.mjs";
|
|
51
|
+
import "./fields/index.mjs";
|
|
52
|
+
import "./filter-builder/index.mjs";
|
|
53
|
+
import "./locale-switcher.mjs";
|
|
54
|
+
import "./sheets/index.mjs";
|
|
55
|
+
import "./ui/accordion.mjs";
|
|
56
|
+
import "./ui/avatar.mjs";
|
|
57
|
+
import "./ui/badge.mjs";
|
|
58
|
+
import "./ui/button.mjs";
|
|
59
|
+
import "./ui/card.mjs";
|
|
60
|
+
import "./ui/checkbox.mjs";
|
|
61
|
+
import "./ui/combobox.mjs";
|
|
62
|
+
import "./ui/dialog.mjs";
|
|
63
|
+
import "./ui/dropdown-menu.mjs";
|
|
64
|
+
import "./ui/label.mjs";
|
|
65
|
+
import "./ui/field.mjs";
|
|
66
|
+
import "./ui/input.mjs";
|
|
67
|
+
import "./ui/input-group.mjs";
|
|
68
|
+
import "./ui/popover.mjs";
|
|
69
|
+
import "./ui/scroll-area.mjs";
|
|
70
|
+
import "./ui/select.mjs";
|
|
71
|
+
import "./ui/separator.mjs";
|
|
72
|
+
import "./ui/sheet.mjs";
|
|
73
|
+
import "./ui/tooltip.mjs";
|
|
74
|
+
import "./ui/sidebar.mjs";
|
|
75
|
+
import "./ui/skeleton.mjs";
|
|
76
|
+
import "./ui/spinner.mjs";
|
|
77
|
+
import "./ui/switch.mjs";
|
|
78
|
+
import "./ui/table.mjs";
|
|
79
|
+
import "./ui/tabs.mjs";
|
|
80
|
+
import "./ui/textarea.mjs";
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { useResolveText } from "../i18n/hooks.mjs";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { getFlagUrl } from "../utils/locale-to-flag.mjs";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./ui/dropdown-menu.mjs";
|
|
5
|
+
import { Icon } from "@iconify/react";
|
|
6
|
+
import { useMemo, useState } from "react";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/client/components/locale-switcher.tsx
|
|
10
|
+
const DROPDOWN_THRESHOLD = 4;
|
|
11
|
+
function LocaleSwitcher({ locales, value, onChange, showFlag = true, labelMode = "code", className }) {
|
|
12
|
+
const resolveText = useResolveText();
|
|
13
|
+
const [imgError, setImgError] = useState(false);
|
|
14
|
+
const resolvedValue = value ?? locales[0]?.code ?? "";
|
|
15
|
+
const hasResolvedValue = resolvedValue.length > 0;
|
|
16
|
+
const localeOptions = locales.length ? locales : hasResolvedValue ? [{ code: resolvedValue }] : [];
|
|
17
|
+
const currentLocale = localeOptions.find((locale) => locale.code === resolvedValue) ?? { code: resolvedValue };
|
|
18
|
+
const canSwitch = !!onChange && localeOptions.length > 1;
|
|
19
|
+
const useDropdown = localeOptions.length >= DROPDOWN_THRESHOLD;
|
|
20
|
+
const flagMapping = useMemo(() => {
|
|
21
|
+
const mapping = {};
|
|
22
|
+
for (const locale of localeOptions) if (locale.flagCountryCode) mapping[locale.code.toLowerCase()] = locale.flagCountryCode;
|
|
23
|
+
return mapping;
|
|
24
|
+
}, [localeOptions]);
|
|
25
|
+
const hasCustomMapping = Object.keys(flagMapping).length > 0;
|
|
26
|
+
const getLocaleFlagUrl = (code, size = 24) => getFlagUrl(code, size, hasCustomMapping ? flagMapping : void 0);
|
|
27
|
+
if (!hasResolvedValue) return null;
|
|
28
|
+
const codeLabel = currentLocale.code.toUpperCase();
|
|
29
|
+
const nameLabel = currentLocale.label ? resolveText(currentLocale.label) : codeLabel;
|
|
30
|
+
const renderLabel = () => {
|
|
31
|
+
switch (labelMode) {
|
|
32
|
+
case "none": return null;
|
|
33
|
+
case "name": return /* @__PURE__ */ jsx("span", {
|
|
34
|
+
className: "font-medium",
|
|
35
|
+
children: nameLabel
|
|
36
|
+
});
|
|
37
|
+
case "both": return /* @__PURE__ */ jsxs("span", {
|
|
38
|
+
className: "flex items-center gap-1",
|
|
39
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: "uppercase tracking-wide",
|
|
41
|
+
children: codeLabel
|
|
42
|
+
}), currentLocale.label && /* @__PURE__ */ jsx("span", {
|
|
43
|
+
className: "font-normal text-muted-foreground",
|
|
44
|
+
children: resolveText(currentLocale.label)
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
case "code":
|
|
48
|
+
default: return /* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: "uppercase tracking-wide",
|
|
50
|
+
children: codeLabel
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const baseClassName = cn("inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", className);
|
|
55
|
+
const interactiveClassName = cn(baseClassName, "cursor-pointer transition-colors hover:bg-muted/80 focus:outline-none focus:ring-1 focus:ring-ring");
|
|
56
|
+
const ariaLabel = `Switch locale (current: ${nameLabel})`;
|
|
57
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [showFlag && !imgError && /* @__PURE__ */ jsx("img", {
|
|
58
|
+
src: getLocaleFlagUrl(resolvedValue),
|
|
59
|
+
alt: resolvedValue,
|
|
60
|
+
className: "h-2.5 w-3.5 rounded-[1px] object-cover",
|
|
61
|
+
onError: () => setImgError(true)
|
|
62
|
+
}), renderLabel()] });
|
|
63
|
+
if (!canSwitch) return /* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: baseClassName,
|
|
65
|
+
children: content
|
|
66
|
+
});
|
|
67
|
+
if (!useDropdown) {
|
|
68
|
+
const handleCycle = (e) => {
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
const nextLocale = localeOptions[(localeOptions.findIndex((locale) => locale.code === resolvedValue) + 1) % localeOptions.length]?.code;
|
|
71
|
+
if (nextLocale) onChange(nextLocale);
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ jsx("button", {
|
|
74
|
+
type: "button",
|
|
75
|
+
onClick: handleCycle,
|
|
76
|
+
className: interactiveClassName,
|
|
77
|
+
"aria-label": ariaLabel,
|
|
78
|
+
title: ariaLabel,
|
|
79
|
+
children: content
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
83
|
+
className: interactiveClassName,
|
|
84
|
+
"aria-label": ariaLabel,
|
|
85
|
+
title: ariaLabel,
|
|
86
|
+
onClick: (e) => e.stopPropagation(),
|
|
87
|
+
children: [content, /* @__PURE__ */ jsx(Icon, {
|
|
88
|
+
icon: "ph:caret-down",
|
|
89
|
+
className: "size-2.5"
|
|
90
|
+
})]
|
|
91
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
92
|
+
align: "start",
|
|
93
|
+
className: "min-w-[140px]",
|
|
94
|
+
children: localeOptions.map((locale) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
95
|
+
onClick: (e) => {
|
|
96
|
+
e.stopPropagation();
|
|
97
|
+
onChange(locale.code);
|
|
98
|
+
},
|
|
99
|
+
className: "gap-2 text-xs",
|
|
100
|
+
children: [
|
|
101
|
+
showFlag && /* @__PURE__ */ jsx("img", {
|
|
102
|
+
src: getLocaleFlagUrl(locale.code),
|
|
103
|
+
alt: locale.code,
|
|
104
|
+
className: "h-2.5 w-3.5 rounded-[1px] object-cover",
|
|
105
|
+
onError: (event) => {
|
|
106
|
+
event.currentTarget.style.display = "none";
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsx("span", {
|
|
110
|
+
className: "uppercase font-medium",
|
|
111
|
+
children: locale.code
|
|
112
|
+
}),
|
|
113
|
+
locale.label && /* @__PURE__ */ jsx("span", {
|
|
114
|
+
className: "text-muted-foreground",
|
|
115
|
+
children: resolveText(locale.label)
|
|
116
|
+
}),
|
|
117
|
+
locale.code === resolvedValue && /* @__PURE__ */ jsx(Icon, {
|
|
118
|
+
icon: "ph:check",
|
|
119
|
+
className: "ml-auto size-3"
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
}, locale.code))
|
|
123
|
+
})] });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
export { LocaleSwitcher };
|
|
128
|
+
//# sourceMappingURL=locale-switcher.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-switcher.mjs","names":["mapping: Record<string, string>"],"sources":["../../../src/client/components/locale-switcher.tsx"],"sourcesContent":["import { Icon } from \"@iconify/react\";\nimport type * as React from \"react\";\nimport { useMemo, useState } from \"react\";\nimport { useResolveText } from \"../i18n/hooks\";\nimport type { I18nText } from \"../i18n/types\";\nimport { cn } from \"../lib/utils\";\nimport { getFlagUrl } from \"../utils/locale-to-flag\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"./ui/dropdown-menu\";\n\nexport type LocaleOption = {\n code: string;\n label?: I18nText;\n flagCountryCode?: string;\n};\n\nexport type LocaleSwitcherLabelMode = \"code\" | \"name\" | \"both\" | \"none\";\n\nexport interface LocaleSwitcherProps {\n locales: LocaleOption[];\n value?: string;\n onChange?: (locale: string) => void;\n showFlag?: boolean;\n labelMode?: LocaleSwitcherLabelMode;\n className?: string;\n}\n\nconst DROPDOWN_THRESHOLD = 4;\n\nexport function LocaleSwitcher({\n locales,\n value,\n onChange,\n showFlag = true,\n labelMode = \"code\",\n className,\n}: LocaleSwitcherProps): React.ReactElement | null {\n const resolveText = useResolveText();\n const [imgError, setImgError] = useState(false);\n const resolvedValue = value ?? locales[0]?.code ?? \"\";\n const hasResolvedValue = resolvedValue.length > 0;\n const localeOptions = locales.length\n ? locales\n : hasResolvedValue\n ? [{ code: resolvedValue } satisfies LocaleOption]\n : [];\n const currentLocale =\n localeOptions.find((locale) => locale.code === resolvedValue) ??\n ({ code: resolvedValue } satisfies LocaleOption);\n const canSwitch = !!onChange && localeOptions.length > 1;\n const useDropdown = localeOptions.length >= DROPDOWN_THRESHOLD;\n\n const flagMapping = useMemo(() => {\n const mapping: Record<string, string> = {};\n for (const locale of localeOptions) {\n if (locale.flagCountryCode) {\n mapping[locale.code.toLowerCase()] = locale.flagCountryCode;\n }\n }\n return mapping;\n }, [localeOptions]);\n const hasCustomMapping = Object.keys(flagMapping).length > 0;\n\n const getLocaleFlagUrl = (code: string, size = 24) =>\n getFlagUrl(code, size, hasCustomMapping ? flagMapping : undefined);\n\n if (!hasResolvedValue) return null;\n\n const codeLabel = currentLocale.code.toUpperCase();\n const nameLabel = currentLocale.label\n ? resolveText(currentLocale.label)\n : codeLabel;\n const renderLabel = () => {\n switch (labelMode) {\n case \"none\":\n return null;\n case \"name\":\n return <span className=\"font-medium\">{nameLabel}</span>;\n case \"both\":\n return (\n <span className=\"flex items-center gap-1\">\n <span className=\"uppercase tracking-wide\">{codeLabel}</span>\n {currentLocale.label && (\n <span className=\"font-normal text-muted-foreground\">\n {resolveText(currentLocale.label)}\n </span>\n )}\n </span>\n );\n case \"code\":\n default:\n return <span className=\"uppercase tracking-wide\">{codeLabel}</span>;\n }\n };\n\n const baseClassName = cn(\n \"inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground\",\n className,\n );\n const interactiveClassName = cn(\n baseClassName,\n \"cursor-pointer transition-colors hover:bg-muted/80 focus:outline-none focus:ring-1 focus:ring-ring\",\n );\n const ariaLabel = `Switch locale (current: ${nameLabel})`;\n\n const content = (\n <>\n {showFlag && !imgError && (\n <img\n src={getLocaleFlagUrl(resolvedValue)}\n alt={resolvedValue}\n className=\"h-2.5 w-3.5 rounded-[1px] object-cover\"\n onError={() => setImgError(true)}\n />\n )}\n {renderLabel()}\n </>\n );\n\n if (!canSwitch) {\n return <span className={baseClassName}>{content}</span>;\n }\n\n if (!useDropdown) {\n const handleCycle = (e: React.MouseEvent) => {\n e.stopPropagation();\n const currentIndex = localeOptions.findIndex(\n (locale) => locale.code === resolvedValue,\n );\n const nextIndex = (currentIndex + 1) % localeOptions.length;\n const nextLocale = localeOptions[nextIndex]?.code;\n if (nextLocale) onChange(nextLocale);\n };\n\n return (\n <button\n type=\"button\"\n onClick={handleCycle}\n className={interactiveClassName}\n aria-label={ariaLabel}\n title={ariaLabel}\n >\n {content}\n </button>\n );\n }\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n className={interactiveClassName}\n aria-label={ariaLabel}\n title={ariaLabel}\n onClick={(e) => e.stopPropagation()}\n >\n {content}\n <Icon icon=\"ph:caret-down\" className=\"size-2.5\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" className=\"min-w-[140px]\">\n {localeOptions.map((locale) => (\n <DropdownMenuItem\n key={locale.code}\n onClick={(e) => {\n e.stopPropagation();\n onChange(locale.code);\n }}\n className=\"gap-2 text-xs\"\n >\n {showFlag && (\n <img\n src={getLocaleFlagUrl(locale.code)}\n alt={locale.code}\n className=\"h-2.5 w-3.5 rounded-[1px] object-cover\"\n onError={(event) => {\n event.currentTarget.style.display = \"none\";\n }}\n />\n )}\n <span className=\"uppercase font-medium\">{locale.code}</span>\n {locale.label && (\n <span className=\"text-muted-foreground\">\n {resolveText(locale.label)}\n </span>\n )}\n {locale.code === resolvedValue && (\n <Icon icon=\"ph:check\" className=\"ml-auto size-3\" />\n )}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";;;;;;;;;AA+BA,MAAM,qBAAqB;AAE3B,SAAgB,eAAe,EAC7B,SACA,OACA,UACA,WAAW,MACX,YAAY,QACZ,aACiD;CACjD,MAAM,cAAc,gBAAgB;CACpC,MAAM,CAAC,UAAU,eAAe,SAAS,MAAM;CAC/C,MAAM,gBAAgB,SAAS,QAAQ,IAAI,QAAQ;CACnD,MAAM,mBAAmB,cAAc,SAAS;CAChD,MAAM,gBAAgB,QAAQ,SAC1B,UACA,mBACE,CAAC,EAAE,MAAM,eAAe,CAAwB,GAChD,EAAE;CACR,MAAM,gBACJ,cAAc,MAAM,WAAW,OAAO,SAAS,cAAc,IAC5D,EAAE,MAAM,eAAe;CAC1B,MAAM,YAAY,CAAC,CAAC,YAAY,cAAc,SAAS;CACvD,MAAM,cAAc,cAAc,UAAU;CAE5C,MAAM,cAAc,cAAc;EAChC,MAAMA,UAAkC,EAAE;AAC1C,OAAK,MAAM,UAAU,cACnB,KAAI,OAAO,gBACT,SAAQ,OAAO,KAAK,aAAa,IAAI,OAAO;AAGhD,SAAO;IACN,CAAC,cAAc,CAAC;CACnB,MAAM,mBAAmB,OAAO,KAAK,YAAY,CAAC,SAAS;CAE3D,MAAM,oBAAoB,MAAc,OAAO,OAC7C,WAAW,MAAM,MAAM,mBAAmB,cAAc,OAAU;AAEpE,KAAI,CAAC,iBAAkB,QAAO;CAE9B,MAAM,YAAY,cAAc,KAAK,aAAa;CAClD,MAAM,YAAY,cAAc,QAC5B,YAAY,cAAc,MAAM,GAChC;CACJ,MAAM,oBAAoB;AACxB,UAAQ,WAAR;GACE,KAAK,OACH,QAAO;GACT,KAAK,OACH,QAAO,oBAAC;IAAK,WAAU;cAAe;KAAiB;GACzD,KAAK,OACH,QACE,qBAAC;IAAK,WAAU;eACd,oBAAC;KAAK,WAAU;eAA2B;MAAiB,EAC3D,cAAc,SACb,oBAAC;KAAK,WAAU;eACb,YAAY,cAAc,MAAM;MAC5B;KAEJ;GAEX,KAAK;GACL,QACE,QAAO,oBAAC;IAAK,WAAU;cAA2B;KAAiB;;;CAIzE,MAAM,gBAAgB,GACpB,+GACA,UACD;CACD,MAAM,uBAAuB,GAC3B,eACA,qGACD;CACD,MAAM,YAAY,2BAA2B,UAAU;CAEvD,MAAM,UACJ,4CACG,YAAY,CAAC,YACZ,oBAAC;EACC,KAAK,iBAAiB,cAAc;EACpC,KAAK;EACL,WAAU;EACV,eAAe,YAAY,KAAK;GAChC,EAEH,aAAa,IACb;AAGL,KAAI,CAAC,UACH,QAAO,oBAAC;EAAK,WAAW;YAAgB;GAAe;AAGzD,KAAI,CAAC,aAAa;EAChB,MAAM,eAAe,MAAwB;AAC3C,KAAE,iBAAiB;GAKnB,MAAM,aAAa,eAJE,cAAc,WAChC,WAAW,OAAO,SAAS,cAC7B,GACiC,KAAK,cAAc,SACR;AAC7C,OAAI,WAAY,UAAS,WAAW;;AAGtC,SACE,oBAAC;GACC,MAAK;GACL,SAAS;GACT,WAAW;GACX,cAAY;GACZ,OAAO;aAEN;IACM;;AAIb,QACE,qBAAC,2BACC,qBAAC;EACC,WAAW;EACX,cAAY;EACZ,OAAO;EACP,UAAU,MAAM,EAAE,iBAAiB;aAElC,SACD,oBAAC;GAAK,MAAK;GAAgB,WAAU;IAAa;GAC9B,EACtB,oBAAC;EAAoB,OAAM;EAAQ,WAAU;YAC1C,cAAc,KAAK,WAClB,qBAAC;GAEC,UAAU,MAAM;AACd,MAAE,iBAAiB;AACnB,aAAS,OAAO,KAAK;;GAEvB,WAAU;;IAET,YACC,oBAAC;KACC,KAAK,iBAAiB,OAAO,KAAK;KAClC,KAAK,OAAO;KACZ,WAAU;KACV,UAAU,UAAU;AAClB,YAAM,cAAc,MAAM,UAAU;;MAEtC;IAEJ,oBAAC;KAAK,WAAU;eAAyB,OAAO;MAAY;IAC3D,OAAO,SACN,oBAAC;KAAK,WAAU;eACb,YAAY,OAAO,MAAM;MACrB;IAER,OAAO,SAAS,iBACf,oBAAC;KAAK,MAAK;KAAW,WAAU;MAAmB;;KAxBhD,OAAO,KA0BK,CACnB;GACkB,IACT"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.mjs";
|
|
2
|
+
import { Skeleton } from "../ui/skeleton.mjs";
|
|
3
|
+
import { Icon } from "@iconify/react";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/client/components/media/media-grid.tsx
|
|
8
|
+
/**
|
|
9
|
+
* MediaGrid Component
|
|
10
|
+
*
|
|
11
|
+
* Reusable grid display for assets with selection support.
|
|
12
|
+
* Used in MediaPickerDialog and potentially in assets table view.
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* - Responsive columns (2-5)
|
|
16
|
+
* - Single/multiple/no selection modes
|
|
17
|
+
* - Loading skeleton
|
|
18
|
+
* - Click handling
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <MediaGrid
|
|
23
|
+
* assets={assets}
|
|
24
|
+
* selectedIds={selectedIds}
|
|
25
|
+
* onSelectionChange={setSelectedIds}
|
|
26
|
+
* selectionMode="multiple"
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Get file icon color based on MIME type
|
|
32
|
+
*/
|
|
33
|
+
function getAssetTypeColor(mimeType) {
|
|
34
|
+
if (!mimeType) return "bg-muted";
|
|
35
|
+
const type = mimeType.toLowerCase();
|
|
36
|
+
if (type.startsWith("image/")) return "bg-info/10";
|
|
37
|
+
if (type.startsWith("video/")) return "bg-primary/10";
|
|
38
|
+
if (type.startsWith("audio/")) return "bg-success/10";
|
|
39
|
+
if (type === "application/pdf") return "bg-destructive/10";
|
|
40
|
+
return "bg-muted";
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Check if MIME type is an image
|
|
44
|
+
*/
|
|
45
|
+
function isImage(mimeType) {
|
|
46
|
+
return !!mimeType?.toLowerCase().startsWith("image/");
|
|
47
|
+
}
|
|
48
|
+
function MediaGridSkeleton({ columns = 4 }) {
|
|
49
|
+
const count = columns * 3;
|
|
50
|
+
const skeletonKeys = React$1.useMemo(() => Array.from({ length: count }, () => crypto.randomUUID()), [count]);
|
|
51
|
+
return /* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: cn("grid gap-3", columns === 2 ? "grid-cols-2" : columns === 3 ? "grid-cols-2 sm:grid-cols-3" : columns === 5 ? "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5" : "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4"),
|
|
53
|
+
children: skeletonKeys.map((key) => /* @__PURE__ */ jsxs("div", {
|
|
54
|
+
className: "space-y-2",
|
|
55
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "aspect-square w-full rounded-lg" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4" })]
|
|
56
|
+
}, key))
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function AssetItem({ asset, selected, selectionMode, onToggle, onClick }) {
|
|
60
|
+
const [imageError, setImageError] = React$1.useState(false);
|
|
61
|
+
const thumbnailUrl = asset.url;
|
|
62
|
+
const isImageType = isImage(asset.mimeType);
|
|
63
|
+
const showCheckbox = selectionMode !== "none";
|
|
64
|
+
const handleClick = () => {
|
|
65
|
+
if (selectionMode !== "none") onToggle();
|
|
66
|
+
onClick?.();
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
69
|
+
type: "button",
|
|
70
|
+
onClick: handleClick,
|
|
71
|
+
className: cn("group relative aspect-square w-full overflow-hidden rounded-lg border", "transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", selected ? "ring-primary border-primary ring-2" : "border-border/60 hover:border-border", "bg-muted/30"),
|
|
72
|
+
children: [
|
|
73
|
+
thumbnailUrl && isImageType && !imageError ? /* @__PURE__ */ jsx("img", {
|
|
74
|
+
src: thumbnailUrl,
|
|
75
|
+
alt: asset.alt || asset.filename || "Asset",
|
|
76
|
+
className: "h-full w-full object-cover",
|
|
77
|
+
onError: () => setImageError(true)
|
|
78
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
79
|
+
className: cn("flex h-full w-full items-center justify-center", getAssetTypeColor(asset.mimeType)),
|
|
80
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
81
|
+
className: "text-muted-foreground text-xs font-medium uppercase",
|
|
82
|
+
children: asset.mimeType?.split("/")[1]?.slice(0, 4) || "FILE"
|
|
83
|
+
})
|
|
84
|
+
}),
|
|
85
|
+
showCheckbox && /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: cn("absolute right-2 top-2 flex size-5 items-center justify-center rounded-full border-2 transition-all", selected ? "bg-primary border-primary" : "border-white bg-black/20 backdrop-blur-sm group-hover:bg-black/40"),
|
|
87
|
+
children: selected && /* @__PURE__ */ jsx(Icon, {
|
|
88
|
+
icon: "ph:check-bold",
|
|
89
|
+
className: "size-3 text-white"
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
asset.filename && /* @__PURE__ */ jsx("div", {
|
|
93
|
+
className: "absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/60 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100",
|
|
94
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
95
|
+
className: "truncate text-xs text-white",
|
|
96
|
+
title: asset.filename,
|
|
97
|
+
children: asset.filename
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function MediaGrid({ assets, selectedIds = /* @__PURE__ */ new Set(), onSelectionChange, selectionMode = "none", loading = false, onAssetClick, columns = 4, className }) {
|
|
104
|
+
const handleToggle = (assetId) => {
|
|
105
|
+
if (!onSelectionChange) return;
|
|
106
|
+
const newSelection = new Set(selectedIds);
|
|
107
|
+
if (selectionMode === "single") {
|
|
108
|
+
newSelection.clear();
|
|
109
|
+
newSelection.add(assetId);
|
|
110
|
+
} else if (newSelection.has(assetId)) newSelection.delete(assetId);
|
|
111
|
+
else newSelection.add(assetId);
|
|
112
|
+
onSelectionChange(newSelection);
|
|
113
|
+
};
|
|
114
|
+
if (loading) return /* @__PURE__ */ jsx("div", {
|
|
115
|
+
className,
|
|
116
|
+
children: /* @__PURE__ */ jsx(MediaGridSkeleton, { columns })
|
|
117
|
+
});
|
|
118
|
+
if (assets.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
119
|
+
className: cn("flex flex-col items-center justify-center rounded-lg border border-dashed p-12", "bg-muted/30 text-muted-foreground", className),
|
|
120
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
121
|
+
className: "text-sm",
|
|
122
|
+
children: "No assets found"
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
return /* @__PURE__ */ jsx("div", {
|
|
126
|
+
className: cn("grid gap-3", columns === 2 ? "grid-cols-2" : columns === 3 ? "grid-cols-2 sm:grid-cols-3" : columns === 5 ? "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5" : "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4", className),
|
|
127
|
+
children: assets.map((asset) => /* @__PURE__ */ jsx(AssetItem, {
|
|
128
|
+
asset,
|
|
129
|
+
selected: selectedIds.has(asset.id),
|
|
130
|
+
selectionMode,
|
|
131
|
+
onToggle: () => handleToggle(asset.id),
|
|
132
|
+
onClick: onAssetClick ? () => onAssetClick(asset) : void 0
|
|
133
|
+
}, asset.id))
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
export { MediaGrid };
|
|
139
|
+
//# sourceMappingURL=media-grid.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-grid.mjs","names":["React"],"sources":["../../../../src/client/components/media/media-grid.tsx"],"sourcesContent":["/**\n * MediaGrid Component\n *\n * Reusable grid display for assets with selection support.\n * Used in MediaPickerDialog and potentially in assets table view.\n *\n * Features:\n * - Responsive columns (2-5)\n * - Single/multiple/no selection modes\n * - Loading skeleton\n * - Click handling\n *\n * @example\n * ```tsx\n * <MediaGrid\n * assets={assets}\n * selectedIds={selectedIds}\n * onSelectionChange={setSelectedIds}\n * selectionMode=\"multiple\"\n * />\n * ```\n */\n\nimport { Icon } from \"@iconify/react\";\nimport * as React from \"react\";\nimport type { Asset } from \"../../hooks/use-upload\";\nimport { cn } from \"../../lib/utils\";\nimport { Skeleton } from \"../ui/skeleton\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface MediaGridProps {\n\t/**\n\t * Assets to display\n\t */\n\tassets: Asset[];\n\n\t/**\n\t * Currently selected asset IDs\n\t */\n\tselectedIds?: Set<string>;\n\n\t/**\n\t * Called when selection changes\n\t */\n\tonSelectionChange?: (ids: Set<string>) => void;\n\n\t/**\n\t * Selection mode\n\t * @default \"none\"\n\t */\n\tselectionMode?: \"single\" | \"multiple\" | \"none\";\n\n\t/**\n\t * Loading state (shows skeleton)\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Called when an asset is clicked\n\t */\n\tonAssetClick?: (asset: Asset) => void;\n\n\t/**\n\t * Number of columns\n\t * @default 4\n\t */\n\tcolumns?: 2 | 3 | 4 | 5;\n\n\t/**\n\t * Additional className\n\t */\n\tclassName?: string;\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Get file icon color based on MIME type\n */\nfunction getAssetTypeColor(mimeType?: string): string {\n\tif (!mimeType) return \"bg-muted\";\n\n\tconst type = mimeType.toLowerCase();\n\n\tif (type.startsWith(\"image/\")) return \"bg-info/10\";\n\tif (type.startsWith(\"video/\")) return \"bg-primary/10\";\n\tif (type.startsWith(\"audio/\")) return \"bg-success/10\";\n\tif (type === \"application/pdf\") return \"bg-destructive/10\";\n\n\treturn \"bg-muted\";\n}\n\n/**\n * Check if MIME type is an image\n */\nfunction isImage(mimeType?: string): boolean {\n\treturn !!mimeType?.toLowerCase().startsWith(\"image/\");\n}\n\n// ============================================================================\n// Skeleton Component\n// ============================================================================\n\nfunction MediaGridSkeleton({ columns = 4 }: { columns?: 2 | 3 | 4 | 5 }) {\n\tconst count = columns * 3; // Show 3 rows\n\tconst skeletonKeys = React.useMemo(\n\t\t() => Array.from({ length: count }, () => crypto.randomUUID()),\n\t\t[count],\n\t);\n\tconst gridClass =\n\t\tcolumns === 2\n\t\t\t? \"grid-cols-2\"\n\t\t\t: columns === 3\n\t\t\t\t? \"grid-cols-2 sm:grid-cols-3\"\n\t\t\t\t: columns === 5\n\t\t\t\t\t? \"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5\"\n\t\t\t\t\t: \"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4\";\n\n\treturn (\n\t\t<div className={cn(\"grid gap-3\", gridClass)}>\n\t\t\t{skeletonKeys.map((key) => (\n\t\t\t\t<div key={key} className=\"space-y-2\">\n\t\t\t\t\t<Skeleton className=\"aspect-square w-full rounded-lg\" />\n\t\t\t\t\t<Skeleton className=\"h-4 w-3/4\" />\n\t\t\t\t</div>\n\t\t\t))}\n\t\t</div>\n\t);\n}\n\n// ============================================================================\n// Asset Item Component\n// ============================================================================\n\ninterface AssetItemProps {\n\tasset: Asset;\n\tselected: boolean;\n\tselectionMode: \"single\" | \"multiple\" | \"none\";\n\tonToggle: () => void;\n\tonClick?: () => void;\n}\n\nfunction AssetItem({\n\tasset,\n\tselected,\n\tselectionMode,\n\tonToggle,\n\tonClick,\n}: AssetItemProps) {\n\tconst [imageError, setImageError] = React.useState(false);\n\tconst thumbnailUrl = asset.url;\n\tconst isImageType = isImage(asset.mimeType);\n\tconst showCheckbox = selectionMode !== \"none\";\n\n\tconst handleClick = () => {\n\t\tif (selectionMode !== \"none\") {\n\t\t\tonToggle();\n\t\t}\n\t\tonClick?.();\n\t};\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={handleClick}\n\t\t\tclassName={cn(\n\t\t\t\t\"group relative aspect-square w-full overflow-hidden rounded-lg border\",\n\t\t\t\t\"transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n\t\t\t\tselected\n\t\t\t\t\t? \"ring-primary border-primary ring-2\"\n\t\t\t\t\t: \"border-border/60 hover:border-border\",\n\t\t\t\t\"bg-muted/30\",\n\t\t\t)}\n\t\t>\n\t\t\t{/* Thumbnail or icon */}\n\t\t\t{thumbnailUrl && isImageType && !imageError ? (\n\t\t\t\t<img\n\t\t\t\t\tsrc={thumbnailUrl}\n\t\t\t\t\talt={asset.alt || asset.filename || \"Asset\"}\n\t\t\t\t\tclassName=\"h-full w-full object-cover\"\n\t\t\t\t\tonError={() => setImageError(true)}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"flex h-full w-full items-center justify-center\",\n\t\t\t\t\t\tgetAssetTypeColor(asset.mimeType),\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"text-muted-foreground text-xs font-medium uppercase\">\n\t\t\t\t\t\t{asset.mimeType?.split(\"/\")[1]?.slice(0, 4) || \"FILE\"}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{/* Selection checkbox */}\n\t\t\t{showCheckbox && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"absolute right-2 top-2 flex size-5 items-center justify-center rounded-full border-2 transition-all\",\n\t\t\t\t\t\tselected\n\t\t\t\t\t\t\t? \"bg-primary border-primary\"\n\t\t\t\t\t\t\t: \"border-white bg-black/20 backdrop-blur-sm group-hover:bg-black/40\",\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{selected && (\n\t\t\t\t\t\t<Icon icon=\"ph:check-bold\" className=\"size-3 text-white\" />\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{/* Filename overlay (on hover) */}\n\t\t\t{asset.filename && (\n\t\t\t\t<div className=\"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/60 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100\">\n\t\t\t\t\t<p className=\"truncate text-xs text-white\" title={asset.filename}>\n\t\t\t\t\t\t{asset.filename}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</button>\n\t);\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\nexport function MediaGrid({\n\tassets,\n\tselectedIds = new Set(),\n\tonSelectionChange,\n\tselectionMode = \"none\",\n\tloading = false,\n\tonAssetClick,\n\tcolumns = 4,\n\tclassName,\n}: MediaGridProps) {\n\t// Handle toggle selection\n\tconst handleToggle = (assetId: string) => {\n\t\tif (!onSelectionChange) return;\n\n\t\tconst newSelection = new Set(selectedIds);\n\n\t\tif (selectionMode === \"single\") {\n\t\t\t// Single mode: clear all and select only this one\n\t\t\tnewSelection.clear();\n\t\t\tnewSelection.add(assetId);\n\t\t} else {\n\t\t\t// Multiple mode: toggle this one\n\t\t\tif (newSelection.has(assetId)) {\n\t\t\t\tnewSelection.delete(assetId);\n\t\t\t} else {\n\t\t\t\tnewSelection.add(assetId);\n\t\t\t}\n\t\t}\n\n\t\tonSelectionChange(newSelection);\n\t};\n\n\t// Show loading skeleton\n\tif (loading) {\n\t\treturn (\n\t\t\t<div className={className}>\n\t\t\t\t<MediaGridSkeleton columns={columns} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Empty state\n\tif (assets.length === 0) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"flex flex-col items-center justify-center rounded-lg border border-dashed p-12\",\n\t\t\t\t\t\"bg-muted/30 text-muted-foreground\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<p className=\"text-sm\">No assets found</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Grid columns class\n\tconst gridClass =\n\t\tcolumns === 2\n\t\t\t? \"grid-cols-2\"\n\t\t\t: columns === 3\n\t\t\t\t? \"grid-cols-2 sm:grid-cols-3\"\n\t\t\t\t: columns === 5\n\t\t\t\t\t? \"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5\"\n\t\t\t\t\t: \"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4\";\n\n\treturn (\n\t\t<div className={cn(\"grid gap-3\", gridClass, className)}>\n\t\t\t{assets.map((asset) => (\n\t\t\t\t<AssetItem\n\t\t\t\t\tkey={asset.id}\n\t\t\t\t\tasset={asset}\n\t\t\t\t\tselected={selectedIds.has(asset.id)}\n\t\t\t\t\tselectionMode={selectionMode}\n\t\t\t\t\tonToggle={() => handleToggle(asset.id)}\n\t\t\t\t\tonClick={onAssetClick ? () => onAssetClick(asset) : undefined}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,SAAS,kBAAkB,UAA2B;AACrD,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;AAEvC,QAAO;;;;;AAMR,SAAS,QAAQ,UAA4B;AAC5C,QAAO,CAAC,CAAC,UAAU,aAAa,CAAC,WAAW,SAAS;;AAOtD,SAAS,kBAAkB,EAAE,UAAU,KAAkC;CACxE,MAAM,QAAQ,UAAU;CACxB,MAAM,eAAeA,QAAM,cACpB,MAAM,KAAK,EAAE,QAAQ,OAAO,QAAQ,OAAO,YAAY,CAAC,EAC9D,CAAC,MAAM,CACP;AAUD,QACC,oBAAC;EAAI,WAAW,GAAG,cATnB,YAAY,IACT,gBACA,YAAY,IACX,+BACA,YAAY,IACX,6DACA,4CAGsC;YACzC,aAAa,KAAK,QAClB,qBAAC;GAAc,WAAU;cACxB,oBAAC,YAAS,WAAU,oCAAoC,EACxD,oBAAC,YAAS,WAAU,cAAc;KAFzB,IAGJ,CACL;GACG;;AAgBR,SAAS,UAAU,EAClB,OACA,UACA,eACA,UACA,WACkB;CAClB,MAAM,CAAC,YAAY,iBAAiBA,QAAM,SAAS,MAAM;CACzD,MAAM,eAAe,MAAM;CAC3B,MAAM,cAAc,QAAQ,MAAM,SAAS;CAC3C,MAAM,eAAe,kBAAkB;CAEvC,MAAM,oBAAoB;AACzB,MAAI,kBAAkB,OACrB,WAAU;AAEX,aAAW;;AAGZ,QACC,qBAAC;EACA,MAAK;EACL,SAAS;EACT,WAAW,GACV,yEACA,0FACA,WACG,uCACA,wCACH,cACA;;GAGA,gBAAgB,eAAe,CAAC,aAChC,oBAAC;IACA,KAAK;IACL,KAAK,MAAM,OAAO,MAAM,YAAY;IACpC,WAAU;IACV,eAAe,cAAc,KAAK;KACjC,GAEF,oBAAC;IACA,WAAW,GACV,kDACA,kBAAkB,MAAM,SAAS,CACjC;cAED,oBAAC;KAAK,WAAU;eACd,MAAM,UAAU,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,EAAE,IAAI;MACzC;KACF;GAIN,gBACA,oBAAC;IACA,WAAW,GACV,uGACA,WACG,8BACA,oEACH;cAEA,YACA,oBAAC;KAAK,MAAK;KAAgB,WAAU;MAAsB;KAEvD;GAIN,MAAM,YACN,oBAAC;IAAI,WAAU;cACd,oBAAC;KAAE,WAAU;KAA8B,OAAO,MAAM;eACtD,MAAM;MACJ;KACC;;GAEC;;AAQX,SAAgB,UAAU,EACzB,QACA,8BAAc,IAAI,KAAK,EACvB,mBACA,gBAAgB,QAChB,UAAU,OACV,cACA,UAAU,GACV,aACkB;CAElB,MAAM,gBAAgB,YAAoB;AACzC,MAAI,CAAC,kBAAmB;EAExB,MAAM,eAAe,IAAI,IAAI,YAAY;AAEzC,MAAI,kBAAkB,UAAU;AAE/B,gBAAa,OAAO;AACpB,gBAAa,IAAI,QAAQ;aAGrB,aAAa,IAAI,QAAQ,CAC5B,cAAa,OAAO,QAAQ;MAE5B,cAAa,IAAI,QAAQ;AAI3B,oBAAkB,aAAa;;AAIhC,KAAI,QACH,QACC,oBAAC;EAAe;YACf,oBAAC,qBAA2B,UAAW;GAClC;AAKR,KAAI,OAAO,WAAW,EACrB,QACC,oBAAC;EACA,WAAW,GACV,kFACA,qCACA,UACA;YAED,oBAAC;GAAE,WAAU;aAAU;IAAmB;GACrC;AAcR,QACC,oBAAC;EAAI,WAAW,GAAG,cATnB,YAAY,IACT,gBACA,YAAY,IACX,+BACA,YAAY,IACX,6DACA,6CAGuC,UAAU;YACpD,OAAO,KAAK,UACZ,oBAAC;GAEO;GACP,UAAU,YAAY,IAAI,MAAM,GAAG;GACpB;GACf,gBAAgB,aAAa,MAAM,GAAG;GACtC,SAAS,qBAAqB,aAAa,MAAM,GAAG;KAL/C,MAAM,GAMV,CACD;GACG"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { Button } from "../ui/button.mjs";
|
|
2
|
+
import { useCollectionList } from "../../hooks/use-collection.mjs";
|
|
3
|
+
import { useUploadCollection } from "../../hooks/use-upload-collection.mjs";
|
|
4
|
+
import { Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle } from "../ui/sheet.mjs";
|
|
5
|
+
import { Input } from "../ui/input.mjs";
|
|
6
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select.mjs";
|
|
7
|
+
import { AssetPreview } from "../primitives/asset-preview.mjs";
|
|
8
|
+
import { MediaGrid } from "./media-grid.mjs";
|
|
9
|
+
import { Icon } from "@iconify/react";
|
|
10
|
+
import * as React$1 from "react";
|
|
11
|
+
import { toast } from "sonner";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
//#region src/client/components/media/media-picker-dialog.tsx
|
|
15
|
+
/**
|
|
16
|
+
* MediaPickerDialog Component
|
|
17
|
+
*
|
|
18
|
+
* Dialog for searching and selecting existing assets from the media library.
|
|
19
|
+
* Used in UploadField and UploadManyField to allow browsing existing files.
|
|
20
|
+
*
|
|
21
|
+
* Features:
|
|
22
|
+
* - Search by filename
|
|
23
|
+
* - MIME type filtering
|
|
24
|
+
* - Responsive grid display
|
|
25
|
+
* - Single/multiple selection modes
|
|
26
|
+
* - Pagination support
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <MediaPickerDialog
|
|
31
|
+
* open={isOpen}
|
|
32
|
+
* onOpenChange={setIsOpen}
|
|
33
|
+
* mode="single"
|
|
34
|
+
* onSelect={(id) => field.onChange(id)}
|
|
35
|
+
* />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
const MIME_TYPE_FILTERS = [
|
|
39
|
+
{
|
|
40
|
+
value: "all",
|
|
41
|
+
label: "All Files",
|
|
42
|
+
mimePattern: void 0
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
value: "images",
|
|
46
|
+
label: "Images",
|
|
47
|
+
mimePattern: "image/"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "videos",
|
|
51
|
+
label: "Videos",
|
|
52
|
+
mimePattern: "video/"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: "audio",
|
|
56
|
+
label: "Audio",
|
|
57
|
+
mimePattern: "audio/"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
value: "documents",
|
|
61
|
+
label: "Documents",
|
|
62
|
+
mimePattern: "application/pdf"
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
function MediaPickerDialog({ open, onOpenChange, mode = "single", accept, onSelect, maxItems, collection }) {
|
|
66
|
+
const { collection: resolvedCollection, collections: availableUploadCollections } = useUploadCollection(collection);
|
|
67
|
+
const [selectedIds, setSelectedIds] = React$1.useState(/* @__PURE__ */ new Set());
|
|
68
|
+
const [searchQuery, setSearchQuery] = React$1.useState("");
|
|
69
|
+
const [mimeFilter, setMimeFilter] = React$1.useState("all");
|
|
70
|
+
const [previewAssetId, setPreviewAssetId] = React$1.useState(null);
|
|
71
|
+
const where = React$1.useMemo(() => {
|
|
72
|
+
const andConditions = [];
|
|
73
|
+
const selectedFilter = MIME_TYPE_FILTERS.find((f) => f.value === mimeFilter);
|
|
74
|
+
if (selectedFilter?.mimePattern) andConditions.push({ mimeType: { startsWith: selectedFilter.mimePattern } });
|
|
75
|
+
if (accept && accept.length > 0) {
|
|
76
|
+
const acceptPatterns = accept.map((pattern) => {
|
|
77
|
+
if (pattern.startsWith(".")) return { filename: { endsWith: pattern } };
|
|
78
|
+
if (pattern.endsWith("/*")) return { mimeType: { startsWith: pattern.slice(0, -1) } };
|
|
79
|
+
return { mimeType: pattern };
|
|
80
|
+
});
|
|
81
|
+
if (acceptPatterns.length === 1) andConditions.push(acceptPatterns[0]);
|
|
82
|
+
else andConditions.push({ OR: acceptPatterns });
|
|
83
|
+
}
|
|
84
|
+
if (andConditions.length === 0) return void 0;
|
|
85
|
+
if (andConditions.length === 1) return andConditions[0];
|
|
86
|
+
return { AND: andConditions };
|
|
87
|
+
}, [mimeFilter, accept]);
|
|
88
|
+
const trimmedSearch = searchQuery.trim();
|
|
89
|
+
const { data, isLoading } = useCollectionList(resolvedCollection || "", {
|
|
90
|
+
where,
|
|
91
|
+
search: trimmedSearch || void 0,
|
|
92
|
+
limit: 50,
|
|
93
|
+
orderBy: { createdAt: "desc" }
|
|
94
|
+
}, { enabled: open && !!resolvedCollection });
|
|
95
|
+
const assets = React$1.useMemo(() => data?.docs || [], [data?.docs]);
|
|
96
|
+
const previewAsset = React$1.useMemo(() => assets.find((asset) => asset.id === previewAssetId) ?? null, [assets, previewAssetId]);
|
|
97
|
+
React$1.useEffect(() => {
|
|
98
|
+
if (!open) {
|
|
99
|
+
setSelectedIds(/* @__PURE__ */ new Set());
|
|
100
|
+
setSearchQuery("");
|
|
101
|
+
setMimeFilter("all");
|
|
102
|
+
setPreviewAssetId(null);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
}, [open]);
|
|
106
|
+
React$1.useEffect(() => {
|
|
107
|
+
if (!open || assets.length === 0) return;
|
|
108
|
+
if (!previewAssetId) {
|
|
109
|
+
setPreviewAssetId(assets[0].id);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!assets.some((asset) => asset.id === previewAssetId)) setPreviewAssetId(assets[0].id);
|
|
113
|
+
}, [
|
|
114
|
+
open,
|
|
115
|
+
assets,
|
|
116
|
+
previewAssetId
|
|
117
|
+
]);
|
|
118
|
+
const handleSelectionChange = (ids) => {
|
|
119
|
+
if (mode === "multiple" && maxItems && ids.size > maxItems) {
|
|
120
|
+
toast.warning(`Maximum ${maxItems} items allowed`);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
setSelectedIds(ids);
|
|
124
|
+
};
|
|
125
|
+
const handleSelect = () => {
|
|
126
|
+
if (!resolvedCollection) {
|
|
127
|
+
toast.error(availableUploadCollections.length > 1 ? `Multiple upload collections are available (${availableUploadCollections.join(", ")}). Specify the collection for MediaPickerDialog.` : "No upload collection is configured for media library.");
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (selectedIds.size === 0) {
|
|
131
|
+
toast.error("Please select at least one asset");
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (mode === "single") {
|
|
135
|
+
const [id] = Array.from(selectedIds);
|
|
136
|
+
onSelect(id);
|
|
137
|
+
} else onSelect(Array.from(selectedIds));
|
|
138
|
+
onOpenChange(false);
|
|
139
|
+
};
|
|
140
|
+
const handleCancel = () => {
|
|
141
|
+
onOpenChange(false);
|
|
142
|
+
};
|
|
143
|
+
return /* @__PURE__ */ jsx(Sheet, {
|
|
144
|
+
open,
|
|
145
|
+
onOpenChange,
|
|
146
|
+
children: /* @__PURE__ */ jsxs(SheetContent, {
|
|
147
|
+
side: "right",
|
|
148
|
+
className: "data-[side=right]:sm:max-w-6xl w-full p-0",
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsxs(SheetHeader, {
|
|
151
|
+
className: "px-6 pt-6",
|
|
152
|
+
children: [/* @__PURE__ */ jsx(SheetTitle, { children: "Browse Media Library" }), /* @__PURE__ */ jsx(SheetDescription, { children: mode === "single" ? "Select an asset from your library" : `Select up to ${maxItems || "multiple"} assets` })]
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ jsxs("div", {
|
|
155
|
+
className: "flex flex-1 flex-col gap-4 overflow-hidden px-6 pb-6",
|
|
156
|
+
children: [
|
|
157
|
+
!resolvedCollection && /* @__PURE__ */ jsx("div", {
|
|
158
|
+
className: "rounded-lg border border-warning/40 bg-warning/5 p-3 text-sm text-warning",
|
|
159
|
+
children: availableUploadCollections.length > 1 ? `Multiple upload collections are available (${availableUploadCollections.join(", ")}). Pass the collection prop to choose one.` : "No upload collection is configured for media library."
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsxs("div", {
|
|
162
|
+
className: "flex flex-col gap-3 border-b pb-4 sm:flex-row",
|
|
163
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
164
|
+
className: "relative flex-1",
|
|
165
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
166
|
+
icon: "ph:magnifying-glass-bold",
|
|
167
|
+
className: "text-muted-foreground absolute left-3 top-1/2 size-4 -translate-y-1/2"
|
|
168
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
169
|
+
type: "text",
|
|
170
|
+
placeholder: "Search by filename...",
|
|
171
|
+
value: searchQuery,
|
|
172
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
173
|
+
className: "pl-9"
|
|
174
|
+
})]
|
|
175
|
+
}), !accept && /* @__PURE__ */ jsxs(Select, {
|
|
176
|
+
value: mimeFilter,
|
|
177
|
+
onValueChange: (value) => setMimeFilter(value || "all"),
|
|
178
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
179
|
+
className: "w-full sm:w-[180px]",
|
|
180
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
181
|
+
className: "flex items-center gap-2",
|
|
182
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
183
|
+
icon: "ph:funnel-simple-bold",
|
|
184
|
+
className: "size-4"
|
|
185
|
+
}), /* @__PURE__ */ jsx(SelectValue, {})]
|
|
186
|
+
})
|
|
187
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: MIME_TYPE_FILTERS.map((filter) => /* @__PURE__ */ jsx(SelectItem, {
|
|
188
|
+
value: filter.value,
|
|
189
|
+
children: filter.label
|
|
190
|
+
}, filter.value)) })]
|
|
191
|
+
})]
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ jsxs("div", {
|
|
194
|
+
className: "flex flex-1 gap-4 overflow-hidden",
|
|
195
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
196
|
+
className: "flex-1 overflow-y-auto pr-1",
|
|
197
|
+
children: /* @__PURE__ */ jsx(MediaGrid, {
|
|
198
|
+
assets,
|
|
199
|
+
selectedIds,
|
|
200
|
+
onSelectionChange: handleSelectionChange,
|
|
201
|
+
selectionMode: mode,
|
|
202
|
+
loading: isLoading,
|
|
203
|
+
columns: 5,
|
|
204
|
+
className: "gap-2",
|
|
205
|
+
onAssetClick: (asset) => setPreviewAssetId(asset.id)
|
|
206
|
+
})
|
|
207
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
208
|
+
className: "hidden lg:flex w-80 xl:w-96 shrink-0 flex-col gap-3 border-l pl-4",
|
|
209
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
210
|
+
className: "text-muted-foreground text-xs uppercase tracking-wide",
|
|
211
|
+
children: "Preview"
|
|
212
|
+
}), previewAsset ? /* @__PURE__ */ jsx(AssetPreview, {
|
|
213
|
+
asset: previewAsset,
|
|
214
|
+
variant: "card"
|
|
215
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
216
|
+
className: "flex items-center justify-center rounded-lg border border-dashed p-6 text-xs text-muted-foreground",
|
|
217
|
+
children: "Select an asset to preview"
|
|
218
|
+
})]
|
|
219
|
+
})]
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ jsx("div", {
|
|
222
|
+
className: "lg:hidden border-t pt-4",
|
|
223
|
+
children: previewAsset ? /* @__PURE__ */ jsx(AssetPreview, {
|
|
224
|
+
asset: previewAsset,
|
|
225
|
+
variant: "compact"
|
|
226
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
227
|
+
className: "flex items-center justify-center rounded-lg border border-dashed p-4 text-xs text-muted-foreground",
|
|
228
|
+
children: "Select an asset to preview"
|
|
229
|
+
})
|
|
230
|
+
})
|
|
231
|
+
]
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ jsx(SheetFooter, {
|
|
234
|
+
className: "border-t px-6 py-4",
|
|
235
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
236
|
+
className: "flex w-full justify-end gap-2",
|
|
237
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
238
|
+
variant: "outline",
|
|
239
|
+
onClick: handleCancel,
|
|
240
|
+
children: "Cancel"
|
|
241
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
242
|
+
onClick: handleSelect,
|
|
243
|
+
disabled: selectedIds.size === 0 || isLoading,
|
|
244
|
+
children: ["Select ", selectedIds.size > 0 && `(${selectedIds.size})`]
|
|
245
|
+
})]
|
|
246
|
+
})
|
|
247
|
+
})
|
|
248
|
+
]
|
|
249
|
+
})
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
//#endregion
|
|
254
|
+
export { MediaPickerDialog };
|
|
255
|
+
//# sourceMappingURL=media-picker-dialog.mjs.map
|