@rebasepro/admin 0.5.0 → 0.6.1
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 +7 -3
- package/dist/CollectionEditorDialog-HNXGxXdO.js +3549 -0
- package/dist/CollectionEditorDialog-HNXGxXdO.js.map +1 -0
- package/dist/CollectionsStudioView-B1mN33GB.js +170 -0
- package/dist/CollectionsStudioView-B1mN33GB.js.map +1 -0
- package/dist/PropertyEditView-C2wp8kQ9.js +3660 -0
- package/dist/PropertyEditView-C2wp8kQ9.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 -4
- 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.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 +10 -4
- 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 +2623 -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 +4 -3
- 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-BO6VT85a.js +311 -0
- package/dist/history-BO6VT85a.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.d.ts +1 -1
- 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-BYniefVu.js +24011 -0
- package/dist/src-BYniefVu.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 -26
- package/src/collection_editor/ConfigControllerProvider.tsx +10 -7
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -0
- 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/DisplaySettingsForm.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +5 -2
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +7 -2
- package/src/collection_editor/validateCollectionJson.ts +2 -2
- package/src/components/ArrayContainer.tsx +5 -5
- 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/DrawerNavigationItem.tsx +4 -4
- 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/EntityCollectionView/Board.tsx +10 -8
- package/src/components/EntityCollectionView/BoardSortableList.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +6 -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 +29 -19
- package/src/components/EntityDetailView.tsx +66 -30
- package/src/components/EntityEditView.tsx +70 -32
- package/src/components/EntitySidePanel.tsx +6 -3
- package/src/components/HomePage/ContentHomePage.tsx +3 -3
- package/src/components/HomePage/NavigationCard.tsx +9 -15
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/HomePage/NavigationGroup.tsx +1 -1
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -5
- 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/SelectableTable/filters/StringNumberFilterField.tsx +28 -21
- package/src/components/UserSelector.tsx +92 -2
- package/src/components/common/default_entity_actions.tsx +33 -8
- package/src/components/field_configs.tsx +6 -3
- package/src/editor/editor.tsx +15 -9
- 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/field_bindings/MapFieldBinding.tsx +3 -3
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +4 -4
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +1 -1
- 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/index.ts +2 -2
- 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-C8E440oK.js +0 -4574
- package/dist/CollectionEditorDialog-C8E440oK.js.map +0 -1
- package/dist/CollectionsStudioView-Brr_b06v.js +0 -217
- package/dist/CollectionsStudioView-Brr_b06v.js.map +0 -1
- package/dist/ExportCollectionAction-D3TTYXrq.js +0 -446
- package/dist/ExportCollectionAction-D3TTYXrq.js.map +0 -1
- package/dist/ImportCollectionAction-Dn7lya6E.js +0 -685
- package/dist/ImportCollectionAction-Dn7lya6E.js.map +0 -1
- package/dist/PropertyEditView-ChBleIbN.js +0 -8197
- package/dist/PropertyEditView-ChBleIbN.js.map +0 -1
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/index-D3S9x_RP.js +0 -462
- package/dist/index-D3S9x_RP.js.map +0 -1
- package/dist/index-D9RNzm01.js +0 -12
- package/dist/index-D9RNzm01.js.map +0 -1
- package/dist/index-DrrT332R.js +0 -8
- package/dist/index-DrrT332R.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-COYYD8zr.js +0 -30474
- package/dist/util-COYYD8zr.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,7 +161,8 @@ 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
168
|
// Track whether the user has explicitly clicked a tab in this component
|
|
@@ -179,16 +192,32 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
179
192
|
const hasAdditionalViews = customViewsCount > 0 || subcollectionsCount > 0 || includeJsonView || includeHistoryView;
|
|
180
193
|
|
|
181
194
|
const {
|
|
182
|
-
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 {
|
|
183
212
|
selectedEntityView
|
|
184
|
-
} = resolvedSelectedEntityView(customViews, customizationController,
|
|
213
|
+
} = resolvedSelectedEntityView(customViews, customizationController, activeTab, canEdit);
|
|
185
214
|
|
|
186
|
-
const mainViewVisible =
|
|
215
|
+
const mainViewVisible = activeTab === MAIN_TAB_VALUE;
|
|
187
216
|
|
|
188
217
|
// Track which custom view tabs have been visited
|
|
189
218
|
const mountedTabsRef = useRef<Set<string>>(new Set());
|
|
190
|
-
if (
|
|
191
|
-
mountedTabsRef.current.add(
|
|
219
|
+
if (activeTab) {
|
|
220
|
+
mountedTabsRef.current.add(activeTab);
|
|
192
221
|
}
|
|
193
222
|
|
|
194
223
|
// Read-only form context for custom entity views
|
|
@@ -208,6 +237,9 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
208
237
|
save: () => {
|
|
209
238
|
throw new Error("Cannot save in read-only detail view");
|
|
210
239
|
},
|
|
240
|
+
submit: () => {
|
|
241
|
+
throw new Error("Cannot submit in read-only detail view");
|
|
242
|
+
},
|
|
211
243
|
collection,
|
|
212
244
|
path,
|
|
213
245
|
entity: usedEntity,
|
|
@@ -237,9 +269,10 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
237
269
|
|
|
238
270
|
// Title resolution
|
|
239
271
|
const titlePropertyKey = getEntityTitlePropertyKey(collection, customizationController.propertyConfigs);
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
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);
|
|
243
276
|
|
|
244
277
|
// Non-action custom views
|
|
245
278
|
const nonActionCustomViews = useMemo(() =>
|
|
@@ -254,7 +287,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
254
287
|
if (!Builder) return null;
|
|
255
288
|
if (!entityId) return null;
|
|
256
289
|
|
|
257
|
-
const isActive =
|
|
290
|
+
const isActive = activeTab === customView.key;
|
|
258
291
|
const hasBeenMounted = mountedTabsRef.current.has(customView.key);
|
|
259
292
|
if (!isActive && !hasBeenMounted) return null;
|
|
260
293
|
|
|
@@ -284,9 +317,9 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
284
317
|
|
|
285
318
|
// JSON view
|
|
286
319
|
const jsonTabMounted = mountedTabsRef.current.has(JSON_TAB_VALUE);
|
|
287
|
-
const jsonView = (
|
|
320
|
+
const jsonView = (activeTab === JSON_TAB_VALUE || jsonTabMounted) ? <div
|
|
288
321
|
className={cls("relative flex-1 h-full overflow-auto w-full",
|
|
289
|
-
{ "hidden":
|
|
322
|
+
{ "hidden": activeTab !== JSON_TAB_VALUE })}
|
|
290
323
|
key={"json_view"}
|
|
291
324
|
role="tabpanel">
|
|
292
325
|
<ErrorBoundary>
|
|
@@ -295,7 +328,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
295
328
|
</div> : null;
|
|
296
329
|
|
|
297
330
|
// History view
|
|
298
|
-
const historyView = includeHistoryView &&
|
|
331
|
+
const historyView = includeHistoryView && activeTab === HISTORY_TAB_VALUE ? <div
|
|
299
332
|
className={"relative flex-1 h-full overflow-auto w-full"}
|
|
300
333
|
key={"history_view"}
|
|
301
334
|
role="tabpanel">
|
|
@@ -316,7 +349,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
316
349
|
const subcollectionId = subcollection.slug;
|
|
317
350
|
const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection.slug)}` : undefined;
|
|
318
351
|
|
|
319
|
-
if (
|
|
352
|
+
if (activeTab !== subcollectionId) return null;
|
|
320
353
|
return (
|
|
321
354
|
<div
|
|
322
355
|
className={"relative flex-1 h-full overflow-auto w-full"}
|
|
@@ -325,7 +358,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
325
358
|
{globalLoading && <CircularProgressCenter />}
|
|
326
359
|
{!globalLoading &&
|
|
327
360
|
(usedEntity && newFullPath
|
|
328
|
-
? <
|
|
361
|
+
? <ResolvedCollectionView
|
|
329
362
|
path={newFullPath}
|
|
330
363
|
parentCollectionSlugs={[...parentCollectionSlugs, collection.slug]}
|
|
331
364
|
parentEntityIds={[...parentEntityIds, String(usedEntity?.id)]}
|
|
@@ -383,7 +416,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
383
416
|
|
|
384
417
|
// Tabs
|
|
385
418
|
const subcollectionTabs = subcollections && subcollections.map((subcollection) => {
|
|
386
|
-
const icon = getIcon(subcollection.icon, undefined, undefined, "
|
|
419
|
+
const icon = getIcon(subcollection.icon, undefined, undefined, "smallest");
|
|
387
420
|
return (
|
|
388
421
|
<Tab
|
|
389
422
|
className="text-sm min-w-[90px]"
|
|
@@ -399,7 +432,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
399
432
|
|
|
400
433
|
const customViewTabsStart = resolvedEntityViews.filter(view => view.position === "start")
|
|
401
434
|
.map((view) => {
|
|
402
|
-
const icon = getIcon(view.icon, undefined, undefined, "
|
|
435
|
+
const icon = getIcon(view.icon, undefined, undefined, "smallest");
|
|
403
436
|
return (
|
|
404
437
|
<Tab
|
|
405
438
|
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
@@ -416,7 +449,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
416
449
|
});
|
|
417
450
|
const customViewTabsEnd = resolvedEntityViews.filter(view => !view.position || view.position === "end")
|
|
418
451
|
.map((view) => {
|
|
419
|
-
const icon = getIcon(view.icon, undefined, undefined, "
|
|
452
|
+
const icon = getIcon(view.icon, undefined, undefined, "smallest");
|
|
420
453
|
return (
|
|
421
454
|
<Tab
|
|
422
455
|
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
@@ -538,7 +571,7 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
538
571
|
{hasAdditionalViews && <div className={"flex-1 flex justify-end min-w-0 shrink-0"}>
|
|
539
572
|
<Tabs
|
|
540
573
|
className={"!w-fit max-w-full"}
|
|
541
|
-
value={
|
|
574
|
+
value={activeTab}
|
|
542
575
|
onValueChange={(value) => {
|
|
543
576
|
onSideTabClick(value);
|
|
544
577
|
}}>
|
|
@@ -547,21 +580,24 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
547
580
|
disabled={!hasAdditionalViews}
|
|
548
581
|
value={JSON_TAB_VALUE}
|
|
549
582
|
className={"text-sm"}>
|
|
550
|
-
<CodeIcon size={iconSize.
|
|
583
|
+
<CodeIcon size={iconSize.smallest} />
|
|
551
584
|
</Tab>}
|
|
552
585
|
|
|
553
586
|
{includeHistoryView && <Tab
|
|
554
587
|
disabled={!hasAdditionalViews}
|
|
555
588
|
value={HISTORY_TAB_VALUE}
|
|
556
589
|
className={"text-sm"}>
|
|
557
|
-
<HistoryIcon size={iconSize.
|
|
590
|
+
<HistoryIcon size={iconSize.smallest} />
|
|
558
591
|
</Tab>}
|
|
559
592
|
|
|
560
593
|
<Tab
|
|
561
594
|
disabled={!hasAdditionalViews}
|
|
562
595
|
value={MAIN_TAB_VALUE}
|
|
563
596
|
className={"text-sm min-w-[90px]"}>
|
|
564
|
-
|
|
597
|
+
<span className="flex items-center gap-1.5">
|
|
598
|
+
{getIcon(collection.icon, undefined, undefined, "smallest")}
|
|
599
|
+
{collection.singularName ?? collection.name}
|
|
600
|
+
</span>
|
|
565
601
|
</Tab>
|
|
566
602
|
|
|
567
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!,
|
|
@@ -254,20 +270,36 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
254
270
|
const hasAdditionalViews = customViewsCount > 0 || subcollectionsCount > 0 || includeJsonView || includeHistoryView;
|
|
255
271
|
|
|
256
272
|
const {
|
|
257
|
-
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 {
|
|
258
290
|
selectedEntityView,
|
|
259
291
|
selectedSecondaryForm
|
|
260
|
-
} = resolvedSelectedEntityView(customViews, customizationController,
|
|
292
|
+
} = resolvedSelectedEntityView(customViews, customizationController, activeTab, canEdit);
|
|
261
293
|
|
|
262
294
|
const actionsAtTheBottom = layout === "side_panel" || layout === "dialog" || selectedEntityView?.includeActions === "bottom";
|
|
263
295
|
|
|
264
|
-
const mainViewVisible =
|
|
296
|
+
const mainViewVisible = activeTab === MAIN_TAB_VALUE || Boolean(selectedSecondaryForm);
|
|
265
297
|
|
|
266
298
|
// Track which custom view tabs have been visited so we keep them mounted
|
|
267
299
|
// (preserving their state) but don't eagerly mount tabs never visited.
|
|
268
300
|
const mountedTabsRef = useRef<Set<string>>(new Set());
|
|
269
|
-
if (
|
|
270
|
-
mountedTabsRef.current.add(
|
|
301
|
+
if (activeTab) {
|
|
302
|
+
mountedTabsRef.current.add(activeTab);
|
|
271
303
|
}
|
|
272
304
|
|
|
273
305
|
// Memoize the read-only fallback form context to avoid recreating it every render
|
|
@@ -288,6 +320,9 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
288
320
|
save: () => {
|
|
289
321
|
throw new Error("You can't save in read only mode");
|
|
290
322
|
},
|
|
323
|
+
submit: () => {
|
|
324
|
+
throw new Error("You can't submit in read only mode");
|
|
325
|
+
},
|
|
291
326
|
collection,
|
|
292
327
|
path: path,
|
|
293
328
|
entity: usedEntity,
|
|
@@ -317,7 +352,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
317
352
|
}
|
|
318
353
|
|
|
319
354
|
// Only mount tabs that have been visited at least once
|
|
320
|
-
const isActive =
|
|
355
|
+
const isActive = activeTab === customView.key;
|
|
321
356
|
const hasBeenMounted = mountedTabsRef.current.has(customView.key);
|
|
322
357
|
if (!isActive && !hasBeenMounted) {
|
|
323
358
|
return null;
|
|
@@ -350,9 +385,9 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
350
385
|
|
|
351
386
|
// Only mount JSON view when its tab is selected (or was previously selected)
|
|
352
387
|
const jsonTabMounted = mountedTabsRef.current.has(JSON_TAB_VALUE);
|
|
353
|
-
const jsonView = (
|
|
388
|
+
const jsonView = (activeTab === JSON_TAB_VALUE || jsonTabMounted) ? <div
|
|
354
389
|
className={cls("relative flex-1 h-full overflow-auto w-full",
|
|
355
|
-
{ "hidden":
|
|
390
|
+
{ "hidden": activeTab !== JSON_TAB_VALUE })}
|
|
356
391
|
key={"json_view"}
|
|
357
392
|
role="tabpanel">
|
|
358
393
|
<ErrorBoundary>
|
|
@@ -362,7 +397,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
362
397
|
</div> : null;
|
|
363
398
|
|
|
364
399
|
// Only mount history view when its tab is actually selected
|
|
365
|
-
const historyView = includeHistoryView &&
|
|
400
|
+
const historyView = includeHistoryView && activeTab === HISTORY_TAB_VALUE ? <div
|
|
366
401
|
className={"relative flex-1 h-full overflow-auto w-full"}
|
|
367
402
|
key={"history_view"}
|
|
368
403
|
role="tabpanel">
|
|
@@ -382,7 +417,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
382
417
|
const subcollectionId = subcollection.slug;
|
|
383
418
|
const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection.slug)}` : undefined;
|
|
384
419
|
|
|
385
|
-
if (
|
|
420
|
+
if (activeTab !== subcollectionId) return null;
|
|
386
421
|
return (
|
|
387
422
|
<div
|
|
388
423
|
className={"relative flex-1 h-full overflow-auto w-full"}
|
|
@@ -393,7 +428,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
393
428
|
|
|
394
429
|
{!globalLoading &&
|
|
395
430
|
(usedEntity && newFullPath
|
|
396
|
-
? <
|
|
431
|
+
? <ResolvedCollectionView
|
|
397
432
|
path={newFullPath}
|
|
398
433
|
parentCollectionSlugs={[...parentCollectionSlugs, collection.slug]}
|
|
399
434
|
parentEntityIds={[...parentEntityIds, String(usedEntity?.id)]}
|
|
@@ -479,7 +514,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
479
514
|
</ErrorBoundary>
|
|
480
515
|
</div>
|
|
481
516
|
) : (
|
|
482
|
-
<
|
|
517
|
+
<ResolvedEntityForm<M>
|
|
483
518
|
collection={collection}
|
|
484
519
|
path={path}
|
|
485
520
|
entityId={entityId ?? usedEntity?.id}
|
|
@@ -490,7 +525,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
490
525
|
forceActionsAtTheBottom={actionsAtTheBottom}
|
|
491
526
|
initialStatus={status}
|
|
492
527
|
className={cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className)}
|
|
493
|
-
EntityFormActionsComponent={
|
|
528
|
+
EntityFormActionsComponent={ResolvedFormActions as React.FC<typeof ResolvedFormActions extends React.ComponentType<infer P> ? P : never>}
|
|
494
529
|
disabled={!canEdit}
|
|
495
530
|
navigateBack={navigateBack}
|
|
496
531
|
{...formProps}
|
|
@@ -509,7 +544,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
509
544
|
onSaved={(params) => {
|
|
510
545
|
const res = {
|
|
511
546
|
...params,
|
|
512
|
-
selectedTab: MAIN_TAB_VALUE ===
|
|
547
|
+
selectedTab: MAIN_TAB_VALUE === activeTab ? undefined : activeTab
|
|
513
548
|
};
|
|
514
549
|
onSaved?.(res);
|
|
515
550
|
formProps?.onSaved?.(res);
|
|
@@ -519,7 +554,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
519
554
|
);
|
|
520
555
|
|
|
521
556
|
const subcollectionTabs = subcollections && subcollections.map((subcollection) => {
|
|
522
|
-
const icon = getIcon(subcollection.icon, undefined, undefined, "
|
|
557
|
+
const icon = getIcon(subcollection.icon, undefined, undefined, "smallest");
|
|
523
558
|
return (
|
|
524
559
|
<Tab
|
|
525
560
|
className="text-sm min-w-[90px]"
|
|
@@ -535,7 +570,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
535
570
|
|
|
536
571
|
const customViewTabsStart = resolvedEntityViews.filter(view => view.position === "start")
|
|
537
572
|
.map((view) => {
|
|
538
|
-
const icon = getIcon(view.icon, undefined, undefined, "
|
|
573
|
+
const icon = getIcon(view.icon, undefined, undefined, "smallest");
|
|
539
574
|
return (
|
|
540
575
|
<Tab
|
|
541
576
|
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
@@ -552,7 +587,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
552
587
|
});
|
|
553
588
|
const customViewTabsEnd = resolvedEntityViews.filter(view => !view.position || view.position === "end")
|
|
554
589
|
.map((view) => {
|
|
555
|
-
const icon = getIcon(view.icon, undefined, undefined, "
|
|
590
|
+
const icon = getIcon(view.icon, undefined, undefined, "smallest");
|
|
556
591
|
return (
|
|
557
592
|
<Tab
|
|
558
593
|
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
@@ -606,7 +641,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
606
641
|
{hasAdditionalViews && <div className={"flex-1 flex justify-end min-w-0 shrink-0"}>
|
|
607
642
|
<Tabs
|
|
608
643
|
className={"!w-fit max-w-full"}
|
|
609
|
-
value={
|
|
644
|
+
value={activeTab}
|
|
610
645
|
onValueChange={(value) => {
|
|
611
646
|
onSideTabClick(value);
|
|
612
647
|
}}>
|
|
@@ -615,21 +650,24 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
615
650
|
disabled={!hasAdditionalViews}
|
|
616
651
|
value={JSON_TAB_VALUE}
|
|
617
652
|
className={"text-sm"}>
|
|
618
|
-
<CodeIcon size={iconSize.
|
|
653
|
+
<CodeIcon size={iconSize.smallest} />
|
|
619
654
|
</Tab>}
|
|
620
655
|
|
|
621
656
|
{includeHistoryView && <Tab
|
|
622
657
|
disabled={!hasAdditionalViews}
|
|
623
658
|
value={HISTORY_TAB_VALUE}
|
|
624
659
|
className={"text-sm"}>
|
|
625
|
-
<HistoryIcon size={iconSize.
|
|
660
|
+
<HistoryIcon size={iconSize.smallest} />
|
|
626
661
|
</Tab>}
|
|
627
662
|
|
|
628
663
|
<Tab
|
|
629
664
|
disabled={!hasAdditionalViews}
|
|
630
665
|
value={MAIN_TAB_VALUE}
|
|
631
666
|
className={"text-sm min-w-[90px]"}>
|
|
632
|
-
|
|
667
|
+
<span className="flex items-center gap-1.5">
|
|
668
|
+
{getIcon(collection.icon, undefined, undefined, "smallest")}
|
|
669
|
+
{collection.singularName ?? collection.name}
|
|
670
|
+
</span>
|
|
633
671
|
</Tab>
|
|
634
672
|
|
|
635
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,
|
|
@@ -112,7 +114,8 @@ export function EntitySidePanel(props: EntitySidePanelProps) {
|
|
|
112
114
|
|
|
113
115
|
const effectiveDefault = resolveDefaultSelectedView(
|
|
114
116
|
collection.defaultSelectedView,
|
|
115
|
-
{ status: "existing",
|
|
117
|
+
{ status: "existing",
|
|
118
|
+
entityId }
|
|
116
119
|
);
|
|
117
120
|
if (effectiveDefault && effectiveDefault !== "edit") {
|
|
118
121
|
hasCorrectedDefaultView.current = true;
|
|
@@ -144,7 +147,7 @@ export function EntitySidePanel(props: EntitySidePanelProps) {
|
|
|
144
147
|
<>
|
|
145
148
|
<ErrorBoundary>
|
|
146
149
|
{isDetailMode
|
|
147
|
-
? <
|
|
150
|
+
? <ResolvedDetailView
|
|
148
151
|
path={path}
|
|
149
152
|
layout={collection?.openEntityMode === "dialog" ? "dialog" : "side_panel"}
|
|
150
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrowRightIcon, Card, cls, Markdown, Typography } from "@rebasepro/ui";
|
|
1
|
+
import { ArrowRightIcon, Card, cls, iconSize, Markdown, Typography } from "@rebasepro/ui";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
export type NavigationCardProps = {
|
|
@@ -25,10 +25,8 @@ export const NavigationCard = React.memo(function NavigationCard({
|
|
|
25
25
|
return (
|
|
26
26
|
<Card
|
|
27
27
|
className={cls(
|
|
28
|
-
"group h-full p-4 cursor-pointer transition-
|
|
29
|
-
"
|
|
30
|
-
"hover:shadow-md hover:shadow-black/[0.04]",
|
|
31
|
-
"hover:border-surface-300 dark:hover:border-primary/20",
|
|
28
|
+
"group h-full p-4 cursor-pointer transition-colors duration-150 ease-in-out",
|
|
29
|
+
"hover:bg-primary/5 dark:hover:bg-primary/5",
|
|
32
30
|
shrink && "w-full max-w-full min-h-0 scale-75"
|
|
33
31
|
)}
|
|
34
32
|
onClick={() => {
|
|
@@ -39,8 +37,8 @@ export const NavigationCard = React.memo(function NavigationCard({
|
|
|
39
37
|
<div className="flex flex-col h-full">
|
|
40
38
|
{/* Header: title + icon left, actions right */}
|
|
41
39
|
<div className="flex items-center w-full justify-between mb-1">
|
|
42
|
-
<div className="flex items-center gap-
|
|
43
|
-
<div className="flex items-center justify-center w-
|
|
40
|
+
<div className="flex items-center gap-3">
|
|
41
|
+
<div className="flex items-center justify-center w-5 h-5 text-surface-400 dark:text-surface-500 transition-colors duration-150 group-hover:text-primary dark:group-hover:text-primary">
|
|
44
42
|
{icon}
|
|
45
43
|
</div>
|
|
46
44
|
<Typography variant="subtitle1"
|
|
@@ -60,7 +58,7 @@ export const NavigationCard = React.memo(function NavigationCard({
|
|
|
60
58
|
</div>
|
|
61
59
|
|
|
62
60
|
{/* Description */}
|
|
63
|
-
<div className="
|
|
61
|
+
<div className="pl-8">
|
|
64
62
|
{description && <Typography variant="caption"
|
|
65
63
|
color="secondary"
|
|
66
64
|
component="div">
|
|
@@ -69,17 +67,13 @@ export const NavigationCard = React.memo(function NavigationCard({
|
|
|
69
67
|
</div>
|
|
70
68
|
|
|
71
69
|
{additionalContent && (
|
|
72
|
-
<div className="pl-
|
|
70
|
+
<div className="pl-8 pointer-events-none">
|
|
73
71
|
{additionalContent}
|
|
74
72
|
</div>
|
|
75
73
|
)}
|
|
76
74
|
|
|
77
|
-
{/*
|
|
78
|
-
<div className="
|
|
79
|
-
<div className={"transition-transform duration-200 group-hover:translate-x-0.5"}>
|
|
80
|
-
<ArrowRightIcon className="text-primary"/>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
75
|
+
{/* Spacer pushes content above to align at the top across grid siblings */}
|
|
76
|
+
<div className="grow"/>
|
|
83
77
|
|
|
84
78
|
</div>
|
|
85
79
|
|
|
@@ -38,7 +38,7 @@ export function NavigationCardBinding({
|
|
|
38
38
|
}) {
|
|
39
39
|
|
|
40
40
|
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
41
|
-
const collectionIcon = <IconForView collectionOrView={collection ?? view}/>;
|
|
41
|
+
const collectionIcon = <IconForView collectionOrView={collection ?? view} size={"small"}/>;
|
|
42
42
|
|
|
43
43
|
const navigate = useNavigate();
|
|
44
44
|
const context = useRebaseContext();
|
|
@@ -40,7 +40,7 @@ export function NavigationGroup({
|
|
|
40
40
|
color="secondary"
|
|
41
41
|
className={cls(
|
|
42
42
|
"px-4 py-1 rounded",
|
|
43
|
-
"font-
|
|
43
|
+
"font-medium text-[10px] uppercase tracking-[0.08em] text-primary/50 dark:text-primary/70"
|
|
44
44
|
)}
|
|
45
45
|
>
|
|
46
46
|
{currentGroupName}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cardClickableMixin, cardMixin, cls, Typography } from "@rebasepro/ui";
|
|
2
2
|
|
|
3
3
|
import { Link } from "react-router-dom";
|
|
4
4
|
|
|
@@ -35,11 +35,7 @@ export function SmallNavigationCard({
|
|
|
35
35
|
</Typography>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
|
-
<div className={"p-2"}>
|
|
39
|
-
<ArrowRightIcon className="text-primary"/>
|
|
40
|
-
</div>
|
|
41
38
|
</Link>
|
|
42
39
|
|
|
43
40
|
</>);
|
|
44
41
|
}
|
|
45
|
-
|