@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":"rich-text-renderer.mjs","names":["defaultStyles: RichTextStyles","textNode: ReactNode"],"sources":["../../../src/components/rich-text/rich-text-renderer.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { cn } from \"#questpie/admin/client/lib/utils\";\n\n/**\n * TipTap JSON node types\n */\nexport type TipTapNode = {\n\ttype: string;\n\tcontent?: TipTapNode[];\n\ttext?: string;\n\tmarks?: Array<{ type: string; attrs?: Record<string, any> }>;\n\tattrs?: Record<string, any>;\n};\n\nexport type TipTapDoc = {\n\ttype: \"doc\";\n\tcontent?: TipTapNode[];\n};\n\n/**\n * Style configuration for rich text elements\n */\nexport interface RichTextStyles {\n\tdoc?: string;\n\tparagraph?: string;\n\theading1?: string;\n\theading2?: string;\n\theading3?: string;\n\theading4?: string;\n\theading5?: string;\n\theading6?: string;\n\tblockquote?: string;\n\tcodeBlock?: string;\n\tbulletList?: string;\n\torderedList?: string;\n\tlistItem?: string;\n\tlink?: string;\n\timage?: string;\n\ttableWrapper?: string;\n\ttable?: string;\n\ttableRow?: string;\n\ttableCell?: string;\n\ttableHeader?: string;\n\thorizontalRule?: string;\n\tbold?: string;\n\titalic?: string;\n\tcode?: string;\n\tstrike?: string;\n\tunderline?: string;\n}\n\nconst defaultStyles: RichTextStyles = {\n\tdoc: \"prose prose-sm max-w-none\",\n\tparagraph: \"mb-4 last:mb-0\",\n\theading1: \"text-3xl font-bold mb-4\",\n\theading2: \"text-2xl font-bold mb-3\",\n\theading3: \"text-xl font-semibold mb-3\",\n\theading4: \"text-lg font-semibold mb-2\",\n\theading5: \"text-base font-semibold mb-2\",\n\theading6: \"text-sm font-semibold mb-2\",\n\tblockquote: \"border-l-4 border-gray-300 pl-4 italic my-4\",\n\tcodeBlock: \"bg-muted rounded p-4 font-mono text-sm my-4 overflow-x-auto\",\n\tbulletList: \"list-disc list-inside mb-4\",\n\torderedList: \"list-decimal list-inside mb-4\",\n\tlistItem: \"mb-1\",\n\tlink: \"text-primary hover:text-primary/80 underline\",\n\timage: \"my-4 rounded-lg\",\n\ttableWrapper: \"my-4 overflow-x-auto\",\n\ttable: \"w-full border-collapse\",\n\ttableRow: \"border-b\",\n\ttableCell: \"border border-border px-3 py-2 align-top\",\n\ttableHeader: \"border border-border px-3 py-2 text-left font-semibold\",\n\thorizontalRule: \"my-4 border-t border-border\",\n\tbold: \"font-bold\",\n\titalic: \"italic\",\n\tcode: \"bg-muted rounded px-1 py-0.5 font-mono text-sm\",\n\tstrike: \"line-through\",\n\tunderline: \"underline\",\n};\n\ninterface RichTextRendererProps {\n\t/**\n\t * TipTap JSON content to render\n\t */\n\tcontent: TipTapDoc | null | undefined;\n\t/**\n\t * Custom styles for elements\n\t */\n\tstyles?: Partial<RichTextStyles>;\n\t/**\n\t * Additional className for the root element\n\t */\n\tclassName?: string;\n}\n\n/**\n * Renders a single TipTap node\n */\nfunction renderNode(\n\tnode: TipTapNode,\n\tindex: number,\n\tstyles: RichTextStyles,\n): ReactNode {\n\t// Text node\n\tif (node.text !== undefined) {\n\t\tlet textNode: ReactNode = node.text;\n\n\t\t// Apply marks (bold, italic, etc.)\n\t\tif (node.marks) {\n\t\t\tfor (const mark of node.marks) {\n\t\t\t\tswitch (mark.type) {\n\t\t\t\t\tcase \"bold\":\n\t\t\t\t\t\ttextNode = (\n\t\t\t\t\t\t\t<strong key={index} className={styles.bold}>\n\t\t\t\t\t\t\t\t{textNode}\n\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"italic\":\n\t\t\t\t\t\ttextNode = (\n\t\t\t\t\t\t\t<em key={index} className={styles.italic}>\n\t\t\t\t\t\t\t\t{textNode}\n\t\t\t\t\t\t\t</em>\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"code\":\n\t\t\t\t\t\ttextNode = (\n\t\t\t\t\t\t\t<code key={index} className={styles.code}>\n\t\t\t\t\t\t\t\t{textNode}\n\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"strike\":\n\t\t\t\t\t\ttextNode = (\n\t\t\t\t\t\t\t<s key={index} className={styles.strike}>\n\t\t\t\t\t\t\t\t{textNode}\n\t\t\t\t\t\t\t</s>\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"underline\":\n\t\t\t\t\t\ttextNode = (\n\t\t\t\t\t\t\t<u key={index} className={styles.underline}>\n\t\t\t\t\t\t\t\t{textNode}\n\t\t\t\t\t\t\t</u>\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"link\": {\n\t\t\t\t\t\tconst href = mark.attrs?.href as string | undefined;\n\t\t\t\t\t\tconst target = mark.attrs?.target as string | undefined;\n\t\t\t\t\t\tconst rel =\n\t\t\t\t\t\t\t(mark.attrs?.rel as string | undefined) ||\n\t\t\t\t\t\t\t(target === \"_blank\" ? \"noopener noreferrer\" : undefined);\n\t\t\t\t\t\ttextNode = (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\thref={href}\n\t\t\t\t\t\t\t\ttarget={target}\n\t\t\t\t\t\t\t\trel={rel}\n\t\t\t\t\t\t\t\tclassName={styles.link}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{textNode}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn textNode;\n\t}\n\n\t// Block nodes\n\tconst children = node.content?.map((child, i) =>\n\t\trenderNode(child, i, styles),\n\t);\n\n\tswitch (node.type) {\n\t\tcase \"doc\":\n\t\t\treturn <div key={index}>{children}</div>;\n\n\t\tcase \"paragraph\": {\n\t\t\tconst paragraphAlign = node.attrs?.textAlign as\n\t\t\t\t| \"left\"\n\t\t\t\t| \"center\"\n\t\t\t\t| \"right\"\n\t\t\t\t| \"justify\"\n\t\t\t\t| undefined;\n\t\t\treturn (\n\t\t\t\t<p\n\t\t\t\t\tkey={index}\n\t\t\t\t\tclassName={styles.paragraph}\n\t\t\t\t\tstyle={paragraphAlign ? { textAlign: paragraphAlign } : undefined}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</p>\n\t\t\t);\n\t\t}\n\n\t\tcase \"heading\": {\n\t\t\tconst level = Math.min(\n\t\t\t\t6,\n\t\t\t\tMath.max(1, (node.attrs?.level as number) || 1),\n\t\t\t);\n\t\t\tconst headingAlign = node.attrs?.textAlign as\n\t\t\t\t| \"left\"\n\t\t\t\t| \"center\"\n\t\t\t\t| \"right\"\n\t\t\t\t| \"justify\"\n\t\t\t\t| undefined;\n\t\t\tconst headingClass =\n\t\t\t\tstyles[`heading${level}` as keyof RichTextStyles] || styles.heading1;\n\t\t\ttype HeadingTagName = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\t\t\tconst HeadingTag = `h${level}` as HeadingTagName;\n\t\t\treturn (\n\t\t\t\t<HeadingTag\n\t\t\t\t\tkey={index}\n\t\t\t\t\tclassName={headingClass}\n\t\t\t\t\tstyle={headingAlign ? { textAlign: headingAlign } : undefined}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</HeadingTag>\n\t\t\t);\n\t\t}\n\n\t\tcase \"blockquote\":\n\t\t\treturn (\n\t\t\t\t<blockquote key={index} className={styles.blockquote}>\n\t\t\t\t\t{children}\n\t\t\t\t</blockquote>\n\t\t\t);\n\n\t\tcase \"codeBlock\":\n\t\t\treturn (\n\t\t\t\t<pre key={index} className={styles.codeBlock}>\n\t\t\t\t\t<code>{children}</code>\n\t\t\t\t</pre>\n\t\t\t);\n\n\t\tcase \"bulletList\":\n\t\t\treturn (\n\t\t\t\t<ul key={index} className={styles.bulletList}>\n\t\t\t\t\t{children}\n\t\t\t\t</ul>\n\t\t\t);\n\n\t\tcase \"orderedList\":\n\t\t\treturn (\n\t\t\t\t<ol key={index} className={styles.orderedList}>\n\t\t\t\t\t{children}\n\t\t\t\t</ol>\n\t\t\t);\n\n\t\tcase \"listItem\":\n\t\t\treturn (\n\t\t\t\t<li key={index} className={styles.listItem}>\n\t\t\t\t\t{children}\n\t\t\t\t</li>\n\t\t\t);\n\n\t\tcase \"hardBreak\":\n\t\t\treturn <br key={index} />;\n\n\t\tcase \"horizontalRule\":\n\t\t\treturn <hr key={index} className={styles.horizontalRule} />;\n\n\t\tcase \"image\": {\n\t\t\tconst src = node.attrs?.src as string | undefined;\n\t\t\tif (!src) return null;\n\t\t\treturn (\n\t\t\t\t<img\n\t\t\t\t\tkey={index}\n\t\t\t\t\tsrc={src}\n\t\t\t\t\talt={(node.attrs?.alt as string | undefined) || \"\"}\n\t\t\t\t\ttitle={node.attrs?.title as string | undefined}\n\t\t\t\t\tclassName={styles.image}\n\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tcase \"table\":\n\t\t\treturn (\n\t\t\t\t<div key={index} className={styles.tableWrapper}>\n\t\t\t\t\t<table className={styles.table}>\n\t\t\t\t\t\t<tbody>{children}</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t);\n\n\t\tcase \"tableRow\":\n\t\t\treturn (\n\t\t\t\t<tr key={index} className={styles.tableRow}>\n\t\t\t\t\t{children}\n\t\t\t\t</tr>\n\t\t\t);\n\n\t\tcase \"tableCell\":\n\t\t\treturn (\n\t\t\t\t<td\n\t\t\t\t\tkey={index}\n\t\t\t\t\tclassName={styles.tableCell}\n\t\t\t\t\tcolSpan={node.attrs?.colspan as number | undefined}\n\t\t\t\t\trowSpan={node.attrs?.rowspan as number | undefined}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</td>\n\t\t\t);\n\n\t\tcase \"tableHeader\":\n\t\t\treturn (\n\t\t\t\t<th\n\t\t\t\t\tkey={index}\n\t\t\t\t\tclassName={styles.tableHeader}\n\t\t\t\t\tcolSpan={node.attrs?.colspan as number | undefined}\n\t\t\t\t\trowSpan={node.attrs?.rowspan as number | undefined}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</th>\n\t\t\t);\n\n\t\tdefault:\n\t\t\t// Unknown node type - render children if available\n\t\t\treturn children ? <div key={index}>{children}</div> : null;\n\t}\n}\n\n/**\n * RichTextRenderer Component\n *\n * Renders TipTap JSON content with customizable styles.\n *\n * @example\n * ```tsx\n * const content = {\n * type: \"doc\",\n * content: [\n * {\n * type: \"paragraph\",\n * content: [{ type: \"text\", text: \"Hello world\" }]\n * }\n * ]\n * };\n *\n * <RichTextRenderer content={content} />\n * ```\n *\n * @example With custom styles\n * ```tsx\n * <RichTextRenderer\n * content={content}\n * styles={{\n * paragraph: \"text-lg leading-relaxed\",\n * heading1: \"text-4xl font-black\"\n * }}\n * />\n * ```\n */\nexport function RichTextRenderer({\n\tcontent,\n\tstyles: customStyles,\n\tclassName,\n}: RichTextRendererProps) {\n\tif (!content || !content.content || content.content.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst styles = { ...defaultStyles, ...customStyles };\n\n\treturn (\n\t\t<div className={cn(styles.doc, className)}>\n\t\t\t{content.content.map((node, i) => renderNode(node, i, styles))}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;AAoDA,MAAMA,gBAAgC;CACrC,KAAK;CACL,WAAW;CACX,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,aAAa;CACb,UAAU;CACV,MAAM;CACN,OAAO;CACP,cAAc;CACd,OAAO;CACP,UAAU;CACV,WAAW;CACX,aAAa;CACb,gBAAgB;CAChB,MAAM;CACN,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,WAAW;CACX;;;;AAoBD,SAAS,WACR,MACA,OACA,QACY;AAEZ,KAAI,KAAK,SAAS,QAAW;EAC5B,IAAIC,WAAsB,KAAK;AAG/B,MAAI,KAAK,MACR,MAAK,MAAM,QAAQ,KAAK,MACvB,SAAQ,KAAK,MAAb;GACC,KAAK;AACJ,eACC,oBAAC;KAAmB,WAAW,OAAO;eACpC;OADW,MAEJ;AAEV;GACD,KAAK;AACJ,eACC,oBAAC;KAAe,WAAW,OAAO;eAChC;OADO,MAEJ;AAEN;GACD,KAAK;AACJ,eACC,oBAAC;KAAiB,WAAW,OAAO;eAClC;OADS,MAEJ;AAER;GACD,KAAK;AACJ,eACC,oBAAC;KAAc,WAAW,OAAO;eAC/B;OADM,MAEJ;AAEL;GACD,KAAK;AACJ,eACC,oBAAC;KAAc,WAAW,OAAO;eAC/B;OADM,MAEJ;AAEL;GACD,KAAK,QAAQ;IACZ,MAAM,OAAO,KAAK,OAAO;IACzB,MAAM,SAAS,KAAK,OAAO;AAI3B,eACC,oBAAC;KAEM;KACE;KACR,KAPA,KAAK,OAAO,QACZ,WAAW,WAAW,wBAAwB;KAO9C,WAAW,OAAO;eAEjB;OANI,MAOF;AAEL;;;AAMJ,SAAO;;CAIR,MAAM,WAAW,KAAK,SAAS,KAAK,OAAO,MAC1C,WAAW,OAAO,GAAG,OAAO,CAC5B;AAED,SAAQ,KAAK,MAAb;EACC,KAAK,MACJ,QAAO,oBAAC,SAAiB,YAAR,MAAuB;EAEzC,KAAK,aAAa;GACjB,MAAM,iBAAiB,KAAK,OAAO;AAMnC,UACC,oBAAC;IAEA,WAAW,OAAO;IAClB,OAAO,iBAAiB,EAAE,WAAW,gBAAgB,GAAG;IAEvD;MAJI,MAKF;;EAIN,KAAK,WAAW;GACf,MAAM,QAAQ,KAAK,IAClB,GACA,KAAK,IAAI,GAAI,KAAK,OAAO,SAAoB,EAAE,CAC/C;GACD,MAAM,eAAe,KAAK,OAAO;GAMjC,MAAM,eACL,OAAO,UAAU,YAAoC,OAAO;AAG7D,UACC,oBAFkB,IAAI;IAIrB,WAAW;IACX,OAAO,eAAe,EAAE,WAAW,cAAc,GAAG;IAEnD;MAJI,MAKO;;EAIf,KAAK,aACJ,QACC,oBAAC;GAAuB,WAAW,OAAO;GACxC;KADe,MAEJ;EAGf,KAAK,YACJ,QACC,oBAAC;GAAgB,WAAW,OAAO;aAClC,oBAAC,UAAM,WAAgB;KADd,MAEJ;EAGR,KAAK,aACJ,QACC,oBAAC;GAAe,WAAW,OAAO;GAChC;KADO,MAEJ;EAGP,KAAK,cACJ,QACC,oBAAC;GAAe,WAAW,OAAO;GAChC;KADO,MAEJ;EAGP,KAAK,WACJ,QACC,oBAAC;GAAe,WAAW,OAAO;GAChC;KADO,MAEJ;EAGP,KAAK,YACJ,QAAO,oBAAC,UAAQ,MAAS;EAE1B,KAAK,iBACJ,QAAO,oBAAC,QAAe,WAAW,OAAO,kBAAzB,MAA2C;EAE5D,KAAK,SAAS;GACb,MAAM,MAAM,KAAK,OAAO;AACxB,OAAI,CAAC,IAAK,QAAO;AACjB,UACC,oBAAC;IAEK;IACL,KAAM,KAAK,OAAO,OAA8B;IAChD,OAAO,KAAK,OAAO;IACnB,WAAW,OAAO;IAClB,SAAQ;MALH,MAMJ;;EAIJ,KAAK,QACJ,QACC,oBAAC;GAAgB,WAAW,OAAO;aAClC,oBAAC;IAAM,WAAW,OAAO;cACxB,oBAAC,WAAO,WAAiB;KAClB;KAHC,MAIJ;EAGR,KAAK,WACJ,QACC,oBAAC;GAAe,WAAW,OAAO;GAChC;KADO,MAEJ;EAGP,KAAK,YACJ,QACC,oBAAC;GAEA,WAAW,OAAO;GAClB,SAAS,KAAK,OAAO;GACrB,SAAS,KAAK,OAAO;GAEpB;KALI,MAMD;EAGP,KAAK,cACJ,QACC,oBAAC;GAEA,WAAW,OAAO;GAClB,SAAS,KAAK,OAAO;GACrB,SAAS,KAAK,OAAO;GAEpB;KALI,MAMD;EAGP,QAEC,QAAO,WAAW,oBAAC,SAAiB,YAAR,MAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCzD,SAAgB,iBAAiB,EAChC,SACA,QAAQ,cACR,aACyB;AACzB,KAAI,CAAC,WAAW,CAAC,QAAQ,WAAW,QAAQ,QAAQ,WAAW,EAC9D,QAAO;CAGR,MAAM,SAAS;EAAE,GAAG;EAAe,GAAG;EAAc;AAEpD,QACC,oBAAC;EAAI,WAAW,GAAG,OAAO,KAAK,UAAU;YACvC,QAAQ,QAAQ,KAAK,MAAM,MAAM,WAAW,MAAM,GAAG,OAAO,CAAC;GACzD"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
|
|
1
|
+
import { I18nContext, I18nText } from "./client/i18n/types.mjs";
|
|
2
|
+
import { BaseFieldProps, IconComponent, MaybeLazyComponent } from "./client/builder/types/common.mjs";
|
|
3
|
+
import { ComponentRegistry, FieldComponentProps, FormViewConfig } from "./client/builder/types/field-types.mjs";
|
|
4
|
+
import { FieldBuilder, FieldBuilderState, FieldDefinition, field } from "./client/builder/field/field.mjs";
|
|
5
|
+
import { AnyWidgetConfig, BaseWidgetConfig, ChartWidgetConfig, CustomWidgetConfig, ProgressWidgetConfig, QuickActionsWidgetConfig, RecentItemsWidgetConfig, StatsWidgetConfig, TableWidgetConfig, TimelineWidgetConfig, ValueWidgetConfig, WidgetComponentProps, WidgetConfig } from "./client/builder/types/widget-types.mjs";
|
|
6
|
+
import { EditViewBuilder, EditViewBuilderState, EditViewDefinition, ListViewBuilder, ListViewBuilderState, ListViewDefinition, editView, listView } from "./client/builder/view/view.mjs";
|
|
7
|
+
import { WidgetBuilder, WidgetBuilderState, WidgetDefinition, widget } from "./client/builder/widget/widget.mjs";
|
|
8
|
+
import { AdminTypeRegistry, IsRegistered, RegisteredAdmin, RegisteredCMS, RegisteredCollectionNames, RegisteredGlobalNames } from "./client/builder/registry.mjs";
|
|
9
|
+
import { Admin, AppAdmin, InferAdminCMS } from "./client/builder/admin.mjs";
|
|
10
|
+
import { qa } from "./client/builder/qa.mjs";
|
|
11
|
+
import { AuthLayout } from "./client/views/auth/auth-layout.mjs";
|
|
12
|
+
import { LoginForm } from "./client/views/auth/login-form.mjs";
|
|
13
|
+
import { ForgotPasswordForm } from "./client/views/auth/forgot-password-form.mjs";
|
|
14
|
+
import { ResetPasswordForm } from "./client/views/auth/reset-password-form.mjs";
|
|
15
|
+
import { AcceptInviteForm } from "./client/views/auth/accept-invite-form.mjs";
|
|
16
|
+
import { SetupForm, SetupFormValues } from "./client/views/auth/setup-form.mjs";
|
|
17
|
+
import { AdminLayout } from "./client/views/layout/admin-layout.mjs";
|
|
18
|
+
import { AdminLayoutProvider } from "./client/views/layout/admin-layout-provider.mjs";
|
|
19
|
+
import { AdminProvider, AdminProviderProps, AdminState, AdminStore, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore } from "./client/runtime/provider.mjs";
|
|
20
|
+
import { AdminRouter, AdminRouterProps } from "./client/views/layout/admin-router.mjs";
|
|
21
|
+
import { DashboardPage } from "./client/views/pages/dashboard-page.mjs";
|
|
22
|
+
import { LoginPage } from "./client/views/pages/login-page.mjs";
|
|
23
|
+
import { ForgotPasswordPage } from "./client/views/pages/forgot-password-page.mjs";
|
|
24
|
+
import { ResetPasswordPage } from "./client/views/pages/reset-password-page.mjs";
|
|
25
|
+
import { InvitePage } from "./client/views/pages/invite-page.mjs";
|
|
26
|
+
import { AcceptInvitePage } from "./client/views/pages/accept-invite-page.mjs";
|
|
27
|
+
import { SetupPage, SetupPageProps } from "./client/views/pages/setup-page.mjs";
|
|
28
|
+
import { AdminLink } from "./client/components/admin-link.mjs";
|
|
29
|
+
import { AuthGuard } from "./client/components/auth/auth-guard.mjs";
|
|
30
|
+
import { AuthLoading } from "./client/components/auth/auth-loading.mjs";
|
|
31
|
+
import { Badge, BadgeProps, ComponentRenderer, ComponentRendererProps, ComponentRendererRegistry, IconifyIcon, IconifyIconProps, createIconRenderer, isComponentReference, resolveIconElement } from "./client/components/component-renderer.mjs";
|
|
32
|
+
import { CoreAdminModule, coreAdminModule } from "./client/builder/defaults/core.mjs";
|
|
33
|
+
import { AdminModule, adminModule } from "./client/builder/defaults/starter.mjs";
|
|
34
|
+
import { TypedHooks, createTypedHooks } from "./client/hooks/typed-hooks.mjs";
|
|
35
|
+
import { createAdminAuthClient, useAuthClient } from "./client/hooks/use-auth.mjs";
|
|
36
|
+
import { useShallow } from "./client/runtime/index.mjs";
|
|
37
|
+
import { AllBlockData, AllBlockValues, BlockComponentProps, BlockPrefetchData, BlockRegistry, BlockRendererComponent, BlockRendererDefinition, BlockRendererProps as BlockRendererProps$2, BlockValues, ExtractBlockFieldValues, ExtractBlockPrefetchData, ExtractServerBlocks, ServerBlockNames, createBlockRegistry } from "./client/blocks/block-registry.mjs";
|
|
38
|
+
import { BlockCategory, BlockContent, BlockNode, BlockRendererProps as BlockRendererProps$1, EMPTY_BLOCK_CONTENT, isBlockContent } from "./client/blocks/types.mjs";
|
|
39
|
+
import { BlockRenderer, BlockRendererProps } from "./client/blocks/block-renderer.mjs";
|
|
40
|
+
import { BlockPrefetchContext, BlockPrefetchError, BlockPrefetchParams, BlockPrefetchResult, TypedBlockPrefetch, prefetchBlockData } from "./client/blocks/prefetch.mjs";
|
|
41
|
+
import { RichTextRenderer, RichTextStyles, TipTapDoc, TipTapNode } from "./components/rich-text/rich-text-renderer.mjs";
|
|
42
|
+
import { PreviewField, PreviewFieldProps, PreviewProvider, StandalonePreviewField, usePreviewContext } from "./client/preview/preview-field.mjs";
|
|
43
|
+
import { PreviewBanner, PreviewBannerProps } from "./client/preview/preview-banner.mjs";
|
|
44
|
+
import { BlockScopeContextValue, BlockScopeProvider, BlockScopeProviderProps, useBlockScope, useResolveFieldPath } from "./client/preview/block-scope-context.mjs";
|
|
45
|
+
import { AdminToPreviewMessage, BlockClickedMessage, FieldClickedMessage, FocusFieldMessage, PreviewConfig, PreviewReadyMessage, PreviewRefreshMessage, PreviewToAdminMessage, RefreshCompleteMessage, SelectBlockMessage, isAdminToPreviewMessage, isPreviewToAdminMessage } from "./client/preview/types.mjs";
|
|
46
|
+
import { UseCollectionPreviewOptions, UseCollectionPreviewResult, useCollectionPreview } from "./client/preview/use-collection-preview.mjs";
|
|
47
|
+
import { useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionUpdate } from "./client/hooks/use-collection.mjs";
|
|
48
|
+
import { useCurrentUser } from "./client/hooks/use-current-user.mjs";
|
|
49
|
+
import { OptionItem, UseFieldOptionsOptions, UseFieldOptionsResult, useFieldOptions } from "./client/hooks/use-field-options.mjs";
|
|
50
|
+
import { useGlobal, useGlobalUpdate } from "./client/hooks/use-global.mjs";
|
|
51
|
+
import { useIsDesktop, useIsMobile, useMediaQuery } from "./client/hooks/use-media-query.mjs";
|
|
52
|
+
import { ReactiveFieldResult, ReactiveFieldState, UseReactiveFieldsOptions, UseReactiveFieldsResult, useReactiveFields } from "./client/hooks/use-reactive-fields.mjs";
|
|
53
|
+
import { useServerWidgetData } from "./client/hooks/use-server-widget-data.mjs";
|
|
54
|
+
import { SetupStatus, useSetupStatus } from "./client/hooks/use-setup-status.mjs";
|
|
55
|
+
import { FlagConfig, getCountryCode, getFlagConfig, getFlagUrl } from "./client/utils/locale-to-flag.mjs";
|
|
56
|
+
import { AnyAdminMeta, ArrayFieldAdminMeta, BaseAdminMeta, BaseWidgetAdminMeta, BooleanFieldAdminMeta, DateFieldAdminMeta, JsonFieldAdminMeta, NumberFieldAdminMeta, ObjectFieldAdminMeta, RelationFieldAdminMeta, SelectFieldAdminMeta, TextFieldAdminMeta, TextareaFieldAdminMeta, TimeFieldAdminMeta, UploadFieldAdminMeta, WidgetTypeRegistry } from "./augmentation.mjs";
|
|
57
|
+
import { FocusContextValue, FocusProvider, FocusProviderProps, FocusState, parsePreviewFieldPath, scrollFieldIntoView, useFocus, useFocusOptional, useIsBlockFocused, useIsFieldFocused } from "./client/context/focus-context.mjs";
|
|
58
|
+
import { ScopeContextValue, ScopeOption, ScopePickerProps, ScopeProviderProps } from "./client/scope/types.mjs";
|
|
59
|
+
import { ScopePicker } from "./client/scope/picker.mjs";
|
|
60
|
+
import { ScopeProvider, createScopedFetch, useScope, useScopeSafe, useScopedFetch } from "./client/scope/provider.mjs";
|
|
61
|
+
import { CollectionFieldKeys, CollectionItem, CollectionNames, GlobalNames } from "./client.mjs";
|
|
62
|
+
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminModule, AdminProvider, AdminProviderProps, AdminRouter, AdminRouterProps, AdminState, AdminStore, AdminToPreviewMessage, AdminTypeRegistry, AllBlockData, AllBlockValues, type AnyAdminMeta, AnyWidgetConfig, AppAdmin, type ArrayFieldAdminMeta, AuthGuard, AuthLayout, AuthLoading, Badge, BadgeProps, type BaseAdminMeta, BaseFieldProps, BaseWidgetAdminMeta, BaseWidgetConfig, BlockCategory, BlockClickedMessage, BlockComponentProps, BlockContent, BlockNode, BlockPrefetchContext, BlockPrefetchData, BlockPrefetchError, BlockPrefetchParams, BlockPrefetchResult, BlockRegistry, BlockRenderer, BlockRendererComponent, BlockRendererProps as BlockRendererComponentProps, BlockRendererDefinition, BlockRendererProps$1 as BlockRendererProps, BlockScopeContextValue, BlockScopeProvider, BlockScopeProviderProps, BlockValues, type BooleanFieldAdminMeta, ChartWidgetConfig, CollectionFieldKeys, CollectionItem, CollectionNames, ComponentRegistry, ComponentRenderer, ComponentRendererProps, ComponentRendererRegistry, CoreAdminModule, CustomWidgetConfig, DashboardPage, type DateFieldAdminMeta, EMPTY_BLOCK_CONTENT, EditViewBuilder, EditViewBuilderState, EditViewDefinition, ExtractBlockFieldValues, ExtractBlockPrefetchData, ExtractServerBlocks, FieldBuilder, FieldBuilderState, FieldClickedMessage, FieldComponentProps, FieldDefinition, FlagConfig, FocusContextValue, FocusFieldMessage, FocusProvider, FocusProviderProps, FocusState, ForgotPasswordForm, ForgotPasswordPage, FormViewConfig, GlobalNames, I18nContext, I18nText, IconComponent, IconifyIcon, IconifyIconProps, InferAdminCMS, InvitePage, IsRegistered, type JsonFieldAdminMeta, ListViewBuilder, ListViewBuilderState, ListViewDefinition, LoginForm, LoginPage, MaybeLazyComponent, type NumberFieldAdminMeta, type ObjectFieldAdminMeta, OptionItem, PreviewBanner, PreviewBannerProps, PreviewConfig, PreviewField, PreviewFieldProps, PreviewProvider, PreviewReadyMessage, PreviewRefreshMessage, PreviewToAdminMessage, ProgressWidgetConfig, QuickActionsWidgetConfig, ReactiveFieldResult, ReactiveFieldState, RecentItemsWidgetConfig, RefreshCompleteMessage, RegisteredAdmin, RegisteredCMS, RegisteredCollectionNames, RegisteredGlobalNames, type RelationFieldAdminMeta, ResetPasswordForm, ResetPasswordPage, RichTextRenderer, RichTextStyles, ScopeContextValue, ScopeOption, ScopePicker, ScopePickerProps, ScopeProvider, ScopeProviderProps, SelectBlockMessage, type SelectFieldAdminMeta, ServerBlockNames, SetupForm, SetupFormValues, SetupPage, SetupPageProps, SetupStatus, StandalonePreviewField, StatsWidgetConfig, TableWidgetConfig, type TextFieldAdminMeta, type TextareaFieldAdminMeta, type TimeFieldAdminMeta, TimelineWidgetConfig, TipTapDoc, TipTapNode, TypedBlockPrefetch, BlockRendererProps$2 as TypedBlockRendererProps, TypedHooks, type UploadFieldAdminMeta, UseCollectionPreviewOptions, UseCollectionPreviewResult, UseFieldOptionsOptions, UseFieldOptionsResult, UseReactiveFieldsOptions, UseReactiveFieldsResult, ValueWidgetConfig, WidgetBuilder, WidgetBuilderState, WidgetComponentProps, WidgetConfig, WidgetDefinition, WidgetTypeRegistry, adminModule, coreAdminModule, createAdminAuthClient, createBlockRegistry, createIconRenderer, createScopedFetch, createTypedHooks, editView, field, getCountryCode, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, listView, parsePreviewFieldPath, prefetchBlockData, qa, resolveIconElement, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore, useAuthClient, useBlockScope, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionUpdate, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalUpdate, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useScope, useScopeSafe, useScopedFetch, useServerWidgetData, useSetupStatus, useShallow, widget };
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { Admin } from "./client/builder/admin.mjs";
|
|
2
|
+
import { AdminProvider, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore } from "./client/runtime/provider.mjs";
|
|
3
|
+
import { useShallow } from "./client/runtime/index.mjs";
|
|
4
|
+
import { Badge, ComponentRenderer, IconifyIcon, createIconRenderer, isComponentReference, resolveIconElement } from "./client/components/component-renderer.mjs";
|
|
5
|
+
import { useIsDesktop, useIsMobile, useMediaQuery } from "./client/hooks/use-media-query.mjs";
|
|
6
|
+
import { getCountryCode, getFlagConfig, getFlagUrl } from "./client/utils/locale-to-flag.mjs";
|
|
7
|
+
import { FocusProvider, parsePreviewFieldPath, scrollFieldIntoView, useFocus, useFocusOptional, useIsBlockFocused, useIsFieldFocused } from "./client/context/focus-context.mjs";
|
|
8
|
+
import { isAdminToPreviewMessage, isPreviewToAdminMessage } from "./client/preview/types.mjs";
|
|
9
|
+
import { createTypedHooks } from "./client/hooks/typed-hooks.mjs";
|
|
10
|
+
import { createAdminAuthClient, useAuthClient } from "./client/hooks/use-auth.mjs";
|
|
11
|
+
import { useCurrentUser } from "./client/hooks/use-current-user.mjs";
|
|
12
|
+
import { useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionUpdate } from "./client/hooks/use-collection.mjs";
|
|
13
|
+
import { useGlobal, useGlobalUpdate } from "./client/hooks/use-global.mjs";
|
|
14
|
+
import { useSetupStatus } from "./client/hooks/use-setup-status.mjs";
|
|
15
|
+
import { useReactiveFields } from "./client/hooks/use-reactive-fields.mjs";
|
|
16
|
+
import { EMPTY_BLOCK_CONTENT, isBlockContent } from "./client/blocks/types.mjs";
|
|
17
|
+
import { WidgetBuilder, widget } from "./client/builder/widget/widget.mjs";
|
|
18
|
+
import { AdminLink } from "./client/components/admin-link.mjs";
|
|
19
|
+
import { FieldBuilder, field } from "./client/builder/field/field.mjs";
|
|
20
|
+
import { EditViewBuilder, ListViewBuilder, editView, listView } from "./client/builder/view/view.mjs";
|
|
21
|
+
import { coreAdminModule } from "./client/builder/defaults/core.mjs";
|
|
22
|
+
import { adminModule } from "./client/builder/defaults/starter.mjs";
|
|
23
|
+
import { qa } from "./client/builder/qa.mjs";
|
|
24
|
+
import { AdminLayout } from "./client/views/layout/admin-layout.mjs";
|
|
25
|
+
import { AuthLoading } from "./client/components/auth/auth-loading.mjs";
|
|
26
|
+
import { AuthGuard } from "./client/components/auth/auth-guard.mjs";
|
|
27
|
+
import { AdminLayoutProvider } from "./client/views/layout/admin-layout-provider.mjs";
|
|
28
|
+
import { AuthLayout } from "./client/views/auth/auth-layout.mjs";
|
|
29
|
+
import { LoginForm } from "./client/views/auth/login-form.mjs";
|
|
30
|
+
import { ForgotPasswordForm } from "./client/views/auth/forgot-password-form.mjs";
|
|
31
|
+
import { ResetPasswordForm } from "./client/views/auth/reset-password-form.mjs";
|
|
32
|
+
import { AcceptInviteForm } from "./client/views/auth/accept-invite-form.mjs";
|
|
33
|
+
import { SetupForm } from "./client/views/auth/setup-form.mjs";
|
|
34
|
+
import { DashboardPage } from "./client/views/pages/dashboard-page.mjs";
|
|
35
|
+
import { LoginPage } from "./client/views/pages/login-page.mjs";
|
|
36
|
+
import { ForgotPasswordPage } from "./client/views/pages/forgot-password-page.mjs";
|
|
37
|
+
import { ResetPasswordPage } from "./client/views/pages/reset-password-page.mjs";
|
|
38
|
+
import { InvitePage } from "./client/views/pages/invite-page.mjs";
|
|
39
|
+
import { AcceptInvitePage } from "./client/views/pages/accept-invite-page.mjs";
|
|
40
|
+
import { SetupPage } from "./client/views/pages/setup-page.mjs";
|
|
41
|
+
import { AdminRouter } from "./client/views/layout/admin-router.mjs";
|
|
42
|
+
import { createBlockRegistry } from "./client/blocks/block-registry.mjs";
|
|
43
|
+
import { BlockScopeProvider, useBlockScope, useResolveFieldPath } from "./client/preview/block-scope-context.mjs";
|
|
44
|
+
import { BlockRenderer } from "./client/blocks/block-renderer.mjs";
|
|
45
|
+
import { BlockPrefetchError, prefetchBlockData } from "./client/blocks/prefetch.mjs";
|
|
46
|
+
import { RichTextRenderer } from "./components/rich-text/rich-text-renderer.mjs";
|
|
47
|
+
import { PreviewField, PreviewProvider, StandalonePreviewField, usePreviewContext } from "./client/preview/preview-field.mjs";
|
|
48
|
+
import { PreviewBanner } from "./client/preview/preview-banner.mjs";
|
|
49
|
+
import { useCollectionPreview } from "./client/preview/use-collection-preview.mjs";
|
|
50
|
+
import { useFieldOptions } from "./client/hooks/use-field-options.mjs";
|
|
51
|
+
import { useServerWidgetData } from "./client/hooks/use-server-widget-data.mjs";
|
|
52
|
+
import { ScopeProvider, createScopedFetch, useScope, useScopeSafe, useScopedFetch } from "./client/scope/provider.mjs";
|
|
53
|
+
import { ScopePicker } from "./client/scope/picker.mjs";
|
|
12
54
|
|
|
13
|
-
export { AcceptInviteForm, AcceptInvitePage, Admin,
|
|
55
|
+
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminProvider, AdminRouter, AuthGuard, AuthLayout, AuthLoading, Badge, BlockPrefetchError, BlockRenderer, BlockScopeProvider, ComponentRenderer, DashboardPage, EMPTY_BLOCK_CONTENT, EditViewBuilder, FieldBuilder, FocusProvider, ForgotPasswordForm, ForgotPasswordPage, IconifyIcon, InvitePage, ListViewBuilder, LoginForm, LoginPage, PreviewBanner, PreviewField, PreviewProvider, ResetPasswordForm, ResetPasswordPage, RichTextRenderer, ScopePicker, ScopeProvider, SetupForm, SetupPage, StandalonePreviewField, WidgetBuilder, adminModule, coreAdminModule, createAdminAuthClient, createBlockRegistry, createIconRenderer, createScopedFetch, createTypedHooks, editView, field, getCountryCode, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, listView, parsePreviewFieldPath, prefetchBlockData, qa, resolveIconElement, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore, useAuthClient, useBlockScope, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionUpdate, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalUpdate, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useScope, useScopeSafe, useScopedFetch, useServerWidgetData, useSetupStatus, useShallow, widget };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { AuthSession } from "../auth-helpers.mjs";
|
|
2
|
+
import { Questpie } from "questpie";
|
|
3
|
+
|
|
4
|
+
//#region src/server/adapters/nextjs.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Options for Next.js auth middleware
|
|
8
|
+
*/
|
|
9
|
+
interface NextAuthMiddlewareOptions {
|
|
10
|
+
/**
|
|
11
|
+
* The CMS instance with auth configured
|
|
12
|
+
*/
|
|
13
|
+
cms: Questpie<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Path to redirect to when not authenticated
|
|
16
|
+
* @default "/admin/login"
|
|
17
|
+
*/
|
|
18
|
+
loginPath?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Required role for access
|
|
21
|
+
* @default "admin"
|
|
22
|
+
*/
|
|
23
|
+
requiredRole?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Paths that require authentication (uses startsWith matching)
|
|
26
|
+
* @default ["/admin"]
|
|
27
|
+
*/
|
|
28
|
+
protectedPaths?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Paths within protectedPaths that should be publicly accessible
|
|
31
|
+
* @default ["/admin/login", "/admin/forgot-password", "/admin/reset-password", "/admin/accept-invite"]
|
|
32
|
+
*/
|
|
33
|
+
publicPaths?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Query parameter name for redirect URL
|
|
36
|
+
* @default "redirect"
|
|
37
|
+
*/
|
|
38
|
+
redirectParam?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a Next.js middleware for admin authentication.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* // middleware.ts
|
|
46
|
+
* import { createNextAuthMiddleware } from "@questpie/admin/server/adapters/nextjs";
|
|
47
|
+
* import { cms } from "./questpie/server/cms";
|
|
48
|
+
*
|
|
49
|
+
* export default createNextAuthMiddleware({
|
|
50
|
+
* cms,
|
|
51
|
+
* loginPath: "/admin/login",
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* export const config = {
|
|
55
|
+
* matcher: ["/admin/:path*"],
|
|
56
|
+
* };
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare function createNextAuthMiddleware({
|
|
60
|
+
cms,
|
|
61
|
+
loginPath,
|
|
62
|
+
requiredRole,
|
|
63
|
+
protectedPaths,
|
|
64
|
+
publicPaths,
|
|
65
|
+
redirectParam
|
|
66
|
+
}: NextAuthMiddlewareOptions): (request: Request) => Promise<Response>;
|
|
67
|
+
/**
|
|
68
|
+
* Get the admin session in a Next.js server component or API route.
|
|
69
|
+
*
|
|
70
|
+
* @example Server Component
|
|
71
|
+
* ```tsx
|
|
72
|
+
* // app/admin/layout.tsx
|
|
73
|
+
* import { getNextAdminSession } from "@questpie/admin/server/adapters/nextjs";
|
|
74
|
+
* import { headers } from "next/headers";
|
|
75
|
+
* import { cms } from "~/questpie/server/cms";
|
|
76
|
+
*
|
|
77
|
+
* export default async function AdminLayout({ children }) {
|
|
78
|
+
* const headersList = headers();
|
|
79
|
+
* const session = await getNextAdminSession({
|
|
80
|
+
* headers: headersList,
|
|
81
|
+
* cms,
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* if (!session) {
|
|
85
|
+
* redirect("/admin/login");
|
|
86
|
+
* }
|
|
87
|
+
*
|
|
88
|
+
* return <div>{children}</div>;
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @example API Route
|
|
93
|
+
* ```ts
|
|
94
|
+
* // app/api/admin/users/route.ts
|
|
95
|
+
* import { getNextAdminSession } from "@questpie/admin/server/adapters/nextjs";
|
|
96
|
+
* import { cms } from "~/questpie/server/cms";
|
|
97
|
+
*
|
|
98
|
+
* export async function GET(request: Request) {
|
|
99
|
+
* const session = await getNextAdminSession({
|
|
100
|
+
* headers: request.headers,
|
|
101
|
+
* cms,
|
|
102
|
+
* });
|
|
103
|
+
*
|
|
104
|
+
* if (!session || session.user.role !== "admin") {
|
|
105
|
+
* return Response.json({ error: "Unauthorized" }, { status: 401 });
|
|
106
|
+
* }
|
|
107
|
+
*
|
|
108
|
+
* // ... handle request
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
declare function getNextAdminSession({
|
|
113
|
+
headers,
|
|
114
|
+
cms
|
|
115
|
+
}: {
|
|
116
|
+
headers: Headers;
|
|
117
|
+
cms: Questpie<any>;
|
|
118
|
+
}): Promise<AuthSession | null>;
|
|
119
|
+
//#endregion
|
|
120
|
+
export { NextAuthMiddlewareOptions, createNextAuthMiddleware, getNextAdminSession };
|
|
121
|
+
//# sourceMappingURL=nextjs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs.d.mts","names":[],"sources":["../../../src/server/adapters/nextjs.ts"],"sourcesContent":[],"mappings":";;;;;;;;UA8BiB,yBAAA;;;;OAIV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgES,wBAAA;;;;;;;GAYb,sCACyC,YAAU,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyFxC,mBAAA;;;;WAIX;OACJ;IACN,QADc,WAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { getAdminSession, requireAdminAuth } from "../auth-helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/server/adapters/nextjs.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check if a path matches any of the given patterns
|
|
6
|
+
*/
|
|
7
|
+
function pathMatches(pathname, patterns) {
|
|
8
|
+
return patterns.some((pattern) => pathname === pattern || pathname.startsWith(`${pattern}/`) || pathname.startsWith(pattern));
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Create a Next.js middleware for admin authentication.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // middleware.ts
|
|
16
|
+
* import { createNextAuthMiddleware } from "@questpie/admin/server/adapters/nextjs";
|
|
17
|
+
* import { cms } from "./questpie/server/cms";
|
|
18
|
+
*
|
|
19
|
+
* export default createNextAuthMiddleware({
|
|
20
|
+
* cms,
|
|
21
|
+
* loginPath: "/admin/login",
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* export const config = {
|
|
25
|
+
* matcher: ["/admin/:path*"],
|
|
26
|
+
* };
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
function createNextAuthMiddleware({ cms, loginPath = "/admin/login", requiredRole = "admin", protectedPaths = ["/admin"], publicPaths = [
|
|
30
|
+
"/admin/login",
|
|
31
|
+
"/admin/forgot-password",
|
|
32
|
+
"/admin/reset-password",
|
|
33
|
+
"/admin/accept-invite"
|
|
34
|
+
], redirectParam = "redirect" }) {
|
|
35
|
+
return async function middleware(request) {
|
|
36
|
+
const pathname = new URL(request.url).pathname;
|
|
37
|
+
const isProtected = pathMatches(pathname, protectedPaths);
|
|
38
|
+
const isPublic = pathMatches(pathname, publicPaths);
|
|
39
|
+
if (!isProtected || isPublic) return new Response(null, {
|
|
40
|
+
status: 200,
|
|
41
|
+
headers: { "x-middleware-next": "1" }
|
|
42
|
+
});
|
|
43
|
+
const redirect = await requireAdminAuth({
|
|
44
|
+
request,
|
|
45
|
+
cms,
|
|
46
|
+
loginPath,
|
|
47
|
+
requiredRole,
|
|
48
|
+
redirectParam
|
|
49
|
+
});
|
|
50
|
+
if (redirect) return redirect;
|
|
51
|
+
return new Response(null, {
|
|
52
|
+
status: 200,
|
|
53
|
+
headers: { "x-middleware-next": "1" }
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the admin session in a Next.js server component or API route.
|
|
59
|
+
*
|
|
60
|
+
* @example Server Component
|
|
61
|
+
* ```tsx
|
|
62
|
+
* // app/admin/layout.tsx
|
|
63
|
+
* import { getNextAdminSession } from "@questpie/admin/server/adapters/nextjs";
|
|
64
|
+
* import { headers } from "next/headers";
|
|
65
|
+
* import { cms } from "~/questpie/server/cms";
|
|
66
|
+
*
|
|
67
|
+
* export default async function AdminLayout({ children }) {
|
|
68
|
+
* const headersList = headers();
|
|
69
|
+
* const session = await getNextAdminSession({
|
|
70
|
+
* headers: headersList,
|
|
71
|
+
* cms,
|
|
72
|
+
* });
|
|
73
|
+
*
|
|
74
|
+
* if (!session) {
|
|
75
|
+
* redirect("/admin/login");
|
|
76
|
+
* }
|
|
77
|
+
*
|
|
78
|
+
* return <div>{children}</div>;
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @example API Route
|
|
83
|
+
* ```ts
|
|
84
|
+
* // app/api/admin/users/route.ts
|
|
85
|
+
* import { getNextAdminSession } from "@questpie/admin/server/adapters/nextjs";
|
|
86
|
+
* import { cms } from "~/questpie/server/cms";
|
|
87
|
+
*
|
|
88
|
+
* export async function GET(request: Request) {
|
|
89
|
+
* const session = await getNextAdminSession({
|
|
90
|
+
* headers: request.headers,
|
|
91
|
+
* cms,
|
|
92
|
+
* });
|
|
93
|
+
*
|
|
94
|
+
* if (!session || session.user.role !== "admin") {
|
|
95
|
+
* return Response.json({ error: "Unauthorized" }, { status: 401 });
|
|
96
|
+
* }
|
|
97
|
+
*
|
|
98
|
+
* // ... handle request
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
async function getNextAdminSession({ headers, cms }) {
|
|
103
|
+
return getAdminSession({
|
|
104
|
+
request: new Request("http://localhost", { headers }),
|
|
105
|
+
cms
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { createNextAuthMiddleware, getNextAdminSession };
|
|
111
|
+
//# sourceMappingURL=nextjs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs.mjs","names":[],"sources":["../../../src/server/adapters/nextjs.ts"],"sourcesContent":["/**\n * Next.js Adapter\n *\n * Convenience helpers for Next.js middleware integration.\n *\n * @example App Router middleware\n * ```ts\n * // middleware.ts\n * import { createNextAuthMiddleware } from \"@questpie/admin/server/adapters/nextjs\";\n * import { cms } from \"./questpie/server/cms\";\n *\n * export default createNextAuthMiddleware({\n * cms,\n * loginPath: \"/admin/login\",\n * protectedPaths: [\"/admin\"],\n * publicPaths: [\"/admin/login\", \"/admin/forgot-password\"],\n * });\n *\n * export const config = {\n * matcher: [\"/admin/:path*\"],\n * };\n * ```\n */\n\nimport type { Questpie } from \"questpie\";\nimport { getAdminSession, requireAdminAuth } from \"../auth-helpers.js\";\n\n/**\n * Options for Next.js auth middleware\n */\nexport interface NextAuthMiddlewareOptions {\n /**\n * The CMS instance with auth configured\n */\n cms: Questpie<any>;\n\n /**\n * Path to redirect to when not authenticated\n * @default \"/admin/login\"\n */\n loginPath?: string;\n\n /**\n * Required role for access\n * @default \"admin\"\n */\n requiredRole?: string;\n\n /**\n * Paths that require authentication (uses startsWith matching)\n * @default [\"/admin\"]\n */\n protectedPaths?: string[];\n\n /**\n * Paths within protectedPaths that should be publicly accessible\n * @default [\"/admin/login\", \"/admin/forgot-password\", \"/admin/reset-password\", \"/admin/accept-invite\"]\n */\n publicPaths?: string[];\n\n /**\n * Query parameter name for redirect URL\n * @default \"redirect\"\n */\n redirectParam?: string;\n}\n\n/**\n * Check if a path matches any of the given patterns\n */\nfunction pathMatches(pathname: string, patterns: string[]): boolean {\n return patterns.some(\n (pattern) =>\n pathname === pattern ||\n pathname.startsWith(`${pattern}/`) ||\n pathname.startsWith(pattern),\n );\n}\n\n/**\n * Create a Next.js middleware for admin authentication.\n *\n * @example\n * ```ts\n * // middleware.ts\n * import { createNextAuthMiddleware } from \"@questpie/admin/server/adapters/nextjs\";\n * import { cms } from \"./questpie/server/cms\";\n *\n * export default createNextAuthMiddleware({\n * cms,\n * loginPath: \"/admin/login\",\n * });\n *\n * export const config = {\n * matcher: [\"/admin/:path*\"],\n * };\n * ```\n */\nexport function createNextAuthMiddleware({\n cms,\n loginPath = \"/admin/login\",\n requiredRole = \"admin\",\n protectedPaths = [\"/admin\"],\n publicPaths = [\n \"/admin/login\",\n \"/admin/forgot-password\",\n \"/admin/reset-password\",\n \"/admin/accept-invite\",\n ],\n redirectParam = \"redirect\",\n}: NextAuthMiddlewareOptions) {\n return async function middleware(request: Request): Promise<Response> {\n const url = new URL(request.url);\n const pathname = url.pathname;\n\n // Check if this is a protected path\n const isProtected = pathMatches(pathname, protectedPaths);\n const isPublic = pathMatches(pathname, publicPaths);\n\n // If not protected or is public, continue\n if (!isProtected || isPublic) {\n // Return a \"continue\" response\n // In Next.js middleware, returning undefined or NextResponse.next() continues\n // Since we're using standard Response, we'll return a special header\n return new Response(null, {\n status: 200,\n headers: {\n \"x-middleware-next\": \"1\",\n },\n });\n }\n\n // Check authentication\n const redirect = await requireAdminAuth({\n request,\n cms,\n loginPath,\n requiredRole,\n redirectParam,\n });\n\n if (redirect) {\n return redirect;\n }\n\n // Authenticated - continue\n return new Response(null, {\n status: 200,\n headers: {\n \"x-middleware-next\": \"1\",\n },\n });\n };\n}\n\n/**\n * Get the admin session in a Next.js server component or API route.\n *\n * @example Server Component\n * ```tsx\n * // app/admin/layout.tsx\n * import { getNextAdminSession } from \"@questpie/admin/server/adapters/nextjs\";\n * import { headers } from \"next/headers\";\n * import { cms } from \"~/questpie/server/cms\";\n *\n * export default async function AdminLayout({ children }) {\n * const headersList = headers();\n * const session = await getNextAdminSession({\n * headers: headersList,\n * cms,\n * });\n *\n * if (!session) {\n * redirect(\"/admin/login\");\n * }\n *\n * return <div>{children}</div>;\n * }\n * ```\n *\n * @example API Route\n * ```ts\n * // app/api/admin/users/route.ts\n * import { getNextAdminSession } from \"@questpie/admin/server/adapters/nextjs\";\n * import { cms } from \"~/questpie/server/cms\";\n *\n * export async function GET(request: Request) {\n * const session = await getNextAdminSession({\n * headers: request.headers,\n * cms,\n * });\n *\n * if (!session || session.user.role !== \"admin\") {\n * return Response.json({ error: \"Unauthorized\" }, { status: 401 });\n * }\n *\n * // ... handle request\n * }\n * ```\n */\nexport async function getNextAdminSession({\n headers,\n cms,\n}: {\n headers: Headers;\n cms: Questpie<any>;\n}) {\n // Create a minimal request object for getAdminSession\n const request = new Request(\"http://localhost\", { headers });\n return getAdminSession({ request, cms });\n}\n"],"mappings":";;;;;;AAsEA,SAAS,YAAY,UAAkB,UAA6B;AAClE,QAAO,SAAS,MACb,YACC,aAAa,WACb,SAAS,WAAW,GAAG,QAAQ,GAAG,IAClC,SAAS,WAAW,QAAQ,CAC/B;;;;;;;;;;;;;;;;;;;;;AAsBH,SAAgB,yBAAyB,EACvC,KACA,YAAY,gBACZ,eAAe,SACf,iBAAiB,CAAC,SAAS,EAC3B,cAAc;CACZ;CACA;CACA;CACA;CACD,EACD,gBAAgB,cACY;AAC5B,QAAO,eAAe,WAAW,SAAqC;EAEpE,MAAM,WADM,IAAI,IAAI,QAAQ,IAAI,CACX;EAGrB,MAAM,cAAc,YAAY,UAAU,eAAe;EACzD,MAAM,WAAW,YAAY,UAAU,YAAY;AAGnD,MAAI,CAAC,eAAe,SAIlB,QAAO,IAAI,SAAS,MAAM;GACxB,QAAQ;GACR,SAAS,EACP,qBAAqB,KACtB;GACF,CAAC;EAIJ,MAAM,WAAW,MAAM,iBAAiB;GACtC;GACA;GACA;GACA;GACA;GACD,CAAC;AAEF,MAAI,SACF,QAAO;AAIT,SAAO,IAAI,SAAS,MAAM;GACxB,QAAQ;GACR,SAAS,EACP,qBAAqB,KACtB;GACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDN,eAAsB,oBAAoB,EACxC,SACA,OAIC;AAGD,QAAO,gBAAgB;EAAE,SADT,IAAI,QAAQ,oBAAoB,EAAE,SAAS,CAAC;EAC1B;EAAK,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Questpie } from "questpie";
|
|
2
|
+
|
|
3
|
+
//#region src/server/adapters/tanstack.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Options for TanStack auth guard
|
|
7
|
+
*/
|
|
8
|
+
interface TanStackAuthGuardOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The CMS instance with auth configured
|
|
11
|
+
*/
|
|
12
|
+
cms: Questpie<any>;
|
|
13
|
+
/**
|
|
14
|
+
* Path to redirect to when not authenticated
|
|
15
|
+
* @default "/admin/login"
|
|
16
|
+
*/
|
|
17
|
+
loginPath?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Required role for access
|
|
20
|
+
* @default "admin"
|
|
21
|
+
*/
|
|
22
|
+
requiredRole?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Query parameter name for redirect URL
|
|
25
|
+
* @default "redirect"
|
|
26
|
+
*/
|
|
27
|
+
redirectParam?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Context passed to TanStack Router beforeLoad
|
|
31
|
+
*/
|
|
32
|
+
interface BeforeLoadContext {
|
|
33
|
+
context: {
|
|
34
|
+
request: Request;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create a TanStack Router beforeLoad guard for admin authentication.
|
|
41
|
+
*
|
|
42
|
+
* Returns a function that can be used as beforeLoad in route definitions.
|
|
43
|
+
* Throws a redirect Response when authentication fails.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { createFileRoute } from "@tanstack/react-router";
|
|
48
|
+
* import { createTanStackAuthGuard } from "@questpie/admin/server/adapters/tanstack";
|
|
49
|
+
* import { cms } from "~/questpie/server/cms";
|
|
50
|
+
*
|
|
51
|
+
* export const Route = createFileRoute("/admin")({
|
|
52
|
+
* beforeLoad: createTanStackAuthGuard({
|
|
53
|
+
* cms,
|
|
54
|
+
* loginPath: "/admin/login",
|
|
55
|
+
* requiredRole: "admin",
|
|
56
|
+
* }),
|
|
57
|
+
* component: AdminLayout,
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @example With custom context
|
|
62
|
+
* ```ts
|
|
63
|
+
* export const Route = createFileRoute("/admin")({
|
|
64
|
+
* beforeLoad: async (ctx) => {
|
|
65
|
+
* // Run auth guard
|
|
66
|
+
* await createTanStackAuthGuard({ cms })(ctx);
|
|
67
|
+
*
|
|
68
|
+
* // Add additional context
|
|
69
|
+
* return { user: ctx.context.user };
|
|
70
|
+
* },
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare function createTanStackAuthGuard({
|
|
75
|
+
cms,
|
|
76
|
+
loginPath,
|
|
77
|
+
requiredRole,
|
|
78
|
+
redirectParam
|
|
79
|
+
}: TanStackAuthGuardOptions): ({
|
|
80
|
+
context
|
|
81
|
+
}: BeforeLoadContext) => Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Create a TanStack Router loader that injects the admin session into context.
|
|
84
|
+
*
|
|
85
|
+
* Use this when you need access to the session in your components.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* import { createTanStackSessionLoader } from "@questpie/admin/server/adapters/tanstack";
|
|
90
|
+
*
|
|
91
|
+
* export const Route = createFileRoute("/admin")({
|
|
92
|
+
* loader: createTanStackSessionLoader({ cms }),
|
|
93
|
+
* component: AdminLayout,
|
|
94
|
+
* });
|
|
95
|
+
*
|
|
96
|
+
* function AdminLayout() {
|
|
97
|
+
* const { session } = Route.useLoaderData();
|
|
98
|
+
* return <div>Hello {session?.user?.name}</div>;
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
declare function createTanStackSessionLoader({
|
|
103
|
+
cms
|
|
104
|
+
}: {
|
|
105
|
+
cms: Questpie<any>;
|
|
106
|
+
}): ({
|
|
107
|
+
context
|
|
108
|
+
}: BeforeLoadContext) => Promise<{
|
|
109
|
+
session: {
|
|
110
|
+
session: {
|
|
111
|
+
id: string;
|
|
112
|
+
createdAt: Date;
|
|
113
|
+
updatedAt: Date;
|
|
114
|
+
userId: string;
|
|
115
|
+
expiresAt: Date;
|
|
116
|
+
token: string;
|
|
117
|
+
ipAddress?: string | null | undefined | undefined;
|
|
118
|
+
userAgent?: string | null | undefined | undefined;
|
|
119
|
+
};
|
|
120
|
+
user: {
|
|
121
|
+
id: string;
|
|
122
|
+
createdAt: Date;
|
|
123
|
+
updatedAt: Date;
|
|
124
|
+
email: string;
|
|
125
|
+
emailVerified: boolean;
|
|
126
|
+
name: string;
|
|
127
|
+
image?: string | null | undefined | undefined;
|
|
128
|
+
};
|
|
129
|
+
} | null;
|
|
130
|
+
}>;
|
|
131
|
+
//#endregion
|
|
132
|
+
export { BeforeLoadContext, TanStackAuthGuardOptions, createTanStackAuthGuard, createTanStackSessionLoader };
|
|
133
|
+
//# sourceMappingURL=tanstack.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tanstack.d.mts","names":[],"sources":["../../../src/server/adapters/tanstack.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkJ4C,UA5H3B,wBAAA,CA4H2B;;;;OAxHrC;;;;;;;;;;;;;;;;;;;;UAwBU,iBAAA;;aAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyCG,uBAAA;;;;;GAKb;;GAC6C,sBAAiB;;;;;;;;;;;;;;;;;;;;;iBA8CjD,2BAAA;;;OAA4C;;;GAChB,sBAAiB"}
|