@questpie/admin 1.1.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +245 -474
- package/dist/_virtual/rolldown_runtime.mjs +18 -0
- package/dist/augmentation.d.mts +315 -0
- package/dist/augmentation.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.d.mts +199 -0
- package/dist/client/blocks/block-registry.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.mjs +88 -0
- package/dist/client/blocks/block-registry.mjs.map +1 -0
- package/dist/client/blocks/block-renderer.d.mts +52 -0
- package/dist/client/blocks/block-renderer.d.mts.map +1 -0
- package/dist/client/blocks/block-renderer.mjs +71 -0
- package/dist/client/blocks/block-renderer.mjs.map +1 -0
- package/dist/client/blocks/index.d.mts +4 -0
- package/dist/client/blocks/prefetch.d.mts +45 -0
- package/dist/client/blocks/prefetch.d.mts.map +1 -0
- package/dist/client/blocks/prefetch.mjs +26 -0
- package/dist/client/blocks/prefetch.mjs.map +1 -0
- package/dist/client/blocks/types.d.mts +69 -0
- package/dist/client/blocks/types.d.mts.map +1 -0
- package/dist/client/blocks/types.mjs +20 -0
- package/dist/client/blocks/types.mjs.map +1 -0
- package/dist/client/builder/admin-builder.d.mts +112 -0
- package/dist/client/builder/admin-builder.d.mts.map +1 -0
- package/dist/client/builder/admin-builder.mjs +185 -0
- package/dist/client/builder/admin-builder.mjs.map +1 -0
- package/dist/client/builder/admin-types.d.mts +73 -0
- package/dist/client/builder/admin-types.d.mts.map +1 -0
- package/dist/client/builder/admin.d.mts +121 -0
- package/dist/client/builder/admin.d.mts.map +1 -0
- package/dist/client/builder/admin.mjs +160 -0
- package/dist/client/builder/admin.mjs.map +1 -0
- package/dist/client/builder/defaults/components.mjs +20 -0
- package/dist/client/builder/defaults/components.mjs.map +1 -0
- package/dist/client/builder/defaults/core.d.mts +354 -0
- package/dist/client/builder/defaults/core.d.mts.map +1 -0
- package/dist/client/builder/defaults/core.mjs +49 -0
- package/dist/client/builder/defaults/core.mjs.map +1 -0
- package/dist/client/builder/defaults/fields.mjs +328 -0
- package/dist/client/builder/defaults/fields.mjs.map +1 -0
- package/dist/client/builder/defaults/pages.mjs +58 -0
- package/dist/client/builder/defaults/pages.mjs.map +1 -0
- package/dist/client/builder/defaults/starter.d.mts +351 -0
- package/dist/client/builder/defaults/starter.d.mts.map +1 -0
- package/dist/client/builder/defaults/starter.mjs +28 -0
- package/dist/client/builder/defaults/starter.mjs.map +1 -0
- package/dist/client/builder/defaults/views.mjs +27 -0
- package/dist/client/builder/defaults/views.mjs.map +1 -0
- package/dist/client/builder/defaults/widgets.mjs +31 -0
- package/dist/client/builder/defaults/widgets.mjs.map +1 -0
- package/dist/client/builder/field/field.d.mts +229 -0
- package/dist/client/builder/field/field.d.mts.map +1 -0
- package/dist/client/builder/field/field.mjs +83 -0
- package/dist/client/builder/field/field.mjs.map +1 -0
- package/dist/client/builder/index.d.mts +36 -0
- package/dist/client/builder/index.d.mts.map +1 -0
- package/dist/client/builder/page/page.d.mts +36 -0
- package/dist/client/builder/page/page.d.mts.map +1 -0
- package/dist/client/builder/page/page.mjs +27 -0
- package/dist/client/builder/page/page.mjs.map +1 -0
- package/dist/client/builder/proxies.d.mts +2 -0
- package/dist/client/builder/proxies.mjs +24 -0
- package/dist/client/builder/proxies.mjs.map +1 -0
- package/dist/client/builder/qa.d.mts +50 -0
- package/dist/client/builder/qa.d.mts.map +1 -0
- package/dist/client/builder/qa.mjs +42 -0
- package/dist/client/builder/qa.mjs.map +1 -0
- package/dist/client/builder/registry.d.mts +70 -0
- package/dist/client/builder/registry.d.mts.map +1 -0
- package/dist/client/builder/types/action-registry.d.mts +2 -0
- package/dist/client/builder/types/action-registry.mjs +142 -0
- package/dist/client/builder/types/action-registry.mjs.map +1 -0
- package/dist/client/builder/types/action-types.d.mts +253 -0
- package/dist/client/builder/types/action-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.d.mts +199 -0
- package/dist/client/builder/types/collection-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.mjs +11 -0
- package/dist/client/builder/types/collection-types.mjs.map +1 -0
- package/dist/client/builder/types/common.d.mts +60 -0
- package/dist/client/builder/types/common.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.d.mts +593 -0
- package/dist/client/builder/types/field-types.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.mjs +19 -0
- package/dist/client/builder/types/field-types.mjs.map +1 -0
- package/dist/client/builder/types/global-types.d.mts +22 -0
- package/dist/client/builder/types/global-types.d.mts.map +1 -0
- package/dist/client/builder/types/ui-config.d.mts +160 -0
- package/dist/client/builder/types/ui-config.d.mts.map +1 -0
- package/dist/client/builder/types/views.d.mts +89 -0
- package/dist/client/builder/types/views.d.mts.map +1 -0
- package/dist/client/builder/types/widget-types.d.mts +563 -0
- package/dist/client/builder/types/widget-types.d.mts.map +1 -0
- package/dist/client/builder/validation.d.mts +3 -0
- package/dist/client/builder/validation.mjs +208 -0
- package/dist/client/builder/validation.mjs.map +1 -0
- package/dist/client/builder/view/view.d.mts +129 -0
- package/dist/client/builder/view/view.d.mts.map +1 -0
- package/dist/client/builder/view/view.mjs +109 -0
- package/dist/client/builder/view/view.mjs.map +1 -0
- package/dist/client/builder/widget/widget.d.mts +33 -0
- package/dist/client/builder/widget/widget.d.mts.map +1 -0
- package/dist/client/builder/widget/widget.mjs +26 -0
- package/dist/client/builder/widget/widget.mjs.map +1 -0
- package/dist/client/components/actions/action-button.d.mts +2 -0
- package/dist/client/components/actions/action-button.mjs +135 -0
- package/dist/client/components/actions/action-button.mjs.map +1 -0
- package/dist/client/components/actions/action-dialog.d.mts +2 -0
- package/dist/client/components/actions/action-dialog.mjs +264 -0
- package/dist/client/components/actions/action-dialog.mjs.map +1 -0
- package/dist/client/components/actions/confirmation-dialog.d.mts +2 -0
- package/dist/client/components/actions/confirmation-dialog.mjs +82 -0
- package/dist/client/components/actions/confirmation-dialog.mjs.map +1 -0
- package/dist/client/components/actions/header-actions.d.mts +2 -0
- package/dist/client/components/actions/header-actions.mjs +117 -0
- package/dist/client/components/actions/header-actions.mjs.map +1 -0
- package/dist/client/components/actions/index.d.mts +4 -0
- package/dist/client/components/admin-link.d.mts +67 -0
- package/dist/client/components/admin-link.d.mts.map +1 -0
- package/dist/client/components/admin-link.mjs +92 -0
- package/dist/client/components/admin-link.mjs.map +1 -0
- package/dist/client/components/auth/auth-guard.d.mts +51 -0
- package/dist/client/components/auth/auth-guard.d.mts.map +1 -0
- package/dist/client/components/auth/auth-guard.mjs +60 -0
- package/dist/client/components/auth/auth-guard.mjs.map +1 -0
- package/dist/client/components/auth/auth-loading.d.mts +36 -0
- package/dist/client/components/auth/auth-loading.d.mts.map +1 -0
- package/dist/client/components/auth/auth-loading.mjs +27 -0
- package/dist/client/components/auth/auth-loading.mjs.map +1 -0
- package/dist/client/components/auth/index.d.mts +2 -0
- package/dist/client/components/blocks/block-canvas.mjs +90 -0
- package/dist/client/components/blocks/block-canvas.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-context.mjs +58 -0
- package/dist/client/components/blocks/block-editor-context.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-layout.mjs +82 -0
- package/dist/client/components/blocks/block-editor-layout.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-provider.mjs +155 -0
- package/dist/client/components/blocks/block-editor-provider.mjs.map +1 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs +70 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs.map +1 -0
- package/dist/client/components/blocks/block-insert-button.mjs +72 -0
- package/dist/client/components/blocks/block-insert-button.mjs.map +1 -0
- package/dist/client/components/blocks/block-item-menu.mjs +161 -0
- package/dist/client/components/blocks/block-item-menu.mjs.map +1 -0
- package/dist/client/components/blocks/block-item.mjs +187 -0
- package/dist/client/components/blocks/block-item.mjs.map +1 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs +190 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs.map +1 -0
- package/dist/client/components/blocks/block-tree.mjs +45 -0
- package/dist/client/components/blocks/block-tree.mjs.map +1 -0
- package/dist/client/components/blocks/block-type-icon.mjs +50 -0
- package/dist/client/components/blocks/block-type-icon.mjs.map +1 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs +186 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs.map +1 -0
- package/dist/client/components/component-renderer.d.mts +125 -0
- package/dist/client/components/component-renderer.d.mts.map +1 -0
- package/dist/client/components/component-renderer.mjs +145 -0
- package/dist/client/components/component-renderer.mjs.map +1 -0
- package/dist/client/components/error-boundary.mjs +92 -0
- package/dist/client/components/error-boundary.mjs.map +1 -0
- package/dist/client/components/fields/array-field.d.mts +44 -0
- package/dist/client/components/fields/array-field.d.mts.map +1 -0
- package/dist/client/components/fields/array-field.mjs +231 -0
- package/dist/client/components/fields/array-field.mjs.map +1 -0
- package/dist/client/components/fields/asset-preview-field.d.mts +52 -0
- package/dist/client/components/fields/asset-preview-field.d.mts.map +1 -0
- package/dist/client/components/fields/asset-preview-field.mjs +60 -0
- package/dist/client/components/fields/asset-preview-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts +41 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +101 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/index.d.mts +1 -0
- package/dist/client/components/fields/boolean-field.d.mts +30 -0
- package/dist/client/components/fields/boolean-field.d.mts.map +1 -0
- package/dist/client/components/fields/boolean-field.mjs +47 -0
- package/dist/client/components/fields/boolean-field.mjs.map +1 -0
- package/dist/client/components/fields/custom-field.d.mts +3 -0
- package/dist/client/components/fields/date-field.d.mts +22 -0
- package/dist/client/components/fields/date-field.d.mts.map +1 -0
- package/dist/client/components/fields/date-field.mjs +42 -0
- package/dist/client/components/fields/date-field.mjs.map +1 -0
- package/dist/client/components/fields/datetime-field.d.mts +23 -0
- package/dist/client/components/fields/datetime-field.d.mts.map +1 -0
- package/dist/client/components/fields/datetime-field.mjs +43 -0
- package/dist/client/components/fields/datetime-field.mjs.map +1 -0
- package/dist/client/components/fields/email-field.d.mts +19 -0
- package/dist/client/components/fields/email-field.d.mts.map +1 -0
- package/dist/client/components/fields/email-field.mjs +38 -0
- package/dist/client/components/fields/email-field.mjs.map +1 -0
- package/dist/client/components/fields/embedded-collection.d.mts +3 -0
- package/dist/client/components/fields/field-types.d.mts +571 -0
- package/dist/client/components/fields/field-types.d.mts.map +1 -0
- package/dist/client/components/fields/field-utils.d.mts +1 -0
- package/dist/client/components/fields/field-utils.mjs +65 -0
- package/dist/client/components/fields/field-utils.mjs.map +1 -0
- package/dist/client/components/fields/field-wrapper.d.mts +3 -0
- package/dist/client/components/fields/field-wrapper.mjs +49 -0
- package/dist/client/components/fields/field-wrapper.mjs.map +1 -0
- package/dist/client/components/fields/index.d.mts +33 -0
- package/dist/client/components/fields/json-field.d.mts +84 -0
- package/dist/client/components/fields/json-field.d.mts.map +1 -0
- package/dist/client/components/fields/json-field.mjs +248 -0
- package/dist/client/components/fields/json-field.mjs.map +1 -0
- package/dist/client/components/fields/locale-badge.d.mts +1 -0
- package/dist/client/components/fields/locale-badge.mjs +17 -0
- package/dist/client/components/fields/locale-badge.mjs.map +1 -0
- package/dist/client/components/fields/number-field.d.mts +23 -0
- package/dist/client/components/fields/number-field.d.mts.map +1 -0
- package/dist/client/components/fields/number-field.mjs +40 -0
- package/dist/client/components/fields/number-field.mjs.map +1 -0
- package/dist/client/components/fields/object-array-field.d.mts +2 -0
- package/dist/client/components/fields/object-array-field.mjs +313 -0
- package/dist/client/components/fields/object-array-field.mjs.map +1 -0
- package/dist/client/components/fields/object-field.d.mts +32 -0
- package/dist/client/components/fields/object-field.d.mts.map +1 -0
- package/dist/client/components/fields/object-field.mjs +128 -0
- package/dist/client/components/fields/object-field.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/cards-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs +140 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/chips-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs +100 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/grid-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs +114 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/index.d.mts +6 -0
- package/dist/client/components/fields/relation/displays/list-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs +128 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/table-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs +134 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/types.d.mts +22 -0
- package/dist/client/components/fields/relation/displays/types.d.mts.map +1 -0
- package/dist/client/components/fields/relation/displays/types.mjs +73 -0
- package/dist/client/components/fields/relation/displays/types.mjs.map +1 -0
- package/dist/client/components/fields/relation/index.d.mts +3 -0
- package/dist/client/components/fields/relation/relation-items-display.d.mts +5 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs +47 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs.map +1 -0
- package/dist/client/components/fields/relation-field.d.mts +134 -0
- package/dist/client/components/fields/relation-field.d.mts.map +1 -0
- package/dist/client/components/fields/relation-field.mjs +106 -0
- package/dist/client/components/fields/relation-field.mjs.map +1 -0
- package/dist/client/components/fields/relation-picker.d.mts +4 -0
- package/dist/client/components/fields/relation-picker.mjs +301 -0
- package/dist/client/components/fields/relation-picker.mjs.map +1 -0
- package/dist/client/components/fields/relation-select.d.mts +3 -0
- package/dist/client/components/fields/relation-select.mjs +219 -0
- package/dist/client/components/fields/relation-select.mjs.map +1 -0
- package/dist/client/components/fields/reverse-relation-field.d.mts +2 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +56 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +118 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +196 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +4 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +187 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +86 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +11 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +145 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +280 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts +78 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs +31 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs +51 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/variants.d.mts +2 -0
- package/dist/client/components/fields/rich-text-field.d.mts +14 -0
- package/dist/client/components/fields/rich-text-field.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-field.mjs +26 -0
- package/dist/client/components/fields/rich-text-field.mjs.map +1 -0
- package/dist/client/components/fields/select-field.d.mts +25 -0
- package/dist/client/components/fields/select-field.d.mts.map +1 -0
- package/dist/client/components/fields/select-field.mjs +53 -0
- package/dist/client/components/fields/select-field.mjs.map +1 -0
- package/dist/client/components/fields/status-field.d.mts +2 -0
- package/dist/client/components/fields/text-field.d.mts +22 -0
- package/dist/client/components/fields/text-field.d.mts.map +1 -0
- package/dist/client/components/fields/text-field.mjs +39 -0
- package/dist/client/components/fields/text-field.mjs.map +1 -0
- package/dist/client/components/fields/textarea-field.d.mts +22 -0
- package/dist/client/components/fields/textarea-field.d.mts.map +1 -0
- package/dist/client/components/fields/textarea-field.mjs +39 -0
- package/dist/client/components/fields/textarea-field.mjs.map +1 -0
- package/dist/client/components/fields/time-field.d.mts +20 -0
- package/dist/client/components/fields/time-field.d.mts.map +1 -0
- package/dist/client/components/fields/time-field.mjs +39 -0
- package/dist/client/components/fields/time-field.mjs.map +1 -0
- package/dist/client/components/fields/upload-field.d.mts +97 -0
- package/dist/client/components/fields/upload-field.d.mts.map +1 -0
- package/dist/client/components/fields/upload-field.mjs +497 -0
- package/dist/client/components/fields/upload-field.mjs.map +1 -0
- package/dist/client/components/filter-builder/columns-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/columns-tab.mjs +131 -0
- package/dist/client/components/filter-builder/columns-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.d.mts +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +157 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs.map +1 -0
- package/dist/client/components/filter-builder/filters-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/filters-tab.mjs +380 -0
- package/dist/client/components/filter-builder/filters-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/index.d.mts +5 -0
- package/dist/client/components/filter-builder/saved-views-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs +125 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs.map +1 -0
- package/dist/client/components/index.d.mts +80 -0
- package/dist/client/components/locale-switcher.d.mts +2 -0
- package/dist/client/components/locale-switcher.mjs +128 -0
- package/dist/client/components/locale-switcher.mjs.map +1 -0
- package/dist/client/components/media/media-grid.mjs +139 -0
- package/dist/client/components/media/media-grid.mjs.map +1 -0
- package/dist/client/components/media/media-picker-dialog.mjs +255 -0
- package/dist/client/components/media/media-picker-dialog.mjs.map +1 -0
- package/dist/client/components/preview/live-preview-mode.mjs +211 -0
- package/dist/client/components/preview/live-preview-mode.mjs.map +1 -0
- package/dist/client/components/preview/preview-pane.mjs +179 -0
- package/dist/client/components/preview/preview-pane.mjs.map +1 -0
- package/dist/client/components/primitives/asset-preview.mjs +363 -0
- package/dist/client/components/primitives/asset-preview.mjs.map +1 -0
- package/dist/client/components/primitives/checkbox-input.mjs +33 -0
- package/dist/client/components/primitives/checkbox-input.mjs.map +1 -0
- package/dist/client/components/primitives/date-input.mjs +218 -0
- package/dist/client/components/primitives/date-input.mjs.map +1 -0
- package/dist/client/components/primitives/dropzone.mjs +239 -0
- package/dist/client/components/primitives/dropzone.mjs.map +1 -0
- package/dist/client/components/primitives/number-input.mjs +113 -0
- package/dist/client/components/primitives/number-input.mjs.map +1 -0
- package/dist/client/components/primitives/select-multi.mjs +256 -0
- package/dist/client/components/primitives/select-multi.mjs.map +1 -0
- package/dist/client/components/primitives/select-single.mjs +183 -0
- package/dist/client/components/primitives/select-single.mjs.map +1 -0
- package/dist/client/components/primitives/text-input.mjs +40 -0
- package/dist/client/components/primitives/text-input.mjs.map +1 -0
- package/dist/client/components/primitives/textarea-input.mjs +38 -0
- package/dist/client/components/primitives/textarea-input.mjs.map +1 -0
- package/dist/client/components/primitives/time-input.mjs +72 -0
- package/dist/client/components/primitives/time-input.mjs.map +1 -0
- package/dist/client/components/primitives/toggle-input.mjs +31 -0
- package/dist/client/components/primitives/toggle-input.mjs.map +1 -0
- package/dist/client/components/primitives/types.d.mts +14 -0
- package/dist/client/components/primitives/types.d.mts.map +1 -0
- package/dist/client/components/primitives/types.mjs +13 -0
- package/dist/client/components/primitives/types.mjs.map +1 -0
- package/dist/client/components/sheets/index.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.mjs +78 -0
- package/dist/client/components/sheets/resource-sheet.mjs.map +1 -0
- package/dist/client/components/ui/accordion.d.mts +2 -0
- package/dist/client/components/ui/accordion.mjs +50 -0
- package/dist/client/components/ui/accordion.mjs.map +1 -0
- package/dist/client/components/ui/alert.mjs +32 -0
- package/dist/client/components/ui/alert.mjs.map +1 -0
- package/dist/client/components/ui/avatar.d.mts +3 -0
- package/dist/client/components/ui/badge.d.mts +3 -0
- package/dist/client/components/ui/badge.mjs +35 -0
- package/dist/client/components/ui/badge.mjs.map +1 -0
- package/dist/client/components/ui/button.d.mts +3 -0
- package/dist/client/components/ui/button.mjs +49 -0
- package/dist/client/components/ui/button.mjs.map +1 -0
- package/dist/client/components/ui/card.d.mts +2 -0
- package/dist/{card-BKHjBQfw.mjs → client/components/ui/card.mjs} +3 -10
- package/dist/{card-BKHjBQfw.mjs.map → client/components/ui/card.mjs.map} +1 -1
- package/dist/client/components/ui/checkbox.d.mts +2 -0
- package/dist/client/components/ui/checkbox.mjs +27 -0
- package/dist/client/components/ui/checkbox.mjs.map +1 -0
- package/dist/client/components/ui/combobox.d.mts +3 -0
- package/dist/client/components/ui/command.mjs +69 -0
- package/dist/client/components/ui/command.mjs.map +1 -0
- package/dist/client/components/ui/dialog.d.mts +3 -0
- package/dist/client/components/ui/dialog.mjs +83 -0
- package/dist/client/components/ui/dialog.mjs.map +1 -0
- package/dist/client/components/ui/drawer.mjs +75 -0
- package/dist/client/components/ui/drawer.mjs.map +1 -0
- package/dist/client/components/ui/dropdown-menu.d.mts +3 -0
- package/dist/client/components/ui/dropdown-menu.mjs +89 -0
- package/dist/client/components/ui/dropdown-menu.mjs.map +1 -0
- package/dist/client/components/ui/empty-state.mjs +53 -0
- package/dist/client/components/ui/empty-state.mjs.map +1 -0
- package/dist/client/components/ui/field.d.mts +3 -0
- package/dist/client/components/ui/field.mjs +78 -0
- package/dist/client/components/ui/field.mjs.map +1 -0
- package/dist/client/components/ui/input-group.d.mts +4 -0
- package/dist/client/components/ui/input-group.mjs +68 -0
- package/dist/client/components/ui/input-group.mjs.map +1 -0
- package/dist/client/components/ui/input.d.mts +2 -0
- package/dist/client/components/ui/input.mjs +17 -0
- package/dist/client/components/ui/input.mjs.map +1 -0
- package/dist/client/components/ui/kbd.mjs +24 -0
- package/dist/client/components/ui/kbd.mjs.map +1 -0
- package/dist/client/components/ui/label.d.mts +2 -0
- package/dist/client/components/ui/label.mjs +15 -0
- package/dist/client/components/ui/label.mjs.map +1 -0
- package/dist/client/components/ui/popover.d.mts +3 -0
- package/dist/client/components/ui/popover.mjs +49 -0
- package/dist/client/components/ui/popover.mjs.map +1 -0
- package/dist/client/components/ui/responsive-dialog.mjs +102 -0
- package/dist/client/components/ui/responsive-dialog.mjs.map +1 -0
- package/dist/client/components/ui/scroll-area.d.mts +2 -0
- package/dist/client/components/ui/search-input.mjs +74 -0
- package/dist/client/components/ui/search-input.mjs.map +1 -0
- package/dist/client/components/ui/select.d.mts +3 -0
- package/dist/client/components/ui/select.mjs +85 -0
- package/dist/client/components/ui/select.mjs.map +1 -0
- package/dist/client/components/ui/separator.d.mts +2 -0
- package/dist/client/components/ui/separator.mjs +17 -0
- package/dist/client/components/ui/separator.mjs.map +1 -0
- package/dist/client/components/ui/sheet.d.mts +3 -0
- package/dist/client/components/ui/sheet.mjs +78 -0
- package/dist/client/components/ui/sheet.mjs.map +1 -0
- package/dist/client/components/ui/sidebar.d.mts +8 -0
- package/dist/client/components/ui/sidebar.mjs +256 -0
- package/dist/client/components/ui/sidebar.mjs.map +1 -0
- package/dist/client/components/ui/skeleton.d.mts +1 -0
- package/dist/client/components/ui/skeleton.mjs +15 -0
- package/dist/client/components/ui/skeleton.mjs.map +1 -0
- package/dist/client/components/ui/sonner.d.mts +14 -0
- package/dist/client/components/ui/sonner.d.mts.map +1 -0
- package/dist/client/components/ui/sonner.mjs +55 -0
- package/dist/client/components/ui/sonner.mjs.map +1 -0
- package/dist/client/components/ui/spinner.d.mts +1 -0
- package/dist/client/components/ui/spinner.mjs +18 -0
- package/dist/client/components/ui/spinner.mjs.map +1 -0
- package/dist/client/components/ui/switch.d.mts +2 -0
- package/dist/client/components/ui/switch.mjs +23 -0
- package/dist/client/components/ui/switch.mjs.map +1 -0
- package/dist/client/components/ui/table.d.mts +2 -0
- package/dist/client/components/ui/table.mjs +66 -0
- package/dist/client/components/ui/table.mjs.map +1 -0
- package/dist/client/components/ui/tabs.d.mts +3 -0
- package/dist/client/components/ui/tabs.mjs +49 -0
- package/dist/client/components/ui/tabs.mjs.map +1 -0
- package/dist/client/components/ui/textarea.d.mts +2 -0
- package/dist/client/components/ui/textarea.mjs +15 -0
- package/dist/client/components/ui/textarea.mjs.map +1 -0
- package/dist/client/components/ui/toolbar.mjs +54 -0
- package/dist/client/components/ui/toolbar.mjs.map +1 -0
- package/dist/client/components/ui/tooltip.d.mts +2 -0
- package/dist/client/components/ui/tooltip.mjs +45 -0
- package/dist/client/components/ui/tooltip.mjs.map +1 -0
- package/dist/client/components/widgets/chart-widget.d.mts +57 -0
- package/dist/client/components/widgets/chart-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/chart-widget.mjs +282 -0
- package/dist/client/components/widgets/chart-widget.mjs.map +1 -0
- package/dist/client/components/widgets/progress-widget.d.mts +41 -0
- package/dist/client/components/widgets/progress-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/progress-widget.mjs +110 -0
- package/dist/client/components/widgets/progress-widget.mjs.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts +29 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs +121 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts +51 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.mjs +101 -0
- package/dist/client/components/widgets/recent-items-widget.mjs.map +1 -0
- package/dist/client/components/widgets/stats-widget.d.mts +55 -0
- package/dist/client/components/widgets/stats-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/stats-widget.mjs +150 -0
- package/dist/client/components/widgets/stats-widget.mjs.map +1 -0
- package/dist/client/components/widgets/table-widget.d.mts +31 -0
- package/dist/client/components/widgets/table-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/table-widget.mjs +139 -0
- package/dist/client/components/widgets/table-widget.mjs.map +1 -0
- package/dist/client/components/widgets/timeline-widget.d.mts +51 -0
- package/dist/client/components/widgets/timeline-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/timeline-widget.mjs +168 -0
- package/dist/client/components/widgets/timeline-widget.mjs.map +1 -0
- package/dist/client/components/widgets/value-widget.d.mts +39 -0
- package/dist/client/components/widgets/value-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/value-widget.mjs +111 -0
- package/dist/client/components/widgets/value-widget.mjs.map +1 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +145 -0
- package/dist/client/components/widgets/widget-skeletons.mjs.map +1 -0
- package/dist/client/context/focus-context.d.mts +88 -0
- package/dist/client/context/focus-context.d.mts.map +1 -0
- package/dist/client/context/focus-context.mjs +178 -0
- package/dist/client/context/focus-context.mjs.map +1 -0
- package/dist/client/contexts/breadcrumb-context.mjs +32 -0
- package/dist/client/contexts/breadcrumb-context.mjs.map +1 -0
- package/dist/client/hooks/typed-hooks.d.mts +84 -0
- package/dist/client/hooks/typed-hooks.d.mts.map +1 -0
- package/dist/client/hooks/typed-hooks.mjs +272 -0
- package/dist/client/hooks/typed-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-action.mjs +201 -0
- package/dist/client/hooks/use-action.mjs.map +1 -0
- package/dist/client/hooks/use-admin-config.mjs +40 -0
- package/dist/client/hooks/use-admin-config.mjs.map +1 -0
- package/dist/client/hooks/use-admin-preferences.mjs +68 -0
- package/dist/client/hooks/use-admin-preferences.mjs.map +1 -0
- package/dist/client/hooks/use-admin-routes.mjs +97 -0
- package/dist/client/hooks/use-admin-routes.mjs.map +1 -0
- package/dist/client/hooks/use-auth.d.mts +98 -0
- package/dist/client/hooks/use-auth.d.mts.map +1 -0
- package/dist/{use-auth-BoLmWtmU.mjs → client/hooks/use-auth.mjs} +3 -3
- package/dist/client/hooks/use-auth.mjs.map +1 -0
- package/dist/client/hooks/use-collection-fields.mjs +32 -0
- package/dist/client/hooks/use-collection-fields.mjs.map +1 -0
- package/dist/client/hooks/use-collection-meta.mjs +121 -0
- package/dist/client/hooks/use-collection-meta.mjs.map +1 -0
- package/dist/client/hooks/use-collection-schema.mjs +67 -0
- package/dist/client/hooks/use-collection-schema.mjs.map +1 -0
- package/dist/client/hooks/use-collection-validation.mjs +74 -0
- package/dist/client/hooks/use-collection-validation.mjs.map +1 -0
- package/dist/client/hooks/use-collection.d.mts +86 -0
- package/dist/client/hooks/use-collection.d.mts.map +1 -0
- package/dist/client/hooks/use-collection.mjs +214 -0
- package/dist/client/hooks/use-collection.mjs.map +1 -0
- package/dist/client/hooks/use-current-user.d.mts +57 -0
- package/dist/client/hooks/use-current-user.d.mts.map +1 -0
- package/dist/client/hooks/use-current-user.mjs +79 -0
- package/dist/client/hooks/use-current-user.mjs.map +1 -0
- package/dist/client/hooks/use-field-hooks.mjs +191 -0
- package/dist/client/hooks/use-field-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-field-options.d.mts +90 -0
- package/dist/client/hooks/use-field-options.d.mts.map +1 -0
- package/dist/client/hooks/use-field-options.mjs +184 -0
- package/dist/client/hooks/use-field-options.mjs.map +1 -0
- package/dist/client/hooks/use-global-fields.mjs +27 -0
- package/dist/client/hooks/use-global-fields.mjs.map +1 -0
- package/dist/client/hooks/use-global-meta.mjs +59 -0
- package/dist/client/hooks/use-global-meta.mjs.map +1 -0
- package/dist/client/hooks/use-global-schema.mjs +33 -0
- package/dist/client/hooks/use-global-schema.mjs.map +1 -0
- package/dist/client/hooks/use-global.d.mts +40 -0
- package/dist/client/hooks/use-global.d.mts.map +1 -0
- package/dist/client/hooks/use-global.mjs +74 -0
- package/dist/client/hooks/use-global.mjs.map +1 -0
- package/dist/client/hooks/use-locks.mjs +245 -0
- package/dist/client/hooks/use-locks.mjs.map +1 -0
- package/dist/client/hooks/use-media-query.d.mts +23 -0
- package/dist/client/hooks/use-media-query.d.mts.map +1 -0
- package/dist/client/hooks/use-media-query.mjs +62 -0
- package/dist/client/hooks/use-media-query.mjs.map +1 -0
- package/dist/client/hooks/use-prefill-params.mjs +47 -0
- package/dist/client/hooks/use-prefill-params.mjs.map +1 -0
- package/dist/client/hooks/use-questpie-query-options.mjs +28 -0
- package/dist/client/hooks/use-questpie-query-options.mjs.map +1 -0
- package/dist/client/hooks/use-reactive-fields.d.mts +75 -0
- package/dist/client/hooks/use-reactive-fields.d.mts.map +1 -0
- package/dist/client/hooks/use-reactive-fields.mjs +164 -0
- package/dist/client/hooks/use-reactive-fields.mjs.map +1 -0
- package/dist/client/hooks/use-realtime-highlight.mjs +96 -0
- package/dist/client/hooks/use-realtime-highlight.mjs.map +1 -0
- package/dist/client/hooks/use-saved-views.mjs +65 -0
- package/dist/client/hooks/use-saved-views.mjs.map +1 -0
- package/dist/client/hooks/use-search.mjs +147 -0
- package/dist/client/hooks/use-search.mjs.map +1 -0
- package/dist/client/hooks/use-server-validation.mjs +199 -0
- package/dist/client/hooks/use-server-validation.mjs.map +1 -0
- package/dist/client/hooks/use-server-widget-data.d.mts +26 -0
- package/dist/client/hooks/use-server-widget-data.d.mts.map +1 -0
- package/dist/client/hooks/use-server-widget-data.mjs +40 -0
- package/dist/client/hooks/use-server-widget-data.mjs.map +1 -0
- package/dist/client/hooks/use-setup-status.d.mts +39 -0
- package/dist/client/hooks/use-setup-status.d.mts.map +1 -0
- package/dist/client/hooks/use-setup-status.mjs +50 -0
- package/dist/client/hooks/use-setup-status.mjs.map +1 -0
- package/dist/client/hooks/use-upload-collection.mjs +32 -0
- package/dist/client/hooks/use-upload-collection.mjs.map +1 -0
- package/dist/client/hooks/use-upload.d.mts +23 -0
- package/dist/client/hooks/use-upload.d.mts.map +1 -0
- package/dist/client/hooks/use-upload.mjs +145 -0
- package/dist/client/hooks/use-upload.mjs.map +1 -0
- package/dist/client/hooks/use-validation-error-map.mjs +53 -0
- package/dist/client/hooks/use-validation-error-map.mjs.map +1 -0
- package/dist/client/hooks/use-view-state.mjs +261 -0
- package/dist/client/hooks/use-view-state.mjs.map +1 -0
- package/dist/client/i18n/hooks.mjs +160 -0
- package/dist/client/i18n/hooks.mjs.map +1 -0
- package/dist/client/i18n/intl-cache.mjs +65 -0
- package/dist/client/i18n/intl-cache.mjs.map +1 -0
- package/dist/client/i18n/messages.mjs +7 -0
- package/dist/client/i18n/messages.mjs.map +1 -0
- package/dist/client/i18n/simple.d.mts +22 -0
- package/dist/client/i18n/simple.d.mts.map +1 -0
- package/dist/client/i18n/simple.mjs +157 -0
- package/dist/client/i18n/simple.mjs.map +1 -0
- package/dist/client/i18n/types.d.mts +110 -0
- package/dist/client/i18n/types.d.mts.map +1 -0
- package/dist/client/lib/utils.d.mts +1 -0
- package/dist/client/lib/utils.mjs +28 -0
- package/dist/client/lib/utils.mjs.map +1 -0
- package/dist/client/preview/block-scope-context.d.mts +74 -0
- package/dist/client/preview/block-scope-context.d.mts.map +1 -0
- package/dist/client/preview/block-scope-context.mjs +93 -0
- package/dist/client/preview/block-scope-context.mjs.map +1 -0
- package/dist/client/preview/index.d.mts +5 -0
- package/dist/client/preview/preview-banner.d.mts +46 -0
- package/dist/client/preview/preview-banner.d.mts.map +1 -0
- package/dist/client/preview/preview-banner.mjs +95 -0
- package/dist/client/preview/preview-banner.mjs.map +1 -0
- package/dist/client/preview/preview-field.d.mts +108 -0
- package/dist/client/preview/preview-field.d.mts.map +1 -0
- package/dist/client/preview/preview-field.mjs +125 -0
- package/dist/client/preview/preview-field.mjs.map +1 -0
- package/dist/client/preview/types.d.mts +115 -0
- package/dist/client/preview/types.d.mts.map +1 -0
- package/dist/client/preview/types.mjs +21 -0
- package/dist/client/preview/types.mjs.map +1 -0
- package/dist/client/preview/use-collection-preview.d.mts +71 -0
- package/dist/client/preview/use-collection-preview.d.mts.map +1 -0
- package/dist/client/preview/use-collection-preview.mjs +114 -0
- package/dist/client/preview/use-collection-preview.mjs.map +1 -0
- package/dist/client/runtime/content-locales-provider.d.mts +1 -0
- package/dist/client/runtime/content-locales-provider.mjs +85 -0
- package/dist/client/runtime/content-locales-provider.mjs.map +1 -0
- package/dist/client/runtime/index.d.mts +7 -0
- package/dist/client/runtime/index.mjs +8 -0
- package/dist/client/runtime/locale-scope.d.mts +2 -0
- package/dist/{runtime-6VZM878K.mjs → client/runtime/locale-scope.mjs} +3 -4
- package/dist/client/runtime/locale-scope.mjs.map +1 -0
- package/dist/client/runtime/provider.d.mts +10107 -0
- package/dist/client/runtime/provider.d.mts.map +1 -0
- package/dist/client/runtime/provider.mjs +229 -0
- package/dist/client/runtime/provider.mjs.map +1 -0
- package/dist/client/runtime/routes.d.mts +49 -0
- package/dist/client/runtime/routes.d.mts.map +1 -0
- package/dist/client/runtime/routes.mjs +107 -0
- package/dist/client/runtime/routes.mjs.map +1 -0
- package/dist/client/runtime/translations-provider.d.mts +2 -0
- package/dist/client/runtime/translations-provider.mjs +181 -0
- package/dist/client/runtime/translations-provider.mjs.map +1 -0
- package/dist/client/scope/index.d.mts +3 -0
- package/dist/client/scope/picker.d.mts +54 -0
- package/dist/client/scope/picker.d.mts.map +1 -0
- package/dist/client/scope/picker.mjs +161 -0
- package/dist/client/scope/picker.mjs.map +1 -0
- package/dist/client/scope/provider.d.mts +104 -0
- package/dist/client/scope/provider.d.mts.map +1 -0
- package/dist/client/scope/provider.mjs +159 -0
- package/dist/client/scope/provider.mjs.map +1 -0
- package/dist/client/scope/types.d.mts +112 -0
- package/dist/client/scope/types.d.mts.map +1 -0
- package/dist/client/styles/index.css +80 -0
- package/dist/client/utils/auto-expand-fields.mjs +65 -0
- package/dist/client/utils/auto-expand-fields.mjs.map +1 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs +256 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs.map +1 -0
- package/dist/client/utils/detect-relations.mjs +46 -0
- package/dist/client/utils/detect-relations.mjs.map +1 -0
- package/dist/client/utils/locale-to-flag.d.mts +118 -0
- package/dist/client/utils/locale-to-flag.d.mts.map +1 -0
- package/dist/client/utils/locale-to-flag.mjs +130 -0
- package/dist/client/utils/locale-to-flag.mjs.map +1 -0
- package/dist/client/utils/routes.mjs +196 -0
- package/dist/client/utils/routes.mjs.map +1 -0
- package/dist/client/views/auth/accept-invite-form.d.mts +73 -0
- package/dist/client/views/auth/accept-invite-form.d.mts.map +1 -0
- package/dist/client/views/auth/accept-invite-form.mjs +180 -0
- package/dist/client/views/auth/accept-invite-form.mjs.map +1 -0
- package/dist/client/views/auth/auth-layout.d.mts +44 -0
- package/dist/client/views/auth/auth-layout.d.mts.map +1 -0
- package/dist/client/views/auth/auth-layout.mjs +53 -0
- package/dist/client/views/auth/auth-layout.mjs.map +1 -0
- package/dist/client/views/auth/forgot-password-form.d.mts +59 -0
- package/dist/client/views/auth/forgot-password-form.d.mts.map +1 -0
- package/dist/{forgot-password-page-Bcp-An4Y.mjs → client/views/auth/forgot-password-form.mjs} +22 -89
- package/dist/client/views/auth/forgot-password-form.mjs.map +1 -0
- package/dist/client/views/auth/index.d.mts +7 -0
- package/dist/client/views/auth/invite-form.d.mts +1 -0
- package/dist/client/views/auth/invite-form.mjs +155 -0
- package/dist/client/views/auth/invite-form.mjs.map +1 -0
- package/dist/client/views/auth/login-form.d.mts +76 -0
- package/dist/client/views/auth/login-form.d.mts.map +1 -0
- package/dist/client/views/auth/login-form.mjs +167 -0
- package/dist/client/views/auth/login-form.mjs.map +1 -0
- package/dist/client/views/auth/reset-password-form.d.mts +66 -0
- package/dist/client/views/auth/reset-password-form.d.mts.map +1 -0
- package/dist/client/views/auth/reset-password-form.mjs +188 -0
- package/dist/client/views/auth/reset-password-form.mjs.map +1 -0
- package/dist/client/views/auth/setup-form.d.mts +61 -0
- package/dist/client/views/auth/setup-form.d.mts.map +1 -0
- package/dist/{setup-page-YAP_fzqh.mjs → client/views/auth/setup-form.mjs} +46 -124
- package/dist/client/views/auth/setup-form.mjs.map +1 -0
- package/dist/client/views/collection/auto-form-fields.d.mts +4 -0
- package/dist/client/views/collection/auto-form-fields.mjs +453 -0
- package/dist/client/views/collection/auto-form-fields.mjs.map +1 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs +291 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts +46 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.mjs +327 -0
- package/dist/client/views/collection/cells/complex-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/index.d.mts +7 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts +76 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs +165 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts +21 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.mjs +105 -0
- package/dist/client/views/collection/cells/relation-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +189 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.d.mts +2 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs +78 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +37 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts +25 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.mjs +20 -0
- package/dist/client/views/collection/cells/upload-cells.mjs.map +1 -0
- package/dist/client/views/collection/columns/build-columns.d.mts +2 -0
- package/dist/client/views/collection/columns/build-columns.mjs +156 -0
- package/dist/client/views/collection/columns/build-columns.mjs.map +1 -0
- package/dist/client/views/collection/columns/column-defaults.d.mts +2 -0
- package/dist/client/views/collection/columns/column-defaults.mjs +108 -0
- package/dist/client/views/collection/columns/column-defaults.mjs.map +1 -0
- package/dist/client/views/collection/columns/index.d.mts +3 -0
- package/dist/client/views/collection/columns/types.d.mts +2 -0
- package/dist/client/views/collection/field-context.mjs +127 -0
- package/dist/client/views/collection/field-context.mjs.map +1 -0
- package/dist/client/views/collection/field-renderer.mjs +171 -0
- package/dist/client/views/collection/field-renderer.mjs.map +1 -0
- package/dist/client/views/collection/form-view.d.mts +112 -0
- package/dist/client/views/collection/form-view.d.mts.map +1 -0
- package/dist/client/views/collection/form-view.mjs +903 -0
- package/dist/client/views/collection/form-view.mjs.map +1 -0
- package/dist/client/views/collection/index.d.mts +9 -0
- package/dist/client/views/collection/table-view.d.mts +102 -0
- package/dist/client/views/collection/table-view.d.mts.map +1 -0
- package/dist/client/views/collection/table-view.mjs +695 -0
- package/dist/client/views/collection/table-view.mjs.map +1 -0
- package/dist/client/views/collection/view-skeletons.mjs +121 -0
- package/dist/client/views/collection/view-skeletons.mjs.map +1 -0
- package/dist/client/views/common/global-search.d.mts +1 -0
- package/dist/client/views/common/global-search.mjs +376 -0
- package/dist/client/views/common/global-search.mjs.map +1 -0
- package/dist/client/views/common/index.d.mts +1 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs +385 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs.map +1 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs +178 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs.map +1 -0
- package/dist/client/views/dashboard/widget-card.mjs +159 -0
- package/dist/client/views/dashboard/widget-card.mjs.map +1 -0
- package/dist/client/views/globals/global-form-view.d.mts +74 -0
- package/dist/client/views/globals/global-form-view.d.mts.map +1 -0
- package/dist/client/views/globals/global-form-view.mjs +181 -0
- package/dist/client/views/globals/global-form-view.mjs.map +1 -0
- package/dist/client/views/index.d.mts +28 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts +140 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout-provider.mjs +90 -0
- package/dist/client/views/layout/admin-layout-provider.mjs.map +1 -0
- package/dist/client/views/layout/admin-layout.d.mts +151 -0
- package/dist/client/views/layout/admin-layout.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout.mjs +144 -0
- package/dist/client/views/layout/admin-layout.mjs.map +1 -0
- package/dist/client/views/layout/admin-root.d.mts +7 -0
- package/dist/client/views/layout/admin-router.d.mts +125 -0
- package/dist/client/views/layout/admin-router.d.mts.map +1 -0
- package/dist/client/views/layout/admin-router.mjs +594 -0
- package/dist/client/views/layout/admin-router.mjs.map +1 -0
- package/dist/client/views/layout/admin-sidebar.d.mts +105 -0
- package/dist/client/views/layout/admin-sidebar.d.mts.map +1 -0
- package/dist/client/views/layout/admin-sidebar.mjs +550 -0
- package/dist/client/views/layout/admin-sidebar.mjs.map +1 -0
- package/dist/client/views/layout/admin-topbar.mjs +128 -0
- package/dist/client/views/layout/admin-topbar.mjs.map +1 -0
- package/dist/client/views/layout/index.d.mts +5 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +67 -0
- package/dist/client/views/pages/accept-invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/accept-invite-page.mjs +143 -0
- package/dist/client/views/pages/accept-invite-page.mjs.map +1 -0
- package/dist/client/views/pages/dashboard-page.d.mts +52 -0
- package/dist/client/views/pages/dashboard-page.d.mts.map +1 -0
- package/dist/client/views/pages/dashboard-page.mjs +45 -0
- package/dist/client/views/pages/dashboard-page.mjs.map +1 -0
- package/dist/client/views/pages/forgot-password-page.d.mts +59 -0
- package/dist/client/views/pages/forgot-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/forgot-password-page.mjs +80 -0
- package/dist/client/views/pages/forgot-password-page.mjs.map +1 -0
- package/dist/client/views/pages/index.d.mts +7 -0
- package/dist/client/views/pages/invite-page.d.mts +71 -0
- package/dist/client/views/pages/invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/invite-page.mjs +86 -0
- package/dist/client/views/pages/invite-page.mjs.map +1 -0
- package/dist/client/views/pages/login-page.d.mts +76 -0
- package/dist/client/views/pages/login-page.d.mts.map +1 -0
- package/dist/client/views/pages/login-page.mjs +98 -0
- package/dist/client/views/pages/login-page.mjs.map +1 -0
- package/dist/client/views/pages/reset-password-page.d.mts +66 -0
- package/dist/client/views/pages/reset-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/reset-password-page.mjs +105 -0
- package/dist/client/views/pages/reset-password-page.mjs.map +1 -0
- package/dist/client/views/pages/setup-page.d.mts +64 -0
- package/dist/client/views/pages/setup-page.d.mts.map +1 -0
- package/dist/client/views/pages/setup-page.mjs +91 -0
- package/dist/client/views/pages/setup-page.mjs.map +1 -0
- package/dist/client.d.mts +92 -3
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +54 -12
- package/dist/components/rich-text/index.d.mts +1 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts +104 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts.map +1 -0
- package/dist/components/rich-text/rich-text-renderer.mjs +210 -0
- package/dist/components/rich-text/rich-text-renderer.mjs.map +1 -0
- package/dist/index.d.mts +62 -3
- package/dist/index.mjs +54 -12
- package/dist/server/adapters/nextjs.d.mts +121 -0
- package/dist/server/adapters/nextjs.d.mts.map +1 -0
- package/dist/server/adapters/nextjs.mjs +111 -0
- package/dist/server/adapters/nextjs.mjs.map +1 -0
- package/dist/server/adapters/tanstack.d.mts +133 -0
- package/dist/server/adapters/tanstack.d.mts.map +1 -0
- package/dist/server/adapters/tanstack.mjs +90 -0
- package/dist/server/adapters/tanstack.mjs.map +1 -0
- package/dist/server/augmentation.d.mts +1523 -0
- package/dist/server/augmentation.d.mts.map +1 -0
- package/dist/server/auth-helpers.d.mts +143 -0
- package/dist/server/auth-helpers.d.mts.map +1 -0
- package/dist/server/auth-helpers.mjs +108 -0
- package/dist/server/auth-helpers.mjs.map +1 -0
- package/dist/server/block/block-builder.d.mts +319 -0
- package/dist/server/block/block-builder.d.mts.map +1 -0
- package/dist/server/block/block-builder.mjs +217 -0
- package/dist/server/block/block-builder.mjs.map +1 -0
- package/dist/server/block/index.d.mts +3 -0
- package/dist/server/block/introspection.d.mts +84 -0
- package/dist/server/block/introspection.d.mts.map +1 -0
- package/dist/server/block/introspection.mjs +89 -0
- package/dist/server/block/introspection.mjs.map +1 -0
- package/dist/server/block/prefetch.d.mts +78 -0
- package/dist/server/block/prefetch.d.mts.map +1 -0
- package/dist/server/block/prefetch.mjs +240 -0
- package/dist/server/block/prefetch.mjs.map +1 -0
- package/dist/server/fields/blocks.d.mts +139 -0
- package/dist/server/fields/blocks.d.mts.map +1 -0
- package/dist/server/fields/blocks.mjs +192 -0
- package/dist/server/fields/blocks.mjs.map +1 -0
- package/dist/server/fields/index.d.mts +48 -0
- package/dist/server/fields/index.d.mts.map +1 -0
- package/dist/server/fields/index.mjs +16 -0
- package/dist/server/fields/index.mjs.map +1 -0
- package/dist/server/fields/rich-text.d.mts +135 -0
- package/dist/server/fields/rich-text.d.mts.map +1 -0
- package/dist/server/fields/rich-text.mjs +188 -0
- package/dist/server/fields/rich-text.mjs.map +1 -0
- package/dist/server/i18n/index.d.mts +16 -0
- package/dist/server/i18n/index.d.mts.map +1 -0
- package/dist/server/i18n/index.mjs +44 -0
- package/dist/server/i18n/index.mjs.map +1 -0
- package/dist/server/i18n/messages/cs.mjs +461 -0
- package/dist/server/i18n/messages/cs.mjs.map +1 -0
- package/dist/server/i18n/messages/de.mjs +461 -0
- package/dist/server/i18n/messages/de.mjs.map +1 -0
- package/dist/server/i18n/messages/en.mjs +493 -0
- package/dist/server/i18n/messages/en.mjs.map +1 -0
- package/dist/server/i18n/messages/es.mjs +461 -0
- package/dist/server/i18n/messages/es.mjs.map +1 -0
- package/dist/server/i18n/messages/fr.mjs +461 -0
- package/dist/server/i18n/messages/fr.mjs.map +1 -0
- package/dist/server/i18n/messages/index.mjs +24 -0
- package/dist/server/i18n/messages/index.mjs.map +1 -0
- package/dist/server/i18n/messages/pl.mjs +461 -0
- package/dist/server/i18n/messages/pl.mjs.map +1 -0
- package/dist/server/i18n/messages/pt.mjs +464 -0
- package/dist/server/i18n/messages/pt.mjs.map +1 -0
- package/dist/server/i18n/messages/sk.mjs +490 -0
- package/dist/server/i18n/messages/sk.mjs.map +1 -0
- package/dist/server/index.d.mts +20 -0
- package/dist/server/modules/admin/functions/admin-config.mjs +348 -0
- package/dist/server/modules/admin/functions/admin-config.mjs.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts +107 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.mjs +331 -0
- package/dist/server/modules/admin/functions/execute-action.mjs.map +1 -0
- package/dist/server/modules/admin/functions/locales.mjs +80 -0
- package/dist/server/modules/admin/functions/locales.mjs.map +1 -0
- package/dist/server/modules/admin/functions/preview.d.mts +70 -0
- package/dist/server/modules/admin/functions/preview.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/preview.mjs +243 -0
- package/dist/server/modules/admin/functions/preview.mjs.map +1 -0
- package/dist/server/modules/admin/functions/reactive.d.mts +99 -0
- package/dist/server/modules/admin/functions/reactive.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/reactive.mjs +378 -0
- package/dist/server/modules/admin/functions/reactive.mjs.map +1 -0
- package/dist/server/modules/admin/functions/setup.d.mts +84 -0
- package/dist/server/modules/admin/functions/setup.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/setup.mjs +131 -0
- package/dist/server/modules/admin/functions/setup.mjs.map +1 -0
- package/dist/server/modules/admin/functions/translations.mjs +125 -0
- package/dist/server/modules/admin/functions/translations.mjs.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts +33 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.mjs +70 -0
- package/dist/server/modules/admin/functions/widget-data.mjs.map +1 -0
- package/dist/server/modules/admin/index.d.mts +16879 -0
- package/dist/server/modules/admin/index.d.mts.map +1 -0
- package/dist/server/modules/admin/index.mjs +249 -0
- package/dist/server/modules/admin/index.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs +48 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs +79 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts +1490 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs +57 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs.map +1 -0
- package/dist/server/patch.d.mts +100 -0
- package/dist/server/patch.d.mts.map +1 -0
- package/dist/server/patch.mjs +1062 -0
- package/dist/server/patch.mjs.map +1 -0
- package/dist/server.d.mts +21 -250
- package/dist/server.mjs +19 -832
- package/dist/shared/preview-utils.d.mts +54 -0
- package/dist/shared/preview-utils.d.mts.map +1 -0
- package/dist/{preview-utils-BKQ9-TMa.mjs → shared/preview-utils.mjs} +2 -2
- package/dist/shared/preview-utils.mjs.map +1 -0
- package/dist/{saved-views.types-BMsz5mCy.d.mts → shared/types/saved-views.types.d.mts} +7 -2
- package/dist/shared/types/saved-views.types.d.mts.map +1 -0
- package/dist/shared.d.mts +3 -57
- package/dist/shared.mjs +1 -1
- package/package.json +12 -17
- package/dist/auth-layout-M8K8_q5R.mjs +0 -181
- package/dist/auth-layout-M8K8_q5R.mjs.map +0 -1
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +0 -273
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +0 -1
- package/dist/client-D1DqawtP.d.mts +0 -13403
- package/dist/client-D1DqawtP.d.mts.map +0 -1
- package/dist/client-njX1rZmi.mjs +0 -22612
- package/dist/client-njX1rZmi.mjs.map +0 -1
- package/dist/content-locales-provider-BXvuIgfg.mjs +0 -1650
- package/dist/content-locales-provider-BXvuIgfg.mjs.map +0 -1
- package/dist/dashboard-page-B4PGEdc2.mjs +0 -2500
- package/dist/dashboard-page-B4PGEdc2.mjs.map +0 -1
- package/dist/dashboard-page-mCY0pgZv.mjs +0 -3
- package/dist/dropzone-Do3awXKd.mjs +0 -634
- package/dist/dropzone-Do3awXKd.mjs.map +0 -1
- package/dist/forgot-password-page-Bcp-An4Y.mjs.map +0 -1
- package/dist/forgot-password-page-CEwsdLwn.mjs +0 -3
- package/dist/index-B4H3amCD.d.mts +0 -2753
- package/dist/index-B4H3amCD.d.mts.map +0 -1
- package/dist/login-page-BUnpCbCa.mjs +0 -3
- package/dist/login-page-CP4gA-dl.mjs +0 -298
- package/dist/login-page-CP4gA-dl.mjs.map +0 -1
- package/dist/preview-utils-BKQ9-TMa.mjs.map +0 -1
- package/dist/reset-password-page-BqfDmLxA.mjs +0 -281
- package/dist/reset-password-page-BqfDmLxA.mjs.map +0 -1
- package/dist/reset-password-page-CufHz3h3.mjs +0 -3
- package/dist/runtime-6VZM878K.mjs.map +0 -1
- package/dist/saved-views.types-BMsz5mCy.d.mts.map +0 -1
- package/dist/server.d.mts.map +0 -1
- package/dist/server.mjs.map +0 -1
- package/dist/setup-page-BNNzt_Z6.mjs +0 -3
- package/dist/setup-page-YAP_fzqh.mjs.map +0 -1
- package/dist/shared.d.mts.map +0 -1
- package/dist/use-auth-BoLmWtmU.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bubble-menu.mjs","names":["TiptapBubbleMenu"],"sources":["../../../../../src/client/components/fields/rich-text-editor/bubble-menu.tsx"],"sourcesContent":["/**\n * Bubble Menu Component\n *\n * Floating toolbar that appears on text selection.\n */\n\nimport type { Editor } from \"@tiptap/core\";\nimport { BubbleMenu as TiptapBubbleMenu } from \"@tiptap/react\";\nimport * as React from \"react\";\n\nimport { useTranslation } from \"../../../i18n/hooks\";\nimport { EDITOR_ICONS, ToolbarButton } from \"./toolbar\";\nimport type { RichTextFeatures } from \"./types\";\n\nexport type RichTextBubbleMenuProps = {\n editor: Editor;\n features: Required<RichTextFeatures>;\n disabled?: boolean;\n onLinkClick: () => void;\n};\n\n/**\n * Bubble menu that appears on text selection\n */\nexport function RichTextBubbleMenu({\n editor,\n features,\n disabled,\n onLinkClick,\n}: RichTextBubbleMenuProps) {\n const { t } = useTranslation();\n const isEditable = !disabled;\n\n return (\n <TiptapBubbleMenu\n editor={editor}\n className=\"flex items-center gap-1 rounded-md border bg-background p-1 shadow-lg\"\n >\n {features.bold && (\n <ToolbarButton\n icon={EDITOR_ICONS.bold}\n active={editor.isActive(\"bold\")}\n disabled={!isEditable}\n title={t(\"editor.bold\")}\n shortcut=\"⌘B\"\n onClick={() => editor.chain().focus().toggleBold().run()}\n />\n )}\n {features.italic && (\n <ToolbarButton\n icon={EDITOR_ICONS.italic}\n active={editor.isActive(\"italic\")}\n disabled={!isEditable}\n title={t(\"editor.italic\")}\n shortcut=\"⌘I\"\n onClick={() => editor.chain().focus().toggleItalic().run()}\n />\n )}\n {features.underline && (\n <ToolbarButton\n icon={EDITOR_ICONS.underline}\n active={editor.isActive(\"underline\")}\n disabled={!isEditable}\n title={t(\"editor.underline\")}\n shortcut=\"⌘U\"\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n />\n )}\n {features.link && (\n <ToolbarButton\n icon={EDITOR_ICONS.link}\n active={editor.isActive(\"link\")}\n disabled={!isEditable}\n title={t(\"editor.link\")}\n shortcut=\"⌘K\"\n onClick={onLinkClick}\n />\n )}\n </TiptapBubbleMenu>\n );\n}\n"],"mappings":";;;;;;;;;;AAwBA,SAAgB,mBAAmB,EACjC,QACA,UACA,UACA,eAC0B;CAC1B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,aAAa,CAAC;AAEpB,QACE,qBAACA;EACS;EACR,WAAU;;GAET,SAAS,QACR,oBAAC;IACC,MAAM,aAAa;IACnB,QAAQ,OAAO,SAAS,OAAO;IAC/B,UAAU,CAAC;IACX,OAAO,EAAE,cAAc;IACvB,UAAS;IACT,eAAe,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK;KACxD;GAEH,SAAS,UACR,oBAAC;IACC,MAAM,aAAa;IACnB,QAAQ,OAAO,SAAS,SAAS;IACjC,UAAU,CAAC;IACX,OAAO,EAAE,gBAAgB;IACzB,UAAS;IACT,eAAe,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK;KAC1D;GAEH,SAAS,aACR,oBAAC;IACC,MAAM,aAAa;IACnB,QAAQ,OAAO,SAAS,YAAY;IACpC,UAAU,CAAC;IACX,OAAO,EAAE,mBAAmB;IAC5B,UAAS;IACT,eAAe,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK;KAC7D;GAEH,SAAS,QACR,oBAAC;IACC,MAAM,aAAa;IACnB,QAAQ,OAAO,SAAS,OAAO;IAC/B,UAAU,CAAC;IACX,OAAO,EAAE,cAAc;IACvB,UAAS;IACT,SAAS;KACT;;GAEa"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { createSlashCommandExtension } from "./slash-commands.mjs";
|
|
2
|
+
import CharacterCount from "@tiptap/extension-character-count";
|
|
3
|
+
import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight";
|
|
4
|
+
import Image from "@tiptap/extension-image";
|
|
5
|
+
import Link from "@tiptap/extension-link";
|
|
6
|
+
import Placeholder from "@tiptap/extension-placeholder";
|
|
7
|
+
import Table from "@tiptap/extension-table";
|
|
8
|
+
import TableCell from "@tiptap/extension-table-cell";
|
|
9
|
+
import TableHeader from "@tiptap/extension-table-header";
|
|
10
|
+
import TableRow from "@tiptap/extension-table-row";
|
|
11
|
+
import TextAlign from "@tiptap/extension-text-align";
|
|
12
|
+
import Underline from "@tiptap/extension-underline";
|
|
13
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
14
|
+
import { common, createLowlight } from "lowlight";
|
|
15
|
+
|
|
16
|
+
//#region src/client/components/fields/rich-text-editor/extensions.tsx
|
|
17
|
+
const lowlight = createLowlight(common);
|
|
18
|
+
/**
|
|
19
|
+
* Build Tiptap extensions based on feature configuration
|
|
20
|
+
*/
|
|
21
|
+
function buildExtensions({ features, placeholder, maxCharacters, customExtensions }) {
|
|
22
|
+
const starterKitConfig = { codeBlock: false };
|
|
23
|
+
if (!features.bold) starterKitConfig.bold = false;
|
|
24
|
+
if (!features.italic) starterKitConfig.italic = false;
|
|
25
|
+
if (!features.strike) starterKitConfig.strike = false;
|
|
26
|
+
if (!features.code) starterKitConfig.code = false;
|
|
27
|
+
if (!features.blockquote) starterKitConfig.blockquote = false;
|
|
28
|
+
if (!features.heading) starterKitConfig.heading = false;
|
|
29
|
+
if (!features.bulletList) starterKitConfig.bulletList = false;
|
|
30
|
+
if (!features.orderedList) starterKitConfig.orderedList = false;
|
|
31
|
+
if (!features.bulletList && !features.orderedList) starterKitConfig.listItem = false;
|
|
32
|
+
if (!features.horizontalRule) starterKitConfig.horizontalRule = false;
|
|
33
|
+
if (!features.history) starterKitConfig.history = false;
|
|
34
|
+
const extensions = [StarterKit.configure(starterKitConfig), Placeholder.configure({ placeholder: placeholder || "Start writing..." })];
|
|
35
|
+
if (features.underline) extensions.push(Underline);
|
|
36
|
+
if (features.link) extensions.push(Link.configure({
|
|
37
|
+
openOnClick: false,
|
|
38
|
+
autolink: true,
|
|
39
|
+
linkOnPaste: true
|
|
40
|
+
}));
|
|
41
|
+
if (features.align) extensions.push(TextAlign.configure({ types: ["heading", "paragraph"] }));
|
|
42
|
+
if (features.image) extensions.push(Image);
|
|
43
|
+
if (features.table) extensions.push(Table.configure({ resizable: true }), TableRow, TableHeader, TableCell);
|
|
44
|
+
if (features.codeBlock) extensions.push(CodeBlockLowlight.configure({ lowlight }));
|
|
45
|
+
if (features.characterCount && maxCharacters) extensions.push(CharacterCount.configure({ limit: maxCharacters }));
|
|
46
|
+
if (features.slashCommands) extensions.push(createSlashCommandExtension((editor) => {
|
|
47
|
+
const commands = [];
|
|
48
|
+
if (features.heading) commands.push({
|
|
49
|
+
title: "Heading 1",
|
|
50
|
+
description: "Large section heading",
|
|
51
|
+
keywords: ["h1"],
|
|
52
|
+
command: (cmdEditor) => cmdEditor.chain().focus().toggleHeading({ level: 1 }).run()
|
|
53
|
+
}, {
|
|
54
|
+
title: "Heading 2",
|
|
55
|
+
description: "Medium section heading",
|
|
56
|
+
keywords: ["h2"],
|
|
57
|
+
command: (cmdEditor) => cmdEditor.chain().focus().toggleHeading({ level: 2 }).run()
|
|
58
|
+
}, {
|
|
59
|
+
title: "Heading 3",
|
|
60
|
+
description: "Small section heading",
|
|
61
|
+
keywords: ["h3"],
|
|
62
|
+
command: (cmdEditor) => cmdEditor.chain().focus().toggleHeading({ level: 3 }).run()
|
|
63
|
+
});
|
|
64
|
+
commands.push({
|
|
65
|
+
title: "Paragraph",
|
|
66
|
+
description: "Start with plain text",
|
|
67
|
+
keywords: ["text"],
|
|
68
|
+
command: (cmdEditor) => cmdEditor.chain().focus().setParagraph().run()
|
|
69
|
+
});
|
|
70
|
+
if (features.bulletList) commands.push({
|
|
71
|
+
title: "Bullet list",
|
|
72
|
+
description: "Create a bulleted list",
|
|
73
|
+
keywords: ["list", "ul"],
|
|
74
|
+
command: (cmdEditor) => cmdEditor.chain().focus().toggleBulletList().run()
|
|
75
|
+
});
|
|
76
|
+
if (features.orderedList) commands.push({
|
|
77
|
+
title: "Numbered list",
|
|
78
|
+
description: "Create an ordered list",
|
|
79
|
+
keywords: ["list", "ol"],
|
|
80
|
+
command: (cmdEditor) => cmdEditor.chain().focus().toggleOrderedList().run()
|
|
81
|
+
});
|
|
82
|
+
if (features.blockquote) commands.push({
|
|
83
|
+
title: "Quote",
|
|
84
|
+
description: "Capture a quote",
|
|
85
|
+
keywords: ["blockquote"],
|
|
86
|
+
command: (cmdEditor) => cmdEditor.chain().focus().toggleBlockquote().run()
|
|
87
|
+
});
|
|
88
|
+
if (features.codeBlock) commands.push({
|
|
89
|
+
title: "Code block",
|
|
90
|
+
description: "Insert code snippet",
|
|
91
|
+
keywords: ["code"],
|
|
92
|
+
command: (cmdEditor) => cmdEditor.chain().focus().toggleCodeBlock().run()
|
|
93
|
+
});
|
|
94
|
+
if (features.horizontalRule) commands.push({
|
|
95
|
+
title: "Divider",
|
|
96
|
+
description: "Insert a horizontal rule",
|
|
97
|
+
keywords: ["hr"],
|
|
98
|
+
command: (cmdEditor) => cmdEditor.chain().focus().setHorizontalRule().run()
|
|
99
|
+
});
|
|
100
|
+
if (features.table) commands.push({
|
|
101
|
+
title: "Table",
|
|
102
|
+
description: "Insert a 3x3 table",
|
|
103
|
+
keywords: ["grid"],
|
|
104
|
+
command: (cmdEditor) => cmdEditor.chain().focus().insertTable({
|
|
105
|
+
rows: 3,
|
|
106
|
+
cols: 3,
|
|
107
|
+
withHeaderRow: true
|
|
108
|
+
}).run()
|
|
109
|
+
});
|
|
110
|
+
return commands;
|
|
111
|
+
}));
|
|
112
|
+
if (customExtensions?.length) extensions.push(...customExtensions);
|
|
113
|
+
return extensions;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
export { buildExtensions };
|
|
118
|
+
//# sourceMappingURL=extensions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.mjs","names":["starterKitConfig: Record<string, any>","extensions: AnyExtension[]","commands: SlashCommandItem[]"],"sources":["../../../../../src/client/components/fields/rich-text-editor/extensions.tsx"],"sourcesContent":["/**\n * Tiptap Extensions Configuration\n *\n * Factory functions for creating and configuring Tiptap extensions.\n */\n\nimport type { AnyExtension } from \"@tiptap/core\";\nimport CharacterCount from \"@tiptap/extension-character-count\";\nimport CodeBlockLowlight from \"@tiptap/extension-code-block-lowlight\";\nimport Image from \"@tiptap/extension-image\";\nimport Link from \"@tiptap/extension-link\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Table from \"@tiptap/extension-table\";\nimport TableCell from \"@tiptap/extension-table-cell\";\nimport TableHeader from \"@tiptap/extension-table-header\";\nimport TableRow from \"@tiptap/extension-table-row\";\nimport TextAlign from \"@tiptap/extension-text-align\";\nimport Underline from \"@tiptap/extension-underline\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport { common, createLowlight } from \"lowlight\";\n\nimport { createSlashCommandExtension } from \"./slash-commands\";\nimport type { RichTextFeatures, SlashCommandItem } from \"./types\";\n\nconst lowlight = createLowlight(common);\n\n/**\n * Build Tiptap extensions based on feature configuration\n */\nexport function buildExtensions({\n features,\n placeholder,\n maxCharacters,\n customExtensions,\n}: {\n features: Required<RichTextFeatures>;\n placeholder?: string;\n maxCharacters?: number;\n customExtensions?: AnyExtension[];\n}): AnyExtension[] {\n const starterKitConfig: Record<string, any> = {\n codeBlock: false,\n };\n\n if (!features.bold) starterKitConfig.bold = false;\n if (!features.italic) starterKitConfig.italic = false;\n if (!features.strike) starterKitConfig.strike = false;\n if (!features.code) starterKitConfig.code = false;\n if (!features.blockquote) starterKitConfig.blockquote = false;\n if (!features.heading) starterKitConfig.heading = false;\n if (!features.bulletList) starterKitConfig.bulletList = false;\n if (!features.orderedList) starterKitConfig.orderedList = false;\n if (!features.bulletList && !features.orderedList) {\n starterKitConfig.listItem = false;\n }\n if (!features.horizontalRule) starterKitConfig.horizontalRule = false;\n if (!features.history) starterKitConfig.history = false;\n\n const extensions: AnyExtension[] = [\n StarterKit.configure(starterKitConfig),\n Placeholder.configure({\n placeholder: placeholder || \"Start writing...\",\n }),\n ];\n\n if (features.underline) {\n extensions.push(Underline);\n }\n\n if (features.link) {\n extensions.push(\n Link.configure({\n openOnClick: false,\n autolink: true,\n linkOnPaste: true,\n }),\n );\n }\n\n if (features.align) {\n extensions.push(TextAlign.configure({ types: [\"heading\", \"paragraph\"] }));\n }\n\n if (features.image) {\n extensions.push(Image);\n }\n\n if (features.table) {\n extensions.push(\n Table.configure({ resizable: true }),\n TableRow,\n TableHeader,\n TableCell,\n );\n }\n\n if (features.codeBlock) {\n extensions.push(CodeBlockLowlight.configure({ lowlight }));\n }\n\n if (features.characterCount && maxCharacters) {\n extensions.push(\n CharacterCount.configure({\n limit: maxCharacters,\n }),\n );\n }\n\n if (features.slashCommands) {\n extensions.push(\n createSlashCommandExtension((editor) => {\n const commands: SlashCommandItem[] = [];\n\n if (features.heading) {\n commands.push(\n {\n title: \"Heading 1\",\n description: \"Large section heading\",\n keywords: [\"h1\"],\n command: (cmdEditor) =>\n cmdEditor.chain().focus().toggleHeading({ level: 1 }).run(),\n },\n {\n title: \"Heading 2\",\n description: \"Medium section heading\",\n keywords: [\"h2\"],\n command: (cmdEditor) =>\n cmdEditor.chain().focus().toggleHeading({ level: 2 }).run(),\n },\n {\n title: \"Heading 3\",\n description: \"Small section heading\",\n keywords: [\"h3\"],\n command: (cmdEditor) =>\n cmdEditor.chain().focus().toggleHeading({ level: 3 }).run(),\n },\n );\n }\n\n commands.push({\n title: \"Paragraph\",\n description: \"Start with plain text\",\n keywords: [\"text\"],\n command: (cmdEditor) =>\n cmdEditor.chain().focus().setParagraph().run(),\n });\n\n if (features.bulletList) {\n commands.push({\n title: \"Bullet list\",\n description: \"Create a bulleted list\",\n keywords: [\"list\", \"ul\"],\n command: (cmdEditor) =>\n cmdEditor.chain().focus().toggleBulletList().run(),\n });\n }\n\n if (features.orderedList) {\n commands.push({\n title: \"Numbered list\",\n description: \"Create an ordered list\",\n keywords: [\"list\", \"ol\"],\n command: (cmdEditor) =>\n cmdEditor.chain().focus().toggleOrderedList().run(),\n });\n }\n\n if (features.blockquote) {\n commands.push({\n title: \"Quote\",\n description: \"Capture a quote\",\n keywords: [\"blockquote\"],\n command: (cmdEditor) =>\n cmdEditor.chain().focus().toggleBlockquote().run(),\n });\n }\n\n if (features.codeBlock) {\n commands.push({\n title: \"Code block\",\n description: \"Insert code snippet\",\n keywords: [\"code\"],\n command: (cmdEditor) =>\n cmdEditor.chain().focus().toggleCodeBlock().run(),\n });\n }\n\n if (features.horizontalRule) {\n commands.push({\n title: \"Divider\",\n description: \"Insert a horizontal rule\",\n keywords: [\"hr\"],\n command: (cmdEditor) =>\n cmdEditor.chain().focus().setHorizontalRule().run(),\n });\n }\n\n if (features.table) {\n commands.push({\n title: \"Table\",\n description: \"Insert a 3x3 table\",\n keywords: [\"grid\"],\n command: (cmdEditor) =>\n cmdEditor\n .chain()\n .focus()\n .insertTable({ rows: 3, cols: 3, withHeaderRow: true })\n .run(),\n });\n }\n\n return commands;\n }),\n );\n }\n\n if (customExtensions?.length) {\n extensions.push(...customExtensions);\n }\n\n return extensions;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { useTranslation } from "../../../i18n/hooks.mjs";
|
|
2
|
+
import { Button } from "../../ui/button.mjs";
|
|
3
|
+
import { sanitizeFilename } from "../field-utils.mjs";
|
|
4
|
+
import { useCollectionItem } from "../../../hooks/use-collection.mjs";
|
|
5
|
+
import { useUploadCollection } from "../../../hooks/use-upload-collection.mjs";
|
|
6
|
+
import { useUpload } from "../../../hooks/use-upload.mjs";
|
|
7
|
+
import { Input } from "../../ui/input.mjs";
|
|
8
|
+
import { Popover, PopoverContent, PopoverHeader, PopoverTitle, PopoverTrigger } from "../../ui/popover.mjs";
|
|
9
|
+
import { MediaPickerDialog } from "../../media/media-picker-dialog.mjs";
|
|
10
|
+
import * as React$1 from "react";
|
|
11
|
+
import { toast } from "sonner";
|
|
12
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
//#region src/client/components/fields/rich-text-editor/image-popover.tsx
|
|
15
|
+
/**
|
|
16
|
+
* Image insertion popover
|
|
17
|
+
*/
|
|
18
|
+
function ImagePopover({ editor, open, onOpenChange, disabled, onImageUpload, imageCollection, enableMediaLibrary }) {
|
|
19
|
+
const { t } = useTranslation();
|
|
20
|
+
const [imageUrl, setImageUrl] = React$1.useState("");
|
|
21
|
+
const [imageAlt, setImageAlt] = React$1.useState("");
|
|
22
|
+
const [uploadingImage, setUploadingImage] = React$1.useState(false);
|
|
23
|
+
const fileInputRef = React$1.useRef(null);
|
|
24
|
+
const [isPickerOpen, setIsPickerOpen] = React$1.useState(false);
|
|
25
|
+
const [selectedAssetId, setSelectedAssetId] = React$1.useState(null);
|
|
26
|
+
const { upload } = useUpload();
|
|
27
|
+
const { collection, collections: availableUploadCollections } = useUploadCollection(imageCollection);
|
|
28
|
+
const showMediaLibrary = enableMediaLibrary ?? true;
|
|
29
|
+
const { data: selectedAsset } = useCollectionItem(collection || "", selectedAssetId || "", void 0, { enabled: !!collection && !!selectedAssetId });
|
|
30
|
+
const handleInsertImageUrl = React$1.useCallback(() => {
|
|
31
|
+
if (!editor || !imageUrl) return;
|
|
32
|
+
editor.chain().focus().setImage({
|
|
33
|
+
src: imageUrl,
|
|
34
|
+
alt: imageAlt || void 0
|
|
35
|
+
}).run();
|
|
36
|
+
setImageUrl("");
|
|
37
|
+
setImageAlt("");
|
|
38
|
+
onOpenChange(false);
|
|
39
|
+
}, [
|
|
40
|
+
editor,
|
|
41
|
+
imageAlt,
|
|
42
|
+
imageUrl,
|
|
43
|
+
onOpenChange
|
|
44
|
+
]);
|
|
45
|
+
const handleImageUpload = React$1.useCallback(async (event) => {
|
|
46
|
+
const file = event.target.files?.[0];
|
|
47
|
+
if (!file || !editor) return;
|
|
48
|
+
try {
|
|
49
|
+
setUploadingImage(true);
|
|
50
|
+
let url;
|
|
51
|
+
if (onImageUpload) url = await onImageUpload(file);
|
|
52
|
+
else {
|
|
53
|
+
if (!collection) throw new Error(availableUploadCollections.length > 1 ? `Multiple upload collections are available (${availableUploadCollections.join(", ")}). Configure rich-text imageCollection to choose one.` : "No upload collection is configured for rich-text image uploads.");
|
|
54
|
+
const sanitizedName = sanitizeFilename(file.name);
|
|
55
|
+
url = (await upload(sanitizedName === file.name ? file : new File([file], sanitizedName, { type: file.type }), { to: collection }))?.url;
|
|
56
|
+
if (!url) throw new Error(t("upload.error"));
|
|
57
|
+
}
|
|
58
|
+
if (url) {
|
|
59
|
+
editor.chain().focus().setImage({
|
|
60
|
+
src: url,
|
|
61
|
+
alt: imageAlt || void 0
|
|
62
|
+
}).run();
|
|
63
|
+
setImageUrl("");
|
|
64
|
+
setImageAlt("");
|
|
65
|
+
onOpenChange(false);
|
|
66
|
+
}
|
|
67
|
+
} catch (err) {
|
|
68
|
+
const uploadError = err instanceof Error ? err : new Error(t("upload.error"));
|
|
69
|
+
toast.error(uploadError.message);
|
|
70
|
+
} finally {
|
|
71
|
+
setUploadingImage(false);
|
|
72
|
+
event.target.value = "";
|
|
73
|
+
}
|
|
74
|
+
}, [
|
|
75
|
+
collection,
|
|
76
|
+
availableUploadCollections,
|
|
77
|
+
editor,
|
|
78
|
+
imageAlt,
|
|
79
|
+
onImageUpload,
|
|
80
|
+
onOpenChange,
|
|
81
|
+
t,
|
|
82
|
+
upload
|
|
83
|
+
]);
|
|
84
|
+
React$1.useEffect(() => {
|
|
85
|
+
if (!selectedAssetId || !selectedAsset || !editor) return;
|
|
86
|
+
const assetUrl = selectedAsset?.url;
|
|
87
|
+
if (!assetUrl) {
|
|
88
|
+
toast.error(t("upload.error"));
|
|
89
|
+
setSelectedAssetId(null);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
editor.chain().focus().setImage({
|
|
93
|
+
src: assetUrl,
|
|
94
|
+
alt: imageAlt || selectedAsset?.alt || void 0
|
|
95
|
+
}).run();
|
|
96
|
+
setImageUrl("");
|
|
97
|
+
setImageAlt("");
|
|
98
|
+
setSelectedAssetId(null);
|
|
99
|
+
onOpenChange(false);
|
|
100
|
+
}, [
|
|
101
|
+
editor,
|
|
102
|
+
imageAlt,
|
|
103
|
+
onOpenChange,
|
|
104
|
+
selectedAsset,
|
|
105
|
+
selectedAssetId,
|
|
106
|
+
t
|
|
107
|
+
]);
|
|
108
|
+
const handlePickerSelect = (ids) => {
|
|
109
|
+
const selectedId = Array.isArray(ids) ? ids[0] : ids;
|
|
110
|
+
if (!selectedId) return;
|
|
111
|
+
setSelectedAssetId(selectedId);
|
|
112
|
+
setIsPickerOpen(false);
|
|
113
|
+
};
|
|
114
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Popover, {
|
|
115
|
+
open,
|
|
116
|
+
onOpenChange,
|
|
117
|
+
children: [/* @__PURE__ */ jsx(PopoverTrigger, { render: /* @__PURE__ */ jsx("div", { className: "sr-only" }) }), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
118
|
+
className: "w-80",
|
|
119
|
+
children: [/* @__PURE__ */ jsx(PopoverHeader, { children: /* @__PURE__ */ jsx(PopoverTitle, { children: t("editor.image") }) }), /* @__PURE__ */ jsxs("div", {
|
|
120
|
+
className: "space-y-3",
|
|
121
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
122
|
+
className: "space-y-2",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ jsx(Input, {
|
|
125
|
+
value: imageUrl,
|
|
126
|
+
placeholder: "https://example.com/image.jpg",
|
|
127
|
+
onChange: (event) => setImageUrl(event.target.value),
|
|
128
|
+
disabled
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ jsx(Input, {
|
|
131
|
+
value: imageAlt,
|
|
132
|
+
placeholder: t("editor.altText"),
|
|
133
|
+
onChange: (event) => setImageAlt(event.target.value),
|
|
134
|
+
disabled
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ jsx("div", {
|
|
137
|
+
className: "flex justify-end gap-2",
|
|
138
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
139
|
+
type: "button",
|
|
140
|
+
size: "xs",
|
|
141
|
+
onClick: handleInsertImageUrl,
|
|
142
|
+
disabled: disabled || !imageUrl,
|
|
143
|
+
children: t("editor.insertUrl")
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
148
|
+
className: "space-y-2",
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ jsx("div", {
|
|
151
|
+
className: "text-xs font-medium",
|
|
152
|
+
children: t("editor.uploadFile")
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ jsx("input", {
|
|
155
|
+
ref: fileInputRef,
|
|
156
|
+
type: "file",
|
|
157
|
+
accept: "image/*",
|
|
158
|
+
onChange: handleImageUpload,
|
|
159
|
+
className: "sr-only",
|
|
160
|
+
disabled: disabled || uploadingImage
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ jsxs("div", {
|
|
163
|
+
className: "flex items-center gap-2",
|
|
164
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
165
|
+
type: "button",
|
|
166
|
+
size: "xs",
|
|
167
|
+
variant: "outline",
|
|
168
|
+
onClick: () => fileInputRef.current?.click(),
|
|
169
|
+
disabled: disabled || uploadingImage || !onImageUpload && !collection,
|
|
170
|
+
children: uploadingImage ? t("editor.uploading") : t("editor.chooseFile")
|
|
171
|
+
}), showMediaLibrary && /* @__PURE__ */ jsx(Button, {
|
|
172
|
+
type: "button",
|
|
173
|
+
size: "xs",
|
|
174
|
+
variant: "outline",
|
|
175
|
+
onClick: () => setIsPickerOpen(true),
|
|
176
|
+
disabled: disabled || !collection,
|
|
177
|
+
children: t("editor.browseLibrary")
|
|
178
|
+
})]
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
})]
|
|
182
|
+
})]
|
|
183
|
+
})]
|
|
184
|
+
}), showMediaLibrary && /* @__PURE__ */ jsx(MediaPickerDialog, {
|
|
185
|
+
open: isPickerOpen,
|
|
186
|
+
onOpenChange: setIsPickerOpen,
|
|
187
|
+
mode: "single",
|
|
188
|
+
accept: ["image/*"],
|
|
189
|
+
onSelect: handlePickerSelect,
|
|
190
|
+
collection
|
|
191
|
+
})] });
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
//#endregion
|
|
195
|
+
export { ImagePopover };
|
|
196
|
+
//# sourceMappingURL=image-popover.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-popover.mjs","names":["React","url: string | undefined"],"sources":["../../../../../src/client/components/fields/rich-text-editor/image-popover.tsx"],"sourcesContent":["/**\n * Image Popover Component\n *\n * Dialog for inserting images via URL or file upload.\n */\n\nimport type { Editor } from \"@tiptap/core\";\nimport * as React from \"react\";\nimport { toast } from \"sonner\";\n\nimport { useCollectionItem } from \"../../../hooks/use-collection\";\nimport { type Asset, useUpload } from \"../../../hooks/use-upload\";\nimport { useUploadCollection } from \"../../../hooks/use-upload-collection\";\nimport { useTranslation } from \"../../../i18n/hooks\";\nimport { MediaPickerDialog } from \"../../media/media-picker-dialog\";\nimport { Button } from \"../../ui/button\";\nimport { Input } from \"../../ui/input\";\nimport {\n\tPopover,\n\tPopoverContent,\n\tPopoverHeader,\n\tPopoverTitle,\n\tPopoverTrigger,\n} from \"../../ui/popover\";\nimport { sanitizeFilename } from \"../field-utils\";\n\nexport type ImagePopoverProps = {\n\teditor: Editor | null;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tdisabled?: boolean;\n\tonImageUpload?: (file: File) => Promise<string>;\n\timageCollection?: string;\n\tenableMediaLibrary?: boolean;\n};\n\n/**\n * Image insertion popover\n */\nexport function ImagePopover({\n\teditor,\n\topen,\n\tonOpenChange,\n\tdisabled,\n\tonImageUpload,\n\timageCollection,\n\tenableMediaLibrary,\n}: ImagePopoverProps) {\n\tconst { t } = useTranslation();\n\tconst [imageUrl, setImageUrl] = React.useState(\"\");\n\tconst [imageAlt, setImageAlt] = React.useState(\"\");\n\tconst [uploadingImage, setUploadingImage] = React.useState(false);\n\tconst fileInputRef = React.useRef<HTMLInputElement | null>(null);\n\tconst [isPickerOpen, setIsPickerOpen] = React.useState(false);\n\tconst [selectedAssetId, setSelectedAssetId] = React.useState<string | null>(\n\t\tnull,\n\t);\n\tconst { upload } = useUpload();\n\tconst { collection, collections: availableUploadCollections } =\n\t\tuseUploadCollection(imageCollection);\n\tconst showMediaLibrary = enableMediaLibrary ?? true;\n\tconst { data: selectedAsset } = useCollectionItem(\n\t\tcollection || \"\",\n\t\tselectedAssetId || \"\",\n\t\tundefined,\n\t\t{ enabled: !!collection && !!selectedAssetId },\n\t);\n\n\tconst handleInsertImageUrl = React.useCallback(() => {\n\t\tif (!editor || !imageUrl) return;\n\t\teditor\n\t\t\t.chain()\n\t\t\t.focus()\n\t\t\t.setImage({ src: imageUrl, alt: imageAlt || undefined })\n\t\t\t.run();\n\t\tsetImageUrl(\"\");\n\t\tsetImageAlt(\"\");\n\t\tonOpenChange(false);\n\t}, [editor, imageAlt, imageUrl, onOpenChange]);\n\n\tconst handleImageUpload = React.useCallback(\n\t\tasync (event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst file = event.target.files?.[0];\n\t\t\tif (!file || !editor) return;\n\n\t\t\ttry {\n\t\t\t\tsetUploadingImage(true);\n\t\t\t\tlet url: string | undefined;\n\t\t\t\tif (onImageUpload) {\n\t\t\t\t\turl = await onImageUpload(file);\n\t\t\t\t} else {\n\t\t\t\t\tif (!collection) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\tavailableUploadCollections.length > 1\n\t\t\t\t\t\t\t\t? `Multiple upload collections are available (${availableUploadCollections.join(\", \")}). Configure rich-text imageCollection to choose one.`\n\t\t\t\t\t\t\t\t: \"No upload collection is configured for rich-text image uploads.\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst sanitizedName = sanitizeFilename(file.name);\n\t\t\t\t\tconst uploadFile =\n\t\t\t\t\t\tsanitizedName === file.name\n\t\t\t\t\t\t\t? file\n\t\t\t\t\t\t\t: new File([file], sanitizedName, { type: file.type });\n\t\t\t\t\tconst uploadedAsset = (await upload(uploadFile, {\n\t\t\t\t\t\tto: collection,\n\t\t\t\t\t})) as Asset;\n\t\t\t\t\turl = uploadedAsset?.url;\n\t\t\t\t\tif (!url) {\n\t\t\t\t\t\tthrow new Error(t(\"upload.error\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (url) {\n\t\t\t\t\teditor\n\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t.setImage({ src: url, alt: imageAlt || undefined })\n\t\t\t\t\t\t.run();\n\t\t\t\t\tsetImageUrl(\"\");\n\t\t\t\t\tsetImageAlt(\"\");\n\t\t\t\t\tonOpenChange(false);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tconst uploadError =\n\t\t\t\t\terr instanceof Error ? err : new Error(t(\"upload.error\"));\n\t\t\t\ttoast.error(uploadError.message);\n\t\t\t} finally {\n\t\t\t\tsetUploadingImage(false);\n\t\t\t\tevent.target.value = \"\";\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tcollection,\n\t\t\tavailableUploadCollections,\n\t\t\teditor,\n\t\t\timageAlt,\n\t\t\tonImageUpload,\n\t\t\tonOpenChange,\n\t\t\tt,\n\t\t\tupload,\n\t\t],\n\t);\n\n\tReact.useEffect(() => {\n\t\tif (!selectedAssetId || !selectedAsset || !editor) return;\n\t\tconst assetUrl = (selectedAsset as Asset | undefined)?.url;\n\t\tif (!assetUrl) {\n\t\t\ttoast.error(t(\"upload.error\"));\n\t\t\tsetSelectedAssetId(null);\n\t\t\treturn;\n\t\t}\n\t\teditor\n\t\t\t.chain()\n\t\t\t.focus()\n\t\t\t.setImage({\n\t\t\t\tsrc: assetUrl,\n\t\t\t\talt: imageAlt || (selectedAsset as Asset | undefined)?.alt || undefined,\n\t\t\t})\n\t\t\t.run();\n\t\tsetImageUrl(\"\");\n\t\tsetImageAlt(\"\");\n\t\tsetSelectedAssetId(null);\n\t\tonOpenChange(false);\n\t}, [editor, imageAlt, onOpenChange, selectedAsset, selectedAssetId, t]);\n\n\tconst handlePickerSelect = (ids: string | string[]) => {\n\t\tconst selectedId = Array.isArray(ids) ? ids[0] : ids;\n\t\tif (!selectedId) return;\n\t\tsetSelectedAssetId(selectedId);\n\t\tsetIsPickerOpen(false);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<Popover open={open} onOpenChange={onOpenChange}>\n\t\t\t\t<PopoverTrigger render={<div className=\"sr-only\" />} />\n\t\t\t\t<PopoverContent className=\"w-80\">\n\t\t\t\t\t<PopoverHeader>\n\t\t\t\t\t\t<PopoverTitle>{t(\"editor.image\")}</PopoverTitle>\n\t\t\t\t\t</PopoverHeader>\n\t\t\t\t\t<div className=\"space-y-3\">\n\t\t\t\t\t\t<div className=\"space-y-2\">\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tvalue={imageUrl}\n\t\t\t\t\t\t\t\tplaceholder=\"https://example.com/image.jpg\"\n\t\t\t\t\t\t\t\tonChange={(event) => setImageUrl(event.target.value)}\n\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tvalue={imageAlt}\n\t\t\t\t\t\t\t\tplaceholder={t(\"editor.altText\")}\n\t\t\t\t\t\t\t\tonChange={(event) => setImageAlt(event.target.value)}\n\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<div className=\"flex justify-end gap-2\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\tonClick={handleInsertImageUrl}\n\t\t\t\t\t\t\t\t\tdisabled={disabled || !imageUrl}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{t(\"editor.insertUrl\")}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"space-y-2\">\n\t\t\t\t\t\t\t<div className=\"text-xs font-medium\">\n\t\t\t\t\t\t\t\t{t(\"editor.uploadFile\")}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tref={fileInputRef}\n\t\t\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\t\t\tonChange={handleImageUpload}\n\t\t\t\t\t\t\t\tclassName=\"sr-only\"\n\t\t\t\t\t\t\t\tdisabled={disabled || uploadingImage}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\tonClick={() => fileInputRef.current?.click()}\n\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t\t\t\t\tuploadingImage ||\n\t\t\t\t\t\t\t\t\t\t(!onImageUpload && !collection)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{uploadingImage\n\t\t\t\t\t\t\t\t\t\t? t(\"editor.uploading\")\n\t\t\t\t\t\t\t\t\t\t: t(\"editor.chooseFile\")}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t{showMediaLibrary && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => setIsPickerOpen(true)}\n\t\t\t\t\t\t\t\t\t\tdisabled={disabled || !collection}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{t(\"editor.browseLibrary\")}\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</PopoverContent>\n\t\t\t</Popover>\n\t\t\t{showMediaLibrary && (\n\t\t\t\t<MediaPickerDialog\n\t\t\t\t\topen={isPickerOpen}\n\t\t\t\t\tonOpenChange={setIsPickerOpen}\n\t\t\t\t\tmode=\"single\"\n\t\t\t\t\taccept={[\"image/*\"]}\n\t\t\t\t\tonSelect={handlePickerSelect}\n\t\t\t\t\tcollection={collection}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</>\n\t);\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { useResolveText } from "../../../i18n/hooks.mjs";
|
|
2
|
+
import { cn } from "../../../lib/utils.mjs";
|
|
3
|
+
import { LocaleBadge } from "../locale-badge.mjs";
|
|
4
|
+
import { Label } from "../../ui/label.mjs";
|
|
5
|
+
import { RichTextToolbar } from "./toolbar.mjs";
|
|
6
|
+
import { RichTextBubbleMenu } from "./bubble-menu.mjs";
|
|
7
|
+
import { buildExtensions } from "./extensions.mjs";
|
|
8
|
+
import { ImagePopover } from "./image-popover.mjs";
|
|
9
|
+
import { LinkPopover } from "./link-popover.mjs";
|
|
10
|
+
import { mergePresetFeatures } from "./presets.mjs";
|
|
11
|
+
import { defaultFeatures } from "./types.mjs";
|
|
12
|
+
import { getCharacterCount, getHeadingLevel, getOutput, isSameValue } from "./utils.mjs";
|
|
13
|
+
import * as React$1 from "react";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { EditorContent, useEditor } from "@tiptap/react";
|
|
16
|
+
|
|
17
|
+
//#region src/client/components/fields/rich-text-editor/index.tsx
|
|
18
|
+
/**
|
|
19
|
+
* RichTextEditor Component
|
|
20
|
+
*
|
|
21
|
+
* Tiptap-based rich text editor with modern icon-based toolbar.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Main RichText Editor Component
|
|
25
|
+
*/
|
|
26
|
+
function RichTextEditor({ name, value, onChange, disabled, readOnly, label, description, placeholder, required, error, localized, locale, extensions, preset, features, showCharacterCount, maxCharacters, enableImages, onImageUpload, imageCollection, enableMediaLibrary }) {
|
|
27
|
+
const resolveText = useResolveText();
|
|
28
|
+
const resolvedLabel = label ? resolveText(label) : void 0;
|
|
29
|
+
const resolvedDescription = description ? resolveText(description) : void 0;
|
|
30
|
+
const [linkOpen, setLinkOpen] = React$1.useState(false);
|
|
31
|
+
const [imageOpen, setImageOpen] = React$1.useState(false);
|
|
32
|
+
const lastEmittedValueRef = React$1.useRef(void 0);
|
|
33
|
+
const pendingValueRef = React$1.useRef(void 0);
|
|
34
|
+
const resolvedFeatures = React$1.useMemo(() => {
|
|
35
|
+
if (preset) return mergePresetFeatures(preset, features);
|
|
36
|
+
return {
|
|
37
|
+
...defaultFeatures,
|
|
38
|
+
...features
|
|
39
|
+
};
|
|
40
|
+
}, [preset, features]);
|
|
41
|
+
const allowImages = resolvedFeatures.image && (enableImages ?? true);
|
|
42
|
+
const allowLinks = resolvedFeatures.link;
|
|
43
|
+
resolvedFeatures.table;
|
|
44
|
+
const allowBubbleMenu = resolvedFeatures.bubbleMenu;
|
|
45
|
+
const allowToolbar = resolvedFeatures.toolbar;
|
|
46
|
+
const allowCharacterCount = resolvedFeatures.characterCount && (showCharacterCount || maxCharacters);
|
|
47
|
+
const editor = useEditor({
|
|
48
|
+
extensions: React$1.useMemo(() => buildExtensions({
|
|
49
|
+
features: resolvedFeatures,
|
|
50
|
+
placeholder,
|
|
51
|
+
maxCharacters,
|
|
52
|
+
customExtensions: extensions
|
|
53
|
+
}), [
|
|
54
|
+
resolvedFeatures,
|
|
55
|
+
placeholder,
|
|
56
|
+
maxCharacters,
|
|
57
|
+
extensions
|
|
58
|
+
]),
|
|
59
|
+
content: value ?? "",
|
|
60
|
+
editorProps: { attributes: { class: "qp-rich-text-editor__content" } },
|
|
61
|
+
editable: !disabled && !readOnly,
|
|
62
|
+
onUpdate: ({ editor: currentEditor }) => {
|
|
63
|
+
if (disabled || readOnly) return;
|
|
64
|
+
const nextValue = getOutput(currentEditor);
|
|
65
|
+
lastEmittedValueRef.current = nextValue;
|
|
66
|
+
onChange?.(nextValue);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const isEditable = !disabled && !readOnly;
|
|
70
|
+
const headingValue = getHeadingLevel(editor);
|
|
71
|
+
const inTable = editor?.isActive("table") ?? false;
|
|
72
|
+
React$1.useEffect(() => {
|
|
73
|
+
if (!editor) return;
|
|
74
|
+
editor.setEditable(isEditable);
|
|
75
|
+
}, [editor, isEditable]);
|
|
76
|
+
React$1.useEffect(() => {
|
|
77
|
+
if (!editor) {
|
|
78
|
+
if (value !== void 0 && !isSameValue(value, pendingValueRef.current)) pendingValueRef.current = value;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const valueToApply = pendingValueRef.current ?? value;
|
|
82
|
+
pendingValueRef.current = void 0;
|
|
83
|
+
if (valueToApply === void 0) return;
|
|
84
|
+
if (isSameValue(valueToApply, lastEmittedValueRef.current)) return;
|
|
85
|
+
lastEmittedValueRef.current = valueToApply;
|
|
86
|
+
editor.commands.setContent(valueToApply ?? "", false);
|
|
87
|
+
}, [editor, value]);
|
|
88
|
+
const characterCount = getCharacterCount(editor);
|
|
89
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
90
|
+
className: "space-y-2",
|
|
91
|
+
"data-disabled": disabled || readOnly,
|
|
92
|
+
children: [
|
|
93
|
+
resolvedLabel && /* @__PURE__ */ jsxs("div", {
|
|
94
|
+
className: "flex items-center gap-2",
|
|
95
|
+
children: [/* @__PURE__ */ jsxs(Label, {
|
|
96
|
+
htmlFor: name,
|
|
97
|
+
children: [resolvedLabel, required && /* @__PURE__ */ jsx("span", {
|
|
98
|
+
className: "text-destructive ml-1",
|
|
99
|
+
children: "*"
|
|
100
|
+
})]
|
|
101
|
+
}), localized && /* @__PURE__ */ jsx(LocaleBadge, { locale: locale || "i18n" })]
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ jsxs("div", {
|
|
104
|
+
className: cn("qp-rich-text-editor rounded-md border border-input/80 bg-input/20 backdrop-blur-sm", disabled || readOnly ? "opacity-60" : "", error ? "border-destructive" : "border-input"),
|
|
105
|
+
children: [
|
|
106
|
+
editor && allowToolbar && /* @__PURE__ */ jsx(RichTextToolbar, {
|
|
107
|
+
editor,
|
|
108
|
+
features: resolvedFeatures,
|
|
109
|
+
disabled: !isEditable,
|
|
110
|
+
headingValue,
|
|
111
|
+
onHeadingChange: (value$1) => {
|
|
112
|
+
if (!editor) return;
|
|
113
|
+
if (value$1 === "paragraph") {
|
|
114
|
+
editor.chain().focus().setParagraph().run();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
editor.chain().focus().toggleHeading({ level: Number(value$1) }).run();
|
|
118
|
+
},
|
|
119
|
+
onLinkClick: () => setLinkOpen(true),
|
|
120
|
+
onImageClick: () => setImageOpen(true),
|
|
121
|
+
onTableClick: () => {
|
|
122
|
+
if (!inTable) editor.chain().focus().insertTable({
|
|
123
|
+
rows: 3,
|
|
124
|
+
cols: 3,
|
|
125
|
+
withHeaderRow: true
|
|
126
|
+
}).run();
|
|
127
|
+
},
|
|
128
|
+
inTable
|
|
129
|
+
}),
|
|
130
|
+
editor && allowBubbleMenu && /* @__PURE__ */ jsx(RichTextBubbleMenu, {
|
|
131
|
+
editor,
|
|
132
|
+
features: resolvedFeatures,
|
|
133
|
+
disabled: !isEditable,
|
|
134
|
+
onLinkClick: () => setLinkOpen(true)
|
|
135
|
+
}),
|
|
136
|
+
editor ? /* @__PURE__ */ jsx(EditorContent, {
|
|
137
|
+
editor,
|
|
138
|
+
id: name
|
|
139
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
140
|
+
className: "flex min-h-[120px] items-center justify-center text-muted-foreground text-sm",
|
|
141
|
+
children: "Loading editor..."
|
|
142
|
+
}),
|
|
143
|
+
allowCharacterCount && showCharacterCount && /* @__PURE__ */ jsxs("div", {
|
|
144
|
+
className: "flex items-center justify-between border-t bg-muted/30 px-2 py-1 text-xs text-muted-foreground",
|
|
145
|
+
children: [/* @__PURE__ */ jsxs("span", { children: [
|
|
146
|
+
characterCount.words,
|
|
147
|
+
" word",
|
|
148
|
+
characterCount.words === 1 ? "" : "s"
|
|
149
|
+
] }), /* @__PURE__ */ jsxs("span", { children: [
|
|
150
|
+
characterCount.characters,
|
|
151
|
+
typeof maxCharacters === "number" ? ` / ${maxCharacters}` : "",
|
|
152
|
+
" ",
|
|
153
|
+
"characters"
|
|
154
|
+
] })]
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
}),
|
|
158
|
+
allowLinks && /* @__PURE__ */ jsx(LinkPopover, {
|
|
159
|
+
editor,
|
|
160
|
+
open: linkOpen,
|
|
161
|
+
onOpenChange: setLinkOpen,
|
|
162
|
+
disabled: !isEditable
|
|
163
|
+
}),
|
|
164
|
+
allowImages && /* @__PURE__ */ jsx(ImagePopover, {
|
|
165
|
+
editor,
|
|
166
|
+
open: imageOpen,
|
|
167
|
+
onOpenChange: setImageOpen,
|
|
168
|
+
disabled: !isEditable,
|
|
169
|
+
onImageUpload,
|
|
170
|
+
imageCollection,
|
|
171
|
+
enableMediaLibrary
|
|
172
|
+
}),
|
|
173
|
+
resolvedDescription && /* @__PURE__ */ jsx("p", {
|
|
174
|
+
className: "text-muted-foreground text-xs",
|
|
175
|
+
children: resolvedDescription
|
|
176
|
+
}),
|
|
177
|
+
error && /* @__PURE__ */ jsx("p", {
|
|
178
|
+
className: "text-destructive text-xs",
|
|
179
|
+
children: error
|
|
180
|
+
})
|
|
181
|
+
]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
export { RichTextEditor };
|
|
187
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["React","value"],"sources":["../../../../../src/client/components/fields/rich-text-editor/index.tsx"],"sourcesContent":["/**\n * RichTextEditor Component\n *\n * Tiptap-based rich text editor with modern icon-based toolbar.\n */\n\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport * as React from \"react\";\n\nimport { useResolveText } from \"../../../i18n/hooks\";\nimport { cn } from \"../../../utils\";\nimport { Label } from \"../../ui/label\";\nimport { LocaleBadge } from \"../locale-badge\";\nimport { RichTextBubbleMenu } from \"./bubble-menu\";\nimport { buildExtensions } from \"./extensions\";\nimport { ImagePopover } from \"./image-popover\";\nimport { LinkPopover } from \"./link-popover\";\nimport { mergePresetFeatures } from \"./presets\";\nimport { RichTextToolbar } from \"./toolbar\";\nimport {\n\tdefaultFeatures,\n\ttype OutputValue,\n\ttype RichTextEditorProps,\n} from \"./types\";\nimport {\n\tgetCharacterCount,\n\tgetHeadingLevel,\n\tgetOutput,\n\tisSameValue,\n} from \"./utils\";\n\nexport type { RichTextPreset } from \"./presets\";\n// Re-export types\nexport type { RichTextEditorProps, RichTextFeatures } from \"./types\";\n\n// Re-export variant components\nexport {\n\tRichTextAdvanced,\n\tRichTextMinimal,\n\tRichTextSimple,\n\tRichTextStandard,\n} from \"./variants\";\n\n/**\n * Main RichText Editor Component\n */\nexport function RichTextEditor({\n\tname,\n\tvalue,\n\tonChange,\n\tdisabled,\n\treadOnly,\n\tlabel,\n\tdescription,\n\tplaceholder,\n\trequired,\n\terror,\n\tlocalized,\n\tlocale,\n\textensions,\n\tpreset,\n\tfeatures,\n\tshowCharacterCount,\n\tmaxCharacters,\n\tenableImages,\n\tonImageUpload,\n\timageCollection,\n\tenableMediaLibrary,\n}: RichTextEditorProps) {\n\tconst resolveText = useResolveText();\n\tconst resolvedLabel = label ? resolveText(label) : undefined;\n\tconst resolvedDescription = description\n\t\t? resolveText(description)\n\t\t: undefined;\n\n\t// Popover states\n\tconst [linkOpen, setLinkOpen] = React.useState(false);\n\tconst [imageOpen, setImageOpen] = React.useState(false);\n\tconst lastEmittedValueRef = React.useRef<OutputValue | undefined>(undefined);\n\t// Track pending value when editor is not ready yet (race condition fix)\n\tconst pendingValueRef = React.useRef<OutputValue | undefined>(undefined);\n\n\t// Resolved feature flags with preset support\n\tconst resolvedFeatures = React.useMemo(() => {\n\t\t// If preset is specified, merge with features\n\t\tif (preset) {\n\t\t\treturn mergePresetFeatures(preset, features);\n\t\t}\n\t\t// Otherwise use default features + overrides\n\t\treturn {\n\t\t\t...defaultFeatures,\n\t\t\t...features,\n\t\t};\n\t}, [preset, features]);\n\n\tconst allowImages = resolvedFeatures.image && (enableImages ?? true);\n\tconst allowLinks = resolvedFeatures.link;\n\tconst allowTables = resolvedFeatures.table;\n\tconst allowBubbleMenu = resolvedFeatures.bubbleMenu;\n\tconst allowToolbar = resolvedFeatures.toolbar;\n\tconst allowCharacterCount =\n\t\tresolvedFeatures.characterCount && (showCharacterCount || maxCharacters);\n\n\t// Build Tiptap extensions\n\tconst resolvedExtensions = React.useMemo(\n\t\t() =>\n\t\t\tbuildExtensions({\n\t\t\t\tfeatures: resolvedFeatures,\n\t\t\t\tplaceholder,\n\t\t\t\tmaxCharacters,\n\t\t\t\tcustomExtensions: extensions,\n\t\t\t}),\n\t\t[resolvedFeatures, placeholder, maxCharacters, extensions],\n\t);\n\n\t// Initialize editor\n\tconst editor = useEditor({\n\t\textensions: resolvedExtensions,\n\t\tcontent: value ?? \"\",\n\t\teditorProps: {\n\t\t\tattributes: {\n\t\t\t\tclass: \"qp-rich-text-editor__content\",\n\t\t\t},\n\t\t},\n\t\teditable: !disabled && !readOnly,\n\t\tonUpdate: ({ editor: currentEditor }) => {\n\t\t\tif (disabled || readOnly) return;\n\t\t\tconst nextValue = getOutput(currentEditor);\n\t\t\tlastEmittedValueRef.current = nextValue as OutputValue;\n\t\t\tonChange?.(nextValue);\n\t\t},\n\t});\n\n\tconst isEditable = !disabled && !readOnly;\n\tconst headingValue = getHeadingLevel(editor);\n\tconst inTable = editor?.isActive(\"table\") ?? false;\n\n\t// Update editor editable state\n\tReact.useEffect(() => {\n\t\tif (!editor) return;\n\t\teditor.setEditable(isEditable);\n\t}, [editor, isEditable]);\n\n\t// Sync external value changes with pending value handling\n\t// This fixes race condition where value arrives before editor is ready\n\tReact.useEffect(() => {\n\t\t// If value changed but editor not ready, store as pending\n\t\tif (!editor) {\n\t\t\tif (value !== undefined && !isSameValue(value, pendingValueRef.current)) {\n\t\t\t\tpendingValueRef.current = value as OutputValue;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Editor is ready - apply pending value first, then current value\n\t\tconst valueToApply = pendingValueRef.current ?? value;\n\t\tpendingValueRef.current = undefined; // Clear pending after use\n\n\t\tif (valueToApply === undefined) return;\n\t\tif (isSameValue(valueToApply, lastEmittedValueRef.current)) return;\n\n\t\tlastEmittedValueRef.current = valueToApply as OutputValue;\n\t\teditor.commands.setContent(valueToApply ?? \"\", false);\n\t}, [editor, value]);\n\n\t// Character count\n\tconst characterCount = getCharacterCount(editor);\n\n\treturn (\n\t\t<div className=\"space-y-2\" data-disabled={disabled || readOnly}>\n\t\t\t{resolvedLabel && (\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<Label htmlFor={name}>\n\t\t\t\t\t\t{resolvedLabel}\n\t\t\t\t\t\t{required && <span className=\"text-destructive ml-1\">*</span>}\n\t\t\t\t\t</Label>\n\t\t\t\t\t{localized && <LocaleBadge locale={locale || \"i18n\"} />}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"qp-rich-text-editor rounded-md border border-input/80 bg-input/20 backdrop-blur-sm\",\n\t\t\t\t\tdisabled || readOnly ? \"opacity-60\" : \"\",\n\t\t\t\t\terror ? \"border-destructive\" : \"border-input\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{/* Toolbar */}\n\t\t\t\t{editor && allowToolbar && (\n\t\t\t\t\t<RichTextToolbar\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\tfeatures={resolvedFeatures}\n\t\t\t\t\t\tdisabled={!isEditable}\n\t\t\t\t\t\theadingValue={headingValue}\n\t\t\t\t\t\tonHeadingChange={(value) => {\n\t\t\t\t\t\t\tif (!editor) return;\n\t\t\t\t\t\t\tif (value === \"paragraph\") {\n\t\t\t\t\t\t\t\teditor.chain().focus().setParagraph().run();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t\t.toggleHeading({\n\t\t\t\t\t\t\t\t\tlevel: Number(value) as 1 | 2 | 3 | 4 | 5 | 6,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.run();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonLinkClick={() => setLinkOpen(true)}\n\t\t\t\t\t\tonImageClick={() => setImageOpen(true)}\n\t\t\t\t\t\tonTableClick={() => {\n\t\t\t\t\t\t\t// Insert table directly when clicking toolbar button\n\t\t\t\t\t\t\tif (!inTable) {\n\t\t\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t\t\t.insertTable({\n\t\t\t\t\t\t\t\t\t\trows: 3,\n\t\t\t\t\t\t\t\t\t\tcols: 3,\n\t\t\t\t\t\t\t\t\t\twithHeaderRow: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.run();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tinTable={inTable}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{/* Bubble Menu */}\n\t\t\t\t{editor && allowBubbleMenu && (\n\t\t\t\t\t<RichTextBubbleMenu\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\tfeatures={resolvedFeatures}\n\t\t\t\t\t\tdisabled={!isEditable}\n\t\t\t\t\t\tonLinkClick={() => setLinkOpen(true)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{/* Editor Content */}\n\t\t\t\t{editor ? (\n\t\t\t\t\t<EditorContent editor={editor} id={name} />\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"flex min-h-[120px] items-center justify-center text-muted-foreground text-sm\">\n\t\t\t\t\t\tLoading editor...\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t{/* Character Count */}\n\t\t\t\t{allowCharacterCount && showCharacterCount && (\n\t\t\t\t\t<div className=\"flex items-center justify-between border-t bg-muted/30 px-2 py-1 text-xs text-muted-foreground\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{characterCount.words} word{characterCount.words === 1 ? \"\" : \"s\"}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{characterCount.characters}\n\t\t\t\t\t\t\t{typeof maxCharacters === \"number\" ? ` / ${maxCharacters}` : \"\"}{\" \"}\n\t\t\t\t\t\t\tcharacters\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{/* Link Popover */}\n\t\t\t{allowLinks && (\n\t\t\t\t<LinkPopover\n\t\t\t\t\teditor={editor}\n\t\t\t\t\topen={linkOpen}\n\t\t\t\t\tonOpenChange={setLinkOpen}\n\t\t\t\t\tdisabled={!isEditable}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{/* Image Popover */}\n\t\t\t{allowImages && (\n\t\t\t\t<ImagePopover\n\t\t\t\t\teditor={editor}\n\t\t\t\t\topen={imageOpen}\n\t\t\t\t\tonOpenChange={setImageOpen}\n\t\t\t\t\tdisabled={!isEditable}\n\t\t\t\t\tonImageUpload={onImageUpload}\n\t\t\t\t\timageCollection={imageCollection}\n\t\t\t\t\tenableMediaLibrary={enableMediaLibrary}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{/* Description & Error */}\n\t\t\t{resolvedDescription && (\n\t\t\t\t<p className=\"text-muted-foreground text-xs\">{resolvedDescription}</p>\n\t\t\t)}\n\t\t\t{error && <p className=\"text-destructive text-xs\">{error}</p>}\n\t\t</div>\n\t);\n}\n"],"mappings":"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"}
|