@rebasepro/admin 0.8.0 → 0.9.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 +20 -20
- package/dist/{CollectionEditorDialog-BO_aQ-Z4.js → CollectionEditorDialog-B-7uW3iJ.js} +11 -11
- package/dist/CollectionEditorDialog-B-7uW3iJ.js.map +1 -0
- package/dist/{PropertyEditView-DKzOpMjR.js → PropertyEditView-7KMTcrqi.js} +78 -70
- package/dist/PropertyEditView-7KMTcrqi.js.map +1 -0
- package/dist/{RouterCollectionsStudioView-BQTIExjA.js → RouterCollectionsStudioView-epqIbZrJ.js} +4 -4
- package/dist/{RouterCollectionsStudioView-BQTIExjA.js.map → RouterCollectionsStudioView-epqIbZrJ.js.map} +1 -1
- package/dist/collection_editor/_cms_internals.d.ts +3 -3
- package/dist/collection_editor/api/generateCollectionApi.d.ts +4 -4
- package/dist/collection_editor/extensibility_types.d.ts +3 -3
- package/dist/collection_editor/index.d.ts +2 -2
- package/dist/collection_editor/pgColumnToProperty.d.ts +3 -3
- package/dist/collection_editor/serializable_types.d.ts +7 -7
- package/dist/collection_editor/serializable_utils.d.ts +8 -8
- package/dist/collection_editor/types/collection_editor_controller.d.ts +5 -5
- package/dist/collection_editor/types/collection_inference.d.ts +2 -2
- package/dist/collection_editor/types/config_controller.d.ts +7 -7
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -2
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -2
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -2
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +3 -3
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +4 -4
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +4 -4
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -4
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +3 -3
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -2
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +2 -2
- package/dist/collection_editor/validateCollectionJson.d.ts +2 -2
- package/dist/collection_editor_ui.js +4 -4
- package/dist/components/CollectionPanel.d.ts +4 -4
- package/dist/components/{EntityCollectionTable/EntityCollectionRowActions.d.ts → CollectionTableBinding/CollectionRowActions.d.ts} +3 -3
- package/dist/components/CollectionTableBinding/CollectionTableBinding.d.ts +28 -0
- package/dist/components/{EntityCollectionTable/EntityCollectionTableProps.d.ts → CollectionTableBinding/CollectionTableBindingProps.d.ts} +1 -1
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.d.ts +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.d.ts +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.d.ts +2 -2
- package/dist/components/CollectionTableBinding/index.d.ts +6 -0
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.d.ts +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.d.ts +2 -2
- package/dist/components/{EntityCollectionView/EntityBoardCard.d.ts → CollectionViewBinding/BoardCardBinding.d.ts} +8 -8
- package/dist/components/{EntityCollectionView/EntityCollectionBoardView.d.ts → CollectionViewBinding/CollectionBoardViewBinding.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionCardView.d.ts → CollectionViewBinding/CollectionCardViewBinding.d.ts} +5 -5
- package/dist/components/{EntityCollectionView/EntityCollectionListView.d.ts → CollectionViewBinding/CollectionListViewBinding.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionViewActions.d.ts → CollectionViewBinding/CollectionViewActions.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionView.d.ts → CollectionViewBinding/CollectionViewBinding.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionViewStartActions.d.ts → CollectionViewBinding/CollectionViewStartActions.d.ts} +4 -4
- package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +21 -0
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.d.ts +3 -3
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.d.ts +2 -2
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.d.ts +2 -2
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.d.ts +2 -2
- package/dist/components/{EntityCollectionView/useEntityPreviewSlots.d.ts → CollectionViewBinding/usePreviewSlots.d.ts} +5 -5
- package/dist/components/DeleteEntityDialog.d.ts +4 -4
- package/dist/components/{EntityDetailView.d.ts → DetailViewBinding.d.ts} +5 -5
- package/dist/components/EditFormActions.d.ts +3 -0
- package/dist/components/{EntityEditView.d.ts → EditViewBinding.d.ts} +9 -9
- package/dist/components/{EntityPreview.d.ts → EntityPreviewBinding.d.ts} +13 -13
- package/dist/components/EntityViewBinding.d.ts +13 -0
- package/dist/components/{EntityJsonPreview.d.ts → JsonPreviewBinding.d.ts} +1 -1
- package/dist/components/RebaseCMS.d.ts +1 -1
- package/dist/components/RebaseNavigation.d.ts +1 -1
- package/dist/components/ReferenceTable/{EntitySelectionTable.d.ts → SelectionTableBinding.d.ts} +5 -5
- package/dist/components/SelectableTable/SelectableTable.d.ts +5 -5
- package/dist/components/SelectableTable/SelectableTableContext.d.ts +3 -3
- package/dist/components/SelectableTable/SelectionStore.d.ts +2 -2
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +6 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +7 -1
- package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +40 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +7 -1
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +7 -1
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +7 -1
- package/dist/components/SideDialogs.d.ts +1 -1
- package/dist/components/SidePanelBinding.d.ts +11 -0
- package/dist/components/{SideEntityProvider.d.ts → SidePanelProvider.d.ts} +7 -7
- package/dist/components/history/EntityHistoryEntry.d.ts +2 -2
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -2
- package/dist/components/index.d.ts +14 -13
- package/dist/contexts/SidePanelControllerContext.d.ts +3 -0
- package/dist/data_export/export/ExportCollectionAction.d.ts +3 -3
- package/dist/data_import/components/ImportSaveInProgress.d.ts +2 -2
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/form_utils.d.ts +2 -2
- package/dist/{history-B3cqBzEV.js → history-7X5bON_n.js} +4 -4
- package/dist/history-7X5bON_n.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +2 -2
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +5 -5
- package/dist/hooks/navigation/useNavigationResolution.d.ts +4 -4
- package/dist/hooks/navigation/useResolvedCollections.d.ts +7 -7
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +2 -2
- package/dist/hooks/navigation/utils.d.ts +5 -5
- package/dist/hooks/useBuildSidePanel.d.ts +6 -0
- package/dist/hooks/useCMSContext.d.ts +2 -2
- package/dist/hooks/{useEntityHistory.d.ts → useHistory.d.ts} +1 -1
- package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
- package/dist/hooks/{useEntitySelectionDialog.d.ts → useSelectionDialog.d.ts} +2 -2
- package/dist/hooks/useSideDialogsController.d.ts +1 -1
- package/dist/hooks/useSidePanel.d.ts +11 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{src-cxV1ODRG.js → src-sUZfe29F.js} +737 -647
- package/dist/src-sUZfe29F.js.map +1 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +2 -2
- package/dist/types/components/EntityFormProps.d.ts +3 -3
- package/dist/types/fields.d.ts +2 -2
- package/dist/util/dataControllerAdapter.d.ts +2 -5
- package/dist/util/navigation_utils.d.ts +6 -6
- package/dist/util/previews.d.ts +3 -3
- package/dist/util/property_utils.d.ts +2 -2
- package/dist/util/{entity_view_constants.d.ts → view_constants.d.ts} +1 -1
- package/package.json +8 -8
- package/src/collection_editor/ConfigControllerProvider.tsx +10 -10
- package/src/collection_editor/_cms_internals.ts +3 -3
- package/src/collection_editor/api/generateCollectionApi.ts +4 -4
- package/src/collection_editor/extensibility_types.ts +3 -3
- package/src/collection_editor/index.ts +3 -3
- package/src/collection_editor/pgColumnToProperty.ts +3 -3
- package/src/collection_editor/serializable_types.ts +8 -8
- package/src/collection_editor/serializable_utils.ts +17 -17
- package/src/collection_editor/types/collection_editor_controller.tsx +5 -5
- package/src/collection_editor/types/collection_inference.ts +2 -2
- package/src/collection_editor/types/config_controller.tsx +7 -7
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -2
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -2
- package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -2
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -2
- package/src/collection_editor/ui/EditorEntityAction.tsx +2 -2
- package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -2
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +26 -26
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +7 -7
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +45 -36
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +2 -2
- package/src/collection_editor/useJsonCollectionsConfigController.tsx +13 -13
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +4 -4
- package/src/collection_editor/validateCollectionJson.ts +3 -3
- package/src/components/CollectionPanel.tsx +14 -17
- package/src/components/{EntityCollectionTable/EntityCollectionRowActions.tsx → CollectionTableBinding/CollectionRowActions.tsx} +6 -6
- package/src/components/{EntityCollectionTable/EntityCollectionTable.tsx → CollectionTableBinding/CollectionTableBinding.tsx} +10 -10
- package/src/components/{EntityCollectionTable/EntityCollectionTableProps.tsx → CollectionTableBinding/CollectionTableBindingProps.tsx} +1 -1
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.tsx +5 -5
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.tsx +10 -10
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.tsx +5 -5
- package/src/components/CollectionTableBinding/index.tsx +14 -0
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.tsx +2 -2
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.tsx +2 -2
- package/src/components/{EntityCollectionView/EntityBoardCard.tsx → CollectionViewBinding/BoardCardBinding.tsx} +15 -15
- package/src/components/{EntityCollectionView/EntityCollectionBoardView.tsx → CollectionViewBinding/CollectionBoardViewBinding.tsx} +14 -13
- package/src/components/{EntityCollectionView/EntityCollectionCardView.tsx → CollectionViewBinding/CollectionCardViewBinding.tsx} +8 -8
- package/src/components/{EntityCollectionView/EntityCollectionListView.tsx → CollectionViewBinding/CollectionListViewBinding.tsx} +12 -12
- package/src/components/{EntityCollectionView/EntityCollectionViewActions.tsx → CollectionViewBinding/CollectionViewActions.tsx} +5 -5
- package/src/components/{EntityCollectionView/EntityCollectionView.tsx → CollectionViewBinding/CollectionViewBinding.tsx} +106 -91
- package/src/components/{EntityCollectionView/EntityCollectionViewStartActions.tsx → CollectionViewBinding/CollectionViewStartActions.tsx} +5 -5
- package/src/components/{EntityCollectionView/EntityCard.tsx → CollectionViewBinding/EntityCardBinding.tsx} +9 -9
- package/src/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.tsx +31 -72
- package/src/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.tsx +9 -9
- package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.ts +5 -5
- package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.ts +4 -4
- package/src/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.tsx +16 -10
- package/src/components/{EntityCollectionView/useEntityPreviewSlots.ts → CollectionViewBinding/usePreviewSlots.ts} +8 -8
- package/src/components/DeleteEntityDialog.tsx +6 -6
- package/src/components/{EntityDetailView.tsx → DetailViewBinding.tsx} +26 -29
- package/src/components/{EntityEditViewFormActions.tsx → EditFormActions.tsx} +12 -12
- package/src/components/{EntityEditView.tsx → EditViewBinding.tsx} +29 -32
- package/src/components/{EntityPreview.tsx → EntityPreviewBinding.tsx} +27 -27
- package/src/components/{EntityView.tsx → EntityViewBinding.tsx} +5 -5
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/{EntityJsonPreview.tsx → JsonPreviewBinding.tsx} +1 -1
- package/src/components/RebaseCMS.tsx +4 -3
- package/src/components/RebaseNavigation.tsx +17 -8
- package/src/components/ReferenceTable/{EntitySelectionTable.tsx → SelectionTableBinding.tsx} +22 -19
- package/src/components/ReferenceWidget.tsx +4 -4
- package/src/components/RelationSelector.tsx +14 -12
- package/src/components/SelectableTable/SelectableTable.tsx +34 -87
- package/src/components/SelectableTable/SelectableTableContext.tsx +3 -3
- package/src/components/SelectableTable/SelectionStore.ts +4 -4
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +9 -1
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +33 -12
- package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +187 -0
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +21 -7
- package/src/components/SelectableTable/filters/RelationFilterField.tsx +17 -3
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +66 -12
- package/src/components/SideDialogs.tsx +3 -3
- package/src/components/{EntitySidePanel.tsx → SidePanelBinding.tsx} +19 -19
- package/src/components/{SideEntityProvider.tsx → SidePanelProvider.tsx} +16 -16
- package/src/components/common/default_entity_actions.tsx +9 -9
- package/src/components/history/EntityHistoryEntry.tsx +2 -2
- package/src/components/history/EntityHistoryView.tsx +3 -3
- package/src/components/history/LastEditedByIndicator.tsx +2 -2
- package/src/components/index.ts +15 -14
- package/src/contexts/SidePanelControllerContext.tsx +5 -0
- package/src/data_export/export/ExportCollectionAction.tsx +4 -4
- package/src/data_import/components/ImportSaveInProgress.tsx +3 -3
- package/src/data_import/import/ImportCollectionAction.tsx +4 -4
- package/src/data_import/utils/data.ts +2 -2
- package/src/form/EntityForm.tsx +2 -2
- package/src/form/EntityFormActions.tsx +3 -3
- package/src/form/EntityFormBinding.tsx +6 -6
- package/src/form/PropertyFieldBinding.tsx +4 -4
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +4 -4
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +19 -19
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +5 -5
- package/src/form/field_bindings/RelationFieldBinding.tsx +3 -3
- package/src/form/form_utils.ts +2 -2
- package/src/hooks/index.ts +4 -4
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +2 -2
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +11 -11
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +5 -5
- package/src/hooks/navigation/useNavigationResolution.ts +10 -10
- package/src/hooks/navigation/useResolvedCollections.ts +8 -8
- package/src/hooks/navigation/useTopLevelNavigation.ts +2 -2
- package/src/hooks/navigation/utils.ts +5 -5
- package/src/hooks/{useBuildSideEntityController.tsx → useBuildSidePanel.tsx} +28 -28
- package/src/hooks/useCMSContext.tsx +6 -6
- package/src/hooks/{useEntityHistory.ts → useHistory.ts} +1 -1
- package/src/hooks/useResolvedNavigationFrom.tsx +8 -5
- package/src/hooks/{useEntitySelectionDialog.tsx → useSelectionDialog.tsx} +7 -7
- package/src/hooks/useSideDialogsController.tsx +1 -1
- package/src/hooks/useSidePanel.tsx +13 -0
- package/src/index.ts +12 -12
- package/src/preview/components/ReferencePreview.tsx +10 -10
- package/src/preview/components/RelationPreview.tsx +13 -12
- package/src/routes/RebaseRoute.tsx +10 -10
- package/src/types/components/EntityFormActionsProps.tsx +2 -2
- package/src/types/components/EntityFormProps.tsx +3 -3
- package/src/types/fields.tsx +2 -2
- package/src/util/dataControllerAdapter.ts +9 -15
- package/src/util/navigation_utils.ts +7 -7
- package/src/util/previews.ts +3 -3
- package/src/util/property_utils.tsx +2 -2
- package/src/util/{entity_view_constants.ts → view_constants.ts} +1 -1
- package/dist/CollectionEditorDialog-BO_aQ-Z4.js.map +0 -1
- package/dist/PropertyEditView-DKzOpMjR.js.map +0 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +0 -28
- package/dist/components/EntityCollectionTable/index.d.ts +0 -6
- package/dist/components/EntityCollectionView/EntityCard.d.ts +0 -21
- package/dist/components/EntityEditViewFormActions.d.ts +0 -3
- package/dist/components/EntitySidePanel.d.ts +0 -11
- package/dist/components/EntityView.d.ts +0 -13
- package/dist/contexts/SideEntityControllerContext.d.ts +0 -3
- package/dist/history-B3cqBzEV.js.map +0 -1
- package/dist/hooks/useBuildSideEntityController.d.ts +0 -6
- package/dist/hooks/useSideEntityController.d.ts +0 -11
- package/dist/src-cxV1ODRG.js.map +0 -1
- package/src/components/EntityCollectionTable/index.tsx +0 -14
- package/src/contexts/SideEntityControllerContext.tsx +0 -5
- package/src/hooks/useSideEntityController.tsx +0 -13
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/utils.d.ts +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/utils.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import type {
|
|
2
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
3
3
|
import type { FormContext } from "../types/fields";
|
|
4
|
-
import type { EntityAction, EntityActionClickProps,
|
|
4
|
+
import type { EntityAction, EntityActionClickProps, SidePanelController } from "@rebasepro/types";
|
|
5
5
|
import React, { useMemo } from "react";
|
|
6
6
|
import { Entity, getCollectionDataPath, RebaseContext } from "@rebasepro/types";
|
|
7
7
|
import type { EntityFormActionsProps } from "../types/components/EntityFormActionsProps";
|
|
@@ -21,7 +21,7 @@ import { ErrorTooltip } from "@rebasepro/core";
|
|
|
21
21
|
import { usePermissions } from "@rebasepro/core";
|
|
22
22
|
import { useCMSContext } from "../index";
|
|
23
23
|
|
|
24
|
-
export function
|
|
24
|
+
export function EditFormActions({
|
|
25
25
|
collection,
|
|
26
26
|
path,
|
|
27
27
|
entity,
|
|
@@ -39,7 +39,7 @@ export function EntityEditViewFormActions({
|
|
|
39
39
|
|
|
40
40
|
const { canCreate, canDelete } = usePermissions();
|
|
41
41
|
const context = useCMSContext();
|
|
42
|
-
const
|
|
42
|
+
const sidePanelController = context.sidePanelController;
|
|
43
43
|
const sideDialogContext = useSideDialogContext();
|
|
44
44
|
const customizationController = useCustomizationController();
|
|
45
45
|
const { t } = useTranslation();
|
|
@@ -70,7 +70,7 @@ export function EntityEditViewFormActions({
|
|
|
70
70
|
formActions,
|
|
71
71
|
collection,
|
|
72
72
|
context,
|
|
73
|
-
|
|
73
|
+
sidePanelController,
|
|
74
74
|
disabled,
|
|
75
75
|
status,
|
|
76
76
|
sideDialogContext,
|
|
@@ -89,7 +89,7 @@ export function EntityEditViewFormActions({
|
|
|
89
89
|
formActions,
|
|
90
90
|
collection,
|
|
91
91
|
context,
|
|
92
|
-
|
|
92
|
+
sidePanelController,
|
|
93
93
|
sideDialogContext,
|
|
94
94
|
disabled,
|
|
95
95
|
status,
|
|
@@ -116,9 +116,9 @@ type ActionsViewProps<M extends Record<string, unknown>> = {
|
|
|
116
116
|
savingError: Error | undefined,
|
|
117
117
|
entity: Entity<M> | undefined,
|
|
118
118
|
formActions: EntityAction[],
|
|
119
|
-
collection:
|
|
119
|
+
collection: CollectionConfig,
|
|
120
120
|
context: RebaseContext,
|
|
121
|
-
|
|
121
|
+
sidePanelController: SidePanelController,
|
|
122
122
|
disabled: boolean,
|
|
123
123
|
status: "new" | "existing" | "copy",
|
|
124
124
|
sideDialogContext: SideDialogController,
|
|
@@ -137,7 +137,7 @@ function buildBottomActions<M extends Record<string, unknown>>({
|
|
|
137
137
|
formActions,
|
|
138
138
|
collection,
|
|
139
139
|
context,
|
|
140
|
-
|
|
140
|
+
sidePanelController,
|
|
141
141
|
disabled,
|
|
142
142
|
status,
|
|
143
143
|
sideDialogContext,
|
|
@@ -171,7 +171,7 @@ function buildBottomActions<M extends Record<string, unknown>>({
|
|
|
171
171
|
path: getCollectionDataPath(collection),
|
|
172
172
|
collection: collection,
|
|
173
173
|
context,
|
|
174
|
-
|
|
174
|
+
sidePanelController,
|
|
175
175
|
openEntityMode,
|
|
176
176
|
navigateBack,
|
|
177
177
|
formContext
|
|
@@ -243,7 +243,7 @@ function buildSideActions<M extends Record<string, unknown>>({
|
|
|
243
243
|
formActions,
|
|
244
244
|
collection,
|
|
245
245
|
context,
|
|
246
|
-
|
|
246
|
+
sidePanelController,
|
|
247
247
|
disabled,
|
|
248
248
|
status,
|
|
249
249
|
sideDialogContext,
|
|
@@ -295,7 +295,7 @@ function buildSideActions<M extends Record<string, unknown>>({
|
|
|
295
295
|
path: getCollectionDataPath(collection),
|
|
296
296
|
collection: collection,
|
|
297
297
|
context,
|
|
298
|
-
|
|
298
|
+
sidePanelController,
|
|
299
299
|
openEntityMode,
|
|
300
300
|
navigateBack,
|
|
301
301
|
formContext
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ComponentRef,
|
|
1
|
+
import type { ComponentRef, CollectionConfig, EntityCustomViewParams, FormViewConfig } from "@rebasepro/types";
|
|
2
2
|
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, getCollectionDataPath } from "@rebasepro/types";
|
|
6
|
-
import { PluginProviderStack, resolveComponentRef, useComponentOverride,
|
|
6
|
+
import { PluginProviderStack, resolveComponentRef, useComponentOverride, CollectionScopeProvider } from "@rebasepro/core";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { CollectionViewBinding, EntityViewBinding } from "../components";
|
|
9
9
|
import { CircularProgressCenter, iconSize } from "@rebasepro/ui";
|
|
10
10
|
import {
|
|
11
11
|
CenteredView,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import { resolvedSelectedEntityView } from "../util/resolutions";
|
|
33
33
|
import {
|
|
34
34
|
useCustomizationController,
|
|
35
|
-
|
|
35
|
+
useFetch,
|
|
36
36
|
useRebaseContext,
|
|
37
37
|
useLargeLayout,
|
|
38
38
|
useSlot,
|
|
@@ -42,8 +42,8 @@ import { getEntityFromMemoryCache } from "@rebasepro/core";
|
|
|
42
42
|
import { EntityFormBinding } from "../form";
|
|
43
43
|
import type { EntityFormBindingProps } from "../form";
|
|
44
44
|
import type { OnUpdateParams } from "../types/components/EntityFormProps";
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
45
|
+
import { EditFormActions } from "./EditFormActions";
|
|
46
|
+
import { JsonPreviewBinding } from "../components/JsonPreviewBinding";
|
|
47
47
|
// Lazy-load history view — only loaded when user clicks the HistoryIcon tab
|
|
48
48
|
const EntityHistoryView = lazy(() => import("../components/history").then(m => ({ default: m.EntityHistoryView })));
|
|
49
49
|
import { createFormexStub, getEntityFromCache } from "@rebasepro/core";
|
|
@@ -51,7 +51,7 @@ import { usePermissions } from "@rebasepro/core";
|
|
|
51
51
|
import { useUrlController } from "../index";
|
|
52
52
|
import { useNavigate } from "react-router-dom";
|
|
53
53
|
|
|
54
|
-
import { MAIN_TAB_VALUE, JSON_TAB_VALUE, HISTORY_TAB_VALUE } from "../util/
|
|
54
|
+
import { MAIN_TAB_VALUE, JSON_TAB_VALUE, HISTORY_TAB_VALUE } from "../util/view_constants";
|
|
55
55
|
export { MAIN_TAB_VALUE, JSON_TAB_VALUE, HISTORY_TAB_VALUE };
|
|
56
56
|
|
|
57
57
|
export type BarActionsParams = {
|
|
@@ -65,16 +65,16 @@ export type OnTabChangeParams<M extends Record<string, unknown>> = {
|
|
|
65
65
|
path: string;
|
|
66
66
|
entityId?: string | number;
|
|
67
67
|
selectedTab?: string;
|
|
68
|
-
collection:
|
|
68
|
+
collection: CollectionConfig<M>;
|
|
69
69
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
export interface
|
|
72
|
+
export interface EditViewBindingProps<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
73
73
|
/**
|
|
74
74
|
* The CMS path of the entity, e.g. "users" or "products".
|
|
75
75
|
*/
|
|
76
76
|
path: string;
|
|
77
|
-
collection:
|
|
77
|
+
collection: CollectionConfig<M>;
|
|
78
78
|
entityId?: string | number;
|
|
79
79
|
databaseId?: string;
|
|
80
80
|
copy?: boolean;
|
|
@@ -90,26 +90,26 @@ export interface EntityEditViewProps<M extends Record<string, unknown> = Record<
|
|
|
90
90
|
/**
|
|
91
91
|
* Pre-populate the form with these values when creating a new entity.
|
|
92
92
|
* Only applied when the form is in "new" mode (no entityId).
|
|
93
|
-
* Sourced from
|
|
93
|
+
* Sourced from SidePanelBindingProps (side panel) or location.state (full screen).
|
|
94
94
|
*/
|
|
95
95
|
defaultValues?: Partial<M>;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* This is the default view that is used as the content of a side panel when
|
|
100
|
-
*
|
|
100
|
+
* a record is opened.
|
|
101
101
|
*/
|
|
102
|
-
export function
|
|
102
|
+
export function EditViewBinding<M extends Record<string, unknown>>({
|
|
103
103
|
entityId,
|
|
104
104
|
...props
|
|
105
|
-
}:
|
|
105
|
+
}: EditViewBindingProps<M>) {
|
|
106
106
|
|
|
107
107
|
const {
|
|
108
108
|
entity,
|
|
109
109
|
dataLoading,
|
|
110
110
|
|
|
111
111
|
dataLoadingError
|
|
112
|
-
} =
|
|
112
|
+
} = useFetch<M>({
|
|
113
113
|
path: props.path,
|
|
114
114
|
entityId: entityId,
|
|
115
115
|
collection: props.collection,
|
|
@@ -148,7 +148,7 @@ export function EntityEditView<M extends Record<string, unknown>>({
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
const content = (
|
|
151
|
-
<
|
|
151
|
+
<EditViewBindingInner<M> {...props}
|
|
152
152
|
entityId={entityId}
|
|
153
153
|
entity={entity}
|
|
154
154
|
initialDirtyValues={initialDirtyValues as Partial<M>}
|
|
@@ -159,17 +159,14 @@ export function EntityEditView<M extends Record<string, unknown>>({
|
|
|
159
159
|
/>
|
|
160
160
|
);
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
return content;
|
|
162
|
+
return (
|
|
163
|
+
<CollectionScopeProvider collection={props.collection}>
|
|
164
|
+
{content}
|
|
165
|
+
</CollectionScopeProvider>
|
|
166
|
+
);
|
|
170
167
|
}
|
|
171
168
|
|
|
172
|
-
export function
|
|
169
|
+
export function EditViewBindingInner<M extends Record<string, unknown>>({
|
|
173
170
|
path,
|
|
174
171
|
entityId,
|
|
175
172
|
selectedTab: selectedTabProp,
|
|
@@ -188,7 +185,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
188
185
|
setStatus,
|
|
189
186
|
formProps,
|
|
190
187
|
canEdit
|
|
191
|
-
}:
|
|
188
|
+
}: EditViewBindingProps<M> & {
|
|
192
189
|
entity?: Entity<M>,
|
|
193
190
|
initialDirtyValues?: Partial<M>, // dirty cached entity in memory
|
|
194
191
|
dataLoading: boolean,
|
|
@@ -197,9 +194,9 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
197
194
|
canEdit?: boolean,
|
|
198
195
|
}) {
|
|
199
196
|
|
|
200
|
-
const ResolvedFormActions = useComponentOverride("
|
|
197
|
+
const ResolvedFormActions = useComponentOverride("EditView.FormActions", EditFormActions);
|
|
201
198
|
const ResolvedEntityForm = useComponentOverride("Entity.Form", EntityFormBinding) as typeof EntityFormBinding;
|
|
202
|
-
const ResolvedCollectionView = useComponentOverride("Collection.View",
|
|
199
|
+
const ResolvedCollectionView = useComponentOverride("Collection.View", CollectionViewBinding);
|
|
203
200
|
|
|
204
201
|
const context = useRebaseContext();
|
|
205
202
|
const urlController = useUrlController();
|
|
@@ -392,7 +389,7 @@ parentEntityIds,
|
|
|
392
389
|
key={"json_view"}
|
|
393
390
|
role="tabpanel">
|
|
394
391
|
<ErrorBoundary>
|
|
395
|
-
<
|
|
392
|
+
<JsonPreviewBinding
|
|
396
393
|
values={formContext?.values ?? entity?.values ?? {}} />
|
|
397
394
|
</ErrorBoundary>
|
|
398
395
|
</div> : null;
|
|
@@ -462,7 +459,7 @@ parentEntityIds,
|
|
|
462
459
|
}, [status, onTabChange, path, entityId, collection]);
|
|
463
460
|
|
|
464
461
|
// Resolve formView.Builder if provided
|
|
465
|
-
const formViewConfig = (collection as
|
|
462
|
+
const formViewConfig = (collection as CollectionConfig<M> & { formView?: FormViewConfig<M> }).formView;
|
|
466
463
|
const FormViewBuilder = formViewConfig?.Builder ? resolveComponentRef<EntityCustomViewParams>(formViewConfig.Builder as ComponentRef<EntityCustomViewParams>) : null;
|
|
467
464
|
const formViewIncludeActions = formViewConfig?.includeActions !== false;
|
|
468
465
|
|
|
@@ -486,7 +483,7 @@ parentEntityIds,
|
|
|
486
483
|
</Suspense>
|
|
487
484
|
</ErrorBoundary>
|
|
488
485
|
) : (
|
|
489
|
-
<
|
|
486
|
+
<EntityViewBinding
|
|
490
487
|
className={"px-8 h-full overflow-auto"}
|
|
491
488
|
entity={entity}
|
|
492
489
|
path={path}
|
|
@@ -718,7 +715,7 @@ parentEntityIds,
|
|
|
718
715
|
return result;
|
|
719
716
|
}
|
|
720
717
|
|
|
721
|
-
function EntityFormSkeleton({ collection }: { collection:
|
|
718
|
+
function EntityFormSkeleton({ collection }: { collection: CollectionConfig }) {
|
|
722
719
|
return (
|
|
723
720
|
<div className="flex-1 flex flex-row w-full overflow-y-auto justify-center">
|
|
724
721
|
<div className="relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
2
2
|
import type { Property } from "@rebasepro/types";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { useEffect, useMemo } from "react";
|
|
@@ -27,12 +27,12 @@ import { IconForView } from "@rebasepro/core";
|
|
|
27
27
|
import { getPropertyInPath } from "../util/property_utils";
|
|
28
28
|
import { getEntityPreviewKeys, getEntityTitlePropertyKey } from "../util/previews";
|
|
29
29
|
import { getValueInPath } from "@rebasepro/utils";
|
|
30
|
-
import { useCollectionRegistryController,
|
|
30
|
+
import { useCollectionRegistryController, useSidePanel } from "../index";
|
|
31
31
|
|
|
32
|
-
export type
|
|
32
|
+
export type EntityPreviewBindingProps = {
|
|
33
33
|
size?: PreviewSize,
|
|
34
34
|
actions?: React.ReactNode,
|
|
35
|
-
collection?:
|
|
35
|
+
collection?: CollectionConfig,
|
|
36
36
|
hover?: boolean;
|
|
37
37
|
previewKeys?: string[],
|
|
38
38
|
disabled?: boolean,
|
|
@@ -42,16 +42,16 @@ export type EntityPreviewProps = {
|
|
|
42
42
|
includeEntityLink?: boolean,
|
|
43
43
|
includeImage?: boolean,
|
|
44
44
|
onClick?: (e: React.SyntheticEvent) => void;
|
|
45
|
-
|
|
45
|
+
onSidePanelClick?: (entity: Entity) => void,
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
export type
|
|
48
|
+
export type EntityPreviewBindingDataProps = {
|
|
49
49
|
size?: "smallest" | "small" | "medium" | "large",
|
|
50
50
|
actions?: React.ReactNode,
|
|
51
|
-
collection?:
|
|
51
|
+
collection?: CollectionConfig,
|
|
52
52
|
previewKeys?: string[],
|
|
53
53
|
entity: Entity<any>,
|
|
54
|
-
|
|
54
|
+
onSidePanelClick?: (entity: Entity) => void,
|
|
55
55
|
includeId?: boolean,
|
|
56
56
|
includeTitle?: boolean,
|
|
57
57
|
includeEntityLink?: boolean,
|
|
@@ -59,25 +59,25 @@ export type EntityPreviewDataProps = {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* This component contains the main logic and content for displaying
|
|
63
|
-
* without any container wrapper. Used internally by
|
|
62
|
+
* This component contains the main logic and content for displaying a entity preview,
|
|
63
|
+
* without any container wrapper. Used internally by EntityPreviewBinding.
|
|
64
64
|
*/
|
|
65
|
-
export function
|
|
65
|
+
export function EntityPreviewBindingData({
|
|
66
66
|
actions,
|
|
67
67
|
collection: collectionProp,
|
|
68
68
|
previewKeys,
|
|
69
69
|
size = "medium",
|
|
70
70
|
includeId = true,
|
|
71
|
-
|
|
71
|
+
onSidePanelClick,
|
|
72
72
|
includeTitle = true,
|
|
73
73
|
includeEntityLink = true,
|
|
74
74
|
includeImage = true,
|
|
75
75
|
entity
|
|
76
|
-
}:
|
|
76
|
+
}: EntityPreviewBindingDataProps) {
|
|
77
77
|
|
|
78
78
|
const authController = useAuthController();
|
|
79
79
|
const analyticsController = useAnalyticsController();
|
|
80
|
-
const
|
|
80
|
+
const sidePanelController = useSidePanel();
|
|
81
81
|
const customizationController = useCustomizationController();
|
|
82
82
|
|
|
83
83
|
const collectionRegistryController = useCollectionRegistryController();
|
|
@@ -194,12 +194,12 @@ export function EntityPreviewData({
|
|
|
194
194
|
onClick={(e) => {
|
|
195
195
|
e.stopPropagation();
|
|
196
196
|
e.preventDefault();
|
|
197
|
-
|
|
197
|
+
onSidePanelClick?.(entity);
|
|
198
198
|
analyticsController.onAnalyticsEvent?.("entity_click_from_reference", {
|
|
199
199
|
path: entity.path,
|
|
200
200
|
entityId: entity.id
|
|
201
201
|
});
|
|
202
|
-
|
|
202
|
+
sidePanelController.open({
|
|
203
203
|
entityId: entity.id,
|
|
204
204
|
path: entity.path,
|
|
205
205
|
collection,
|
|
@@ -216,11 +216,11 @@ export function EntityPreviewData({
|
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
export function
|
|
219
|
+
export function EntityPreviewBindingWithId({
|
|
220
220
|
entityId,
|
|
221
221
|
path,
|
|
222
222
|
...props
|
|
223
|
-
}: Omit<
|
|
223
|
+
}: Omit<EntityPreviewBindingProps, "entity"> & {
|
|
224
224
|
entityId: string | number;
|
|
225
225
|
path: string;
|
|
226
226
|
databaseId?: string;
|
|
@@ -236,7 +236,7 @@ export function EntityPreviewWithId({
|
|
|
236
236
|
setEntity(undefined);
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
|
-
const
|
|
239
|
+
const fetchOne = async () => {
|
|
240
240
|
setDataLoading(true);
|
|
241
241
|
try {
|
|
242
242
|
const fetchedEntity = await dataClient.collection(path).findById(entityId);
|
|
@@ -255,7 +255,7 @@ export function EntityPreviewWithId({
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
|
|
258
|
+
fetchOne();
|
|
259
259
|
|
|
260
260
|
return () => {
|
|
261
261
|
isMounted = false;
|
|
@@ -284,16 +284,16 @@ export function EntityPreviewWithId({
|
|
|
284
284
|
);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
return <
|
|
287
|
+
return <EntityPreviewBindingData
|
|
288
288
|
{...props}
|
|
289
289
|
entity={entity}/>;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
|
-
* This view is used to display a preview of
|
|
293
|
+
* This view is used to display a preview of a entity.
|
|
294
294
|
* It is used by default in reference fields and whenever a reference is displayed.
|
|
295
295
|
*/
|
|
296
|
-
export function
|
|
296
|
+
export function EntityPreviewBinding({
|
|
297
297
|
actions,
|
|
298
298
|
disabled,
|
|
299
299
|
hover,
|
|
@@ -305,16 +305,16 @@ export function EntityPreview({
|
|
|
305
305
|
includeTitle = true,
|
|
306
306
|
includeEntityLink = true,
|
|
307
307
|
includeImage = true,
|
|
308
|
-
|
|
308
|
+
onSidePanelClick,
|
|
309
309
|
entity
|
|
310
|
-
}:
|
|
310
|
+
}: EntityPreviewBindingProps) {
|
|
311
311
|
|
|
312
312
|
return (
|
|
313
313
|
<EntityPreviewContainer
|
|
314
314
|
onClick={disabled ? undefined : onClick}
|
|
315
315
|
hover={disabled ? undefined : hover}
|
|
316
316
|
size={size}>
|
|
317
|
-
<
|
|
317
|
+
<EntityPreviewBindingData
|
|
318
318
|
actions={actions}
|
|
319
319
|
collection={collection}
|
|
320
320
|
previewKeys={previewKeys}
|
|
@@ -323,7 +323,7 @@ export function EntityPreview({
|
|
|
323
323
|
includeTitle={includeTitle}
|
|
324
324
|
includeEntityLink={includeEntityLink}
|
|
325
325
|
includeImage={includeImage}
|
|
326
|
-
|
|
326
|
+
onSidePanelClick={onSidePanelClick}
|
|
327
327
|
entity={entity}
|
|
328
328
|
/>
|
|
329
329
|
</EntityPreviewContainer>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Properties } from "@rebasepro/types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
3
3
|
import type { CustomizationController } from "@rebasepro/types";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { Entity } from "@rebasepro/types";
|
|
@@ -12,20 +12,20 @@ import { PropertyCollectionView } from "./PropertyCollectionView";
|
|
|
12
12
|
/**
|
|
13
13
|
* @group Components
|
|
14
14
|
*/
|
|
15
|
-
export interface
|
|
15
|
+
export interface EntityViewBindingProps<M extends Record<string, unknown>> {
|
|
16
16
|
entity: Entity<M>;
|
|
17
|
-
collection:
|
|
17
|
+
collection: CollectionConfig<M>;
|
|
18
18
|
path: string;
|
|
19
19
|
className?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export function
|
|
22
|
+
export function EntityViewBinding<M extends Record<string, unknown>>(
|
|
23
23
|
{
|
|
24
24
|
entity,
|
|
25
25
|
collection,
|
|
26
26
|
path,
|
|
27
27
|
className
|
|
28
|
-
}:
|
|
28
|
+
}: EntityViewBindingProps<M>) {
|
|
29
29
|
|
|
30
30
|
const customizationController: CustomizationController = useCustomizationController();
|
|
31
31
|
|
|
@@ -2,7 +2,7 @@ import React, { useRef } from "react";
|
|
|
2
2
|
import { Highlight, themes } from "prism-react-renderer";
|
|
3
3
|
import { useModeController } from "@rebasepro/core";
|
|
4
4
|
|
|
5
|
-
export function
|
|
5
|
+
export function JsonPreviewBinding({ values }: { values: object }) {
|
|
6
6
|
const code = JSON.stringify(values, null, "\t");
|
|
7
7
|
const { mode } = useModeController();
|
|
8
8
|
const preRef = useRef<HTMLPreElement>(null);
|
|
@@ -10,7 +10,7 @@ import type { RebaseCMSConfig } from "@rebasepro/types";
|
|
|
10
10
|
* is auto-wired as a native feature (slots, provider, Studio view) without
|
|
11
11
|
* needing any external plugin.
|
|
12
12
|
*/
|
|
13
|
-
export function RebaseCMS({ collections, views, homePage, entityViews, entityActions, collectionEditor, navigationGroupMappings }: RebaseCMSConfig) {
|
|
13
|
+
export function RebaseCMS({ collections, views, homePage, entityViews, entityActions, collectionEditor, navigationGroupMappings, basePath }: RebaseCMSConfig) {
|
|
14
14
|
const dispatch = useRebaseRegistryDispatch();
|
|
15
15
|
|
|
16
16
|
useLayoutEffect(() => {
|
|
@@ -20,9 +20,10 @@ homePage,
|
|
|
20
20
|
entityViews,
|
|
21
21
|
entityActions,
|
|
22
22
|
collectionEditor,
|
|
23
|
-
navigationGroupMappings
|
|
23
|
+
navigationGroupMappings,
|
|
24
|
+
basePath });
|
|
24
25
|
return () => dispatch.unregisterCMS();
|
|
25
|
-
}, [dispatch, collections, views, homePage, entityViews, entityActions, collectionEditor, navigationGroupMappings]);
|
|
26
|
+
}, [dispatch, collections, views, homePage, entityViews, entityActions, collectionEditor, navigationGroupMappings, basePath]);
|
|
26
27
|
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
} from "@rebasepro/core";
|
|
17
17
|
import { buildRoutedRebaseData, resolveDataSource } from "@rebasepro/common";
|
|
18
18
|
import { CircularProgressCenter } from "@rebasepro/ui";
|
|
19
|
-
import type { AppView, CollectionEditorOptions, EntityCustomView, EntityAction,
|
|
19
|
+
import type { AppView, CollectionEditorOptions, EntityCustomView, EntityAction, CollectionConfig, RebasePlugin } from "@rebasepro/types";
|
|
20
20
|
import type { CollectionRegistryController } from "@rebasepro/types";
|
|
21
21
|
import type { UrlController, NavigationStateController } from "@rebasepro/types";
|
|
22
22
|
|
|
23
23
|
const EMPTY_PLUGINS: RebasePlugin[] = [];
|
|
24
|
-
const EMPTY_COLLECTIONS:
|
|
24
|
+
const EMPTY_COLLECTIONS: CollectionConfig[] = [];
|
|
25
25
|
|
|
26
26
|
import { useBuildNavigationStateController } from "../hooks/navigation/useBuildNavigationStateController";
|
|
27
27
|
import { useBuildUrlController } from "../hooks/navigation/useBuildUrlController";
|
|
@@ -31,7 +31,7 @@ import { CollectionRegistryContext } from "../hooks/navigation/contexts/Collecti
|
|
|
31
31
|
import { UrlContext } from "../hooks/navigation/contexts/UrlContext";
|
|
32
32
|
import { NavigationStateContext } from "../hooks/navigation/contexts/NavigationStateContext";
|
|
33
33
|
|
|
34
|
-
import {
|
|
34
|
+
import { SidePanelProvider } from "./SidePanelProvider";
|
|
35
35
|
|
|
36
36
|
// Collection editor internals — used when collectionEditor is enabled
|
|
37
37
|
import { useLocalCollectionsConfigController } from "../collection_editor/useLocalCollectionsConfigController";
|
|
@@ -61,7 +61,7 @@ export interface RebaseNavigationProps {
|
|
|
61
61
|
* ```tsx
|
|
62
62
|
* <RebaseNavigation>
|
|
63
63
|
* <MyCustomLayout>
|
|
64
|
-
* <
|
|
64
|
+
* <CollectionViewBinding ... />
|
|
65
65
|
* </MyCustomLayout>
|
|
66
66
|
* </RebaseNavigation>
|
|
67
67
|
* ```
|
|
@@ -109,8 +109,17 @@ export function RebaseNavigation({ children }: RebaseNavigationProps) {
|
|
|
109
109
|
resolveKey: (slugOrPath) => resolveDataSource(getCollectionRef.current(slugOrPath), dataSources.registry).key
|
|
110
110
|
}), [defaultData, dataSources]);
|
|
111
111
|
|
|
112
|
+
// Normalize the configured mount prefix to a leading-slash, no-trailing-slash
|
|
113
|
+
// form (e.g. "admin" or "/admin/" -> "/admin"); empty/"/" stays "/".
|
|
114
|
+
const basePath = useMemo(() => {
|
|
115
|
+
const raw = registry.cmsConfig?.basePath;
|
|
116
|
+
if (!raw || raw === "/") return "/";
|
|
117
|
+
const trimmed = raw.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
118
|
+
return trimmed ? `/${trimmed}` : "/";
|
|
119
|
+
}, [registry.cmsConfig?.basePath]);
|
|
120
|
+
|
|
112
121
|
const urlController = useBuildUrlController({
|
|
113
|
-
basePath
|
|
122
|
+
basePath,
|
|
114
123
|
baseCollectionPath: "/c",
|
|
115
124
|
collectionRegistryController
|
|
116
125
|
});
|
|
@@ -213,7 +222,7 @@ export function RebaseNavigation({ children }: RebaseNavigationProps) {
|
|
|
213
222
|
// The <Rebase> component builds the customizationController from its own props,
|
|
214
223
|
// but entity views passed to <RebaseCMS> are stored in the registry and not
|
|
215
224
|
// automatically merged. We re-provide an enriched controller here so that
|
|
216
|
-
// downstream consumers (
|
|
225
|
+
// downstream consumers (EditViewBinding, side panels, etc.) can resolve
|
|
217
226
|
// string-keyed entity views like "blog_preview".
|
|
218
227
|
const enrichedCustomizationController = useMemo(() => {
|
|
219
228
|
const cmsEntityViews = (registry.cmsConfig?.entityViews ?? []) as EntityCustomView[];
|
|
@@ -245,14 +254,14 @@ export function RebaseNavigation({ children }: RebaseNavigationProps) {
|
|
|
245
254
|
<CollectionRegistryContext.Provider value={collectionRegistryController}>
|
|
246
255
|
<UrlContext.Provider value={urlController}>
|
|
247
256
|
<NavigationStateContext.Provider value={navigationStateController}>
|
|
248
|
-
<
|
|
257
|
+
<SidePanelProvider>
|
|
249
258
|
<BridgeAutoRegistrar
|
|
250
259
|
collectionRegistryController={collectionRegistryController}
|
|
251
260
|
urlController={urlController}
|
|
252
261
|
navigationStateController={navigationStateController}
|
|
253
262
|
/>
|
|
254
263
|
{children}
|
|
255
|
-
</
|
|
264
|
+
</SidePanelProvider>
|
|
256
265
|
</NavigationStateContext.Provider>
|
|
257
266
|
</UrlContext.Provider>
|
|
258
267
|
</CollectionRegistryContext.Provider>
|