@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
|
@@ -3,7 +3,7 @@ import type { FormContext } from "../types/fields";
|
|
|
3
3
|
import type { PluginFormActionProps } from "@rebasepro/types";
|
|
4
4
|
import React, { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { Entity, EntityStatus, Property } from "@rebasepro/types";
|
|
6
|
-
import { PluginProviderStack, resolveComponentRef } from "@rebasepro/core";
|
|
6
|
+
import { PluginProviderStack, resolveComponentRef, useComponentOverride, CollectionComponentOverrideProvider } from "@rebasepro/core";
|
|
7
7
|
|
|
8
8
|
import { EntityCollectionView, EntityView } from "../components";
|
|
9
9
|
import { CircularProgressCenter, iconSize } from "@rebasepro/ui";
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
import { useUrlController, useCollectionRegistryController } from "../index";
|
|
43
43
|
import { useNavigate } from "react-router-dom";
|
|
44
44
|
import { getValueInPath } from "@rebasepro/utils";
|
|
45
|
-
import { getEntityTitlePropertyKey } from "../util/previews";
|
|
45
|
+
import { getEntityTitlePropertyKey, resolveTitleToString } from "../util/previews";
|
|
46
46
|
import { EntityJsonPreview } from "../components/EntityJsonPreview";
|
|
47
47
|
|
|
48
48
|
const EntityHistoryView = lazy(() => import("../components/history").then(m => ({ default: m.EntityHistoryView })));
|
|
@@ -104,12 +104,23 @@ export function EntityDetailView<M extends Record<string, unknown>>({
|
|
|
104
104
|
</CenteredView>;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
const content = (
|
|
108
|
+
<EntityDetailViewInner<M>
|
|
109
|
+
{...props}
|
|
110
|
+
entityId={entityId}
|
|
111
|
+
entity={entity}
|
|
112
|
+
dataLoading={dataLoading}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
if (props.collection.components) {
|
|
117
|
+
return (
|
|
118
|
+
<CollectionComponentOverrideProvider overrides={props.collection.components}>
|
|
119
|
+
{content}
|
|
120
|
+
</CollectionComponentOverrideProvider>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
return content;
|
|
113
124
|
}
|
|
114
125
|
|
|
115
126
|
function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
@@ -129,6 +140,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
129
140
|
entity?: Entity<M>,
|
|
130
141
|
dataLoading: boolean,
|
|
131
142
|
}) {
|
|
143
|
+
const ResolvedCollectionView = useComponentOverride("Collection.View", EntityCollectionView);
|
|
132
144
|
const { t } = useTranslation();
|
|
133
145
|
const context = useRebaseContext();
|
|
134
146
|
const urlController = useUrlController();
|
|
@@ -149,30 +161,27 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
149
161
|
|
|
150
162
|
const defaultSelectedView = useMemo(() => resolveDefaultSelectedView(
|
|
151
163
|
collection.defaultSelectedView,
|
|
152
|
-
{ status: "existing",
|
|
164
|
+
{ status: "existing",
|
|
165
|
+
entityId }
|
|
153
166
|
), [collection, entityId]);
|
|
154
167
|
|
|
155
|
-
// Track whether
|
|
156
|
-
// See
|
|
157
|
-
const
|
|
168
|
+
// Track whether the user has explicitly clicked a tab in this component
|
|
169
|
+
// instance. See EntityEditViewInner for full explanation.
|
|
170
|
+
const userHasChangedTab = useRef(false);
|
|
158
171
|
|
|
159
172
|
const [selectedTab, setSelectedTab] = useState<string>(() => {
|
|
160
173
|
const val = selectedTabProp ?? defaultSelectedView ?? MAIN_TAB_VALUE;
|
|
161
|
-
hasAppliedDefault.current = true;
|
|
162
174
|
return val === "edit" ? MAIN_TAB_VALUE : val;
|
|
163
175
|
});
|
|
164
176
|
useEffect(() => {
|
|
165
|
-
const val =
|
|
177
|
+
const val = userHasChangedTab.current
|
|
166
178
|
? (selectedTabProp ?? MAIN_TAB_VALUE)
|
|
167
179
|
: (selectedTabProp ?? defaultSelectedView ?? MAIN_TAB_VALUE);
|
|
168
180
|
const target = val === "edit" ? MAIN_TAB_VALUE : val;
|
|
169
|
-
if (!hasAppliedDefault.current) {
|
|
170
|
-
hasAppliedDefault.current = true;
|
|
171
|
-
}
|
|
172
181
|
if (target !== selectedTab) {
|
|
173
182
|
setSelectedTab(target);
|
|
174
183
|
}
|
|
175
|
-
}, [selectedTabProp]);
|
|
184
|
+
}, [selectedTabProp, defaultSelectedView]);
|
|
176
185
|
|
|
177
186
|
const subcollections = getSubcollections(collection).filter(c => !c.hideFromNavigation);
|
|
178
187
|
const subcollectionsCount = subcollections?.length ?? 0;
|
|
@@ -183,16 +192,32 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
183
192
|
const hasAdditionalViews = customViewsCount > 0 || subcollectionsCount > 0 || includeJsonView || includeHistoryView;
|
|
184
193
|
|
|
185
194
|
const {
|
|
186
|
-
resolvedEntityViews
|
|
195
|
+
resolvedEntityViews
|
|
196
|
+
} = resolvedSelectedEntityView(customViews, customizationController, undefined, canEdit);
|
|
197
|
+
|
|
198
|
+
const validTabValues = useMemo(() => {
|
|
199
|
+
const set = new Set<string>([
|
|
200
|
+
MAIN_TAB_VALUE,
|
|
201
|
+
...(includeJsonView ? [JSON_TAB_VALUE] : []),
|
|
202
|
+
...(includeHistoryView ? [HISTORY_TAB_VALUE] : []),
|
|
203
|
+
...resolvedEntityViews.map(v => v.key),
|
|
204
|
+
...subcollections.map(s => s.slug)
|
|
205
|
+
]);
|
|
206
|
+
return set;
|
|
207
|
+
}, [includeJsonView, includeHistoryView, resolvedEntityViews, subcollections]);
|
|
208
|
+
|
|
209
|
+
const activeTab = validTabValues.has(selectedTab) ? selectedTab : MAIN_TAB_VALUE;
|
|
210
|
+
|
|
211
|
+
const {
|
|
187
212
|
selectedEntityView
|
|
188
|
-
} = resolvedSelectedEntityView(customViews, customizationController,
|
|
213
|
+
} = resolvedSelectedEntityView(customViews, customizationController, activeTab, canEdit);
|
|
189
214
|
|
|
190
|
-
const mainViewVisible =
|
|
215
|
+
const mainViewVisible = activeTab === MAIN_TAB_VALUE;
|
|
191
216
|
|
|
192
217
|
// Track which custom view tabs have been visited
|
|
193
218
|
const mountedTabsRef = useRef<Set<string>>(new Set());
|
|
194
|
-
if (
|
|
195
|
-
mountedTabsRef.current.add(
|
|
219
|
+
if (activeTab) {
|
|
220
|
+
mountedTabsRef.current.add(activeTab);
|
|
196
221
|
}
|
|
197
222
|
|
|
198
223
|
// Read-only form context for custom entity views
|
|
@@ -212,6 +237,9 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
212
237
|
save: () => {
|
|
213
238
|
throw new Error("Cannot save in read-only detail view");
|
|
214
239
|
},
|
|
240
|
+
submit: () => {
|
|
241
|
+
throw new Error("Cannot submit in read-only detail view");
|
|
242
|
+
},
|
|
215
243
|
collection,
|
|
216
244
|
path,
|
|
217
245
|
entity: usedEntity,
|
|
@@ -241,9 +269,10 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
241
269
|
|
|
242
270
|
// Title resolution
|
|
243
271
|
const titlePropertyKey = getEntityTitlePropertyKey(collection, customizationController.propertyConfigs);
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
272
|
+
const rawTitle = usedEntity?.values && titlePropertyKey ? getValueInPath(usedEntity.values, titlePropertyKey) : undefined;
|
|
273
|
+
const title = rawTitle !== undefined && rawTitle !== null
|
|
274
|
+
? resolveTitleToString(rawTitle)
|
|
275
|
+
: (collection.singularName ?? collection.name);
|
|
247
276
|
|
|
248
277
|
// Non-action custom views
|
|
249
278
|
const nonActionCustomViews = useMemo(() =>
|
|
@@ -258,7 +287,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
258
287
|
if (!Builder) return null;
|
|
259
288
|
if (!entityId) return null;
|
|
260
289
|
|
|
261
|
-
const isActive =
|
|
290
|
+
const isActive = activeTab === customView.key;
|
|
262
291
|
const hasBeenMounted = mountedTabsRef.current.has(customView.key);
|
|
263
292
|
if (!isActive && !hasBeenMounted) return null;
|
|
264
293
|
|
|
@@ -288,9 +317,9 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
288
317
|
|
|
289
318
|
// JSON view
|
|
290
319
|
const jsonTabMounted = mountedTabsRef.current.has(JSON_TAB_VALUE);
|
|
291
|
-
const jsonView = (
|
|
320
|
+
const jsonView = (activeTab === JSON_TAB_VALUE || jsonTabMounted) ? <div
|
|
292
321
|
className={cls("relative flex-1 h-full overflow-auto w-full",
|
|
293
|
-
{ "hidden":
|
|
322
|
+
{ "hidden": activeTab !== JSON_TAB_VALUE })}
|
|
294
323
|
key={"json_view"}
|
|
295
324
|
role="tabpanel">
|
|
296
325
|
<ErrorBoundary>
|
|
@@ -299,7 +328,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
299
328
|
</div> : null;
|
|
300
329
|
|
|
301
330
|
// History view
|
|
302
|
-
const historyView = includeHistoryView &&
|
|
331
|
+
const historyView = includeHistoryView && activeTab === HISTORY_TAB_VALUE ? <div
|
|
303
332
|
className={"relative flex-1 h-full overflow-auto w-full"}
|
|
304
333
|
key={"history_view"}
|
|
305
334
|
role="tabpanel">
|
|
@@ -320,7 +349,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
320
349
|
const subcollectionId = subcollection.slug;
|
|
321
350
|
const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection.slug)}` : undefined;
|
|
322
351
|
|
|
323
|
-
if (
|
|
352
|
+
if (activeTab !== subcollectionId) return null;
|
|
324
353
|
return (
|
|
325
354
|
<div
|
|
326
355
|
className={"relative flex-1 h-full overflow-auto w-full"}
|
|
@@ -329,7 +358,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
329
358
|
{globalLoading && <CircularProgressCenter />}
|
|
330
359
|
{!globalLoading &&
|
|
331
360
|
(usedEntity && newFullPath
|
|
332
|
-
? <
|
|
361
|
+
? <ResolvedCollectionView
|
|
333
362
|
path={newFullPath}
|
|
334
363
|
parentCollectionSlugs={[...parentCollectionSlugs, collection.slug]}
|
|
335
364
|
parentEntityIds={[...parentEntityIds, String(usedEntity?.id)]}
|
|
@@ -347,6 +376,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
347
376
|
}).filter(Boolean);
|
|
348
377
|
|
|
349
378
|
const onSideTabClick = useCallback((value: string) => {
|
|
379
|
+
userHasChangedTab.current = true;
|
|
350
380
|
setSelectedTab(value);
|
|
351
381
|
onTabChange?.({
|
|
352
382
|
path,
|
|
@@ -386,7 +416,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
386
416
|
|
|
387
417
|
// Tabs
|
|
388
418
|
const subcollectionTabs = subcollections && subcollections.map((subcollection) => {
|
|
389
|
-
const icon = getIcon(subcollection.icon, undefined, undefined, "
|
|
419
|
+
const icon = getIcon(subcollection.icon, undefined, undefined, "smallest");
|
|
390
420
|
return (
|
|
391
421
|
<Tab
|
|
392
422
|
className="text-sm min-w-[90px]"
|
|
@@ -402,7 +432,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
402
432
|
|
|
403
433
|
const customViewTabsStart = resolvedEntityViews.filter(view => view.position === "start")
|
|
404
434
|
.map((view) => {
|
|
405
|
-
const icon = getIcon(view.icon, undefined, undefined, "
|
|
435
|
+
const icon = getIcon(view.icon, undefined, undefined, "smallest");
|
|
406
436
|
return (
|
|
407
437
|
<Tab
|
|
408
438
|
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
@@ -419,7 +449,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
419
449
|
});
|
|
420
450
|
const customViewTabsEnd = resolvedEntityViews.filter(view => !view.position || view.position === "end")
|
|
421
451
|
.map((view) => {
|
|
422
|
-
const icon = getIcon(view.icon, undefined, undefined, "
|
|
452
|
+
const icon = getIcon(view.icon, undefined, undefined, "smallest");
|
|
423
453
|
return (
|
|
424
454
|
<Tab
|
|
425
455
|
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
@@ -541,7 +571,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
541
571
|
{hasAdditionalViews && <div className={"flex-1 flex justify-end min-w-0 shrink-0"}>
|
|
542
572
|
<Tabs
|
|
543
573
|
className={"!w-fit max-w-full"}
|
|
544
|
-
value={
|
|
574
|
+
value={activeTab}
|
|
545
575
|
onValueChange={(value) => {
|
|
546
576
|
onSideTabClick(value);
|
|
547
577
|
}}>
|
|
@@ -550,21 +580,24 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
550
580
|
disabled={!hasAdditionalViews}
|
|
551
581
|
value={JSON_TAB_VALUE}
|
|
552
582
|
className={"text-sm"}>
|
|
553
|
-
<CodeIcon size={iconSize.
|
|
583
|
+
<CodeIcon size={iconSize.smallest} />
|
|
554
584
|
</Tab>}
|
|
555
585
|
|
|
556
586
|
{includeHistoryView && <Tab
|
|
557
587
|
disabled={!hasAdditionalViews}
|
|
558
588
|
value={HISTORY_TAB_VALUE}
|
|
559
589
|
className={"text-sm"}>
|
|
560
|
-
<HistoryIcon size={iconSize.
|
|
590
|
+
<HistoryIcon size={iconSize.smallest} />
|
|
561
591
|
</Tab>}
|
|
562
592
|
|
|
563
593
|
<Tab
|
|
564
594
|
disabled={!hasAdditionalViews}
|
|
565
595
|
value={MAIN_TAB_VALUE}
|
|
566
596
|
className={"text-sm min-w-[90px]"}>
|
|
567
|
-
|
|
597
|
+
<span className="flex items-center gap-1.5">
|
|
598
|
+
{getIcon(collection.icon, undefined, undefined, "smallest")}
|
|
599
|
+
{collection.singularName ?? collection.name}
|
|
600
|
+
</span>
|
|
568
601
|
</Tab>
|
|
569
602
|
|
|
570
603
|
{customViewTabsStart}
|
|
@@ -3,7 +3,7 @@ import type { FormContext } from "../types/fields";
|
|
|
3
3
|
import type { PluginFormActionProps } from "@rebasepro/types";
|
|
4
4
|
import React, { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { Entity, EntityStatus } from "@rebasepro/types";
|
|
6
|
-
import { PluginProviderStack, resolveComponentRef } from "@rebasepro/core";
|
|
6
|
+
import { PluginProviderStack, resolveComponentRef, useComponentOverride, CollectionComponentOverrideProvider } from "@rebasepro/core";
|
|
7
7
|
|
|
8
8
|
import { EntityCollectionView, EntityView } from "../components";
|
|
9
9
|
import { CircularProgressCenter, iconSize } from "@rebasepro/ui";
|
|
@@ -146,15 +146,26 @@ export function EntityEditView<M extends Record<string, unknown>>({
|
|
|
146
146
|
</CenteredView>;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
149
|
+
const content = (
|
|
150
|
+
<EntityEditViewInner<M> {...props}
|
|
151
|
+
entityId={entityId}
|
|
152
|
+
entity={entity}
|
|
153
|
+
initialDirtyValues={initialDirtyValues as Partial<M>}
|
|
154
|
+
dataLoading={dataLoading}
|
|
155
|
+
status={status}
|
|
156
|
+
setStatus={setStatus}
|
|
157
|
+
canEdit={canEdit}
|
|
158
|
+
/>
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
if (props.collection.components) {
|
|
162
|
+
return (
|
|
163
|
+
<CollectionComponentOverrideProvider overrides={props.collection.components}>
|
|
164
|
+
{content}
|
|
165
|
+
</CollectionComponentOverrideProvider>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
return content;
|
|
158
169
|
}
|
|
159
170
|
|
|
160
171
|
export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
@@ -185,6 +196,10 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
185
196
|
canEdit?: boolean,
|
|
186
197
|
}) {
|
|
187
198
|
|
|
199
|
+
const ResolvedFormActions = useComponentOverride("Entity.FormActions", EntityEditViewFormActions);
|
|
200
|
+
const ResolvedEntityForm = useComponentOverride("Entity.Form", EntityForm) as typeof EntityForm;
|
|
201
|
+
const ResolvedCollectionView = useComponentOverride("Collection.View", EntityCollectionView);
|
|
202
|
+
|
|
188
203
|
const context = useRebaseContext();
|
|
189
204
|
const urlController = useUrlController();
|
|
190
205
|
const navigate = useNavigate();
|
|
@@ -205,7 +220,8 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
205
220
|
|
|
206
221
|
const formActionTopProps: PluginFormActionProps = useMemo(() => ({
|
|
207
222
|
entityId,
|
|
208
|
-
parentCollectionSlugs,
|
|
223
|
+
parentCollectionSlugs,
|
|
224
|
+
parentEntityIds,
|
|
209
225
|
path: path,
|
|
210
226
|
status,
|
|
211
227
|
collection: collection!,
|
|
@@ -224,33 +240,26 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
224
240
|
}
|
|
225
241
|
), [collection, status, entityId]);
|
|
226
242
|
|
|
227
|
-
// Track whether
|
|
228
|
-
//
|
|
229
|
-
//
|
|
230
|
-
//
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
const hasAppliedDefault = useRef(false);
|
|
243
|
+
// Track whether the user has explicitly clicked a tab in this component
|
|
244
|
+
// instance. When false, we fall back to defaultSelectedView (which may
|
|
245
|
+
// resolve asynchronously if the collection loads from the registry after
|
|
246
|
+
// mount). Once true, selectedTabProp=undefined means the user selected
|
|
247
|
+
// the form tab, so we must NOT re-apply defaultSelectedView.
|
|
248
|
+
const userHasChangedTab = useRef(false);
|
|
234
249
|
|
|
235
250
|
const [selectedTab, setSelectedTab] = useState<string>(() => {
|
|
236
251
|
const val = selectedTabProp ?? defaultSelectedView ?? MAIN_TAB_VALUE;
|
|
237
|
-
hasAppliedDefault.current = true;
|
|
238
252
|
return val === "edit" ? MAIN_TAB_VALUE : val;
|
|
239
253
|
});
|
|
240
254
|
useEffect(() => {
|
|
241
|
-
|
|
242
|
-
// back to defaultSelectedView, because undefined now means "form tab".
|
|
243
|
-
const val = hasAppliedDefault.current
|
|
255
|
+
const val = userHasChangedTab.current
|
|
244
256
|
? (selectedTabProp ?? MAIN_TAB_VALUE)
|
|
245
257
|
: (selectedTabProp ?? defaultSelectedView ?? MAIN_TAB_VALUE);
|
|
246
258
|
const target = val === "edit" ? MAIN_TAB_VALUE : val;
|
|
247
|
-
if (!hasAppliedDefault.current) {
|
|
248
|
-
hasAppliedDefault.current = true;
|
|
249
|
-
}
|
|
250
259
|
if (target !== selectedTab) {
|
|
251
260
|
setSelectedTab(target);
|
|
252
261
|
}
|
|
253
|
-
}, [selectedTabProp]);
|
|
262
|
+
}, [selectedTabProp, defaultSelectedView]);
|
|
254
263
|
|
|
255
264
|
const subcollections = getSubcollections(collection).filter(c => !c.hideFromNavigation);
|
|
256
265
|
const subcollectionsCount = subcollections?.length ?? 0;
|
|
@@ -261,20 +270,36 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
261
270
|
const hasAdditionalViews = customViewsCount > 0 || subcollectionsCount > 0 || includeJsonView || includeHistoryView;
|
|
262
271
|
|
|
263
272
|
const {
|
|
264
|
-
resolvedEntityViews
|
|
273
|
+
resolvedEntityViews
|
|
274
|
+
} = resolvedSelectedEntityView(customViews, customizationController, undefined, canEdit);
|
|
275
|
+
|
|
276
|
+
const validTabValues = useMemo(() => {
|
|
277
|
+
const set = new Set<string>([
|
|
278
|
+
MAIN_TAB_VALUE,
|
|
279
|
+
...(includeJsonView ? [JSON_TAB_VALUE] : []),
|
|
280
|
+
...(includeHistoryView ? [HISTORY_TAB_VALUE] : []),
|
|
281
|
+
...resolvedEntityViews.map(v => v.key),
|
|
282
|
+
...subcollections.map(s => s.slug)
|
|
283
|
+
]);
|
|
284
|
+
return set;
|
|
285
|
+
}, [includeJsonView, includeHistoryView, resolvedEntityViews, subcollections]);
|
|
286
|
+
|
|
287
|
+
const activeTab = validTabValues.has(selectedTab) ? selectedTab : MAIN_TAB_VALUE;
|
|
288
|
+
|
|
289
|
+
const {
|
|
265
290
|
selectedEntityView,
|
|
266
291
|
selectedSecondaryForm
|
|
267
|
-
} = resolvedSelectedEntityView(customViews, customizationController,
|
|
292
|
+
} = resolvedSelectedEntityView(customViews, customizationController, activeTab, canEdit);
|
|
268
293
|
|
|
269
294
|
const actionsAtTheBottom = layout === "side_panel" || layout === "dialog" || selectedEntityView?.includeActions === "bottom";
|
|
270
295
|
|
|
271
|
-
const mainViewVisible =
|
|
296
|
+
const mainViewVisible = activeTab === MAIN_TAB_VALUE || Boolean(selectedSecondaryForm);
|
|
272
297
|
|
|
273
298
|
// Track which custom view tabs have been visited so we keep them mounted
|
|
274
299
|
// (preserving their state) but don't eagerly mount tabs never visited.
|
|
275
300
|
const mountedTabsRef = useRef<Set<string>>(new Set());
|
|
276
|
-
if (
|
|
277
|
-
mountedTabsRef.current.add(
|
|
301
|
+
if (activeTab) {
|
|
302
|
+
mountedTabsRef.current.add(activeTab);
|
|
278
303
|
}
|
|
279
304
|
|
|
280
305
|
// Memoize the read-only fallback form context to avoid recreating it every render
|
|
@@ -295,6 +320,9 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
295
320
|
save: () => {
|
|
296
321
|
throw new Error("You can't save in read only mode");
|
|
297
322
|
},
|
|
323
|
+
submit: () => {
|
|
324
|
+
throw new Error("You can't submit in read only mode");
|
|
325
|
+
},
|
|
298
326
|
collection,
|
|
299
327
|
path: path,
|
|
300
328
|
entity: usedEntity,
|
|
@@ -324,7 +352,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
324
352
|
}
|
|
325
353
|
|
|
326
354
|
// Only mount tabs that have been visited at least once
|
|
327
|
-
const isActive =
|
|
355
|
+
const isActive = activeTab === customView.key;
|
|
328
356
|
const hasBeenMounted = mountedTabsRef.current.has(customView.key);
|
|
329
357
|
if (!isActive && !hasBeenMounted) {
|
|
330
358
|
return null;
|
|
@@ -357,9 +385,9 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
357
385
|
|
|
358
386
|
// Only mount JSON view when its tab is selected (or was previously selected)
|
|
359
387
|
const jsonTabMounted = mountedTabsRef.current.has(JSON_TAB_VALUE);
|
|
360
|
-
const jsonView = (
|
|
388
|
+
const jsonView = (activeTab === JSON_TAB_VALUE || jsonTabMounted) ? <div
|
|
361
389
|
className={cls("relative flex-1 h-full overflow-auto w-full",
|
|
362
|
-
{ "hidden":
|
|
390
|
+
{ "hidden": activeTab !== JSON_TAB_VALUE })}
|
|
363
391
|
key={"json_view"}
|
|
364
392
|
role="tabpanel">
|
|
365
393
|
<ErrorBoundary>
|
|
@@ -369,7 +397,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
369
397
|
</div> : null;
|
|
370
398
|
|
|
371
399
|
// Only mount history view when its tab is actually selected
|
|
372
|
-
const historyView = includeHistoryView &&
|
|
400
|
+
const historyView = includeHistoryView && activeTab === HISTORY_TAB_VALUE ? <div
|
|
373
401
|
className={"relative flex-1 h-full overflow-auto w-full"}
|
|
374
402
|
key={"history_view"}
|
|
375
403
|
role="tabpanel">
|
|
@@ -389,7 +417,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
389
417
|
const subcollectionId = subcollection.slug;
|
|
390
418
|
const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection.slug)}` : undefined;
|
|
391
419
|
|
|
392
|
-
if (
|
|
420
|
+
if (activeTab !== subcollectionId) return null;
|
|
393
421
|
return (
|
|
394
422
|
<div
|
|
395
423
|
className={"relative flex-1 h-full overflow-auto w-full"}
|
|
@@ -400,7 +428,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
400
428
|
|
|
401
429
|
{!globalLoading &&
|
|
402
430
|
(usedEntity && newFullPath
|
|
403
|
-
? <
|
|
431
|
+
? <ResolvedCollectionView
|
|
404
432
|
path={newFullPath}
|
|
405
433
|
parentCollectionSlugs={[...parentCollectionSlugs, collection.slug]}
|
|
406
434
|
parentEntityIds={[...parentEntityIds, String(usedEntity?.id)]}
|
|
@@ -420,6 +448,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
420
448
|
}).filter(Boolean);
|
|
421
449
|
|
|
422
450
|
const onSideTabClick = useCallback((value: string) => {
|
|
451
|
+
userHasChangedTab.current = true;
|
|
423
452
|
setSelectedTab(value);
|
|
424
453
|
if (status === "existing") {
|
|
425
454
|
onTabChange?.({
|
|
@@ -485,7 +514,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
485
514
|
</ErrorBoundary>
|
|
486
515
|
</div>
|
|
487
516
|
) : (
|
|
488
|
-
<
|
|
517
|
+
<ResolvedEntityForm<M>
|
|
489
518
|
collection={collection}
|
|
490
519
|
path={path}
|
|
491
520
|
entityId={entityId ?? usedEntity?.id}
|
|
@@ -496,7 +525,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
496
525
|
forceActionsAtTheBottom={actionsAtTheBottom}
|
|
497
526
|
initialStatus={status}
|
|
498
527
|
className={cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className)}
|
|
499
|
-
EntityFormActionsComponent={
|
|
528
|
+
EntityFormActionsComponent={ResolvedFormActions as React.FC<typeof ResolvedFormActions extends React.ComponentType<infer P> ? P : never>}
|
|
500
529
|
disabled={!canEdit}
|
|
501
530
|
navigateBack={navigateBack}
|
|
502
531
|
{...formProps}
|
|
@@ -515,7 +544,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
515
544
|
onSaved={(params) => {
|
|
516
545
|
const res = {
|
|
517
546
|
...params,
|
|
518
|
-
selectedTab: MAIN_TAB_VALUE ===
|
|
547
|
+
selectedTab: MAIN_TAB_VALUE === activeTab ? undefined : activeTab
|
|
519
548
|
};
|
|
520
549
|
onSaved?.(res);
|
|
521
550
|
formProps?.onSaved?.(res);
|
|
@@ -525,7 +554,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
525
554
|
);
|
|
526
555
|
|
|
527
556
|
const subcollectionTabs = subcollections && subcollections.map((subcollection) => {
|
|
528
|
-
const icon = getIcon(subcollection.icon, undefined, undefined, "
|
|
557
|
+
const icon = getIcon(subcollection.icon, undefined, undefined, "smallest");
|
|
529
558
|
return (
|
|
530
559
|
<Tab
|
|
531
560
|
className="text-sm min-w-[90px]"
|
|
@@ -541,7 +570,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
541
570
|
|
|
542
571
|
const customViewTabsStart = resolvedEntityViews.filter(view => view.position === "start")
|
|
543
572
|
.map((view) => {
|
|
544
|
-
const icon = getIcon(view.icon, undefined, undefined, "
|
|
573
|
+
const icon = getIcon(view.icon, undefined, undefined, "smallest");
|
|
545
574
|
return (
|
|
546
575
|
<Tab
|
|
547
576
|
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
@@ -558,7 +587,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
558
587
|
});
|
|
559
588
|
const customViewTabsEnd = resolvedEntityViews.filter(view => !view.position || view.position === "end")
|
|
560
589
|
.map((view) => {
|
|
561
|
-
const icon = getIcon(view.icon, undefined, undefined, "
|
|
590
|
+
const icon = getIcon(view.icon, undefined, undefined, "smallest");
|
|
562
591
|
return (
|
|
563
592
|
<Tab
|
|
564
593
|
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
@@ -612,7 +641,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
612
641
|
{hasAdditionalViews && <div className={"flex-1 flex justify-end min-w-0 shrink-0"}>
|
|
613
642
|
<Tabs
|
|
614
643
|
className={"!w-fit max-w-full"}
|
|
615
|
-
value={
|
|
644
|
+
value={activeTab}
|
|
616
645
|
onValueChange={(value) => {
|
|
617
646
|
onSideTabClick(value);
|
|
618
647
|
}}>
|
|
@@ -621,21 +650,24 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
621
650
|
disabled={!hasAdditionalViews}
|
|
622
651
|
value={JSON_TAB_VALUE}
|
|
623
652
|
className={"text-sm"}>
|
|
624
|
-
<CodeIcon size={iconSize.
|
|
653
|
+
<CodeIcon size={iconSize.smallest} />
|
|
625
654
|
</Tab>}
|
|
626
655
|
|
|
627
656
|
{includeHistoryView && <Tab
|
|
628
657
|
disabled={!hasAdditionalViews}
|
|
629
658
|
value={HISTORY_TAB_VALUE}
|
|
630
659
|
className={"text-sm"}>
|
|
631
|
-
<HistoryIcon size={iconSize.
|
|
660
|
+
<HistoryIcon size={iconSize.smallest} />
|
|
632
661
|
</Tab>}
|
|
633
662
|
|
|
634
663
|
<Tab
|
|
635
664
|
disabled={!hasAdditionalViews}
|
|
636
665
|
value={MAIN_TAB_VALUE}
|
|
637
666
|
className={"text-sm min-w-[90px]"}>
|
|
638
|
-
|
|
667
|
+
<span className="flex items-center gap-1.5">
|
|
668
|
+
{getIcon(collection.icon, undefined, undefined, "smallest")}
|
|
669
|
+
{collection.singularName ?? collection.name}
|
|
670
|
+
</span>
|
|
639
671
|
</Tab>
|
|
640
672
|
|
|
641
673
|
{customViewTabsStart}
|
|
@@ -9,7 +9,7 @@ import { EntityEditView } from "./EntityEditView";
|
|
|
9
9
|
import { EntityDetailView } from "./EntityDetailView";
|
|
10
10
|
import { useSideDialogContext } from "./SideDialogs";
|
|
11
11
|
import { useNavigate } from "react-router-dom";
|
|
12
|
-
import { saveEntityToMemoryCache } from "@rebasepro/core";
|
|
12
|
+
import { saveEntityToMemoryCache, useComponentOverride } from "@rebasepro/core";
|
|
13
13
|
import { useCollectionRegistryController, useSideEntityController } from "../index";
|
|
14
14
|
import { useUrlController } from "../index";
|
|
15
15
|
import { resolveDefaultSelectedView } from "@rebasepro/common";
|
|
@@ -32,6 +32,8 @@ export function EntitySidePanel(props: EntitySidePanelProps) {
|
|
|
32
32
|
formProps
|
|
33
33
|
} = props;
|
|
34
34
|
|
|
35
|
+
const ResolvedDetailView = useComponentOverride("Entity.DetailView", EntityDetailView);
|
|
36
|
+
|
|
35
37
|
const {
|
|
36
38
|
blocked,
|
|
37
39
|
setBlocked,
|
|
@@ -102,6 +104,9 @@ export function EntitySidePanel(props: EntitySidePanelProps) {
|
|
|
102
104
|
// editor / Studio and is not available on the collection object the
|
|
103
105
|
// caller passed to sideEntityController.open().
|
|
104
106
|
const hasCorrectedDefaultView = useRef(false);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
hasCorrectedDefaultView.current = false;
|
|
109
|
+
}, [entityId]);
|
|
105
110
|
useEffect(() => {
|
|
106
111
|
if (hasCorrectedDefaultView.current) return;
|
|
107
112
|
if (selectedTab) return; // Already has a tab — no correction needed
|
|
@@ -109,7 +114,8 @@ export function EntitySidePanel(props: EntitySidePanelProps) {
|
|
|
109
114
|
|
|
110
115
|
const effectiveDefault = resolveDefaultSelectedView(
|
|
111
116
|
collection.defaultSelectedView,
|
|
112
|
-
{ status: "existing",
|
|
117
|
+
{ status: "existing",
|
|
118
|
+
entityId }
|
|
113
119
|
);
|
|
114
120
|
if (effectiveDefault && effectiveDefault !== "edit") {
|
|
115
121
|
hasCorrectedDefaultView.current = true;
|
|
@@ -141,7 +147,7 @@ export function EntitySidePanel(props: EntitySidePanelProps) {
|
|
|
141
147
|
<>
|
|
142
148
|
<ErrorBoundary>
|
|
143
149
|
{isDetailMode
|
|
144
|
-
? <
|
|
150
|
+
? <ResolvedDetailView
|
|
145
151
|
path={path}
|
|
146
152
|
layout={collection?.openEntityMode === "dialog" ? "dialog" : "side_panel"}
|
|
147
153
|
collection={collection as EntityCollection}
|
|
@@ -22,7 +22,7 @@ import { toArray } from "@rebasepro/utils";
|
|
|
22
22
|
import { useCollapsedGroups, buildCollapsedDefaults, useCustomizationController, useTranslation, useSlot, useAdminModeController, useRebaseRegistry } from "@rebasepro/core";
|
|
23
23
|
import { useRestoreScroll } from "@rebasepro/core";
|
|
24
24
|
|
|
25
|
-
import {
|
|
25
|
+
import { SchemaDriftBanner } from "@rebasepro/core";
|
|
26
26
|
import { useBreadcrumbsController, useCMSContext } from "../../index";
|
|
27
27
|
|
|
28
28
|
export const DEFAULT_GROUP_NAME = "Views";
|
|
@@ -320,8 +320,8 @@ export function ContentHomePage({
|
|
|
320
320
|
return (
|
|
321
321
|
<div ref={containerRef} className="py-2 overflow-auto h-full w-full bg-surface-50 dark:bg-surface-800">
|
|
322
322
|
<Container maxWidth="6xl">
|
|
323
|
-
<div className="mb-4">
|
|
324
|
-
<
|
|
323
|
+
<div className="mb-4 flex flex-col gap-2">
|
|
324
|
+
<SchemaDriftBanner />
|
|
325
325
|
</div>
|
|
326
326
|
{/* search & actions */}
|
|
327
327
|
<div
|