@rebasepro/admin 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -0
- package/dist/CollectionEditorDialog-jA-PLh6N.js +3549 -0
- package/dist/CollectionEditorDialog-jA-PLh6N.js.map +1 -0
- package/dist/CollectionsStudioView-UKouBPOm.js +170 -0
- package/dist/CollectionsStudioView-UKouBPOm.js.map +1 -0
- package/dist/PropertyEditView-DEUddmg_.js +3660 -0
- package/dist/PropertyEditView-DEUddmg_.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +2 -2
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -1
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -1
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -1
- package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +1 -9
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -3
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +1 -1
- package/dist/collection_editor_ui.js +4 -11
- package/dist/components/ArrayContainer.d.ts +3 -3
- package/dist/components/ClearFilterSortButton.d.ts +1 -1
- package/dist/components/CollectionEditorDialogs.d.ts +2 -1
- package/dist/components/CollectionPanel.d.ts +2 -27
- package/dist/components/DefaultAppBar.d.ts +1 -1
- package/dist/components/DefaultDrawer.d.ts +4 -4
- package/dist/components/DeleteEntityDialog.d.ts +2 -1
- package/dist/components/DrawerNavigationGroup.d.ts +1 -1
- package/dist/components/DrawerNavigationItem.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +4 -3
- package/dist/components/EntityCollectionView/Board.d.ts +2 -1
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +1 -1
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCard.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +0 -24
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
- package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +2 -1
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
- package/dist/components/EntityCollectionView/SplitListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +2 -1
- package/dist/components/EntityDetailView.d.ts +1 -1
- package/dist/components/EntityEditView.d.ts +2 -2
- package/dist/components/EntityEditViewFormActions.d.ts +2 -1
- package/dist/components/EntityJsonPreview.d.ts +2 -1
- package/dist/components/EntityPreview.d.ts +3 -3
- package/dist/components/EntitySidePanel.d.ts +2 -1
- package/dist/components/EntityView.d.ts +2 -1
- package/dist/components/FieldCaption.d.ts +1 -1
- package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
- package/dist/components/HomePage/FavouritesView.d.ts +1 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +4 -4
- package/dist/components/HomePage/NavigationCard.d.ts +1 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +2 -1
- package/dist/components/HomePage/NavigationGroup.d.ts +2 -2
- package/dist/components/HomePage/RenameGroupDialog.d.ts +2 -1
- package/dist/components/HomePage/SmallNavigationCard.d.ts +1 -1
- package/dist/components/PropertyCollectionView.d.ts +2 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +2 -2
- package/dist/components/RebaseAuthGate.d.ts +1 -1
- package/dist/components/RebaseLayout.d.ts +1 -1
- package/dist/components/RebaseNavigation.d.ts +1 -1
- package/dist/components/RebaseRouteDefs.d.ts +1 -1
- package/dist/components/RebaseShell.d.ts +1 -1
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
- package/dist/components/ReferenceWidget.d.ts +2 -1
- package/dist/components/SearchIconsView.d.ts +2 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -1
- package/dist/components/SideDialogs.d.ts +1 -1
- package/dist/components/SideEntityProvider.d.ts +1 -1
- package/dist/components/admin/CreationResultDialog.d.ts +2 -1
- package/dist/components/app/AppBar.d.ts +1 -1
- package/dist/components/app/Drawer.d.ts +1 -1
- package/dist/components/common/default_entity_actions.d.ts +2 -1
- package/dist/components/history/EntityHistoryEntry.d.ts +1 -1
- package/dist/components/history/EntityHistoryView.d.ts +1 -1
- package/dist/components/history/LastEditedByFormAction.d.ts +2 -1
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -1
- package/dist/components/history/UserChip.d.ts +1 -1
- package/dist/data_export/export/BasicExportAction.d.ts +2 -1
- package/dist/data_export/export/ExportCollectionAction.d.ts +1 -1
- package/dist/data_import/components/DataNewPropertiesMapping.d.ts +1 -1
- package/dist/data_import/components/ImportFileUpload.d.ts +1 -1
- package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +2 -1
- package/dist/data_import/components/ImportSaveInProgress.d.ts +1 -1
- package/dist/data_import/import/ImportCollectionAction.d.ts +4 -3
- package/dist/editor/components/SlashCommandMenu.d.ts +2 -1
- package/dist/editor/editor.d.ts +1 -1
- package/dist/editor/selectors/color-selector.d.ts +1 -1
- package/dist/editor/selectors/link-selector.d.ts +1 -1
- package/dist/editor/selectors/node-selector.d.ts +1 -1
- package/dist/editor/selectors/text-buttons.d.ts +1 -1
- package/dist/editor.js +2621 -3574
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -1
- package/dist/form/EntityFormActions.d.ts +2 -1
- package/dist/form/components/FieldHelperText.d.ts +1 -1
- package/dist/form/components/FormEntry.d.ts +1 -1
- package/dist/form/components/FormLayout.d.ts +1 -1
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +1 -1
- package/dist/form/components/LocalChangesMenu.d.ts +2 -1
- package/dist/form/components/StorageItemPreview.d.ts +2 -1
- package/dist/form/components/StorageUploadProgress.d.ts +2 -1
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -2
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/VectorFieldBinding.d.ts +2 -1
- package/dist/history-BL49TIDb.js +311 -0
- package/dist/history-BL49TIDb.js.map +1 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +0 -2
- package/dist/hooks/navigation/useNavigationResolution.d.ts +5 -6
- package/dist/hooks/navigation/useResolvedCollections.d.ts +0 -2
- package/dist/hooks/useBreadcrumbsController.d.ts +2 -32
- package/dist/index.js +2 -3393
- package/dist/markdown-CklalUUk.js +526 -0
- package/dist/markdown-CklalUUk.js.map +1 -0
- package/dist/preview/components/ArrayEnumPreview.d.ts +2 -1
- package/dist/preview/components/EmptyValue.d.ts +2 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/components/ImagePreview.d.ts +2 -1
- package/dist/preview/components/ReferencePreview.d.ts +2 -1
- package/dist/preview/components/RelationPreview.d.ts +2 -1
- package/dist/preview/components/StorageThumbnail.d.ts +1 -1
- package/dist/preview/components/UserPreview.d.ts +6 -3
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +2 -1
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +3 -2
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +5 -4
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/routes/RebaseRoute.d.ts +1 -1
- package/dist/src-BJ8fkM8y.js +24010 -0
- package/dist/src-BJ8fkM8y.js.map +1 -0
- package/dist/types/components/PropertyPreviewProps.d.ts +4 -0
- package/dist/types/components/formex.d.ts +1 -40
- package/dist/types/fields.d.ts +9 -1
- package/dist/util/navigation_utils.d.ts +2 -1
- package/dist/util/previews.d.ts +5 -0
- package/dist/util/property_utils.d.ts +1 -1
- package/package.json +29 -27
- package/src/collection_editor/ConfigControllerProvider.tsx +10 -7
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -1
- package/src/collection_editor/ui/EditorEntityAction.tsx +2 -1
- package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -1
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +2 -1
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +2 -3
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +0 -1
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -4
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +5 -2
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +1 -1
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +7 -2
- package/src/collection_editor/validateCollectionJson.ts +2 -2
- package/src/components/CollectionPanel.tsx +51 -25
- package/src/components/DefaultAppBar.tsx +1 -2
- package/src/components/DefaultDrawer.tsx +3 -2
- package/src/components/DrawerNavigationGroup.tsx +3 -2
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +30 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -0
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +5 -2
- package/src/components/EntityCollectionView/Board.tsx +10 -8
- package/src/components/EntityCollectionView/BoardSortableList.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +4 -2
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +14 -4
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +48 -26
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +146 -73
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +2 -1
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +3 -2
- package/src/components/EntityCollectionView/FilterPresetsButton.tsx +4 -2
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +0 -1
- package/src/components/EntityCollectionView/useBoardDataController.tsx +17 -15
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +32 -23
- package/src/components/EntityDetailView.tsx +72 -39
- package/src/components/EntityEditView.tsx +79 -47
- package/src/components/EntitySidePanel.tsx +9 -3
- package/src/components/HomePage/ContentHomePage.tsx +3 -3
- package/src/components/HomePage/NavigationCard.tsx +5 -5
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/RebaseLayout.tsx +5 -2
- package/src/components/RebaseNavigation.tsx +1 -4
- package/src/components/RebaseRouteDefs.tsx +5 -3
- package/src/components/SearchIconsView.tsx +1 -1
- package/src/components/SelectableTable/SelectableTable.tsx +2 -3
- package/src/components/SelectableTable/SelectionStore.ts +9 -3
- package/src/components/UserSelector.tsx +92 -2
- package/src/components/common/default_entity_actions.tsx +23 -6
- package/src/components/field_configs.tsx +6 -3
- package/src/editor/editor.tsx +1 -1
- package/src/editor/extensions/Image/index.ts +2 -2
- package/src/editor/extensions/Image.ts +2 -2
- package/src/editor/extensions/clipboard.ts +2 -2
- package/src/editor/markdown-it-plugins.d.ts +24 -0
- package/src/editor/markdown.ts +2 -3
- package/src/form/EntityForm.tsx +21 -15
- package/src/form/PropertyFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MapFieldBinding.tsx +5 -47
- package/src/form/field_bindings/VectorFieldBinding.tsx +3 -3
- package/src/form/validation.ts +17 -15
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -6
- package/src/hooks/navigation/useNavigationResolution.ts +143 -19
- package/src/hooks/navigation/useResolvedCollections.ts +4 -6
- package/src/hooks/useBreadcrumbsController.tsx +2 -34
- package/src/hooks/useBuildSideEntityController.tsx +25 -3
- package/src/preview/PropertyPreview.tsx +6 -2
- package/src/preview/components/ReferencePreview.tsx +64 -13
- package/src/preview/components/RelationPreview.tsx +101 -13
- package/src/preview/components/UserPreview.tsx +5 -14
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/routes/RebaseRoute.tsx +5 -4
- package/src/types/components/PropertyPreviewProps.tsx +5 -0
- package/src/types/components/formex.tsx +1 -45
- package/src/types/fields.tsx +10 -1
- package/src/util/navigation_utils.ts +14 -4
- package/src/util/previews.ts +101 -4
- package/dist/CollectionEditorDialog-Bo86h-d-.js +0 -4574
- package/dist/CollectionEditorDialog-Bo86h-d-.js.map +0 -1
- package/dist/CollectionsStudioView-bsg4AT_Z.js +0 -217
- package/dist/CollectionsStudioView-bsg4AT_Z.js.map +0 -1
- package/dist/ExportCollectionAction-Cf-Id5uO.js +0 -446
- package/dist/ExportCollectionAction-Cf-Id5uO.js.map +0 -1
- package/dist/ImportCollectionAction-LN5sreK9.js +0 -685
- package/dist/ImportCollectionAction-LN5sreK9.js.map +0 -1
- package/dist/PropertyEditView-jCWCxmCz.js +0 -8197
- package/dist/PropertyEditView-jCWCxmCz.js.map +0 -1
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/index-BrqSvMG0.js +0 -8
- package/dist/index-BrqSvMG0.js.map +0 -1
- package/dist/index-Cb0bPnzZ.js +0 -12
- package/dist/index-Cb0bPnzZ.js.map +0 -1
- package/dist/index-z3H8iqsj.js +0 -462
- package/dist/index-z3H8iqsj.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-DD2JDU1X.js +0 -618
- package/dist/markdown-DD2JDU1X.js.map +0 -1
- package/dist/useEntityHistory-UVsSclfZ.js +0 -123
- package/dist/useEntityHistory-UVsSclfZ.js.map +0 -1
- package/dist/util-CvNp6A-r.js +0 -30505
- package/dist/util-CvNp6A-r.js.map +0 -1
|
@@ -41,8 +41,8 @@ export function VectorFieldBinding({
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
// Extract array value from the custom { __type: "Vector", value: number[] } wrapper
|
|
44
|
-
const arrayValue = isVectorObject(value)
|
|
45
|
-
? value.value
|
|
44
|
+
const arrayValue = isVectorObject(value)
|
|
45
|
+
? value.value
|
|
46
46
|
: (Array.isArray(value) ? value : []);
|
|
47
47
|
|
|
48
48
|
const [textValue, setTextValue] = useState(() => arrayValue.join(", "));
|
|
@@ -108,7 +108,7 @@ export function VectorFieldBinding({
|
|
|
108
108
|
<div className="flex items-center justify-between flex-wrap gap-2">
|
|
109
109
|
<div className="flex items-center gap-2.5">
|
|
110
110
|
{/* Status Dot */}
|
|
111
|
-
<div className={`w-2.5 h-2.5 rounded-full ${isPopulated ?
|
|
111
|
+
<div className={`w-2.5 h-2.5 rounded-full ${isPopulated ? "bg-emerald-500 animate-pulse" : "bg-surface-300 dark:bg-surface-600"}`} />
|
|
112
112
|
<span className="text-sm font-semibold text-text-primary dark:text-text-primary-dark">
|
|
113
113
|
{isPopulated ? `${arrayValue.length} Dimensions` : "Empty Vector"}
|
|
114
114
|
</span>
|
package/src/form/validation.ts
CHANGED
|
@@ -229,7 +229,7 @@ function getZodNumberSchema({
|
|
|
229
229
|
const n = Number(val);
|
|
230
230
|
return isNaN(n) ? val : n; // pass through non-numeric to let refine catch it
|
|
231
231
|
},
|
|
232
|
-
z.number({
|
|
232
|
+
z.number({ error: "Must be a number" }).nullable()
|
|
233
233
|
);
|
|
234
234
|
|
|
235
235
|
const isRequired = validation?.required || property.isId === true || property.isId === "manual";
|
|
@@ -446,17 +446,19 @@ function getZodArraySchema({
|
|
|
446
446
|
});
|
|
447
447
|
arraySchema = z.array(
|
|
448
448
|
z.any().superRefine(async (object, ctx) => {
|
|
449
|
-
//
|
|
450
|
-
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
449
|
+
// In Zod v4, ctx.path is not available in superRefine.
|
|
450
|
+
// Instead, iterate all zodProperties and validate against each.
|
|
451
|
+
for (const [key, zodProperty] of Object.entries(zodProperties)) {
|
|
452
|
+
if (zodProperty) {
|
|
453
|
+
const result = await (zodProperty as ZodTypeAny).safeParseAsync(object);
|
|
454
|
+
if (!result.success) {
|
|
455
|
+
result.error.issues.forEach((issue) => {
|
|
456
|
+
ctx.addIssue({
|
|
457
|
+
code: "custom",
|
|
458
|
+
message: issue.message
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
}
|
|
460
462
|
}
|
|
461
463
|
}
|
|
462
464
|
})
|
|
@@ -537,21 +539,21 @@ function getZodVectorSchema({
|
|
|
537
539
|
},
|
|
538
540
|
z.array(z.number()).nullable().optional()
|
|
539
541
|
);
|
|
540
|
-
|
|
542
|
+
|
|
541
543
|
if (property.dimensions) {
|
|
542
544
|
schema = schema.refine(
|
|
543
545
|
(val: unknown) => val === null || val === undefined || (Array.isArray(val) && val.length === property.dimensions),
|
|
544
546
|
{ message: `${property.name ?? "Vector"} must have exactly ${property.dimensions} dimensions` }
|
|
545
547
|
);
|
|
546
548
|
}
|
|
547
|
-
|
|
549
|
+
|
|
548
550
|
if (property.validation?.required) {
|
|
549
551
|
schema = schema.refine(
|
|
550
552
|
(val: unknown) => val !== null && val !== undefined && Array.isArray(val) && val.length > 0,
|
|
551
553
|
{ message: property.validation?.requiredMessage ?? "Required" }
|
|
552
554
|
);
|
|
553
555
|
}
|
|
554
|
-
|
|
556
|
+
|
|
555
557
|
return schema;
|
|
556
558
|
}
|
|
557
559
|
|
|
@@ -5,7 +5,6 @@ import { AuthController, RebaseData, CollectionRegistryController, User } from "
|
|
|
5
5
|
import type { EntityCollectionsBuilder, AppViewsBuilder, EffectiveRoleController } from "@rebasepro/types";
|
|
6
6
|
import { CollectionRegistry } from "@rebasepro/common";
|
|
7
7
|
|
|
8
|
-
import { UserManagementDelegate } from "@rebasepro/types";
|
|
9
8
|
|
|
10
9
|
import { useResolvedCollections } from "./useResolvedCollections";
|
|
11
10
|
import { useResolvedViews } from "./useResolvedViews";
|
|
@@ -25,7 +24,7 @@ export type BuildNavigationStateProps<EC extends EntityCollection, USER extends
|
|
|
25
24
|
urlController: UrlController;
|
|
26
25
|
adminMode?: "content" | "studio" | "settings";
|
|
27
26
|
effectiveRoleController?: EffectiveRoleController;
|
|
28
|
-
|
|
27
|
+
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
/**
|
|
@@ -55,8 +54,7 @@ export function useBuildNavigationStateController<EC extends EntityCollection, U
|
|
|
55
54
|
collectionRegistryController,
|
|
56
55
|
urlController,
|
|
57
56
|
adminMode = "content",
|
|
58
|
-
effectiveRoleController
|
|
59
|
-
userManagement
|
|
57
|
+
effectiveRoleController
|
|
60
58
|
} = props;
|
|
61
59
|
|
|
62
60
|
const {
|
|
@@ -70,8 +68,7 @@ export function useBuildNavigationStateController<EC extends EntityCollection, U
|
|
|
70
68
|
data,
|
|
71
69
|
plugins,
|
|
72
70
|
disabled,
|
|
73
|
-
collectionRegistryController
|
|
74
|
-
userManagement
|
|
71
|
+
collectionRegistryController
|
|
75
72
|
});
|
|
76
73
|
|
|
77
74
|
const {
|
|
@@ -1,36 +1,157 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
AppView,
|
|
3
|
+
AppViewsBuilder,
|
|
4
|
+
AuthCollectionConfig,
|
|
5
|
+
EntityAction,
|
|
6
|
+
EntityCollection,
|
|
7
|
+
EntityCollectionsBuilder,
|
|
8
|
+
RebaseContext,
|
|
9
|
+
RebasePlugin,
|
|
10
|
+
UserCreationResult
|
|
11
|
+
} from "@rebasepro/types";
|
|
12
|
+
import { type AuthController, type User, type RebaseData } from "@rebasepro/types";
|
|
4
13
|
import { canReadCollection } from "@rebasepro/common";
|
|
14
|
+
import { resetPasswordAction } from "../../components/common/default_entity_actions";
|
|
15
|
+
import { CreationResultDialog } from "../../components/admin/CreationResultDialog";
|
|
16
|
+
import React from "react";
|
|
5
17
|
|
|
6
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Check whether a `RebaseCallContext` is actually the full frontend
|
|
20
|
+
* `RebaseContext` (which carries `dialogsController`).
|
|
21
|
+
*/
|
|
22
|
+
function isRebaseContext(ctx: unknown): ctx is RebaseContext {
|
|
23
|
+
return typeof ctx === "object" && ctx !== null && "dialogsController" in ctx;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function filterOutNotAllowedCollections(resolvedCollections: EntityCollection[], authController: AuthController): EntityCollection[] {
|
|
7
27
|
return resolvedCollections
|
|
8
28
|
.filter((c) => canReadCollection(c, authController))
|
|
9
29
|
.map((c) => {
|
|
10
|
-
if (!
|
|
30
|
+
if (!c.childCollections) return c;
|
|
11
31
|
return {
|
|
12
32
|
...c,
|
|
13
|
-
|
|
14
|
-
}
|
|
33
|
+
childCollections: () => filterOutNotAllowedCollections(c.childCollections!() ?? [], authController)
|
|
34
|
+
};
|
|
15
35
|
});
|
|
16
36
|
}
|
|
17
37
|
|
|
18
|
-
export function applyPluginModifyCollection(resolvedCollections: EntityCollection[], modifyCollection: (collection: EntityCollection) => EntityCollection) {
|
|
19
|
-
return resolvedCollections.map((collection
|
|
38
|
+
export function applyPluginModifyCollection(resolvedCollections: EntityCollection[], modifyCollection: (collection: EntityCollection) => EntityCollection): EntityCollection[] {
|
|
39
|
+
return resolvedCollections.map((collection): EntityCollection => {
|
|
20
40
|
const modifiedCollection = modifyCollection(collection);
|
|
21
|
-
if (
|
|
41
|
+
if (modifiedCollection.childCollections) {
|
|
22
42
|
return {
|
|
23
43
|
...modifiedCollection,
|
|
24
|
-
|
|
25
|
-
}
|
|
44
|
+
childCollections: () => applyPluginModifyCollection(modifiedCollection.childCollections!() ?? [], modifyCollection)
|
|
45
|
+
};
|
|
26
46
|
}
|
|
27
47
|
return modifiedCollection;
|
|
28
48
|
});
|
|
29
49
|
}
|
|
30
50
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Auto-inject auth-specific entity actions and callbacks for collections
|
|
53
|
+
* with `auth: true` or `auth: { enabled: true }`.
|
|
54
|
+
*
|
|
55
|
+
* Injections:
|
|
56
|
+
* 1. **resetPasswordAction** — adds the entity action unless explicitly disabled
|
|
57
|
+
* 2. **afterSave callback** — shows the `CreationResultDialog` when a new user
|
|
58
|
+
* is created with `invitationSent` or `temporaryPassword` in the response
|
|
59
|
+
*
|
|
60
|
+
* Skips injection if the collection already has the action/callback present.
|
|
61
|
+
*/
|
|
62
|
+
function injectAuthCollectionConfig(collections: EntityCollection[]): EntityCollection[] {
|
|
63
|
+
return collections.map((collection) => {
|
|
64
|
+
const authProp = collection.auth;
|
|
65
|
+
if (!authProp) return collection;
|
|
66
|
+
|
|
67
|
+
const isAuth = authProp === true || (typeof authProp === "object" && authProp.enabled === true);
|
|
68
|
+
if (!isAuth) return collection;
|
|
69
|
+
|
|
70
|
+
const authConfig: AuthCollectionConfig | undefined = typeof authProp === "object" ? authProp : undefined;
|
|
71
|
+
|
|
72
|
+
let result = collection;
|
|
73
|
+
|
|
74
|
+
// ─── Entity Action injection (resetPassword) ─────────────────────
|
|
75
|
+
const resetPref = authConfig?.actions?.resetPassword;
|
|
76
|
+
let actionToInject: EntityAction | undefined;
|
|
77
|
+
|
|
78
|
+
if (resetPref === false) {
|
|
79
|
+
actionToInject = undefined;
|
|
80
|
+
} else if (typeof resetPref === "object") {
|
|
81
|
+
actionToInject = resetPref;
|
|
82
|
+
} else {
|
|
83
|
+
actionToInject = resetPasswordAction;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (actionToInject) {
|
|
87
|
+
const injectedAction = actionToInject;
|
|
88
|
+
const existing = result.entityActions ?? [];
|
|
89
|
+
const alreadyHas = existing.some(
|
|
90
|
+
(a) => a.key != null && a.key === injectedAction.key
|
|
91
|
+
);
|
|
92
|
+
if (!alreadyHas) {
|
|
93
|
+
result = {
|
|
94
|
+
...result,
|
|
95
|
+
entityActions: [...existing, injectedAction]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ─── afterSave callback (creation result dialog) ─────────────────
|
|
101
|
+
const existingAfterSave = result.callbacks?.afterSave;
|
|
102
|
+
result = {
|
|
103
|
+
...result,
|
|
104
|
+
callbacks: {
|
|
105
|
+
...result.callbacks,
|
|
106
|
+
afterSave: async (props) => {
|
|
107
|
+
await existingAfterSave?.(props);
|
|
108
|
+
|
|
109
|
+
const { values, status, context } = props;
|
|
110
|
+
if (status !== "new" && status !== "copy") return;
|
|
111
|
+
|
|
112
|
+
const hasCreationInfo = values.invitationSent !== undefined || values.temporaryPassword !== undefined;
|
|
113
|
+
if (!hasCreationInfo || !isRebaseContext(context) || !context.dialogsController) return;
|
|
114
|
+
|
|
115
|
+
const { dialogsController } = context;
|
|
116
|
+
|
|
117
|
+
const creationResult: UserCreationResult = {
|
|
118
|
+
user: {
|
|
119
|
+
uid: String(props.entityId),
|
|
120
|
+
email: typeof values.email === "string" ? values.email : "",
|
|
121
|
+
displayName: typeof values.displayName === "string" ? values.displayName : "",
|
|
122
|
+
roles: Array.isArray(values.roles) ? values.roles as string[] : [],
|
|
123
|
+
photoURL: typeof values.photoURL === "string"
|
|
124
|
+
? values.photoURL
|
|
125
|
+
: typeof values.photoUrl === "string"
|
|
126
|
+
? values.photoUrl
|
|
127
|
+
: null,
|
|
128
|
+
providerId: "password",
|
|
129
|
+
isAnonymous: false
|
|
130
|
+
},
|
|
131
|
+
invitationSent: !!values.invitationSent,
|
|
132
|
+
temporaryPassword: typeof values.temporaryPassword === "string" ? values.temporaryPassword : undefined
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const { closeDialog } = dialogsController.open({
|
|
136
|
+
key: "user_creation_result",
|
|
137
|
+
Component: () => (
|
|
138
|
+
React.createElement(CreationResultDialog, {
|
|
139
|
+
result: creationResult,
|
|
140
|
+
onClose: () => closeDialog()
|
|
141
|
+
})
|
|
142
|
+
)
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
return result;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export async function resolveCollections(
|
|
153
|
+
collections: undefined | EntityCollection[] | EntityCollectionsBuilder,
|
|
154
|
+
authController: AuthController,
|
|
34
155
|
data: RebaseData,
|
|
35
156
|
plugins: RebasePlugin[] | undefined
|
|
36
157
|
): Promise<EntityCollection[]> {
|
|
@@ -52,21 +173,24 @@ export async function resolveCollections<U extends User, EC extends EntityCollec
|
|
|
52
173
|
}
|
|
53
174
|
|
|
54
175
|
if (plugin.hooks?.injectCollections) {
|
|
55
|
-
resolvedCollections = plugin.hooks.injectCollections(resolvedCollections
|
|
176
|
+
resolvedCollections = plugin.hooks.injectCollections(resolvedCollections);
|
|
56
177
|
}
|
|
57
178
|
}
|
|
58
179
|
}
|
|
59
180
|
|
|
181
|
+
// Auto-inject auth entity actions and callbacks (resetPassword, creation dialog, etc.)
|
|
182
|
+
resolvedCollections = injectAuthCollectionConfig(resolvedCollections);
|
|
183
|
+
|
|
60
184
|
resolvedCollections = filterOutNotAllowedCollections(resolvedCollections, authController);
|
|
61
185
|
return resolvedCollections;
|
|
62
186
|
}
|
|
63
187
|
|
|
64
|
-
export async function resolveAppViews
|
|
188
|
+
export async function resolveAppViews(
|
|
65
189
|
baseViews: AppView[] | AppViewsBuilder | undefined,
|
|
66
|
-
authController: AuthController
|
|
190
|
+
authController: AuthController,
|
|
67
191
|
data: RebaseData,
|
|
68
192
|
plugins?: RebasePlugin[]
|
|
69
|
-
) {
|
|
193
|
+
): Promise<AppView[]> {
|
|
70
194
|
let resolvedViews: AppView[] = [];
|
|
71
195
|
if (typeof baseViews === "function") {
|
|
72
196
|
resolvedViews = await baseViews({
|
|
@@ -4,7 +4,7 @@ import { useCallback, useEffect, useRef, useState, useMemo } from "react";
|
|
|
4
4
|
import { AuthController, CollectionRegistryController, RebaseData, User } from "@rebasepro/types";
|
|
5
5
|
import type { EntityCollectionsBuilder } from "@rebasepro/types";
|
|
6
6
|
import { CollectionRegistry } from "@rebasepro/common";
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
|
|
9
9
|
import { resolveCollections } from "./useNavigationResolution";
|
|
10
10
|
import { areCollectionListsEqual } from "./utils";
|
|
@@ -16,7 +16,7 @@ export type UseResolvedCollectionsProps<EC extends EntityCollection, USER extend
|
|
|
16
16
|
plugins?: RebasePlugin[];
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
collectionRegistryController: CollectionRegistryController<EC> & { collectionRegistryRef: React.MutableRefObject<CollectionRegistry> };
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export type UseResolvedCollectionsResult = {
|
|
@@ -47,8 +47,7 @@ export function useResolvedCollections<EC extends EntityCollection, USER extends
|
|
|
47
47
|
data,
|
|
48
48
|
plugins,
|
|
49
49
|
disabled,
|
|
50
|
-
collectionRegistryController
|
|
51
|
-
userManagement
|
|
50
|
+
collectionRegistryController
|
|
52
51
|
} = props;
|
|
53
52
|
|
|
54
53
|
const [loading, setLoading] = useState(true);
|
|
@@ -70,8 +69,7 @@ export function useResolvedCollections<EC extends EntityCollection, USER extends
|
|
|
70
69
|
authControllerRef.current = authController;
|
|
71
70
|
const pluginsRef = useRef(plugins);
|
|
72
71
|
pluginsRef.current = plugins;
|
|
73
|
-
|
|
74
|
-
userManagementRef.current = userManagement;
|
|
72
|
+
|
|
75
73
|
|
|
76
74
|
// Ref for resolved collections change detection
|
|
77
75
|
const resolvedCollectionsRef = useRef<EntityCollection[]>([]);
|
|
@@ -1,40 +1,8 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { BreadcrumbContext } from "../contexts/BreacrumbsContext";
|
|
3
|
+
import { BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/types";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
* @group Hooks and utilities
|
|
6
|
-
*/
|
|
7
|
-
export interface BreadcrumbsController {
|
|
8
|
-
breadcrumbs: BreadcrumbEntry[];
|
|
9
|
-
set: (props: {
|
|
10
|
-
breadcrumbs: BreadcrumbEntry[];
|
|
11
|
-
}) => void;
|
|
12
|
-
/**
|
|
13
|
-
* Update the count for a specific breadcrumb by ID.
|
|
14
|
-
*/
|
|
15
|
-
updateCount: (id: string, count: number | null | undefined) => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @group Hooks and utilities
|
|
21
|
-
*/
|
|
22
|
-
export interface BreadcrumbEntry {
|
|
23
|
-
title: string;
|
|
24
|
-
url: string;
|
|
25
|
-
/**
|
|
26
|
-
* Optional entity count for collection breadcrumbs.
|
|
27
|
-
* - undefined: not applicable (e.g., entity breadcrumb, custom view)
|
|
28
|
-
* - null: loading
|
|
29
|
-
* - number: loaded count
|
|
30
|
-
*/
|
|
31
|
-
count?: number | null;
|
|
32
|
-
/**
|
|
33
|
-
* Unique identifier for this breadcrumb (e.g., collection path).
|
|
34
|
-
* Used to update count without replacing entire breadcrumb array.
|
|
35
|
-
*/
|
|
36
|
-
id?: string;
|
|
37
|
-
}
|
|
5
|
+
export type { BreadcrumbEntry, BreadcrumbsController };
|
|
38
6
|
|
|
39
7
|
|
|
40
8
|
/**
|
|
@@ -11,11 +11,33 @@ import {
|
|
|
11
11
|
} from "@rebasepro/common";
|
|
12
12
|
import { resolvedSelectedEntityView } from "../util/resolutions";
|
|
13
13
|
import { ADDITIONAL_TAB_WIDTH, CONTAINER_FULL_WIDTH, FORM_CONTAINER_WIDTH } from "@rebasepro/core";
|
|
14
|
-
import { useCustomizationController, useLargeLayout } from "@rebasepro/core";
|
|
14
|
+
import { useCustomizationController, useLargeLayout, useComponentOverride, CollectionComponentOverrideProvider } from "@rebasepro/core";
|
|
15
15
|
import { JSON_TAB_VALUE, HISTORY_TAB_VALUE } from "../components/EntityEditView";
|
|
16
16
|
import React from "react";
|
|
17
17
|
import { EntitySidePanel } from "../components/EntitySidePanel";
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Thin wrapper that resolves the Entity.SidePanel component override.
|
|
21
|
+
* Because the JSX is created inside `propsToSidePanel` (a plain function,
|
|
22
|
+
* not a React component), we need this wrapper so the hook is called at the
|
|
23
|
+
* top level of a React component per the Rules of Hooks.
|
|
24
|
+
*/
|
|
25
|
+
function ResolvedEntitySidePanelInner(props: EntitySidePanelProps) {
|
|
26
|
+
const Resolved = useComponentOverride("Entity.SidePanel", EntitySidePanel);
|
|
27
|
+
return <Resolved {...props}/>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function ResolvedEntitySidePanel(props: EntitySidePanelProps) {
|
|
31
|
+
if (props.collection?.components) {
|
|
32
|
+
return (
|
|
33
|
+
<CollectionComponentOverrideProvider overrides={props.collection.components}>
|
|
34
|
+
<ResolvedEntitySidePanelInner {...props}/>
|
|
35
|
+
</CollectionComponentOverrideProvider>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return <ResolvedEntitySidePanelInner {...props}/>;
|
|
39
|
+
}
|
|
40
|
+
|
|
19
41
|
const NEW_URL_HASH = "new_side";
|
|
20
42
|
const SIDE_URL_HASH = "side";
|
|
21
43
|
|
|
@@ -188,7 +210,7 @@ width: newWidth };
|
|
|
188
210
|
sideDialogsController.open(
|
|
189
211
|
propsToSidePanel({
|
|
190
212
|
...props,
|
|
191
|
-
selectedTab: props.selectedTab ?? defaultSelectedView
|
|
213
|
+
selectedTab: props.selectedTab ?? defaultSelectedView
|
|
192
214
|
},
|
|
193
215
|
urlController.buildUrlCollectionPath,
|
|
194
216
|
urlController.resolveDatabasePathsFrom,
|
|
@@ -317,7 +339,7 @@ const propsToSidePanel = (props: EntitySidePanelProps,
|
|
|
317
339
|
const entityViewWidth = getEntityViewWidth(props, smallLayout, customizationController);
|
|
318
340
|
return {
|
|
319
341
|
key: `${props.path}/${props.entityId}`,
|
|
320
|
-
component: <
|
|
342
|
+
component: <ResolvedEntitySidePanel {...resolvedPanelProps}/>,
|
|
321
343
|
urlPath: urlPath,
|
|
322
344
|
parentUrlPath: parentUrlPath,
|
|
323
345
|
width: entityViewWidth,
|
|
@@ -117,6 +117,7 @@ export const PropertyPreview = React.memo(function PropertyPreview<P extends Pro
|
|
|
117
117
|
size={props.size}
|
|
118
118
|
reference={new EntityReference({ id: value,
|
|
119
119
|
path: stringProperty.reference.path })}
|
|
120
|
+
textOnly={props.textOnly}
|
|
120
121
|
/>;
|
|
121
122
|
} else {
|
|
122
123
|
content = <EmptyValue/>;
|
|
@@ -213,6 +214,7 @@ path: stringProperty.reference.path })}
|
|
|
213
214
|
includeEntityLink={property.includeEntityLink}
|
|
214
215
|
size={props.size}
|
|
215
216
|
reference={value as EntityReference}
|
|
217
|
+
textOnly={props.textOnly}
|
|
216
218
|
/>;
|
|
217
219
|
} else {
|
|
218
220
|
content = buildWrongValueType(propertyKey, property.type, value);
|
|
@@ -229,7 +231,7 @@ path: stringProperty.reference.path })}
|
|
|
229
231
|
content = (
|
|
230
232
|
<div className="flex flex-col w-full gap-0.5">
|
|
231
233
|
{(value as unknown[]).map((item: unknown, index: number) => {
|
|
232
|
-
const entityRelation = normalizeToEntityRelation(item);
|
|
234
|
+
const entityRelation = normalizeToEntityRelation(item, "relation");
|
|
233
235
|
if (!entityRelation) return null;
|
|
234
236
|
return (
|
|
235
237
|
<div className="w-full"
|
|
@@ -241,6 +243,7 @@ path: stringProperty.reference.path })}
|
|
|
241
243
|
includeEntityLink={property.includeEntityLink}
|
|
242
244
|
size={"small"}
|
|
243
245
|
relation={entityRelation}
|
|
246
|
+
textOnly={props.textOnly}
|
|
244
247
|
/>
|
|
245
248
|
</div>
|
|
246
249
|
);
|
|
@@ -249,7 +252,7 @@ path: stringProperty.reference.path })}
|
|
|
249
252
|
);
|
|
250
253
|
} else {
|
|
251
254
|
// Single-cardinality relation
|
|
252
|
-
const relationValue = normalizeToEntityRelation(value);
|
|
255
|
+
const relationValue = normalizeToEntityRelation(value, "relation");
|
|
253
256
|
if (relationValue) {
|
|
254
257
|
content = <RelationPreview
|
|
255
258
|
disabled={!property.relation}
|
|
@@ -258,6 +261,7 @@ path: stringProperty.reference.path })}
|
|
|
258
261
|
includeEntityLink={property.includeEntityLink}
|
|
259
262
|
size={props.size}
|
|
260
263
|
relation={relationValue}
|
|
264
|
+
textOnly={props.textOnly}
|
|
261
265
|
/>;
|
|
262
266
|
} else {
|
|
263
267
|
content = buildWrongValueType(propertyKey, property.type, value);
|
|
@@ -3,12 +3,14 @@ import * as React from "react";
|
|
|
3
3
|
|
|
4
4
|
import { Entity, EntityReference } from "@rebasepro/types";
|
|
5
5
|
import type { PreviewSize } from "../../types/components/PropertyPreviewProps";
|
|
6
|
-
import { useCustomizationController, useEntityFetch } from "@rebasepro/core";
|
|
6
|
+
import { useCustomizationController, useEntityFetch, useComponentOverride, CollectionComponentOverrideProvider } from "@rebasepro/core";
|
|
7
7
|
import { Skeleton } from "@rebasepro/ui";
|
|
8
8
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
9
9
|
import { ErrorView } from "@rebasepro/core";
|
|
10
10
|
import { EntityPreview, EntityPreviewContainer } from "../../components/EntityPreview";
|
|
11
11
|
import { useCollectionRegistryController } from "../../index";
|
|
12
|
+
import { getEntityTitlePropertyKey } from "../../util/previews";
|
|
13
|
+
import { getValueInPath } from "@rebasepro/utils";
|
|
12
14
|
|
|
13
15
|
export type ReferencePreviewProps = {
|
|
14
16
|
disabled?: boolean;
|
|
@@ -19,6 +21,7 @@ export type ReferencePreviewProps = {
|
|
|
19
21
|
hover?: boolean;
|
|
20
22
|
includeEntityLink?: boolean;
|
|
21
23
|
includeId?: boolean;
|
|
24
|
+
textOnly?: boolean;
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
/**
|
|
@@ -28,6 +31,9 @@ export const ReferencePreview = function ReferencePreview(props: ReferencePrevie
|
|
|
28
31
|
const reference = props.reference;
|
|
29
32
|
if (!(typeof reference === "object" && "isEntityReference" in reference && reference.isEntityReference())) {
|
|
30
33
|
console.warn("Reference preview received value of type", typeof reference);
|
|
34
|
+
if (props.textOnly) {
|
|
35
|
+
return <span>{String(reference)}</span>;
|
|
36
|
+
}
|
|
31
37
|
return <EntityPreviewContainer
|
|
32
38
|
onClick={props.onClick}
|
|
33
39
|
size={props.size ?? "medium"}>
|
|
@@ -40,7 +46,9 @@ export const ReferencePreview = function ReferencePreview(props: ReferencePrevie
|
|
|
40
46
|
</ErrorBoundary>;
|
|
41
47
|
};
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
const DefaultMissingReference: React.FC<{ path: string }> = () => null;
|
|
50
|
+
|
|
51
|
+
function ReferencePreviewInternalInner({
|
|
44
52
|
disabled,
|
|
45
53
|
reference,
|
|
46
54
|
previewProperties,
|
|
@@ -48,18 +56,19 @@ function ReferencePreviewInternal({
|
|
|
48
56
|
hover,
|
|
49
57
|
onClick,
|
|
50
58
|
includeEntityLink = true,
|
|
51
|
-
includeId = true
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const collectionRegistryController = useCollectionRegistryController();
|
|
59
|
+
includeId = true,
|
|
60
|
+
textOnly,
|
|
61
|
+
collection
|
|
62
|
+
}: ReferencePreviewProps & { collection?: EntityCollection }) {
|
|
63
|
+
const ResolvedMissingReference = useComponentOverride("Entity.MissingReference", DefaultMissingReference);
|
|
57
64
|
|
|
58
|
-
const collection = collectionRegistryController.getCollection(reference.path);
|
|
59
65
|
if (!collection) {
|
|
60
|
-
if (
|
|
61
|
-
return <
|
|
66
|
+
if (ResolvedMissingReference !== DefaultMissingReference) {
|
|
67
|
+
return <ResolvedMissingReference path={reference.path}/>;
|
|
62
68
|
} else {
|
|
69
|
+
if (textOnly) {
|
|
70
|
+
return <span>{reference.path}</span>;
|
|
71
|
+
}
|
|
63
72
|
return <EntityPreviewContainer
|
|
64
73
|
onClick={onClick}
|
|
65
74
|
size={size ?? "medium"}>
|
|
@@ -78,9 +87,31 @@ function ReferencePreviewInternal({
|
|
|
78
87
|
includeEntityLink={includeEntityLink}
|
|
79
88
|
includeId={includeId}
|
|
80
89
|
onClick={onClick}
|
|
90
|
+
textOnly={textOnly}
|
|
81
91
|
hover={hover}/>
|
|
82
92
|
}
|
|
83
93
|
|
|
94
|
+
function ReferencePreviewInternal(props: ReferencePreviewProps) {
|
|
95
|
+
const collectionRegistryController = useCollectionRegistryController();
|
|
96
|
+
const collection = collectionRegistryController.getCollection(props.reference.path);
|
|
97
|
+
|
|
98
|
+
const content = (
|
|
99
|
+
<ReferencePreviewInternalInner
|
|
100
|
+
{...props}
|
|
101
|
+
collection={collection}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
if (collection?.components) {
|
|
106
|
+
return (
|
|
107
|
+
<CollectionComponentOverrideProvider overrides={collection.components}>
|
|
108
|
+
{content}
|
|
109
|
+
</CollectionComponentOverrideProvider>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
return content;
|
|
113
|
+
}
|
|
114
|
+
|
|
84
115
|
function ReferencePreviewExisting<M extends Record<string, unknown> = Record<string, unknown>>({
|
|
85
116
|
reference,
|
|
86
117
|
collection,
|
|
@@ -90,11 +121,15 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
90
121
|
includeEntityLink,
|
|
91
122
|
includeId,
|
|
92
123
|
onClick,
|
|
93
|
-
hover
|
|
124
|
+
hover,
|
|
125
|
+
textOnly
|
|
94
126
|
}: ReferencePreviewProps & {
|
|
95
127
|
collection: EntityCollection<M>
|
|
96
128
|
}) {
|
|
97
129
|
|
|
130
|
+
const ResolvedEntityPreview = useComponentOverride("Entity.Preview", EntityPreview);
|
|
131
|
+
const customizationController = useCustomizationController();
|
|
132
|
+
|
|
98
133
|
const {
|
|
99
134
|
entity,
|
|
100
135
|
dataLoading,
|
|
@@ -121,6 +156,9 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
121
156
|
tooltip={reference.path}/>;
|
|
122
157
|
}
|
|
123
158
|
if (body) {
|
|
159
|
+
if (textOnly) {
|
|
160
|
+
return <span>{reference.id}</span>;
|
|
161
|
+
}
|
|
124
162
|
|
|
125
163
|
return (
|
|
126
164
|
<EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
@@ -132,6 +170,9 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
132
170
|
}
|
|
133
171
|
|
|
134
172
|
if (dataLoading && !usedEntity) {
|
|
173
|
+
if (textOnly) {
|
|
174
|
+
return <Skeleton className="inline-block w-20 h-4" />;
|
|
175
|
+
}
|
|
135
176
|
return (
|
|
136
177
|
<EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
137
178
|
hover={disabled ? undefined : hover}
|
|
@@ -142,6 +183,9 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
142
183
|
}
|
|
143
184
|
|
|
144
185
|
if (!usedEntity) {
|
|
186
|
+
if (textOnly) {
|
|
187
|
+
return <span>{reference.id}</span>;
|
|
188
|
+
}
|
|
145
189
|
return (
|
|
146
190
|
<EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
147
191
|
hover={disabled ? undefined : hover}
|
|
@@ -151,7 +195,14 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
151
195
|
);
|
|
152
196
|
}
|
|
153
197
|
|
|
154
|
-
|
|
198
|
+
if (textOnly) {
|
|
199
|
+
const titleProperty = getEntityTitlePropertyKey(collection, customizationController.propertyConfigs);
|
|
200
|
+
const titleValue = titleProperty ? getValueInPath(usedEntity.values, titleProperty) : undefined;
|
|
201
|
+
const displayValue = titleValue !== undefined && titleValue !== null ? String(titleValue) : String(reference.id);
|
|
202
|
+
return <span className="truncate">{displayValue}</span>;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return <ResolvedEntityPreview size={size}
|
|
155
206
|
previewKeys={previewProperties}
|
|
156
207
|
disabled={disabled}
|
|
157
208
|
entity={usedEntity}
|