@rebasepro/admin 0.10.0 → 0.10.1-canary.0a881d4
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/dist/{CollectionEditorDialog-BOlKGGg7.js → CollectionEditorDialog-DMztwJ5S.js} +12 -12
- package/dist/CollectionEditorDialog-DMztwJ5S.js.map +1 -0
- package/dist/{PropertyEditView-i51tFOfM.js → PropertyEditView-CjFCnftn.js} +18 -18
- package/dist/PropertyEditView-CjFCnftn.js.map +1 -0
- package/dist/{RouterCollectionsStudioView-Dh4W53PU.js → RouterCollectionsStudioView-nDFQdKHA.js} +4 -4
- package/dist/RouterCollectionsStudioView-nDFQdKHA.js.map +1 -0
- package/dist/collection_editor/api/generateCollectionApi.d.ts +4 -4
- package/dist/collection_editor/pgColumnToProperty.d.ts +4 -3
- package/dist/collection_editor/serializable_types.d.ts +31 -30
- package/dist/collection_editor/serializable_utils.d.ts +6 -5
- package/dist/collection_editor/types/collection_editor_controller.d.ts +6 -5
- package/dist/collection_editor/types/collection_inference.d.ts +3 -2
- package/dist/collection_editor/types/config_controller.d.ts +8 -7
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -2
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +3 -2
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -2
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
- 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 +5 -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 +3 -2
- 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 +3 -2
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +4 -3
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +1 -1
- 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/ui/collection_editor/utils/supported_fields.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -1
- 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/AdminModeSyncer.d.ts +1 -1
- package/dist/components/ClearFilterSortButton.d.ts +1 -1
- package/dist/components/CollectionPanel.d.ts +2 -2
- package/dist/components/CollectionTableBinding/CollectionRowActions.d.ts +4 -4
- package/dist/components/CollectionTableBinding/CollectionTableBinding.d.ts +1 -1
- package/dist/components/CollectionTableBinding/CollectionTableBindingProps.d.ts +3 -2
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.d.ts +3 -3
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.d.ts +3 -3
- package/dist/components/CollectionTableBinding/fields/TableRelationField.d.ts +3 -3
- package/dist/components/CollectionTableBinding/internal/common.d.ts +2 -2
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.d.ts +2 -2
- package/dist/components/CollectionViewBinding/BoardCardBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/CollectionViewActions.d.ts +2 -3
- package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +2 -2
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +2 -3
- package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/FilterPresetsButton.d.ts +2 -1
- package/dist/components/CollectionViewBinding/SplitListView.d.ts +3 -3
- package/dist/components/CollectionViewBinding/ViewModeToggle.d.ts +1 -1
- package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.d.ts +3 -2
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.d.ts +3 -2
- package/dist/components/CollectionViewBinding/useBoardDataController.d.ts +2 -2
- package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +9 -6
- package/dist/components/CollectionViewBinding/useSelectionController.d.ts +2 -1
- package/dist/components/DeleteEntityDialog.d.ts +2 -2
- package/dist/components/DetailViewBinding.d.ts +3 -3
- package/dist/components/DrawerNavigationGroup.d.ts +1 -1
- package/dist/components/EditViewBinding.d.ts +3 -3
- package/dist/components/EntityPreviewBinding.d.ts +3 -3
- package/dist/components/EntityViewBinding.d.ts +2 -2
- package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +1 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +1 -1
- package/dist/components/PropertyConfigBadge.d.ts +1 -1
- package/dist/components/RebaseAdmin.d.ts +1 -1
- package/dist/components/RebaseLayout.d.ts +1 -1
- package/dist/components/ReferenceTable/SelectionTableBinding.d.ts +2 -2
- package/dist/components/SelectableTable/SelectableTable.d.ts +3 -2
- package/dist/components/SelectableTable/SelectionStore.d.ts +1 -1
- package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +2 -2
- package/dist/components/SidePanelBinding.d.ts +1 -1
- package/dist/components/admin/CreationResultDialog.d.ts +1 -1
- package/dist/components/common/default_entity_actions.d.ts +2 -1
- package/dist/components/field_configs.d.ts +3 -2
- package/dist/components/history/EntityHistoryEntry.d.ts +2 -2
- package/dist/components/history/EntityHistoryView.d.ts +1 -1
- package/dist/components/history/LastEditedByFormAction.d.ts +1 -1
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -2
- package/dist/contexts/BreacrumbsContext.d.ts +1 -1
- package/dist/contexts/SideDialogsControllerContext.d.ts +1 -1
- package/dist/contexts/SidePanelControllerContext.d.ts +1 -1
- package/dist/data_export/export/ExportCollectionAction.d.ts +4 -3
- package/dist/data_import/components/ImportSaveInProgress.d.ts +2 -2
- package/dist/data_import/import/ImportCollectionAction.d.ts +2 -1
- package/dist/data_import/utils/data.d.ts +2 -1
- package/dist/{export-BM6HPujv.js → export-CavEbZVF.js} +2 -2
- package/dist/export-CavEbZVF.js.map +1 -0
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/form_utils.d.ts +4 -3
- package/dist/{history-CtIPJxvQ.js → history-B1lIsrkX.js} +2 -2
- package/dist/history-B1lIsrkX.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +2 -2
- package/dist/hooks/navigation/contexts/NavigationStateContext.d.ts +1 -1
- package/dist/hooks/navigation/contexts/UrlContext.d.ts +1 -1
- package/dist/hooks/navigation/useBuildCollectionRegistryController.d.ts +2 -1
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +7 -5
- package/dist/hooks/navigation/useBuildUrlController.d.ts +1 -1
- package/dist/hooks/navigation/useNavigationResolution.d.ts +6 -5
- package/dist/hooks/navigation/useResolvedCollections.d.ts +8 -7
- package/dist/hooks/navigation/useResolvedViews.d.ts +4 -2
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +2 -2
- package/dist/hooks/navigation/utils.d.ts +5 -5
- package/dist/hooks/useBreadcrumbsController.d.ts +1 -1
- package/dist/hooks/useBuildSidePanel.d.ts +4 -4
- package/dist/hooks/useCMSContext.d.ts +4 -2
- package/dist/hooks/useResolvedNavigationFrom.d.ts +5 -4
- package/dist/hooks/useResolvedUsers.d.ts +8 -0
- package/dist/hooks/useSideDialogsController.d.ts +1 -1
- package/dist/hooks/useSidePanel.d.ts +1 -1
- package/dist/{import-DzQnT03v.js → import-36UcGe71.js} +2 -2
- package/dist/import-36UcGe71.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/preview/components/UrlComponentPreview.d.ts +1 -1
- package/dist/preview/components/UserPreview.d.ts +3 -2
- package/dist/preview/property_previews/StringPropertyPreview.d.ts +1 -1
- package/dist/preview/util.d.ts +1 -1
- package/dist/routes/CustomViewRoute.d.ts +1 -1
- 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 +1 -1
- package/dist/util/entity_actions.d.ts +1 -1
- package/dist/util/navigation_utils.d.ts +3 -3
- package/dist/util/previews.d.ts +22 -4
- package/dist/util/property_utils.d.ts +3 -2
- package/dist/util/resolutions.d.ts +1 -1
- package/dist/util/view_mode.d.ts +3 -3
- package/dist/{util-XFwQ9FEc.js → util-CPgUM4M8.js} +353 -221
- package/dist/util-CPgUM4M8.js.map +1 -0
- package/package.json +11 -9
- package/src/collection_editor/ConfigControllerProvider.tsx +11 -12
- package/src/collection_editor/api/generateCollectionApi.ts +4 -4
- package/src/collection_editor/pgColumnToProperty.ts +4 -3
- package/src/collection_editor/serializable_types.ts +36 -34
- package/src/collection_editor/serializable_utils.ts +17 -32
- package/src/collection_editor/types/collection_editor_controller.tsx +6 -5
- package/src/collection_editor/types/collection_inference.ts +3 -2
- package/src/collection_editor/types/config_controller.tsx +8 -7
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +3 -2
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +3 -2
- package/src/collection_editor/ui/EditorCollectionAction.tsx +3 -2
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +3 -2
- package/src/collection_editor/ui/EditorEntityAction.tsx +3 -2
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +1 -1
- package/src/collection_editor/ui/KanbanSetupAction.tsx +3 -2
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +1 -1
- package/src/collection_editor/ui/NewCollectionCard.tsx +1 -1
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +6 -5
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +5 -7
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +28 -38
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +5 -4
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +6 -5
- package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +3 -3
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +3 -3
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +4 -4
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +10 -8
- package/src/collection_editor/useJsonCollectionsConfigController.tsx +10 -9
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +5 -5
- package/src/collection_editor/validateCollectionJson.ts +4 -5
- package/src/components/AdminModeSyncer.tsx +1 -1
- package/src/components/ClearFilterSortButton.tsx +1 -1
- package/src/components/CollectionPanel.tsx +5 -4
- package/src/components/CollectionTableBinding/CollectionRowActions.tsx +6 -6
- package/src/components/CollectionTableBinding/CollectionTableBinding.tsx +5 -4
- package/src/components/CollectionTableBinding/CollectionTableBindingProps.tsx +3 -2
- package/src/components/CollectionTableBinding/PropertyTableCell.tsx +5 -5
- package/src/components/CollectionTableBinding/fields/TableMultipleRelationField.tsx +4 -3
- package/src/components/CollectionTableBinding/fields/TableReferenceField.tsx +5 -4
- package/src/components/CollectionTableBinding/fields/TableRelationField.tsx +4 -3
- package/src/components/CollectionTableBinding/internal/common.tsx +8 -7
- package/src/components/CollectionTableBinding/internal/popup_field/PopupFormField.tsx +5 -4
- package/src/components/CollectionTableBinding/table_bindings.tsx +7 -7
- package/src/components/CollectionViewBinding/BoardCardBinding.tsx +6 -5
- package/src/components/CollectionViewBinding/CollectionBoardViewBinding.tsx +5 -6
- package/src/components/CollectionViewBinding/CollectionCardViewBinding.tsx +4 -3
- package/src/components/CollectionViewBinding/CollectionListViewBinding.tsx +10 -13
- package/src/components/CollectionViewBinding/CollectionViewActions.tsx +3 -3
- package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +17 -16
- package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +3 -3
- package/src/components/CollectionViewBinding/EntityCardBinding.tsx +6 -5
- package/src/components/CollectionViewBinding/FilterPresetsButton.tsx +2 -1
- package/src/components/CollectionViewBinding/FiltersDialog.tsx +2 -2
- package/src/components/CollectionViewBinding/SplitListView.tsx +6 -5
- package/src/components/CollectionViewBinding/ViewModeToggle.tsx +1 -1
- package/src/components/CollectionViewBinding/hooks/useCollectionInlineEditor.ts +3 -2
- package/src/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.ts +3 -2
- package/src/components/CollectionViewBinding/useBoardDataController.tsx +3 -2
- package/src/components/CollectionViewBinding/usePreviewSlots.ts +57 -25
- package/src/components/CollectionViewBinding/useSelectionController.tsx +2 -1
- package/src/components/DefaultDrawer.tsx +2 -2
- package/src/components/DeleteEntityDialog.tsx +3 -2
- package/src/components/DetailViewBinding.tsx +23 -18
- package/src/components/DrawerNavigationGroup.tsx +1 -1
- package/src/components/EditFormActions.tsx +5 -5
- package/src/components/EditViewBinding.tsx +11 -15
- package/src/components/EntityPreviewBinding.tsx +7 -6
- package/src/components/EntityViewBinding.tsx +3 -3
- package/src/components/HomePage/ContentHomePage.tsx +2 -2
- package/src/components/HomePage/FavouritesView.tsx +1 -1
- package/src/components/HomePage/HomePageDnD.tsx +1 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +2 -2
- package/src/components/PropertyConfigBadge.tsx +2 -1
- package/src/components/RebaseAdmin.tsx +1 -1
- package/src/components/RebaseAuthGate.tsx +1 -1
- package/src/components/RebaseLayout.tsx +1 -1
- package/src/components/RebaseNavigation.tsx +4 -3
- package/src/components/ReferenceTable/SelectionTableBinding.tsx +6 -5
- package/src/components/ReferenceWidget.tsx +3 -2
- package/src/components/SelectableTable/SelectableTable.tsx +3 -3
- package/src/components/SelectableTable/SelectionStore.ts +1 -1
- package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +9 -6
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +3 -2
- package/src/components/SideDialogs.tsx +2 -2
- package/src/components/SidePanelBinding.tsx +5 -5
- package/src/components/SidePanelProvider.tsx +1 -1
- package/src/components/admin/CreationResultDialog.tsx +1 -1
- package/src/components/common/default_entity_actions.tsx +3 -2
- package/src/components/field_configs.tsx +30 -29
- package/src/components/history/EntityHistoryEntry.tsx +3 -2
- package/src/components/history/EntityHistoryView.tsx +1 -1
- package/src/components/history/LastEditedByFormAction.tsx +1 -1
- package/src/components/history/LastEditedByIndicator.tsx +3 -2
- package/src/contexts/BreacrumbsContext.tsx +1 -1
- package/src/contexts/SideDialogsControllerContext.tsx +1 -1
- package/src/contexts/SidePanelControllerContext.tsx +1 -1
- package/src/data_export/export/ExportCollectionAction.tsx +5 -4
- package/src/data_import/components/ImportSaveInProgress.tsx +4 -3
- package/src/data_import/import/ImportCollectionAction.tsx +3 -2
- package/src/data_import/utils/data.ts +3 -2
- package/src/form/EntityForm.tsx +19 -10
- package/src/form/EntityFormActions.tsx +3 -3
- package/src/form/EntityFormBinding.tsx +6 -4
- package/src/form/PropertyFieldBinding.tsx +15 -12
- package/src/form/components/FieldHelperText.tsx +1 -1
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +5 -4
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +7 -6
- package/src/form/field_bindings/BlockFieldBinding.tsx +4 -4
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MapFieldBinding.tsx +7 -7
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +4 -3
- package/src/form/field_bindings/RelationFieldBinding.tsx +2 -2
- package/src/form/field_bindings/RepeatFieldBinding.tsx +5 -5
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +2 -2
- package/src/form/field_bindings/SwitchFieldBinding.tsx +1 -1
- package/src/form/field_bindings/TextFieldBinding.tsx +8 -8
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +1 -1
- package/src/form/form_utils.ts +5 -3
- package/src/form/useClearRestoreValue.tsx +1 -1
- package/src/form/validation.ts +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +3 -2
- package/src/hooks/navigation/contexts/NavigationStateContext.tsx +1 -1
- package/src/hooks/navigation/contexts/UrlContext.tsx +1 -1
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +19 -15
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +8 -6
- package/src/hooks/navigation/useBuildUrlController.tsx +2 -2
- package/src/hooks/navigation/useNavigationResolution.ts +15 -21
- package/src/hooks/navigation/useResolvedCollections.ts +10 -9
- package/src/hooks/navigation/useResolvedViews.tsx +4 -2
- package/src/hooks/navigation/useTopLevelNavigation.ts +3 -2
- package/src/hooks/navigation/utils.ts +6 -5
- package/src/hooks/useBreadcrumbsController.tsx +1 -1
- package/src/hooks/useBuildSidePanel.tsx +9 -12
- package/src/hooks/useCMSContext.tsx +8 -4
- package/src/hooks/useResolvedNavigationFrom.tsx +7 -5
- package/src/hooks/useResolvedUsers.ts +143 -0
- package/src/hooks/useSelectionDialog.tsx +3 -2
- package/src/hooks/useSideDialogsController.tsx +1 -1
- package/src/hooks/useSidePanel.tsx +1 -1
- package/src/index.ts +2 -1
- package/src/preview/PropertyPreview.tsx +11 -11
- package/src/preview/components/ReferencePreview.tsx +6 -5
- package/src/preview/components/RelationPreview.tsx +6 -5
- package/src/preview/components/UrlComponentPreview.tsx +1 -1
- package/src/preview/components/UserPreview.tsx +13 -4
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +1 -1
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +2 -2
- package/src/preview/property_previews/StringPropertyPreview.tsx +19 -13
- package/src/preview/util.ts +1 -1
- package/src/routes/CustomViewRoute.tsx +1 -1
- package/src/routes/RebaseRoute.tsx +7 -5
- package/src/types/components/EntityFormActionsProps.tsx +3 -2
- package/src/types/components/EntityFormProps.tsx +4 -3
- package/src/types/fields.tsx +3 -2
- package/src/util/dataControllerAdapter.ts +2 -1
- package/src/util/entity_actions.ts +1 -1
- package/src/util/navigation_utils.ts +4 -13
- package/src/util/previews.ts +43 -53
- package/src/util/propertyConfigMapper.ts +7 -7
- package/src/util/property_utils.tsx +5 -4
- package/src/util/resolutions.ts +1 -1
- package/src/util/view_mode.ts +4 -3
- package/dist/CollectionEditorDialog-BOlKGGg7.js.map +0 -1
- package/dist/PropertyEditView-i51tFOfM.js.map +0 -1
- package/dist/RouterCollectionsStudioView-Dh4W53PU.js.map +0 -1
- package/dist/export-BM6HPujv.js.map +0 -1
- package/dist/history-CtIPJxvQ.js.map +0 -1
- package/dist/import-DzQnT03v.js.map +0 -1
- package/dist/util-XFwQ9FEc.js.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import type { FormContext } from "../types/fields";
|
|
4
|
-
import type { EntityAction, EntityActionClickProps, SidePanelController } from "@rebasepro/types";
|
|
4
|
+
import type { EntityAction, EntityActionClickProps, SidePanelController, AdminCollection } from "@rebasepro/admin-types";
|
|
5
5
|
import React, { useMemo } from "react";
|
|
6
|
-
import { Entity, getCollectionDataPath
|
|
6
|
+
import { Entity, getCollectionDataPath } from "@rebasepro/types";
|
|
7
|
+
import { RebaseContext } from "@rebasepro/admin-types";
|
|
7
8
|
import type { EntityFormActionsProps } from "../types/components/EntityFormActionsProps";
|
|
8
9
|
import { copyEntityAction, deleteEntityAction } from "./common/default_entity_actions";
|
|
9
10
|
import { mergeEntityActions } from "../util/entity_actions";
|
|
@@ -116,7 +117,7 @@ type ActionsViewProps<M extends Record<string, unknown>> = {
|
|
|
116
117
|
savingError: Error | undefined,
|
|
117
118
|
entity: Entity<M> | undefined,
|
|
118
119
|
formActions: EntityAction[],
|
|
119
|
-
collection:
|
|
120
|
+
collection: AdminCollection,
|
|
120
121
|
context: RebaseContext,
|
|
121
122
|
sidePanelController: SidePanelController,
|
|
122
123
|
disabled: boolean,
|
|
@@ -164,7 +165,6 @@ function buildBottomActions<M extends Record<string, unknown>>({
|
|
|
164
165
|
{formActions.length > 0 && <div className="grow flex overflow-auto no-scrollbar">
|
|
165
166
|
{formActions.map((action, index) => {
|
|
166
167
|
|
|
167
|
-
|
|
168
168
|
const props = {
|
|
169
169
|
view: "form",
|
|
170
170
|
entity,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { ComponentRef
|
|
1
|
+
import type { ComponentRef } from "@rebasepro/types";
|
|
2
|
+
import type { EntityCustomViewParams, FormViewConfig, AdminCollection } from "@rebasepro/admin-types";
|
|
2
3
|
import type { FormContext } from "../types/fields";
|
|
3
|
-
import type { PluginFormActionProps } from "@rebasepro/types";
|
|
4
|
+
import type { PluginFormActionProps } from "@rebasepro/admin-types";
|
|
4
5
|
import React, { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
6
|
import { Entity, EntityStatus, getCollectionDataPath } from "@rebasepro/types";
|
|
6
|
-
import { PluginProviderStack, resolveComponentRef, useComponentOverride, CollectionScopeProvider } from "@rebasepro/app";
|
|
7
|
+
import { PluginProviderStack, resolveComponentRef, useComponentOverride, CollectionScopeProvider, getAdminSubcollections } from "@rebasepro/app";
|
|
7
8
|
|
|
8
9
|
import { CollectionViewBinding } from "./CollectionViewBinding/CollectionViewBinding";
|
|
9
10
|
import { EntityViewBinding } from "./EntityViewBinding";
|
|
@@ -25,11 +26,8 @@ import {
|
|
|
25
26
|
} from "@rebasepro/ui";
|
|
26
27
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
27
28
|
import { ErrorView } from "@rebasepro/app";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
removeInitialAndTrailingSlashes,
|
|
31
|
-
resolveDefaultSelectedView
|
|
32
|
-
} from "@rebasepro/common";
|
|
29
|
+
|
|
30
|
+
import { removeInitialAndTrailingSlashes, resolveDefaultSelectedView } from "@rebasepro/app";
|
|
33
31
|
import { resolvedSelectedEntityView } from "../util/resolutions";
|
|
34
32
|
import {
|
|
35
33
|
useCustomizationController,
|
|
@@ -66,7 +64,7 @@ export type OnTabChangeParams<M extends Record<string, unknown>> = {
|
|
|
66
64
|
path: string;
|
|
67
65
|
entityId?: string | number;
|
|
68
66
|
selectedTab?: string;
|
|
69
|
-
collection:
|
|
67
|
+
collection: AdminCollection<M>;
|
|
70
68
|
|
|
71
69
|
};
|
|
72
70
|
|
|
@@ -75,7 +73,7 @@ export interface EditViewBindingProps<M extends Record<string, unknown> = Record
|
|
|
75
73
|
* The CMS path of the entity, e.g. "users" or "products".
|
|
76
74
|
*/
|
|
77
75
|
path: string;
|
|
78
|
-
collection:
|
|
76
|
+
collection: AdminCollection<M>;
|
|
79
77
|
entityId?: string | number;
|
|
80
78
|
databaseId?: string;
|
|
81
79
|
copy?: boolean;
|
|
@@ -260,7 +258,7 @@ parentEntityIds,
|
|
|
260
258
|
}
|
|
261
259
|
}, [selectedTabProp, defaultSelectedView]);
|
|
262
260
|
|
|
263
|
-
const subcollections =
|
|
261
|
+
const subcollections = getAdminSubcollections(collection).filter(c => !c.hideFromNavigation);
|
|
264
262
|
const subcollectionsCount = subcollections?.length ?? 0;
|
|
265
263
|
const customViews = collection.entityViews ?? [];
|
|
266
264
|
const customViewsCount = customViews?.length ?? 0;
|
|
@@ -460,7 +458,7 @@ parentEntityIds,
|
|
|
460
458
|
}, [status, onTabChange, path, entityId, collection]);
|
|
461
459
|
|
|
462
460
|
// Resolve formView.Builder if provided
|
|
463
|
-
const formViewConfig = (collection as
|
|
461
|
+
const formViewConfig = (collection as AdminCollection<M> & { formView?: FormViewConfig<M> }).formView;
|
|
464
462
|
const FormViewBuilder = formViewConfig?.Builder ? resolveComponentRef<EntityCustomViewParams>(formViewConfig.Builder as ComponentRef<EntityCustomViewParams>) : null;
|
|
465
463
|
const formViewIncludeActions = formViewConfig?.includeActions !== false;
|
|
466
464
|
|
|
@@ -619,7 +617,6 @@ parentEntityIds,
|
|
|
619
617
|
</Tooltip>
|
|
620
618
|
) : null;
|
|
621
619
|
|
|
622
|
-
|
|
623
620
|
let result = <div className="relative flex flex-col h-full w-full bg-white dark:bg-surface-800">
|
|
624
621
|
|
|
625
622
|
{shouldShowTopBar && <div
|
|
@@ -634,7 +631,6 @@ parentEntityIds,
|
|
|
634
631
|
status
|
|
635
632
|
})}
|
|
636
633
|
|
|
637
|
-
|
|
638
634
|
{pluginActionsTop}
|
|
639
635
|
|
|
640
636
|
{hasAdditionalViews && <div className={"flex-1 flex justify-end min-w-0 shrink-0"}>
|
|
@@ -716,7 +712,7 @@ parentEntityIds,
|
|
|
716
712
|
return result;
|
|
717
713
|
}
|
|
718
714
|
|
|
719
|
-
function EntityFormSkeleton({ collection }: { collection:
|
|
715
|
+
function EntityFormSkeleton({ collection }: { collection: AdminCollection }) {
|
|
720
716
|
return (
|
|
721
717
|
<div className="flex-1 flex flex-row w-full overflow-y-auto justify-center">
|
|
722
718
|
<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,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import type { Property } from "@rebasepro/types";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { useEffect, useMemo } from "react";
|
|
5
5
|
|
|
6
6
|
import { Entity } from "@rebasepro/types";
|
|
7
7
|
import type { PreviewSize } from "../types/components/PropertyPreviewProps";
|
|
8
|
-
import { getEntityImagePreviewPropertyKey } from "@rebasepro/
|
|
8
|
+
import { getEntityImagePreviewPropertyKey } from "@rebasepro/app";
|
|
9
9
|
import {
|
|
10
10
|
ArrowRightToLineIcon,
|
|
11
11
|
cls,
|
|
@@ -25,15 +25,16 @@ import {
|
|
|
25
25
|
import { useAnalyticsController } from "@rebasepro/app";
|
|
26
26
|
import { IconForView } from "@rebasepro/app";
|
|
27
27
|
import { getPropertyInPath } from "../util/property_utils";
|
|
28
|
-
import { getEntityPreviewKeys,
|
|
28
|
+
import { getEntityPreviewKeys, getEntityTitlePropertyKeyForEntity } from "../util/previews";
|
|
29
29
|
import { getValueInPath } from "@rebasepro/utils";
|
|
30
30
|
import { useCollectionRegistryController } from "../hooks/navigation/contexts/CollectionRegistryContext";
|
|
31
31
|
import { useSidePanel } from "../hooks/useSidePanel";
|
|
32
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
32
33
|
|
|
33
34
|
export type EntityPreviewBindingProps = {
|
|
34
35
|
size?: PreviewSize,
|
|
35
36
|
actions?: React.ReactNode,
|
|
36
|
-
collection?:
|
|
37
|
+
collection?: AdminCollection,
|
|
37
38
|
hover?: boolean;
|
|
38
39
|
previewKeys?: string[],
|
|
39
40
|
disabled?: boolean,
|
|
@@ -49,7 +50,7 @@ export type EntityPreviewBindingProps = {
|
|
|
49
50
|
export type EntityPreviewBindingDataProps = {
|
|
50
51
|
size?: "smallest" | "small" | "medium" | "large",
|
|
51
52
|
actions?: React.ReactNode,
|
|
52
|
-
collection?:
|
|
53
|
+
collection?: AdminCollection,
|
|
53
54
|
previewKeys?: string[],
|
|
54
55
|
entity: Entity<any>,
|
|
55
56
|
onSidePanelClick?: (entity: Entity) => void,
|
|
@@ -98,7 +99,7 @@ export function EntityPreviewBindingData({
|
|
|
98
99
|
);
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
const titleProperty = includeTitle ?
|
|
102
|
+
const titleProperty = includeTitle ? getEntityTitlePropertyKeyForEntity(collection, entity.values, entity.id) : undefined;
|
|
102
103
|
const imagePropertyKey = includeImage ? getEntityImagePreviewPropertyKey(collection) : undefined;
|
|
103
104
|
const imageProperty = imagePropertyKey ? collection.properties[imagePropertyKey] : undefined;
|
|
104
105
|
const ofProp = imageProperty && "of" in imageProperty ? imageProperty.of : undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Properties } from "@rebasepro/types";
|
|
2
|
-
|
|
3
|
-
import type { CustomizationController } from "@rebasepro/types";
|
|
2
|
+
|
|
3
|
+
import type { CustomizationController, AdminCollection } from "@rebasepro/admin-types";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { Entity } from "@rebasepro/types";
|
|
6
6
|
import { cls, defaultBorderMixin, ExternalLinkIcon, IconButton, Typography } from "@rebasepro/ui";
|
|
@@ -14,7 +14,7 @@ import { PropertyCollectionView } from "./PropertyCollectionView";
|
|
|
14
14
|
*/
|
|
15
15
|
export interface EntityViewBindingProps<M extends Record<string, unknown>> {
|
|
16
16
|
entity: Entity<M>;
|
|
17
|
-
collection:
|
|
17
|
+
collection: AdminCollection<M>;
|
|
18
18
|
path: string;
|
|
19
19
|
className?: string;
|
|
20
20
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { HomePageSection, NavigationEntry, NavigationGroupMapping, PluginGenericProps } from "@rebasepro/types";
|
|
1
|
+
import type { HomePageSection, NavigationEntry, NavigationGroupMapping, PluginGenericProps } from "@rebasepro/admin-types";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import Fuse from "fuse.js";
|
|
4
4
|
import { Container, SearchBar } from "@rebasepro/ui";
|
|
5
|
-
import { AnalyticsEvent } from "@rebasepro/types";
|
|
5
|
+
import { AnalyticsEvent } from "@rebasepro/admin-types";
|
|
6
6
|
import { FavouritesView } from "./FavouritesView";
|
|
7
7
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
8
8
|
import { NavigationGroup } from "./NavigationGroup";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import type { NavigationEntry, AdminCollection } from "@rebasepro/admin-types";
|
|
2
3
|
import { useNavigate } from "react-router-dom";
|
|
3
4
|
;
|
|
4
5
|
import { IconButton, StarIcon, Tooltip } from "@rebasepro/ui";
|
|
@@ -81,7 +82,6 @@ export function NavigationCardBinding({
|
|
|
81
82
|
context
|
|
82
83
|
});
|
|
83
84
|
|
|
84
|
-
|
|
85
85
|
const actions: React.ReactNode | undefined = <>
|
|
86
86
|
{actionsArray}
|
|
87
87
|
{pluginCardActions}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Property } from "@rebasepro/types";
|
|
2
|
+
import type { PropertyConfig } from "@rebasepro/admin-types";
|
|
2
3
|
import { getDefaultFieldConfig } from "./field_configs";
|
|
3
4
|
import { getIconForWidget } from "../util/property_utils";
|
|
4
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useLayoutEffect } from "react";
|
|
2
2
|
import { useRebaseRegistryDispatch } from "@rebasepro/app";
|
|
3
|
-
import type { RebaseAdminConfig } from "@rebasepro/types";
|
|
3
|
+
import type { RebaseAdminConfig } from "@rebasepro/admin-types";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Declarative component to configure the CMS in Rebase.
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "@rebasepro/app";
|
|
6
6
|
import { CircularProgressCenter } from "@rebasepro/ui";
|
|
7
7
|
import { LoginView } from "@rebasepro/app";
|
|
8
|
-
import type { AuthControllerExtended } from "@rebasepro/types";
|
|
8
|
+
import type { AuthControllerExtended } from "@rebasepro/admin-types";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Auth gate component that handles the authentication flow.
|
|
@@ -10,7 +10,7 @@ import { Scaffold } from "./app/Scaffold";
|
|
|
10
10
|
import { Drawer } from "./app/Drawer";
|
|
11
11
|
import { SideDialogs } from "./SideDialogs";
|
|
12
12
|
import { AdminModeSyncer } from "./AdminModeSyncer";
|
|
13
|
-
import type { AppView } from "@rebasepro/types";
|
|
13
|
+
import type { AppView } from "@rebasepro/admin-types";
|
|
14
14
|
|
|
15
15
|
export interface RebaseLayoutProps {
|
|
16
16
|
/** Title shown in the drawer. */
|
|
@@ -17,12 +17,13 @@ import {
|
|
|
17
17
|
} from "@rebasepro/app";
|
|
18
18
|
import { buildRoutedRebaseData, resolveDataSource } from "@rebasepro/common";
|
|
19
19
|
import { CircularProgressCenter } from "@rebasepro/ui";
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
import type { AppView, CollectionEditorOptions, EntityCustomView, EntityAction, RebasePlugin, AdminCollection } from "@rebasepro/admin-types";
|
|
21
22
|
import type { CollectionRegistryController } from "@rebasepro/types";
|
|
22
|
-
import type { UrlController, NavigationStateController } from "@rebasepro/types";
|
|
23
|
+
import type { UrlController, NavigationStateController } from "@rebasepro/admin-types";
|
|
23
24
|
|
|
24
25
|
const EMPTY_PLUGINS: RebasePlugin[] = [];
|
|
25
|
-
const EMPTY_COLLECTIONS:
|
|
26
|
+
const EMPTY_COLLECTIONS: AdminCollection[] = [];
|
|
26
27
|
|
|
27
28
|
import { useBuildNavigationStateController } from "../hooks/navigation/useBuildNavigationStateController";
|
|
28
29
|
import { useBuildUrlController } from "../hooks/navigation/useBuildUrlController";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import React, { MouseEventHandler, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Entity, FilterValues } from "@rebasepro/types";
|
|
4
|
+
import { CollectionSize, AdminCollection } from "@rebasepro/admin-types";
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
CollectionRowActions,
|
|
@@ -39,7 +40,7 @@ export interface SelectionProps<M extends Record<string, unknown>> {
|
|
|
39
40
|
/**
|
|
40
41
|
* Entity collection config
|
|
41
42
|
*/
|
|
42
|
-
collection?:
|
|
43
|
+
collection?: AdminCollection<M>;
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
46
|
* Absolute path of the collection.
|
|
@@ -113,7 +114,7 @@ function SelectionTableBindingInternal<M extends Record<string, unknown>>(
|
|
|
113
114
|
description,
|
|
114
115
|
fixedFilter,
|
|
115
116
|
maxSelection
|
|
116
|
-
}: SelectionProps<M> & { collection:
|
|
117
|
+
}: SelectionProps<M> & { collection: AdminCollection<M> }) {
|
|
117
118
|
|
|
118
119
|
const sideDialogContext = useSideDialogContext();
|
|
119
120
|
const sidePanelController = useSidePanel();
|
|
@@ -331,7 +332,7 @@ function EntitySelectionDialogActions({
|
|
|
331
332
|
onClear,
|
|
332
333
|
onNewClick
|
|
333
334
|
}: {
|
|
334
|
-
collection:
|
|
335
|
+
collection: AdminCollection<any>,
|
|
335
336
|
path: string,
|
|
336
337
|
onClear: () => void,
|
|
337
338
|
onNewClick: () => void
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSelectionDialog } from "../hooks/useSelectionDialog";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import React, { useCallback, useMemo } from "react";
|
|
4
4
|
|
|
5
5
|
import { Entity, EntityReference, FilterValues } from "@rebasepro/types";
|
|
@@ -8,6 +8,7 @@ import { getReferenceFrom } from "@rebasepro/common";
|
|
|
8
8
|
import { ReferencePreview } from "../preview";
|
|
9
9
|
import { Button, cls } from "@rebasepro/ui";
|
|
10
10
|
import { useCollectionRegistryController } from "../hooks/navigation/contexts/CollectionRegistryContext";
|
|
11
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
11
12
|
|
|
12
13
|
export type ReferenceWidgetProps<M extends Record<string, unknown>> = {
|
|
13
14
|
name?: string,
|
|
@@ -55,7 +56,7 @@ export function ReferenceWidget<M extends Record<string, unknown>>({
|
|
|
55
56
|
|
|
56
57
|
const collectionRegistryController = useCollectionRegistryController();
|
|
57
58
|
|
|
58
|
-
const collection:
|
|
59
|
+
const collection: AdminCollection | undefined = useMemo(() => {
|
|
59
60
|
return collectionRegistryController.getCollection(path);
|
|
60
61
|
}, [path, collectionRegistryController.getCollection]);
|
|
61
62
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createSelectionStore, AdminSelectedCell } from "./SelectionStore";
|
|
2
2
|
import type { Property, WhereFilterOp } from "@rebasepro/types";
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { Entity, FilterValues } from "@rebasepro/types";
|
|
5
|
+
import { CollectionSize, EntityTableController, SelectedCellProps, AdminCollection } from "@rebasepro/admin-types";
|
|
5
6
|
import { CellRendererParams, TableView, VirtualTableColumn, VirtualTableFilterValues, OnRowClickParams } from "@rebasepro/ui";
|
|
6
7
|
import { DEFAULT_PAGE_SIZE, DataCollectionTableController, OnCellValueChange, OnColumnResizeParams } from "@rebasepro/app";
|
|
7
8
|
import { FilterFormFieldProps } from "@rebasepro/ui";
|
|
@@ -109,7 +110,7 @@ export type SelectableTableProps<M extends Record<string, unknown>> = {
|
|
|
109
110
|
* a custom view. If you just need to create a default view you can do it
|
|
110
111
|
* exclusively with config options.
|
|
111
112
|
*
|
|
112
|
-
* If you want to bind a {@link
|
|
113
|
+
* If you want to bind a {@link AdminCollection} to a table with the default
|
|
113
114
|
* options you see in collections in the top level navigation, you can
|
|
114
115
|
* check {@link CollectionViewBinding}.
|
|
115
116
|
*
|
|
@@ -306,4 +307,3 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
|
|
|
306
307
|
|
|
307
308
|
};
|
|
308
309
|
|
|
309
|
-
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React, { Suspense } from "react";
|
|
2
2
|
import {
|
|
3
3
|
ArrayProperty,
|
|
4
|
-
FilterFieldBindingProps,
|
|
5
4
|
Property,
|
|
6
5
|
ReferenceProperty,
|
|
7
6
|
RelationProperty,
|
|
8
7
|
WhereFilterOp
|
|
9
8
|
} from "@rebasepro/types";
|
|
10
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
FilterFieldBindingProps
|
|
11
|
+
} from "@rebasepro/admin-types";
|
|
12
|
+
import { enumToObjectEntries } from "@rebasepro/common";
|
|
13
|
+
import { resolveFilterOperators } from "@rebasepro/app";
|
|
11
14
|
import { useCollectionScope, useComponentOverride, useResolvedComponent } from "@rebasepro/app";
|
|
12
15
|
import { StringNumberFilterField } from "./StringNumberFilterField";
|
|
13
16
|
import { BooleanFilterField } from "./BooleanFilterField";
|
|
@@ -40,14 +43,14 @@ export interface FilterFieldBindingInput {
|
|
|
40
43
|
* Filters dialog.
|
|
41
44
|
*
|
|
42
45
|
* Resolution order:
|
|
43
|
-
* 1. `property.
|
|
46
|
+
* 1. `property.admin.Filter` — per-property replacement (rendered even when the
|
|
44
47
|
* resolved operator list is empty; the component owns filterability).
|
|
45
48
|
* 2. `components["Collection.FilterField"]` — collection-level or app-level
|
|
46
49
|
* override (wrap mode supported via `OriginalComponent`).
|
|
47
50
|
* 3. Built-in field dispatched by property type.
|
|
48
51
|
*
|
|
49
52
|
* The operators handed to the field are the intersection of the engine's
|
|
50
|
-
* capabilities, the property-type defaults, and `property.
|
|
53
|
+
* capabilities, the property-type defaults, and `property.admin.filterOperators`
|
|
51
54
|
* (see `resolveFilterOperators`). When that intersection is empty and no
|
|
52
55
|
* per-property `Filter` is set, nothing is rendered.
|
|
53
56
|
*
|
|
@@ -72,7 +75,7 @@ export function FilterFieldBinding({
|
|
|
72
75
|
// Hooks must run unconditionally — before any early return.
|
|
73
76
|
const scopeCollection = useCollectionScope();
|
|
74
77
|
const ResolvedFilterField = useComponentOverride<FilterFieldBindingProps>("Collection.FilterField", DefaultFilterField);
|
|
75
|
-
const PropertyFilter = useResolvedComponent<FilterFieldBindingProps>(baseProperty?.
|
|
78
|
+
const PropertyFilter = useResolvedComponent<FilterFieldBindingProps>(baseProperty?.admin?.Filter);
|
|
76
79
|
|
|
77
80
|
if (!baseProperty) return null;
|
|
78
81
|
|
|
@@ -136,7 +139,7 @@ function DefaultFilterField({
|
|
|
136
139
|
path={referenceProperty.path}
|
|
137
140
|
title={title}
|
|
138
141
|
includeId={referenceProperty.includeId}
|
|
139
|
-
previewProperties={referenceProperty.
|
|
142
|
+
previewProperties={referenceProperty.admin?.previewProperties}
|
|
140
143
|
hidden={hidden ?? false}
|
|
141
144
|
setHidden={setHidden ?? (() => undefined)}/>;
|
|
142
145
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSelectionDialog } from "../../../hooks/useSelectionDialog";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import React, { useMemo, useState } from "react";
|
|
4
4
|
import { VirtualTableWhereFilterOp } from "@rebasepro/ui";
|
|
5
5
|
import { Entity, EntityReference } from "@rebasepro/types";
|
|
@@ -8,6 +8,7 @@ import { Button, Checkbox, Label, Select, SelectItem } from "@rebasepro/ui";
|
|
|
8
8
|
import { getReferenceFrom } from "@rebasepro/common";
|
|
9
9
|
import { useTranslation } from "@rebasepro/app";
|
|
10
10
|
import { useCollectionRegistryController } from "../../../hooks/navigation/contexts/CollectionRegistryContext";
|
|
11
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
11
12
|
|
|
12
13
|
interface ReferenceFilterFieldProps {
|
|
13
14
|
name: string,
|
|
@@ -111,7 +112,7 @@ export function ReferenceFilterField({
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
const collectionRegistryController = useCollectionRegistryController();
|
|
114
|
-
const collection:
|
|
115
|
+
const collection: AdminCollection | undefined = useMemo(() => {
|
|
115
116
|
return path ? collectionRegistryController.getCollection(path) : undefined;
|
|
116
117
|
}, [path]);
|
|
117
118
|
|
|
@@ -4,7 +4,7 @@ import { useSideDialogsController } from "../hooks";
|
|
|
4
4
|
import { Sheet, Dialog } from "@rebasepro/ui";
|
|
5
5
|
import { useUnsavedChangesDialog, UnsavedChangesDialog } from "@rebasepro/app";
|
|
6
6
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
7
|
-
import type { SidePanelBindingProps } from "@rebasepro/types";
|
|
7
|
+
import type { SidePanelBindingProps } from "@rebasepro/admin-types";
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
export type SideDialogController = {
|
|
@@ -164,7 +164,7 @@ function SideDialogView({
|
|
|
164
164
|
scrollable={false}
|
|
165
165
|
>
|
|
166
166
|
{panel && (
|
|
167
|
-
<div className="flex flex-col h-[75vh] min-h-[500px] min-w-
|
|
167
|
+
<div className="flex flex-col h-[75vh] min-h-[500px] w-full min-w-0 max-w-full overflow-hidden">
|
|
168
168
|
<ErrorBoundary>
|
|
169
169
|
{panel.component}
|
|
170
170
|
</ErrorBoundary>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import type { SidePanelBindingProps } from "@rebasepro/types";
|
|
1
|
+
|
|
2
|
+
import type { SidePanelBindingProps, AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
|
|
5
5
|
import type { OnUpdateParams } from "../types/components/EntityFormProps";
|
|
@@ -13,7 +13,7 @@ import { saveEntityToMemoryCache, useComponentOverride } from "@rebasepro/app";
|
|
|
13
13
|
import { useCollectionRegistryController } from "../hooks/navigation/contexts/CollectionRegistryContext";
|
|
14
14
|
import { useSidePanel } from "../hooks/useSidePanel";
|
|
15
15
|
import { useUrlController } from "../hooks/navigation/contexts/UrlContext";
|
|
16
|
-
import { resolveDefaultSelectedView } from "@rebasepro/
|
|
16
|
+
import { resolveDefaultSelectedView } from "@rebasepro/app";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* This is the component in charge of rendering the side dialog used
|
|
@@ -188,7 +188,7 @@ entityId }
|
|
|
188
188
|
? <ResolvedDetailView
|
|
189
189
|
path={path}
|
|
190
190
|
layout={collection?.openEntityMode === "dialog" ? "dialog" : "side_panel"}
|
|
191
|
-
collection={collection as
|
|
191
|
+
collection={collection as AdminCollection}
|
|
192
192
|
entityId={entityId!}
|
|
193
193
|
parentCollectionSlugs={parentCollectionSlugs}
|
|
194
194
|
parentEntityIds={parentEntityIds}
|
|
@@ -237,7 +237,7 @@ entityId }
|
|
|
237
237
|
: <EditViewBinding
|
|
238
238
|
{...props}
|
|
239
239
|
layout={collection?.openEntityMode === "dialog" ? "dialog" : "side_panel"}
|
|
240
|
-
collection={collection as
|
|
240
|
+
collection={collection as AdminCollection}
|
|
241
241
|
parentCollectionSlugs={parentCollectionSlugs} parentEntityIds={parentEntityIds}
|
|
242
242
|
onValuesModified={onValuesModified}
|
|
243
243
|
onSaved={onUpdate}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SidePanelController } from "@rebasepro/types";
|
|
1
|
+
import type { SidePanelController } from "@rebasepro/admin-types";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { useBuildSidePanel } from "../hooks/useBuildSidePanel";
|
|
4
4
|
import { useBuildSideDialogsController } from "../hooks/useBuildSideDialogsController";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
Typography
|
|
15
15
|
} from "@rebasepro/ui";
|
|
16
16
|
import { useSnackbarController, useTranslation } from "@rebasepro/app";
|
|
17
|
-
import { UserCreationResult } from "@rebasepro/types";
|
|
17
|
+
import { UserCreationResult } from "@rebasepro/admin-types";
|
|
18
18
|
|
|
19
19
|
export function CreationResultDialog({
|
|
20
20
|
result,
|
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
Trash2Icon,
|
|
18
18
|
Typography
|
|
19
19
|
} from "@rebasepro/ui";
|
|
20
|
-
import type {
|
|
20
|
+
import type { User } from "@rebasepro/types";
|
|
21
|
+
import type { EntityAction, UserCreationResult } from "@rebasepro/admin-types";
|
|
21
22
|
import {
|
|
22
23
|
useAuthController,
|
|
23
24
|
useRebaseClient,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
import { DeleteEntityDialog } from "../DeleteEntityDialog";
|
|
28
29
|
import { addRecentId } from "../CollectionViewBinding/utils";
|
|
29
30
|
import { navigateToEntity } from "../../util/navigation_utils";
|
|
30
|
-
import { resolveDefaultSelectedView } from "@rebasepro/
|
|
31
|
+
import { resolveDefaultSelectedView } from "@rebasepro/app";
|
|
31
32
|
import { CreationResultDialog } from "../admin/CreationResultDialog";
|
|
32
33
|
import React, { useState } from "react";
|
|
33
34
|
|