@rebasepro/admin 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/CollectionEditorDialog-HNXGxXdO.js +3549 -0
- package/dist/CollectionEditorDialog-HNXGxXdO.js.map +1 -0
- package/dist/CollectionsStudioView-B1mN33GB.js +170 -0
- package/dist/CollectionsStudioView-B1mN33GB.js.map +1 -0
- package/dist/PropertyEditView-C2wp8kQ9.js +3660 -0
- package/dist/PropertyEditView-C2wp8kQ9.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +2 -2
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -1
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -1
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -1
- package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +1 -9
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -4
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +1 -1
- package/dist/collection_editor_ui.js +4 -11
- package/dist/components/ArrayContainer.d.ts +3 -3
- package/dist/components/ClearFilterSortButton.d.ts +1 -1
- package/dist/components/CollectionEditorDialogs.d.ts +2 -1
- package/dist/components/CollectionPanel.d.ts +2 -27
- package/dist/components/DefaultAppBar.d.ts +1 -1
- package/dist/components/DefaultDrawer.d.ts +4 -4
- package/dist/components/DeleteEntityDialog.d.ts +2 -1
- package/dist/components/DrawerNavigationGroup.d.ts +1 -1
- package/dist/components/DrawerNavigationItem.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +4 -3
- package/dist/components/EntityCollectionView/Board.d.ts +2 -1
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +1 -1
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCard.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +0 -24
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
- package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +2 -1
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
- package/dist/components/EntityCollectionView/SplitListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +2 -1
- package/dist/components/EntityDetailView.d.ts +1 -1
- package/dist/components/EntityEditView.d.ts +2 -2
- package/dist/components/EntityEditViewFormActions.d.ts +2 -1
- package/dist/components/EntityJsonPreview.d.ts +2 -1
- package/dist/components/EntityPreview.d.ts +3 -3
- package/dist/components/EntitySidePanel.d.ts +2 -1
- package/dist/components/EntityView.d.ts +2 -1
- package/dist/components/FieldCaption.d.ts +1 -1
- package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
- package/dist/components/HomePage/FavouritesView.d.ts +1 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +4 -4
- package/dist/components/HomePage/NavigationCard.d.ts +1 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +2 -1
- package/dist/components/HomePage/NavigationGroup.d.ts +2 -2
- package/dist/components/HomePage/RenameGroupDialog.d.ts +2 -1
- package/dist/components/HomePage/SmallNavigationCard.d.ts +1 -1
- package/dist/components/PropertyCollectionView.d.ts +2 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +2 -2
- package/dist/components/RebaseAuthGate.d.ts +1 -1
- package/dist/components/RebaseLayout.d.ts +1 -1
- package/dist/components/RebaseNavigation.d.ts +1 -1
- package/dist/components/RebaseRouteDefs.d.ts +1 -1
- package/dist/components/RebaseShell.d.ts +1 -1
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
- package/dist/components/ReferenceWidget.d.ts +2 -1
- package/dist/components/SearchIconsView.d.ts +2 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -1
- package/dist/components/SideDialogs.d.ts +1 -1
- package/dist/components/SideEntityProvider.d.ts +1 -1
- package/dist/components/admin/CreationResultDialog.d.ts +2 -1
- package/dist/components/app/AppBar.d.ts +1 -1
- package/dist/components/app/Drawer.d.ts +1 -1
- package/dist/components/common/default_entity_actions.d.ts +2 -1
- package/dist/components/history/EntityHistoryEntry.d.ts +1 -1
- package/dist/components/history/EntityHistoryView.d.ts +1 -1
- package/dist/components/history/LastEditedByFormAction.d.ts +2 -1
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -1
- package/dist/components/history/UserChip.d.ts +1 -1
- package/dist/data_export/export/BasicExportAction.d.ts +2 -1
- package/dist/data_export/export/ExportCollectionAction.d.ts +1 -1
- package/dist/data_import/components/DataNewPropertiesMapping.d.ts +1 -1
- package/dist/data_import/components/ImportFileUpload.d.ts +1 -1
- package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +2 -1
- package/dist/data_import/components/ImportSaveInProgress.d.ts +1 -1
- package/dist/data_import/import/ImportCollectionAction.d.ts +4 -3
- package/dist/editor/components/SlashCommandMenu.d.ts +2 -1
- package/dist/editor/editor.d.ts +10 -4
- package/dist/editor/selectors/color-selector.d.ts +1 -1
- package/dist/editor/selectors/link-selector.d.ts +1 -1
- package/dist/editor/selectors/node-selector.d.ts +1 -1
- package/dist/editor/selectors/text-buttons.d.ts +1 -1
- package/dist/editor.js +2623 -3574
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -1
- package/dist/form/EntityFormActions.d.ts +2 -1
- package/dist/form/components/FieldHelperText.d.ts +1 -1
- package/dist/form/components/FormEntry.d.ts +1 -1
- package/dist/form/components/FormLayout.d.ts +1 -1
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +1 -1
- package/dist/form/components/LocalChangesMenu.d.ts +2 -1
- package/dist/form/components/StorageItemPreview.d.ts +2 -1
- package/dist/form/components/StorageUploadProgress.d.ts +2 -1
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +4 -3
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -2
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/VectorFieldBinding.d.ts +2 -1
- package/dist/history-BO6VT85a.js +311 -0
- package/dist/history-BO6VT85a.js.map +1 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +0 -2
- package/dist/hooks/navigation/useNavigationResolution.d.ts +5 -6
- package/dist/hooks/navigation/useResolvedCollections.d.ts +0 -2
- package/dist/hooks/useBreadcrumbsController.d.ts +2 -32
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -3393
- package/dist/markdown-CklalUUk.js +526 -0
- package/dist/markdown-CklalUUk.js.map +1 -0
- package/dist/preview/components/ArrayEnumPreview.d.ts +2 -1
- package/dist/preview/components/EmptyValue.d.ts +2 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/components/ImagePreview.d.ts +2 -1
- package/dist/preview/components/ReferencePreview.d.ts +2 -1
- package/dist/preview/components/RelationPreview.d.ts +2 -1
- package/dist/preview/components/StorageThumbnail.d.ts +1 -1
- package/dist/preview/components/UserPreview.d.ts +6 -3
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +2 -1
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +3 -2
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +5 -4
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/routes/RebaseRoute.d.ts +1 -1
- package/dist/src-BYniefVu.js +24011 -0
- package/dist/src-BYniefVu.js.map +1 -0
- package/dist/types/components/PropertyPreviewProps.d.ts +4 -0
- package/dist/types/components/formex.d.ts +1 -40
- package/dist/types/fields.d.ts +9 -1
- package/dist/util/navigation_utils.d.ts +2 -1
- package/dist/util/previews.d.ts +5 -0
- package/dist/util/property_utils.d.ts +1 -1
- package/package.json +29 -26
- package/src/collection_editor/ConfigControllerProvider.tsx +10 -7
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -0
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -1
- package/src/collection_editor/ui/EditorEntityAction.tsx +2 -1
- package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -1
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +2 -1
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +2 -3
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +0 -1
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -4
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +5 -2
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +7 -2
- package/src/collection_editor/validateCollectionJson.ts +2 -2
- package/src/components/ArrayContainer.tsx +5 -5
- package/src/components/CollectionPanel.tsx +51 -25
- package/src/components/DefaultAppBar.tsx +1 -2
- package/src/components/DefaultDrawer.tsx +3 -2
- package/src/components/DrawerNavigationGroup.tsx +3 -2
- package/src/components/DrawerNavigationItem.tsx +4 -4
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +30 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -0
- package/src/components/EntityCollectionView/Board.tsx +10 -8
- package/src/components/EntityCollectionView/BoardSortableList.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +6 -2
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +14 -4
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +48 -26
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +146 -73
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +2 -1
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +3 -2
- package/src/components/EntityCollectionView/FilterPresetsButton.tsx +4 -2
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +0 -1
- package/src/components/EntityCollectionView/useBoardDataController.tsx +17 -15
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +29 -19
- package/src/components/EntityDetailView.tsx +66 -30
- package/src/components/EntityEditView.tsx +70 -32
- package/src/components/EntitySidePanel.tsx +6 -3
- package/src/components/HomePage/ContentHomePage.tsx +3 -3
- package/src/components/HomePage/NavigationCard.tsx +9 -15
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/HomePage/NavigationGroup.tsx +1 -1
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -5
- package/src/components/RebaseLayout.tsx +5 -2
- package/src/components/RebaseNavigation.tsx +1 -4
- package/src/components/RebaseRouteDefs.tsx +5 -3
- package/src/components/SearchIconsView.tsx +1 -1
- package/src/components/SelectableTable/SelectableTable.tsx +2 -3
- package/src/components/SelectableTable/SelectionStore.ts +9 -3
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +28 -21
- package/src/components/UserSelector.tsx +92 -2
- package/src/components/common/default_entity_actions.tsx +33 -8
- package/src/components/field_configs.tsx +6 -3
- package/src/editor/editor.tsx +15 -9
- package/src/editor/extensions/Image/index.ts +2 -2
- package/src/editor/extensions/Image.ts +2 -2
- package/src/editor/extensions/clipboard.ts +2 -2
- package/src/editor/markdown-it-plugins.d.ts +24 -0
- package/src/editor/markdown.ts +2 -3
- package/src/form/EntityForm.tsx +21 -15
- package/src/form/field_bindings/MapFieldBinding.tsx +3 -3
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +4 -4
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +1 -1
- package/src/form/field_bindings/VectorFieldBinding.tsx +3 -3
- package/src/form/validation.ts +17 -15
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -6
- package/src/hooks/navigation/useNavigationResolution.ts +143 -19
- package/src/hooks/navigation/useResolvedCollections.ts +4 -6
- package/src/hooks/useBreadcrumbsController.tsx +2 -34
- package/src/hooks/useBuildSideEntityController.tsx +25 -3
- package/src/index.ts +2 -2
- package/src/preview/PropertyPreview.tsx +6 -2
- package/src/preview/components/ReferencePreview.tsx +64 -13
- package/src/preview/components/RelationPreview.tsx +101 -13
- package/src/preview/components/UserPreview.tsx +5 -14
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/routes/RebaseRoute.tsx +5 -4
- package/src/types/components/PropertyPreviewProps.tsx +5 -0
- package/src/types/components/formex.tsx +1 -45
- package/src/types/fields.tsx +10 -1
- package/src/util/navigation_utils.ts +14 -4
- package/src/util/previews.ts +101 -4
- package/dist/CollectionEditorDialog-C8E440oK.js +0 -4574
- package/dist/CollectionEditorDialog-C8E440oK.js.map +0 -1
- package/dist/CollectionsStudioView-Brr_b06v.js +0 -217
- package/dist/CollectionsStudioView-Brr_b06v.js.map +0 -1
- package/dist/ExportCollectionAction-D3TTYXrq.js +0 -446
- package/dist/ExportCollectionAction-D3TTYXrq.js.map +0 -1
- package/dist/ImportCollectionAction-Dn7lya6E.js +0 -685
- package/dist/ImportCollectionAction-Dn7lya6E.js.map +0 -1
- package/dist/PropertyEditView-ChBleIbN.js +0 -8197
- package/dist/PropertyEditView-ChBleIbN.js.map +0 -1
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/index-D3S9x_RP.js +0 -462
- package/dist/index-D3S9x_RP.js.map +0 -1
- package/dist/index-D9RNzm01.js +0 -12
- package/dist/index-D9RNzm01.js.map +0 -1
- package/dist/index-DrrT332R.js +0 -8
- package/dist/index-DrrT332R.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-DD2JDU1X.js +0 -618
- package/dist/markdown-DD2JDU1X.js.map +0 -1
- package/dist/useEntityHistory-UVsSclfZ.js +0 -123
- package/dist/useEntityHistory-UVsSclfZ.js.map +0 -1
- package/dist/util-COYYD8zr.js +0 -30474
- package/dist/util-COYYD8zr.js.map +0 -1
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import type { AdditionalFieldDelegate, EntityCollection } from "@rebasepro/types";
|
|
3
3
|
import type { EntityAction, Property } from "@rebasepro/types";
|
|
4
4
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { useSearchParams } from "react-router-dom";
|
|
5
6
|
|
|
6
7
|
import { deepEqual as equal } from "fast-equals"
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
const EMPTY_ARRAY: any[] = [];
|
|
10
11
|
const DEFAULT_ENTITY_OPEN_MODE = "split";
|
|
11
12
|
|
|
@@ -31,7 +32,9 @@ import {
|
|
|
31
32
|
usePermissions,
|
|
32
33
|
useTranslation,
|
|
33
34
|
useSlot,
|
|
34
|
-
IconForView
|
|
35
|
+
IconForView,
|
|
36
|
+
useComponentOverride,
|
|
37
|
+
CollectionComponentOverrideProvider
|
|
35
38
|
} from "@rebasepro/core";
|
|
36
39
|
import { useUserConfigurationPersistence } from "@rebasepro/core";
|
|
37
40
|
import { EntityCollectionViewActions } from "./EntityCollectionViewActions";
|
|
@@ -40,7 +43,7 @@ import { EntityCollectionListView } from "./EntityCollectionListView";
|
|
|
40
43
|
import { SplitListView } from "./SplitListView";
|
|
41
44
|
import { EntityCollectionBoardView } from "./EntityCollectionBoardView";
|
|
42
45
|
import { ViewModeToggle, KanbanPropertyOption } from "./ViewModeToggle";
|
|
43
|
-
import { Button, cls, focusedDisabled, IconButton, Markdown, Popover, Skeleton, TextField, Tooltip, Typography, VirtualTableColumn
|
|
46
|
+
import { Button, cls, focusedDisabled, IconButton, Markdown, Popover, Skeleton, TextField, Tooltip, Typography, VirtualTableColumn, iconSize } from "@rebasepro/ui";
|
|
44
47
|
import { ArrowRightToLineIcon, ErrorBoundary, PlusIcon, SearchIcon } from "@rebasepro/ui";
|
|
45
48
|
import { setIn } from "@rebasepro/formex";
|
|
46
49
|
import { getSubcollectionColumnId } from "../EntityCollectionTable/internal/common";
|
|
@@ -141,8 +144,8 @@ export type EntityCollectionViewProps<M extends Record<string, unknown>> = {
|
|
|
141
144
|
|
|
142
145
|
* @group Components
|
|
143
146
|
*/
|
|
144
|
-
|
|
145
|
-
function
|
|
147
|
+
const EntityCollectionViewInner = React.memo(
|
|
148
|
+
function EntityCollectionViewInner<M extends Record<string, unknown>>({
|
|
146
149
|
path: pathProp,
|
|
147
150
|
|
|
148
151
|
parentCollectionSlugs, parentEntityIds,
|
|
@@ -227,16 +230,16 @@ export const EntityCollectionView = React.memo(
|
|
|
227
230
|
|
|
228
231
|
// View mode priority: URL > saved user config > collection.defaultViewMode
|
|
229
232
|
const defaultViewMode = collection.defaultViewMode ?? "list";
|
|
233
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
230
234
|
|
|
231
|
-
//
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return urlView as ViewMode;
|
|
235
|
+
// Read view from React Router's searchParams (reactive on back/forward)
|
|
236
|
+
const urlView = useMemo((): ViewMode | null => {
|
|
237
|
+
const v = searchParams.get("__view");
|
|
238
|
+
if (v && ["list", "table", "kanban", "cards"].includes(v)) {
|
|
239
|
+
return v as ViewMode;
|
|
237
240
|
}
|
|
238
241
|
return null;
|
|
239
|
-
}, []);
|
|
242
|
+
}, [searchParams]);
|
|
240
243
|
|
|
241
244
|
// Get saved view from local persistence
|
|
242
245
|
const getSavedView = useCallback((): ViewMode | null => {
|
|
@@ -246,7 +249,6 @@ export const EntityCollectionView = React.memo(
|
|
|
246
249
|
|
|
247
250
|
const [viewMode, setViewModeState] = useState<ViewMode>(() => {
|
|
248
251
|
// Priority: URL > saved config > collection default
|
|
249
|
-
const urlView = getViewFromUrl();
|
|
250
252
|
if (urlView) return urlView;
|
|
251
253
|
const savedView = getSavedView();
|
|
252
254
|
if (savedView) return savedView;
|
|
@@ -257,12 +259,13 @@ export const EntityCollectionView = React.memo(
|
|
|
257
259
|
|
|
258
260
|
// Sync URL with current view on init (if view came from saved config)
|
|
259
261
|
useEffect(() => {
|
|
260
|
-
const urlView = getViewFromUrl();
|
|
261
262
|
if (!urlView && viewMode !== defaultViewMode) {
|
|
262
263
|
// View came from saved config but URL doesn't have it - update URL without push
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
setSearchParams((prev) => {
|
|
265
|
+
const next = new URLSearchParams(prev);
|
|
266
|
+
next.set("__view", viewMode);
|
|
267
|
+
return next;
|
|
268
|
+
}, { replace: true });
|
|
266
269
|
}
|
|
267
270
|
}, []); // Only on mount
|
|
268
271
|
|
|
@@ -270,33 +273,27 @@ export const EntityCollectionView = React.memo(
|
|
|
270
273
|
const setViewMode = useCallback((newMode: ViewMode) => {
|
|
271
274
|
setViewModeState(newMode);
|
|
272
275
|
|
|
273
|
-
// Update URL with __view param
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
url.searchParams.set("__view", newMode);
|
|
279
|
-
}
|
|
280
|
-
window.history.pushState({}, "", url.toString());
|
|
281
|
-
}, [defaultViewMode]);
|
|
282
|
-
|
|
283
|
-
// Listen for browser back/forward
|
|
284
|
-
useEffect(() => {
|
|
285
|
-
const handlePopState = () => {
|
|
286
|
-
const urlView = getViewFromUrl();
|
|
287
|
-
if (urlView) {
|
|
288
|
-
// URL has explicit view - use it
|
|
289
|
-
setViewModeState(urlView);
|
|
276
|
+
// Update URL with __view param via React Router
|
|
277
|
+
setSearchParams((prev) => {
|
|
278
|
+
const next = new URLSearchParams(prev);
|
|
279
|
+
if (newMode === defaultViewMode) {
|
|
280
|
+
next.delete("__view");
|
|
290
281
|
} else {
|
|
291
|
-
|
|
292
|
-
const savedView = getSavedView();
|
|
293
|
-
setViewModeState(savedView ?? defaultViewMode);
|
|
282
|
+
next.set("__view", newMode);
|
|
294
283
|
}
|
|
295
|
-
|
|
284
|
+
return next;
|
|
285
|
+
});
|
|
286
|
+
}, [defaultViewMode, setSearchParams]);
|
|
296
287
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
288
|
+
// Sync viewMode state when URL changes via back/forward navigation
|
|
289
|
+
useEffect(() => {
|
|
290
|
+
if (urlView) {
|
|
291
|
+
setViewModeState(urlView);
|
|
292
|
+
} else {
|
|
293
|
+
const savedView = getSavedView();
|
|
294
|
+
setViewModeState(savedView ?? defaultViewMode);
|
|
295
|
+
}
|
|
296
|
+
}, [urlView, getSavedView, defaultViewMode]);
|
|
300
297
|
|
|
301
298
|
// List view size state - controls row height and info density
|
|
302
299
|
const [listSize, setListSize] = useState<CollectionSize>(collection.defaultSize ?? "m");
|
|
@@ -352,10 +349,11 @@ export const EntityCollectionView = React.memo(
|
|
|
352
349
|
sideEntityController,
|
|
353
350
|
openEntityMode,
|
|
354
351
|
collection,
|
|
355
|
-
entityId: clickedEntity.id
|
|
352
|
+
entityId: clickedEntity.id,
|
|
353
|
+
replace: openEntityMode === "split" && selectedEntityIdProp !== undefined
|
|
356
354
|
});
|
|
357
355
|
|
|
358
|
-
}, [
|
|
356
|
+
}, [sideEntityController, openEntityMode, selectedEntityIdProp, path, urlController, analyticsController]);
|
|
359
357
|
|
|
360
358
|
const onNewClick = useCallback(() => {
|
|
361
359
|
const collection = collectionRef.current;
|
|
@@ -418,14 +416,16 @@ export const EntityCollectionView = React.memo(
|
|
|
418
416
|
|
|
419
417
|
const pluginAddColumnComponents = useSlot("collection.add-column", {
|
|
420
418
|
path,
|
|
421
|
-
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
419
|
+
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
420
|
+
parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
422
421
|
collection,
|
|
423
422
|
tableController
|
|
424
423
|
});
|
|
425
424
|
|
|
426
425
|
const pluginToolbarWidgets = useSlot("collection.toolbar", {
|
|
427
426
|
path,
|
|
428
|
-
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
427
|
+
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
428
|
+
parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
429
429
|
collection: collection,
|
|
430
430
|
tableController: tableController,
|
|
431
431
|
selectionController: usedSelectionController
|
|
@@ -433,7 +433,8 @@ export const EntityCollectionView = React.memo(
|
|
|
433
433
|
|
|
434
434
|
const pluginEmptyStates = useSlot("collection.empty-state", {
|
|
435
435
|
path,
|
|
436
|
-
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
436
|
+
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
437
|
+
parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
437
438
|
collection,
|
|
438
439
|
canCreate: canCreateEntities,
|
|
439
440
|
onNewClick
|
|
@@ -441,7 +442,8 @@ export const EntityCollectionView = React.memo(
|
|
|
441
442
|
|
|
442
443
|
const pluginInsights = useSlot("collection.insights", {
|
|
443
444
|
path,
|
|
444
|
-
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
445
|
+
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
446
|
+
parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
445
447
|
collection
|
|
446
448
|
});
|
|
447
449
|
|
|
@@ -776,7 +778,8 @@ export const EntityCollectionView = React.memo(
|
|
|
776
778
|
path,
|
|
777
779
|
collection: collection as EntityCollection,
|
|
778
780
|
tableController: tableController as EntityTableController,
|
|
779
|
-
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
781
|
+
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
782
|
+
parentEntityIds: parentEntityIds ?? EMPTY_ARRAY
|
|
780
783
|
};
|
|
781
784
|
return <>{headerActionContributions.map((s, i) => (
|
|
782
785
|
<ErrorBoundary key={`header_action_${propertyKey}_${i}`}>
|
|
@@ -819,13 +822,19 @@ export const EntityCollectionView = React.memo(
|
|
|
819
822
|
.forEach(plugin => {
|
|
820
823
|
plugin.hooks!.onColumnsReorder!({
|
|
821
824
|
fullPath: path,
|
|
822
|
-
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
825
|
+
parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
|
|
826
|
+
parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
|
|
823
827
|
collection,
|
|
824
828
|
newPropertiesOrder
|
|
825
829
|
});
|
|
826
830
|
});
|
|
827
831
|
}
|
|
828
|
-
|
|
832
|
+
|
|
833
|
+
// Save to user configuration persistence (local storage)
|
|
834
|
+
if (userConfigPersistence) {
|
|
835
|
+
onCollectionModifiedForUser(path, { propertiesOrder: newPropertiesOrder } as PartialEntityCollection<M>);
|
|
836
|
+
}
|
|
837
|
+
}, [collection, setLocalPropertiesOrder, customizationController, path, parentCollectionSlugs, parentEntityIds, userConfigPersistence, onCollectionModifiedForUser]);
|
|
829
838
|
|
|
830
839
|
// Popover open state managed at parent level to prevent closing when view changes
|
|
831
840
|
const [viewModePopoverOpen, setViewModePopoverOpen] = useState(false);
|
|
@@ -850,34 +859,28 @@ export const EntityCollectionView = React.memo(
|
|
|
850
859
|
const pluginErrorViews = useSlot("collection.error", {
|
|
851
860
|
path,
|
|
852
861
|
collection,
|
|
853
|
-
parentCollectionSlugs,
|
|
862
|
+
parentCollectionSlugs,
|
|
863
|
+
parentEntityIds,
|
|
854
864
|
error: tableController.dataLoadingError as Error
|
|
855
865
|
});
|
|
856
866
|
const pluginErrorView = tableController.dataLoadingError && pluginErrorViews.length > 0
|
|
857
867
|
? pluginErrorViews[0]
|
|
858
868
|
: null;
|
|
859
869
|
|
|
860
|
-
// Shared empty state — plugin slot takes priority, then default
|
|
870
|
+
// Shared empty state — plugin slot takes priority, then override, then default
|
|
861
871
|
const isSearching = !!tableController.searchString;
|
|
862
872
|
const isFilteredOrSorted = tableController.filterValues !== undefined || tableController.sortBy !== undefined || isSearching;
|
|
873
|
+
const ResolvedEmptyState = useComponentOverride("Collection.EmptyState", DefaultCollectionEmptyState);
|
|
874
|
+
const ResolvedCollectionActions = useComponentOverride("Collection.Actions", EntityCollectionViewActions);
|
|
875
|
+
const ResolvedCollectionTable = useComponentOverride("Collection.Table", EntityCollectionTable) as typeof EntityCollectionTable;
|
|
863
876
|
const emptyComponent = pluginEmptyStates.length > 0
|
|
864
877
|
? <>{pluginEmptyStates}</>
|
|
865
|
-
:
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
>
|
|
872
|
-
<PlusIcon/>
|
|
873
|
-
{t("create_your_first_entry")}
|
|
874
|
-
</Button>
|
|
875
|
-
</div>
|
|
876
|
-
: <Typography variant={"label"}>
|
|
877
|
-
{isSearching
|
|
878
|
-
? t("no_results_search", { search: tableController.searchString ?? "" })
|
|
879
|
-
: t("no_results_filter_sort")}
|
|
880
|
-
</Typography>;
|
|
878
|
+
: <ResolvedEmptyState
|
|
879
|
+
canCreate={canCreateEntities && !isFilteredOrSorted}
|
|
880
|
+
onNewClick={onNewClick}
|
|
881
|
+
isSearching={isSearching}
|
|
882
|
+
searchString={tableController.searchString ?? ""}
|
|
883
|
+
/>;
|
|
881
884
|
|
|
882
885
|
const toolbarNode = (
|
|
883
886
|
<CollectionTableToolbar
|
|
@@ -898,7 +901,7 @@ export const EntityCollectionView = React.memo(
|
|
|
898
901
|
openNewDocument={openNewDocument}
|
|
899
902
|
compact={isCompact}/>}
|
|
900
903
|
actions={
|
|
901
|
-
<
|
|
904
|
+
<ResolvedCollectionActions
|
|
902
905
|
parentCollectionSlugs={parentCollectionSlugs ?? EMPTY_ARRAY} parentEntityIds={parentEntityIds ?? EMPTY_ARRAY}
|
|
903
906
|
collection={collection}
|
|
904
907
|
tableController={tableController}
|
|
@@ -913,7 +916,7 @@ export const EntityCollectionView = React.memo(
|
|
|
913
916
|
compact={isCompact}
|
|
914
917
|
>
|
|
915
918
|
{pluginToolbarWidgets}
|
|
916
|
-
</
|
|
919
|
+
</ResolvedCollectionActions>
|
|
917
920
|
}
|
|
918
921
|
/>
|
|
919
922
|
); const innerView = viewMode === "kanban" ? (
|
|
@@ -961,7 +964,7 @@ export const EntityCollectionView = React.memo(
|
|
|
961
964
|
openEntityMode={openEntityMode}
|
|
962
965
|
/>
|
|
963
966
|
) : (
|
|
964
|
-
<
|
|
967
|
+
<ResolvedCollectionTable
|
|
965
968
|
key={`collection_table_${path}`}
|
|
966
969
|
hideToolbar={true}
|
|
967
970
|
additionalFields={additionalFields}
|
|
@@ -996,12 +999,20 @@ export const EntityCollectionView = React.memo(
|
|
|
996
999
|
/>
|
|
997
1000
|
);
|
|
998
1001
|
|
|
999
|
-
|
|
1002
|
+
const mainContent = (
|
|
1000
1003
|
<div className={cls("overflow-hidden h-full w-full rounded-md flex flex-col dark:bg-surface-800", className)}
|
|
1001
1004
|
ref={containerRef}>
|
|
1002
1005
|
|
|
1003
1006
|
{countFetcher}
|
|
1004
1007
|
|
|
1008
|
+
{tableController.dataLoadingError && tableController.data.length > 0 && (
|
|
1009
|
+
<div className="flex items-center gap-4 px-4 py-2 bg-red-50 dark:bg-red-900/20 border-b border-red-200 dark:border-red-800 flex-shrink-0">
|
|
1010
|
+
<Typography variant="body2" className="text-red-700 dark:text-red-300 flex-1">
|
|
1011
|
+
<strong>Warning:</strong> {tableController.dataLoadingError.message || "Failed to update data."}
|
|
1012
|
+
</Typography>
|
|
1013
|
+
</div>
|
|
1014
|
+
)}
|
|
1015
|
+
|
|
1005
1016
|
|
|
1006
1017
|
{/* When isSplitLayout, SplitListView is ALWAYS mounted — regardless
|
|
1007
1018
|
of viewMode. The toolbar + current view live in the left panel;
|
|
@@ -1160,6 +1171,8 @@ export const EntityCollectionView = React.memo(
|
|
|
1160
1171
|
|
|
1161
1172
|
</div>
|
|
1162
1173
|
);
|
|
1174
|
+
|
|
1175
|
+
return mainContent;
|
|
1163
1176
|
}, (a, b) => {
|
|
1164
1177
|
return equal(a.path, b.path) &&
|
|
1165
1178
|
equal(a.parentCollectionSlugs, b.parentCollectionSlugs) && equal(a.parentEntityIds, b.parentEntityIds) &&
|
|
@@ -1182,7 +1195,67 @@ export const EntityCollectionView = React.memo(
|
|
|
1182
1195
|
equal(a.fixedFilter, b.fixedFilter) &&
|
|
1183
1196
|
equal(a.selectedEntityId, b.selectedEntityId) &&
|
|
1184
1197
|
equal(a.selectedTab, b.selectedTab);
|
|
1185
|
-
}) as React.FunctionComponent<EntityCollectionViewProps<any
|
|
1198
|
+
}) as React.FunctionComponent<EntityCollectionViewProps<any>>;
|
|
1199
|
+
|
|
1200
|
+
export const EntityCollectionView = React.memo(
|
|
1201
|
+
function EntityCollectionView<M extends Record<string, unknown>>(props: EntityCollectionViewProps<M>) {
|
|
1202
|
+
const collectionRegistry = useCollectionRegistryController();
|
|
1203
|
+
const path = props.path ?? props.slug;
|
|
1204
|
+
const collection = collectionRegistry.getCollection(path) ?? props;
|
|
1205
|
+
|
|
1206
|
+
const content = <EntityCollectionViewInner {...props} />;
|
|
1207
|
+
|
|
1208
|
+
if (collection?.components) {
|
|
1209
|
+
return (
|
|
1210
|
+
<CollectionComponentOverrideProvider overrides={collection.components}>
|
|
1211
|
+
{content}
|
|
1212
|
+
</CollectionComponentOverrideProvider>
|
|
1213
|
+
);
|
|
1214
|
+
}
|
|
1215
|
+
return content;
|
|
1216
|
+
}
|
|
1217
|
+
) as React.FunctionComponent<EntityCollectionViewProps<any>>;
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* Default empty state shown when a collection has no entities.
|
|
1221
|
+
* Used as the fallback for the `"Collection.EmptyState"` component override.
|
|
1222
|
+
*
|
|
1223
|
+
* @internal
|
|
1224
|
+
*/
|
|
1225
|
+
function DefaultCollectionEmptyState({
|
|
1226
|
+
canCreate,
|
|
1227
|
+
onNewClick,
|
|
1228
|
+
isSearching,
|
|
1229
|
+
searchString
|
|
1230
|
+
}: {
|
|
1231
|
+
canCreate: boolean;
|
|
1232
|
+
onNewClick: () => void;
|
|
1233
|
+
isSearching: boolean;
|
|
1234
|
+
searchString: string;
|
|
1235
|
+
}) {
|
|
1236
|
+
const { t } = useTranslation();
|
|
1237
|
+
if (canCreate) {
|
|
1238
|
+
return (
|
|
1239
|
+
<div className="flex flex-col items-center justify-center">
|
|
1240
|
+
<Typography variant={"subtitle2"}>{t("so_empty")}</Typography>
|
|
1241
|
+
<Button
|
|
1242
|
+
onClick={onNewClick}
|
|
1243
|
+
className="mt-4"
|
|
1244
|
+
>
|
|
1245
|
+
<PlusIcon/>
|
|
1246
|
+
{t("create_your_first_entry")}
|
|
1247
|
+
</Button>
|
|
1248
|
+
</div>
|
|
1249
|
+
);
|
|
1250
|
+
}
|
|
1251
|
+
return (
|
|
1252
|
+
<Typography variant={"label"}>
|
|
1253
|
+
{isSearching
|
|
1254
|
+
? t("no_results_search", { search: searchString })
|
|
1255
|
+
: t("no_results_filter_sort")}
|
|
1256
|
+
</Typography>
|
|
1257
|
+
);
|
|
1258
|
+
}
|
|
1186
1259
|
|
|
1187
1260
|
/**
|
|
1188
1261
|
* Inflight count request deduplication map.
|
|
@@ -112,7 +112,8 @@ export function EntityCollectionViewActions<M extends Record<string, unknown>>({
|
|
|
112
112
|
const actionProps: CollectionActionsProps<M> = {
|
|
113
113
|
path,
|
|
114
114
|
relativePath,
|
|
115
|
-
parentCollectionSlugs,
|
|
115
|
+
parentCollectionSlugs,
|
|
116
|
+
parentEntityIds,
|
|
116
117
|
collection,
|
|
117
118
|
selectionController,
|
|
118
119
|
context,
|
|
@@ -3,7 +3,7 @@ import type { EntityCollection } from "@rebasepro/types";
|
|
|
3
3
|
import React, { useState, useCallback } from "react";
|
|
4
4
|
import { useAuthController, useLargeLayout, useTranslation, useSlot } from "@rebasepro/core";
|
|
5
5
|
import { CollectionActionsProps, EntityTableController, SelectionController } from "@rebasepro/types";
|
|
6
|
-
import { ErrorBoundary
|
|
6
|
+
import { ErrorBoundary, iconSize } from "@rebasepro/ui";
|
|
7
7
|
import { ArrowLeftIcon, Badge, Button, cls, FilterIcon, IconButton, Tooltip } from "@rebasepro/ui";
|
|
8
8
|
import { ClearFilterSortButton } from "../ClearFilterSortButton";
|
|
9
9
|
import { FiltersDialog } from "./FiltersDialog";
|
|
@@ -61,7 +61,8 @@ export function EntityCollectionViewStartActions<M extends Record<string, unknow
|
|
|
61
61
|
const actionProps: CollectionActionsProps<M> = {
|
|
62
62
|
path,
|
|
63
63
|
relativePath,
|
|
64
|
-
parentCollectionSlugs,
|
|
64
|
+
parentCollectionSlugs,
|
|
65
|
+
parentEntityIds,
|
|
65
66
|
collection,
|
|
66
67
|
selectionController,
|
|
67
68
|
context,
|
|
@@ -79,8 +79,10 @@ function generateLabel(filterValues: FilterValues<string>): string {
|
|
|
79
79
|
* Truncate a label if it exceeds MAX_LABEL_LENGTH.
|
|
80
80
|
*/
|
|
81
81
|
function truncateLabel(label: string): { display: string; truncated: boolean } {
|
|
82
|
-
if (label.length <= MAX_LABEL_LENGTH) return { display: label,
|
|
83
|
-
|
|
82
|
+
if (label.length <= MAX_LABEL_LENGTH) return { display: label,
|
|
83
|
+
truncated: false };
|
|
84
|
+
return { display: label.slice(0, MAX_LABEL_LENGTH - 1) + "…",
|
|
85
|
+
truncated: true };
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
// ─── Overflow Menu ──────────────────────────────────────────────────
|
|
@@ -276,7 +276,7 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
|
|
|
276
276
|
if (isCleaningUpRef.current) return;
|
|
277
277
|
|
|
278
278
|
const pendingMap = pendingItemsRef.current;
|
|
279
|
-
|
|
279
|
+
|
|
280
280
|
// Apply pending updates to incoming entities
|
|
281
281
|
const mergedEntities = entities.map(e => {
|
|
282
282
|
const pending = pendingMap[String(e.id)];
|
|
@@ -284,7 +284,7 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
|
|
|
284
284
|
// Check if DB entity has caught up to the expected column and order
|
|
285
285
|
const expectedCol = pending.expectedValues[currentColumnProperty];
|
|
286
286
|
const expectedOrder = currentOrderProperty ? pending.expectedValues[currentOrderProperty] : undefined;
|
|
287
|
-
|
|
287
|
+
|
|
288
288
|
let caughtUp = true;
|
|
289
289
|
if (e.values?.[currentColumnProperty] !== expectedCol) {
|
|
290
290
|
caughtUp = false;
|
|
@@ -292,15 +292,17 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
|
|
|
292
292
|
if (currentOrderProperty && e.values?.[currentOrderProperty] !== expectedOrder) {
|
|
293
293
|
caughtUp = false;
|
|
294
294
|
}
|
|
295
|
-
|
|
295
|
+
|
|
296
296
|
if (caughtUp) {
|
|
297
297
|
// DB has caught up, clear pending state
|
|
298
298
|
delete pendingMap[String(e.id)];
|
|
299
299
|
return e; // Use the real DB entity
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
|
|
302
302
|
// DB hasn't caught up, overlay expected values
|
|
303
|
-
return { ...e,
|
|
303
|
+
return { ...e,
|
|
304
|
+
values: { ...e.values,
|
|
305
|
+
...pending.expectedValues } };
|
|
304
306
|
}
|
|
305
307
|
return e;
|
|
306
308
|
});
|
|
@@ -326,14 +328,14 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
|
|
|
326
328
|
processed = [...processed].sort((a, b) => {
|
|
327
329
|
const valA = a.values?.[currentOrderProperty] as string | undefined | null;
|
|
328
330
|
const valB = b.values?.[currentOrderProperty] as string | undefined | null;
|
|
329
|
-
|
|
331
|
+
|
|
330
332
|
const isAEmpty = valA === undefined || valA === null || valA === "";
|
|
331
333
|
const isBEmpty = valB === undefined || valB === null || valB === "";
|
|
332
|
-
|
|
334
|
+
|
|
333
335
|
if (isAEmpty && isBEmpty) return 0;
|
|
334
336
|
if (isAEmpty) return 1;
|
|
335
337
|
if (isBEmpty) return -1;
|
|
336
|
-
|
|
338
|
+
|
|
337
339
|
return valA < valB ? -1 : valA > valB ? 1 : 0;
|
|
338
340
|
});
|
|
339
341
|
}
|
|
@@ -618,7 +620,7 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
|
|
|
618
620
|
...itemToMove.values,
|
|
619
621
|
...(newValues || {})
|
|
620
622
|
};
|
|
621
|
-
|
|
623
|
+
|
|
622
624
|
const updatedEntity = {
|
|
623
625
|
...itemToMove,
|
|
624
626
|
values: newValuesMerged
|
|
@@ -631,7 +633,7 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
|
|
|
631
633
|
};
|
|
632
634
|
|
|
633
635
|
const targetEntities = sourceColumn === targetColumn ? sourceEntities : [...(updated[targetColumn]?.entities || [])];
|
|
634
|
-
|
|
636
|
+
|
|
635
637
|
if (newIndex !== undefined && newIndex >= 0 && newIndex <= targetEntities.length) {
|
|
636
638
|
targetEntities.splice(newIndex, 0, updatedEntity);
|
|
637
639
|
} else {
|
|
@@ -641,15 +643,15 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
|
|
|
641
643
|
targetEntities.sort((a, b) => {
|
|
642
644
|
const valA = a.values?.[orderProp] as string | undefined | null;
|
|
643
645
|
const valB = b.values?.[orderProp] as string | undefined | null;
|
|
644
|
-
|
|
646
|
+
|
|
645
647
|
// Handle nulls/empty strings to match Postgres NULLS LAST (ASC) behavior
|
|
646
648
|
const isAEmpty = valA === undefined || valA === null || valA === "";
|
|
647
649
|
const isBEmpty = valB === undefined || valB === null || valB === "";
|
|
648
|
-
|
|
650
|
+
|
|
649
651
|
if (isAEmpty && isBEmpty) return 0;
|
|
650
652
|
if (isAEmpty) return 1; // A is null, B is not -> A goes after B
|
|
651
653
|
if (isBEmpty) return -1; // B is null, A is not -> A goes before B
|
|
652
|
-
|
|
654
|
+
|
|
653
655
|
return valA < valB ? -1 : valA > valB ? 1 : 0;
|
|
654
656
|
});
|
|
655
657
|
}
|
|
@@ -658,8 +660,8 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
|
|
|
658
660
|
updated[sourceColumn] = {
|
|
659
661
|
...updated[sourceColumn],
|
|
660
662
|
entities: sourceColumn === targetColumn ? targetEntities : sourceEntities,
|
|
661
|
-
totalCount: sourceColumn === targetColumn
|
|
662
|
-
? updated[sourceColumn].totalCount
|
|
663
|
+
totalCount: sourceColumn === targetColumn
|
|
664
|
+
? updated[sourceColumn].totalCount
|
|
663
665
|
: Math.max(0, (updated[sourceColumn].totalCount ?? 0) - 1)
|
|
664
666
|
};
|
|
665
667
|
|
|
@@ -166,31 +166,38 @@ export function resolveCollectionSlotKeys(
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
// Relations: collect
|
|
170
|
-
//
|
|
171
|
-
//
|
|
169
|
+
// Relations: collect relation property keys for chip rendering.
|
|
170
|
+
// When propertiesOrder is explicitly set, skip this — relations will
|
|
171
|
+
// be shown in the developer-defined order, not as separate chips.
|
|
172
|
+
const hasExplicitOrder = !!(collection.propertiesOrder as string[] | undefined);
|
|
172
173
|
const relationKeys: string[] = [];
|
|
173
|
-
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
if (!hasExplicitOrder) {
|
|
175
|
+
for (const [key, prop] of Object.entries(collection.properties)) {
|
|
176
|
+
const p = prop as Property;
|
|
177
|
+
if (p.type === "relation") {
|
|
178
|
+
relationKeys.push(key);
|
|
179
|
+
}
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
182
|
|
|
180
|
-
// Subtitle: first preview key that isn't title/image/status/date/
|
|
183
|
+
// Subtitle: first preview key that isn't title/image/status/date/id.
|
|
184
|
+
// When propertiesOrder is not set, also exclude relation keys (they render as chips).
|
|
181
185
|
// Prefer string fields (especially multiline/description-like) over numbers.
|
|
182
186
|
const excludeKeys = new Set([titleKey, imageKey, statusKey, dateKey, ...relationKeys]);
|
|
183
187
|
const previewKeys = getEntityPreviewKeys(authController, collection, propertyConfigs, undefined, 10)
|
|
184
188
|
.filter(k => !excludeKeys.has(k) && k !== "id");
|
|
185
189
|
|
|
186
|
-
//
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
// When propertiesOrder is set, respect the developer-defined order (no re-sorting).
|
|
191
|
+
// When not set, sort: strings first (prefer multiline → good description candidate).
|
|
192
|
+
const sortedPreviewKeys = hasExplicitOrder
|
|
193
|
+
? previewKeys
|
|
194
|
+
: [...previewKeys].sort((a, b) => {
|
|
195
|
+
const propA = collection.properties[a] as Property | undefined;
|
|
196
|
+
const propB = collection.properties[b] as Property | undefined;
|
|
197
|
+
const scoreA = propA?.type === "string" ? (propA.multiline ? 2 : 1) : 0;
|
|
198
|
+
const scoreB = propB?.type === "string" ? (propB.multiline ? 2 : 1) : 0;
|
|
199
|
+
return scoreB - scoreA;
|
|
200
|
+
});
|
|
194
201
|
const subtitleKey = sortedPreviewKeys.length > 0 ? sortedPreviewKeys[0] : undefined;
|
|
195
202
|
|
|
196
203
|
return { titleKey,
|
|
@@ -333,7 +340,7 @@ value: val };
|
|
|
333
340
|
const items: RelationChipItem[] = [];
|
|
334
341
|
let totalCount = 0;
|
|
335
342
|
|
|
336
|
-
const isMany = prop.relation?.cardinality === "many";
|
|
343
|
+
const isMany = prop.cardinality === "many" || prop.relation?.cardinality === "many";
|
|
337
344
|
|
|
338
345
|
if (isMany && Array.isArray(val)) {
|
|
339
346
|
// cardinality:"many" → array of EntityRelation
|
|
@@ -351,9 +358,12 @@ id });
|
|
|
351
358
|
}
|
|
352
359
|
} else if (!isMany && val && typeof val === "object") {
|
|
353
360
|
// cardinality:"one" → single EntityRelation
|
|
354
|
-
const
|
|
361
|
+
const obj = val as Record<string, unknown>;
|
|
362
|
+
const isRelation = ("__type" in obj && obj.__type === "relation")
|
|
363
|
+
|| (typeof obj.isEntityRelation === "function"
|
|
364
|
+
&& (obj.isEntityRelation as () => boolean)());
|
|
355
365
|
if (isRelation) {
|
|
356
|
-
const relation =
|
|
366
|
+
const relation = obj as unknown as EntityRelation;
|
|
357
367
|
const displayName = resolveRelationDisplayName(relation, prop);
|
|
358
368
|
totalCount = 1;
|
|
359
369
|
if (displayName) {
|