@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,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import type {
|
|
2
|
+
import type { CollectionConfig, Property } from "@rebasepro/types";
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { CollectionSize, Entity, EntityAction, EntityTableController, SelectionController } from "@rebasepro/types";
|
|
5
5
|
import {
|
|
@@ -22,12 +22,12 @@ import { useAnalyticsController } from "@rebasepro/core";
|
|
|
22
22
|
import { getEntityPreviewKeys } from "../../util/previews";
|
|
23
23
|
import { IconForView } from "@rebasepro/core";
|
|
24
24
|
import { getValueInPath } from "@rebasepro/utils";
|
|
25
|
-
import { useCollectionSlotKeys, resolveEntitySlots, type CollectionSlotKeys } from "./
|
|
25
|
+
import { useCollectionSlotKeys, resolveEntitySlots, type CollectionSlotKeys } from "./usePreviewSlots";
|
|
26
26
|
import { useCMSContext } from "../../hooks/useCMSContext";
|
|
27
27
|
import { resolveEntityAction } from "../../util/resolutions";
|
|
28
28
|
|
|
29
|
-
export type
|
|
30
|
-
collection:
|
|
29
|
+
export type CollectionListViewBindingProps<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
30
|
+
collection: CollectionConfig<M>;
|
|
31
31
|
tableController: EntityTableController<M>;
|
|
32
32
|
onEntityClick?: (entity: Entity<M>) => void;
|
|
33
33
|
selectionController?: SelectionController<M>;
|
|
@@ -215,7 +215,7 @@ function compactValueSummary(value: unknown, property: Property): string | null
|
|
|
215
215
|
if (typeof value === "string" || typeof value === "number") return String(value);
|
|
216
216
|
if (value && typeof value === "object") {
|
|
217
217
|
const obj = value as Record<string, unknown>;
|
|
218
|
-
// EntityRelation.data is
|
|
218
|
+
// EntityRelation.data is a Entity: { id, path, values: { name, ... } }
|
|
219
219
|
if (obj.data && typeof obj.data === "object") {
|
|
220
220
|
const data = obj.data as Record<string, unknown>;
|
|
221
221
|
const values = (data.values && typeof data.values === "object")
|
|
@@ -271,7 +271,7 @@ year: diffDays > 365 ? "numeric" : undefined });
|
|
|
271
271
|
* - Column-sortable headers
|
|
272
272
|
* - Infinite scroll
|
|
273
273
|
*/
|
|
274
|
-
export function
|
|
274
|
+
export function CollectionListViewBinding<M extends Record<string, unknown> = Record<string, unknown>>({
|
|
275
275
|
collection,
|
|
276
276
|
tableController,
|
|
277
277
|
onEntityClick,
|
|
@@ -285,7 +285,7 @@ export function EntityCollectionListView<M extends Record<string, unknown> = Rec
|
|
|
285
285
|
getActionsForEntity,
|
|
286
286
|
path,
|
|
287
287
|
openEntityMode
|
|
288
|
-
}:
|
|
288
|
+
}: CollectionListViewBindingProps<M>) {
|
|
289
289
|
const authController = useAuthController();
|
|
290
290
|
const customizationController = useCustomizationController();
|
|
291
291
|
const analyticsController = useAnalyticsController();
|
|
@@ -327,7 +327,7 @@ export function EntityCollectionListView<M extends Record<string, unknown> = Rec
|
|
|
327
327
|
|
|
328
328
|
// ── Shared slot resolution (replaces 4 individual useMemo calls) ──
|
|
329
329
|
const slotKeys = useCollectionSlotKeys(
|
|
330
|
-
resolvedCollection as
|
|
330
|
+
resolvedCollection as CollectionConfig<Record<string, unknown>>,
|
|
331
331
|
authController,
|
|
332
332
|
customizationController.propertyConfigs
|
|
333
333
|
);
|
|
@@ -611,7 +611,7 @@ const ListRow = React.memo(function ListRow<M extends Record<string, unknown>>({
|
|
|
611
611
|
openEntityMode
|
|
612
612
|
}: {
|
|
613
613
|
entity: Entity<M>;
|
|
614
|
-
collection:
|
|
614
|
+
collection: CollectionConfig<M>;
|
|
615
615
|
onClick?: (entity: Entity<M>) => void;
|
|
616
616
|
selected?: boolean;
|
|
617
617
|
highlighted?: boolean;
|
|
@@ -633,7 +633,7 @@ const ListRow = React.memo(function ListRow<M extends Record<string, unknown>>({
|
|
|
633
633
|
// ── Resolve slots (pure function, no hooks) ──
|
|
634
634
|
const slots = resolveEntitySlots(
|
|
635
635
|
entity as Entity<Record<string, unknown>>,
|
|
636
|
-
collection as
|
|
636
|
+
collection as CollectionConfig<Record<string, unknown>>,
|
|
637
637
|
slotKeys
|
|
638
638
|
);
|
|
639
639
|
|
|
@@ -862,7 +862,7 @@ const ListRow = React.memo(function ListRow<M extends Record<string, unknown>>({
|
|
|
862
862
|
path,
|
|
863
863
|
collection,
|
|
864
864
|
context: context!,
|
|
865
|
-
|
|
865
|
+
sidePanelController: context?.sidePanelController,
|
|
866
866
|
selectionController,
|
|
867
867
|
openEntityMode: openEntityMode ?? collection?.openEntityMode ?? "full_screen"
|
|
868
868
|
});
|
|
@@ -877,7 +877,7 @@ const ListRow = React.memo(function ListRow<M extends Record<string, unknown>>({
|
|
|
877
877
|
);
|
|
878
878
|
}) as <M extends Record<string, unknown>>(props: {
|
|
879
879
|
entity: Entity<M>;
|
|
880
|
-
collection:
|
|
880
|
+
collection: CollectionConfig<M>;
|
|
881
881
|
onClick?: (entity: Entity<M>) => void;
|
|
882
882
|
selected?: boolean;
|
|
883
883
|
highlighted?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import type {
|
|
2
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
3
3
|
import React, { lazy, Suspense } from "react";
|
|
4
4
|
|
|
5
5
|
import { useLargeLayout, useTranslation, useSlot, resolveComponentRef } from "@rebasepro/core";
|
|
@@ -15,8 +15,8 @@ import { EditorCollectionAction } from "../../collection_editor/ui/EditorCollect
|
|
|
15
15
|
import { useCollectionEditorController } from "../../collection_editor/useCollectionEditorController";
|
|
16
16
|
import { useCMSContext } from "../../index";
|
|
17
17
|
|
|
18
|
-
export type
|
|
19
|
-
collection:
|
|
18
|
+
export type CollectionViewActionsProps<M extends Record<string, unknown>> = {
|
|
19
|
+
collection: CollectionConfig<M>;
|
|
20
20
|
path: string;
|
|
21
21
|
relativePath: string;
|
|
22
22
|
parentCollectionSlugs: string[], parentEntityIds: string[];
|
|
@@ -31,7 +31,7 @@ export type EntityCollectionViewActionsProps<M extends Record<string, unknown>>
|
|
|
31
31
|
openNewDocument: (defaultValues?: Record<string, unknown>) => void;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export function
|
|
34
|
+
export function CollectionViewActions<M extends Record<string, unknown>>({
|
|
35
35
|
collection,
|
|
36
36
|
relativePath,
|
|
37
37
|
parentCollectionSlugs, parentEntityIds,
|
|
@@ -45,7 +45,7 @@ export function EntityCollectionViewActions<M extends Record<string, unknown>>({
|
|
|
45
45
|
compact,
|
|
46
46
|
children,
|
|
47
47
|
openNewDocument
|
|
48
|
-
}:
|
|
48
|
+
}: CollectionViewActionsProps<M>) {
|
|
49
49
|
const context = useCMSContext();
|
|
50
50
|
|
|
51
51
|
const { canCreate, canDelete } = usePermissions();
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import type { AdditionalFieldDelegate, EntityAction, CollectionConfig, Property } from "@rebasepro/types";
|
|
2
|
+
import {
|
|
3
|
+
CollectionSize,
|
|
4
|
+
Entity,
|
|
5
|
+
EntityReference,
|
|
6
|
+
EntityTableController,
|
|
7
|
+
FilterValues,
|
|
8
|
+
getCollectionDataPath,
|
|
9
|
+
PartialCollectionConfig,
|
|
10
|
+
ViewMode
|
|
11
|
+
} from "@rebasepro/types";
|
|
4
12
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
13
|
import { useSearchParams } from "react-router-dom";
|
|
6
14
|
|
|
7
15
|
import { deepEqual as equal } from "fast-equals"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const EMPTY_ARRAY: never[] = [];
|
|
11
|
-
const DEFAULT_ENTITY_OPEN_MODE = "split";
|
|
12
|
-
|
|
13
|
-
import { CollectionSize, Entity, EntityReference, EntityTableController, FilterValues, getCollectionDataPath, PartialEntityCollection, ViewMode } from "@rebasepro/types";
|
|
14
|
-
import {
|
|
15
|
-
EntityCollectionRowActions,
|
|
16
|
-
EntityCollectionTable
|
|
17
|
-
} from "../EntityCollectionTable";
|
|
18
|
-
import { CollectionTableToolbar } from "../EntityCollectionTable/internal/CollectionTableToolbar";
|
|
16
|
+
import { CollectionRowActions, CollectionTableBinding } from "../CollectionTableBinding";
|
|
17
|
+
import { CollectionTableToolbar } from "../CollectionTableBinding/internal/CollectionTableToolbar";
|
|
19
18
|
import { getSubcollections } from "@rebasepro/common";
|
|
20
19
|
import { useCollectionInlineEditor } from "./hooks/useCollectionInlineEditor";
|
|
21
20
|
import { navigateToEntity } from "../../util/navigation_utils";
|
|
@@ -24,47 +23,63 @@ import { resolveEntityAction } from "../../util/resolutions";
|
|
|
24
23
|
import { getPropertyInPath } from "../../util/property_utils";
|
|
25
24
|
import { ReferencePreview } from "../../preview";
|
|
26
25
|
import {
|
|
26
|
+
CollectionScopeProvider,
|
|
27
|
+
OnColumnResizeParams,
|
|
28
|
+
useAnalyticsController,
|
|
27
29
|
useAuthController,
|
|
30
|
+
useColumnIds,
|
|
31
|
+
useComponentOverride,
|
|
28
32
|
useCustomizationController,
|
|
29
33
|
useData,
|
|
30
34
|
useDataTableController,
|
|
31
35
|
useLargeLayout,
|
|
32
36
|
usePermissions,
|
|
33
|
-
|
|
37
|
+
useScrollRestoration,
|
|
34
38
|
useSlot,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
CollectionComponentOverrideProvider
|
|
39
|
+
useTranslation,
|
|
40
|
+
useUserConfigurationPersistence
|
|
38
41
|
} from "@rebasepro/core";
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import { EntityCollectionListView } from "./EntityCollectionListView";
|
|
42
|
+
import { CollectionViewActions } from "./CollectionViewActions";
|
|
43
|
+
import { CollectionCardViewBinding } from "./CollectionCardViewBinding";
|
|
44
|
+
import { CollectionListViewBinding } from "./CollectionListViewBinding";
|
|
43
45
|
import { SplitListView } from "./SplitListView";
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import { Button, cls, focusedDisabled, IconButton, Markdown, Popover, Skeleton, TextField, Tooltip, Typography, VirtualTableColumn, iconSize } from "@rebasepro/ui";
|
|
47
|
-
import { ArrowRightToLineIcon, ErrorBoundary, PlusIcon, SearchIcon } from "@rebasepro/ui";
|
|
48
|
-
import { setIn } from "@rebasepro/formex";
|
|
49
|
-
import { getSubcollectionColumnId } from "../EntityCollectionTable/internal/common";
|
|
46
|
+
import { CollectionBoardViewBinding } from "./CollectionBoardViewBinding";
|
|
47
|
+
import { KanbanPropertyOption, ViewModeToggle } from "./ViewModeToggle";
|
|
50
48
|
import {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
ArrowRightToLineIcon,
|
|
50
|
+
Button,
|
|
51
|
+
cls,
|
|
52
|
+
ErrorBoundary,
|
|
53
|
+
focusedDisabled,
|
|
54
|
+
IconButton,
|
|
55
|
+
iconSize,
|
|
56
|
+
PlusIcon,
|
|
57
|
+
Popover,
|
|
58
|
+
SearchIcon,
|
|
59
|
+
TextField,
|
|
60
|
+
Tooltip,
|
|
61
|
+
Typography,
|
|
62
|
+
VirtualTableColumn
|
|
63
|
+
} from "@rebasepro/ui";
|
|
64
|
+
import { getSubcollectionColumnId } from "../CollectionTableBinding/internal/common";
|
|
65
|
+
import { copyEntityAction, deleteEntityAction, editEntityAction } from "../common/default_entity_actions";
|
|
66
|
+
import { PopupFormField } from "../CollectionTableBinding/internal/popup_field/PopupFormField";
|
|
67
|
+
import { GetPropertyForProps } from "../CollectionTableBinding/CollectionTableBindingProps";
|
|
59
68
|
import { DeleteEntityDialog } from "../DeleteEntityDialog";
|
|
60
|
-
import { useAnalyticsController } from "@rebasepro/core";
|
|
61
69
|
import { useSelectionController } from "./useSelectionController";
|
|
62
|
-
import {
|
|
70
|
+
import { CollectionViewStartActions } from "./CollectionViewStartActions";
|
|
63
71
|
import { addRecentId, getRecentIds } from "./utils";
|
|
64
|
-
import { useScrollRestoration } from "@rebasepro/core";
|
|
65
72
|
import { mergeDeep } from "@rebasepro/utils";
|
|
66
|
-
import {
|
|
67
|
-
|
|
73
|
+
import {
|
|
74
|
+
useBreadcrumbsController,
|
|
75
|
+
useCMSContext,
|
|
76
|
+
useCollectionRegistryController,
|
|
77
|
+
useSidePanel,
|
|
78
|
+
useUrlController
|
|
79
|
+
} from "../../index";
|
|
80
|
+
|
|
81
|
+
const EMPTY_ARRAY: never[] = [];
|
|
82
|
+
const DEFAULT_ENTITY_OPEN_MODE = "split";
|
|
68
83
|
|
|
69
84
|
function getOpenEntityMode(
|
|
70
85
|
viewMode: ViewMode,
|
|
@@ -80,7 +95,7 @@ function getOpenEntityMode(
|
|
|
80
95
|
/**
|
|
81
96
|
* @group Components
|
|
82
97
|
*/
|
|
83
|
-
export type
|
|
98
|
+
export type CollectionViewBindingProps<M extends Record<string, unknown>> = {
|
|
84
99
|
/**
|
|
85
100
|
* Complete path where this collection is located.
|
|
86
101
|
* It defaults to the collection path if not provided.
|
|
@@ -118,23 +133,23 @@ export type EntityCollectionViewProps<M extends Record<string, unknown>> = {
|
|
|
118
133
|
*/
|
|
119
134
|
selectedTab?: string;
|
|
120
135
|
|
|
121
|
-
} &
|
|
136
|
+
} & CollectionConfig<M>;
|
|
122
137
|
|
|
123
138
|
/**
|
|
124
|
-
* This component is in charge of binding a driver path with an {@link
|
|
139
|
+
* This component is in charge of binding a driver path with an {@link CollectionConfig}
|
|
125
140
|
* where it's configuration is defined. It includes an infinite scrolling table
|
|
126
141
|
* and a 'Add' new entities button,
|
|
127
142
|
*
|
|
128
143
|
* This component is the default one used for displaying entity collections
|
|
129
144
|
* and is in charge of generating all the specific actions and customization
|
|
130
|
-
* of the lower level {@link
|
|
145
|
+
* of the lower level {@link CollectionTableBinding}
|
|
131
146
|
*
|
|
132
147
|
* Please **note** that you only need to use this component if you are building
|
|
133
148
|
* a custom view. If you just need to create a default view you can do it
|
|
134
149
|
* exclusively with config options.
|
|
135
150
|
*
|
|
136
151
|
* If you need a lower level implementation with more granular options, you
|
|
137
|
-
* can use {@link
|
|
152
|
+
* can use {@link CollectionTableBinding}.
|
|
138
153
|
*
|
|
139
154
|
* If you need a generic table that is not bound to the driver or entities and
|
|
140
155
|
* properties at all, you can check {@link VirtualTable}
|
|
@@ -144,8 +159,8 @@ export type EntityCollectionViewProps<M extends Record<string, unknown>> = {
|
|
|
144
159
|
|
|
145
160
|
* @group Components
|
|
146
161
|
*/
|
|
147
|
-
const
|
|
148
|
-
function
|
|
162
|
+
const CollectionViewBindingInner = React.memo(
|
|
163
|
+
function CollectionViewBindingInner<M extends Record<string, unknown>>({
|
|
149
164
|
path: pathProp,
|
|
150
165
|
|
|
151
166
|
parentCollectionSlugs, parentEntityIds,
|
|
@@ -155,7 +170,7 @@ const EntityCollectionViewInner = React.memo(
|
|
|
155
170
|
selectedEntityId: selectedEntityIdProp,
|
|
156
171
|
selectedTab: selectedTabProp,
|
|
157
172
|
...collectionProp
|
|
158
|
-
}:
|
|
173
|
+
}: CollectionViewBindingProps<M>
|
|
159
174
|
) {
|
|
160
175
|
|
|
161
176
|
const { t } = useTranslation();
|
|
@@ -165,7 +180,7 @@ const EntityCollectionViewInner = React.memo(
|
|
|
165
180
|
const breadcrumbs = useBreadcrumbsController();
|
|
166
181
|
const path = pathProp ?? getCollectionDataPath(collectionProp);
|
|
167
182
|
const dataClient = useData();
|
|
168
|
-
const
|
|
183
|
+
const sidePanelController = useSidePanel();
|
|
169
184
|
const authController = useAuthController();
|
|
170
185
|
const userConfigPersistence = useUserConfigurationPersistence();
|
|
171
186
|
const analyticsController = useAnalyticsController();
|
|
@@ -179,7 +194,7 @@ const EntityCollectionViewInner = React.memo(
|
|
|
179
194
|
const collection = useMemo(() => {
|
|
180
195
|
const registryCollection = collectionRegistry.getCollection(path) || collectionProp;
|
|
181
196
|
const userOverride = userConfigPersistence?.getCollectionConfig<M>(path);
|
|
182
|
-
return (userOverride ? mergeDeep(registryCollection, userOverride) : registryCollection) as
|
|
197
|
+
return (userOverride ? mergeDeep(registryCollection, userOverride) : registryCollection) as CollectionConfig<M>;
|
|
183
198
|
}, [collectionProp, path, userConfigPersistence, collectionRegistry]);
|
|
184
199
|
|
|
185
200
|
const collectionRef = React.useRef(collection);
|
|
@@ -346,14 +361,14 @@ const EntityCollectionViewInner = React.memo(
|
|
|
346
361
|
navigateToEntity({
|
|
347
362
|
navigation: urlController,
|
|
348
363
|
path: entityPath,
|
|
349
|
-
|
|
364
|
+
sidePanelController,
|
|
350
365
|
openEntityMode,
|
|
351
366
|
collection,
|
|
352
367
|
entityId: clickedEntity.id,
|
|
353
368
|
replace: openEntityMode === "split" && selectedEntityIdProp !== undefined
|
|
354
369
|
});
|
|
355
370
|
|
|
356
|
-
}, [
|
|
371
|
+
}, [sidePanelController, openEntityMode, selectedEntityIdProp, path, urlController, analyticsController]);
|
|
357
372
|
|
|
358
373
|
const onNewClick = useCallback(() => {
|
|
359
374
|
const collection = collectionRef.current;
|
|
@@ -365,11 +380,11 @@ const EntityCollectionViewInner = React.memo(
|
|
|
365
380
|
collection,
|
|
366
381
|
entityId: undefined,
|
|
367
382
|
path: path,
|
|
368
|
-
|
|
383
|
+
sidePanelController,
|
|
369
384
|
navigation: urlController,
|
|
370
385
|
onClose: unselectNavigatedEntity
|
|
371
386
|
})
|
|
372
|
-
}, [path,
|
|
387
|
+
}, [path, sidePanelController]);
|
|
373
388
|
|
|
374
389
|
const openNewDocument = useCallback((defaultValues?: Record<string, unknown>) => {
|
|
375
390
|
const collection = collectionRef.current;
|
|
@@ -382,11 +397,11 @@ const EntityCollectionViewInner = React.memo(
|
|
|
382
397
|
entityId: undefined,
|
|
383
398
|
defaultValues,
|
|
384
399
|
path: path,
|
|
385
|
-
|
|
400
|
+
sidePanelController,
|
|
386
401
|
navigation: urlController,
|
|
387
402
|
onClose: unselectNavigatedEntity
|
|
388
403
|
});
|
|
389
|
-
}, [path,
|
|
404
|
+
}, [path, sidePanelController, openEntityMode, urlController, unselectNavigatedEntity]);
|
|
390
405
|
|
|
391
406
|
const onMultipleDeleteClick = () => {
|
|
392
407
|
analyticsController.onAnalyticsEvent?.("multiple_delete_dialog_open", {
|
|
@@ -447,7 +462,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
|
447
462
|
collection
|
|
448
463
|
});
|
|
449
464
|
|
|
450
|
-
const onCollectionModifiedForUser = useCallback((path: string, partialCollection:
|
|
465
|
+
const onCollectionModifiedForUser = useCallback((path: string, partialCollection: PartialCollectionConfig<M>) => {
|
|
451
466
|
if (userConfigPersistence) {
|
|
452
467
|
const currentStoredConfig = userConfigPersistence.getCollectionConfig(path);
|
|
453
468
|
const updatedConfig = mergeDeep(currentStoredConfig, partialCollection);
|
|
@@ -463,7 +478,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
|
463
478
|
const collection = collectionRef.current;
|
|
464
479
|
// Only for property columns
|
|
465
480
|
if (!getPropertyInPath(collection.properties, key)) return;
|
|
466
|
-
const localCollection = buildPropertyWidthOverwrite(key, width) as
|
|
481
|
+
const localCollection = buildPropertyWidthOverwrite(key, width) as PartialCollectionConfig<M>;
|
|
467
482
|
onCollectionModifiedForUser(path, localCollection);
|
|
468
483
|
}, [onCollectionModifiedForUser, path]);
|
|
469
484
|
|
|
@@ -489,7 +504,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
|
489
504
|
setViewMode(mode);
|
|
490
505
|
// Save to local persistence for next visit
|
|
491
506
|
if (userConfigPersistence) {
|
|
492
|
-
onCollectionModifiedForUser(path, { defaultViewMode: mode } as
|
|
507
|
+
onCollectionModifiedForUser(path, { defaultViewMode: mode } as PartialCollectionConfig<M>);
|
|
493
508
|
}
|
|
494
509
|
}, [setViewMode, userConfigPersistence, onCollectionModifiedForUser, path, analyticsController, viewMode]);
|
|
495
510
|
|
|
@@ -583,7 +598,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
|
583
598
|
setSelectedKanbanProperty(property);
|
|
584
599
|
// Save to local persistence
|
|
585
600
|
if (userConfigPersistence) {
|
|
586
|
-
onCollectionModifiedForUser(path, { kanbanColumnProperty: property } as
|
|
601
|
+
onCollectionModifiedForUser(path, { kanbanColumnProperty: property } as PartialCollectionConfig<M>);
|
|
587
602
|
}
|
|
588
603
|
}, [userConfigPersistence, onCollectionModifiedForUser, path, analyticsController]);
|
|
589
604
|
|
|
@@ -620,7 +635,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
|
620
635
|
const additionalFields = useMemo(() => {
|
|
621
636
|
// v4: use getSubcollections helper to access subcollections
|
|
622
637
|
const subcollectionsList = getSubcollections(collection);
|
|
623
|
-
const subcollectionColumns: AdditionalFieldDelegate<M, any>[] = subcollectionsList.map((subcollection:
|
|
638
|
+
const subcollectionColumns: AdditionalFieldDelegate<M, any>[] = subcollectionsList.map((subcollection: CollectionConfig) => {
|
|
624
639
|
return {
|
|
625
640
|
key: getSubcollectionColumnId(subcollection),
|
|
626
641
|
name: subcollection.name,
|
|
@@ -639,7 +654,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
|
639
654
|
selectedTab: subcollection.slug,
|
|
640
655
|
path: path,
|
|
641
656
|
navigation: urlController,
|
|
642
|
-
|
|
657
|
+
sidePanelController
|
|
643
658
|
})
|
|
644
659
|
}}>
|
|
645
660
|
{subcollection.name}
|
|
@@ -652,7 +667,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
|
652
667
|
...(collection.additionalFields ?? EMPTY_ARRAY),
|
|
653
668
|
...subcollectionColumns
|
|
654
669
|
];
|
|
655
|
-
}, [collection, path,
|
|
670
|
+
}, [collection, path, sidePanelController]);
|
|
656
671
|
|
|
657
672
|
const updateLastDeleteTimestamp = useCallback(() => {
|
|
658
673
|
setLastDeleteTimestamp(Date.now());
|
|
@@ -717,7 +732,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
|
717
732
|
});
|
|
718
733
|
|
|
719
734
|
return (
|
|
720
|
-
<
|
|
735
|
+
<CollectionRowActions
|
|
721
736
|
entity={entity}
|
|
722
737
|
width={width}
|
|
723
738
|
frozen={frozen}
|
|
@@ -776,7 +791,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
|
776
791
|
propertyKey,
|
|
777
792
|
onHover,
|
|
778
793
|
path,
|
|
779
|
-
collection: collection as
|
|
794
|
+
collection: collection as CollectionConfig,
|
|
780
795
|
tableController: tableController as EntityTableController,
|
|
781
796
|
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
782
797
|
parentEntityIds: parentEntityIds ?? EMPTY_ARRAY
|
|
@@ -832,7 +847,7 @@ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY
|
|
|
832
847
|
|
|
833
848
|
// Save to user configuration persistence (local storage)
|
|
834
849
|
if (userConfigPersistence) {
|
|
835
|
-
onCollectionModifiedForUser(path, { propertiesOrder: newPropertiesOrder } as
|
|
850
|
+
onCollectionModifiedForUser(path, { propertiesOrder: newPropertiesOrder } as PartialCollectionConfig<M>);
|
|
836
851
|
}
|
|
837
852
|
}, [collection, setLocalPropertiesOrder, customizationController, path, parentCollectionSlugs, parentEntityIds, userConfigPersistence, onCollectionModifiedForUser]);
|
|
838
853
|
|
|
@@ -871,8 +886,8 @@ parentEntityIds,
|
|
|
871
886
|
const isSearching = !!tableController.searchString;
|
|
872
887
|
const isFilteredOrSorted = tableController.filterValues !== undefined || tableController.sortBy !== undefined || isSearching;
|
|
873
888
|
const ResolvedEmptyState = useComponentOverride("Collection.EmptyState", DefaultCollectionEmptyState);
|
|
874
|
-
const ResolvedCollectionActions = useComponentOverride("Collection.Actions",
|
|
875
|
-
const ResolvedCollectionTable = useComponentOverride("Collection.Table",
|
|
889
|
+
const ResolvedCollectionActions = useComponentOverride("Collection.Actions", CollectionViewActions);
|
|
890
|
+
const ResolvedCollectionTable = useComponentOverride("Collection.Table", CollectionTableBinding) as typeof CollectionTableBinding;
|
|
876
891
|
const emptyComponent = pluginEmptyStates.length > 0
|
|
877
892
|
? <>{pluginEmptyStates}</>
|
|
878
893
|
: <ResolvedEmptyState
|
|
@@ -889,7 +904,7 @@ parentEntityIds,
|
|
|
889
904
|
onTextSearch={tableController.setSearchString}
|
|
890
905
|
initialSearchText={tableController.searchString}
|
|
891
906
|
viewModeToggle={viewModeToggleElement}
|
|
892
|
-
actionsStart={<
|
|
907
|
+
actionsStart={<CollectionViewStartActions
|
|
893
908
|
parentCollectionSlugs={parentCollectionSlugs ?? EMPTY_ARRAY} parentEntityIds={parentEntityIds ?? EMPTY_ARRAY}
|
|
894
909
|
collection={collection}
|
|
895
910
|
tableController={tableController}
|
|
@@ -920,7 +935,7 @@ parentEntityIds,
|
|
|
920
935
|
}
|
|
921
936
|
/>
|
|
922
937
|
); const innerView = viewMode === "kanban" ? (
|
|
923
|
-
<
|
|
938
|
+
<CollectionBoardViewBinding
|
|
924
939
|
key={`kanban-view-${path}-${selectedKanbanProperty}`}
|
|
925
940
|
collection={collection}
|
|
926
941
|
tableController={tableController}
|
|
@@ -935,7 +950,7 @@ parentEntityIds,
|
|
|
935
950
|
emptyComponent={emptyComponent}
|
|
936
951
|
/>
|
|
937
952
|
) : viewMode === "cards" ? (
|
|
938
|
-
<
|
|
953
|
+
<CollectionCardViewBinding
|
|
939
954
|
key={`cards-view-${path}`}
|
|
940
955
|
collection={collection}
|
|
941
956
|
tableController={tableController}
|
|
@@ -949,7 +964,7 @@ parentEntityIds,
|
|
|
949
964
|
emptyComponent={emptyComponent}
|
|
950
965
|
/>
|
|
951
966
|
) : viewMode === "list" ? (
|
|
952
|
-
<
|
|
967
|
+
<CollectionListViewBinding
|
|
953
968
|
key={`list-view-${path}`}
|
|
954
969
|
collection={collection}
|
|
955
970
|
tableController={tableController}
|
|
@@ -1080,7 +1095,7 @@ parentEntityIds,
|
|
|
1080
1095
|
</div>
|
|
1081
1096
|
</div>
|
|
1082
1097
|
)}
|
|
1083
|
-
<
|
|
1098
|
+
<CollectionListViewBinding
|
|
1084
1099
|
key={`list-view-${path}`}
|
|
1085
1100
|
collection={collection}
|
|
1086
1101
|
tableController={tableController}
|
|
@@ -1195,26 +1210,26 @@ parentEntityIds,
|
|
|
1195
1210
|
equal(a.fixedFilter, b.fixedFilter) &&
|
|
1196
1211
|
equal(a.selectedEntityId, b.selectedEntityId) &&
|
|
1197
1212
|
equal(a.selectedTab, b.selectedTab);
|
|
1198
|
-
}) as React.FunctionComponent<
|
|
1213
|
+
}) as React.FunctionComponent<CollectionViewBindingProps<any>>;
|
|
1199
1214
|
|
|
1200
|
-
export const
|
|
1201
|
-
function
|
|
1215
|
+
export const CollectionViewBinding = React.memo(
|
|
1216
|
+
function CollectionViewBinding<M extends Record<string, unknown>>(props: CollectionViewBindingProps<M>) {
|
|
1202
1217
|
const collectionRegistry = useCollectionRegistryController();
|
|
1203
1218
|
const path = props.path ?? props.slug;
|
|
1204
1219
|
const collection = collectionRegistry.getCollection(path) ?? props;
|
|
1205
1220
|
|
|
1206
|
-
const content = <
|
|
1221
|
+
const content = <CollectionViewBindingInner {...props} />;
|
|
1207
1222
|
|
|
1208
|
-
if (collection
|
|
1223
|
+
if (collection) {
|
|
1209
1224
|
return (
|
|
1210
|
-
<
|
|
1225
|
+
<CollectionScopeProvider collection={collection as CollectionConfig}>
|
|
1211
1226
|
{content}
|
|
1212
|
-
</
|
|
1227
|
+
</CollectionScopeProvider>
|
|
1213
1228
|
);
|
|
1214
1229
|
}
|
|
1215
1230
|
return content;
|
|
1216
1231
|
}
|
|
1217
|
-
) as React.FunctionComponent<
|
|
1232
|
+
) as React.FunctionComponent<CollectionViewBindingProps<any>>;
|
|
1218
1233
|
|
|
1219
1234
|
/**
|
|
1220
1235
|
* Default empty state shown when a collection has no entities.
|
|
@@ -1272,7 +1287,7 @@ function EntitiesCount({
|
|
|
1272
1287
|
onCountChange
|
|
1273
1288
|
}: {
|
|
1274
1289
|
path: string,
|
|
1275
|
-
collection:
|
|
1290
|
+
collection: CollectionConfig,
|
|
1276
1291
|
filter?: FilterValues<any>,
|
|
1277
1292
|
sortBy?: [string, "asc" | "desc"],
|
|
1278
1293
|
onCountChange?: (count: number | null | undefined) => void,
|
|
@@ -1303,7 +1318,7 @@ function EntitiesCount({
|
|
|
1303
1318
|
|
|
1304
1319
|
// filterValues is already FilterValues — pass directly
|
|
1305
1320
|
const whereParams = filter && Object.keys(filter).length > 0 ? filter : undefined;
|
|
1306
|
-
const orderByParams = sortByProperty ?
|
|
1321
|
+
const orderByParams: [string, "asc" | "desc"] | undefined = sortByProperty && currentSort ? [String(sortByProperty), currentSort] : undefined;
|
|
1307
1322
|
|
|
1308
1323
|
// Deduplicate inflight count requests (e.g. React StrictMode double-mount)
|
|
1309
1324
|
const cacheKey = `${path}|${filterKey}|${sortByProperty ?? ""}|${currentSort ?? ""}`;
|
|
@@ -1332,12 +1347,12 @@ function EntitiesCount({
|
|
|
1332
1347
|
return null;
|
|
1333
1348
|
}
|
|
1334
1349
|
|
|
1335
|
-
function buildPropertyWidthOverwrite(key: string, width: number):
|
|
1350
|
+
function buildPropertyWidthOverwrite(key: string, width: number): PartialCollectionConfig {
|
|
1336
1351
|
if (key.includes(".")) {
|
|
1337
1352
|
const [parentKey, ...childKey] = key.split(".");
|
|
1338
|
-
return { properties: { [parentKey]: buildPropertyWidthOverwrite(childKey.join("."), width) } } as
|
|
1353
|
+
return { properties: { [parentKey]: buildPropertyWidthOverwrite(childKey.join("."), width) } } as PartialCollectionConfig;
|
|
1339
1354
|
}
|
|
1340
|
-
return { properties: { [key]: { ui: { columnWidth: width } } } } as
|
|
1355
|
+
return { properties: { [key]: { ui: { columnWidth: width } } } } as PartialCollectionConfig;
|
|
1341
1356
|
}
|
|
1342
1357
|
|
|
1343
1358
|
function EntityIdHeaderWidget({
|
|
@@ -1345,7 +1360,7 @@ function EntityIdHeaderWidget({
|
|
|
1345
1360
|
path,
|
|
1346
1361
|
idPath
|
|
1347
1362
|
}: {
|
|
1348
|
-
collection:
|
|
1363
|
+
collection: CollectionConfig,
|
|
1349
1364
|
path: string,
|
|
1350
1365
|
idPath: string
|
|
1351
1366
|
}) {
|
|
@@ -1355,7 +1370,7 @@ function EntityIdHeaderWidget({
|
|
|
1355
1370
|
const [openPopup, setOpenPopup] = React.useState(false);
|
|
1356
1371
|
const [searchString, setSearchString] = React.useState("");
|
|
1357
1372
|
const [recentIds, setRecentIds] = React.useState<string[]>(getRecentIds(collection.slug).map(String));
|
|
1358
|
-
const
|
|
1373
|
+
const sidePanelController = useSidePanel();
|
|
1359
1374
|
|
|
1360
1375
|
const openEntityMode = collection?.openEntityMode ?? DEFAULT_ENTITY_OPEN_MODE;
|
|
1361
1376
|
|
|
@@ -1387,7 +1402,7 @@ function EntityIdHeaderWidget({
|
|
|
1387
1402
|
entityId,
|
|
1388
1403
|
path,
|
|
1389
1404
|
|
|
1390
|
-
|
|
1405
|
+
sidePanelController,
|
|
1391
1406
|
navigation: urlController
|
|
1392
1407
|
})
|
|
1393
1408
|
}}
|
|
@@ -1425,7 +1440,7 @@ path })}
|
|
|
1425
1440
|
entityId: id,
|
|
1426
1441
|
path,
|
|
1427
1442
|
|
|
1428
|
-
|
|
1443
|
+
sidePanelController,
|
|
1429
1444
|
navigation: urlController
|
|
1430
1445
|
})
|
|
1431
1446
|
}}
|
|
@@ -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 React, { useState, useCallback } from "react";
|
|
4
4
|
import { useAuthController, useLargeLayout, useTranslation, useSlot } from "@rebasepro/core";
|
|
5
5
|
import { CollectionActionsProps, EntityTableController, SelectionController } from "@rebasepro/types";
|
|
@@ -12,8 +12,8 @@ import { toArray } from "@rebasepro/utils";
|
|
|
12
12
|
import { useNavigate } from "react-router-dom";
|
|
13
13
|
import { useUrlController, useCMSContext } from "../../index";
|
|
14
14
|
|
|
15
|
-
export type
|
|
16
|
-
collection:
|
|
15
|
+
export type CollectionViewStartActionsProps<M extends Record<string, unknown>> = {
|
|
16
|
+
collection: CollectionConfig<M>;
|
|
17
17
|
path: string;
|
|
18
18
|
relativePath: string;
|
|
19
19
|
parentCollectionSlugs: string[], parentEntityIds: string[];
|
|
@@ -28,7 +28,7 @@ export type EntityCollectionViewStartActionsProps<M extends Record<string, unkno
|
|
|
28
28
|
openNewDocument: (defaultValues?: Record<string, unknown>) => void;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export function
|
|
31
|
+
export function CollectionViewStartActions<M extends Record<string, unknown>>({
|
|
32
32
|
collection,
|
|
33
33
|
relativePath,
|
|
34
34
|
parentCollectionSlugs, parentEntityIds,
|
|
@@ -39,7 +39,7 @@ export function EntityCollectionViewStartActions<M extends Record<string, unknow
|
|
|
39
39
|
resolvedProperties,
|
|
40
40
|
compact,
|
|
41
41
|
openNewDocument
|
|
42
|
-
}:
|
|
42
|
+
}: CollectionViewStartActionsProps<M>) {
|
|
43
43
|
|
|
44
44
|
const context = useCMSContext();
|
|
45
45
|
const largeLayout = useLargeLayout();
|