@rebasepro/cms 0.24.0 → 0.24.1-canary.g19596ef
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 +3 -1
- package/dist/collection_editor/CollectionEditorDialogsContext.js +10 -0
- package/dist/collection_editor/CollectionEditorDialogsContext.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.js +274 -0
- package/dist/collection_editor/ConfigControllerProvider.js.map +1 -0
- package/dist/collection_editor/api/generateCollectionApi.js +64 -0
- package/dist/collection_editor/api/generateCollectionApi.js.map +1 -0
- package/dist/collection_editor/collection_wire.d.ts +13 -0
- package/dist/collection_editor/collection_wire.js +49 -0
- package/dist/collection_editor/collection_wire.js.map +1 -0
- package/dist/collection_editor/liveSchemaClient.js +130 -0
- package/dist/collection_editor/liveSchemaClient.js.map +1 -0
- package/dist/collection_editor/relation_kinds.js +74 -0
- package/dist/collection_editor/relation_kinds.js.map +1 -0
- package/dist/collection_editor/serializable_types.d.ts +4 -1
- package/dist/collection_editor/serializable_utils.js +504 -0
- package/dist/collection_editor/serializable_utils.js.map +1 -0
- package/dist/collection_editor/ui/EditorCollectionAction.js +37 -0
- package/dist/collection_editor/ui/EditorCollectionAction.js.map +1 -0
- package/dist/collection_editor/ui/MissingReferenceWidget.js +39 -0
- package/dist/collection_editor/ui/MissingReferenceWidget.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js +160 -0
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js +61 -0
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js +731 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js +220 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js +160 -0
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js +394 -0
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js +616 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js +68 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js +11 -0
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js +148 -0
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js +244 -0
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/EnumForm.js +222 -0
- package/dist/collection_editor/ui/collection_editor/EnumForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js +204 -0
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js +108 -0
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js +163 -0
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js +59 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.js +640 -0
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js +141 -0
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/PropertyTree.js +210 -0
- package/dist/collection_editor/ui/collection_editor/PropertyTree.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js +31 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js +25 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js.map +1 -0
- package/dist/{SchemaChangeDialog-CcFSXvkK.js → collection_editor/ui/collection_editor/SchemaChangeDialog.js} +42 -59
- package/dist/collection_editor/ui/collection_editor/SchemaChangeDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/SwitchControl.js +24 -0
- package/dist/collection_editor/ui/collection_editor/SwitchControl.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js +66 -0
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js +61 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js +188 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.d.ts +12 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js +74 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js +100 -0
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js +34 -0
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js +75 -0
- package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js +338 -0
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js +83 -0
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js +15 -0
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js +121 -0
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js +127 -0
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js +151 -0
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js +77 -0
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js +254 -0
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js +71 -0
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js +356 -0
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js +173 -0
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js +79 -0
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js +34 -0
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js +47 -0
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js +47 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js +62 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js +119 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +10 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js +178 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js +23 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.js +116 -0
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.js +182 -0
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/products_template.js +87 -0
- package/dist/collection_editor/ui/collection_editor/templates/products_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/users_template.js +46 -0
- package/dist/collection_editor/ui/collection_editor/templates/users_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/util.js +20 -0
- package/dist/collection_editor/ui/collection_editor/util.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/utils/strings.js +2 -0
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js +37 -0
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js +192 -0
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js.map +1 -0
- package/dist/collection_editor/useCollectionEditorController.js +12 -0
- package/dist/collection_editor/useCollectionEditorController.js.map +1 -0
- package/dist/collection_editor/useCollectionsConfigController.js +12 -0
- package/dist/collection_editor/useCollectionsConfigController.js.map +1 -0
- package/dist/collection_editor/useJsonCollectionsConfigController.js +191 -0
- package/dist/collection_editor/useJsonCollectionsConfigController.js.map +1 -0
- package/dist/collection_editor/useLiveSchemaEditing.js +214 -0
- package/dist/collection_editor/useLiveSchemaEditing.js.map +1 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.js +228 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.js.map +1 -0
- package/dist/collection_editor/useSafeSnackbarController.js +13 -0
- package/dist/collection_editor/useSafeSnackbarController.js.map +1 -0
- package/dist/collection_editor/validateCollectionJson.js +289 -0
- package/dist/collection_editor/validateCollectionJson.js.map +1 -0
- package/dist/collection_editor_ui.js +7 -33
- package/dist/components/AdditionalFieldValue.js +60 -0
- package/dist/components/AdditionalFieldValue.js.map +1 -0
- package/dist/components/AdminModeSyncer.js +41 -0
- package/dist/components/AdminModeSyncer.js.map +1 -0
- package/dist/components/ArrayContainer.d.ts +8 -2
- package/dist/components/ArrayContainer.js +363 -0
- package/dist/components/ArrayContainer.js.map +1 -0
- package/dist/components/ClearFilterSortButton.js +33 -0
- package/dist/components/ClearFilterSortButton.js.map +1 -0
- package/dist/components/CollectionEditorDialogs.js +49 -0
- package/dist/components/CollectionEditorDialogs.js.map +1 -0
- package/dist/components/CollectionPanel.d.ts +26 -5
- package/dist/components/CollectionPanel.js +142 -0
- package/dist/components/CollectionPanel.js.map +1 -0
- package/dist/components/CollectionTableBinding/CollectionRowActions.js +165 -0
- package/dist/components/CollectionTableBinding/CollectionRowActions.js.map +1 -0
- package/dist/components/CollectionTableBinding/CollectionTableBinding.js +329 -0
- package/dist/components/CollectionTableBinding/CollectionTableBinding.js.map +1 -0
- package/dist/components/CollectionTableBinding/PropertyTableCell.js +311 -0
- package/dist/components/CollectionTableBinding/PropertyTableCell.js.map +1 -0
- package/dist/components/CollectionTableBinding/column_utils.js +85 -0
- package/dist/components/CollectionTableBinding/column_utils.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js +45 -0
- package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js +66 -0
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.js +86 -0
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationField.js +93 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js +33 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js +171 -0
- package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js +91 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js +36 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js.map +1 -0
- package/dist/components/CollectionTableBinding/index.js +6 -0
- package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js +50 -0
- package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.d.ts +2 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.js +223 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js +58 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/TableCellOpener.js +53 -0
- package/dist/components/CollectionTableBinding/internal/TableCellOpener.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/common.js +40 -0
- package/dist/components/CollectionTableBinding/internal/common.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js +270 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js +68 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js +24 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js.map +1 -0
- package/dist/components/CollectionTableBinding/table_bindings.js +306 -0
- package/dist/components/CollectionTableBinding/table_bindings.js.map +1 -0
- package/dist/components/CollectionViewBinding/BoardCardBinding.js +160 -0
- package/dist/components/CollectionViewBinding/BoardCardBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js +471 -0
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js +108 -0
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.js +988 -0
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.js +146 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewBinding.js +1209 -0
- package/dist/components/CollectionViewBinding/CollectionViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.js +133 -0
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.js.map +1 -0
- package/dist/components/CollectionViewBinding/EntityCardBinding.js +133 -0
- package/dist/components/CollectionViewBinding/EntityCardBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/FilterPresetsButton.js +203 -0
- package/dist/components/CollectionViewBinding/FilterPresetsButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/FiltersDialog.js +148 -0
- package/dist/components/CollectionViewBinding/FiltersDialog.js.map +1 -0
- package/dist/components/CollectionViewBinding/SearchExplanation.js +86 -0
- package/dist/components/CollectionViewBinding/SearchExplanation.js.map +1 -0
- package/dist/components/CollectionViewBinding/SearchHighlight.js +262 -0
- package/dist/components/CollectionViewBinding/SearchHighlight.js.map +1 -0
- package/dist/components/CollectionViewBinding/SlotValue.js +117 -0
- package/dist/components/CollectionViewBinding/SlotValue.js.map +1 -0
- package/dist/components/CollectionViewBinding/SortButton.js +214 -0
- package/dist/components/CollectionViewBinding/SortButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListCloseButton.js +41 -0
- package/dist/components/CollectionViewBinding/SplitListCloseButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListShowButton.js +29 -0
- package/dist/components/CollectionViewBinding/SplitListShowButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListView.js +311 -0
- package/dist/components/CollectionViewBinding/SplitListView.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitViewContext.js +21 -0
- package/dist/components/CollectionViewBinding/SplitViewContext.js.map +1 -0
- package/dist/components/CollectionViewBinding/ViewModeToggle.js +150 -0
- package/dist/components/CollectionViewBinding/ViewModeToggle.js.map +1 -0
- package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js +49 -0
- package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js.map +1 -0
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js +122 -0
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js.map +1 -0
- package/dist/components/CollectionViewBinding/useBoardDataController.js +530 -0
- package/dist/components/CollectionViewBinding/useBoardDataController.js.map +1 -0
- package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +4 -1
- package/dist/components/CollectionViewBinding/usePreviewSlots.js +384 -0
- package/dist/components/CollectionViewBinding/usePreviewSlots.js.map +1 -0
- package/dist/components/CollectionViewBinding/useSelectionController.js +104 -0
- package/dist/components/CollectionViewBinding/useSelectionController.js.map +1 -0
- package/dist/components/CollectionViewBinding/utils.js +21 -0
- package/dist/components/CollectionViewBinding/utils.js.map +1 -0
- package/dist/components/CollectionsProvider.d.ts +44 -0
- package/dist/components/CollectionsProvider.js +137 -0
- package/dist/components/CollectionsProvider.js.map +1 -0
- package/dist/components/CollectionsScopeContext.d.ts +18 -0
- package/dist/components/CollectionsScopeContext.js +25 -0
- package/dist/components/CollectionsScopeContext.js.map +1 -0
- package/dist/components/DefaultAppBar.js +179 -0
- package/dist/components/DefaultAppBar.js.map +1 -0
- package/dist/components/DefaultDrawer.js +364 -0
- package/dist/components/DefaultDrawer.js.map +1 -0
- package/dist/components/DeleteEntityDialog.js +256 -0
- package/dist/components/DeleteEntityDialog.js.map +1 -0
- package/dist/components/DetailViewBinding.js +504 -0
- package/dist/components/DetailViewBinding.js.map +1 -0
- package/dist/components/DrawerNavigationGroup.js +74 -0
- package/dist/components/DrawerNavigationGroup.js.map +1 -0
- package/dist/components/DrawerNavigationItem.d.ts +8 -0
- package/dist/components/DrawerNavigationItem.js +45 -0
- package/dist/components/DrawerNavigationItem.js.map +1 -0
- package/dist/components/EditFormActions.js +210 -0
- package/dist/components/EditFormActions.js.map +1 -0
- package/dist/components/EditViewBinding.js +802 -0
- package/dist/components/EditViewBinding.js.map +1 -0
- package/dist/components/EntityDisplayHeader.js +139 -0
- package/dist/components/EntityDisplayHeader.js.map +1 -0
- package/dist/components/EntityFormPanel.d.ts +58 -0
- package/dist/components/EntityFormPanel.js +126 -0
- package/dist/components/EntityFormPanel.js.map +1 -0
- package/dist/components/EntityIdentityBar.js +364 -0
- package/dist/components/EntityIdentityBar.js.map +1 -0
- package/dist/components/EntityInspector.js +96 -0
- package/dist/components/EntityInspector.js.map +1 -0
- package/dist/components/EntityPreviewBinding.js +282 -0
- package/dist/components/EntityPreviewBinding.js.map +1 -0
- package/dist/components/EntityPreviewNesting.js +53 -0
- package/dist/components/EntityPreviewNesting.js.map +1 -0
- package/dist/components/EntityViewBinding.js +246 -0
- package/dist/components/EntityViewBinding.js.map +1 -0
- package/dist/components/FieldCaption.js +17 -0
- package/dist/components/FieldCaption.js.map +1 -0
- package/dist/components/HomePage/ContentHomePage.js +326 -0
- package/dist/components/HomePage/ContentHomePage.js.map +1 -0
- package/dist/components/HomePage/FavouritesView.js +44 -0
- package/dist/components/HomePage/FavouritesView.js.map +1 -0
- package/dist/components/HomePage/HomePageDnD.js +436 -0
- package/dist/components/HomePage/HomePageDnD.js.map +1 -0
- package/dist/components/HomePage/NavigationCard.js +59 -0
- package/dist/components/HomePage/NavigationCard.js.map +1 -0
- package/dist/components/HomePage/NavigationCardBinding.js +70 -0
- package/dist/components/HomePage/NavigationCardBinding.js.map +1 -0
- package/dist/components/HomePage/NavigationGroup.js +98 -0
- package/dist/components/HomePage/NavigationGroup.js.map +1 -0
- package/dist/components/HomePage/RenameGroupDialog.js +89 -0
- package/dist/components/HomePage/RenameGroupDialog.js.map +1 -0
- package/dist/components/InlineEntityPreview.js +116 -0
- package/dist/components/InlineEntityPreview.js.map +1 -0
- package/dist/{JsonPreviewBinding-v0w3H0fp.js → components/JsonPreviewBinding.js} +2 -2
- package/dist/components/JsonPreviewBinding.js.map +1 -0
- package/dist/components/NavigationLoadingErrorView.js +27 -0
- package/dist/components/NavigationLoadingErrorView.js.map +1 -0
- package/dist/components/PickerTrigger.js +27 -0
- package/dist/components/PickerTrigger.js.map +1 -0
- package/dist/components/PropertyCollectionView.js +215 -0
- package/dist/components/PropertyCollectionView.js.map +1 -0
- package/dist/components/PropertyConfigBadge.js +19 -0
- package/dist/components/PropertyConfigBadge.js.map +1 -0
- package/dist/components/PropertyKeyHint.js +58 -0
- package/dist/components/PropertyKeyHint.js.map +1 -0
- package/dist/components/RebaseAuthGate.js +35 -0
- package/dist/components/RebaseAuthGate.js.map +1 -0
- package/dist/components/RebaseCMS.js +44 -0
- package/dist/components/RebaseCMS.js.map +1 -0
- package/dist/components/RebaseLayout.js +59 -0
- package/dist/components/RebaseLayout.js.map +1 -0
- package/dist/components/RebaseNavigation.js +215 -0
- package/dist/components/RebaseNavigation.js.map +1 -0
- package/dist/components/RebaseRouteDefs.js +96 -0
- package/dist/components/RebaseRouteDefs.js.map +1 -0
- package/dist/components/RebaseShell.js +50 -0
- package/dist/components/RebaseShell.js.map +1 -0
- package/dist/components/ReferenceTable/SelectionTableBinding.js +224 -0
- package/dist/components/ReferenceTable/SelectionTableBinding.js.map +1 -0
- package/dist/components/ReferenceWidget.js +100 -0
- package/dist/components/ReferenceWidget.js.map +1 -0
- package/dist/components/RelationSelector.js +625 -0
- package/dist/components/RelationSelector.js.map +1 -0
- package/dist/components/SearchIconsView.js +52 -0
- package/dist/components/SearchIconsView.js.map +1 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
- package/dist/components/SelectableTable/SelectableTable.js +158 -0
- package/dist/components/SelectableTable/SelectableTable.js.map +1 -0
- package/dist/components/SelectableTable/SelectableTableContext.js +8 -0
- package/dist/components/SelectableTable/SelectableTableContext.js.map +1 -0
- package/dist/components/SelectableTable/SelectionStore.js +29 -0
- package/dist/components/SelectableTable/SelectionStore.js.map +1 -0
- package/dist/components/SelectableTable/filters/BooleanFilterField.js +28 -0
- package/dist/components/SelectableTable/filters/BooleanFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.js +93 -0
- package/dist/components/SelectableTable/filters/DateTimeFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/FilterFieldBinding.js +132 -0
- package/dist/components/SelectableTable/filters/FilterFieldBinding.js.map +1 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.js +157 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/RelationFilterField.js +169 -0
- package/dist/components/SelectableTable/filters/RelationFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/StringNumberFilterField.js +181 -0
- package/dist/components/SelectableTable/filters/StringNumberFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/null_filter.js +36 -0
- package/dist/components/SelectableTable/filters/null_filter.js.map +1 -0
- package/dist/components/SideDialogs.js +149 -0
- package/dist/components/SideDialogs.js.map +1 -0
- package/dist/components/SidePanelBinding.js +287 -0
- package/dist/components/SidePanelBinding.js.map +1 -0
- package/dist/components/SidePanelProvider.js +69 -0
- package/dist/components/SidePanelProvider.js.map +1 -0
- package/dist/components/UserSelector.d.ts +2 -0
- package/dist/components/UserSelector.js +418 -0
- package/dist/components/UserSelector.js.map +1 -0
- package/dist/components/admin/CreationResultDialog.js +118 -0
- package/dist/components/admin/CreationResultDialog.js.map +1 -0
- package/dist/components/app/AppBar.js +14 -0
- package/dist/components/app/AppBar.js.map +1 -0
- package/dist/components/app/Drawer.js +26 -0
- package/dist/components/app/Drawer.js.map +1 -0
- package/dist/components/app/Scaffold.js +229 -0
- package/dist/components/app/Scaffold.js.map +1 -0
- package/dist/components/app/useApp.js +24 -0
- package/dist/components/app/useApp.js.map +1 -0
- package/dist/components/common/ActionMenuLabel.js +30 -0
- package/dist/components/common/ActionMenuLabel.js.map +1 -0
- package/dist/components/common/default_entity_actions.js +590 -0
- package/dist/components/common/default_entity_actions.js.map +1 -0
- package/dist/components/drawer_expansion.d.ts +25 -0
- package/dist/components/drawer_expansion.js +44 -0
- package/dist/components/drawer_expansion.js.map +1 -0
- package/dist/components/field_configs.d.ts +2 -2
- package/dist/components/field_configs.js +431 -0
- package/dist/components/field_configs.js.map +1 -0
- package/dist/components/field_ids.d.ts +11 -0
- package/dist/components/field_ids.js +58 -0
- package/dist/components/field_ids.js.map +1 -0
- package/dist/components/history/EntityHistoryEntry.js +151 -0
- package/dist/components/history/EntityHistoryEntry.js.map +1 -0
- package/dist/components/history/EntityHistoryView.js +157 -0
- package/dist/components/history/EntityHistoryView.js.map +1 -0
- package/dist/components/history/UserChip.js +21 -0
- package/dist/components/history/UserChip.js.map +1 -0
- package/dist/components/history/index.js +4 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/lazy_record_views.d.ts +10 -0
- package/dist/components/lazy_record_views.js +57 -0
- package/dist/components/lazy_record_views.js.map +1 -0
- package/dist/contexts/BreacrumbsContext.js +28 -0
- package/dist/contexts/BreacrumbsContext.js.map +1 -0
- package/dist/contexts/EditorAIControllerContext.d.ts +18 -0
- package/dist/contexts/EditorAIControllerContext.js +29 -0
- package/dist/contexts/EditorAIControllerContext.js.map +1 -0
- package/dist/contexts/SideDialogsControllerContext.js +7 -0
- package/dist/contexts/SideDialogsControllerContext.js.map +1 -0
- package/dist/data_export/export/BasicExportAction.js +151 -0
- package/dist/data_export/export/BasicExportAction.js.map +1 -0
- package/dist/data_export/export/ExportCollectionAction.js +297 -0
- package/dist/data_export/export/ExportCollectionAction.js.map +1 -0
- package/dist/data_export/export/additional_fields.js +40 -0
- package/dist/data_export/export/additional_fields.js.map +1 -0
- package/dist/data_export/export/export.d.ts +35 -0
- package/dist/data_export/export/export.js +400 -0
- package/dist/data_export/export/export.js.map +1 -0
- package/dist/data_export/export/fetch_export_data.d.ts +17 -7
- package/dist/data_export/export/fetch_export_data.js +67 -0
- package/dist/data_export/export/fetch_export_data.js.map +1 -0
- package/dist/data_export/export/index.d.ts +4 -2
- package/dist/data_export/export/index.js +5 -0
- package/dist/data_import/components/DataNewPropertiesMapping.js +207 -0
- package/dist/data_import/components/DataNewPropertiesMapping.js.map +1 -0
- package/dist/data_import/components/ImportConversionProblems.js +89 -0
- package/dist/data_import/components/ImportConversionProblems.js.map +1 -0
- package/dist/data_import/components/ImportFileUpload.js +43 -0
- package/dist/data_import/components/ImportFileUpload.js.map +1 -0
- package/dist/data_import/components/ImportNewPropertyFieldPreview.js +42 -0
- package/dist/data_import/components/ImportNewPropertyFieldPreview.js.map +1 -0
- package/dist/data_import/components/ImportSaveInProgress.js +105 -0
- package/dist/data_import/components/ImportSaveInProgress.js.map +1 -0
- package/dist/data_import/hooks/useImportConfig.js +34 -0
- package/dist/data_import/hooks/useImportConfig.js.map +1 -0
- package/dist/{import-DjQoRrIU.js → data_import/import/ImportCollectionAction.js} +53 -43
- package/dist/data_import/import/ImportCollectionAction.js.map +1 -0
- package/dist/data_import/import/index.js +2 -0
- package/dist/data_import/utils/csv.js +146 -0
- package/dist/data_import/utils/csv.js.map +1 -0
- package/dist/data_import/utils/data.js +366 -0
- package/dist/data_import/utils/data.js.map +1 -0
- package/dist/data_import/utils/file_headers.js +32 -0
- package/dist/data_import/utils/file_headers.js.map +1 -0
- package/dist/data_import/utils/file_to_json.js +149 -0
- package/dist/data_import/utils/file_to_json.js.map +1 -0
- package/dist/data_import/utils/get_import_inference_type.js +14 -0
- package/dist/data_import/utils/get_import_inference_type.js.map +1 -0
- package/dist/data_import/utils/id_column.js +27 -0
- package/dist/data_import/utils/id_column.js.map +1 -0
- package/dist/data_import/utils/import_columns.js +92 -0
- package/dist/data_import/utils/import_columns.js.map +1 -0
- package/dist/data_import/utils/save_entities.d.ts +33 -4
- package/dist/data_import/utils/save_entities.js +244 -0
- package/dist/data_import/utils/save_entities.js.map +1 -0
- package/dist/data_import/utils/transforms.js +83 -0
- package/dist/data_import/utils/transforms.js.map +1 -0
- package/dist/editor/components/SlashCommandMenu.js +497 -0
- package/dist/editor/components/SlashCommandMenu.js.map +1 -0
- package/dist/editor/components/editor-bubble-item.js +24 -0
- package/dist/editor/components/editor-bubble-item.js.map +1 -0
- package/dist/editor/components/editor-bubble.js +97 -0
- package/dist/editor/components/editor-bubble.js.map +1 -0
- package/dist/editor/components/image-bubble.js +148 -0
- package/dist/editor/components/image-bubble.js.map +1 -0
- package/dist/editor/components/table-bubble.js +406 -0
- package/dist/editor/components/table-bubble.js.map +1 -0
- package/dist/editor/editor.js +423 -0
- package/dist/editor/editor.js.map +1 -0
- package/dist/editor/extensions/HighlightDecorationExtension.js +74 -0
- package/dist/editor/extensions/HighlightDecorationExtension.js.map +1 -0
- package/dist/editor/extensions/Image.d.ts +7 -1
- package/dist/editor/extensions/Image.js +160 -0
- package/dist/editor/extensions/Image.js.map +1 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.js +82 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.js.map +1 -0
- package/dist/editor/extensions/clipboard.js +63 -0
- package/dist/editor/extensions/clipboard.js.map +1 -0
- package/dist/editor/extensions/drag-and-drop.js +354 -0
- package/dist/editor/extensions/drag-and-drop.js.map +1 -0
- package/dist/editor/hooks/useProseMirror.js +101 -0
- package/dist/editor/hooks/useProseMirror.js.map +1 -0
- package/dist/editor/hooks/useProseMirrorContext.js +11 -0
- package/dist/editor/hooks/useProseMirrorContext.js.map +1 -0
- package/dist/editor/markdown.js +154 -0
- package/dist/editor/markdown.js.map +1 -0
- package/dist/editor/nodeViews/ImageComponent.js +35 -0
- package/dist/editor/nodeViews/ImageComponent.js.map +1 -0
- package/dist/editor/nodeViews/ReactNodeView.js +57 -0
- package/dist/editor/nodeViews/ReactNodeView.js.map +1 -0
- package/dist/editor/nodeViews/TaskItemComponent.js +29 -0
- package/dist/editor/nodeViews/TaskItemComponent.js.map +1 -0
- package/dist/editor/nodeViews/index.js +21 -0
- package/dist/editor/nodeViews/index.js.map +1 -0
- package/dist/editor/plugins/index.js +54 -0
- package/dist/editor/plugins/index.js.map +1 -0
- package/dist/editor/plugins/inputrules.js +54 -0
- package/dist/editor/plugins/inputrules.js.map +1 -0
- package/dist/editor/plugins/placeholderPlugin.js +38 -0
- package/dist/editor/plugins/placeholderPlugin.js.map +1 -0
- package/dist/editor/plugins/slashCommandPlugin.js +40 -0
- package/dist/editor/plugins/slashCommandPlugin.js.map +1 -0
- package/dist/editor/sanitize-html.js +190 -0
- package/dist/editor/sanitize-html.js.map +1 -0
- package/dist/{markdown-CCqp8ibf.js → editor/schema.js} +2 -159
- package/dist/editor/schema.js.map +1 -0
- package/dist/editor/selectors/link-selector.js +118 -0
- package/dist/editor/selectors/link-selector.js.map +1 -0
- package/dist/editor/selectors/node-selector.js +118 -0
- package/dist/editor/selectors/node-selector.js.map +1 -0
- package/dist/editor/selectors/text-buttons.js +71 -0
- package/dist/editor/selectors/text-buttons.js.map +1 -0
- package/dist/editor/utils/prosemirror-utils.js +92 -0
- package/dist/editor/utils/prosemirror-utils.js.map +1 -0
- package/dist/editor/utils/remove_classes.js +16 -0
- package/dist/editor/utils/remove_classes.js.map +1 -0
- package/dist/editor.js +1 -3147
- package/dist/form/EntityForm.js +734 -0
- package/dist/form/EntityForm.js.map +1 -0
- package/dist/form/EntityFormActions.js +101 -0
- package/dist/form/EntityFormActions.js.map +1 -0
- package/dist/form/EntityFormBinding.js +256 -0
- package/dist/form/EntityFormBinding.js.map +1 -0
- package/dist/form/PropertyFieldBinding.js +298 -0
- package/dist/form/PropertyFieldBinding.js.map +1 -0
- package/dist/form/components/ErrorFocus.js +33 -0
- package/dist/form/components/ErrorFocus.js.map +1 -0
- package/dist/form/components/FieldBlock.js +118 -0
- package/dist/form/components/FieldBlock.js.map +1 -0
- package/dist/form/components/FieldHelperText.js +56 -0
- package/dist/form/components/FieldHelperText.js.map +1 -0
- package/dist/form/components/FormRail.js +118 -0
- package/dist/form/components/FormRail.js.map +1 -0
- package/dist/form/components/FormSections.js +63 -0
- package/dist/form/components/FormSections.js.map +1 -0
- package/dist/form/components/LabelWithIcon.js +29 -0
- package/dist/form/components/LabelWithIcon.js.map +1 -0
- package/dist/form/components/LocalChangesMenu.js +127 -0
- package/dist/form/components/LocalChangesMenu.js.map +1 -0
- package/dist/form/components/StorageItemPreview.js +46 -0
- package/dist/form/components/StorageItemPreview.js.map +1 -0
- package/dist/form/components/StorageUploadProgress.js +84 -0
- package/dist/form/components/StorageUploadProgress.js.map +1 -0
- package/dist/form/components/useRailVisible.js +43 -0
- package/dist/form/components/useRailVisible.js.map +1 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js +84 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js +125 -0
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/BinaryFieldBinding.js +135 -0
- package/dist/form/field_bindings/BinaryFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/BlockFieldBinding.js +164 -0
- package/dist/form/field_bindings/BlockFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/DateTimeFieldBinding.js +47 -0
- package/dist/form/field_bindings/DateTimeFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/GeopointFieldBinding.js +148 -0
- package/dist/form/field_bindings/GeopointFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/KeyValueFieldBinding.js +450 -0
- package/dist/form/field_bindings/KeyValueFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MapFieldBinding.js +77 -0
- package/dist/form/field_bindings/MapFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.js +215 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MultiSelectFieldBinding.js +88 -0
- package/dist/form/field_bindings/MultiSelectFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MultipleRelationFieldBinding.js +118 -0
- package/dist/form/field_bindings/MultipleRelationFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/ReadOnlyFieldBinding.js +52 -0
- package/dist/form/field_bindings/ReadOnlyFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.js +99 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/RelationFieldBinding.js +135 -0
- package/dist/form/field_bindings/RelationFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/RepeatFieldBinding.js +103 -0
- package/dist/form/field_bindings/RepeatFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/SelectFieldBinding.js +80 -0
- package/dist/form/field_bindings/SelectFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.js +266 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/SwitchFieldBinding.js +41 -0
- package/dist/form/field_bindings/SwitchFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/TextFieldBinding.js +114 -0
- package/dist/form/field_bindings/TextFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/UserSelectFieldBinding.js +48 -0
- package/dist/form/field_bindings/UserSelectFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/VectorFieldBinding.js +147 -0
- package/dist/form/field_bindings/VectorFieldBinding.js.map +1 -0
- package/dist/form/form_keyboard_scope.d.ts +26 -0
- package/dist/form/form_keyboard_scope.js +39 -0
- package/dist/form/form_keyboard_scope.js.map +1 -0
- package/dist/form/form_uploads.d.ts +24 -0
- package/dist/form/form_uploads.js +31 -0
- package/dist/form/form_uploads.js.map +1 -0
- package/dist/form/form_utils.d.ts +24 -0
- package/dist/form/form_utils.js +280 -0
- package/dist/form/form_utils.js.map +1 -0
- package/dist/form/resolve_cell_property.d.ts +32 -0
- package/dist/form/resolve_cell_property.js +80 -0
- package/dist/form/resolve_cell_property.js.map +1 -0
- package/dist/form/resolve_form_properties.d.ts +2 -1
- package/dist/form/resolve_form_properties.js +78 -0
- package/dist/form/resolve_form_properties.js.map +1 -0
- package/dist/form/useClearRestoreValue.js +27 -0
- package/dist/form/useClearRestoreValue.js.map +1 -0
- package/dist/form/useUndoableDiscard.js +36 -0
- package/dist/form/useUndoableDiscard.js.map +1 -0
- package/dist/form/validation.d.ts +20 -0
- package/dist/form/validation.js +416 -0
- package/dist/form/validation.js.map +1 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.js +22 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.js.map +1 -0
- package/dist/hooks/navigation/contexts/NavigationStateContext.js +15 -0
- package/dist/hooks/navigation/contexts/NavigationStateContext.js.map +1 -0
- package/dist/hooks/navigation/contexts/UrlContext.js +22 -0
- package/dist/hooks/navigation/contexts/UrlContext.js.map +1 -0
- package/dist/hooks/navigation/useAsyncResolver.js +68 -0
- package/dist/hooks/navigation/useAsyncResolver.js.map +1 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.js +141 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.js.map +1 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.js +77 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.js.map +1 -0
- package/dist/hooks/navigation/useBuildUrlController.js +57 -0
- package/dist/hooks/navigation/useBuildUrlController.js.map +1 -0
- package/dist/hooks/navigation/useNavigationResolution.js +177 -0
- package/dist/hooks/navigation/useNavigationResolution.js.map +1 -0
- package/dist/hooks/navigation/useResolvedCollections.js +56 -0
- package/dist/hooks/navigation/useResolvedCollections.js.map +1 -0
- package/dist/hooks/navigation/useResolvedViews.js +94 -0
- package/dist/hooks/navigation/useResolvedViews.js.map +1 -0
- package/dist/hooks/navigation/useTopLevelNavigation.js +162 -0
- package/dist/hooks/navigation/useTopLevelNavigation.js.map +1 -0
- package/dist/hooks/navigation/utils.js +125 -0
- package/dist/hooks/navigation/utils.js.map +1 -0
- package/dist/hooks/useAdminContext.js +45 -0
- package/dist/hooks/useAdminContext.js.map +1 -0
- package/dist/hooks/useBreadcrumbsController.js +17 -0
- package/dist/hooks/useBreadcrumbsController.js.map +1 -0
- package/dist/hooks/useBuildSideDialogsController.js +96 -0
- package/dist/hooks/useBuildSideDialogsController.js.map +1 -0
- package/dist/hooks/useBuildSidePanel.js +221 -0
- package/dist/hooks/useBuildSidePanel.js.map +1 -0
- package/dist/hooks/useChildViewSource.js +41 -0
- package/dist/hooks/useChildViewSource.js.map +1 -0
- package/dist/hooks/useEntityDisplay.js +136 -0
- package/dist/hooks/useEntityDisplay.js.map +1 -0
- package/dist/hooks/useEntityDisplayTitle.js +34 -0
- package/dist/hooks/useEntityDisplayTitle.js.map +1 -0
- package/dist/hooks/useHistory.js +137 -0
- package/dist/hooks/useHistory.js.map +1 -0
- package/dist/hooks/useRecordActions.js +108 -0
- package/dist/hooks/useRecordActions.js.map +1 -0
- package/dist/hooks/useReferencePaths.js +32 -0
- package/dist/hooks/useReferencePaths.js.map +1 -0
- package/dist/hooks/useResolvedNavigationFrom.js +83 -0
- package/dist/hooks/useResolvedNavigationFrom.js.map +1 -0
- package/dist/hooks/useResolvedUsers.js +109 -0
- package/dist/hooks/useResolvedUsers.js.map +1 -0
- package/dist/hooks/useSelectionDialog.js +53 -0
- package/dist/hooks/useSelectionDialog.js.map +1 -0
- package/dist/hooks/useSideDialogsController.js +8 -0
- package/dist/hooks/useSideDialogsController.js.map +1 -0
- package/dist/hooks/useSidePanel.js +15 -0
- package/dist/hooks/useSidePanel.js.map +1 -0
- package/dist/hooks/useStorageReferenceResolver.d.ts +4 -2
- package/dist/hooks/useStorageReferenceResolver.js +49 -0
- package/dist/hooks/useStorageReferenceResolver.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +151 -3867
- package/dist/preview/PropertyPreview.js +260 -0
- package/dist/preview/PropertyPreview.js.map +1 -0
- package/dist/preview/compact_text.js +52 -0
- package/dist/preview/compact_text.js.map +1 -0
- package/dist/preview/components/ArrayEnumPreview.js +24 -0
- package/dist/preview/components/ArrayEnumPreview.js.map +1 -0
- package/dist/preview/components/BooleanPreview.js +25 -0
- package/dist/preview/components/BooleanPreview.js.map +1 -0
- package/dist/preview/components/DatePreview.d.ts +3 -2
- package/dist/preview/components/DatePreview.js +87 -0
- package/dist/preview/components/DatePreview.js.map +1 -0
- package/dist/preview/components/EmptyValue.js +13 -0
- package/dist/preview/components/EmptyValue.js.map +1 -0
- package/dist/preview/components/EnumValuesChip.js +26 -0
- package/dist/preview/components/EnumValuesChip.js.map +1 -0
- package/dist/preview/components/ImagePreview.d.ts +7 -1
- package/dist/preview/components/ImagePreview.js +112 -0
- package/dist/preview/components/ImagePreview.js.map +1 -0
- package/dist/preview/components/InlineEntityListPreview.js +31 -0
- package/dist/preview/components/InlineEntityListPreview.js.map +1 -0
- package/dist/preview/components/ReferencePreview.js +162 -0
- package/dist/preview/components/ReferencePreview.js.map +1 -0
- package/dist/preview/components/RelationPreview.js +196 -0
- package/dist/preview/components/RelationPreview.js.map +1 -0
- package/dist/preview/components/StorageMarkdown.d.ts +2 -1
- package/dist/preview/components/StorageMarkdown.js +49 -0
- package/dist/preview/components/StorageMarkdown.js.map +1 -0
- package/dist/preview/components/StorageThumbnail.js +183 -0
- package/dist/preview/components/StorageThumbnail.js.map +1 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +3 -1
- package/dist/preview/components/UrlComponentPreview.js +88 -0
- package/dist/preview/components/UrlComponentPreview.js.map +1 -0
- package/dist/preview/components/UserPreview.js +30 -0
- package/dist/preview/components/UserPreview.js.map +1 -0
- package/dist/preview/components/date_fns_locales.js +124 -0
- package/dist/preview/components/date_fns_locales.js.map +1 -0
- package/dist/preview/components/storageRenditions.d.ts +10 -0
- package/dist/preview/components/storageRenditions.js +95 -0
- package/dist/preview/components/storageRenditions.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfMapsPreview.js +44 -0
- package/dist/preview/property_previews/ArrayOfMapsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.js +48 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfRelationsPreview.js +50 -0
- package/dist/preview/property_previews/ArrayOfRelationsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js +30 -0
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfStringsPreview.js +42 -0
- package/dist/preview/property_previews/ArrayOfStringsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOneOfPreview.js +47 -0
- package/dist/preview/property_previews/ArrayOneOfPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.js +25 -0
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayPropertyPreview.js +48 -0
- package/dist/preview/property_previews/ArrayPropertyPreview.js.map +1 -0
- package/dist/preview/property_previews/MapPropertyPreview.js +137 -0
- package/dist/preview/property_previews/MapPropertyPreview.js.map +1 -0
- package/dist/preview/property_previews/NumberPropertyPreview.js +34 -0
- package/dist/preview/property_previews/NumberPropertyPreview.js.map +1 -0
- package/dist/preview/property_previews/SkeletonPropertyComponent.js +151 -0
- package/dist/preview/property_previews/SkeletonPropertyComponent.js.map +1 -0
- package/dist/preview/property_previews/StringPropertyPreview.js +49 -0
- package/dist/preview/property_previews/StringPropertyPreview.js.map +1 -0
- package/dist/preview/util.d.ts +4 -3
- package/dist/{util-D7ebttKT.js → preview/util.js} +8 -5
- package/dist/preview/util.js.map +1 -0
- package/dist/routes/CustomViewRoute.js +26 -0
- package/dist/routes/CustomViewRoute.js.map +1 -0
- package/dist/routes/RebaseRoute.js +311 -0
- package/dist/routes/RebaseRoute.js.map +1 -0
- package/dist/selection/SelectionMenu.js +90 -0
- package/dist/selection/SelectionMenu.js.map +1 -0
- package/dist/selection/resolve_selection.js +79 -0
- package/dist/selection/resolve_selection.js.map +1 -0
- package/dist/util/caller_scopes.js +25 -0
- package/dist/util/caller_scopes.js.map +1 -0
- package/dist/util/collection_open_mode.d.ts +20 -0
- package/dist/util/collection_open_mode.js +32 -0
- package/dist/util/collection_open_mode.js.map +1 -0
- package/dist/util/dataControllerAdapter.js +65 -0
- package/dist/util/dataControllerAdapter.js.map +1 -0
- package/dist/util/entity_actions.d.ts +5 -0
- package/dist/util/entity_actions.js +77 -0
- package/dist/util/entity_actions.js.map +1 -0
- package/dist/util/entity_pages.d.ts +37 -3
- package/dist/util/entity_pages.js +71 -0
- package/dist/util/entity_pages.js.map +1 -0
- package/dist/util/find_entities_by_ids.d.ts +23 -0
- package/dist/util/find_entities_by_ids.js +55 -0
- package/dist/util/find_entities_by_ids.js.map +1 -0
- package/dist/util/fit_inline_actions.js +40 -0
- package/dist/util/fit_inline_actions.js.map +1 -0
- package/dist/util/format_collection_date.d.ts +29 -0
- package/dist/util/format_collection_date.js +60 -0
- package/dist/util/format_collection_date.js.map +1 -0
- package/dist/util/map_with_concurrency.js +46 -0
- package/dist/util/map_with_concurrency.js.map +1 -0
- package/dist/util/navigation_utils.js +45 -0
- package/dist/util/navigation_utils.js.map +1 -0
- package/dist/util/number_format.js +33 -0
- package/dist/util/number_format.js.map +1 -0
- package/dist/util/previews.js +71 -0
- package/dist/util/previews.js.map +1 -0
- package/dist/util/propertyConfigMapper.js +83 -0
- package/dist/util/propertyConfigMapper.js.map +1 -0
- package/dist/util/property_utils.js +141 -0
- package/dist/util/property_utils.js.map +1 -0
- package/dist/util/resolutions.js +55 -0
- package/dist/util/resolutions.js.map +1 -0
- package/dist/util/view_constants.js +35 -0
- package/dist/util/view_constants.js.map +1 -0
- package/dist/util/view_mode.js +112 -0
- package/dist/util/view_mode.js.map +1 -0
- package/package.json +13 -9
- package/dist/CollectionEditorDialog-p5-I-Apu.js +0 -3669
- package/dist/CollectionEditorDialog-p5-I-Apu.js.map +0 -1
- package/dist/JsonPreviewBinding-v0w3H0fp.js.map +0 -1
- package/dist/PropertyEditView-DDB_X-00.js +0 -3837
- package/dist/PropertyEditView-DDB_X-00.js.map +0 -1
- package/dist/RouterCollectionsStudioView-SGBV4CMg.js +0 -212
- package/dist/RouterCollectionsStudioView-SGBV4CMg.js.map +0 -1
- package/dist/SchemaChangeDialog-CcFSXvkK.js.map +0 -1
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +0 -13
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +0 -8
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/editor.js.map +0 -1
- package/dist/export-DCHuPD1a.js +0 -520
- package/dist/export-DCHuPD1a.js.map +0 -1
- package/dist/history-CBd6SBRs.js +0 -314
- package/dist/history-CBd6SBRs.js.map +0 -1
- package/dist/import-DjQoRrIU.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-CCqp8ibf.js.map +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.js +0 -13
- package/dist/util-BRvKFMLa.js +0 -27773
- package/dist/util-BRvKFMLa.js.map +0 -1
- package/dist/util-D7ebttKT.js.map +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/util/map_with_concurrency.ts
|
|
2
|
+
/**
|
|
3
|
+
* Run `task` over every item, at most `concurrency` at a time, and return the
|
|
4
|
+
* results in the order the items were given.
|
|
5
|
+
*
|
|
6
|
+
* The bulk delete used to be `Promise.all(entities.map(performDelete))`. That is
|
|
7
|
+
* fine for the handful of rows anyone could tick by hand, and it is the reason
|
|
8
|
+
* a "select all matching" over a real collection could not simply be poured
|
|
9
|
+
* into the existing dialog: twelve thousand entries in that array is twelve
|
|
10
|
+
* thousand simultaneous requests, which the browser queues and the server takes
|
|
11
|
+
* as a burst.
|
|
12
|
+
*
|
|
13
|
+
* Rejections are not swallowed and do not cancel: every task is run, and the
|
|
14
|
+
* first rejection is thrown once they have all settled, so a bulk action cannot
|
|
15
|
+
* half-apply and then report the failure as if nothing had happened.
|
|
16
|
+
*/
|
|
17
|
+
async function mapWithConcurrency(items, concurrency, task, onSettled) {
|
|
18
|
+
const results = new Array(items.length);
|
|
19
|
+
const limit = Math.max(1, Math.floor(concurrency));
|
|
20
|
+
let next = 0;
|
|
21
|
+
let completed = 0;
|
|
22
|
+
let firstError;
|
|
23
|
+
let failed = false;
|
|
24
|
+
async function worker() {
|
|
25
|
+
for (;;) {
|
|
26
|
+
const index = next++;
|
|
27
|
+
if (index >= items.length) return;
|
|
28
|
+
try {
|
|
29
|
+
results[index] = await task(items[index], index);
|
|
30
|
+
} catch (e) {
|
|
31
|
+
if (!failed) {
|
|
32
|
+
failed = true;
|
|
33
|
+
firstError = e;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
onSettled?.(++completed, items.length);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker));
|
|
40
|
+
if (failed) throw firstError;
|
|
41
|
+
return results;
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { mapWithConcurrency };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=map_with_concurrency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map_with_concurrency.js","names":[],"sources":["../../src/util/map_with_concurrency.ts"],"sourcesContent":["/**\n * Run `task` over every item, at most `concurrency` at a time, and return the\n * results in the order the items were given.\n *\n * The bulk delete used to be `Promise.all(entities.map(performDelete))`. That is\n * fine for the handful of rows anyone could tick by hand, and it is the reason\n * a \"select all matching\" over a real collection could not simply be poured\n * into the existing dialog: twelve thousand entries in that array is twelve\n * thousand simultaneous requests, which the browser queues and the server takes\n * as a burst.\n *\n * Rejections are not swallowed and do not cancel: every task is run, and the\n * first rejection is thrown once they have all settled, so a bulk action cannot\n * half-apply and then report the failure as if nothing had happened.\n */\nexport async function mapWithConcurrency<T, R>(\n items: readonly T[],\n concurrency: number,\n task: (item: T, index: number) => Promise<R>,\n onSettled?: (completed: number, total: number) => void\n): Promise<R[]> {\n\n const results = new Array<R>(items.length);\n const limit = Math.max(1, Math.floor(concurrency));\n let next = 0;\n let completed = 0;\n let firstError: unknown;\n let failed = false;\n\n async function worker(): Promise<void> {\n for (; ;) {\n const index = next++;\n if (index >= items.length) return;\n try {\n results[index] = await task(items[index], index);\n } catch (e) {\n if (!failed) {\n failed = true;\n firstError = e;\n }\n }\n onSettled?.(++completed, items.length);\n }\n }\n\n await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker));\n\n if (failed) throw firstError;\n return results;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,eAAsB,mBAClB,OACA,aACA,MACA,WACY;CAEZ,MAAM,UAAU,IAAI,MAAS,MAAM,MAAM;CACzC,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,WAAW,CAAC;CACjD,IAAI,OAAO;CACX,IAAI,YAAY;CAChB,IAAI;CACJ,IAAI,SAAS;CAEb,eAAe,SAAwB;EACnC,SAAU;GACN,MAAM,QAAQ;GACd,IAAI,SAAS,MAAM,QAAQ;GAC3B,IAAI;IACA,QAAQ,SAAS,MAAM,KAAK,MAAM,QAAQ,KAAK;GACnD,SAAS,GAAG;IACR,IAAI,CAAC,QAAQ;KACT,SAAS;KACT,aAAa;IACjB;GACJ;GACA,YAAY,EAAE,WAAW,MAAM,MAAM;EACzC;CACJ;CAEA,MAAM,QAAQ,IAAI,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,OAAO,MAAM,MAAM,EAAE,GAAG,MAAM,CAAC;CAE/E,IAAI,QAAQ,MAAM;CAClB,OAAO;AACX"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { withListState } from "./view_mode.js";
|
|
2
|
+
import { addInitialSlash, getCollectionBySlugWithin, getCollectionPathsCombinations, getLastSegment as getLastSegment$1, removeInitialAndTrailingSlashes as removeInitialAndTrailingSlashes$1, removeInitialSlash, removeTrailingSlash as removeTrailingSlash$1, resolveCollectionPathIds as resolveCollectionPathIds$1 } from "@rebasepro/app";
|
|
3
|
+
//#region src/util/navigation_utils.ts
|
|
4
|
+
/**
|
|
5
|
+
* Navigate to a entity using either a side panel or full-screen mode.
|
|
6
|
+
* This is an admin-specific UI concern and lives here (not in common).
|
|
7
|
+
*/
|
|
8
|
+
function navigateToEntity({ openEntityMode, collection, entityId, copy, path, selectedTab, defaultValues, sidePanelController, onClose, onUpdate, navigation, replace }) {
|
|
9
|
+
const mode = navigation.routesMounted === false && openEntityMode !== "dialog" ? "side_panel" : openEntityMode;
|
|
10
|
+
if (mode === "side_panel" || mode === "dialog") sidePanelController.open({
|
|
11
|
+
entityId,
|
|
12
|
+
path,
|
|
13
|
+
copy,
|
|
14
|
+
selectedTab,
|
|
15
|
+
collection,
|
|
16
|
+
updateUrl: mode !== "dialog",
|
|
17
|
+
onClose,
|
|
18
|
+
onUpdate,
|
|
19
|
+
defaultValues
|
|
20
|
+
});
|
|
21
|
+
else {
|
|
22
|
+
let to = navigation.buildUrlCollectionPath(entityId ? `${path ?? path}/${entityId}` : path ?? path);
|
|
23
|
+
if (entityId && selectedTab) to += `/${selectedTab}`;
|
|
24
|
+
to = withListState(to);
|
|
25
|
+
if (!entityId) to += "#new";
|
|
26
|
+
if (copy) to += "#copy";
|
|
27
|
+
const navigateOptions = {};
|
|
28
|
+
if (replace !== void 0) navigateOptions.replace = replace;
|
|
29
|
+
if (defaultValues) navigateOptions.state = { defaultValues };
|
|
30
|
+
const hasOptions = Object.keys(navigateOptions).length > 0;
|
|
31
|
+
navigation.navigate(to, hasOptions ? navigateOptions : void 0);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Whether `pathname` is the record at `entityPath` or somewhere below it — one
|
|
36
|
+
* of its tabs, its `/edit`. A path segment, not a string prefix:
|
|
37
|
+
* `/c/products/12` is another record, not a place inside `/c/products/1`.
|
|
38
|
+
*/
|
|
39
|
+
function isPathWithinRecord(pathname, entityPath) {
|
|
40
|
+
return pathname === entityPath || pathname.startsWith(`${entityPath}/`);
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { addInitialSlash, getCollectionBySlugWithin, getCollectionPathsCombinations, getLastSegment$1 as getLastSegment, isPathWithinRecord, navigateToEntity, removeInitialAndTrailingSlashes$1 as removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash$1 as removeTrailingSlash, resolveCollectionPathIds$1 as resolveCollectionPathIds };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=navigation_utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation_utils.js","names":[],"sources":["../../src/util/navigation_utils.ts"],"sourcesContent":["\nimport type { UrlController, SidePanelBindingProps, SidePanelController, NavigateOptions, AdminCollection } from \"@rebasepro/cms-types\";\nimport { withListState } from \"./view_mode\";\n\n// Canonical path utilities — single source of truth in @rebasepro/common\nexport { removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash, addInitialSlash, getLastSegment, resolveCollectionPathIds, getCollectionBySlugWithin, getCollectionPathsCombinations } from \"@rebasepro/app\";\n\n/**\n * Navigate to a entity using either a side panel or full-screen mode.\n * This is an admin-specific UI concern and lives here (not in common).\n */\nexport function navigateToEntity({\n openEntityMode,\n collection,\n entityId,\n copy,\n path,\n selectedTab,\n defaultValues,\n sidePanelController,\n onClose,\n onUpdate,\n navigation,\n replace\n}:\n\n {\n openEntityMode?: \"side_panel\" | \"full_screen\" | \"split\" | \"dialog\";\n collection?: AdminCollection;\n entityId?: string | number;\n selectedTab?: string;\n copy?: boolean;\n /**\n * Pre-populate the new entity form with these values.\n * Only applied when entityId is not set (i.e. \"new\" mode).\n *\n * Side panel: passed through SidePanelBindingProps → EditViewBinding.\n * Full screen: carried via React Router location.state so the route\n * component can read it on mount without polluting the URL.\n */\n defaultValues?: Record<string, unknown>;\n path: string;\n sidePanelController: SidePanelController;\n onClose?: () => void;\n /**\n * Called when the side panel or dialog saves the record. A full-screen\n * record replaces the view that opened it, and that view reads\n * everything again when it comes back, so nothing is called there.\n */\n onUpdate?: SidePanelBindingProps[\"onUpdate\"];\n navigation: UrlController;\n replace?: boolean;\n }) {\n\n // No CMS route serves this page (a collection embedded in the host app's\n // own page): there is no URL to go to, so the record opens over the page.\n const mode = navigation.routesMounted === false && openEntityMode !== \"dialog\"\n ? \"side_panel\"\n : openEntityMode;\n\n if (mode === \"side_panel\" || mode === \"dialog\") {\n\n sidePanelController.open({\n entityId,\n path: path,\n copy,\n selectedTab,\n collection,\n updateUrl: mode !== \"dialog\",\n onClose,\n onUpdate,\n defaultValues\n });\n\n } else {\n let to = navigation.buildUrlCollectionPath(entityId ? `${path ?? path}/${entityId}` : path ?? path);\n if (entityId && selectedTab) {\n to += `/${selectedTab}`;\n }\n // The whole list state, not just the view mode: a record opened from a\n // search must come back to that search.\n to = withListState(to);\n if (!entityId) {\n to += \"#new\";\n }\n if (copy) {\n to += \"#copy\";\n }\n // Use React Router location.state to carry defaultValues — the correct SPA\n // approach. No URL size limits, no encoding, nothing in the address bar.\n // EntityFullScreenRoute reads location.state.defaultValues on mount.\n const navigateOptions: NavigateOptions = {};\n if (replace !== undefined) {\n navigateOptions.replace = replace;\n }\n if (defaultValues) {\n navigateOptions.state = { defaultValues };\n }\n const hasOptions = Object.keys(navigateOptions).length > 0;\n navigation.navigate(to, hasOptions ? navigateOptions : undefined);\n }\n\n}\n\n/**\n * Whether `pathname` is the record at `entityPath` or somewhere below it — one\n * of its tabs, its `/edit`. A path segment, not a string prefix:\n * `/c/products/12` is another record, not a place inside `/c/products/1`.\n */\nexport function isPathWithinRecord(pathname: string, entityPath: string): boolean {\n return pathname === entityPath || pathname.startsWith(`${entityPath}/`);\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,iBAAiB,EAC7B,gBACA,YACA,UACA,MACA,MACA,aACA,eACA,qBACA,SACA,UACA,YACA,WA6BG;CAIH,MAAM,OAAO,WAAW,kBAAkB,SAAS,mBAAmB,WAChE,eACA;CAEN,IAAI,SAAS,gBAAgB,SAAS,UAElC,oBAAoB,KAAK;EACrB;EACM;EACN;EACA;EACA;EACA,WAAW,SAAS;EACpB;EACA;EACA;CACJ,CAAC;MAEE;EACH,IAAI,KAAK,WAAW,uBAAuB,WAAW,GAAG,QAAQ,KAAK,GAAG,aAAa,QAAQ,IAAI;EAClG,IAAI,YAAY,aACZ,MAAM,IAAI;EAId,KAAK,cAAc,EAAE;EACrB,IAAI,CAAC,UACD,MAAM;EAEV,IAAI,MACA,MAAM;EAKV,MAAM,kBAAmC,CAAC;EAC1C,IAAI,YAAY,KAAA,GACZ,gBAAgB,UAAU;EAE9B,IAAI,eACA,gBAAgB,QAAQ,EAAE,cAAc;EAE5C,MAAM,aAAa,OAAO,KAAK,eAAe,CAAC,CAAC,SAAS;EACzD,WAAW,SAAS,IAAI,aAAa,kBAAkB,KAAA,CAAS;CACpE;AAEJ;;;;;;AAOA,SAAgB,mBAAmB,UAAkB,YAA6B;CAC9E,OAAO,aAAa,cAAc,SAAS,WAAW,GAAG,WAAW,EAAE;AAC1E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/util/number_format.ts
|
|
2
|
+
/**
|
|
3
|
+
* Write a number out for reading, per a property's declared `admin.format`.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is inferred here. With no options the number is returned as it came
|
|
6
|
+
* out of the database — `String(value)`, not a locale-grouped rendering — so a
|
|
7
|
+
* panel that declares nothing shows exactly the stored value, and an author who
|
|
8
|
+
* wants thousands separators asks for them.
|
|
9
|
+
*
|
|
10
|
+
* `Intl.NumberFormat` throws on a bad currency code or an out-of-range fraction
|
|
11
|
+
* count, and a record must not blank because one property is misconfigured, so a
|
|
12
|
+
* failure falls back to the raw value.
|
|
13
|
+
*/
|
|
14
|
+
function formatNumber(value, options, fallbackLocale) {
|
|
15
|
+
if (!options) return String(value);
|
|
16
|
+
const style = options.style ?? (options.currency ? "currency" : "decimal");
|
|
17
|
+
if (style === "currency" && !options.currency) return String(value);
|
|
18
|
+
try {
|
|
19
|
+
return new Intl.NumberFormat(options.locale ?? fallbackLocale ?? void 0, {
|
|
20
|
+
style,
|
|
21
|
+
currency: options.currency,
|
|
22
|
+
minimumFractionDigits: options.minimumFractionDigits,
|
|
23
|
+
maximumFractionDigits: options.maximumFractionDigits,
|
|
24
|
+
notation: options.notation
|
|
25
|
+
}).format(value);
|
|
26
|
+
} catch {
|
|
27
|
+
return String(value);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { formatNumber };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=number_format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number_format.js","names":[],"sources":["../../src/util/number_format.ts"],"sourcesContent":["import type { NumberFormatOptions } from \"@rebasepro/cms-types\";\n\n/**\n * Write a number out for reading, per a property's declared `admin.format`.\n *\n * Nothing is inferred here. With no options the number is returned as it came\n * out of the database — `String(value)`, not a locale-grouped rendering — so a\n * panel that declares nothing shows exactly the stored value, and an author who\n * wants thousands separators asks for them.\n *\n * `Intl.NumberFormat` throws on a bad currency code or an out-of-range fraction\n * count, and a record must not blank because one property is misconfigured, so a\n * failure falls back to the raw value.\n */\nexport function formatNumber(\n value: number,\n options: NumberFormatOptions | undefined,\n fallbackLocale?: string\n): string {\n\n if (!options) return String(value);\n\n // A currency code is the whole declaration in the common case: writing\n // `{ currency: \"EUR\" }` and getting a bare `185.11` because `style` was\n // omitted is a trap, and there is nothing else `currency` could mean.\n const style = options.style ?? (options.currency ? \"currency\" : \"decimal\");\n\n if (style === \"currency\" && !options.currency) {\n // `Intl` throws on this rather than picking a currency, which is the\n // right call — there is no sensible default — but the record still has\n // to render.\n return String(value);\n }\n\n try {\n return new Intl.NumberFormat(options.locale ?? fallbackLocale ?? undefined, {\n style,\n currency: options.currency,\n minimumFractionDigits: options.minimumFractionDigits,\n maximumFractionDigits: options.maximumFractionDigits,\n notation: options.notation\n }).format(value);\n } catch {\n return String(value);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,aACZ,OACA,SACA,gBACM;CAEN,IAAI,CAAC,SAAS,OAAO,OAAO,KAAK;CAKjC,MAAM,QAAQ,QAAQ,UAAU,QAAQ,WAAW,aAAa;CAEhE,IAAI,UAAU,cAAc,CAAC,QAAQ,UAIjC,OAAO,OAAO,KAAK;CAGvB,IAAI;EACA,OAAO,IAAI,KAAK,aAAa,QAAQ,UAAU,kBAAkB,KAAA,GAAW;GACxE;GACA,UAAU,QAAQ;GAClB,uBAAuB,QAAQ;GAC/B,uBAAuB,QAAQ;GAC/B,UAAU,QAAQ;EACtB,CAAC,CAAC,CAAC,OAAO,KAAK;CACnB,QAAQ;EACJ,OAAO,OAAO,KAAK;CACvB;AACJ"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { isPropertyBuilder } from "@rebasepro/common";
|
|
2
|
+
import { getEntityPreviewKeys, getTitlePropertyKey, getTitlePropertyKeyForValues } from "@rebasepro/app";
|
|
3
|
+
//#region src/util/previews.ts
|
|
4
|
+
/**
|
|
5
|
+
* The property that fills the title slot for a collection.
|
|
6
|
+
*
|
|
7
|
+
* Ranking lives in `@rebasepro/common` so every surface (list rows, cards,
|
|
8
|
+
* board cards, detail header, relation chips) agrees on what an entity is
|
|
9
|
+
* called. Identifiers are excluded from the property *schema* — primary keys,
|
|
10
|
+
* foreign keys, UUID columns — not from the key name.
|
|
11
|
+
*/
|
|
12
|
+
function getEntityTitlePropertyKey(collection) {
|
|
13
|
+
return getTitlePropertyKey(collection);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Same as {@link getEntityTitlePropertyKey}, but skips candidates that carry
|
|
17
|
+
* no readable value for this particular entity (empty, or an opaque id).
|
|
18
|
+
*/
|
|
19
|
+
function getEntityTitlePropertyKeyForEntity(collection, values, entityId) {
|
|
20
|
+
return getTitlePropertyKeyForValues(collection, values, entityId);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* True when a property key points at a user picker, whose stored value is an
|
|
24
|
+
* auth user id that has to be resolved before it can be displayed.
|
|
25
|
+
*/
|
|
26
|
+
function isUserSelectProperty(collection, propertyKey) {
|
|
27
|
+
if (!propertyKey) return false;
|
|
28
|
+
const property = collection.properties[propertyKey];
|
|
29
|
+
if (!property || isPropertyBuilder(property)) return false;
|
|
30
|
+
const prop = property;
|
|
31
|
+
return prop.type === "string" && Boolean(prop.userSelect);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Attempt to turn a title value (which might be a relation, reference, date, array, or other complex object)
|
|
35
|
+
* into a renderable, human-readable string.
|
|
36
|
+
*/
|
|
37
|
+
function resolveTitleToString(title) {
|
|
38
|
+
if (title === null || title === void 0) return "";
|
|
39
|
+
if (typeof title !== "object") return String(title);
|
|
40
|
+
if ("__type" in title && title.__type === "relation") {
|
|
41
|
+
if (title.data && title.data.values) {
|
|
42
|
+
const values = title.data.values;
|
|
43
|
+
for (const key of [
|
|
44
|
+
"name",
|
|
45
|
+
"title",
|
|
46
|
+
"label",
|
|
47
|
+
"displayName"
|
|
48
|
+
]) if (values[key] !== void 0 && values[key] !== null) return String(values[key]);
|
|
49
|
+
for (const val of Object.values(values)) if (typeof val === "string" && val.length > 0 && val.length < 200) return val;
|
|
50
|
+
}
|
|
51
|
+
if (title.id !== void 0 && title.id !== null) return String(title.id);
|
|
52
|
+
}
|
|
53
|
+
if ("isEntityReference" in title && typeof title.isEntityReference === "function" && title.isEntityReference()) return String(title.id);
|
|
54
|
+
if ("id" in title && "path" in title && !("__type" in title)) return String(title.id);
|
|
55
|
+
if (title instanceof Date) return title.toLocaleDateString();
|
|
56
|
+
if ("name" in title && title.name !== void 0 && title.name !== null && typeof title.name !== "object") return String(title.name);
|
|
57
|
+
if ("title" in title && title.title !== void 0 && title.title !== null && typeof title.title !== "object") return String(title.title);
|
|
58
|
+
if ("label" in title && title.label !== void 0 && title.label !== null && typeof title.label !== "object") return String(title.label);
|
|
59
|
+
if ("id" in title && title.id !== void 0 && title.id !== null && typeof title.id !== "object") return String(title.id);
|
|
60
|
+
try {
|
|
61
|
+
const str = String(title);
|
|
62
|
+
if (str !== "[object Object]") return str;
|
|
63
|
+
return JSON.stringify(title);
|
|
64
|
+
} catch {
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { getEntityPreviewKeys, getEntityTitlePropertyKey, getEntityTitlePropertyKeyForEntity, isUserSelectProperty, resolveTitleToString };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=previews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previews.js","names":[],"sources":["../../src/util/previews.ts"],"sourcesContent":["import type { Property } from \"@rebasepro/types\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\nimport { getTitlePropertyKey, getTitlePropertyKeyForValues } from \"@rebasepro/app\";\nimport { isPropertyBuilder } from \"@rebasepro/common\";\n\n/**\n * Which properties fill a preview surface, best first.\n *\n * The implementation lives in `@rebasepro/app` so that the admin package and\n * the app package cannot disagree about what a record looks like in a card —\n * they had drifted, and only one of the two copies had learned to keep\n * relations out of the list.\n */\nexport { getEntityPreviewKeys } from \"@rebasepro/app\";\n\n/**\n * The property that fills the title slot for a collection.\n *\n * Ranking lives in `@rebasepro/common` so every surface (list rows, cards,\n * board cards, detail header, relation chips) agrees on what an entity is\n * called. Identifiers are excluded from the property *schema* — primary keys,\n * foreign keys, UUID columns — not from the key name.\n */\nexport function getEntityTitlePropertyKey<M extends Record<string, unknown>>(\n collection: AdminCollection<M>\n): string | undefined {\n return getTitlePropertyKey(collection);\n}\n\n/**\n * Same as {@link getEntityTitlePropertyKey}, but skips candidates that carry\n * no readable value for this particular entity (empty, or an opaque id).\n */\nexport function getEntityTitlePropertyKeyForEntity<M extends Record<string, unknown>>(\n collection: AdminCollection<M>,\n values: Record<string, unknown> | undefined,\n entityId?: string | number\n): string | undefined {\n return getTitlePropertyKeyForValues(collection, values, entityId);\n}\n\n/**\n * True when a property key points at a user picker, whose stored value is an\n * auth user id that has to be resolved before it can be displayed.\n */\nexport function isUserSelectProperty<M extends Record<string, unknown>>(\n collection: AdminCollection<M>,\n propertyKey: string | undefined\n): boolean {\n if (!propertyKey) return false;\n const property = collection.properties[propertyKey];\n if (!property || isPropertyBuilder(property)) return false;\n const prop = property as Property;\n return prop.type === \"string\" && Boolean(prop.userSelect);\n}\n\n/**\n * Attempt to turn a title value (which might be a relation, reference, date, array, or other complex object)\n * into a renderable, human-readable string.\n */\nexport function resolveTitleToString(title: any): string {\n if (title === null || title === undefined) {\n return \"\";\n }\n\n if (typeof title !== \"object\") {\n return String(title);\n }\n\n // Check if it's a relation shape: { __type: \"relation\", id, path, data }\n if (\"__type\" in title && title.__type === \"relation\") {\n if (title.data && title.data.values) {\n const values = title.data.values;\n // Prioritize common title fields in eagerly loaded relation data\n for (const key of [\"name\", \"title\", \"label\", \"displayName\"]) {\n if (values[key] !== undefined && values[key] !== null) {\n return String(values[key]);\n }\n }\n // Fallback: search for first short string value in values\n for (const val of Object.values(values)) {\n if (typeof val === \"string\" && val.length > 0 && val.length < 200) {\n return val;\n }\n }\n }\n if (title.id !== undefined && title.id !== null) {\n return String(title.id);\n }\n }\n\n // Check if it's a reference shape: { isEntityReference() } or similar\n if (\"isEntityReference\" in title && typeof title.isEntityReference === \"function\" && title.isEntityReference()) {\n return String(title.id);\n }\n if (\"id\" in title && \"path\" in title && !(\"__type\" in title)) {\n // Flat reference/relation-like object\n return String(title.id);\n }\n\n // Check if it's a Date\n if (title instanceof Date) {\n return title.toLocaleDateString();\n }\n\n // Check if it has a string/number property like name/title/label/id\n if (\"name\" in title && title.name !== undefined && title.name !== null && typeof title.name !== \"object\") {\n return String(title.name);\n }\n if (\"title\" in title && title.title !== undefined && title.title !== null && typeof title.title !== \"object\") {\n return String(title.title);\n }\n if (\"label\" in title && title.label !== undefined && title.label !== null && typeof title.label !== \"object\") {\n return String(title.label);\n }\n if (\"id\" in title && title.id !== undefined && title.id !== null && typeof title.id !== \"object\") {\n return String(title.id);\n }\n\n // Fallback: try converting to string, or JSON.stringify if it looks like a generic object\n try {\n const str = String(title);\n if (str !== \"[object Object]\") {\n return str;\n }\n return JSON.stringify(title);\n } catch {\n return \"\";\n }\n}\n\n"],"mappings":";;;;;;;;;;;AAuBA,SAAgB,0BACZ,YACkB;CAClB,OAAO,oBAAoB,UAAU;AACzC;;;;;AAMA,SAAgB,mCACZ,YACA,QACA,UACkB;CAClB,OAAO,6BAA6B,YAAY,QAAQ,QAAQ;AACpE;;;;;AAMA,SAAgB,qBACZ,YACA,aACO;CACP,IAAI,CAAC,aAAa,OAAO;CACzB,MAAM,WAAW,WAAW,WAAW;CACvC,IAAI,CAAC,YAAY,kBAAkB,QAAQ,GAAG,OAAO;CACrD,MAAM,OAAO;CACb,OAAO,KAAK,SAAS,YAAY,QAAQ,KAAK,UAAU;AAC5D;;;;;AAMA,SAAgB,qBAAqB,OAAoB;CACrD,IAAI,UAAU,QAAQ,UAAU,KAAA,GAC5B,OAAO;CAGX,IAAI,OAAO,UAAU,UACjB,OAAO,OAAO,KAAK;CAIvB,IAAI,YAAY,SAAS,MAAM,WAAW,YAAY;EAClD,IAAI,MAAM,QAAQ,MAAM,KAAK,QAAQ;GACjC,MAAM,SAAS,MAAM,KAAK;GAE1B,KAAK,MAAM,OAAO;IAAC;IAAQ;IAAS;IAAS;GAAa,GACtD,IAAI,OAAO,SAAS,KAAA,KAAa,OAAO,SAAS,MAC7C,OAAO,OAAO,OAAO,IAAI;GAIjC,KAAK,MAAM,OAAO,OAAO,OAAO,MAAM,GAClC,IAAI,OAAO,QAAQ,YAAY,IAAI,SAAS,KAAK,IAAI,SAAS,KAC1D,OAAO;EAGnB;EACA,IAAI,MAAM,OAAO,KAAA,KAAa,MAAM,OAAO,MACvC,OAAO,OAAO,MAAM,EAAE;CAE9B;CAGA,IAAI,uBAAuB,SAAS,OAAO,MAAM,sBAAsB,cAAc,MAAM,kBAAkB,GACzG,OAAO,OAAO,MAAM,EAAE;CAE1B,IAAI,QAAQ,SAAS,UAAU,SAAS,EAAE,YAAY,QAElD,OAAO,OAAO,MAAM,EAAE;CAI1B,IAAI,iBAAiB,MACjB,OAAO,MAAM,mBAAmB;CAIpC,IAAI,UAAU,SAAS,MAAM,SAAS,KAAA,KAAa,MAAM,SAAS,QAAQ,OAAO,MAAM,SAAS,UAC5F,OAAO,OAAO,MAAM,IAAI;CAE5B,IAAI,WAAW,SAAS,MAAM,UAAU,KAAA,KAAa,MAAM,UAAU,QAAQ,OAAO,MAAM,UAAU,UAChG,OAAO,OAAO,MAAM,KAAK;CAE7B,IAAI,WAAW,SAAS,MAAM,UAAU,KAAA,KAAa,MAAM,UAAU,QAAQ,OAAO,MAAM,UAAU,UAChG,OAAO,OAAO,MAAM,KAAK;CAE7B,IAAI,QAAQ,SAAS,MAAM,OAAO,KAAA,KAAa,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,UACpF,OAAO,OAAO,MAAM,EAAE;CAI1B,IAAI;EACA,MAAM,MAAM,OAAO,KAAK;EACxB,IAAI,QAAQ,mBACR,OAAO;EAEX,OAAO,KAAK,UAAU,KAAK;CAC/B,QAAQ;EACJ,OAAO;CACX;AACJ"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { prettifyIdentifier } from "@rebasepro/utils";
|
|
2
|
+
//#region src/util/propertyConfigMapper.ts
|
|
3
|
+
/**
|
|
4
|
+
* Map Rebase property types to headless-supported types.
|
|
5
|
+
* `vector` and `binary` are not directly renderable, so we fall back to `string`.
|
|
6
|
+
*/
|
|
7
|
+
var TYPE_MAP = {
|
|
8
|
+
string: "string",
|
|
9
|
+
number: "number",
|
|
10
|
+
boolean: "boolean",
|
|
11
|
+
date: "date",
|
|
12
|
+
geopoint: "geopoint",
|
|
13
|
+
reference: "reference",
|
|
14
|
+
relation: "relation",
|
|
15
|
+
array: "array",
|
|
16
|
+
map: "map",
|
|
17
|
+
vector: "string",
|
|
18
|
+
binary: "string"
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Convert a single Property to a CollectionPropertyConfig.
|
|
22
|
+
*/
|
|
23
|
+
function mapPropertyToConfig(property, key) {
|
|
24
|
+
const base = {
|
|
25
|
+
type: TYPE_MAP[property.type] ?? "string",
|
|
26
|
+
name: property.name ?? (key ? prettifyIdentifier(key) : ""),
|
|
27
|
+
description: property.description,
|
|
28
|
+
columnWidth: property.admin?.columnWidth,
|
|
29
|
+
hideFromCollection: property.admin?.hideFromCollection
|
|
30
|
+
};
|
|
31
|
+
if (property.type === "string") {
|
|
32
|
+
if (property.enum) base.enum = mapEnumValues(property.enum);
|
|
33
|
+
if (property.admin?.multiline) base.multiline = true;
|
|
34
|
+
if (property.admin?.previewAsTag) base.previewAsTag = true;
|
|
35
|
+
if (property.admin?.urlPreview) base.url = property.admin.urlPreview;
|
|
36
|
+
if (property.admin?.markdown) base.markdown = true;
|
|
37
|
+
if (property.storage) base.storage = true;
|
|
38
|
+
if (property.email) base.email = true;
|
|
39
|
+
}
|
|
40
|
+
if (property.type === "number" && property.enum) base.enum = mapEnumValues(property.enum);
|
|
41
|
+
if (property.type === "array" && property.of && !Array.isArray(property.of)) base.of = mapPropertyToConfig(property.of, key);
|
|
42
|
+
if (property.type === "map" && property.properties) {
|
|
43
|
+
base.properties = mapPropertiesToConfigs(property.properties);
|
|
44
|
+
if (property.propertiesOrder) base.propertiesOrder = property.propertiesOrder;
|
|
45
|
+
}
|
|
46
|
+
if (property.type === "date" && property.mode) base.mode = property.mode;
|
|
47
|
+
if (property.admin?.Preview) {}
|
|
48
|
+
return base;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Convert a Properties record to a CollectionPropertyConfig record.
|
|
52
|
+
*/
|
|
53
|
+
function mapPropertiesToConfigs(properties) {
|
|
54
|
+
const result = {};
|
|
55
|
+
for (const [key, property] of Object.entries(properties)) result[key] = mapPropertyToConfig(property, key);
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Convert Rebase EnumValues to CollectionEnumValueConfig format.
|
|
60
|
+
* Handles both array form (EnumValueConfig[]) and record form.
|
|
61
|
+
*/
|
|
62
|
+
function mapEnumValues(enumValues) {
|
|
63
|
+
if (!enumValues) return void 0;
|
|
64
|
+
if (Array.isArray(enumValues)) {
|
|
65
|
+
const result = {};
|
|
66
|
+
for (const item of enumValues) result[String(item.id)] = normalizeEnumValueConfig(item);
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
const result = {};
|
|
70
|
+
for (const [key, value] of Object.entries(enumValues)) result[key] = typeof value === "string" ? value : normalizeEnumValueConfig(value);
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
function normalizeEnumValueConfig(config) {
|
|
74
|
+
return {
|
|
75
|
+
label: config.label,
|
|
76
|
+
color: typeof config.color === "string" ? config.color : void 0,
|
|
77
|
+
disabled: config.disabled
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { mapPropertiesToConfigs, mapPropertyToConfig };
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=propertyConfigMapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propertyConfigMapper.js","names":[],"sources":["../../src/util/propertyConfigMapper.ts"],"sourcesContent":["/**\n * Maps a Rebase `Property` (from @rebasepro/types) to a `CollectionPropertyConfig`\n * (from @rebasepro/ui), stripping all entity-specific fields and keeping only\n * the UI-relevant subset.\n *\n * This is the bridge between the entity-aware and headless layers.\n */\n\nimport type { Property, Properties, EnumValues, EnumValueConfig } from \"@rebasepro/types\";\nimport type { CollectionPropertyConfig, CollectionEnumValueConfig } from \"@rebasepro/ui\";\nimport { prettifyIdentifier } from \"@rebasepro/utils\";\n\n/**\n * Map Rebase property types to headless-supported types.\n * `vector` and `binary` are not directly renderable, so we fall back to `string`.\n */\nconst TYPE_MAP: Record<string, CollectionPropertyConfig[\"type\"]> = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\",\n date: \"date\",\n geopoint: \"geopoint\",\n reference: \"reference\",\n relation: \"relation\",\n array: \"array\",\n map: \"map\",\n vector: \"string\", // vectors display as text\n binary: \"string\", // binary displays as text\n};\n\n/**\n * Convert a single Property to a CollectionPropertyConfig.\n */\nexport function mapPropertyToConfig(property: Property, key?: string): CollectionPropertyConfig {\n const base: CollectionPropertyConfig = {\n type: TYPE_MAP[property.type] ?? \"string\",\n // A column header has to say something, and `name` is optional on the\n // property — a headless project has no UI and no reason to invent\n // labels. Falling back to the key is what the collection editor already\n // does when it suggests a name, so a derived label reads the same\n // wherever it appears: `publishDate` -> \"Publish Date\".\n name: property.name ?? (key ? prettifyIdentifier(key) : \"\"),\n description: property.description,\n columnWidth: property.admin?.columnWidth,\n hideFromCollection: property.admin?.hideFromCollection,\n };\n\n // String-specific\n if (property.type === \"string\") {\n if (property.enum) {\n base.enum = mapEnumValues(property.enum);\n }\n if (property.admin?.multiline) base.multiline = true;\n if (property.admin?.previewAsTag) base.previewAsTag = true;\n if (property.admin?.urlPreview) base.url = property.admin.urlPreview;\n if (property.admin?.markdown) base.markdown = true;\n if (property.storage) base.storage = true;\n if (property.email) base.email = true;\n }\n\n // Number-specific\n if (property.type === \"number\" && property.enum) {\n base.enum = mapEnumValues(property.enum);\n }\n\n // Array-specific\n if (property.type === \"array\" && property.of && !Array.isArray(property.of)) {\n base.of = mapPropertyToConfig(property.of, key);\n }\n\n // Map-specific\n if (property.type === \"map\" && property.properties) {\n base.properties = mapPropertiesToConfigs(property.properties);\n if (property.propertiesOrder) {\n base.propertiesOrder = property.propertiesOrder;\n }\n }\n\n // Date-specific\n if (property.type === \"date\" && property.mode) {\n base.mode = property.mode;\n }\n\n // Custom preview component\n if (property.admin?.Preview) {\n // The connected wrapper will handle this by injecting via cellRenderer override\n // We don't copy it here because Preview may reference entity-aware components\n }\n\n return base;\n}\n\n/**\n * Convert a Properties record to a CollectionPropertyConfig record.\n */\nexport function mapPropertiesToConfigs(\n properties: Properties\n): Record<string, CollectionPropertyConfig> {\n const result: Record<string, CollectionPropertyConfig> = {};\n for (const [key, property] of Object.entries(properties)) {\n result[key] = mapPropertyToConfig(property, key);\n }\n return result;\n}\n\n/**\n * Convert Rebase EnumValues to CollectionEnumValueConfig format.\n * Handles both array form (EnumValueConfig[]) and record form.\n */\nfunction mapEnumValues(\n enumValues: EnumValues | undefined\n): Record<string, CollectionEnumValueConfig> | Map<string | number, CollectionEnumValueConfig> | undefined {\n if (!enumValues) return undefined;\n\n // Array form: EnumValueConfig[]\n if (Array.isArray(enumValues)) {\n const result: Record<string, CollectionEnumValueConfig> = {};\n for (const item of enumValues) {\n result[String(item.id)] = normalizeEnumValueConfig(item);\n }\n return result;\n }\n\n // Record form: Record<string | number, string | EnumValueConfig>\n const result: Record<string, CollectionEnumValueConfig> = {};\n for (const [key, value] of Object.entries(enumValues)) {\n result[key] = typeof value === \"string\"\n ? value\n : normalizeEnumValueConfig(value);\n }\n return result;\n}\n\nfunction normalizeEnumValueConfig(config: EnumValueConfig): CollectionEnumValueConfig {\n return {\n label: config.label,\n color: typeof config.color === \"string\" ? config.color : undefined,\n disabled: config.disabled,\n };\n}\n"],"mappings":";;;;;;AAgBA,IAAM,WAA6D;CAC/D,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,MAAM;CACN,UAAU;CACV,WAAW;CACX,UAAU;CACV,OAAO;CACP,KAAK;CACL,QAAQ;CACR,QAAQ;AACZ;;;;AAKA,SAAgB,oBAAoB,UAAoB,KAAwC;CAC5F,MAAM,OAAiC;EACnC,MAAM,SAAS,SAAS,SAAS;EAMjC,MAAM,SAAS,SAAS,MAAM,mBAAmB,GAAG,IAAI;EACxD,aAAa,SAAS;EACtB,aAAa,SAAS,OAAO;EAC7B,oBAAoB,SAAS,OAAO;CACxC;CAGA,IAAI,SAAS,SAAS,UAAU;EAC5B,IAAI,SAAS,MACT,KAAK,OAAO,cAAc,SAAS,IAAI;EAE3C,IAAI,SAAS,OAAO,WAAW,KAAK,YAAY;EAChD,IAAI,SAAS,OAAO,cAAc,KAAK,eAAe;EACtD,IAAI,SAAS,OAAO,YAAY,KAAK,MAAM,SAAS,MAAM;EAC1D,IAAI,SAAS,OAAO,UAAU,KAAK,WAAW;EAC9C,IAAI,SAAS,SAAS,KAAK,UAAU;EACrC,IAAI,SAAS,OAAO,KAAK,QAAQ;CACrC;CAGA,IAAI,SAAS,SAAS,YAAY,SAAS,MACvC,KAAK,OAAO,cAAc,SAAS,IAAI;CAI3C,IAAI,SAAS,SAAS,WAAW,SAAS,MAAM,CAAC,MAAM,QAAQ,SAAS,EAAE,GACtE,KAAK,KAAK,oBAAoB,SAAS,IAAI,GAAG;CAIlD,IAAI,SAAS,SAAS,SAAS,SAAS,YAAY;EAChD,KAAK,aAAa,uBAAuB,SAAS,UAAU;EAC5D,IAAI,SAAS,iBACT,KAAK,kBAAkB,SAAS;CAExC;CAGA,IAAI,SAAS,SAAS,UAAU,SAAS,MACrC,KAAK,OAAO,SAAS;CAIzB,IAAI,SAAS,OAAO,SAAS,CAG7B;CAEA,OAAO;AACX;;;;AAKA,SAAgB,uBACZ,YACwC;CACxC,MAAM,SAAmD,CAAC;CAC1D,KAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QAAQ,UAAU,GACnD,OAAO,OAAO,oBAAoB,UAAU,GAAG;CAEnD,OAAO;AACX;;;;;AAMA,SAAS,cACL,YACuG;CACvG,IAAI,CAAC,YAAY,OAAO,KAAA;CAGxB,IAAI,MAAM,QAAQ,UAAU,GAAG;EAC3B,MAAM,SAAoD,CAAC;EAC3D,KAAK,MAAM,QAAQ,YACf,OAAO,OAAO,KAAK,EAAE,KAAK,yBAAyB,IAAI;EAE3D,OAAO;CACX;CAGA,MAAM,SAAoD,CAAC;CAC3D,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,UAAU,GAChD,OAAO,OAAO,OAAO,UAAU,WACzB,QACA,yBAAyB,KAAK;CAExC,OAAO;AACX;AAEA,SAAS,yBAAyB,QAAoD;CAClF,OAAO;EACH,OAAO,OAAO;EACd,OAAO,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,KAAA;EACzD,UAAU,OAAO;CACrB;AACJ"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { AlignLeftIcon, CalendarIcon, CircleIcon, FlagIcon, FunctionSquareIcon, GlobeIcon, HashIcon, LinkIcon, MailIcon, RepeatIcon, Rows3Icon, TextIcon, UploadIcon, VoteIcon, iconSize } from "@rebasepro/ui";
|
|
4
|
+
import { isPropertyBuilder } from "@rebasepro/common";
|
|
5
|
+
//#region src/util/property_utils.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Resolve a size value (string token or number) to a numeric pixel value
|
|
8
|
+
* suitable for passing to Lucide icons.
|
|
9
|
+
*/
|
|
10
|
+
function resolveSize(size) {
|
|
11
|
+
if (typeof size === "number") return size;
|
|
12
|
+
return iconSize[size];
|
|
13
|
+
}
|
|
14
|
+
function isReferenceProperty(property) {
|
|
15
|
+
if (!property) return null;
|
|
16
|
+
if (property.type === "reference") return true;
|
|
17
|
+
if (property.type === "array") if (Array.isArray(property.of)) return false;
|
|
18
|
+
else return property.of?.type === "reference";
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
function isRelationProperty(property) {
|
|
22
|
+
if (!property) return null;
|
|
23
|
+
if (property.type === "relation") return true;
|
|
24
|
+
if (property.type === "array") if (Array.isArray(property.of)) return false;
|
|
25
|
+
else return property.of?.type === "relation";
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
function getIconForWidget(widget, size) {
|
|
29
|
+
return /* @__PURE__ */ jsx(widget?.Icon ?? CircleIcon, { size: resolveSize(size) });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns a default Lucide icon component based on property type.
|
|
33
|
+
* This provides a sensible fallback when no PropertyConfig is available.
|
|
34
|
+
*/
|
|
35
|
+
function getDefaultIconForProperty(property) {
|
|
36
|
+
switch (property.type) {
|
|
37
|
+
case "string":
|
|
38
|
+
if (property.storage) return UploadIcon;
|
|
39
|
+
if (property.admin?.urlPreview) return GlobeIcon;
|
|
40
|
+
if (property.email) return MailIcon;
|
|
41
|
+
if (property.admin?.multiline || property.admin?.markdown) return AlignLeftIcon;
|
|
42
|
+
return TextIcon;
|
|
43
|
+
case "number": return HashIcon;
|
|
44
|
+
case "boolean": return FlagIcon;
|
|
45
|
+
case "date": return CalendarIcon;
|
|
46
|
+
case "map": return VoteIcon;
|
|
47
|
+
case "array": {
|
|
48
|
+
const of = property.of;
|
|
49
|
+
if (property.oneOf) return Rows3Icon;
|
|
50
|
+
if (of && !Array.isArray(of)) {
|
|
51
|
+
if (of.type === "reference") return LinkIcon;
|
|
52
|
+
if (of.type === "string" && of.storage) return UploadIcon;
|
|
53
|
+
}
|
|
54
|
+
return RepeatIcon;
|
|
55
|
+
}
|
|
56
|
+
case "reference": return LinkIcon;
|
|
57
|
+
case "relation": return LinkIcon;
|
|
58
|
+
case "vector": return HashIcon;
|
|
59
|
+
default: return CircleIcon;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function getIconForProperty(property, size = "small", fields = {}) {
|
|
63
|
+
const px = resolveSize(size);
|
|
64
|
+
if (isPropertyBuilder(property)) return /* @__PURE__ */ jsx(FunctionSquareIcon, { size: px });
|
|
65
|
+
const configId = property.propertyConfig || void 0;
|
|
66
|
+
const widget = configId ? fields[configId] : void 0;
|
|
67
|
+
if (widget?.Icon) return getIconForWidget(widget, size);
|
|
68
|
+
return /* @__PURE__ */ jsx(getDefaultIconForProperty(property), { size: px });
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get a property in a property tree from a path like
|
|
72
|
+
* `address.street`
|
|
73
|
+
* @param properties
|
|
74
|
+
* @param path
|
|
75
|
+
*/
|
|
76
|
+
function getPropertyInPath(properties, path) {
|
|
77
|
+
if (typeof properties === "object") {
|
|
78
|
+
if (path in properties) return properties[path];
|
|
79
|
+
if (path.includes(".")) {
|
|
80
|
+
const pathSegments = path.split(".");
|
|
81
|
+
const childProperty = properties[pathSegments[0]];
|
|
82
|
+
if (typeof childProperty === "object" && childProperty.type === "map" && childProperty.properties) return getPropertyInPath(childProperty.properties, pathSegments.slice(1).join("."));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function getResolvedPropertyInPath(properties, path) {
|
|
87
|
+
if (typeof properties === "object") {
|
|
88
|
+
if (path in properties) return properties[path];
|
|
89
|
+
if (path.includes(".")) {
|
|
90
|
+
const pathSegments = path.split(".");
|
|
91
|
+
const childProperty = properties[pathSegments[0]];
|
|
92
|
+
if (childProperty?.type === "map" && childProperty.properties) return getResolvedPropertyInPath(childProperty.properties, pathSegments.slice(1).join("."));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function getBracketNotation(path) {
|
|
97
|
+
return path.replace(/\.([^.]*)/g, "[$1]");
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get properties sorted by their order, but include ALL properties.
|
|
101
|
+
* Nested keys (like "data.mode") in propertiesOrder are ignored - they're for column ordering.
|
|
102
|
+
* @param properties
|
|
103
|
+
* @param propertiesOrder
|
|
104
|
+
*/
|
|
105
|
+
function getPropertiesWithPropertiesOrder(properties, propertiesOrder) {
|
|
106
|
+
if (!propertiesOrder) return properties;
|
|
107
|
+
const propertyKeys = Object.keys(properties);
|
|
108
|
+
const validOrderKeys = propertiesOrder.filter((key) => !key.includes(".") && properties[key]);
|
|
109
|
+
const result = {};
|
|
110
|
+
validOrderKeys.forEach((key) => {
|
|
111
|
+
const property = properties[key];
|
|
112
|
+
if (typeof property === "object" && property.type === "map" && property.properties) {
|
|
113
|
+
const mapProp = property;
|
|
114
|
+
result[key] = {
|
|
115
|
+
...mapProp,
|
|
116
|
+
properties: getPropertiesWithPropertiesOrder(mapProp.properties, mapProp.propertiesOrder ?? [])
|
|
117
|
+
};
|
|
118
|
+
} else if (property) result[key] = property;
|
|
119
|
+
});
|
|
120
|
+
propertyKeys.forEach((key) => {
|
|
121
|
+
if (!result[key]) {
|
|
122
|
+
const property = properties[key];
|
|
123
|
+
if (typeof property === "object" && property.type === "map" && property.properties) {
|
|
124
|
+
const mapProp = property;
|
|
125
|
+
result[key] = {
|
|
126
|
+
...mapProp,
|
|
127
|
+
properties: getPropertiesWithPropertiesOrder(mapProp.properties, mapProp.propertiesOrder ?? [])
|
|
128
|
+
};
|
|
129
|
+
} else if (property) result[key] = property;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
function getDefaultPropertiesOrder(collection) {
|
|
135
|
+
if (collection.propertiesOrder) return collection.propertiesOrder;
|
|
136
|
+
return [...Object.keys(collection.properties), ...(collection.additionalFields ?? []).map((field) => field.key)];
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
export { getBracketNotation, getDefaultPropertiesOrder, getIconForProperty, getIconForWidget, getPropertiesWithPropertiesOrder, getPropertyInPath, getResolvedPropertyInPath, isReferenceProperty, isRelationProperty };
|
|
140
|
+
|
|
141
|
+
//# sourceMappingURL=property_utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property_utils.js","names":[],"sources":["../../src/util/property_utils.tsx"],"sourcesContent":["\nimport type { Properties } from \"@rebasepro/types\";\nimport type { MapProperty, Property } from \"@rebasepro/types\";\nimport type { PropertyConfig, AdminCollection } from \"@rebasepro/cms-types\";\nimport React from \"react\";\n\nimport { isPropertyBuilder } from \"@rebasepro/common\";\nimport {\n AlignLeftIcon,\n CalendarIcon,\n CircleIcon,\n FlagIcon,\n FunctionSquareIcon,\n GlobeIcon,\n HashIcon,\n iconSize,\n LinkIcon,\n MailIcon,\n RepeatIcon,\n Rows3Icon,\n TextIcon,\n UploadIcon,\n VoteIcon\n} from \"@rebasepro/ui\";\nimport type { IconSize, LucideIcon } from \"@rebasepro/ui\";\n\n/**\n * Resolve a size value (string token or number) to a numeric pixel value\n * suitable for passing to Lucide icons.\n */\nfunction resolveSize(size: IconSize | number): number {\n if (typeof size === \"number\") return size;\n return iconSize[size];\n}\n\nexport function isReferenceProperty(property: Property) {\n\n if (!property) return null;\n if (property.type === \"reference\") {\n return true;\n }\n if (property.type === \"array\") {\n if (Array.isArray(property.of)) return false;\n else return property.of?.type === \"reference\"\n }\n return false;\n}\n\nexport function isRelationProperty(property: Property) {\n if (!property) return null;\n if (property.type === \"relation\") {\n return true;\n }\n if (property.type === \"array\") {\n if (Array.isArray(property.of)) return false;\n else return property.of?.type === \"relation\"\n }\n return false;\n}\n\nexport function getIconForWidget(widget: PropertyConfig | undefined,\n size: IconSize | number) {\n const Icon = widget?.Icon ?? CircleIcon;\n const px = resolveSize(size);\n return <Icon size={px}/>;\n}\n\n/**\n * Returns a default Lucide icon component based on property type.\n * This provides a sensible fallback when no PropertyConfig is available.\n */\nfunction getDefaultIconForProperty(property: Property): LucideIcon {\n switch (property.type) {\n case \"string\": {\n if (property.storage) return UploadIcon;\n if (property.admin?.urlPreview) return GlobeIcon;\n if (property.email) return MailIcon;\n if (property.admin?.multiline || property.admin?.markdown) return AlignLeftIcon;\n return TextIcon;\n }\n case \"number\":\n return HashIcon;\n case \"boolean\":\n return FlagIcon;\n case \"date\":\n return CalendarIcon;\n case \"map\":\n return VoteIcon;\n case \"array\": {\n const of = property.of;\n const oneOf = property.oneOf;\n if (oneOf) return Rows3Icon;\n if (of && !Array.isArray(of)) {\n if (of.type === \"reference\") return LinkIcon;\n if (of.type === \"string\" && of.storage) return UploadIcon;\n }\n return RepeatIcon;\n }\n case \"reference\":\n return LinkIcon;\n case \"relation\":\n return LinkIcon;\n case \"vector\":\n return HashIcon;\n default:\n return CircleIcon;\n }\n}\n\nexport function getIconForProperty(\n property: Property,\n size: IconSize | number = \"small\",\n fields: Record<string, PropertyConfig> = {}\n): React.ReactNode {\n const px = resolveSize(size);\n\n if (isPropertyBuilder(property)) {\n return <FunctionSquareIcon size={px}/>;\n }\n\n // Try to look up a custom PropertyConfig icon first\n const configId = property.propertyConfig || undefined;\n const widget = configId ? fields[configId] : undefined;\n if (widget?.Icon) {\n return getIconForWidget(widget, size);\n }\n\n // Fall back to a type-based default icon\n const Icon = getDefaultIconForProperty(property);\n return <Icon size={px}/>;\n}\n\n/**\n * Get a property in a property tree from a path like\n * `address.street`\n * @param properties\n * @param path\n */\nexport function getPropertyInPath(properties: Properties, path: string): Property | undefined {\n if (typeof properties === \"object\") {\n if (path in properties) {\n return (properties as Record<string, Property>)[path];\n }\n if (path.includes(\".\")) {\n const pathSegments = path.split(\".\");\n const childProperty = (properties as Record<string, Property>)[pathSegments[0]];\n if (typeof childProperty === \"object\" && childProperty.type === \"map\" && childProperty.properties) {\n return getPropertyInPath(childProperty.properties, pathSegments.slice(1).join(\".\"))\n }\n }\n }\n return undefined;\n}\n\nexport function getResolvedPropertyInPath(properties: Record<string, Property>, path: string): Property | undefined {\n if (typeof properties === \"object\") {\n if (path in properties) {\n return properties[path];\n }\n if (path.includes(\".\")) {\n const pathSegments = path.split(\".\");\n // A path whose root is not a property at all is simply not found.\n // Reading `.type` off the miss threw a TypeError instead, which\n // turned one unresolvable column key into a crash for whatever was\n // walking the properties — see `propertiesToColumns`, where that is\n // the whole table. `getPropertyInPath` above already guards this.\n const childProperty = properties[pathSegments[0]];\n if (childProperty?.type === \"map\" && childProperty.properties) {\n return getResolvedPropertyInPath(childProperty.properties, pathSegments.slice(1).join(\".\"))\n }\n }\n }\n return undefined;\n}\n\n// replace the dot notation with brackets\n// address.street => address[street]\nexport function getBracketNotation(path: string): string {\n return path.replace(/\\.([^.]*)/g, \"[$1]\");\n}\n\n/**\n * Get properties sorted by their order, but include ALL properties.\n * Nested keys (like \"data.mode\") in propertiesOrder are ignored - they're for column ordering.\n * @param properties\n * @param propertiesOrder\n */\nexport function getPropertiesWithPropertiesOrder(properties: Properties, propertiesOrder?: string[]): Properties {\n if (!propertiesOrder) return properties;\n\n const propertyKeys = Object.keys(properties);\n\n // Filter propertiesOrder to only include top-level keys (no dots) that exist\n const validOrderKeys = (propertiesOrder as string[]).filter(\n key => !key.includes(\".\") && properties[key]\n );\n\n const result: Properties = {};\n\n // First add properties in the specified order\n validOrderKeys.forEach(key => {\n const property = properties[key];\n if (typeof property === \"object\" && property.type === \"map\" && (property as MapProperty).properties) {\n const mapProp = property as MapProperty;\n result[key] = {\n ...mapProp,\n properties: getPropertiesWithPropertiesOrder(mapProp.properties!, mapProp.propertiesOrder ?? [])\n } as Property;\n } else if (property) {\n result[key] = property;\n }\n });\n\n // Then add any missing properties (so they don't disappear!)\n propertyKeys.forEach(key => {\n if (!result[key]) {\n const property = properties[key];\n if (typeof property === \"object\" && property.type === \"map\" && (property as MapProperty).properties) {\n const mapProp = property as MapProperty;\n result[key] = {\n ...mapProp,\n properties: getPropertiesWithPropertiesOrder(mapProp.properties!, mapProp.propertiesOrder ?? [])\n } as Property;\n } else if (property) {\n result[key] = property;\n }\n }\n });\n\n return result;\n}\n\nexport function getDefaultPropertiesOrder(collection: AdminCollection): string[] {\n if (collection.propertiesOrder) return collection.propertiesOrder;\n return [...Object.keys(collection.properties), ...(collection.additionalFields ?? []).map(field => field.key)];\n}\n"],"mappings":";;;;;;;;;AA8BA,SAAS,YAAY,MAAiC;CAClD,IAAI,OAAO,SAAS,UAAU,OAAO;CACrC,OAAO,SAAS;AACpB;AAEA,SAAgB,oBAAoB,UAAoB;CAEpD,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI,SAAS,SAAS,aAClB,OAAO;CAEX,IAAI,SAAS,SAAS,SAClB,IAAI,MAAM,QAAQ,SAAS,EAAE,GAAG,OAAO;MAClC,OAAO,SAAS,IAAI,SAAS;CAEtC,OAAO;AACX;AAEA,SAAgB,mBAAmB,UAAoB;CACnD,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI,SAAS,SAAS,YAClB,OAAO;CAEX,IAAI,SAAS,SAAS,SAClB,IAAI,MAAM,QAAQ,SAAS,EAAE,GAAG,OAAO;MAClC,OAAO,SAAS,IAAI,SAAS;CAEtC,OAAO;AACX;AAEA,SAAgB,iBAAiB,QAC7B,MAAyB;CAGzB,OAAO,oBAFM,QAAQ,QAAQ,YAEtB,EAAM,MADF,YAAY,IACJ,EAAI,CAAA;AAC3B;;;;;AAMA,SAAS,0BAA0B,UAAgC;CAC/D,QAAQ,SAAS,MAAjB;EACI,KAAK;GACD,IAAI,SAAS,SAAS,OAAO;GAC7B,IAAI,SAAS,OAAO,YAAY,OAAO;GACvC,IAAI,SAAS,OAAO,OAAO;GAC3B,IAAI,SAAS,OAAO,aAAa,SAAS,OAAO,UAAU,OAAO;GAClE,OAAO;EAEX,KAAK,UACD,OAAO;EACX,KAAK,WACD,OAAO;EACX,KAAK,QACD,OAAO;EACX,KAAK,OACD,OAAO;EACX,KAAK,SAAS;GACV,MAAM,KAAK,SAAS;GAEpB,IADc,SAAS,OACZ,OAAO;GAClB,IAAI,MAAM,CAAC,MAAM,QAAQ,EAAE,GAAG;IAC1B,IAAI,GAAG,SAAS,aAAa,OAAO;IACpC,IAAI,GAAG,SAAS,YAAY,GAAG,SAAS,OAAO;GACnD;GACA,OAAO;EACX;EACA,KAAK,aACD,OAAO;EACX,KAAK,YACD,OAAO;EACX,KAAK,UACD,OAAO;EACX,SACI,OAAO;CACf;AACJ;AAEA,SAAgB,mBACZ,UACA,OAA0B,SAC1B,SAAyC,CAAC,GAC3B;CACf,MAAM,KAAK,YAAY,IAAI;CAE3B,IAAI,kBAAkB,QAAQ,GAC1B,OAAO,oBAAC,oBAAD,EAAoB,MAAM,GAAI,CAAA;CAIzC,MAAM,WAAW,SAAS,kBAAkB,KAAA;CAC5C,MAAM,SAAS,WAAW,OAAO,YAAY,KAAA;CAC7C,IAAI,QAAQ,MACR,OAAO,iBAAiB,QAAQ,IAAI;CAKxC,OAAO,oBADM,0BAA0B,QAC/B,GAAD,EAAM,MAAM,GAAI,CAAA;AAC3B;;;;;;;AAQA,SAAgB,kBAAkB,YAAwB,MAAoC;CAC1F,IAAI,OAAO,eAAe,UAAU;EAChC,IAAI,QAAQ,YACR,OAAQ,WAAwC;EAEpD,IAAI,KAAK,SAAS,GAAG,GAAG;GACpB,MAAM,eAAe,KAAK,MAAM,GAAG;GACnC,MAAM,gBAAiB,WAAwC,aAAa;GAC5E,IAAI,OAAO,kBAAkB,YAAY,cAAc,SAAS,SAAS,cAAc,YACnF,OAAO,kBAAkB,cAAc,YAAY,aAAa,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;EAE1F;CACJ;AAEJ;AAEA,SAAgB,0BAA0B,YAAsC,MAAoC;CAChH,IAAI,OAAO,eAAe,UAAU;EAChC,IAAI,QAAQ,YACR,OAAO,WAAW;EAEtB,IAAI,KAAK,SAAS,GAAG,GAAG;GACpB,MAAM,eAAe,KAAK,MAAM,GAAG;GAMnC,MAAM,gBAAgB,WAAW,aAAa;GAC9C,IAAI,eAAe,SAAS,SAAS,cAAc,YAC/C,OAAO,0BAA0B,cAAc,YAAY,aAAa,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;EAElG;CACJ;AAEJ;AAIA,SAAgB,mBAAmB,MAAsB;CACrD,OAAO,KAAK,QAAQ,cAAc,MAAM;AAC5C;;;;;;;AAQA,SAAgB,iCAAiC,YAAwB,iBAAwC;CAC7G,IAAI,CAAC,iBAAiB,OAAO;CAE7B,MAAM,eAAe,OAAO,KAAK,UAAU;CAG3C,MAAM,iBAAkB,gBAA6B,QACjD,QAAO,CAAC,IAAI,SAAS,GAAG,KAAK,WAAW,IAC5C;CAEA,MAAM,SAAqB,CAAC;CAG5B,eAAe,SAAQ,QAAO;EAC1B,MAAM,WAAW,WAAW;EAC5B,IAAI,OAAO,aAAa,YAAY,SAAS,SAAS,SAAU,SAAyB,YAAY;GACjG,MAAM,UAAU;GAChB,OAAO,OAAO;IACV,GAAG;IACH,YAAY,iCAAiC,QAAQ,YAAa,QAAQ,mBAAmB,CAAC,CAAC;GACnG;EACJ,OAAO,IAAI,UACP,OAAO,OAAO;CAEtB,CAAC;CAGD,aAAa,SAAQ,QAAO;EACxB,IAAI,CAAC,OAAO,MAAM;GACd,MAAM,WAAW,WAAW;GAC5B,IAAI,OAAO,aAAa,YAAY,SAAS,SAAS,SAAU,SAAyB,YAAY;IACjG,MAAM,UAAU;IAChB,OAAO,OAAO;KACV,GAAG;KACH,YAAY,iCAAiC,QAAQ,YAAa,QAAQ,mBAAmB,CAAC,CAAC;IACnG;GACJ,OAAO,IAAI,UACP,OAAO,OAAO;EAEtB;CACJ,CAAC;CAED,OAAO;AACX;AAEA,SAAgB,0BAA0B,YAAuC;CAC7E,IAAI,WAAW,iBAAiB,OAAO,WAAW;CAClD,OAAO,CAAC,GAAG,OAAO,KAAK,WAAW,UAAU,GAAG,IAAI,WAAW,oBAAoB,CAAC,EAAA,CAAG,KAAI,UAAS,MAAM,GAAG,CAAC;AACjH"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { VIEW_MODES } from "./view_mode.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { HistoryIcon } from "@rebasepro/ui";
|
|
4
|
+
//#region src/util/resolutions.ts
|
|
5
|
+
/**
|
|
6
|
+
* Built-in entity views that are resolved by token name.
|
|
7
|
+
* These are always available without needing to be registered
|
|
8
|
+
* in the customization controller's entityViews array.
|
|
9
|
+
*/
|
|
10
|
+
var BUILTIN_ENTITY_VIEWS = { "__rebase_history": {
|
|
11
|
+
key: "__rebase_history",
|
|
12
|
+
name: "History",
|
|
13
|
+
tabComponent: React.createElement(HistoryIcon, { size: 20 }),
|
|
14
|
+
position: "end"
|
|
15
|
+
} };
|
|
16
|
+
function resolveEntityView(entityView, contextEntityViews) {
|
|
17
|
+
if (typeof entityView === "string") return BUILTIN_ENTITY_VIEWS[entityView] ?? contextEntityViews?.find((entry) => entry.key === entityView);
|
|
18
|
+
else return entityView;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resolve a collection's `admin.customViews` into the views it can actually
|
|
22
|
+
* render, dropping every entry that names a key nothing registered.
|
|
23
|
+
*
|
|
24
|
+
* Dropping is deliberate: an unresolvable key must not become a switcher entry
|
|
25
|
+
* that renders a blank panel. It falls out of `enabledViews` too, so a user
|
|
26
|
+
* whose saved view mode was removed lands on a built-in.
|
|
27
|
+
*/
|
|
28
|
+
function resolveCollectionViews(customViews, contextCollectionViews) {
|
|
29
|
+
if (!customViews) return [];
|
|
30
|
+
const resolved = [];
|
|
31
|
+
const seen = /* @__PURE__ */ new Set();
|
|
32
|
+
for (const entry of customViews) {
|
|
33
|
+
const view = typeof entry === "string" ? contextCollectionViews?.find((candidate) => candidate.key === entry) : entry;
|
|
34
|
+
if (!view || VIEW_MODES.includes(view.key) || seen.has(view.key)) continue;
|
|
35
|
+
seen.add(view.key);
|
|
36
|
+
resolved.push(view);
|
|
37
|
+
}
|
|
38
|
+
return resolved;
|
|
39
|
+
}
|
|
40
|
+
function resolveEntityAction(entityAction, contextEntityActions) {
|
|
41
|
+
if (typeof entityAction === "string") return contextEntityActions?.find((entry) => entry.key === entityAction);
|
|
42
|
+
else return entityAction;
|
|
43
|
+
}
|
|
44
|
+
function resolvedSelectedEntityView(customViews, customizationController, selectedTab, _canEdit) {
|
|
45
|
+
const resolvedEntityViews = customViews ? customViews.map((e) => resolveEntityView(e, customizationController.entityViews)).filter(Boolean).filter((e) => e.key !== "__rebase_history") : [];
|
|
46
|
+
return {
|
|
47
|
+
resolvedEntityViews,
|
|
48
|
+
selectedEntityView: resolvedEntityViews.find((e) => e.key === selectedTab),
|
|
49
|
+
selectedSecondaryForm: customViews && resolvedEntityViews.filter((e) => e.includeActions).find((e) => e.key === selectedTab)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { resolveCollectionViews, resolveEntityAction, resolveEntityView, resolvedSelectedEntityView };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=resolutions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolutions.js","names":[],"sources":["../../src/util/resolutions.ts"],"sourcesContent":["import { HistoryIcon } from \"@rebasepro/ui\";\nimport React from \"react\";\nimport type { CollectionCustomView, CustomizationController, EntityAction, EntityCustomView } from \"@rebasepro/cms-types\";\nimport { VIEW_MODES } from \"./view_mode\";\n\n/**\n * Built-in entity views that are resolved by token name.\n * These are always available without needing to be registered\n * in the customization controller's entityViews array.\n */\nconst BUILTIN_ENTITY_VIEWS: Record<string, EntityCustomView> = {\n \"__rebase_history\": {\n key: \"__rebase_history\",\n name: \"History\",\n tabComponent: React.createElement(HistoryIcon, { size: 20 }),\n position: \"end\"\n }\n};\n\nexport function resolveEntityView(\n entityView: string | EntityCustomView<any>,\n contextEntityViews?: EntityCustomView<any>[]\n): EntityCustomView<any> | undefined {\n if (typeof entityView === \"string\") {\n // Check built-in views first, then user-registered views\n return BUILTIN_ENTITY_VIEWS[entityView]\n ?? contextEntityViews?.find((entry) => entry.key === entityView);\n } else {\n return entityView;\n }\n}\n\n/**\n * Resolve a collection's `admin.customViews` into the views it can actually\n * render, dropping every entry that names a key nothing registered.\n *\n * Dropping is deliberate: an unresolvable key must not become a switcher entry\n * that renders a blank panel. It falls out of `enabledViews` too, so a user\n * whose saved view mode was removed lands on a built-in.\n */\nexport function resolveCollectionViews(\n customViews: (string | CollectionCustomView<any>)[] | undefined,\n contextCollectionViews?: CollectionCustomView<any>[]\n): CollectionCustomView<any>[] {\n if (!customViews) return [];\n const resolved: CollectionCustomView<any>[] = [];\n const seen = new Set<string>();\n for (const entry of customViews) {\n const view = typeof entry === \"string\"\n ? contextCollectionViews?.find((candidate) => candidate.key === entry)\n : entry;\n // A custom view keyed \"table\" would shadow a built-in in the switcher\n // and be unreachable in the render chain, which checks built-ins first.\n if (!view || VIEW_MODES.includes(view.key) || seen.has(view.key)) continue;\n seen.add(view.key);\n resolved.push(view);\n }\n return resolved;\n}\n\nexport function resolveEntityAction<M extends Record<string, unknown>>(\n entityAction: string | EntityAction<M>,\n contextEntityActions?: EntityAction<M>[]\n): EntityAction<M> | undefined {\n if (typeof entityAction === \"string\") {\n return contextEntityActions?.find((entry) => entry.key === entityAction);\n } else {\n return entityAction;\n }\n}\n\nexport function resolvedSelectedEntityView<M extends Record<string, unknown>>(\n customViews: (string | EntityCustomView<M>)[] | undefined,\n customizationController: CustomizationController,\n selectedTab?: string,\n _canEdit?: boolean\n) {\n const resolvedEntityViews = customViews\n ? customViews\n .map((e) => resolveEntityView(e, (customizationController as { entityViews?: EntityCustomView[] }).entityViews))\n .filter(Boolean)\n .filter((e) => (e as EntityCustomView).key !== \"__rebase_history\") as EntityCustomView[]\n : [];\n\n const selectedEntityView = resolvedEntityViews.find((e) => e.key === selectedTab);\n const selectedSecondaryForm =\n customViews &&\n resolvedEntityViews\n .filter((e) => e.includeActions)\n .find((e) => e.key === selectedTab);\n return {\n resolvedEntityViews,\n selectedEntityView,\n selectedSecondaryForm\n };\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,uBAAyD,EAC3D,oBAAoB;CAChB,KAAK;CACL,MAAM;CACN,cAAc,MAAM,cAAc,aAAa,EAAE,MAAM,GAAG,CAAC;CAC3D,UAAU;AACd,EACJ;AAEA,SAAgB,kBACZ,YACA,oBACiC;CACjC,IAAI,OAAO,eAAe,UAEtB,OAAO,qBAAqB,eACrB,oBAAoB,MAAM,UAAU,MAAM,QAAQ,UAAU;MAEnE,OAAO;AAEf;;;;;;;;;AAUA,SAAgB,uBACZ,aACA,wBAC2B;CAC3B,IAAI,CAAC,aAAa,OAAO,CAAC;CAC1B,MAAM,WAAwC,CAAC;CAC/C,MAAM,uBAAO,IAAI,IAAY;CAC7B,KAAK,MAAM,SAAS,aAAa;EAC7B,MAAM,OAAO,OAAO,UAAU,WACxB,wBAAwB,MAAM,cAAc,UAAU,QAAQ,KAAK,IACnE;EAGN,IAAI,CAAC,QAAQ,WAAW,SAAS,KAAK,GAAG,KAAK,KAAK,IAAI,KAAK,GAAG,GAAG;EAClE,KAAK,IAAI,KAAK,GAAG;EACjB,SAAS,KAAK,IAAI;CACtB;CACA,OAAO;AACX;AAEA,SAAgB,oBACZ,cACA,sBAC2B;CAC3B,IAAI,OAAO,iBAAiB,UACxB,OAAO,sBAAsB,MAAM,UAAU,MAAM,QAAQ,YAAY;MAEvE,OAAO;AAEf;AAEA,SAAgB,2BACZ,aACA,yBACA,aACA,UACF;CACE,MAAM,sBAAsB,cACtB,YACK,KAAK,MAAM,kBAAkB,GAAI,wBAAiE,WAAW,CAAC,CAAC,CAC/G,OAAO,OAAO,CAAC,CACf,QAAQ,MAAO,EAAuB,QAAQ,kBAAkB,IACrE,CAAC;CAQP,OAAO;EACH;EACA,oBARuB,oBAAoB,MAAM,MAAM,EAAE,QAAQ,WAQjE;EACA,uBAPA,eACA,oBACK,QAAQ,MAAM,EAAE,cAAc,CAAC,CAC/B,MAAM,MAAM,EAAE,QAAQ,WAAW;CAK1C;AACJ"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/util/view_constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* Shared tab value constants used by EditViewBinding and DetailViewBinding.
|
|
4
|
+
*/
|
|
5
|
+
var MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
|
|
6
|
+
var JSON_TAB_VALUE = "__json";
|
|
7
|
+
var HISTORY_TAB_VALUE = "__rebase_history";
|
|
8
|
+
/**
|
|
9
|
+
* The tab row belongs to the header band above the record, not to the record
|
|
10
|
+
* itself, so it carries the same surface the identity bar over it and the form
|
|
11
|
+
* rail beside it carry. Against that, the active tab takes the record's own
|
|
12
|
+
* card surface and reads as connected to what it opens; on a card-coloured row it had to be
|
|
13
|
+
* the tinted one, which is the relationship backwards.
|
|
14
|
+
*/
|
|
15
|
+
var ENTITY_VIEW_TAB_BAR_CLASS = "bg-surface-sheet";
|
|
16
|
+
/**
|
|
17
|
+
* Every tab in that row, a custom `tabComponent` included.
|
|
18
|
+
*
|
|
19
|
+
* `h-full` over the variant's `h-9`: the row is 40px and the tab 36px, so a
|
|
20
|
+
* centred tab floated ~2px clear of the row's bottom border and the active
|
|
21
|
+
* tab's underline stopped short of the record it opens. Paired with
|
|
22
|
+
* `items-stretch` on the Tabs root, which the variant leaves centred.
|
|
23
|
+
*/
|
|
24
|
+
var ENTITY_VIEW_TAB_CLASS = "h-full";
|
|
25
|
+
/**
|
|
26
|
+
* Added on top for the tabs this row labels itself — a custom `tabComponent`
|
|
27
|
+
* sizes its own contents. The main tab was the only one rendered without it,
|
|
28
|
+
* and so the only one left at the boxy variant's `text-xs` while its
|
|
29
|
+
* neighbours sat at `text-sm`.
|
|
30
|
+
*/
|
|
31
|
+
var ENTITY_VIEW_TAB_LABEL_CLASS = "text-sm min-w-[90px]";
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ENTITY_VIEW_TAB_BAR_CLASS, ENTITY_VIEW_TAB_CLASS, ENTITY_VIEW_TAB_LABEL_CLASS, HISTORY_TAB_VALUE, JSON_TAB_VALUE, MAIN_TAB_VALUE };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=view_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view_constants.js","names":[],"sources":["../../src/util/view_constants.ts"],"sourcesContent":["/**\n * Shared tab value constants used by EditViewBinding and DetailViewBinding.\n */\nexport const MAIN_TAB_VALUE = \"__main_##Q$SC^#S6\";\nexport const JSON_TAB_VALUE = \"__json\";\nexport const HISTORY_TAB_VALUE = \"__rebase_history\";\n\n/**\n * The tab row belongs to the header band above the record, not to the record\n * itself, so it carries the same surface the identity bar over it and the form\n * rail beside it carry. Against that, the active tab takes the record's own\n * card surface and reads as connected to what it opens; on a card-coloured row it had to be\n * the tinted one, which is the relationship backwards.\n */\nexport const ENTITY_VIEW_TAB_BAR_CLASS = \"bg-surface-sheet\";\n\n/**\n * Every tab in that row, a custom `tabComponent` included.\n *\n * `h-full` over the variant's `h-9`: the row is 40px and the tab 36px, so a\n * centred tab floated ~2px clear of the row's bottom border and the active\n * tab's underline stopped short of the record it opens. Paired with\n * `items-stretch` on the Tabs root, which the variant leaves centred.\n */\nexport const ENTITY_VIEW_TAB_CLASS = \"h-full\";\n\n/**\n * Added on top for the tabs this row labels itself — a custom `tabComponent`\n * sizes its own contents. The main tab was the only one rendered without it,\n * and so the only one left at the boxy variant's `text-xs` while its\n * neighbours sat at `text-sm`.\n */\nexport const ENTITY_VIEW_TAB_LABEL_CLASS = \"text-sm min-w-[90px]\";\n"],"mappings":";;;;AAGA,IAAa,iBAAiB;AAC9B,IAAa,iBAAiB;AAC9B,IAAa,oBAAoB;;;;;;;;AASjC,IAAa,4BAA4B;;;;;;;;;AAUzC,IAAa,wBAAwB;;;;;;;AAQrC,IAAa,8BAA8B"}
|