@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,5 +1,5 @@
|
|
|
1
1
|
import { Button, FilterXIcon, iconSize, Tooltip } from "@rebasepro/ui";
|
|
2
|
-
import { EntityTableController } from "@rebasepro/types";
|
|
2
|
+
import { EntityTableController } from "@rebasepro/admin-types";
|
|
3
3
|
import { useTranslation } from "@rebasepro/app";
|
|
4
4
|
|
|
5
5
|
export function ClearFilterSortButton({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import type { ViewMode, AdminCollection } from "@rebasepro/admin-types";
|
|
2
3
|
import React, { useMemo } from "react";
|
|
3
4
|
import { CollectionViewBinding } from "./CollectionViewBinding/CollectionViewBinding";
|
|
4
5
|
import { useCollectionRegistryController } from "../hooks/navigation/contexts/CollectionRegistryContext";
|
|
@@ -66,7 +67,7 @@ export type CollectionPanelProps = {
|
|
|
66
67
|
* Any additional collection-level overrides (e.g. `previewProperties`,
|
|
67
68
|
* `enabledViews`, `entityActions`, `defaultFilter`, etc.).
|
|
68
69
|
*/
|
|
69
|
-
collectionOverrides?: Partial<
|
|
70
|
+
collectionOverrides?: Partial<AdminCollection>;
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
/**
|
|
@@ -101,7 +102,7 @@ function CollectionPanelInner({
|
|
|
101
102
|
title,
|
|
102
103
|
updateUrl,
|
|
103
104
|
className
|
|
104
|
-
}: CollectionPanelProps & { mergedCollection:
|
|
105
|
+
}: CollectionPanelProps & { mergedCollection: AdminCollection }) {
|
|
105
106
|
const ResolvedCollectionView = useComponentOverride("Collection.View", CollectionViewBinding);
|
|
106
107
|
|
|
107
108
|
return (
|
|
@@ -150,7 +151,7 @@ export function CollectionPanel(props: CollectionPanelProps) {
|
|
|
150
151
|
...registeredCollection,
|
|
151
152
|
...(collectionOverrides ?? {}),
|
|
152
153
|
...propOverrides
|
|
153
|
-
} as
|
|
154
|
+
} as AdminCollection;
|
|
154
155
|
}, [registeredCollection, collectionOverrides, viewMode, sort, limit, openEntityMode]);
|
|
155
156
|
|
|
156
157
|
if (!mergedCollection) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import type { EntityAction } from "@rebasepro/types";
|
|
1
|
+
|
|
2
|
+
import type { EntityAction, AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
import React, { MouseEvent, useCallback } from "react";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Entity } from "@rebasepro/types";
|
|
6
|
+
import { CollectionSize, SelectionController } from "@rebasepro/admin-types";
|
|
6
7
|
import {
|
|
7
8
|
Badge,
|
|
8
9
|
Checkbox,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
} from "@rebasepro/ui";
|
|
17
18
|
import { useTranslation } from "@rebasepro/app";
|
|
18
19
|
import { getEntityFromCache } from "@rebasepro/app";
|
|
19
|
-
import { getLocalChangesBackup } from "@rebasepro/
|
|
20
|
+
import { getLocalChangesBackup } from "@rebasepro/app";
|
|
20
21
|
import { useCMSContext } from "../../hooks/useCMSContext";
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -56,7 +57,7 @@ export const CollectionRowActions = function CollectionRowActions({
|
|
|
56
57
|
}:
|
|
57
58
|
{
|
|
58
59
|
entity: Entity<any>,
|
|
59
|
-
collection?:
|
|
60
|
+
collection?: AdminCollection<any>,
|
|
60
61
|
path?: string,
|
|
61
62
|
width: number,
|
|
62
63
|
frozen?: boolean,
|
|
@@ -78,7 +79,6 @@ export const CollectionRowActions = function CollectionRowActions({
|
|
|
78
79
|
isDraggable?: boolean;
|
|
79
80
|
}) {
|
|
80
81
|
|
|
81
|
-
|
|
82
82
|
const context = useCMSContext();
|
|
83
83
|
const sidePanelCtrl = context.sidePanelController;
|
|
84
84
|
const { t } = useTranslation();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { AdditionalFieldDelegate } from "@rebasepro/types";
|
|
1
|
+
import type { AdditionalFieldDelegate, AdminCollection } from "@rebasepro/admin-types";
|
|
2
2
|
import React, { useCallback, useMemo, useRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Entity, User, Property } from "@rebasepro/types";
|
|
4
|
+
import { CollectionSize, RebaseContext } from "@rebasepro/admin-types";
|
|
4
5
|
import { PropertyTableCell } from "./PropertyTableCell";
|
|
5
6
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
6
7
|
import { useRebaseContext, useLargeLayout } from "@rebasepro/app";
|
|
@@ -29,7 +30,7 @@ import { getValueInPath } from "@rebasepro/utils";
|
|
|
29
30
|
* a custom view. If you just need to create a default view you can do it
|
|
30
31
|
* exclusively with config options.
|
|
31
32
|
*
|
|
32
|
-
* If you want to bind a {@link
|
|
33
|
+
* If you want to bind a {@link AdminCollection} to a table with the default
|
|
33
34
|
* options you see in collections in the top level navigation, you can
|
|
34
35
|
* check {@link CollectionViewBinding}.
|
|
35
36
|
*
|
|
@@ -145,7 +146,7 @@ export const CollectionTableBinding = function CollectionTableBinding<M extends
|
|
|
145
146
|
propertyKey,
|
|
146
147
|
entity
|
|
147
148
|
}) ?? columnCustom?.resolvedProperty;
|
|
148
|
-
if (!property?.
|
|
149
|
+
if (!property?.admin?.disabled) {
|
|
149
150
|
disabled = false;
|
|
150
151
|
}
|
|
151
152
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Properties } from "@rebasepro/types";
|
|
2
|
-
import type { AdditionalFieldDelegate } from "@rebasepro/types";
|
|
2
|
+
import type { AdditionalFieldDelegate } from "@rebasepro/admin-types";
|
|
3
3
|
import type { Property } from "@rebasepro/types";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { Entity, FilterValues, User } from "@rebasepro/types";
|
|
6
|
+
import { CollectionSize, EntityTableController, SelectionController } from "@rebasepro/admin-types";
|
|
6
7
|
import { OnCellValueChange, OnColumnResizeParams, UniqueFieldValidator } from "@rebasepro/app";
|
|
7
8
|
import { VirtualTableColumn } from "@rebasepro/ui";
|
|
8
9
|
|
|
@@ -18,7 +18,7 @@ import { EntityTableCellActions } from "./internal/EntityTableCellActions";
|
|
|
18
18
|
import { useSelectableTableController } from "../SelectableTable/SelectableTableContext";
|
|
19
19
|
import { useClearRestoreValue } from "../../form/useClearRestoreValue";
|
|
20
20
|
import { getRowHeight } from "@rebasepro/app";
|
|
21
|
-
import { isReadOnly } from "@rebasepro/
|
|
21
|
+
import { isReadOnly } from "@rebasepro/app";
|
|
22
22
|
import { TableRelationField } from "./fields/TableRelationField";
|
|
23
23
|
import { TableRelationSelectorField } from "./fields/TableRelationSelectorField";
|
|
24
24
|
|
|
@@ -91,11 +91,11 @@ export const PropertyTableCell = React.memo<PropertyTableCellProps<any>>(
|
|
|
91
91
|
setSavedTimestamp(Date.now());
|
|
92
92
|
}, []);
|
|
93
93
|
|
|
94
|
-
const customField = Boolean(property.
|
|
95
|
-
const customPreview = Boolean(property.
|
|
94
|
+
const customField = Boolean(property.admin?.Field);
|
|
95
|
+
const customPreview = Boolean(property.admin?.Preview);
|
|
96
96
|
const readOnlyProperty = isReadOnly(property);
|
|
97
|
-
const disabledTooltip: string | undefined = typeof property.
|
|
98
|
-
const disabled = readonly || disabledProp || Boolean(property.
|
|
97
|
+
const disabledTooltip: string | undefined = typeof property.admin?.disabled === "object" ? property.admin?.disabled.disabledMessage : undefined;
|
|
98
|
+
const disabled = readonly || disabledProp || Boolean(property.admin?.disabled);
|
|
99
99
|
|
|
100
100
|
const validation = useMemo(() => mapPropertyToZod({
|
|
101
101
|
property,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSelectionDialog } from "../../../hooks/useSelectionDialog";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { getCollectionDataPath } from "@rebasepro/types";
|
|
4
4
|
import React, { useCallback } from "react";
|
|
5
5
|
import { deepEqual as equal } from "fast-equals";
|
|
@@ -8,7 +8,8 @@ import { cls, PencilIcon } from "@rebasepro/ui";
|
|
|
8
8
|
import { getRelationFrom, normalizeToEntityRelation } from "@rebasepro/common";
|
|
9
9
|
|
|
10
10
|
import { RelationPreview } from "../../../preview";
|
|
11
|
-
import {
|
|
11
|
+
import { Entity, EntityRelation, FilterValues, Relation } from "@rebasepro/types";
|
|
12
|
+
import { CollectionSize, AdminCollection } from "@rebasepro/admin-types";
|
|
12
13
|
import { } from "@rebasepro/app";
|
|
13
14
|
import { ErrorView } from "@rebasepro/app";
|
|
14
15
|
import { EntityPreviewContainer } from "../../EntityPreviewBinding";
|
|
@@ -34,7 +35,7 @@ export function TableMultipleRelationField(props: TableMultipleRelationFieldProp
|
|
|
34
35
|
|
|
35
36
|
export const TableMultipleRelationFieldInternal = React.memo(
|
|
36
37
|
function TableMultipleRelationFieldInternal(props: TableMultipleRelationFieldProps & {
|
|
37
|
-
collection:
|
|
38
|
+
collection: AdminCollection;
|
|
38
39
|
}) {
|
|
39
40
|
const {
|
|
40
41
|
name,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useSelectionDialog } from "../../../hooks/useSelectionDialog";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import React, { useCallback } from "react";
|
|
4
4
|
import { deepEqual as equal } from "fast-equals"
|
|
5
5
|
|
|
6
6
|
import { ReferencePreview } from "../../../preview";
|
|
7
|
-
import {
|
|
7
|
+
import { Entity, EntityReference, FilterValues } from "@rebasepro/types";
|
|
8
|
+
import { CollectionSize, AdminCollection } from "@rebasepro/admin-types";
|
|
8
9
|
|
|
9
10
|
import { getPreviewSizeFrom } from "../../../preview/util";
|
|
10
11
|
import { useComponentOverride, ErrorView, CollectionScopeProvider } from "@rebasepro/app";
|
|
@@ -30,7 +31,7 @@ type TableReferenceFieldProps = {
|
|
|
30
31
|
|
|
31
32
|
const DefaultMissingReference: React.FC<{ path: string }> = () => null;
|
|
32
33
|
|
|
33
|
-
function TableReferenceFieldResolver(props: TableReferenceFieldProps & { collection:
|
|
34
|
+
function TableReferenceFieldResolver(props: TableReferenceFieldProps & { collection: AdminCollection | undefined }) {
|
|
34
35
|
const ResolvedMissingReference = useComponentOverride("Entity.MissingReference", DefaultMissingReference);
|
|
35
36
|
const { path, collection } = props;
|
|
36
37
|
|
|
@@ -68,7 +69,7 @@ export function TableReferenceField(props: TableReferenceFieldProps) {
|
|
|
68
69
|
|
|
69
70
|
export const TableReferenceFieldInternal = React.memo(
|
|
70
71
|
function TableReferenceFieldInternal(props: TableReferenceFieldProps & {
|
|
71
|
-
collection:
|
|
72
|
+
collection: AdminCollection;
|
|
72
73
|
}) {
|
|
73
74
|
const {
|
|
74
75
|
name,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useSelectionDialog } from "../../../hooks/useSelectionDialog";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { getCollectionDataPath } from "@rebasepro/types";
|
|
4
4
|
import React, { useCallback } from "react";
|
|
5
5
|
import { deepEqual as equal } from "fast-equals"
|
|
6
6
|
|
|
7
7
|
import { RelationPreview } from "../../../preview";
|
|
8
|
-
import {
|
|
8
|
+
import { Entity, EntityRelation, FilterValues, Relation } from "@rebasepro/types";
|
|
9
|
+
import { CollectionSize, AdminCollection } from "@rebasepro/admin-types";
|
|
9
10
|
|
|
10
11
|
import { getPreviewSizeFrom } from "../../../preview/util";
|
|
11
12
|
import { } from "@rebasepro/app";
|
|
@@ -57,7 +58,7 @@ export function TableRelationField(props: TableRelationFieldProps) {
|
|
|
57
58
|
|
|
58
59
|
export const TableRelationFieldInternal = React.memo(
|
|
59
60
|
function TableRelationFieldInternal(props: TableRelationFieldProps & {
|
|
60
|
-
collection:
|
|
61
|
+
collection: AdminCollection;
|
|
61
62
|
}) {
|
|
62
63
|
const {
|
|
63
64
|
name,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import type { ArrayProperty, Property } from "@rebasepro/types";
|
|
3
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
3
4
|
|
|
4
5
|
export function getTableCellAlignment(property: Property): "right" | "left" | "center" {
|
|
5
6
|
if (property.type === "boolean") {
|
|
@@ -17,20 +18,20 @@ export function getTableCellAlignment(property: Property): "right" | "left" | "c
|
|
|
17
18
|
|
|
18
19
|
export function getTablePropertyColumnWidth(property: Property): number {
|
|
19
20
|
|
|
20
|
-
if (property.
|
|
21
|
-
return property.
|
|
21
|
+
if (property.admin?.columnWidth) {
|
|
22
|
+
return property.admin?.columnWidth;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
if (property.type === "string") {
|
|
25
|
-
if (property.
|
|
26
|
+
if (property.admin?.urlPreview) {
|
|
26
27
|
return 280;
|
|
27
28
|
} else if (property.storage) {
|
|
28
29
|
return 160;
|
|
29
30
|
} else if (property.enum) {
|
|
30
31
|
return 200;
|
|
31
|
-
} else if (property.
|
|
32
|
+
} else if (property.admin?.multiline) {
|
|
32
33
|
return 300;
|
|
33
|
-
} else if (property.
|
|
34
|
+
} else if (property.admin?.markdown) {
|
|
34
35
|
return 300;
|
|
35
36
|
} else if (property.email) {
|
|
36
37
|
return 200;
|
|
@@ -68,6 +69,6 @@ export function getTablePropertyColumnWidth(property: Property): number {
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
export function getSubcollectionColumnId(collection:
|
|
72
|
+
export function getSubcollectionColumnId(collection: AdminCollection) {
|
|
72
73
|
return `subcollection:${collection.slug}`;
|
|
73
74
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Properties } from "@rebasepro/types";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import type { FormContext, PropertyFieldBindingProps } from "../../../../types/fields";
|
|
4
4
|
import type { Property } from "@rebasepro/types";
|
|
5
5
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useState } from "react";
|
|
@@ -16,7 +16,8 @@ import { getPropertyInPath } from "../../../../util/property_utils";
|
|
|
16
16
|
import { PropertyFieldBinding, zodToFormErrors } from "../../../../form";
|
|
17
17
|
import { useAuthController, useCustomizationController, useData, useRebaseContext } from "@rebasepro/app";
|
|
18
18
|
import type { OnCellValueChangeParams } from "@rebasepro/app";
|
|
19
|
-
import { isReadOnly } from "@rebasepro/
|
|
19
|
+
import { isReadOnly } from "@rebasepro/app";
|
|
20
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
20
21
|
|
|
21
22
|
interface PopupFormFieldProps<M extends Record<string, unknown>> {
|
|
22
23
|
customFieldValidator?: CustomFieldValidator;
|
|
@@ -24,7 +25,7 @@ interface PopupFormFieldProps<M extends Record<string, unknown>> {
|
|
|
24
25
|
entityId: string | number;
|
|
25
26
|
tableKey: string;
|
|
26
27
|
propertyKey?: Extract<keyof M, string>;
|
|
27
|
-
collection?:
|
|
28
|
+
collection?: AdminCollection<any>;
|
|
28
29
|
cellRect?: DOMRect;
|
|
29
30
|
open: boolean;
|
|
30
31
|
onClose: () => void;
|
|
@@ -290,7 +291,7 @@ export function PopupFormFieldInternal<M extends Record<string, unknown>>({
|
|
|
290
291
|
const fieldProps: PropertyFieldBindingProps<M> | undefined = propertyKey && property
|
|
291
292
|
? {
|
|
292
293
|
propertyKey: propertyKey as string,
|
|
293
|
-
disabled: isSubmitting || isReadOnly(property) || !!property.
|
|
294
|
+
disabled: isSubmitting || isReadOnly(property) || !!property.admin?.disabled,
|
|
294
295
|
property,
|
|
295
296
|
includeDescription: false,
|
|
296
297
|
underlyingValueHasChanged: false,
|
|
@@ -44,7 +44,7 @@ export interface TableFieldConfig {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export function isStorageProperty(property: Property) {
|
|
47
|
-
if (property.type === "string" && property.
|
|
47
|
+
if (property.type === "string" && property.admin?.markdown)
|
|
48
48
|
return false;
|
|
49
49
|
if (property.type === "string" && (property as StringProperty).storage)
|
|
50
50
|
return true;
|
|
@@ -159,8 +159,8 @@ export function getTableBindingForProperty(
|
|
|
159
159
|
),
|
|
160
160
|
fullHeight: true
|
|
161
161
|
};
|
|
162
|
-
} else if (stringProperty.
|
|
163
|
-
const multiline = Boolean(stringProperty.
|
|
162
|
+
} else if (stringProperty.admin?.markdown || !stringProperty.storage) {
|
|
163
|
+
const multiline = Boolean(stringProperty.admin?.multiline) || Boolean(stringProperty.admin?.markdown);
|
|
164
164
|
return {
|
|
165
165
|
Component: ({ error, validationError, disabled, selected, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
166
166
|
<VirtualTableInput
|
|
@@ -221,7 +221,7 @@ export function getTableBindingForProperty(
|
|
|
221
221
|
size={size}
|
|
222
222
|
path={(property as ReferenceProperty).path!}
|
|
223
223
|
multiselect={false}
|
|
224
|
-
previewProperties={(property as ReferenceProperty).
|
|
224
|
+
previewProperties={(property as ReferenceProperty).admin?.previewProperties}
|
|
225
225
|
includeId={(property as ReferenceProperty).includeId}
|
|
226
226
|
includeEntityLink={(property as ReferenceProperty).includeEntityLink}
|
|
227
227
|
title={property.name ?? propertyKey}
|
|
@@ -234,7 +234,7 @@ export function getTableBindingForProperty(
|
|
|
234
234
|
}
|
|
235
235
|
} else if (property.type === "relation") {
|
|
236
236
|
if ((property as RelationProperty).relation) {
|
|
237
|
-
if ((property as RelationProperty).
|
|
237
|
+
if ((property as RelationProperty).admin?.widget === "dialog") {
|
|
238
238
|
return {
|
|
239
239
|
Component: RelationDialogBindingComponent,
|
|
240
240
|
allowScroll: false
|
|
@@ -288,7 +288,7 @@ export function getTableBindingForProperty(
|
|
|
288
288
|
size={size}
|
|
289
289
|
multiselect={true}
|
|
290
290
|
path={refOfProp.path!}
|
|
291
|
-
previewProperties={refOfProp.
|
|
291
|
+
previewProperties={refOfProp.admin?.previewProperties}
|
|
292
292
|
title={arrayProperty.name}
|
|
293
293
|
fixedFilter={refOfProp.fixedFilter}
|
|
294
294
|
includeId={refOfProp.includeId}
|
|
@@ -317,7 +317,7 @@ function RelationDialogBindingComponent({ propertyKey, internalValue, updateValu
|
|
|
317
317
|
size={size}
|
|
318
318
|
multiselect={false}
|
|
319
319
|
relation={relProp.relation!}
|
|
320
|
-
previewProperties={relProp.
|
|
320
|
+
previewProperties={relProp.admin?.previewProperties}
|
|
321
321
|
includeId={relProp.includeId}
|
|
322
322
|
includeEntityLink={relProp.includeEntityLink}
|
|
323
323
|
title={relProp.name ?? propertyKey}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import React, { memo, useCallback, useMemo } from "react";
|
|
3
3
|
import { Entity } from "@rebasepro/types";
|
|
4
4
|
import { Checkbox, Chip, cls, defaultBorderMixin, Markdown } from "@rebasepro/ui";
|
|
@@ -7,9 +7,10 @@ import { useAuthController, useCustomizationController } from "@rebasepro/app";
|
|
|
7
7
|
import { IconForView } from "@rebasepro/app";
|
|
8
8
|
import { BoardItemViewProps } from "@rebasepro/ui";
|
|
9
9
|
import { useCollectionSlotKeys, resolveEntitySlots } from "./usePreviewSlots";
|
|
10
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
10
11
|
|
|
11
12
|
export type BoardCardBindingProps<M extends Record<string, unknown> = Record<string, unknown>> = BoardItemViewProps<Entity<M>> & {
|
|
12
|
-
collection:
|
|
13
|
+
collection: AdminCollection<M>;
|
|
13
14
|
onClick?: (entity: Entity<M>) => void;
|
|
14
15
|
selected?: boolean;
|
|
15
16
|
onSelectionChange?: (entity: Entity<M>, selected: boolean) => void;
|
|
@@ -40,7 +41,7 @@ function BoardCardBindingInner<M extends Record<string, unknown> = Record<string
|
|
|
40
41
|
const customizationController = useCustomizationController();
|
|
41
42
|
|
|
42
43
|
const slotKeys = useCollectionSlotKeys(
|
|
43
|
-
collection as
|
|
44
|
+
collection as AdminCollection<Record<string, unknown>>,
|
|
44
45
|
authController,
|
|
45
46
|
customizationController.propertyConfigs
|
|
46
47
|
);
|
|
@@ -48,7 +49,7 @@ function BoardCardBindingInner<M extends Record<string, unknown> = Record<string
|
|
|
48
49
|
const slots = useMemo(
|
|
49
50
|
() => resolveEntitySlots(
|
|
50
51
|
entity as Entity<Record<string, unknown>>,
|
|
51
|
-
collection as
|
|
52
|
+
collection as AdminCollection<Record<string, unknown>>,
|
|
52
53
|
slotKeys
|
|
53
54
|
),
|
|
54
55
|
[entity, collection, slotKeys]
|
|
@@ -240,7 +241,7 @@ export const BoardCardBinding = memo(BoardCardBindingInner) as typeof BoardCardB
|
|
|
240
241
|
* Wrapper component that adapts BoardCardBinding to BoardItemViewProps interface
|
|
241
242
|
*/
|
|
242
243
|
export function createBoardCardBindingComponent<M extends Record<string, unknown>>(
|
|
243
|
-
collection:
|
|
244
|
+
collection: AdminCollection<M>,
|
|
244
245
|
options: {
|
|
245
246
|
onClick?: (entity: Entity<M>) => void;
|
|
246
247
|
isEntitySelected?: (entity: Entity<M>) => boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
-
import { Entity,
|
|
3
|
+
import { Entity, EnumValueConfig } from "@rebasepro/types";
|
|
4
|
+
import { EntityTableController, SelectionController, AdminCollection } from "@rebasepro/admin-types";
|
|
4
5
|
import { BoardCardBinding } from "./BoardCardBinding";
|
|
5
6
|
import {
|
|
6
7
|
Button,
|
|
@@ -42,7 +43,7 @@ import { useSidePanel } from "../../hooks/useSidePanel";
|
|
|
42
43
|
import { generateNKeysBetween } from "fractional-indexing";
|
|
43
44
|
|
|
44
45
|
export type CollectionBoardViewBindingProps<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
45
|
-
collection:
|
|
46
|
+
collection: AdminCollection<M>;
|
|
46
47
|
tableController: EntityTableController<M>;
|
|
47
48
|
fullPath: string;
|
|
48
49
|
parentCollectionSlugs?: string[], parentEntityIds?: string[];
|
|
@@ -467,7 +468,7 @@ parentEntityIds,
|
|
|
467
468
|
const Comp = (props: BoardItemViewProps<Entity<M>>) => (
|
|
468
469
|
<BoardCardBinding
|
|
469
470
|
{...props}
|
|
470
|
-
collection={collectionRef.current as
|
|
471
|
+
collection={collectionRef.current as AdminCollection<M>}
|
|
471
472
|
onClick={stableOnClick}
|
|
472
473
|
selected={isEntitySelectedRef.current(props.item.data)}
|
|
473
474
|
onSelectionChange={stableOnSelectionChange}
|
|
@@ -486,7 +487,6 @@ parentEntityIds,
|
|
|
486
487
|
parentEntityIds
|
|
487
488
|
});
|
|
488
489
|
|
|
489
|
-
|
|
490
490
|
// Get AddKanbanColumnComponent from plugin slots
|
|
491
491
|
const addKanbanColumnSlots = useSlot("kanban.add-column", {
|
|
492
492
|
collection,
|
|
@@ -496,7 +496,6 @@ parentEntityIds,
|
|
|
496
496
|
columnProperty
|
|
497
497
|
});
|
|
498
498
|
|
|
499
|
-
|
|
500
499
|
// Check for loading error
|
|
501
500
|
const hasError = Boolean(dataLoadingError);
|
|
502
501
|
const errorMessage = dataLoadingError?.message || "";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Entity } from "@rebasepro/types";
|
|
4
|
+
import { CollectionSize, EntityTableController, SelectionController, AdminCollection } from "@rebasepro/admin-types";
|
|
4
5
|
import { EntityCardBinding } from "./EntityCardBinding";
|
|
5
6
|
import {
|
|
6
7
|
cls,
|
|
@@ -11,7 +12,7 @@ import {
|
|
|
11
12
|
import { useComponentOverride } from "@rebasepro/app";
|
|
12
13
|
|
|
13
14
|
export type CollectionCardViewBindingProps<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
14
|
-
collection:
|
|
15
|
+
collection: AdminCollection<M>;
|
|
15
16
|
tableController: EntityTableController<M>;
|
|
16
17
|
onEntityClick?: (entity: Entity<M>) => void;
|
|
17
18
|
selectionController?: SelectionController<M>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import type {
|
|
2
|
+
import type { Property } from "@rebasepro/types";
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { Entity } from "@rebasepro/types";
|
|
5
|
+
import { CollectionSize, EntityAction, EntityTableController, SelectionController, AdminCollection } from "@rebasepro/admin-types";
|
|
5
6
|
import {
|
|
6
7
|
Checkbox,
|
|
7
8
|
Chip,
|
|
@@ -27,7 +28,7 @@ import { useCMSContext } from "../../hooks/useCMSContext";
|
|
|
27
28
|
import { resolveEntityAction } from "../../util/resolutions";
|
|
28
29
|
|
|
29
30
|
export type CollectionListViewBindingProps<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
30
|
-
collection:
|
|
31
|
+
collection: AdminCollection<M>;
|
|
31
32
|
tableController: EntityTableController<M>;
|
|
32
33
|
onEntityClick?: (entity: Entity<M>) => void;
|
|
33
34
|
selectionController?: SelectionController<M>;
|
|
@@ -78,7 +79,6 @@ type ListColumnDef = {
|
|
|
78
79
|
width: string;
|
|
79
80
|
};
|
|
80
81
|
|
|
81
|
-
|
|
82
82
|
/**
|
|
83
83
|
* Get row padding/spacing classes based on size
|
|
84
84
|
*/
|
|
@@ -327,20 +327,18 @@ export function CollectionListViewBinding<M extends Record<string, unknown> = Re
|
|
|
327
327
|
|
|
328
328
|
// ── Shared slot resolution (replaces 4 individual useMemo calls) ──
|
|
329
329
|
const slotKeys = useCollectionSlotKeys(
|
|
330
|
-
resolvedCollection as
|
|
330
|
+
resolvedCollection as AdminCollection<Record<string, unknown>>,
|
|
331
331
|
authController,
|
|
332
332
|
customizationController.propertyConfigs
|
|
333
333
|
);
|
|
334
334
|
const { titleKey: titlePropertyKey, imageKey: imagePropertyKey, subtitleKey, statusKey: statusPropertyKey, dateKey: datePropertyKey } = slotKeys;
|
|
335
335
|
|
|
336
|
-
|
|
337
336
|
const previewKeys = useMemo(
|
|
338
337
|
() => getEntityPreviewKeys(authController, resolvedCollection, customizationController.propertyConfigs, undefined, 10)
|
|
339
338
|
.filter(key => key !== titlePropertyKey && key !== imagePropertyKey && key !== statusPropertyKey && key !== datePropertyKey),
|
|
340
339
|
[authController, resolvedCollection, customizationController.propertyConfigs, titlePropertyKey, imagePropertyKey, statusPropertyKey, datePropertyKey]
|
|
341
340
|
);
|
|
342
341
|
|
|
343
|
-
|
|
344
342
|
const columns = useMemo(() => {
|
|
345
343
|
const cols: ListColumnDef[] = [];
|
|
346
344
|
|
|
@@ -407,10 +405,10 @@ export function CollectionListViewBinding<M extends Record<string, unknown> = Re
|
|
|
407
405
|
const prop = resolvedCollection.properties[k] as Property | undefined;
|
|
408
406
|
if (!prop) return false;
|
|
409
407
|
// Exclude storage/image properties — they are already rendered in the image slot
|
|
410
|
-
if (prop.type === "string" && (prop.storage || prop.
|
|
408
|
+
if (prop.type === "string" && (prop.storage || prop.admin?.urlPreview === "image")) return false;
|
|
411
409
|
if (prop.type === "array" && prop.of && !Array.isArray(prop.of)) {
|
|
412
410
|
const inner = prop.of;
|
|
413
|
-
if (inner.type === "string" && (inner.storage || inner.
|
|
411
|
+
if (inner.type === "string" && (inner.storage || inner.admin?.urlPreview === "image")) return false;
|
|
414
412
|
}
|
|
415
413
|
return true;
|
|
416
414
|
});
|
|
@@ -459,7 +457,6 @@ export function CollectionListViewBinding<M extends Record<string, unknown> = Re
|
|
|
459
457
|
|
|
460
458
|
const showImage = size !== "xs";
|
|
461
459
|
|
|
462
|
-
|
|
463
460
|
// Responsive: determine visible columns based on container width.
|
|
464
461
|
// The first extra column requires significantly more available space (600px)
|
|
465
462
|
// to ensure the title area has generous room before columns appear.
|
|
@@ -611,7 +608,7 @@ const ListRow = React.memo(function ListRow<M extends Record<string, unknown>>({
|
|
|
611
608
|
openEntityMode
|
|
612
609
|
}: {
|
|
613
610
|
entity: Entity<M>;
|
|
614
|
-
collection:
|
|
611
|
+
collection: AdminCollection<M>;
|
|
615
612
|
onClick?: (entity: Entity<M>) => void;
|
|
616
613
|
selected?: boolean;
|
|
617
614
|
highlighted?: boolean;
|
|
@@ -633,7 +630,7 @@ const ListRow = React.memo(function ListRow<M extends Record<string, unknown>>({
|
|
|
633
630
|
// ── Resolve slots (pure function, no hooks) ──
|
|
634
631
|
const slots = resolveEntitySlots(
|
|
635
632
|
entity as Entity<Record<string, unknown>>,
|
|
636
|
-
collection as
|
|
633
|
+
collection as AdminCollection<Record<string, unknown>>,
|
|
637
634
|
slotKeys
|
|
638
635
|
);
|
|
639
636
|
|
|
@@ -877,7 +874,7 @@ const ListRow = React.memo(function ListRow<M extends Record<string, unknown>>({
|
|
|
877
874
|
);
|
|
878
875
|
}) as <M extends Record<string, unknown>>(props: {
|
|
879
876
|
entity: Entity<M>;
|
|
880
|
-
collection:
|
|
877
|
+
collection: AdminCollection<M>;
|
|
881
878
|
onClick?: (entity: Entity<M>) => void;
|
|
882
879
|
selected?: boolean;
|
|
883
880
|
highlighted?: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import React, { lazy, Suspense } from "react";
|
|
4
4
|
|
|
5
5
|
import { useLargeLayout, useTranslation, useSlot, resolveComponentRef } from "@rebasepro/app";
|
|
6
|
-
import { CollectionActionsProps, EntityTableController, SelectionController } from "@rebasepro/types";
|
|
6
|
+
import { CollectionActionsProps, EntityTableController, SelectionController, AdminCollection } from "@rebasepro/admin-types";
|
|
7
7
|
import { Button, IconButton, Tooltip, Popover, iconSize } from "@rebasepro/ui";
|
|
8
8
|
import { ErrorBoundary, MoreVerticalIcon, PlusIcon, Trash2Icon } from "@rebasepro/ui";
|
|
9
9
|
import { usePermissions } from "@rebasepro/app";
|
|
@@ -16,7 +16,7 @@ import { useCollectionEditorController } from "../../collection_editor/useCollec
|
|
|
16
16
|
import { useCMSContext } from "../../hooks/useCMSContext";
|
|
17
17
|
|
|
18
18
|
export type CollectionViewActionsProps<M extends Record<string, unknown>> = {
|
|
19
|
-
collection:
|
|
19
|
+
collection: AdminCollection<M>;
|
|
20
20
|
path: string;
|
|
21
21
|
relativePath: string;
|
|
22
22
|
parentCollectionSlugs: string[], parentEntityIds: string[];
|