@questpie/admin 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +245 -474
- package/dist/_virtual/rolldown_runtime.mjs +18 -0
- package/dist/augmentation.d.mts +315 -0
- package/dist/augmentation.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.d.mts +199 -0
- package/dist/client/blocks/block-registry.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.mjs +88 -0
- package/dist/client/blocks/block-registry.mjs.map +1 -0
- package/dist/client/blocks/block-renderer.d.mts +52 -0
- package/dist/client/blocks/block-renderer.d.mts.map +1 -0
- package/dist/client/blocks/block-renderer.mjs +71 -0
- package/dist/client/blocks/block-renderer.mjs.map +1 -0
- package/dist/client/blocks/index.d.mts +4 -0
- package/dist/client/blocks/prefetch.d.mts +45 -0
- package/dist/client/blocks/prefetch.d.mts.map +1 -0
- package/dist/client/blocks/prefetch.mjs +26 -0
- package/dist/client/blocks/prefetch.mjs.map +1 -0
- package/dist/client/blocks/types.d.mts +69 -0
- package/dist/client/blocks/types.d.mts.map +1 -0
- package/dist/client/blocks/types.mjs +20 -0
- package/dist/client/blocks/types.mjs.map +1 -0
- package/dist/client/builder/admin-builder.d.mts +112 -0
- package/dist/client/builder/admin-builder.d.mts.map +1 -0
- package/dist/client/builder/admin-builder.mjs +185 -0
- package/dist/client/builder/admin-builder.mjs.map +1 -0
- package/dist/client/builder/admin-types.d.mts +73 -0
- package/dist/client/builder/admin-types.d.mts.map +1 -0
- package/dist/client/builder/admin.d.mts +121 -0
- package/dist/client/builder/admin.d.mts.map +1 -0
- package/dist/client/builder/admin.mjs +160 -0
- package/dist/client/builder/admin.mjs.map +1 -0
- package/dist/client/builder/defaults/components.mjs +20 -0
- package/dist/client/builder/defaults/components.mjs.map +1 -0
- package/dist/client/builder/defaults/core.d.mts +354 -0
- package/dist/client/builder/defaults/core.d.mts.map +1 -0
- package/dist/client/builder/defaults/core.mjs +49 -0
- package/dist/client/builder/defaults/core.mjs.map +1 -0
- package/dist/client/builder/defaults/fields.mjs +328 -0
- package/dist/client/builder/defaults/fields.mjs.map +1 -0
- package/dist/client/builder/defaults/pages.mjs +58 -0
- package/dist/client/builder/defaults/pages.mjs.map +1 -0
- package/dist/client/builder/defaults/starter.d.mts +351 -0
- package/dist/client/builder/defaults/starter.d.mts.map +1 -0
- package/dist/client/builder/defaults/starter.mjs +28 -0
- package/dist/client/builder/defaults/starter.mjs.map +1 -0
- package/dist/client/builder/defaults/views.mjs +27 -0
- package/dist/client/builder/defaults/views.mjs.map +1 -0
- package/dist/client/builder/defaults/widgets.mjs +31 -0
- package/dist/client/builder/defaults/widgets.mjs.map +1 -0
- package/dist/client/builder/field/field.d.mts +229 -0
- package/dist/client/builder/field/field.d.mts.map +1 -0
- package/dist/client/builder/field/field.mjs +83 -0
- package/dist/client/builder/field/field.mjs.map +1 -0
- package/dist/client/builder/index.d.mts +36 -0
- package/dist/client/builder/index.d.mts.map +1 -0
- package/dist/client/builder/page/page.d.mts +36 -0
- package/dist/client/builder/page/page.d.mts.map +1 -0
- package/dist/client/builder/page/page.mjs +27 -0
- package/dist/client/builder/page/page.mjs.map +1 -0
- package/dist/client/builder/proxies.d.mts +2 -0
- package/dist/client/builder/proxies.mjs +24 -0
- package/dist/client/builder/proxies.mjs.map +1 -0
- package/dist/client/builder/qa.d.mts +50 -0
- package/dist/client/builder/qa.d.mts.map +1 -0
- package/dist/client/builder/qa.mjs +42 -0
- package/dist/client/builder/qa.mjs.map +1 -0
- package/dist/client/builder/registry.d.mts +70 -0
- package/dist/client/builder/registry.d.mts.map +1 -0
- package/dist/client/builder/types/action-registry.d.mts +2 -0
- package/dist/client/builder/types/action-registry.mjs +142 -0
- package/dist/client/builder/types/action-registry.mjs.map +1 -0
- package/dist/client/builder/types/action-types.d.mts +253 -0
- package/dist/client/builder/types/action-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.d.mts +199 -0
- package/dist/client/builder/types/collection-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.mjs +11 -0
- package/dist/client/builder/types/collection-types.mjs.map +1 -0
- package/dist/client/builder/types/common.d.mts +60 -0
- package/dist/client/builder/types/common.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.d.mts +593 -0
- package/dist/client/builder/types/field-types.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.mjs +19 -0
- package/dist/client/builder/types/field-types.mjs.map +1 -0
- package/dist/client/builder/types/global-types.d.mts +22 -0
- package/dist/client/builder/types/global-types.d.mts.map +1 -0
- package/dist/client/builder/types/ui-config.d.mts +160 -0
- package/dist/client/builder/types/ui-config.d.mts.map +1 -0
- package/dist/client/builder/types/views.d.mts +89 -0
- package/dist/client/builder/types/views.d.mts.map +1 -0
- package/dist/client/builder/types/widget-types.d.mts +563 -0
- package/dist/client/builder/types/widget-types.d.mts.map +1 -0
- package/dist/client/builder/validation.d.mts +3 -0
- package/dist/client/builder/validation.mjs +208 -0
- package/dist/client/builder/validation.mjs.map +1 -0
- package/dist/client/builder/view/view.d.mts +129 -0
- package/dist/client/builder/view/view.d.mts.map +1 -0
- package/dist/client/builder/view/view.mjs +109 -0
- package/dist/client/builder/view/view.mjs.map +1 -0
- package/dist/client/builder/widget/widget.d.mts +33 -0
- package/dist/client/builder/widget/widget.d.mts.map +1 -0
- package/dist/client/builder/widget/widget.mjs +26 -0
- package/dist/client/builder/widget/widget.mjs.map +1 -0
- package/dist/client/components/actions/action-button.d.mts +2 -0
- package/dist/client/components/actions/action-button.mjs +135 -0
- package/dist/client/components/actions/action-button.mjs.map +1 -0
- package/dist/client/components/actions/action-dialog.d.mts +2 -0
- package/dist/client/components/actions/action-dialog.mjs +264 -0
- package/dist/client/components/actions/action-dialog.mjs.map +1 -0
- package/dist/client/components/actions/confirmation-dialog.d.mts +2 -0
- package/dist/client/components/actions/confirmation-dialog.mjs +82 -0
- package/dist/client/components/actions/confirmation-dialog.mjs.map +1 -0
- package/dist/client/components/actions/header-actions.d.mts +2 -0
- package/dist/client/components/actions/header-actions.mjs +117 -0
- package/dist/client/components/actions/header-actions.mjs.map +1 -0
- package/dist/client/components/actions/index.d.mts +4 -0
- package/dist/client/components/admin-link.d.mts +67 -0
- package/dist/client/components/admin-link.d.mts.map +1 -0
- package/dist/client/components/admin-link.mjs +92 -0
- package/dist/client/components/admin-link.mjs.map +1 -0
- package/dist/client/components/auth/auth-guard.d.mts +51 -0
- package/dist/client/components/auth/auth-guard.d.mts.map +1 -0
- package/dist/client/components/auth/auth-guard.mjs +60 -0
- package/dist/client/components/auth/auth-guard.mjs.map +1 -0
- package/dist/client/components/auth/auth-loading.d.mts +36 -0
- package/dist/client/components/auth/auth-loading.d.mts.map +1 -0
- package/dist/client/components/auth/auth-loading.mjs +27 -0
- package/dist/client/components/auth/auth-loading.mjs.map +1 -0
- package/dist/client/components/auth/index.d.mts +2 -0
- package/dist/client/components/blocks/block-canvas.mjs +90 -0
- package/dist/client/components/blocks/block-canvas.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-context.mjs +58 -0
- package/dist/client/components/blocks/block-editor-context.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-layout.mjs +82 -0
- package/dist/client/components/blocks/block-editor-layout.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-provider.mjs +155 -0
- package/dist/client/components/blocks/block-editor-provider.mjs.map +1 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs +70 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs.map +1 -0
- package/dist/client/components/blocks/block-insert-button.mjs +72 -0
- package/dist/client/components/blocks/block-insert-button.mjs.map +1 -0
- package/dist/client/components/blocks/block-item-menu.mjs +161 -0
- package/dist/client/components/blocks/block-item-menu.mjs.map +1 -0
- package/dist/client/components/blocks/block-item.mjs +187 -0
- package/dist/client/components/blocks/block-item.mjs.map +1 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs +190 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs.map +1 -0
- package/dist/client/components/blocks/block-tree.mjs +45 -0
- package/dist/client/components/blocks/block-tree.mjs.map +1 -0
- package/dist/client/components/blocks/block-type-icon.mjs +50 -0
- package/dist/client/components/blocks/block-type-icon.mjs.map +1 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs +186 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs.map +1 -0
- package/dist/client/components/component-renderer.d.mts +125 -0
- package/dist/client/components/component-renderer.d.mts.map +1 -0
- package/dist/client/components/component-renderer.mjs +145 -0
- package/dist/client/components/component-renderer.mjs.map +1 -0
- package/dist/client/components/error-boundary.mjs +92 -0
- package/dist/client/components/error-boundary.mjs.map +1 -0
- package/dist/client/components/fields/array-field.d.mts +44 -0
- package/dist/client/components/fields/array-field.d.mts.map +1 -0
- package/dist/client/components/fields/array-field.mjs +231 -0
- package/dist/client/components/fields/array-field.mjs.map +1 -0
- package/dist/client/components/fields/asset-preview-field.d.mts +52 -0
- package/dist/client/components/fields/asset-preview-field.d.mts.map +1 -0
- package/dist/client/components/fields/asset-preview-field.mjs +60 -0
- package/dist/client/components/fields/asset-preview-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts +41 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +101 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/index.d.mts +1 -0
- package/dist/client/components/fields/boolean-field.d.mts +30 -0
- package/dist/client/components/fields/boolean-field.d.mts.map +1 -0
- package/dist/client/components/fields/boolean-field.mjs +47 -0
- package/dist/client/components/fields/boolean-field.mjs.map +1 -0
- package/dist/client/components/fields/custom-field.d.mts +3 -0
- package/dist/client/components/fields/date-field.d.mts +22 -0
- package/dist/client/components/fields/date-field.d.mts.map +1 -0
- package/dist/client/components/fields/date-field.mjs +42 -0
- package/dist/client/components/fields/date-field.mjs.map +1 -0
- package/dist/client/components/fields/datetime-field.d.mts +23 -0
- package/dist/client/components/fields/datetime-field.d.mts.map +1 -0
- package/dist/client/components/fields/datetime-field.mjs +43 -0
- package/dist/client/components/fields/datetime-field.mjs.map +1 -0
- package/dist/client/components/fields/email-field.d.mts +19 -0
- package/dist/client/components/fields/email-field.d.mts.map +1 -0
- package/dist/client/components/fields/email-field.mjs +38 -0
- package/dist/client/components/fields/email-field.mjs.map +1 -0
- package/dist/client/components/fields/embedded-collection.d.mts +3 -0
- package/dist/client/components/fields/field-types.d.mts +571 -0
- package/dist/client/components/fields/field-types.d.mts.map +1 -0
- package/dist/client/components/fields/field-utils.d.mts +1 -0
- package/dist/client/components/fields/field-utils.mjs +65 -0
- package/dist/client/components/fields/field-utils.mjs.map +1 -0
- package/dist/client/components/fields/field-wrapper.d.mts +3 -0
- package/dist/client/components/fields/field-wrapper.mjs +49 -0
- package/dist/client/components/fields/field-wrapper.mjs.map +1 -0
- package/dist/client/components/fields/index.d.mts +33 -0
- package/dist/client/components/fields/json-field.d.mts +84 -0
- package/dist/client/components/fields/json-field.d.mts.map +1 -0
- package/dist/client/components/fields/json-field.mjs +248 -0
- package/dist/client/components/fields/json-field.mjs.map +1 -0
- package/dist/client/components/fields/locale-badge.d.mts +1 -0
- package/dist/client/components/fields/locale-badge.mjs +17 -0
- package/dist/client/components/fields/locale-badge.mjs.map +1 -0
- package/dist/client/components/fields/number-field.d.mts +23 -0
- package/dist/client/components/fields/number-field.d.mts.map +1 -0
- package/dist/client/components/fields/number-field.mjs +40 -0
- package/dist/client/components/fields/number-field.mjs.map +1 -0
- package/dist/client/components/fields/object-array-field.d.mts +2 -0
- package/dist/client/components/fields/object-array-field.mjs +313 -0
- package/dist/client/components/fields/object-array-field.mjs.map +1 -0
- package/dist/client/components/fields/object-field.d.mts +32 -0
- package/dist/client/components/fields/object-field.d.mts.map +1 -0
- package/dist/client/components/fields/object-field.mjs +128 -0
- package/dist/client/components/fields/object-field.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/cards-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs +140 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/chips-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs +100 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/grid-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs +114 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/index.d.mts +6 -0
- package/dist/client/components/fields/relation/displays/list-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs +128 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/table-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs +134 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/types.d.mts +22 -0
- package/dist/client/components/fields/relation/displays/types.d.mts.map +1 -0
- package/dist/client/components/fields/relation/displays/types.mjs +73 -0
- package/dist/client/components/fields/relation/displays/types.mjs.map +1 -0
- package/dist/client/components/fields/relation/index.d.mts +3 -0
- package/dist/client/components/fields/relation/relation-items-display.d.mts +5 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs +47 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs.map +1 -0
- package/dist/client/components/fields/relation-field.d.mts +134 -0
- package/dist/client/components/fields/relation-field.d.mts.map +1 -0
- package/dist/client/components/fields/relation-field.mjs +106 -0
- package/dist/client/components/fields/relation-field.mjs.map +1 -0
- package/dist/client/components/fields/relation-picker.d.mts +4 -0
- package/dist/client/components/fields/relation-picker.mjs +301 -0
- package/dist/client/components/fields/relation-picker.mjs.map +1 -0
- package/dist/client/components/fields/relation-select.d.mts +3 -0
- package/dist/client/components/fields/relation-select.mjs +219 -0
- package/dist/client/components/fields/relation-select.mjs.map +1 -0
- package/dist/client/components/fields/reverse-relation-field.d.mts +2 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +56 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +118 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +196 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +4 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +187 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +86 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +11 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +145 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +280 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts +78 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs +31 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs +51 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/variants.d.mts +2 -0
- package/dist/client/components/fields/rich-text-field.d.mts +14 -0
- package/dist/client/components/fields/rich-text-field.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-field.mjs +26 -0
- package/dist/client/components/fields/rich-text-field.mjs.map +1 -0
- package/dist/client/components/fields/select-field.d.mts +25 -0
- package/dist/client/components/fields/select-field.d.mts.map +1 -0
- package/dist/client/components/fields/select-field.mjs +53 -0
- package/dist/client/components/fields/select-field.mjs.map +1 -0
- package/dist/client/components/fields/status-field.d.mts +2 -0
- package/dist/client/components/fields/text-field.d.mts +22 -0
- package/dist/client/components/fields/text-field.d.mts.map +1 -0
- package/dist/client/components/fields/text-field.mjs +39 -0
- package/dist/client/components/fields/text-field.mjs.map +1 -0
- package/dist/client/components/fields/textarea-field.d.mts +22 -0
- package/dist/client/components/fields/textarea-field.d.mts.map +1 -0
- package/dist/client/components/fields/textarea-field.mjs +39 -0
- package/dist/client/components/fields/textarea-field.mjs.map +1 -0
- package/dist/client/components/fields/time-field.d.mts +20 -0
- package/dist/client/components/fields/time-field.d.mts.map +1 -0
- package/dist/client/components/fields/time-field.mjs +39 -0
- package/dist/client/components/fields/time-field.mjs.map +1 -0
- package/dist/client/components/fields/upload-field.d.mts +97 -0
- package/dist/client/components/fields/upload-field.d.mts.map +1 -0
- package/dist/client/components/fields/upload-field.mjs +497 -0
- package/dist/client/components/fields/upload-field.mjs.map +1 -0
- package/dist/client/components/filter-builder/columns-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/columns-tab.mjs +131 -0
- package/dist/client/components/filter-builder/columns-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.d.mts +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +157 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs.map +1 -0
- package/dist/client/components/filter-builder/filters-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/filters-tab.mjs +380 -0
- package/dist/client/components/filter-builder/filters-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/index.d.mts +5 -0
- package/dist/client/components/filter-builder/saved-views-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs +125 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs.map +1 -0
- package/dist/client/components/index.d.mts +80 -0
- package/dist/client/components/locale-switcher.d.mts +2 -0
- package/dist/client/components/locale-switcher.mjs +128 -0
- package/dist/client/components/locale-switcher.mjs.map +1 -0
- package/dist/client/components/media/media-grid.mjs +139 -0
- package/dist/client/components/media/media-grid.mjs.map +1 -0
- package/dist/client/components/media/media-picker-dialog.mjs +255 -0
- package/dist/client/components/media/media-picker-dialog.mjs.map +1 -0
- package/dist/client/components/preview/live-preview-mode.mjs +211 -0
- package/dist/client/components/preview/live-preview-mode.mjs.map +1 -0
- package/dist/client/components/preview/preview-pane.mjs +179 -0
- package/dist/client/components/preview/preview-pane.mjs.map +1 -0
- package/dist/client/components/primitives/asset-preview.mjs +363 -0
- package/dist/client/components/primitives/asset-preview.mjs.map +1 -0
- package/dist/client/components/primitives/checkbox-input.mjs +33 -0
- package/dist/client/components/primitives/checkbox-input.mjs.map +1 -0
- package/dist/client/components/primitives/date-input.mjs +218 -0
- package/dist/client/components/primitives/date-input.mjs.map +1 -0
- package/dist/client/components/primitives/dropzone.mjs +239 -0
- package/dist/client/components/primitives/dropzone.mjs.map +1 -0
- package/dist/client/components/primitives/number-input.mjs +113 -0
- package/dist/client/components/primitives/number-input.mjs.map +1 -0
- package/dist/client/components/primitives/select-multi.mjs +256 -0
- package/dist/client/components/primitives/select-multi.mjs.map +1 -0
- package/dist/client/components/primitives/select-single.mjs +183 -0
- package/dist/client/components/primitives/select-single.mjs.map +1 -0
- package/dist/client/components/primitives/text-input.mjs +40 -0
- package/dist/client/components/primitives/text-input.mjs.map +1 -0
- package/dist/client/components/primitives/textarea-input.mjs +38 -0
- package/dist/client/components/primitives/textarea-input.mjs.map +1 -0
- package/dist/client/components/primitives/time-input.mjs +72 -0
- package/dist/client/components/primitives/time-input.mjs.map +1 -0
- package/dist/client/components/primitives/toggle-input.mjs +31 -0
- package/dist/client/components/primitives/toggle-input.mjs.map +1 -0
- package/dist/client/components/primitives/types.d.mts +14 -0
- package/dist/client/components/primitives/types.d.mts.map +1 -0
- package/dist/client/components/primitives/types.mjs +13 -0
- package/dist/client/components/primitives/types.mjs.map +1 -0
- package/dist/client/components/sheets/index.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.mjs +78 -0
- package/dist/client/components/sheets/resource-sheet.mjs.map +1 -0
- package/dist/client/components/ui/accordion.d.mts +2 -0
- package/dist/client/components/ui/accordion.mjs +50 -0
- package/dist/client/components/ui/accordion.mjs.map +1 -0
- package/dist/client/components/ui/alert.mjs +32 -0
- package/dist/client/components/ui/alert.mjs.map +1 -0
- package/dist/client/components/ui/avatar.d.mts +3 -0
- package/dist/client/components/ui/badge.d.mts +3 -0
- package/dist/client/components/ui/badge.mjs +35 -0
- package/dist/client/components/ui/badge.mjs.map +1 -0
- package/dist/client/components/ui/button.d.mts +3 -0
- package/dist/client/components/ui/button.mjs +49 -0
- package/dist/client/components/ui/button.mjs.map +1 -0
- package/dist/client/components/ui/card.d.mts +2 -0
- package/dist/{card-BKHjBQfw.mjs → client/components/ui/card.mjs} +3 -10
- package/dist/{card-BKHjBQfw.mjs.map → client/components/ui/card.mjs.map} +1 -1
- package/dist/client/components/ui/checkbox.d.mts +2 -0
- package/dist/client/components/ui/checkbox.mjs +27 -0
- package/dist/client/components/ui/checkbox.mjs.map +1 -0
- package/dist/client/components/ui/combobox.d.mts +3 -0
- package/dist/client/components/ui/command.mjs +69 -0
- package/dist/client/components/ui/command.mjs.map +1 -0
- package/dist/client/components/ui/dialog.d.mts +3 -0
- package/dist/client/components/ui/dialog.mjs +83 -0
- package/dist/client/components/ui/dialog.mjs.map +1 -0
- package/dist/client/components/ui/drawer.mjs +75 -0
- package/dist/client/components/ui/drawer.mjs.map +1 -0
- package/dist/client/components/ui/dropdown-menu.d.mts +3 -0
- package/dist/client/components/ui/dropdown-menu.mjs +89 -0
- package/dist/client/components/ui/dropdown-menu.mjs.map +1 -0
- package/dist/client/components/ui/empty-state.mjs +53 -0
- package/dist/client/components/ui/empty-state.mjs.map +1 -0
- package/dist/client/components/ui/field.d.mts +3 -0
- package/dist/client/components/ui/field.mjs +78 -0
- package/dist/client/components/ui/field.mjs.map +1 -0
- package/dist/client/components/ui/input-group.d.mts +4 -0
- package/dist/client/components/ui/input-group.mjs +68 -0
- package/dist/client/components/ui/input-group.mjs.map +1 -0
- package/dist/client/components/ui/input.d.mts +2 -0
- package/dist/client/components/ui/input.mjs +17 -0
- package/dist/client/components/ui/input.mjs.map +1 -0
- package/dist/client/components/ui/kbd.mjs +24 -0
- package/dist/client/components/ui/kbd.mjs.map +1 -0
- package/dist/client/components/ui/label.d.mts +2 -0
- package/dist/client/components/ui/label.mjs +15 -0
- package/dist/client/components/ui/label.mjs.map +1 -0
- package/dist/client/components/ui/popover.d.mts +3 -0
- package/dist/client/components/ui/popover.mjs +49 -0
- package/dist/client/components/ui/popover.mjs.map +1 -0
- package/dist/client/components/ui/responsive-dialog.mjs +102 -0
- package/dist/client/components/ui/responsive-dialog.mjs.map +1 -0
- package/dist/client/components/ui/scroll-area.d.mts +2 -0
- package/dist/client/components/ui/search-input.mjs +74 -0
- package/dist/client/components/ui/search-input.mjs.map +1 -0
- package/dist/client/components/ui/select.d.mts +3 -0
- package/dist/client/components/ui/select.mjs +85 -0
- package/dist/client/components/ui/select.mjs.map +1 -0
- package/dist/client/components/ui/separator.d.mts +2 -0
- package/dist/client/components/ui/separator.mjs +17 -0
- package/dist/client/components/ui/separator.mjs.map +1 -0
- package/dist/client/components/ui/sheet.d.mts +3 -0
- package/dist/client/components/ui/sheet.mjs +78 -0
- package/dist/client/components/ui/sheet.mjs.map +1 -0
- package/dist/client/components/ui/sidebar.d.mts +8 -0
- package/dist/client/components/ui/sidebar.mjs +256 -0
- package/dist/client/components/ui/sidebar.mjs.map +1 -0
- package/dist/client/components/ui/skeleton.d.mts +1 -0
- package/dist/client/components/ui/skeleton.mjs +15 -0
- package/dist/client/components/ui/skeleton.mjs.map +1 -0
- package/dist/client/components/ui/sonner.d.mts +14 -0
- package/dist/client/components/ui/sonner.d.mts.map +1 -0
- package/dist/client/components/ui/sonner.mjs +55 -0
- package/dist/client/components/ui/sonner.mjs.map +1 -0
- package/dist/client/components/ui/spinner.d.mts +1 -0
- package/dist/client/components/ui/spinner.mjs +18 -0
- package/dist/client/components/ui/spinner.mjs.map +1 -0
- package/dist/client/components/ui/switch.d.mts +2 -0
- package/dist/client/components/ui/switch.mjs +23 -0
- package/dist/client/components/ui/switch.mjs.map +1 -0
- package/dist/client/components/ui/table.d.mts +2 -0
- package/dist/client/components/ui/table.mjs +66 -0
- package/dist/client/components/ui/table.mjs.map +1 -0
- package/dist/client/components/ui/tabs.d.mts +3 -0
- package/dist/client/components/ui/tabs.mjs +49 -0
- package/dist/client/components/ui/tabs.mjs.map +1 -0
- package/dist/client/components/ui/textarea.d.mts +2 -0
- package/dist/client/components/ui/textarea.mjs +15 -0
- package/dist/client/components/ui/textarea.mjs.map +1 -0
- package/dist/client/components/ui/toolbar.mjs +54 -0
- package/dist/client/components/ui/toolbar.mjs.map +1 -0
- package/dist/client/components/ui/tooltip.d.mts +2 -0
- package/dist/client/components/ui/tooltip.mjs +45 -0
- package/dist/client/components/ui/tooltip.mjs.map +1 -0
- package/dist/client/components/widgets/chart-widget.d.mts +57 -0
- package/dist/client/components/widgets/chart-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/chart-widget.mjs +282 -0
- package/dist/client/components/widgets/chart-widget.mjs.map +1 -0
- package/dist/client/components/widgets/progress-widget.d.mts +41 -0
- package/dist/client/components/widgets/progress-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/progress-widget.mjs +110 -0
- package/dist/client/components/widgets/progress-widget.mjs.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts +29 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs +121 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts +51 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.mjs +101 -0
- package/dist/client/components/widgets/recent-items-widget.mjs.map +1 -0
- package/dist/client/components/widgets/stats-widget.d.mts +55 -0
- package/dist/client/components/widgets/stats-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/stats-widget.mjs +150 -0
- package/dist/client/components/widgets/stats-widget.mjs.map +1 -0
- package/dist/client/components/widgets/table-widget.d.mts +31 -0
- package/dist/client/components/widgets/table-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/table-widget.mjs +139 -0
- package/dist/client/components/widgets/table-widget.mjs.map +1 -0
- package/dist/client/components/widgets/timeline-widget.d.mts +51 -0
- package/dist/client/components/widgets/timeline-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/timeline-widget.mjs +168 -0
- package/dist/client/components/widgets/timeline-widget.mjs.map +1 -0
- package/dist/client/components/widgets/value-widget.d.mts +39 -0
- package/dist/client/components/widgets/value-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/value-widget.mjs +111 -0
- package/dist/client/components/widgets/value-widget.mjs.map +1 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +145 -0
- package/dist/client/components/widgets/widget-skeletons.mjs.map +1 -0
- package/dist/client/context/focus-context.d.mts +88 -0
- package/dist/client/context/focus-context.d.mts.map +1 -0
- package/dist/client/context/focus-context.mjs +178 -0
- package/dist/client/context/focus-context.mjs.map +1 -0
- package/dist/client/contexts/breadcrumb-context.mjs +32 -0
- package/dist/client/contexts/breadcrumb-context.mjs.map +1 -0
- package/dist/client/hooks/typed-hooks.d.mts +84 -0
- package/dist/client/hooks/typed-hooks.d.mts.map +1 -0
- package/dist/client/hooks/typed-hooks.mjs +272 -0
- package/dist/client/hooks/typed-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-action.mjs +201 -0
- package/dist/client/hooks/use-action.mjs.map +1 -0
- package/dist/client/hooks/use-admin-config.mjs +40 -0
- package/dist/client/hooks/use-admin-config.mjs.map +1 -0
- package/dist/client/hooks/use-admin-preferences.mjs +68 -0
- package/dist/client/hooks/use-admin-preferences.mjs.map +1 -0
- package/dist/client/hooks/use-admin-routes.mjs +97 -0
- package/dist/client/hooks/use-admin-routes.mjs.map +1 -0
- package/dist/client/hooks/use-auth.d.mts +98 -0
- package/dist/client/hooks/use-auth.d.mts.map +1 -0
- package/dist/{use-auth-BoLmWtmU.mjs → client/hooks/use-auth.mjs} +3 -3
- package/dist/client/hooks/use-auth.mjs.map +1 -0
- package/dist/client/hooks/use-collection-fields.mjs +32 -0
- package/dist/client/hooks/use-collection-fields.mjs.map +1 -0
- package/dist/client/hooks/use-collection-meta.mjs +121 -0
- package/dist/client/hooks/use-collection-meta.mjs.map +1 -0
- package/dist/client/hooks/use-collection-schema.mjs +67 -0
- package/dist/client/hooks/use-collection-schema.mjs.map +1 -0
- package/dist/client/hooks/use-collection-validation.mjs +74 -0
- package/dist/client/hooks/use-collection-validation.mjs.map +1 -0
- package/dist/client/hooks/use-collection.d.mts +86 -0
- package/dist/client/hooks/use-collection.d.mts.map +1 -0
- package/dist/client/hooks/use-collection.mjs +214 -0
- package/dist/client/hooks/use-collection.mjs.map +1 -0
- package/dist/client/hooks/use-current-user.d.mts +57 -0
- package/dist/client/hooks/use-current-user.d.mts.map +1 -0
- package/dist/client/hooks/use-current-user.mjs +79 -0
- package/dist/client/hooks/use-current-user.mjs.map +1 -0
- package/dist/client/hooks/use-field-hooks.mjs +191 -0
- package/dist/client/hooks/use-field-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-field-options.d.mts +90 -0
- package/dist/client/hooks/use-field-options.d.mts.map +1 -0
- package/dist/client/hooks/use-field-options.mjs +184 -0
- package/dist/client/hooks/use-field-options.mjs.map +1 -0
- package/dist/client/hooks/use-global-fields.mjs +27 -0
- package/dist/client/hooks/use-global-fields.mjs.map +1 -0
- package/dist/client/hooks/use-global-meta.mjs +59 -0
- package/dist/client/hooks/use-global-meta.mjs.map +1 -0
- package/dist/client/hooks/use-global-schema.mjs +33 -0
- package/dist/client/hooks/use-global-schema.mjs.map +1 -0
- package/dist/client/hooks/use-global.d.mts +40 -0
- package/dist/client/hooks/use-global.d.mts.map +1 -0
- package/dist/client/hooks/use-global.mjs +74 -0
- package/dist/client/hooks/use-global.mjs.map +1 -0
- package/dist/client/hooks/use-locks.mjs +245 -0
- package/dist/client/hooks/use-locks.mjs.map +1 -0
- package/dist/client/hooks/use-media-query.d.mts +23 -0
- package/dist/client/hooks/use-media-query.d.mts.map +1 -0
- package/dist/client/hooks/use-media-query.mjs +62 -0
- package/dist/client/hooks/use-media-query.mjs.map +1 -0
- package/dist/client/hooks/use-prefill-params.mjs +47 -0
- package/dist/client/hooks/use-prefill-params.mjs.map +1 -0
- package/dist/client/hooks/use-questpie-query-options.mjs +28 -0
- package/dist/client/hooks/use-questpie-query-options.mjs.map +1 -0
- package/dist/client/hooks/use-reactive-fields.d.mts +75 -0
- package/dist/client/hooks/use-reactive-fields.d.mts.map +1 -0
- package/dist/client/hooks/use-reactive-fields.mjs +164 -0
- package/dist/client/hooks/use-reactive-fields.mjs.map +1 -0
- package/dist/client/hooks/use-realtime-highlight.mjs +96 -0
- package/dist/client/hooks/use-realtime-highlight.mjs.map +1 -0
- package/dist/client/hooks/use-saved-views.mjs +65 -0
- package/dist/client/hooks/use-saved-views.mjs.map +1 -0
- package/dist/client/hooks/use-search.mjs +147 -0
- package/dist/client/hooks/use-search.mjs.map +1 -0
- package/dist/client/hooks/use-server-validation.mjs +199 -0
- package/dist/client/hooks/use-server-validation.mjs.map +1 -0
- package/dist/client/hooks/use-server-widget-data.d.mts +26 -0
- package/dist/client/hooks/use-server-widget-data.d.mts.map +1 -0
- package/dist/client/hooks/use-server-widget-data.mjs +40 -0
- package/dist/client/hooks/use-server-widget-data.mjs.map +1 -0
- package/dist/client/hooks/use-setup-status.d.mts +39 -0
- package/dist/client/hooks/use-setup-status.d.mts.map +1 -0
- package/dist/client/hooks/use-setup-status.mjs +50 -0
- package/dist/client/hooks/use-setup-status.mjs.map +1 -0
- package/dist/client/hooks/use-upload-collection.mjs +32 -0
- package/dist/client/hooks/use-upload-collection.mjs.map +1 -0
- package/dist/client/hooks/use-upload.d.mts +23 -0
- package/dist/client/hooks/use-upload.d.mts.map +1 -0
- package/dist/client/hooks/use-upload.mjs +145 -0
- package/dist/client/hooks/use-upload.mjs.map +1 -0
- package/dist/client/hooks/use-validation-error-map.mjs +53 -0
- package/dist/client/hooks/use-validation-error-map.mjs.map +1 -0
- package/dist/client/hooks/use-view-state.mjs +261 -0
- package/dist/client/hooks/use-view-state.mjs.map +1 -0
- package/dist/client/i18n/hooks.mjs +160 -0
- package/dist/client/i18n/hooks.mjs.map +1 -0
- package/dist/client/i18n/intl-cache.mjs +65 -0
- package/dist/client/i18n/intl-cache.mjs.map +1 -0
- package/dist/client/i18n/messages.mjs +7 -0
- package/dist/client/i18n/messages.mjs.map +1 -0
- package/dist/client/i18n/simple.d.mts +22 -0
- package/dist/client/i18n/simple.d.mts.map +1 -0
- package/dist/client/i18n/simple.mjs +157 -0
- package/dist/client/i18n/simple.mjs.map +1 -0
- package/dist/client/i18n/types.d.mts +110 -0
- package/dist/client/i18n/types.d.mts.map +1 -0
- package/dist/client/lib/utils.d.mts +1 -0
- package/dist/client/lib/utils.mjs +28 -0
- package/dist/client/lib/utils.mjs.map +1 -0
- package/dist/client/preview/block-scope-context.d.mts +74 -0
- package/dist/client/preview/block-scope-context.d.mts.map +1 -0
- package/dist/client/preview/block-scope-context.mjs +93 -0
- package/dist/client/preview/block-scope-context.mjs.map +1 -0
- package/dist/client/preview/index.d.mts +5 -0
- package/dist/client/preview/preview-banner.d.mts +46 -0
- package/dist/client/preview/preview-banner.d.mts.map +1 -0
- package/dist/client/preview/preview-banner.mjs +95 -0
- package/dist/client/preview/preview-banner.mjs.map +1 -0
- package/dist/client/preview/preview-field.d.mts +108 -0
- package/dist/client/preview/preview-field.d.mts.map +1 -0
- package/dist/client/preview/preview-field.mjs +125 -0
- package/dist/client/preview/preview-field.mjs.map +1 -0
- package/dist/client/preview/types.d.mts +115 -0
- package/dist/client/preview/types.d.mts.map +1 -0
- package/dist/client/preview/types.mjs +21 -0
- package/dist/client/preview/types.mjs.map +1 -0
- package/dist/client/preview/use-collection-preview.d.mts +71 -0
- package/dist/client/preview/use-collection-preview.d.mts.map +1 -0
- package/dist/client/preview/use-collection-preview.mjs +114 -0
- package/dist/client/preview/use-collection-preview.mjs.map +1 -0
- package/dist/client/runtime/content-locales-provider.d.mts +1 -0
- package/dist/client/runtime/content-locales-provider.mjs +85 -0
- package/dist/client/runtime/content-locales-provider.mjs.map +1 -0
- package/dist/client/runtime/index.d.mts +7 -0
- package/dist/client/runtime/index.mjs +8 -0
- package/dist/client/runtime/locale-scope.d.mts +2 -0
- package/dist/{runtime-6VZM878K.mjs → client/runtime/locale-scope.mjs} +3 -4
- package/dist/client/runtime/locale-scope.mjs.map +1 -0
- package/dist/client/runtime/provider.d.mts +10107 -0
- package/dist/client/runtime/provider.d.mts.map +1 -0
- package/dist/client/runtime/provider.mjs +229 -0
- package/dist/client/runtime/provider.mjs.map +1 -0
- package/dist/client/runtime/routes.d.mts +49 -0
- package/dist/client/runtime/routes.d.mts.map +1 -0
- package/dist/client/runtime/routes.mjs +107 -0
- package/dist/client/runtime/routes.mjs.map +1 -0
- package/dist/client/runtime/translations-provider.d.mts +2 -0
- package/dist/client/runtime/translations-provider.mjs +181 -0
- package/dist/client/runtime/translations-provider.mjs.map +1 -0
- package/dist/client/scope/index.d.mts +3 -0
- package/dist/client/scope/picker.d.mts +54 -0
- package/dist/client/scope/picker.d.mts.map +1 -0
- package/dist/client/scope/picker.mjs +161 -0
- package/dist/client/scope/picker.mjs.map +1 -0
- package/dist/client/scope/provider.d.mts +104 -0
- package/dist/client/scope/provider.d.mts.map +1 -0
- package/dist/client/scope/provider.mjs +159 -0
- package/dist/client/scope/provider.mjs.map +1 -0
- package/dist/client/scope/types.d.mts +112 -0
- package/dist/client/scope/types.d.mts.map +1 -0
- package/dist/client/styles/index.css +80 -0
- package/dist/client/utils/auto-expand-fields.mjs +65 -0
- package/dist/client/utils/auto-expand-fields.mjs.map +1 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs +256 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs.map +1 -0
- package/dist/client/utils/detect-relations.mjs +46 -0
- package/dist/client/utils/detect-relations.mjs.map +1 -0
- package/dist/client/utils/locale-to-flag.d.mts +118 -0
- package/dist/client/utils/locale-to-flag.d.mts.map +1 -0
- package/dist/client/utils/locale-to-flag.mjs +130 -0
- package/dist/client/utils/locale-to-flag.mjs.map +1 -0
- package/dist/client/utils/routes.mjs +196 -0
- package/dist/client/utils/routes.mjs.map +1 -0
- package/dist/client/views/auth/accept-invite-form.d.mts +73 -0
- package/dist/client/views/auth/accept-invite-form.d.mts.map +1 -0
- package/dist/client/views/auth/accept-invite-form.mjs +180 -0
- package/dist/client/views/auth/accept-invite-form.mjs.map +1 -0
- package/dist/client/views/auth/auth-layout.d.mts +44 -0
- package/dist/client/views/auth/auth-layout.d.mts.map +1 -0
- package/dist/client/views/auth/auth-layout.mjs +53 -0
- package/dist/client/views/auth/auth-layout.mjs.map +1 -0
- package/dist/client/views/auth/forgot-password-form.d.mts +59 -0
- package/dist/client/views/auth/forgot-password-form.d.mts.map +1 -0
- package/dist/{forgot-password-page-Bcp-An4Y.mjs → client/views/auth/forgot-password-form.mjs} +22 -89
- package/dist/client/views/auth/forgot-password-form.mjs.map +1 -0
- package/dist/client/views/auth/index.d.mts +7 -0
- package/dist/client/views/auth/invite-form.d.mts +1 -0
- package/dist/client/views/auth/invite-form.mjs +155 -0
- package/dist/client/views/auth/invite-form.mjs.map +1 -0
- package/dist/client/views/auth/login-form.d.mts +76 -0
- package/dist/client/views/auth/login-form.d.mts.map +1 -0
- package/dist/client/views/auth/login-form.mjs +167 -0
- package/dist/client/views/auth/login-form.mjs.map +1 -0
- package/dist/client/views/auth/reset-password-form.d.mts +66 -0
- package/dist/client/views/auth/reset-password-form.d.mts.map +1 -0
- package/dist/client/views/auth/reset-password-form.mjs +188 -0
- package/dist/client/views/auth/reset-password-form.mjs.map +1 -0
- package/dist/client/views/auth/setup-form.d.mts +61 -0
- package/dist/client/views/auth/setup-form.d.mts.map +1 -0
- package/dist/{setup-page-YAP_fzqh.mjs → client/views/auth/setup-form.mjs} +46 -124
- package/dist/client/views/auth/setup-form.mjs.map +1 -0
- package/dist/client/views/collection/auto-form-fields.d.mts +4 -0
- package/dist/client/views/collection/auto-form-fields.mjs +453 -0
- package/dist/client/views/collection/auto-form-fields.mjs.map +1 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs +291 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts +46 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.mjs +327 -0
- package/dist/client/views/collection/cells/complex-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/index.d.mts +7 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts +76 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs +165 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts +21 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.mjs +105 -0
- package/dist/client/views/collection/cells/relation-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +189 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.d.mts +2 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs +78 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +37 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts +25 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.mjs +20 -0
- package/dist/client/views/collection/cells/upload-cells.mjs.map +1 -0
- package/dist/client/views/collection/columns/build-columns.d.mts +2 -0
- package/dist/client/views/collection/columns/build-columns.mjs +156 -0
- package/dist/client/views/collection/columns/build-columns.mjs.map +1 -0
- package/dist/client/views/collection/columns/column-defaults.d.mts +2 -0
- package/dist/client/views/collection/columns/column-defaults.mjs +108 -0
- package/dist/client/views/collection/columns/column-defaults.mjs.map +1 -0
- package/dist/client/views/collection/columns/index.d.mts +3 -0
- package/dist/client/views/collection/columns/types.d.mts +2 -0
- package/dist/client/views/collection/field-context.mjs +127 -0
- package/dist/client/views/collection/field-context.mjs.map +1 -0
- package/dist/client/views/collection/field-renderer.mjs +171 -0
- package/dist/client/views/collection/field-renderer.mjs.map +1 -0
- package/dist/client/views/collection/form-view.d.mts +112 -0
- package/dist/client/views/collection/form-view.d.mts.map +1 -0
- package/dist/client/views/collection/form-view.mjs +903 -0
- package/dist/client/views/collection/form-view.mjs.map +1 -0
- package/dist/client/views/collection/index.d.mts +9 -0
- package/dist/client/views/collection/table-view.d.mts +102 -0
- package/dist/client/views/collection/table-view.d.mts.map +1 -0
- package/dist/client/views/collection/table-view.mjs +695 -0
- package/dist/client/views/collection/table-view.mjs.map +1 -0
- package/dist/client/views/collection/view-skeletons.mjs +121 -0
- package/dist/client/views/collection/view-skeletons.mjs.map +1 -0
- package/dist/client/views/common/global-search.d.mts +1 -0
- package/dist/client/views/common/global-search.mjs +376 -0
- package/dist/client/views/common/global-search.mjs.map +1 -0
- package/dist/client/views/common/index.d.mts +1 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs +385 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs.map +1 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs +178 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs.map +1 -0
- package/dist/client/views/dashboard/widget-card.mjs +159 -0
- package/dist/client/views/dashboard/widget-card.mjs.map +1 -0
- package/dist/client/views/globals/global-form-view.d.mts +74 -0
- package/dist/client/views/globals/global-form-view.d.mts.map +1 -0
- package/dist/client/views/globals/global-form-view.mjs +181 -0
- package/dist/client/views/globals/global-form-view.mjs.map +1 -0
- package/dist/client/views/index.d.mts +28 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts +140 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout-provider.mjs +90 -0
- package/dist/client/views/layout/admin-layout-provider.mjs.map +1 -0
- package/dist/client/views/layout/admin-layout.d.mts +151 -0
- package/dist/client/views/layout/admin-layout.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout.mjs +144 -0
- package/dist/client/views/layout/admin-layout.mjs.map +1 -0
- package/dist/client/views/layout/admin-root.d.mts +7 -0
- package/dist/client/views/layout/admin-router.d.mts +125 -0
- package/dist/client/views/layout/admin-router.d.mts.map +1 -0
- package/dist/client/views/layout/admin-router.mjs +594 -0
- package/dist/client/views/layout/admin-router.mjs.map +1 -0
- package/dist/client/views/layout/admin-sidebar.d.mts +105 -0
- package/dist/client/views/layout/admin-sidebar.d.mts.map +1 -0
- package/dist/client/views/layout/admin-sidebar.mjs +550 -0
- package/dist/client/views/layout/admin-sidebar.mjs.map +1 -0
- package/dist/client/views/layout/admin-topbar.mjs +128 -0
- package/dist/client/views/layout/admin-topbar.mjs.map +1 -0
- package/dist/client/views/layout/index.d.mts +5 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +67 -0
- package/dist/client/views/pages/accept-invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/accept-invite-page.mjs +143 -0
- package/dist/client/views/pages/accept-invite-page.mjs.map +1 -0
- package/dist/client/views/pages/dashboard-page.d.mts +52 -0
- package/dist/client/views/pages/dashboard-page.d.mts.map +1 -0
- package/dist/client/views/pages/dashboard-page.mjs +45 -0
- package/dist/client/views/pages/dashboard-page.mjs.map +1 -0
- package/dist/client/views/pages/forgot-password-page.d.mts +59 -0
- package/dist/client/views/pages/forgot-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/forgot-password-page.mjs +80 -0
- package/dist/client/views/pages/forgot-password-page.mjs.map +1 -0
- package/dist/client/views/pages/index.d.mts +7 -0
- package/dist/client/views/pages/invite-page.d.mts +71 -0
- package/dist/client/views/pages/invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/invite-page.mjs +86 -0
- package/dist/client/views/pages/invite-page.mjs.map +1 -0
- package/dist/client/views/pages/login-page.d.mts +76 -0
- package/dist/client/views/pages/login-page.d.mts.map +1 -0
- package/dist/client/views/pages/login-page.mjs +98 -0
- package/dist/client/views/pages/login-page.mjs.map +1 -0
- package/dist/client/views/pages/reset-password-page.d.mts +66 -0
- package/dist/client/views/pages/reset-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/reset-password-page.mjs +105 -0
- package/dist/client/views/pages/reset-password-page.mjs.map +1 -0
- package/dist/client/views/pages/setup-page.d.mts +64 -0
- package/dist/client/views/pages/setup-page.d.mts.map +1 -0
- package/dist/client/views/pages/setup-page.mjs +91 -0
- package/dist/client/views/pages/setup-page.mjs.map +1 -0
- package/dist/client.d.mts +92 -3
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +54 -12
- package/dist/components/rich-text/index.d.mts +1 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts +104 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts.map +1 -0
- package/dist/components/rich-text/rich-text-renderer.mjs +210 -0
- package/dist/components/rich-text/rich-text-renderer.mjs.map +1 -0
- package/dist/index.d.mts +62 -3
- package/dist/index.mjs +54 -12
- package/dist/server/adapters/nextjs.d.mts +121 -0
- package/dist/server/adapters/nextjs.d.mts.map +1 -0
- package/dist/server/adapters/nextjs.mjs +111 -0
- package/dist/server/adapters/nextjs.mjs.map +1 -0
- package/dist/server/adapters/tanstack.d.mts +133 -0
- package/dist/server/adapters/tanstack.d.mts.map +1 -0
- package/dist/server/adapters/tanstack.mjs +90 -0
- package/dist/server/adapters/tanstack.mjs.map +1 -0
- package/dist/server/augmentation.d.mts +1523 -0
- package/dist/server/augmentation.d.mts.map +1 -0
- package/dist/server/auth-helpers.d.mts +143 -0
- package/dist/server/auth-helpers.d.mts.map +1 -0
- package/dist/server/auth-helpers.mjs +108 -0
- package/dist/server/auth-helpers.mjs.map +1 -0
- package/dist/server/block/block-builder.d.mts +319 -0
- package/dist/server/block/block-builder.d.mts.map +1 -0
- package/dist/server/block/block-builder.mjs +217 -0
- package/dist/server/block/block-builder.mjs.map +1 -0
- package/dist/server/block/index.d.mts +3 -0
- package/dist/server/block/introspection.d.mts +84 -0
- package/dist/server/block/introspection.d.mts.map +1 -0
- package/dist/server/block/introspection.mjs +89 -0
- package/dist/server/block/introspection.mjs.map +1 -0
- package/dist/server/block/prefetch.d.mts +78 -0
- package/dist/server/block/prefetch.d.mts.map +1 -0
- package/dist/server/block/prefetch.mjs +240 -0
- package/dist/server/block/prefetch.mjs.map +1 -0
- package/dist/server/fields/blocks.d.mts +139 -0
- package/dist/server/fields/blocks.d.mts.map +1 -0
- package/dist/server/fields/blocks.mjs +192 -0
- package/dist/server/fields/blocks.mjs.map +1 -0
- package/dist/server/fields/index.d.mts +48 -0
- package/dist/server/fields/index.d.mts.map +1 -0
- package/dist/server/fields/index.mjs +16 -0
- package/dist/server/fields/index.mjs.map +1 -0
- package/dist/server/fields/rich-text.d.mts +135 -0
- package/dist/server/fields/rich-text.d.mts.map +1 -0
- package/dist/server/fields/rich-text.mjs +188 -0
- package/dist/server/fields/rich-text.mjs.map +1 -0
- package/dist/server/i18n/index.d.mts +16 -0
- package/dist/server/i18n/index.d.mts.map +1 -0
- package/dist/server/i18n/index.mjs +44 -0
- package/dist/server/i18n/index.mjs.map +1 -0
- package/dist/server/i18n/messages/cs.mjs +461 -0
- package/dist/server/i18n/messages/cs.mjs.map +1 -0
- package/dist/server/i18n/messages/de.mjs +461 -0
- package/dist/server/i18n/messages/de.mjs.map +1 -0
- package/dist/server/i18n/messages/en.mjs +493 -0
- package/dist/server/i18n/messages/en.mjs.map +1 -0
- package/dist/server/i18n/messages/es.mjs +461 -0
- package/dist/server/i18n/messages/es.mjs.map +1 -0
- package/dist/server/i18n/messages/fr.mjs +461 -0
- package/dist/server/i18n/messages/fr.mjs.map +1 -0
- package/dist/server/i18n/messages/index.mjs +24 -0
- package/dist/server/i18n/messages/index.mjs.map +1 -0
- package/dist/server/i18n/messages/pl.mjs +461 -0
- package/dist/server/i18n/messages/pl.mjs.map +1 -0
- package/dist/server/i18n/messages/pt.mjs +464 -0
- package/dist/server/i18n/messages/pt.mjs.map +1 -0
- package/dist/server/i18n/messages/sk.mjs +490 -0
- package/dist/server/i18n/messages/sk.mjs.map +1 -0
- package/dist/server/index.d.mts +20 -0
- package/dist/server/modules/admin/functions/admin-config.mjs +348 -0
- package/dist/server/modules/admin/functions/admin-config.mjs.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts +107 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.mjs +331 -0
- package/dist/server/modules/admin/functions/execute-action.mjs.map +1 -0
- package/dist/server/modules/admin/functions/locales.mjs +80 -0
- package/dist/server/modules/admin/functions/locales.mjs.map +1 -0
- package/dist/server/modules/admin/functions/preview.d.mts +70 -0
- package/dist/server/modules/admin/functions/preview.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/preview.mjs +243 -0
- package/dist/server/modules/admin/functions/preview.mjs.map +1 -0
- package/dist/server/modules/admin/functions/reactive.d.mts +99 -0
- package/dist/server/modules/admin/functions/reactive.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/reactive.mjs +378 -0
- package/dist/server/modules/admin/functions/reactive.mjs.map +1 -0
- package/dist/server/modules/admin/functions/setup.d.mts +84 -0
- package/dist/server/modules/admin/functions/setup.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/setup.mjs +131 -0
- package/dist/server/modules/admin/functions/setup.mjs.map +1 -0
- package/dist/server/modules/admin/functions/translations.mjs +125 -0
- package/dist/server/modules/admin/functions/translations.mjs.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts +33 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.mjs +70 -0
- package/dist/server/modules/admin/functions/widget-data.mjs.map +1 -0
- package/dist/server/modules/admin/index.d.mts +16879 -0
- package/dist/server/modules/admin/index.d.mts.map +1 -0
- package/dist/server/modules/admin/index.mjs +249 -0
- package/dist/server/modules/admin/index.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs +48 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs +79 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts +1490 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs +57 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs.map +1 -0
- package/dist/server/patch.d.mts +100 -0
- package/dist/server/patch.d.mts.map +1 -0
- package/dist/server/patch.mjs +1062 -0
- package/dist/server/patch.mjs.map +1 -0
- package/dist/server.d.mts +21 -250
- package/dist/server.mjs +19 -832
- package/dist/shared/preview-utils.d.mts +54 -0
- package/dist/shared/preview-utils.d.mts.map +1 -0
- package/dist/{preview-utils-BKQ9-TMa.mjs → shared/preview-utils.mjs} +2 -2
- package/dist/shared/preview-utils.mjs.map +1 -0
- package/dist/{saved-views.types-BMsz5mCy.d.mts → shared/types/saved-views.types.d.mts} +7 -2
- package/dist/shared/types/saved-views.types.d.mts.map +1 -0
- package/dist/shared.d.mts +3 -57
- package/dist/shared.mjs +1 -1
- package/package.json +12 -17
- package/dist/auth-layout-M8K8_q5R.mjs +0 -181
- package/dist/auth-layout-M8K8_q5R.mjs.map +0 -1
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +0 -273
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +0 -1
- package/dist/client-B7r47hEd.d.mts +0 -13403
- package/dist/client-B7r47hEd.d.mts.map +0 -1
- package/dist/client-njX1rZmi.mjs +0 -22612
- package/dist/client-njX1rZmi.mjs.map +0 -1
- package/dist/content-locales-provider-BXvuIgfg.mjs +0 -1650
- package/dist/content-locales-provider-BXvuIgfg.mjs.map +0 -1
- package/dist/dashboard-page-B4PGEdc2.mjs +0 -2500
- package/dist/dashboard-page-B4PGEdc2.mjs.map +0 -1
- package/dist/dashboard-page-mCY0pgZv.mjs +0 -3
- package/dist/dropzone-Do3awXKd.mjs +0 -634
- package/dist/dropzone-Do3awXKd.mjs.map +0 -1
- package/dist/forgot-password-page-Bcp-An4Y.mjs.map +0 -1
- package/dist/forgot-password-page-CEwsdLwn.mjs +0 -3
- package/dist/index-BYyqkWtn.d.mts +0 -2753
- package/dist/index-BYyqkWtn.d.mts.map +0 -1
- package/dist/login-page-BUnpCbCa.mjs +0 -3
- package/dist/login-page-CP4gA-dl.mjs +0 -298
- package/dist/login-page-CP4gA-dl.mjs.map +0 -1
- package/dist/preview-utils-BKQ9-TMa.mjs.map +0 -1
- package/dist/reset-password-page-BqfDmLxA.mjs +0 -281
- package/dist/reset-password-page-BqfDmLxA.mjs.map +0 -1
- package/dist/reset-password-page-CufHz3h3.mjs +0 -3
- package/dist/runtime-6VZM878K.mjs.map +0 -1
- package/dist/saved-views.types-BMsz5mCy.d.mts.map +0 -1
- package/dist/server.d.mts.map +0 -1
- package/dist/server.mjs.map +0 -1
- package/dist/setup-page-BNNzt_Z6.mjs +0 -3
- package/dist/setup-page-YAP_fzqh.mjs.map +0 -1
- package/dist/shared.d.mts.map +0 -1
- package/dist/use-auth-BoLmWtmU.mjs.map +0 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { I18nProvider } from "../i18n/hooks.mjs";
|
|
2
|
+
import { createSimpleI18n } from "../i18n/simple.mjs";
|
|
3
|
+
import { selectClient, useAdminStore } from "./provider.mjs";
|
|
4
|
+
import { DEFAULT_LOCALE } from "questpie/shared";
|
|
5
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
6
|
+
import { Suspense, useCallback, useMemo, useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/client/runtime/translations-provider.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Translations Provider
|
|
12
|
+
*
|
|
13
|
+
* Fetches admin UI translations from the server and provides i18n context.
|
|
14
|
+
* This enables single source of truth for all translations on the server.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* // In AdminProvider
|
|
19
|
+
* <TranslationsProvider initialLocale="en">
|
|
20
|
+
* {children}
|
|
21
|
+
* </TranslationsProvider>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
/** Cookie for UI locale (admin interface language) */
|
|
25
|
+
const UI_LOCALE_COOKIE = "questpie_ui_locale";
|
|
26
|
+
/** Cookie max age (1 year) */
|
|
27
|
+
const LOCALE_COOKIE_MAX_AGE = 3600 * 24 * 365;
|
|
28
|
+
function getCookie(name) {
|
|
29
|
+
if (typeof document === "undefined") return null;
|
|
30
|
+
const match = document.cookie.match(/* @__PURE__ */ new RegExp(`${name}=([^;]+)`));
|
|
31
|
+
return match ? match[1] : null;
|
|
32
|
+
}
|
|
33
|
+
function setCookie(name, value) {
|
|
34
|
+
if (typeof document === "undefined") return;
|
|
35
|
+
document.cookie = `${name}=${value}; path=/; max-age=${LOCALE_COOKIE_MAX_AGE}; SameSite=Lax`;
|
|
36
|
+
}
|
|
37
|
+
function getUiLocaleFromCookie() {
|
|
38
|
+
return getCookie(UI_LOCALE_COOKIE);
|
|
39
|
+
}
|
|
40
|
+
function setUiLocaleCookie(locale) {
|
|
41
|
+
setCookie(UI_LOCALE_COOKIE, locale);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Query options for fetching admin UI translations.
|
|
45
|
+
* Can be used with TanStack Query's prefetching in loaders.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* // In TanStack Start loader
|
|
50
|
+
* export const Route = createFileRoute("/admin")({
|
|
51
|
+
* loader: async ({ context }) => {
|
|
52
|
+
* await context.queryClient.ensureQueryData(
|
|
53
|
+
* getAdminTranslationsQueryOptions(context.client, "en")
|
|
54
|
+
* );
|
|
55
|
+
* },
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
function getAdminTranslationsQueryOptions(client, locale) {
|
|
60
|
+
return {
|
|
61
|
+
queryKey: [
|
|
62
|
+
"cms",
|
|
63
|
+
"adminTranslations",
|
|
64
|
+
locale
|
|
65
|
+
],
|
|
66
|
+
queryFn: async () => {
|
|
67
|
+
try {
|
|
68
|
+
return await client.rpc.getAdminTranslations({ locale });
|
|
69
|
+
} catch {
|
|
70
|
+
return {
|
|
71
|
+
locale: DEFAULT_LOCALE,
|
|
72
|
+
messages: {},
|
|
73
|
+
fallbackLocale: DEFAULT_LOCALE
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
staleTime: Number.POSITIVE_INFINITY,
|
|
78
|
+
gcTime: Number.POSITIVE_INFINITY
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Query options for fetching available admin UI locales.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* // In TanStack Start loader
|
|
87
|
+
* export const Route = createFileRoute("/admin")({
|
|
88
|
+
* loader: async ({ context }) => {
|
|
89
|
+
* await context.queryClient.ensureQueryData(
|
|
90
|
+
* getAdminLocalesQueryOptions(context.client)
|
|
91
|
+
* );
|
|
92
|
+
* },
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
function getAdminLocalesQueryOptions(client) {
|
|
97
|
+
return {
|
|
98
|
+
queryKey: ["cms", "adminLocales"],
|
|
99
|
+
queryFn: async () => {
|
|
100
|
+
try {
|
|
101
|
+
return await client.rpc.getAdminLocales({});
|
|
102
|
+
} catch {
|
|
103
|
+
return {
|
|
104
|
+
locales: [DEFAULT_LOCALE],
|
|
105
|
+
defaultLocale: DEFAULT_LOCALE
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
staleTime: Number.POSITIVE_INFINITY,
|
|
110
|
+
gcTime: Number.POSITIVE_INFINITY
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function TranslationsInner({ initialLocale, children }) {
|
|
114
|
+
const client = useAdminStore(selectClient);
|
|
115
|
+
const [locale, setLocaleState] = useState(initialLocale);
|
|
116
|
+
const { data: localesData } = useSuspenseQuery(getAdminLocalesQueryOptions(client));
|
|
117
|
+
const { data: translationsData } = useSuspenseQuery(getAdminTranslationsQueryOptions(client, locale));
|
|
118
|
+
const setLocale = useCallback((newLocale) => {
|
|
119
|
+
setLocaleState(newLocale);
|
|
120
|
+
setUiLocaleCookie(newLocale);
|
|
121
|
+
}, []);
|
|
122
|
+
return /* @__PURE__ */ jsx(I18nProvider, {
|
|
123
|
+
adapter: useMemo(() => {
|
|
124
|
+
return createSimpleI18n({
|
|
125
|
+
locale: translationsData.locale,
|
|
126
|
+
locales: localesData.locales,
|
|
127
|
+
messages: { [translationsData.locale]: translationsData.messages },
|
|
128
|
+
fallbackLocale: translationsData.fallbackLocale,
|
|
129
|
+
onLocaleChange: setLocale
|
|
130
|
+
});
|
|
131
|
+
}, [
|
|
132
|
+
translationsData,
|
|
133
|
+
localesData.locales,
|
|
134
|
+
setLocale
|
|
135
|
+
]),
|
|
136
|
+
children
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function LoadingFallback() {
|
|
140
|
+
return /* @__PURE__ */ jsx("div", {
|
|
141
|
+
className: "qp-flex qp-h-screen qp-w-screen qp-items-center qp-justify-center qp-bg-background",
|
|
142
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
143
|
+
className: "qp-flex qp-flex-col qp-items-center qp-gap-4",
|
|
144
|
+
children: [/* @__PURE__ */ jsx("div", { className: "qp-h-8 qp-w-8 qp-animate-spin qp-rounded-full qp-border-4 qp-border-primary qp-border-t-transparent" }), /* @__PURE__ */ jsx("span", {
|
|
145
|
+
className: "qp-text-sm qp-text-muted-foreground",
|
|
146
|
+
children: "Loading..."
|
|
147
|
+
})]
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Translations Provider
|
|
153
|
+
*
|
|
154
|
+
* Fetches admin UI translations from the server and provides i18n context.
|
|
155
|
+
* Uses Suspense for loading state.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```tsx
|
|
159
|
+
* <AdminStoreContext.Provider value={store}>
|
|
160
|
+
* <TranslationsProvider initialLocale="en">
|
|
161
|
+
* <ContentLocalesProvider>
|
|
162
|
+
* {children}
|
|
163
|
+
* </ContentLocalesProvider>
|
|
164
|
+
* </TranslationsProvider>
|
|
165
|
+
* </AdminStoreContext.Provider>
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
function TranslationsProvider({ initialLocale, children, fallback }) {
|
|
169
|
+
const resolvedLocale = initialLocale ?? getUiLocaleFromCookie() ?? DEFAULT_LOCALE;
|
|
170
|
+
return /* @__PURE__ */ jsx(Suspense, {
|
|
171
|
+
fallback: fallback ?? /* @__PURE__ */ jsx(LoadingFallback, {}),
|
|
172
|
+
children: /* @__PURE__ */ jsx(TranslationsInner, {
|
|
173
|
+
initialLocale: resolvedLocale,
|
|
174
|
+
children
|
|
175
|
+
})
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
//#endregion
|
|
180
|
+
export { TranslationsProvider, getAdminLocalesQueryOptions, getAdminTranslationsQueryOptions, getUiLocaleFromCookie, setUiLocaleCookie };
|
|
181
|
+
//# sourceMappingURL=translations-provider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations-provider.mjs","names":[],"sources":["../../../src/client/runtime/translations-provider.tsx"],"sourcesContent":["/**\n * Translations Provider\n *\n * Fetches admin UI translations from the server and provides i18n context.\n * This enables single source of truth for all translations on the server.\n *\n * @example\n * ```tsx\n * // In AdminProvider\n * <TranslationsProvider initialLocale=\"en\">\n * {children}\n * </TranslationsProvider>\n * ```\n */\n\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_LOCALE } from \"questpie/shared\";\nimport {\n type ReactElement,\n type ReactNode,\n Suspense,\n useCallback,\n useMemo,\n useState,\n} from \"react\";\nimport { I18nProvider } from \"../i18n/hooks\";\nimport { createSimpleI18n, type SimpleMessages } from \"../i18n/simple\";\nimport { selectClient, useAdminStore } from \"./provider\";\n\n// ============================================================================\n// Constants\n// ============================================================================\n\n/** Cookie for UI locale (admin interface language) */\nconst UI_LOCALE_COOKIE = \"questpie_ui_locale\";\n/** Cookie max age (1 year) */\nconst LOCALE_COOKIE_MAX_AGE = 60 * 60 * 24 * 365;\n\n// ============================================================================\n// Cookie Helpers\n// ============================================================================\n\nfunction getCookie(name: string): string | null {\n if (typeof document === \"undefined\") return null;\n const match = document.cookie.match(new RegExp(`${name}=([^;]+)`));\n return match ? match[1] : null;\n}\n\nfunction setCookie(name: string, value: string): void {\n if (typeof document === \"undefined\") return;\n // biome-ignore lint/suspicious/noDocumentCookie: this string is ok\n document.cookie = `${name}=${value}; path=/; max-age=${LOCALE_COOKIE_MAX_AGE}; SameSite=Lax`;\n}\n\nexport function getUiLocaleFromCookie(): string | null {\n return getCookie(UI_LOCALE_COOKIE);\n}\n\nexport function setUiLocaleCookie(locale: string): void {\n setCookie(UI_LOCALE_COOKIE, locale);\n}\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface TranslationsProviderProps {\n /** Initial UI locale */\n initialLocale?: string;\n /** Children to render */\n children: ReactNode;\n /** Fallback while loading translations */\n fallback?: ReactNode;\n}\n\n// ============================================================================\n// Query Options\n// ============================================================================\n\n/**\n * Query options for fetching admin UI translations.\n * Can be used with TanStack Query's prefetching in loaders.\n *\n * @example\n * ```ts\n * // In TanStack Start loader\n * export const Route = createFileRoute(\"/admin\")({\n * loader: async ({ context }) => {\n * await context.queryClient.ensureQueryData(\n * getAdminTranslationsQueryOptions(context.client, \"en\")\n * );\n * },\n * });\n * ```\n */\nexport function getAdminTranslationsQueryOptions(client: any, locale: string) {\n return {\n queryKey: [\"cms\", \"adminTranslations\", locale] as const,\n queryFn: async () => {\n try {\n const result = await client.rpc.getAdminTranslations({ locale });\n return result as {\n locale: string;\n messages: SimpleMessages;\n fallbackLocale: string;\n };\n } catch {\n // Fallback if function doesn't exist (older server)\n return {\n locale: DEFAULT_LOCALE,\n messages: {} as SimpleMessages,\n fallbackLocale: DEFAULT_LOCALE,\n };\n }\n },\n staleTime: Number.POSITIVE_INFINITY, // Cache forever\n gcTime: Number.POSITIVE_INFINITY,\n };\n}\n\n/**\n * Query options for fetching available admin UI locales.\n *\n * @example\n * ```ts\n * // In TanStack Start loader\n * export const Route = createFileRoute(\"/admin\")({\n * loader: async ({ context }) => {\n * await context.queryClient.ensureQueryData(\n * getAdminLocalesQueryOptions(context.client)\n * );\n * },\n * });\n * ```\n */\nexport function getAdminLocalesQueryOptions(client: any) {\n return {\n queryKey: [\"cms\", \"adminLocales\"] as const,\n queryFn: async () => {\n try {\n const result = await client.rpc.getAdminLocales({});\n return result as {\n locales: string[];\n defaultLocale: string;\n };\n } catch {\n // Fallback if function doesn't exist\n return {\n locales: [DEFAULT_LOCALE],\n defaultLocale: DEFAULT_LOCALE,\n };\n }\n },\n staleTime: Number.POSITIVE_INFINITY,\n gcTime: Number.POSITIVE_INFINITY,\n };\n}\n\n// ============================================================================\n// Inner Provider (with Suspense)\n// ============================================================================\n\ninterface TranslationsInnerProps {\n initialLocale: string;\n children: ReactNode;\n}\n\nfunction TranslationsInner({\n initialLocale,\n children,\n}: TranslationsInnerProps): ReactElement {\n const client = useAdminStore(selectClient);\n const [locale, setLocaleState] = useState(initialLocale);\n\n // Fetch available locales\n const { data: localesData } = useSuspenseQuery(\n getAdminLocalesQueryOptions(client),\n );\n\n // Fetch translations for current locale\n const { data: translationsData } = useSuspenseQuery(\n getAdminTranslationsQueryOptions(client, locale),\n );\n\n // Handle locale change\n const setLocale = useCallback((newLocale: string) => {\n setLocaleState(newLocale);\n setUiLocaleCookie(newLocale);\n }, []);\n\n // Create i18n adapter\n const i18nAdapter = useMemo(() => {\n return createSimpleI18n({\n locale: translationsData.locale,\n locales: localesData.locales,\n messages: { [translationsData.locale]: translationsData.messages },\n fallbackLocale: translationsData.fallbackLocale,\n onLocaleChange: setLocale,\n });\n }, [translationsData, localesData.locales, setLocale]);\n\n return <I18nProvider adapter={i18nAdapter}>{children}</I18nProvider>;\n}\n\n// ============================================================================\n// Loading Fallback\n// ============================================================================\n\nfunction LoadingFallback(): ReactElement {\n return (\n <div className=\"qp-flex qp-h-screen qp-w-screen qp-items-center qp-justify-center qp-bg-background\">\n <div className=\"qp-flex qp-flex-col qp-items-center qp-gap-4\">\n <div className=\"qp-h-8 qp-w-8 qp-animate-spin qp-rounded-full qp-border-4 qp-border-primary qp-border-t-transparent\" />\n <span className=\"qp-text-sm qp-text-muted-foreground\">Loading...</span>\n </div>\n </div>\n );\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\n/**\n * Translations Provider\n *\n * Fetches admin UI translations from the server and provides i18n context.\n * Uses Suspense for loading state.\n *\n * @example\n * ```tsx\n * <AdminStoreContext.Provider value={store}>\n * <TranslationsProvider initialLocale=\"en\">\n * <ContentLocalesProvider>\n * {children}\n * </ContentLocalesProvider>\n * </TranslationsProvider>\n * </AdminStoreContext.Provider>\n * ```\n */\nexport function TranslationsProvider({\n initialLocale,\n children,\n fallback,\n}: TranslationsProviderProps): ReactElement {\n const resolvedLocale =\n initialLocale ?? getUiLocaleFromCookie() ?? DEFAULT_LOCALE;\n\n return (\n <Suspense fallback={fallback ?? <LoadingFallback />}>\n <TranslationsInner initialLocale={resolvedLocale}>\n {children}\n </TranslationsInner>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,mBAAmB;;AAEzB,MAAM,wBAAwB,OAAU,KAAK;AAM7C,SAAS,UAAU,MAA6B;AAC9C,KAAI,OAAO,aAAa,YAAa,QAAO;CAC5C,MAAM,QAAQ,SAAS,OAAO,sBAAM,IAAI,OAAO,GAAG,KAAK,UAAU,CAAC;AAClE,QAAO,QAAQ,MAAM,KAAK;;AAG5B,SAAS,UAAU,MAAc,OAAqB;AACpD,KAAI,OAAO,aAAa,YAAa;AAErC,UAAS,SAAS,GAAG,KAAK,GAAG,MAAM,oBAAoB,sBAAsB;;AAG/E,SAAgB,wBAAuC;AACrD,QAAO,UAAU,iBAAiB;;AAGpC,SAAgB,kBAAkB,QAAsB;AACtD,WAAU,kBAAkB,OAAO;;;;;;;;;;;;;;;;;;AAoCrC,SAAgB,iCAAiC,QAAa,QAAgB;AAC5E,QAAO;EACL,UAAU;GAAC;GAAO;GAAqB;GAAO;EAC9C,SAAS,YAAY;AACnB,OAAI;AAEF,WADe,MAAM,OAAO,IAAI,qBAAqB,EAAE,QAAQ,CAAC;WAM1D;AAEN,WAAO;KACL,QAAQ;KACR,UAAU,EAAE;KACZ,gBAAgB;KACjB;;;EAGL,WAAW,OAAO;EAClB,QAAQ,OAAO;EAChB;;;;;;;;;;;;;;;;;AAkBH,SAAgB,4BAA4B,QAAa;AACvD,QAAO;EACL,UAAU,CAAC,OAAO,eAAe;EACjC,SAAS,YAAY;AACnB,OAAI;AAEF,WADe,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;WAK7C;AAEN,WAAO;KACL,SAAS,CAAC,eAAe;KACzB,eAAe;KAChB;;;EAGL,WAAW,OAAO;EAClB,QAAQ,OAAO;EAChB;;AAYH,SAAS,kBAAkB,EACzB,eACA,YACuC;CACvC,MAAM,SAAS,cAAc,aAAa;CAC1C,MAAM,CAAC,QAAQ,kBAAkB,SAAS,cAAc;CAGxD,MAAM,EAAE,MAAM,gBAAgB,iBAC5B,4BAA4B,OAAO,CACpC;CAGD,MAAM,EAAE,MAAM,qBAAqB,iBACjC,iCAAiC,QAAQ,OAAO,CACjD;CAGD,MAAM,YAAY,aAAa,cAAsB;AACnD,iBAAe,UAAU;AACzB,oBAAkB,UAAU;IAC3B,EAAE,CAAC;AAaN,QAAO,oBAAC;EAAa,SAVD,cAAc;AAChC,UAAO,iBAAiB;IACtB,QAAQ,iBAAiB;IACzB,SAAS,YAAY;IACrB,UAAU,GAAG,iBAAiB,SAAS,iBAAiB,UAAU;IAClE,gBAAgB,iBAAiB;IACjC,gBAAgB;IACjB,CAAC;KACD;GAAC;GAAkB,YAAY;GAAS;GAAU,CAAC;EAEV;GAAwB;;AAOtE,SAAS,kBAAgC;AACvC,QACE,oBAAC;EAAI,WAAU;YACb,qBAAC;GAAI,WAAU;cACb,oBAAC,SAAI,WAAU,wGAAwG,EACvH,oBAAC;IAAK,WAAU;cAAsC;KAAiB;IACnE;GACF;;;;;;;;;;;;;;;;;;;AAyBV,SAAgB,qBAAqB,EACnC,eACA,UACA,YAC0C;CAC1C,MAAM,iBACJ,iBAAiB,uBAAuB,IAAI;AAE9C,QACE,oBAAC;EAAS,UAAU,YAAY,oBAAC,oBAAkB;YACjD,oBAAC;GAAkB,eAAe;GAC/B;IACiB;GACX"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ScopePickerProps } from "./types.mjs";
|
|
2
|
+
import * as react_jsx_runtime30 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/client/scope/picker.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Scope Picker Component
|
|
8
|
+
*
|
|
9
|
+
* Renders a dropdown for selecting the current scope.
|
|
10
|
+
* Integrates with ScopeProvider to manage the selected scope.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Fetch options from a collection
|
|
15
|
+
* <ScopePicker
|
|
16
|
+
* collection="properties"
|
|
17
|
+
* labelField="name"
|
|
18
|
+
* placeholder="Select property..."
|
|
19
|
+
* allowClear
|
|
20
|
+
* />
|
|
21
|
+
*
|
|
22
|
+
* // Use static options
|
|
23
|
+
* <ScopePicker
|
|
24
|
+
* options={[
|
|
25
|
+
* { value: 'org_1', label: 'Organization 1' },
|
|
26
|
+
* { value: 'org_2', label: 'Organization 2' },
|
|
27
|
+
* ]}
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* // Use async options loader
|
|
31
|
+
* <ScopePicker
|
|
32
|
+
* loadOptions={async () => {
|
|
33
|
+
* const response = await fetch('/api/my-scopes');
|
|
34
|
+
* return response.json();
|
|
35
|
+
* }}
|
|
36
|
+
* />
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
declare function ScopePicker({
|
|
40
|
+
collection,
|
|
41
|
+
labelField,
|
|
42
|
+
valueField,
|
|
43
|
+
options: staticOptions,
|
|
44
|
+
loadOptions,
|
|
45
|
+
placeholder,
|
|
46
|
+
label,
|
|
47
|
+
allowClear,
|
|
48
|
+
clearText,
|
|
49
|
+
className,
|
|
50
|
+
compact
|
|
51
|
+
}: ScopePickerProps): react_jsx_runtime30.JSX.Element;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { ScopePicker };
|
|
54
|
+
//# sourceMappingURL=picker.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker.d.mts","names":[],"sources":["../../../src/client/scope/picker.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDgB,WAAA;;;;WAIN;;;;;;;;GAQP,mBAAgB,mBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { useAdminStore } from "../runtime/provider.mjs";
|
|
3
|
+
import { Skeleton } from "../components/ui/skeleton.mjs";
|
|
4
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../components/ui/select.mjs";
|
|
5
|
+
import { useScope } from "./provider.mjs";
|
|
6
|
+
import { Icon } from "@iconify/react";
|
|
7
|
+
import { useQuery } from "@tanstack/react-query";
|
|
8
|
+
import { useCallback, useMemo } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region src/client/scope/picker.tsx
|
|
12
|
+
/**
|
|
13
|
+
* Scope Picker Component
|
|
14
|
+
*
|
|
15
|
+
* A dropdown picker for selecting the current scope in multi-tenant apps.
|
|
16
|
+
* Can fetch options from a collection or use static options.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Scope Picker Component
|
|
20
|
+
*
|
|
21
|
+
* Renders a dropdown for selecting the current scope.
|
|
22
|
+
* Integrates with ScopeProvider to manage the selected scope.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // Fetch options from a collection
|
|
27
|
+
* <ScopePicker
|
|
28
|
+
* collection="properties"
|
|
29
|
+
* labelField="name"
|
|
30
|
+
* placeholder="Select property..."
|
|
31
|
+
* allowClear
|
|
32
|
+
* />
|
|
33
|
+
*
|
|
34
|
+
* // Use static options
|
|
35
|
+
* <ScopePicker
|
|
36
|
+
* options={[
|
|
37
|
+
* { value: 'org_1', label: 'Organization 1' },
|
|
38
|
+
* { value: 'org_2', label: 'Organization 2' },
|
|
39
|
+
* ]}
|
|
40
|
+
* />
|
|
41
|
+
*
|
|
42
|
+
* // Use async options loader
|
|
43
|
+
* <ScopePicker
|
|
44
|
+
* loadOptions={async () => {
|
|
45
|
+
* const response = await fetch('/api/my-scopes');
|
|
46
|
+
* return response.json();
|
|
47
|
+
* }}
|
|
48
|
+
* />
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
function ScopePicker({ collection, labelField = "name", valueField = "id", options: staticOptions, loadOptions, placeholder = "Select...", label, allowClear = false, clearText = "All", className, compact = false }) {
|
|
52
|
+
const { scopeId, setScope, isLoading: scopeLoading } = useScope();
|
|
53
|
+
const client = useAdminStore((s) => s.client);
|
|
54
|
+
const { data: collectionData, isLoading: collectionLoading, error: collectionError } = useQuery({
|
|
55
|
+
queryKey: [
|
|
56
|
+
"scope-picker",
|
|
57
|
+
collection,
|
|
58
|
+
labelField,
|
|
59
|
+
valueField
|
|
60
|
+
],
|
|
61
|
+
queryFn: async () => {
|
|
62
|
+
if (!collection || !client) return null;
|
|
63
|
+
return (await client.collections[collection].find({
|
|
64
|
+
limit: 100,
|
|
65
|
+
columns: {
|
|
66
|
+
[valueField]: true,
|
|
67
|
+
[labelField]: true
|
|
68
|
+
}
|
|
69
|
+
})).docs.map((doc) => ({
|
|
70
|
+
value: String(doc[valueField]),
|
|
71
|
+
label: String(doc[labelField] ?? doc[valueField])
|
|
72
|
+
}));
|
|
73
|
+
},
|
|
74
|
+
enabled: !!collection && !!client,
|
|
75
|
+
staleTime: 6e4
|
|
76
|
+
});
|
|
77
|
+
const { data: asyncOptions, isLoading: asyncLoading, error: asyncError } = useQuery({
|
|
78
|
+
queryKey: ["scope-picker-async", loadOptions?.toString()],
|
|
79
|
+
queryFn: loadOptions,
|
|
80
|
+
enabled: !!loadOptions,
|
|
81
|
+
staleTime: 6e4
|
|
82
|
+
});
|
|
83
|
+
const options = useMemo(() => {
|
|
84
|
+
if (staticOptions) return staticOptions;
|
|
85
|
+
if (collectionData) return collectionData;
|
|
86
|
+
if (asyncOptions) return asyncOptions;
|
|
87
|
+
return [];
|
|
88
|
+
}, [
|
|
89
|
+
staticOptions,
|
|
90
|
+
collectionData,
|
|
91
|
+
asyncOptions
|
|
92
|
+
]);
|
|
93
|
+
const isLoading = scopeLoading || collectionLoading || asyncLoading;
|
|
94
|
+
const error = collectionError || asyncError;
|
|
95
|
+
const handleValueChange = useCallback((value) => {
|
|
96
|
+
if (!value || value === "__clear__") setScope(null);
|
|
97
|
+
else setScope(value);
|
|
98
|
+
}, [setScope]);
|
|
99
|
+
const selectedLabel = useMemo(() => {
|
|
100
|
+
if (!scopeId) return null;
|
|
101
|
+
return options.find((opt) => opt.value === scopeId)?.label ?? scopeId;
|
|
102
|
+
}, [scopeId, options]);
|
|
103
|
+
if (isLoading) return /* @__PURE__ */ jsxs("div", {
|
|
104
|
+
className: cn("space-y-1.5", className),
|
|
105
|
+
children: [label && !compact && /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-16" }), /* @__PURE__ */ jsx(Skeleton, { className: cn("h-9 w-full", compact && "h-8") })]
|
|
106
|
+
});
|
|
107
|
+
if (error) return /* @__PURE__ */ jsx("div", {
|
|
108
|
+
className: cn("text-xs text-destructive", className),
|
|
109
|
+
children: "Failed to load options"
|
|
110
|
+
});
|
|
111
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
112
|
+
className: cn("space-y-1.5", className),
|
|
113
|
+
children: [label && !compact && /* @__PURE__ */ jsx("span", {
|
|
114
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
115
|
+
children: label
|
|
116
|
+
}), /* @__PURE__ */ jsxs(Select, {
|
|
117
|
+
value: scopeId ?? "__clear__",
|
|
118
|
+
onValueChange: (value) => handleValueChange(value),
|
|
119
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
120
|
+
className: cn("w-full", compact && "h-8 text-xs", !scopeId && "text-muted-foreground"),
|
|
121
|
+
children: /* @__PURE__ */ jsx(SelectValue, {
|
|
122
|
+
placeholder,
|
|
123
|
+
children: scopeId ? selectedLabel : allowClear ? clearText : placeholder
|
|
124
|
+
})
|
|
125
|
+
}), /* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
126
|
+
allowClear && /* @__PURE__ */ jsx(SelectItem, {
|
|
127
|
+
value: "__clear__",
|
|
128
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
129
|
+
className: "flex items-center gap-2",
|
|
130
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
131
|
+
icon: "ph:globe",
|
|
132
|
+
className: "size-4 text-muted-foreground"
|
|
133
|
+
}), clearText]
|
|
134
|
+
})
|
|
135
|
+
}),
|
|
136
|
+
options.map((option) => /* @__PURE__ */ jsx(SelectItem, {
|
|
137
|
+
value: option.value,
|
|
138
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
139
|
+
className: "flex items-center gap-2",
|
|
140
|
+
children: [
|
|
141
|
+
option.icon,
|
|
142
|
+
/* @__PURE__ */ jsx("span", { children: option.label }),
|
|
143
|
+
option.description && /* @__PURE__ */ jsx("span", {
|
|
144
|
+
className: "text-muted-foreground text-xs",
|
|
145
|
+
children: option.description
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
})
|
|
149
|
+
}, option.value)),
|
|
150
|
+
options.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
151
|
+
className: "px-2 py-1.5 text-xs text-muted-foreground",
|
|
152
|
+
children: "No options available"
|
|
153
|
+
})
|
|
154
|
+
] })]
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
export { ScopePicker };
|
|
161
|
+
//# sourceMappingURL=picker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker.mjs","names":[],"sources":["../../../src/client/scope/picker.tsx"],"sourcesContent":["/**\n * Scope Picker Component\n *\n * A dropdown picker for selecting the current scope in multi-tenant apps.\n * Can fetch options from a collection or use static options.\n */\n\nimport { Icon } from \"@iconify/react\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useCallback, useMemo } from \"react\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"../components/ui/select\";\nimport { Skeleton } from \"../components/ui/skeleton\";\nimport { cn } from \"../lib/utils\";\nimport { useAdminStore } from \"../runtime/provider.js\";\nimport { useScope } from \"./provider\";\nimport type { ScopeOption, ScopePickerProps } from \"./types\";\n\n/**\n * Scope Picker Component\n *\n * Renders a dropdown for selecting the current scope.\n * Integrates with ScopeProvider to manage the selected scope.\n *\n * @example\n * ```tsx\n * // Fetch options from a collection\n * <ScopePicker\n * collection=\"properties\"\n * labelField=\"name\"\n * placeholder=\"Select property...\"\n * allowClear\n * />\n *\n * // Use static options\n * <ScopePicker\n * options={[\n * { value: 'org_1', label: 'Organization 1' },\n * { value: 'org_2', label: 'Organization 2' },\n * ]}\n * />\n *\n * // Use async options loader\n * <ScopePicker\n * loadOptions={async () => {\n * const response = await fetch('/api/my-scopes');\n * return response.json();\n * }}\n * />\n * ```\n */\nexport function ScopePicker({\n\tcollection,\n\tlabelField = \"name\",\n\tvalueField = \"id\",\n\toptions: staticOptions,\n\tloadOptions,\n\tplaceholder = \"Select...\",\n\tlabel,\n\tallowClear = false,\n\tclearText = \"All\",\n\tclassName,\n\tcompact = false,\n}: ScopePickerProps) {\n\tconst { scopeId, setScope, isLoading: scopeLoading } = useScope();\n\tconst client = useAdminStore((s) => s.client);\n\n\t// Fetch options from collection\n\tconst {\n\t\tdata: collectionData,\n\t\tisLoading: collectionLoading,\n\t\terror: collectionError,\n\t} = useQuery({\n\t\tqueryKey: [\"scope-picker\", collection, labelField, valueField],\n\t\tqueryFn: async () => {\n\t\t\tif (!collection || !client) return null;\n\n\t\t\tconst result = await (client.collections as any)[collection].find({\n\t\t\t\tlimit: 100,\n\t\t\t\tcolumns: {\n\t\t\t\t\t[valueField]: true,\n\t\t\t\t\t[labelField]: true,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treturn result.docs.map((doc: any) => ({\n\t\t\t\tvalue: String(doc[valueField]),\n\t\t\t\tlabel: String(doc[labelField] ?? doc[valueField]),\n\t\t\t}));\n\t\t},\n\t\tenabled: !!collection && !!client,\n\t\tstaleTime: 60000, // 1 minute\n\t});\n\n\t// Fetch options from async loader\n\tconst {\n\t\tdata: asyncOptions,\n\t\tisLoading: asyncLoading,\n\t\terror: asyncError,\n\t} = useQuery({\n\t\tqueryKey: [\"scope-picker-async\", loadOptions?.toString()],\n\t\tqueryFn: loadOptions!,\n\t\tenabled: !!loadOptions,\n\t\tstaleTime: 60000,\n\t});\n\n\t// Combine options from all sources\n\tconst options = useMemo((): ScopeOption[] => {\n\t\tif (staticOptions) return staticOptions;\n\t\tif (collectionData) return collectionData;\n\t\tif (asyncOptions) return asyncOptions;\n\t\treturn [];\n\t}, [staticOptions, collectionData, asyncOptions]);\n\n\tconst isLoading = scopeLoading || collectionLoading || asyncLoading;\n\tconst error = collectionError || asyncError;\n\n\t// Handle selection change\n\tconst handleValueChange = useCallback(\n\t\t(value: string | null) => {\n\t\t\tif (!value || value === \"__clear__\") {\n\t\t\t\tsetScope(null);\n\t\t\t} else {\n\t\t\t\tsetScope(value);\n\t\t\t}\n\t\t},\n\t\t[setScope],\n\t);\n\n\t// Get current selection label\n\tconst selectedLabel = useMemo(() => {\n\t\tif (!scopeId) return null;\n\t\tconst option = options.find((opt) => opt.value === scopeId);\n\t\treturn option?.label ?? scopeId;\n\t}, [scopeId, options]);\n\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<div className={cn(\"space-y-1.5\", className)}>\n\t\t\t\t{label && !compact && <Skeleton className=\"h-3 w-16\" />}\n\t\t\t\t<Skeleton className={cn(\"h-9 w-full\", compact && \"h-8\")} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (error) {\n\t\treturn (\n\t\t\t<div className={cn(\"text-xs text-destructive\", className)}>\n\t\t\t\tFailed to load options\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className={cn(\"space-y-1.5\", className)}>\n\t\t\t{label && !compact && (\n\t\t\t\t<span className=\"text-xs font-medium text-muted-foreground\">\n\t\t\t\t\t{label}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t\t<Select\n\t\t\t\tvalue={scopeId ?? \"__clear__\"}\n\t\t\t\tonValueChange={(value) => handleValueChange(value)}\n\t\t\t>\n\t\t\t\t<SelectTrigger\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"w-full\",\n\t\t\t\t\t\tcompact && \"h-8 text-xs\",\n\t\t\t\t\t\t!scopeId && \"text-muted-foreground\",\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<SelectValue placeholder={placeholder}>\n\t\t\t\t\t\t{scopeId ? selectedLabel : allowClear ? clearText : placeholder}\n\t\t\t\t\t</SelectValue>\n\t\t\t\t</SelectTrigger>\n\t\t\t\t<SelectContent>\n\t\t\t\t\t{allowClear && (\n\t\t\t\t\t\t<SelectItem value=\"__clear__\">\n\t\t\t\t\t\t\t<span className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\ticon=\"ph:globe\"\n\t\t\t\t\t\t\t\t\tclassName=\"size-4 text-muted-foreground\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{clearText}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</SelectItem>\n\t\t\t\t\t)}\n\t\t\t\t\t{options.map((option) => (\n\t\t\t\t\t\t<SelectItem key={option.value} value={option.value}>\n\t\t\t\t\t\t\t<span className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t\t{option.icon}\n\t\t\t\t\t\t\t\t<span>{option.label}</span>\n\t\t\t\t\t\t\t\t{option.description && (\n\t\t\t\t\t\t\t\t\t<span className=\"text-muted-foreground text-xs\">\n\t\t\t\t\t\t\t\t\t\t{option.description}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</SelectItem>\n\t\t\t\t\t))}\n\t\t\t\t\t{options.length === 0 && (\n\t\t\t\t\t\t<div className=\"px-2 py-1.5 text-xs text-muted-foreground\">\n\t\t\t\t\t\t\tNo options available\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</SelectContent>\n\t\t\t</Select>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,SAAgB,YAAY,EAC3B,YACA,aAAa,QACb,aAAa,MACb,SAAS,eACT,aACA,cAAc,aACd,OACA,aAAa,OACb,YAAY,OACZ,WACA,UAAU,SACU;CACpB,MAAM,EAAE,SAAS,UAAU,WAAW,iBAAiB,UAAU;CACjE,MAAM,SAAS,eAAe,MAAM,EAAE,OAAO;CAG7C,MAAM,EACL,MAAM,gBACN,WAAW,mBACX,OAAO,oBACJ,SAAS;EACZ,UAAU;GAAC;GAAgB;GAAY;GAAY;GAAW;EAC9D,SAAS,YAAY;AACpB,OAAI,CAAC,cAAc,CAAC,OAAQ,QAAO;AAUnC,WARe,MAAO,OAAO,YAAoB,YAAY,KAAK;IACjE,OAAO;IACP,SAAS;MACP,aAAa;MACb,aAAa;KACd;IACD,CAAC,EAEY,KAAK,KAAK,SAAc;IACrC,OAAO,OAAO,IAAI,YAAY;IAC9B,OAAO,OAAO,IAAI,eAAe,IAAI,YAAY;IACjD,EAAE;;EAEJ,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC;EAC3B,WAAW;EACX,CAAC;CAGF,MAAM,EACL,MAAM,cACN,WAAW,cACX,OAAO,eACJ,SAAS;EACZ,UAAU,CAAC,sBAAsB,aAAa,UAAU,CAAC;EACzD,SAAS;EACT,SAAS,CAAC,CAAC;EACX,WAAW;EACX,CAAC;CAGF,MAAM,UAAU,cAA6B;AAC5C,MAAI,cAAe,QAAO;AAC1B,MAAI,eAAgB,QAAO;AAC3B,MAAI,aAAc,QAAO;AACzB,SAAO,EAAE;IACP;EAAC;EAAe;EAAgB;EAAa,CAAC;CAEjD,MAAM,YAAY,gBAAgB,qBAAqB;CACvD,MAAM,QAAQ,mBAAmB;CAGjC,MAAM,oBAAoB,aACxB,UAAyB;AACzB,MAAI,CAAC,SAAS,UAAU,YACvB,UAAS,KAAK;MAEd,UAAS,MAAM;IAGjB,CAAC,SAAS,CACV;CAGD,MAAM,gBAAgB,cAAc;AACnC,MAAI,CAAC,QAAS,QAAO;AAErB,SADe,QAAQ,MAAM,QAAQ,IAAI,UAAU,QAAQ,EAC5C,SAAS;IACtB,CAAC,SAAS,QAAQ,CAAC;AAEtB,KAAI,UACH,QACC,qBAAC;EAAI,WAAW,GAAG,eAAe,UAAU;aAC1C,SAAS,CAAC,WAAW,oBAAC,YAAS,WAAU,aAAa,EACvD,oBAAC,YAAS,WAAW,GAAG,cAAc,WAAW,MAAM,GAAI;GACtD;AAIR,KAAI,MACH,QACC,oBAAC;EAAI,WAAW,GAAG,4BAA4B,UAAU;YAAE;GAErD;AAIR,QACC,qBAAC;EAAI,WAAW,GAAG,eAAe,UAAU;aAC1C,SAAS,CAAC,WACV,oBAAC;GAAK,WAAU;aACd;IACK,EAER,qBAAC;GACA,OAAO,WAAW;GAClB,gBAAgB,UAAU,kBAAkB,MAAM;cAElD,oBAAC;IACA,WAAW,GACV,UACA,WAAW,eACX,CAAC,WAAW,wBACZ;cAED,oBAAC;KAAyB;eACxB,UAAU,gBAAgB,aAAa,YAAY;MACvC;KACC,EAChB,qBAAC;IACC,cACA,oBAAC;KAAW,OAAM;eACjB,qBAAC;MAAK,WAAU;iBACf,oBAAC;OACA,MAAK;OACL,WAAU;QACT,EACD;OACK;MACK;IAEb,QAAQ,KAAK,WACb,oBAAC;KAA8B,OAAO,OAAO;eAC5C,qBAAC;MAAK,WAAU;;OACd,OAAO;OACR,oBAAC,oBAAM,OAAO,QAAa;OAC1B,OAAO,eACP,oBAAC;QAAK,WAAU;kBACd,OAAO;SACF;;OAEF;OATS,OAAO,MAUX,CACZ;IACD,QAAQ,WAAW,KACnB,oBAAC;KAAI,WAAU;eAA4C;MAErD;OAEQ;IACR;GACJ"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ScopeContextValue, ScopeProviderProps } from "./types.mjs";
|
|
2
|
+
import * as react_jsx_runtime31 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/client/scope/provider.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Fetch function type (browser-compatible, avoids Bun-specific types)
|
|
8
|
+
*/
|
|
9
|
+
type FetchFn = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
10
|
+
/**
|
|
11
|
+
* Provider component for scope selection.
|
|
12
|
+
*
|
|
13
|
+
* Wrap your admin app with this provider to enable scope-based filtering.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <ScopeProvider
|
|
18
|
+
* headerName="x-selected-property"
|
|
19
|
+
* storageKey="admin-property"
|
|
20
|
+
* >
|
|
21
|
+
* <AdminProvider {...props}>
|
|
22
|
+
* {children}
|
|
23
|
+
* </AdminProvider>
|
|
24
|
+
* </ScopeProvider>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function ScopeProvider({
|
|
28
|
+
children,
|
|
29
|
+
headerName,
|
|
30
|
+
storageKey,
|
|
31
|
+
defaultScope
|
|
32
|
+
}: ScopeProviderProps): react_jsx_runtime31.JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* Hook to access the current scope context.
|
|
35
|
+
*
|
|
36
|
+
* @throws Error if used outside of ScopeProvider
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* function MyComponent() {
|
|
41
|
+
* const { scopeId, setScope, clearScope } = useScope();
|
|
42
|
+
*
|
|
43
|
+
* return (
|
|
44
|
+
* <div>
|
|
45
|
+
* Current scope: {scopeId ?? 'None'}
|
|
46
|
+
* <button onClick={() => setScope('org_123')}>
|
|
47
|
+
* Switch to Org 123
|
|
48
|
+
* </button>
|
|
49
|
+
* <button onClick={clearScope}>Clear</button>
|
|
50
|
+
* </div>
|
|
51
|
+
* );
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare function useScope(): ScopeContextValue;
|
|
56
|
+
/**
|
|
57
|
+
* Hook to check if we're inside a ScopeProvider.
|
|
58
|
+
* Returns null if not inside a provider (doesn't throw).
|
|
59
|
+
*/
|
|
60
|
+
declare function useScopeSafe(): ScopeContextValue | null;
|
|
61
|
+
/**
|
|
62
|
+
* Hook to create a fetch wrapper that automatically injects the scope header.
|
|
63
|
+
*
|
|
64
|
+
* Use this when creating the QuestpieClient to ensure all API calls
|
|
65
|
+
* include the selected scope.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* function AdminWithScopedClient() {
|
|
70
|
+
* const scopedFetch = useScopedFetch();
|
|
71
|
+
*
|
|
72
|
+
* const client = useMemo(() =>
|
|
73
|
+
* createClient<typeof cms>({
|
|
74
|
+
* baseURL: '/api',
|
|
75
|
+
* fetch: scopedFetch,
|
|
76
|
+
* }),
|
|
77
|
+
* [scopedFetch]
|
|
78
|
+
* );
|
|
79
|
+
*
|
|
80
|
+
* return <AdminProvider client={client} {...rest} />;
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
declare function useScopedFetch(): FetchFn;
|
|
85
|
+
/**
|
|
86
|
+
* Creates a fetch function that injects scope headers.
|
|
87
|
+
* Use this outside of React components.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* let currentScopeId: string | null = null;
|
|
92
|
+
*
|
|
93
|
+
* const scopedFetch = createScopedFetch(
|
|
94
|
+
* 'x-selected-property',
|
|
95
|
+
* () => currentScopeId
|
|
96
|
+
* );
|
|
97
|
+
*
|
|
98
|
+
* const client = createClient({ fetch: scopedFetch, ... });
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
declare function createScopedFetch(headerName: string, getScopeId: () => string | null): FetchFn;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { ScopeProvider, createScopedFetch, useScope, useScopeSafe, useScopedFetch };
|
|
104
|
+
//# sourceMappingURL=provider.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.mts","names":[],"sources":["../../../src/client/scope/provider.tsx"],"sourcesContent":[],"mappings":";;;;;;;;KAmBK,OAAA,GAGO,CAAA,KAAA,EAFJ,WAEI,GAFU,GAEV,EAAA,IAAA,CAAA,EADJ,WACI,EAAA,GAAP,OAAO,CAAC,QAAD,CAAA;AAqBZ;;;;;;;;AAmFA;AAYA;AA2BA;AA+BA;;;;;;iBAzJgB,aAAA;;;;;GAKb,qBAAkB,mBAAA,CAAA,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;iBA8EL,QAAA,CAAA,GAAY;;;;;iBAYZ,YAAA,CAAA,GAAgB;;;;;;;;;;;;;;;;;;;;;;;;iBA2BhB,cAAA,CAAA,GAAkB;;;;;;;;;;;;;;;;;iBA+BlB,iBAAA,uDAGb"}
|