@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
|
@@ -44,4 +44,8 @@ export interface PropertyPreviewProps<P extends Property | Property, CustomProps
|
|
|
44
44
|
* Only applies to image type properties.
|
|
45
45
|
*/
|
|
46
46
|
fill?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* If true, relations/references will render as plain text strings rather than full cards.
|
|
49
|
+
*/
|
|
50
|
+
textOnly?: boolean;
|
|
47
51
|
}
|
|
@@ -1,40 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export type FormexController<T extends object> = {
|
|
3
|
-
values: T;
|
|
4
|
-
initialValues: T;
|
|
5
|
-
setValues: (values: T) => void;
|
|
6
|
-
setFieldValue: (key: string, value: unknown, shouldValidate?: boolean) => void;
|
|
7
|
-
touched: Record<string, boolean>;
|
|
8
|
-
setFieldTouched: (key: string, touched: boolean, shouldValidate?: boolean) => void;
|
|
9
|
-
setTouched: (touched: Record<string, boolean>) => void;
|
|
10
|
-
dirty: boolean;
|
|
11
|
-
setDirty: (dirty: boolean) => void;
|
|
12
|
-
setSubmitCount: (submitCount: number) => void;
|
|
13
|
-
errors: Record<string, string>;
|
|
14
|
-
setFieldError: (key: string, error?: string) => void;
|
|
15
|
-
handleChange: (event: React.SyntheticEvent) => void;
|
|
16
|
-
handleBlur: (event: React.FocusEvent) => void;
|
|
17
|
-
handleSubmit: (event?: FormEvent<HTMLFormElement>) => void;
|
|
18
|
-
validate: () => void;
|
|
19
|
-
resetForm: (props?: FormexResetProps<T>) => void;
|
|
20
|
-
submitCount: number;
|
|
21
|
-
isSubmitting: boolean;
|
|
22
|
-
setSubmitting: (isSubmitting: boolean) => void;
|
|
23
|
-
isValidating: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* The version of the form. This is incremented every time the form is reset
|
|
26
|
-
* or the form is submitted.
|
|
27
|
-
*/
|
|
28
|
-
version: number;
|
|
29
|
-
debugId?: string;
|
|
30
|
-
undo: () => void;
|
|
31
|
-
redo: () => void;
|
|
32
|
-
canUndo: boolean;
|
|
33
|
-
canRedo: boolean;
|
|
34
|
-
};
|
|
35
|
-
export type FormexResetProps<T extends object> = {
|
|
36
|
-
values?: T;
|
|
37
|
-
submitCount?: number;
|
|
38
|
-
errors?: Record<string, string>;
|
|
39
|
-
touched?: Record<string, boolean>;
|
|
40
|
-
};
|
|
1
|
+
export type { FormexController, FormexResetProps } from "@rebasepro/formex";
|
package/dist/types/fields.d.ts
CHANGED
|
@@ -123,9 +123,17 @@ export interface FormContext<M extends Record<string, unknown> = Record<string,
|
|
|
123
123
|
*/
|
|
124
124
|
setFieldValue: (key: string, value: unknown, shouldValidate?: boolean) => void;
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
126
|
+
* Quietly persist the entity to the database without any UI feedback
|
|
127
|
+
* (no validation, no snackbar, no form reset).
|
|
128
|
+
* Use this for programmatic/background saves from custom views.
|
|
127
129
|
*/
|
|
128
130
|
save: (values: M) => void;
|
|
131
|
+
/**
|
|
132
|
+
* Submit the form — validates, saves, resets the form, and shows
|
|
133
|
+
* a success snackbar. This is what the Save button calls.
|
|
134
|
+
* Use this from custom views when you want the full "user saved" experience.
|
|
135
|
+
*/
|
|
136
|
+
submit: () => void;
|
|
129
137
|
/**
|
|
130
138
|
* Collection of the entity being modified
|
|
131
139
|
*/
|
|
@@ -4,7 +4,7 @@ export { removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlas
|
|
|
4
4
|
* Navigate to an entity using either a side panel or full-screen mode.
|
|
5
5
|
* This is an admin-specific UI concern and lives here (not in common).
|
|
6
6
|
*/
|
|
7
|
-
export declare function navigateToEntity({ openEntityMode, collection, entityId, copy, path, selectedTab, defaultValues, sideEntityController, onClose, navigation }: {
|
|
7
|
+
export declare function navigateToEntity({ openEntityMode, collection, entityId, copy, path, selectedTab, defaultValues, sideEntityController, onClose, navigation, replace }: {
|
|
8
8
|
openEntityMode: "side_panel" | "full_screen" | "split" | "dialog";
|
|
9
9
|
collection?: EntityCollection;
|
|
10
10
|
entityId?: string | number;
|
|
@@ -23,4 +23,5 @@ export declare function navigateToEntity({ openEntityMode, collection, entityId,
|
|
|
23
23
|
sideEntityController: SideEntityController;
|
|
24
24
|
onClose?: () => void;
|
|
25
25
|
navigation: UrlController;
|
|
26
|
+
replace?: boolean;
|
|
26
27
|
}): void;
|
package/dist/util/previews.d.ts
CHANGED
|
@@ -2,3 +2,8 @@ import type { EntityCollection, PropertyConfig } from "@rebasepro/types";
|
|
|
2
2
|
import { AuthController } from "@rebasepro/types";
|
|
3
3
|
export declare function getEntityPreviewKeys(authController: AuthController, targetCollection: EntityCollection<any>, fields: Record<string, PropertyConfig>, previewProperties?: string[], limit?: number): string[];
|
|
4
4
|
export declare function getEntityTitlePropertyKey<M extends Record<string, unknown>>(collection: EntityCollection<M>, propertyConfigs: Record<string, PropertyConfig>): string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Attempt to turn a title value (which might be a relation, reference, date, array, or other complex object)
|
|
7
|
+
* into a renderable, human-readable string.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveTitleToString(title: any): string;
|
|
@@ -4,7 +4,7 @@ import React from "react";
|
|
|
4
4
|
import type { IconSize } from "@rebasepro/ui";
|
|
5
5
|
export declare function isReferenceProperty(property: Property): boolean | null;
|
|
6
6
|
export declare function isRelationProperty(property: Property): boolean | null;
|
|
7
|
-
export declare function getIconForWidget(widget: PropertyConfig | undefined, size: IconSize | number):
|
|
7
|
+
export declare function getIconForWidget(widget: PropertyConfig | undefined, size: IconSize | number): React.JSX.Element;
|
|
8
8
|
export declare function getIconForProperty(property: Property, size?: IconSize | number, fields?: Record<string, PropertyConfig>): React.ReactNode;
|
|
9
9
|
/**
|
|
10
10
|
* Get a property in a property tree from a path like
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/admin",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.1",
|
|
5
5
|
"description": "Rebase CMS — content management views, forms, and routing",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/rebaseco"
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"@dnd-kit/utilities": "^3.2.2",
|
|
57
57
|
"@floating-ui/dom": "^1.7.6",
|
|
58
58
|
"cmdk": "^1.1.1",
|
|
59
|
-
"date-fns": "^
|
|
59
|
+
"date-fns": "^4.4.0",
|
|
60
60
|
"exceljs": "^4.4.0",
|
|
61
61
|
"fast-equals": "6.0.0",
|
|
62
62
|
"fractional-indexing": "3.2.0",
|
|
63
|
-
"fuse.js": "^7.
|
|
63
|
+
"fuse.js": "^7.4.2",
|
|
64
64
|
"json5": "^2.2.3",
|
|
65
|
-
"markdown-it": "^14.
|
|
65
|
+
"markdown-it": "^14.2.0",
|
|
66
66
|
"markdown-it-ins": "^4.0.0",
|
|
67
67
|
"markdown-it-mark": "^4.0.0",
|
|
68
68
|
"markdown-it-task-lists": "^2.1.1",
|
|
@@ -74,22 +74,22 @@
|
|
|
74
74
|
"prosemirror-inputrules": "^1.5.1",
|
|
75
75
|
"prosemirror-keymap": "^1.2.3",
|
|
76
76
|
"prosemirror-markdown": "^1.13.4",
|
|
77
|
-
"prosemirror-model": "^1.25.
|
|
77
|
+
"prosemirror-model": "^1.25.8",
|
|
78
78
|
"prosemirror-schema-list": "^1.5.1",
|
|
79
79
|
"prosemirror-state": "^1.4.4",
|
|
80
80
|
"prosemirror-tables": "^1.8.5",
|
|
81
81
|
"prosemirror-transform": "^1.12.0",
|
|
82
|
-
"prosemirror-view": "^1.41.
|
|
83
|
-
"
|
|
84
|
-
"react-dropzone": "^14.4.1",
|
|
82
|
+
"prosemirror-view": "^1.41.9",
|
|
83
|
+
"react-dropzone": "^15.0.0",
|
|
85
84
|
"react-use-measure": "^2.1.7",
|
|
86
|
-
"
|
|
87
|
-
"@rebasepro/
|
|
88
|
-
"@rebasepro/
|
|
89
|
-
"@rebasepro/schema-inference": "0.
|
|
90
|
-
"@rebasepro/
|
|
91
|
-
"@rebasepro/types": "0.
|
|
92
|
-
"@rebasepro/
|
|
85
|
+
"zod": "^4.4.3",
|
|
86
|
+
"@rebasepro/core": "0.6.1",
|
|
87
|
+
"@rebasepro/formex": "0.6.1",
|
|
88
|
+
"@rebasepro/schema-inference": "0.6.1",
|
|
89
|
+
"@rebasepro/common": "0.6.1",
|
|
90
|
+
"@rebasepro/types": "0.6.1",
|
|
91
|
+
"@rebasepro/utils": "0.6.1",
|
|
92
|
+
"@rebasepro/ui": "0.6.1"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"react": ">=19.0.0",
|
|
@@ -100,19 +100,19 @@
|
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@jest/globals": "^30.4.1",
|
|
102
102
|
"@testing-library/react": "^16.3.2",
|
|
103
|
-
"@types/jest": "^
|
|
103
|
+
"@types/jest": "^30.0.0",
|
|
104
104
|
"@types/markdown-it": "^14.1.2",
|
|
105
|
-
"@types/node": "^
|
|
106
|
-
"@types/react": "^19.2.
|
|
105
|
+
"@types/node": "^25.9.3",
|
|
106
|
+
"@types/react": "^19.2.17",
|
|
107
107
|
"@types/react-dom": "^19.2.3",
|
|
108
108
|
"@types/react-measure": "^2.0.12",
|
|
109
|
-
"@vitejs/plugin-react": "^
|
|
110
|
-
"jest": "^
|
|
111
|
-
"react-router": "^7.
|
|
112
|
-
"react-router-dom": "^7.
|
|
113
|
-
"ts-jest": "^29.4.
|
|
114
|
-
"typescript": "^
|
|
115
|
-
"vite": "^
|
|
109
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
110
|
+
"jest": "^30.4.2",
|
|
111
|
+
"react-router": "^7.17.0",
|
|
112
|
+
"react-router-dom": "^7.17.0",
|
|
113
|
+
"ts-jest": "^29.4.11",
|
|
114
|
+
"typescript": "^6.0.3",
|
|
115
|
+
"vite": "^8.0.16"
|
|
116
116
|
},
|
|
117
117
|
"files": [
|
|
118
118
|
"dist",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
},
|
|
131
131
|
"jest": {
|
|
132
132
|
"transform": {
|
|
133
|
-
"^.+\\.
|
|
133
|
+
"^.+\\.[jt]sx?$": "ts-jest"
|
|
134
134
|
},
|
|
135
135
|
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
|
|
136
136
|
"moduleFileExtensions": [
|
|
@@ -145,6 +145,9 @@
|
|
|
145
145
|
"testPathIgnorePatterns": [
|
|
146
146
|
"/node_modules/"
|
|
147
147
|
],
|
|
148
|
+
"transformIgnorePatterns": [
|
|
149
|
+
"node_modules/(?!.*fractional-indexing)/"
|
|
150
|
+
],
|
|
148
151
|
"setupFilesAfterEnv": [
|
|
149
152
|
"<rootDir>/test/setupTests.ts"
|
|
150
153
|
],
|
|
@@ -27,7 +27,6 @@ export interface ConfigControllerProviderProps {
|
|
|
27
27
|
collectionInference?: CollectionInference;
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
extraView?: {
|
|
32
31
|
View: React.ComponentType<{
|
|
33
32
|
path: string
|
|
@@ -119,7 +118,6 @@ export const ConfigControllerProvider = React.memo(
|
|
|
119
118
|
}>();
|
|
120
119
|
|
|
121
120
|
|
|
122
|
-
|
|
123
121
|
const editCollection = useCallback(({
|
|
124
122
|
id,
|
|
125
123
|
path,
|
|
@@ -145,7 +143,8 @@ export const ConfigControllerProvider = React.memo(
|
|
|
145
143
|
setCurrentDialog({
|
|
146
144
|
editedCollectionId: id,
|
|
147
145
|
path,
|
|
148
|
-
parentCollectionSlugs,
|
|
146
|
+
parentCollectionSlugs,
|
|
147
|
+
parentEntityIds,
|
|
149
148
|
isNewCollection: false,
|
|
150
149
|
parentCollection,
|
|
151
150
|
redirect: false,
|
|
@@ -191,7 +190,8 @@ export const ConfigControllerProvider = React.memo(
|
|
|
191
190
|
namespace,
|
|
192
191
|
currentPropertiesOrder,
|
|
193
192
|
editedCollectionId,
|
|
194
|
-
parentCollectionSlugs,
|
|
193
|
+
parentCollectionSlugs,
|
|
194
|
+
parentEntityIds,
|
|
195
195
|
|
|
196
196
|
existingEntities,
|
|
197
197
|
collection
|
|
@@ -217,7 +217,8 @@ export const ConfigControllerProvider = React.memo(
|
|
|
217
217
|
sourceClick?: string
|
|
218
218
|
}) => {
|
|
219
219
|
console.debug("Create collection", {
|
|
220
|
-
parentCollectionSlugs,
|
|
220
|
+
parentCollectionSlugs,
|
|
221
|
+
parentEntityIds,
|
|
221
222
|
parentCollection,
|
|
222
223
|
initialValues,
|
|
223
224
|
copyFrom,
|
|
@@ -225,7 +226,8 @@ export const ConfigControllerProvider = React.memo(
|
|
|
225
226
|
sourceClick
|
|
226
227
|
});
|
|
227
228
|
onAnalyticsEvent?.(copyFrom ? "duplicate_collection" : "create_collection", {
|
|
228
|
-
parentCollectionSlugs,
|
|
229
|
+
parentCollectionSlugs,
|
|
230
|
+
parentEntityIds,
|
|
229
231
|
parentCollection,
|
|
230
232
|
initialValues,
|
|
231
233
|
redirect,
|
|
@@ -233,7 +235,8 @@ export const ConfigControllerProvider = React.memo(
|
|
|
233
235
|
});
|
|
234
236
|
setCurrentDialog({
|
|
235
237
|
isNewCollection: true,
|
|
236
|
-
parentCollectionSlugs,
|
|
238
|
+
parentCollectionSlugs,
|
|
239
|
+
parentEntityIds,
|
|
237
240
|
parentCollection,
|
|
238
241
|
initialValues,
|
|
239
242
|
copyFrom,
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
Dialog,
|
|
16
16
|
DialogActions,
|
|
17
17
|
DialogContent,
|
|
18
|
+
DialogTitle,
|
|
18
19
|
IconButton,
|
|
19
20
|
PlusIcon,
|
|
20
21
|
TextField,
|
|
@@ -159,6 +160,7 @@ export function AddKanbanColumnAction({
|
|
|
159
160
|
</div>
|
|
160
161
|
|
|
161
162
|
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
|
|
163
|
+
<DialogTitle hidden>{t("studio_add_kanban_column_title")}</DialogTitle>
|
|
162
164
|
<DialogContent className="max-w-md">
|
|
163
165
|
<Typography variant="h6" className="mb-4">
|
|
164
166
|
{t("studio_add_kanban_column_title")}
|
|
@@ -36,7 +36,8 @@ export function CollectionViewHeaderAction({
|
|
|
36
36
|
propertyKey,
|
|
37
37
|
property,
|
|
38
38
|
editedCollectionId: collection.slug,
|
|
39
|
-
parentCollectionSlugs,
|
|
39
|
+
parentCollectionSlugs,
|
|
40
|
+
parentEntityIds,
|
|
40
41
|
collection,
|
|
41
42
|
existingEntities: tableController.data ?? []
|
|
42
43
|
});
|
|
@@ -36,7 +36,8 @@ export function EditorCollectionAction({
|
|
|
36
36
|
? () => collectionEditorController?.editCollection({
|
|
37
37
|
id: collection.slug,
|
|
38
38
|
path,
|
|
39
|
-
parentCollectionSlugs,
|
|
39
|
+
parentCollectionSlugs,
|
|
40
|
+
parentEntityIds,
|
|
40
41
|
parentCollection: parentCollection as EntityCollection,
|
|
41
42
|
existingEntities: tableController?.data ?? []
|
|
42
43
|
})
|
|
@@ -40,7 +40,8 @@ export function EditorCollectionActionStart({
|
|
|
40
40
|
onClick={() => configController
|
|
41
41
|
?.saveCollection({
|
|
42
42
|
id: collection.slug,
|
|
43
|
-
parentCollectionSlugs,
|
|
43
|
+
parentCollectionSlugs,
|
|
44
|
+
parentEntityIds,
|
|
44
45
|
collectionData: mergeDeep(collection as EntityCollection,
|
|
45
46
|
{
|
|
46
47
|
defaultFilter: tableController.filterValues ?? null,
|
|
@@ -33,7 +33,8 @@ export function EditorEntityAction({
|
|
|
33
33
|
? () => collectionEditorController?.editCollection({
|
|
34
34
|
id: collection.slug,
|
|
35
35
|
path,
|
|
36
|
-
parentCollectionSlugs,
|
|
36
|
+
parentCollectionSlugs,
|
|
37
|
+
parentEntityIds,
|
|
37
38
|
parentCollection: parentCollection as EntityCollection
|
|
38
39
|
})
|
|
39
40
|
: undefined}>
|
|
@@ -24,7 +24,8 @@ export function KanbanSetupAction({
|
|
|
24
24
|
const handleConfigureClick = () => {
|
|
25
25
|
collectionEditorController.editCollection({
|
|
26
26
|
id: collection.slug,
|
|
27
|
-
parentCollectionSlugs,
|
|
27
|
+
parentCollectionSlugs,
|
|
28
|
+
parentEntityIds,
|
|
28
29
|
initialView: "display",
|
|
29
30
|
expandKanban: true
|
|
30
31
|
});
|
|
@@ -22,7 +22,8 @@ export function MissingReferenceWidget({ path: pathProp }: {
|
|
|
22
22
|
collectionEditor.createCollection({
|
|
23
23
|
initialValues: { path,
|
|
24
24
|
name: prettifyIdentifier(path) },
|
|
25
|
-
parentCollectionSlugs,
|
|
25
|
+
parentCollectionSlugs,
|
|
26
|
+
parentEntityIds,
|
|
26
27
|
redirect: false,
|
|
27
28
|
sourceClick: "missing_reference"
|
|
28
29
|
});
|
|
@@ -34,7 +34,8 @@ export function PropertyAddColumnComponent({
|
|
|
34
34
|
onClick={canEditCollection ? () => {
|
|
35
35
|
collectionEditorController.editProperty({
|
|
36
36
|
editedCollectionId: collection.slug,
|
|
37
|
-
parentCollectionSlugs,
|
|
37
|
+
parentCollectionSlugs,
|
|
38
|
+
parentEntityIds,
|
|
38
39
|
currentPropertiesOrder: getDefaultPropertiesOrder(collection),
|
|
39
40
|
collection,
|
|
40
41
|
existingEntities: tableController.data
|
|
@@ -111,7 +111,6 @@ export function CollectionDetailsForm({
|
|
|
111
111
|
const collectionIcon = <IconForView collectionOrView={values}/>;
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
|
|
115
114
|
const isSubcollection = !!parentCollection;
|
|
116
115
|
|
|
117
116
|
const showErrors = submitCount > 0;
|
|
@@ -177,7 +176,6 @@ export function CollectionDetailsForm({
|
|
|
177
176
|
</div>
|
|
178
177
|
|
|
179
178
|
|
|
180
|
-
|
|
181
179
|
<LayoutModeSwitch
|
|
182
180
|
className={"col-span-12"}
|
|
183
181
|
value={values.openEntityMode ?? "side_panel"}
|
|
@@ -296,7 +294,8 @@ export function CollectionDetailsForm({
|
|
|
296
294
|
property={{
|
|
297
295
|
type: "string",
|
|
298
296
|
name: dialogPropertyName,
|
|
299
|
-
ui: { disabled: true,
|
|
297
|
+
ui: { disabled: true,
|
|
298
|
+
hideFromCollection: true }
|
|
300
299
|
}}
|
|
301
300
|
propertyKey={dialogPropertyKey}
|
|
302
301
|
existingProperty={false}
|
|
@@ -212,7 +212,6 @@ export function CollectionEditor(props: CollectionEditorDialogProps & {
|
|
|
212
212
|
}, [props.editedCollectionId, props.parentCollectionSlugs, props.parentEntityIds, collectionRegistry.initialised, collectionRegistry.getRawCollection]);
|
|
213
213
|
|
|
214
214
|
|
|
215
|
-
|
|
216
215
|
const initialCollection = collection
|
|
217
216
|
? {
|
|
218
217
|
...collection,
|
|
@@ -100,15 +100,19 @@ export function CollectionPropertiesEditorForm({
|
|
|
100
100
|
|
|
101
101
|
const inferPropertiesFromData = doCollectionInference
|
|
102
102
|
? (): void => {
|
|
103
|
-
|
|
103
|
+
const inferenceFn = doCollectionInference;
|
|
104
|
+
if (!inferenceFn || configController?.readOnly)
|
|
104
105
|
return;
|
|
105
106
|
|
|
106
107
|
setInferringProperties(true);
|
|
107
108
|
|
|
108
109
|
console.debug("CollectionEditor: inferring properties from data", values);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
const promise = inferenceFn(values);
|
|
111
|
+
if (!promise) {
|
|
112
|
+
setInferringProperties(false);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
promise.then((newCollection) => {
|
|
112
116
|
|
|
113
117
|
if (!newCollection) {
|
|
114
118
|
snackbarController.open({
|
|
@@ -196,7 +196,8 @@ export function DisplaySettingsForm({
|
|
|
196
196
|
property={{
|
|
197
197
|
type: "string",
|
|
198
198
|
name: dialogPropertyName,
|
|
199
|
-
ui: { disabled: true,
|
|
199
|
+
ui: { disabled: true,
|
|
200
|
+
hideFromCollection: true }
|
|
200
201
|
}}
|
|
201
202
|
propertyKey={dialogPropertyKey}
|
|
202
203
|
existingProperty={false}
|
|
@@ -51,7 +51,7 @@ import { isValidRegExp, mergeDeep } from "@rebasepro/utils";
|
|
|
51
51
|
|
|
52
52
|
export type PropertyWithId = Property & {
|
|
53
53
|
id?: string;
|
|
54
|
-
conditions?: import(
|
|
54
|
+
conditions?: import("@rebasepro/types").PropertyConditions;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
export type OnPropertyChangedParams = {
|
|
@@ -71,8 +71,11 @@ export function RelationPropertyField({
|
|
|
71
71
|
|
|
72
72
|
const updateThrough = useCallback(
|
|
73
73
|
(patch: Record<string, unknown>) => {
|
|
74
|
-
const currentThrough = values.through ?? { table: "",
|
|
75
|
-
|
|
74
|
+
const currentThrough = values.through ?? { table: "",
|
|
75
|
+
sourceColumn: "",
|
|
76
|
+
targetColumn: "" };
|
|
77
|
+
setFieldValue("through", { ...currentThrough,
|
|
78
|
+
...patch });
|
|
76
79
|
},
|
|
77
80
|
[values.through, setFieldValue]
|
|
78
81
|
);
|
|
@@ -3,7 +3,7 @@ import { EntityCollection, Properties } from "@rebasepro/types";
|
|
|
3
3
|
import { getSubcollections } from "@rebasepro/common";
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import React, { useMemo } from "react";
|
|
6
|
+
import React, { useMemo, useRef } from "react";
|
|
7
7
|
export function useLocalCollectionsConfigController(
|
|
8
8
|
clientOrUrl: any,
|
|
9
9
|
baseCollections: EntityCollection[] = [],
|
|
@@ -14,10 +14,15 @@ export function useLocalCollectionsConfigController(
|
|
|
14
14
|
): CollectionsConfigController {
|
|
15
15
|
|
|
16
16
|
const parsedCollections = baseCollections;
|
|
17
|
+
|
|
18
|
+
// Store latest options in a ref to prevent stale closures in the `request` function
|
|
19
|
+
// due to useMemo caching the saveCollection function.
|
|
20
|
+
const optionsRef = useRef(options);
|
|
21
|
+
optionsRef.current = options;
|
|
17
22
|
|
|
18
23
|
const request = async (endpoint: string, payload: Record<string, unknown>) => {
|
|
19
24
|
try {
|
|
20
|
-
let token =
|
|
25
|
+
let token = optionsRef.current?.getAuthToken ? await optionsRef.current.getAuthToken() : null;
|
|
21
26
|
let baseUrl = typeof clientOrUrl === "string" ? clientOrUrl : "";
|
|
22
27
|
|
|
23
28
|
if (typeof clientOrUrl === "object" && clientOrUrl !== null) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EntityCollection } from "@rebasepro/types";
|
|
1
|
+
import { DataType, EntityCollection } from "@rebasepro/types";
|
|
2
|
+
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Valid dataType values for properties
|
|
@@ -17,7 +18,6 @@ const VALID_DATA_TYPES = [
|
|
|
17
18
|
"binary"
|
|
18
19
|
] as const;
|
|
19
20
|
|
|
20
|
-
type DataType = typeof VALID_DATA_TYPES[number];
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Validation error with path and message
|
|
@@ -402,13 +402,13 @@ export function ArrayContainer<T>({
|
|
|
402
402
|
const newIds = [...internalIds];
|
|
403
403
|
newIds.splice(index, 1);
|
|
404
404
|
setInternalIds(newIds);
|
|
405
|
-
onValueChange(value.filter((_, i) => i !== index));
|
|
405
|
+
onValueChange((value ?? []).filter((_, i) => i !== index));
|
|
406
406
|
};
|
|
407
407
|
|
|
408
408
|
const copy = (index: number) => {
|
|
409
409
|
if ((value ?? []).length >= max) return;
|
|
410
410
|
const id = getRandomId();
|
|
411
|
-
const copyingItem = value[index];
|
|
411
|
+
const copyingItem = (value ?? [])[index];
|
|
412
412
|
const newIds: number[] = [
|
|
413
413
|
...internalIds.slice(0, index + 1),
|
|
414
414
|
id,
|
|
@@ -416,7 +416,7 @@ export function ArrayContainer<T>({
|
|
|
416
416
|
];
|
|
417
417
|
if (onInternalIdAdded) onInternalIdAdded(id);
|
|
418
418
|
setInternalIds(newIds);
|
|
419
|
-
onValueChange([...value.slice(0, index + 1), copyingItem, ...value.slice(index + 1)]);
|
|
419
|
+
onValueChange([...(value ?? []).slice(0, index + 1), copyingItem, ...(value ?? []).slice(index + 1)]);
|
|
420
420
|
};
|
|
421
421
|
|
|
422
422
|
const addInIndex = (index: number) => {
|
|
@@ -429,7 +429,7 @@ export function ArrayContainer<T>({
|
|
|
429
429
|
];
|
|
430
430
|
if (onInternalIdAdded) onInternalIdAdded(id);
|
|
431
431
|
setInternalIds(newIds);
|
|
432
|
-
onValueChange([...value.slice(0, index), newDefaultEntry, ...value.slice(index)]);
|
|
432
|
+
onValueChange([...(value ?? []).slice(0, index), newDefaultEntry, ...(value ?? []).slice(index)]);
|
|
433
433
|
};
|
|
434
434
|
|
|
435
435
|
const onDragEnd = (event: DragEndEvent) => {
|
|
@@ -444,7 +444,7 @@ export function ArrayContainer<T>({
|
|
|
444
444
|
if (oldIndex === -1 || newIndex === -1) return;
|
|
445
445
|
const newIds = arrayMove(internalIds, oldIndex, newIndex);
|
|
446
446
|
setInternalIds(newIds);
|
|
447
|
-
onValueChange(arrayMove(value, oldIndex, newIndex));
|
|
447
|
+
onValueChange(arrayMove(value ?? [], oldIndex, newIndex));
|
|
448
448
|
};
|
|
449
449
|
|
|
450
450
|
return sortable ? (
|
|
@@ -3,6 +3,7 @@ import React, { useMemo } from "react";
|
|
|
3
3
|
import { EntityCollectionView } from "./EntityCollectionView/EntityCollectionView";
|
|
4
4
|
import { useCollectionRegistryController } from "../hooks/navigation/contexts/CollectionRegistryContext";
|
|
5
5
|
import { Typography } from "@rebasepro/ui";
|
|
6
|
+
import { useComponentOverride, CollectionComponentOverrideProvider } from "@rebasepro/core";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Props for the {@link CollectionPanel} component.
|
|
@@ -94,17 +95,44 @@ export type CollectionPanelProps = {
|
|
|
94
95
|
*
|
|
95
96
|
* @group Components
|
|
96
97
|
*/
|
|
97
|
-
|
|
98
|
+
function CollectionPanelInner({
|
|
99
|
+
mergedCollection,
|
|
98
100
|
path,
|
|
99
101
|
title,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
updateUrl,
|
|
103
|
+
className
|
|
104
|
+
}: CollectionPanelProps & { mergedCollection: EntityCollection }) {
|
|
105
|
+
const ResolvedCollectionView = useComponentOverride("Collection.View", EntityCollectionView);
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<div className={className}>
|
|
109
|
+
{title !== false && (
|
|
110
|
+
<Typography
|
|
111
|
+
variant="subtitle2"
|
|
112
|
+
className="font-bold mb-2 text-surface-700 dark:text-surface-300"
|
|
113
|
+
>
|
|
114
|
+
{title ?? mergedCollection.name}
|
|
115
|
+
</Typography>
|
|
116
|
+
)}
|
|
117
|
+
<ResolvedCollectionView
|
|
118
|
+
{...mergedCollection}
|
|
119
|
+
path={path}
|
|
120
|
+
updateUrl={updateUrl}
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function CollectionPanel(props: CollectionPanelProps) {
|
|
127
|
+
const {
|
|
128
|
+
path,
|
|
129
|
+
viewMode,
|
|
130
|
+
sort,
|
|
131
|
+
limit,
|
|
132
|
+
openEntityMode,
|
|
133
|
+
className,
|
|
134
|
+
collectionOverrides
|
|
135
|
+
} = props;
|
|
108
136
|
const collectionRegistry = useCollectionRegistryController();
|
|
109
137
|
const registeredCollection = collectionRegistry.getCollection(path);
|
|
110
138
|
|
|
@@ -135,21 +163,19 @@ export function CollectionPanel({
|
|
|
135
163
|
);
|
|
136
164
|
}
|
|
137
165
|
|
|
138
|
-
|
|
139
|
-
<
|
|
140
|
-
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
className="font-bold mb-2 text-surface-700 dark:text-surface-300"
|
|
144
|
-
>
|
|
145
|
-
{title ?? mergedCollection.name}
|
|
146
|
-
</Typography>
|
|
147
|
-
)}
|
|
148
|
-
<EntityCollectionView
|
|
149
|
-
{...mergedCollection}
|
|
150
|
-
path={path}
|
|
151
|
-
updateUrl={updateUrl}
|
|
152
|
-
/>
|
|
153
|
-
</div>
|
|
166
|
+
const content = (
|
|
167
|
+
<CollectionPanelInner
|
|
168
|
+
{...props}
|
|
169
|
+
mergedCollection={mergedCollection}
|
|
170
|
+
/>
|
|
154
171
|
);
|
|
172
|
+
|
|
173
|
+
if (mergedCollection.components) {
|
|
174
|
+
return (
|
|
175
|
+
<CollectionComponentOverrideProvider overrides={mergedCollection.components}>
|
|
176
|
+
{content}
|
|
177
|
+
</CollectionComponentOverrideProvider>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
return content;
|
|
155
181
|
}
|