@rebasepro/admin 0.10.0 → 0.10.1-canary.0a881d4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CollectionEditorDialog-BOlKGGg7.js → CollectionEditorDialog-DMztwJ5S.js} +12 -12
- package/dist/CollectionEditorDialog-DMztwJ5S.js.map +1 -0
- package/dist/{PropertyEditView-i51tFOfM.js → PropertyEditView-CjFCnftn.js} +18 -18
- package/dist/PropertyEditView-CjFCnftn.js.map +1 -0
- package/dist/{RouterCollectionsStudioView-Dh4W53PU.js → RouterCollectionsStudioView-nDFQdKHA.js} +4 -4
- package/dist/RouterCollectionsStudioView-nDFQdKHA.js.map +1 -0
- package/dist/collection_editor/api/generateCollectionApi.d.ts +4 -4
- package/dist/collection_editor/pgColumnToProperty.d.ts +4 -3
- package/dist/collection_editor/serializable_types.d.ts +31 -30
- package/dist/collection_editor/serializable_utils.d.ts +6 -5
- package/dist/collection_editor/types/collection_editor_controller.d.ts +6 -5
- package/dist/collection_editor/types/collection_inference.d.ts +3 -2
- package/dist/collection_editor/types/config_controller.d.ts +8 -7
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -2
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +3 -2
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -2
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +3 -3
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +5 -4
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +4 -3
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -1
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +2 -2
- package/dist/collection_editor/validateCollectionJson.d.ts +2 -2
- package/dist/collection_editor_ui.js +4 -4
- package/dist/components/AdminModeSyncer.d.ts +1 -1
- package/dist/components/ClearFilterSortButton.d.ts +1 -1
- package/dist/components/CollectionPanel.d.ts +2 -2
- package/dist/components/CollectionTableBinding/CollectionRowActions.d.ts +4 -4
- package/dist/components/CollectionTableBinding/CollectionTableBinding.d.ts +1 -1
- package/dist/components/CollectionTableBinding/CollectionTableBindingProps.d.ts +3 -2
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.d.ts +3 -3
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.d.ts +3 -3
- package/dist/components/CollectionTableBinding/fields/TableRelationField.d.ts +3 -3
- package/dist/components/CollectionTableBinding/internal/common.d.ts +2 -2
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.d.ts +2 -2
- package/dist/components/CollectionViewBinding/BoardCardBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/CollectionViewActions.d.ts +2 -3
- package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +2 -2
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +2 -3
- package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +3 -3
- package/dist/components/CollectionViewBinding/FilterPresetsButton.d.ts +2 -1
- package/dist/components/CollectionViewBinding/SplitListView.d.ts +3 -3
- package/dist/components/CollectionViewBinding/ViewModeToggle.d.ts +1 -1
- package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.d.ts +3 -2
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.d.ts +3 -2
- package/dist/components/CollectionViewBinding/useBoardDataController.d.ts +2 -2
- package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +9 -6
- package/dist/components/CollectionViewBinding/useSelectionController.d.ts +2 -1
- package/dist/components/DeleteEntityDialog.d.ts +2 -2
- package/dist/components/DetailViewBinding.d.ts +3 -3
- package/dist/components/DrawerNavigationGroup.d.ts +1 -1
- package/dist/components/EditViewBinding.d.ts +3 -3
- package/dist/components/EntityPreviewBinding.d.ts +3 -3
- package/dist/components/EntityViewBinding.d.ts +2 -2
- package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +1 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +1 -1
- package/dist/components/PropertyConfigBadge.d.ts +1 -1
- package/dist/components/RebaseAdmin.d.ts +1 -1
- package/dist/components/RebaseLayout.d.ts +1 -1
- package/dist/components/ReferenceTable/SelectionTableBinding.d.ts +2 -2
- package/dist/components/SelectableTable/SelectableTable.d.ts +3 -2
- package/dist/components/SelectableTable/SelectionStore.d.ts +1 -1
- package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +2 -2
- package/dist/components/SidePanelBinding.d.ts +1 -1
- package/dist/components/admin/CreationResultDialog.d.ts +1 -1
- package/dist/components/common/default_entity_actions.d.ts +2 -1
- package/dist/components/field_configs.d.ts +3 -2
- package/dist/components/history/EntityHistoryEntry.d.ts +2 -2
- package/dist/components/history/EntityHistoryView.d.ts +1 -1
- package/dist/components/history/LastEditedByFormAction.d.ts +1 -1
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -2
- package/dist/contexts/BreacrumbsContext.d.ts +1 -1
- package/dist/contexts/SideDialogsControllerContext.d.ts +1 -1
- package/dist/contexts/SidePanelControllerContext.d.ts +1 -1
- package/dist/data_export/export/ExportCollectionAction.d.ts +4 -3
- package/dist/data_import/components/ImportSaveInProgress.d.ts +2 -2
- package/dist/data_import/import/ImportCollectionAction.d.ts +2 -1
- package/dist/data_import/utils/data.d.ts +2 -1
- package/dist/{export-BM6HPujv.js → export-CavEbZVF.js} +2 -2
- package/dist/export-CavEbZVF.js.map +1 -0
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/form_utils.d.ts +4 -3
- package/dist/{history-CtIPJxvQ.js → history-B1lIsrkX.js} +2 -2
- package/dist/history-B1lIsrkX.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +2 -2
- package/dist/hooks/navigation/contexts/NavigationStateContext.d.ts +1 -1
- package/dist/hooks/navigation/contexts/UrlContext.d.ts +1 -1
- package/dist/hooks/navigation/useBuildCollectionRegistryController.d.ts +2 -1
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +7 -5
- package/dist/hooks/navigation/useBuildUrlController.d.ts +1 -1
- package/dist/hooks/navigation/useNavigationResolution.d.ts +6 -5
- package/dist/hooks/navigation/useResolvedCollections.d.ts +8 -7
- package/dist/hooks/navigation/useResolvedViews.d.ts +4 -2
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +2 -2
- package/dist/hooks/navigation/utils.d.ts +5 -5
- package/dist/hooks/useBreadcrumbsController.d.ts +1 -1
- package/dist/hooks/useBuildSidePanel.d.ts +4 -4
- package/dist/hooks/useCMSContext.d.ts +4 -2
- package/dist/hooks/useResolvedNavigationFrom.d.ts +5 -4
- package/dist/hooks/useResolvedUsers.d.ts +8 -0
- package/dist/hooks/useSideDialogsController.d.ts +1 -1
- package/dist/hooks/useSidePanel.d.ts +1 -1
- package/dist/{import-DzQnT03v.js → import-36UcGe71.js} +2 -2
- package/dist/import-36UcGe71.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/preview/components/UrlComponentPreview.d.ts +1 -1
- package/dist/preview/components/UserPreview.d.ts +3 -2
- package/dist/preview/property_previews/StringPropertyPreview.d.ts +1 -1
- package/dist/preview/util.d.ts +1 -1
- package/dist/routes/CustomViewRoute.d.ts +1 -1
- package/dist/types/components/EntityFormActionsProps.d.ts +2 -2
- package/dist/types/components/EntityFormProps.d.ts +3 -3
- package/dist/types/fields.d.ts +2 -2
- package/dist/util/dataControllerAdapter.d.ts +1 -1
- package/dist/util/entity_actions.d.ts +1 -1
- package/dist/util/navigation_utils.d.ts +3 -3
- package/dist/util/previews.d.ts +22 -4
- package/dist/util/property_utils.d.ts +3 -2
- package/dist/util/resolutions.d.ts +1 -1
- package/dist/util/view_mode.d.ts +3 -3
- package/dist/{util-XFwQ9FEc.js → util-CPgUM4M8.js} +353 -221
- package/dist/util-CPgUM4M8.js.map +1 -0
- package/package.json +11 -9
- package/src/collection_editor/ConfigControllerProvider.tsx +11 -12
- package/src/collection_editor/api/generateCollectionApi.ts +4 -4
- package/src/collection_editor/pgColumnToProperty.ts +4 -3
- package/src/collection_editor/serializable_types.ts +36 -34
- package/src/collection_editor/serializable_utils.ts +17 -32
- package/src/collection_editor/types/collection_editor_controller.tsx +6 -5
- package/src/collection_editor/types/collection_inference.ts +3 -2
- package/src/collection_editor/types/config_controller.tsx +8 -7
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +3 -2
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +3 -2
- package/src/collection_editor/ui/EditorCollectionAction.tsx +3 -2
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +3 -2
- package/src/collection_editor/ui/EditorEntityAction.tsx +3 -2
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +1 -1
- package/src/collection_editor/ui/KanbanSetupAction.tsx +3 -2
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +1 -1
- package/src/collection_editor/ui/NewCollectionCard.tsx +1 -1
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +6 -5
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +5 -7
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +28 -38
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +5 -4
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +4 -3
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +6 -5
- package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +3 -3
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +3 -3
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +4 -4
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +10 -8
- package/src/collection_editor/useJsonCollectionsConfigController.tsx +10 -9
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +5 -5
- package/src/collection_editor/validateCollectionJson.ts +4 -5
- package/src/components/AdminModeSyncer.tsx +1 -1
- package/src/components/ClearFilterSortButton.tsx +1 -1
- package/src/components/CollectionPanel.tsx +5 -4
- package/src/components/CollectionTableBinding/CollectionRowActions.tsx +6 -6
- package/src/components/CollectionTableBinding/CollectionTableBinding.tsx +5 -4
- package/src/components/CollectionTableBinding/CollectionTableBindingProps.tsx +3 -2
- package/src/components/CollectionTableBinding/PropertyTableCell.tsx +5 -5
- package/src/components/CollectionTableBinding/fields/TableMultipleRelationField.tsx +4 -3
- package/src/components/CollectionTableBinding/fields/TableReferenceField.tsx +5 -4
- package/src/components/CollectionTableBinding/fields/TableRelationField.tsx +4 -3
- package/src/components/CollectionTableBinding/internal/common.tsx +8 -7
- package/src/components/CollectionTableBinding/internal/popup_field/PopupFormField.tsx +5 -4
- package/src/components/CollectionTableBinding/table_bindings.tsx +7 -7
- package/src/components/CollectionViewBinding/BoardCardBinding.tsx +6 -5
- package/src/components/CollectionViewBinding/CollectionBoardViewBinding.tsx +5 -6
- package/src/components/CollectionViewBinding/CollectionCardViewBinding.tsx +4 -3
- package/src/components/CollectionViewBinding/CollectionListViewBinding.tsx +10 -13
- package/src/components/CollectionViewBinding/CollectionViewActions.tsx +3 -3
- package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +17 -16
- package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +3 -3
- package/src/components/CollectionViewBinding/EntityCardBinding.tsx +6 -5
- package/src/components/CollectionViewBinding/FilterPresetsButton.tsx +2 -1
- package/src/components/CollectionViewBinding/FiltersDialog.tsx +2 -2
- package/src/components/CollectionViewBinding/SplitListView.tsx +6 -5
- package/src/components/CollectionViewBinding/ViewModeToggle.tsx +1 -1
- package/src/components/CollectionViewBinding/hooks/useCollectionInlineEditor.ts +3 -2
- package/src/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.ts +3 -2
- package/src/components/CollectionViewBinding/useBoardDataController.tsx +3 -2
- package/src/components/CollectionViewBinding/usePreviewSlots.ts +57 -25
- package/src/components/CollectionViewBinding/useSelectionController.tsx +2 -1
- package/src/components/DefaultDrawer.tsx +2 -2
- package/src/components/DeleteEntityDialog.tsx +3 -2
- package/src/components/DetailViewBinding.tsx +23 -18
- package/src/components/DrawerNavigationGroup.tsx +1 -1
- package/src/components/EditFormActions.tsx +5 -5
- package/src/components/EditViewBinding.tsx +11 -15
- package/src/components/EntityPreviewBinding.tsx +7 -6
- package/src/components/EntityViewBinding.tsx +3 -3
- package/src/components/HomePage/ContentHomePage.tsx +2 -2
- package/src/components/HomePage/FavouritesView.tsx +1 -1
- package/src/components/HomePage/HomePageDnD.tsx +1 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +2 -2
- package/src/components/PropertyConfigBadge.tsx +2 -1
- package/src/components/RebaseAdmin.tsx +1 -1
- package/src/components/RebaseAuthGate.tsx +1 -1
- package/src/components/RebaseLayout.tsx +1 -1
- package/src/components/RebaseNavigation.tsx +4 -3
- package/src/components/ReferenceTable/SelectionTableBinding.tsx +6 -5
- package/src/components/ReferenceWidget.tsx +3 -2
- package/src/components/SelectableTable/SelectableTable.tsx +3 -3
- package/src/components/SelectableTable/SelectionStore.ts +1 -1
- package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +9 -6
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +3 -2
- package/src/components/SideDialogs.tsx +2 -2
- package/src/components/SidePanelBinding.tsx +5 -5
- package/src/components/SidePanelProvider.tsx +1 -1
- package/src/components/admin/CreationResultDialog.tsx +1 -1
- package/src/components/common/default_entity_actions.tsx +3 -2
- package/src/components/field_configs.tsx +30 -29
- package/src/components/history/EntityHistoryEntry.tsx +3 -2
- package/src/components/history/EntityHistoryView.tsx +1 -1
- package/src/components/history/LastEditedByFormAction.tsx +1 -1
- package/src/components/history/LastEditedByIndicator.tsx +3 -2
- package/src/contexts/BreacrumbsContext.tsx +1 -1
- package/src/contexts/SideDialogsControllerContext.tsx +1 -1
- package/src/contexts/SidePanelControllerContext.tsx +1 -1
- package/src/data_export/export/ExportCollectionAction.tsx +5 -4
- package/src/data_import/components/ImportSaveInProgress.tsx +4 -3
- package/src/data_import/import/ImportCollectionAction.tsx +3 -2
- package/src/data_import/utils/data.ts +3 -2
- package/src/form/EntityForm.tsx +19 -10
- package/src/form/EntityFormActions.tsx +3 -3
- package/src/form/EntityFormBinding.tsx +6 -4
- package/src/form/PropertyFieldBinding.tsx +15 -12
- package/src/form/components/FieldHelperText.tsx +1 -1
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +5 -4
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +7 -6
- package/src/form/field_bindings/BlockFieldBinding.tsx +4 -4
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MapFieldBinding.tsx +7 -7
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +4 -3
- package/src/form/field_bindings/RelationFieldBinding.tsx +2 -2
- package/src/form/field_bindings/RepeatFieldBinding.tsx +5 -5
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +2 -2
- package/src/form/field_bindings/SwitchFieldBinding.tsx +1 -1
- package/src/form/field_bindings/TextFieldBinding.tsx +8 -8
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +1 -1
- package/src/form/form_utils.ts +5 -3
- package/src/form/useClearRestoreValue.tsx +1 -1
- package/src/form/validation.ts +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +3 -2
- package/src/hooks/navigation/contexts/NavigationStateContext.tsx +1 -1
- package/src/hooks/navigation/contexts/UrlContext.tsx +1 -1
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +19 -15
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +8 -6
- package/src/hooks/navigation/useBuildUrlController.tsx +2 -2
- package/src/hooks/navigation/useNavigationResolution.ts +15 -21
- package/src/hooks/navigation/useResolvedCollections.ts +10 -9
- package/src/hooks/navigation/useResolvedViews.tsx +4 -2
- package/src/hooks/navigation/useTopLevelNavigation.ts +3 -2
- package/src/hooks/navigation/utils.ts +6 -5
- package/src/hooks/useBreadcrumbsController.tsx +1 -1
- package/src/hooks/useBuildSidePanel.tsx +9 -12
- package/src/hooks/useCMSContext.tsx +8 -4
- package/src/hooks/useResolvedNavigationFrom.tsx +7 -5
- package/src/hooks/useResolvedUsers.ts +143 -0
- package/src/hooks/useSelectionDialog.tsx +3 -2
- package/src/hooks/useSideDialogsController.tsx +1 -1
- package/src/hooks/useSidePanel.tsx +1 -1
- package/src/index.ts +2 -1
- package/src/preview/PropertyPreview.tsx +11 -11
- package/src/preview/components/ReferencePreview.tsx +6 -5
- package/src/preview/components/RelationPreview.tsx +6 -5
- package/src/preview/components/UrlComponentPreview.tsx +1 -1
- package/src/preview/components/UserPreview.tsx +13 -4
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +1 -1
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +2 -2
- package/src/preview/property_previews/StringPropertyPreview.tsx +19 -13
- package/src/preview/util.ts +1 -1
- package/src/routes/CustomViewRoute.tsx +1 -1
- package/src/routes/RebaseRoute.tsx +7 -5
- package/src/types/components/EntityFormActionsProps.tsx +3 -2
- package/src/types/components/EntityFormProps.tsx +4 -3
- package/src/types/fields.tsx +3 -2
- package/src/util/dataControllerAdapter.ts +2 -1
- package/src/util/entity_actions.ts +1 -1
- package/src/util/navigation_utils.ts +4 -13
- package/src/util/previews.ts +43 -53
- package/src/util/propertyConfigMapper.ts +7 -7
- package/src/util/property_utils.tsx +5 -4
- package/src/util/resolutions.ts +1 -1
- package/src/util/view_mode.ts +4 -3
- package/dist/CollectionEditorDialog-BOlKGGg7.js.map +0 -1
- package/dist/PropertyEditView-i51tFOfM.js.map +0 -1
- package/dist/RouterCollectionsStudioView-Dh4W53PU.js.map +0 -1
- package/dist/export-BM6HPujv.js.map +0 -1
- package/dist/history-CtIPJxvQ.js.map +0 -1
- package/dist/import-DzQnT03v.js.map +0 -1
- package/dist/util-XFwQ9FEc.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/admin",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.1-canary.0a881d4",
|
|
5
5
|
"description": "Rebase CMS — content management views, forms, and routing",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/rebaseco"
|
|
@@ -83,13 +83,14 @@
|
|
|
83
83
|
"react-dropzone": "^15.0.0",
|
|
84
84
|
"react-use-measure": "^2.1.7",
|
|
85
85
|
"zod": "^4.4.3",
|
|
86
|
-
"@rebasepro/
|
|
87
|
-
"@rebasepro/app": "0.10.
|
|
88
|
-
"@rebasepro/
|
|
89
|
-
"@rebasepro/
|
|
90
|
-
"@rebasepro/
|
|
91
|
-
"@rebasepro/
|
|
92
|
-
"@rebasepro/
|
|
86
|
+
"@rebasepro/admin-types": "0.10.1-canary.0a881d4",
|
|
87
|
+
"@rebasepro/app": "0.10.1-canary.0a881d4",
|
|
88
|
+
"@rebasepro/common": "0.10.1-canary.0a881d4",
|
|
89
|
+
"@rebasepro/forms": "0.10.1-canary.0a881d4",
|
|
90
|
+
"@rebasepro/inference": "0.10.1-canary.0a881d4",
|
|
91
|
+
"@rebasepro/types": "0.10.1-canary.0a881d4",
|
|
92
|
+
"@rebasepro/ui": "0.10.1-canary.0a881d4",
|
|
93
|
+
"@rebasepro/utils": "0.10.1-canary.0a881d4"
|
|
93
94
|
},
|
|
94
95
|
"peerDependencies": {
|
|
95
96
|
"react": ">=19.0.0",
|
|
@@ -153,7 +154,8 @@
|
|
|
153
154
|
],
|
|
154
155
|
"moduleNameMapper": {
|
|
155
156
|
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js",
|
|
156
|
-
"^@rebasepro/([a-z0-9-]+)$": "<rootDir>/../$1/src/index.ts"
|
|
157
|
+
"^@rebasepro/([a-z0-9-]+)$": "<rootDir>/../$1/src/index.ts",
|
|
158
|
+
"^@rebasepro/admin-types$": "<rootDir>/../admin-types/src/index.ts"
|
|
157
159
|
}
|
|
158
160
|
},
|
|
159
161
|
"scripts": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useUrlController } from "./_cms_internals";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
|
-
import { Entity,
|
|
3
|
+
import { Entity, Property, TableMetadata, User } from "@rebasepro/types";
|
|
4
4
|
import { deepEqual as equal } from "fast-equals";
|
|
5
5
|
|
|
6
6
|
import { CollectionsConfigController } from "./types/config_controller";
|
|
@@ -11,6 +11,7 @@ import { CollectionEditorController } from "./types/collection_editor_controller
|
|
|
11
11
|
import { CollectionInference } from "./types/collection_inference";
|
|
12
12
|
import { CollectionGenerationCallback } from "./api/generateCollectionApi";
|
|
13
13
|
import { CollectionEditorDialogsContext, CollectionEditorDialogsState } from "./CollectionEditorDialogsContext";
|
|
14
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
14
15
|
|
|
15
16
|
export const ConfigControllerContext = React.createContext<CollectionsConfigController>({} as CollectionsConfigController);
|
|
16
17
|
export const CollectionEditorContext = React.createContext<CollectionEditorController>({} as CollectionEditorController);
|
|
@@ -26,7 +27,6 @@ export interface ConfigControllerProviderProps {
|
|
|
26
27
|
*/
|
|
27
28
|
collectionInference?: CollectionInference;
|
|
28
29
|
|
|
29
|
-
|
|
30
30
|
extraView?: {
|
|
31
31
|
View: React.ComponentType<{
|
|
32
32
|
path: string
|
|
@@ -87,7 +87,7 @@ export const ConfigControllerProvider = React.memo(
|
|
|
87
87
|
|
|
88
88
|
const [currentDialog, setCurrentDialog] = React.useState<{
|
|
89
89
|
isNewCollection: boolean,
|
|
90
|
-
parentCollection?:
|
|
90
|
+
parentCollection?: AdminCollection,
|
|
91
91
|
editedCollectionId?: string,
|
|
92
92
|
path?: string,
|
|
93
93
|
parentCollectionSlugs: string[], parentEntityIds: string[],
|
|
@@ -95,7 +95,7 @@ export const ConfigControllerProvider = React.memo(
|
|
|
95
95
|
path?: string,
|
|
96
96
|
name?: string
|
|
97
97
|
},
|
|
98
|
-
copyFrom?:
|
|
98
|
+
copyFrom?: AdminCollection,
|
|
99
99
|
redirect: boolean,
|
|
100
100
|
existingEntities?: Entity[],
|
|
101
101
|
pathSuggestions?: string[];
|
|
@@ -107,17 +107,16 @@ export const ConfigControllerProvider = React.memo(
|
|
|
107
107
|
propertyKey?: string,
|
|
108
108
|
property?: Property,
|
|
109
109
|
namespace?: string,
|
|
110
|
-
parentCollection?:
|
|
110
|
+
parentCollection?: AdminCollection,
|
|
111
111
|
currentPropertiesOrder?: string[],
|
|
112
112
|
editedCollectionId: string,
|
|
113
113
|
path?: string,
|
|
114
114
|
parentCollectionSlugs: string[], parentEntityIds: string[],
|
|
115
115
|
|
|
116
116
|
existingEntities?: Entity[];
|
|
117
|
-
collection?:
|
|
117
|
+
collection?: AdminCollection;
|
|
118
118
|
}>();
|
|
119
119
|
|
|
120
|
-
|
|
121
120
|
const editCollection = useCallback(({
|
|
122
121
|
id,
|
|
123
122
|
path,
|
|
@@ -130,7 +129,7 @@ export const ConfigControllerProvider = React.memo(
|
|
|
130
129
|
id?: string,
|
|
131
130
|
path?: string,
|
|
132
131
|
parentCollectionSlugs: string[], parentEntityIds: string[],
|
|
133
|
-
parentCollection?:
|
|
132
|
+
parentCollection?: AdminCollection,
|
|
134
133
|
existingEntities?: Entity[],
|
|
135
134
|
initialView?: "general" | "display" | "properties",
|
|
136
135
|
expandKanban?: boolean
|
|
@@ -169,7 +168,7 @@ parentEntityIds,
|
|
|
169
168
|
currentPropertiesOrder?: string[],
|
|
170
169
|
editedCollectionId: string,
|
|
171
170
|
parentCollectionSlugs: string[], parentEntityIds: string[],
|
|
172
|
-
collection:
|
|
171
|
+
collection: AdminCollection,
|
|
173
172
|
existingEntities?: Entity[]
|
|
174
173
|
}) => {
|
|
175
174
|
console.debug("Edit property", propertyKey, property, editedCollectionId, currentPropertiesOrder, parentCollectionSlugs, parentEntityIds, collection);
|
|
@@ -207,12 +206,12 @@ parentEntityIds,
|
|
|
207
206
|
sourceClick
|
|
208
207
|
}: {
|
|
209
208
|
parentCollectionSlugs: string[], parentEntityIds: string[],
|
|
210
|
-
parentCollection?:
|
|
209
|
+
parentCollection?: AdminCollection
|
|
211
210
|
initialValues?: {
|
|
212
211
|
path?: string,
|
|
213
212
|
name?: string
|
|
214
213
|
},
|
|
215
|
-
copyFrom?:
|
|
214
|
+
copyFrom?: AdminCollection,
|
|
216
215
|
redirect: boolean,
|
|
217
216
|
sourceClick?: string
|
|
218
217
|
}) => {
|
|
@@ -262,7 +261,7 @@ parentEntityIds,
|
|
|
262
261
|
onAnalyticsEvent,
|
|
263
262
|
unmappedTables,
|
|
264
263
|
onFetchTableMetadata,
|
|
265
|
-
handleClose: (collection?:
|
|
264
|
+
handleClose: (collection?: AdminCollection) => {
|
|
266
265
|
if (currentDialog?.redirect) {
|
|
267
266
|
if (collection && currentDialog?.isNewCollection && !currentDialog.parentCollectionSlugs.length) {
|
|
268
267
|
const url = urlController.buildUrlCollectionPath(collection.slug);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
2
2
|
|
|
3
3
|
export interface GenerateCollectionRequest {
|
|
4
4
|
/** User's natural language description of what they want */
|
|
5
5
|
prompt: string;
|
|
6
6
|
|
|
7
7
|
/** Other collections in the project (for context/relationships). Limit to 30. */
|
|
8
|
-
existingCollections: Partial<
|
|
8
|
+
existingCollections: Partial<AdminCollection>[];
|
|
9
9
|
|
|
10
10
|
/** Optional for generate, required for modifications. If provided, modifies this collection */
|
|
11
|
-
existingCollection?: Partial<
|
|
11
|
+
existingCollection?: Partial<AdminCollection>;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/** Operation types for modifying a collection */
|
|
@@ -23,7 +23,7 @@ export interface CollectionOperation {
|
|
|
23
23
|
|
|
24
24
|
/** Result from collection generation, including optional delta operations */
|
|
25
25
|
export interface GenerateCollectionResult {
|
|
26
|
-
collection:
|
|
26
|
+
collection: AdminCollection;
|
|
27
27
|
operations?: CollectionOperation[];
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Property, StringProperty, NumberProperty, ArrayProperty, TableColumnInfo, TableMetadata, PostgresProperties } from "@rebasepro/types";
|
|
2
2
|
import { prettifyIdentifier } from "@rebasepro/utils";
|
|
3
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Maps a PostgreSQL column data type to a Rebase property type.
|
|
@@ -193,13 +194,13 @@ label: prettifyIdentifier(v) })),
|
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
/**
|
|
196
|
-
* Builds a partial
|
|
197
|
+
* Builds a partial AdminCollection from PostgreSQL table metadata.
|
|
197
198
|
* This is used when creating a new collection from an existing database table.
|
|
198
199
|
*/
|
|
199
200
|
export function buildCollectionFromTableMetadata(
|
|
200
201
|
tableName: string,
|
|
201
202
|
metadata: TableMetadata
|
|
202
|
-
): Partial<
|
|
203
|
+
): Partial<AdminCollection> {
|
|
203
204
|
const properties: Record<string, Property> = {};
|
|
204
205
|
const propertiesOrder: string[] = [];
|
|
205
206
|
const relations: any[] = []; // In the builder/editor, target can be a string path before hydration
|
|
@@ -13,32 +13,34 @@
|
|
|
13
13
|
|
|
14
14
|
import type {
|
|
15
15
|
ArrayPropertyValidationSchema,
|
|
16
|
-
CollectionSize,
|
|
17
16
|
EnumValues,
|
|
18
17
|
FileType,
|
|
19
18
|
FilterPreset,
|
|
20
19
|
FilterValues,
|
|
21
20
|
ImageResize,
|
|
22
21
|
JoinStep,
|
|
23
|
-
KanbanConfig,
|
|
24
|
-
NavigationGroupMapping,
|
|
25
22
|
NumberPropertyValidationSchema,
|
|
26
23
|
OnAction,
|
|
27
24
|
PropertyConditions,
|
|
28
25
|
PropertyValidationSchema,
|
|
29
|
-
SecurityRule
|
|
30
|
-
ViewMode,
|
|
26
|
+
SecurityRule
|
|
31
27
|
} from "@rebasepro/types";
|
|
28
|
+
import type {
|
|
29
|
+
CollectionSize,
|
|
30
|
+
KanbanConfig,
|
|
31
|
+
NavigationGroupMapping,
|
|
32
|
+
ViewMode
|
|
33
|
+
} from "@rebasepro/admin-types";
|
|
32
34
|
|
|
33
35
|
// ═══════════════════════════════════════════════════════════════════════
|
|
34
36
|
// SERIALIZABLE PROPERTY TYPES
|
|
35
37
|
// ═══════════════════════════════════════════════════════════════════════
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
|
-
* JSON-serializable version of `
|
|
40
|
+
* JSON-serializable version of `AdminPropertyOptions`.
|
|
39
41
|
* Drops `Field` and `Preview` (ComponentRef — functions/components).
|
|
40
42
|
*/
|
|
41
|
-
export interface
|
|
43
|
+
export interface SerializableAdminBaseOptions {
|
|
42
44
|
columnWidth?: number;
|
|
43
45
|
hideFromCollection?: boolean;
|
|
44
46
|
readOnly?: boolean;
|
|
@@ -105,8 +107,8 @@ export interface SerializableStorageConfig {
|
|
|
105
107
|
|
|
106
108
|
// ── Serializable UI configs for specific property types ───────────────
|
|
107
109
|
|
|
108
|
-
/** JSON-serializable version of `
|
|
109
|
-
export interface
|
|
110
|
+
/** JSON-serializable version of `AdminStringOptions`. */
|
|
111
|
+
export interface SerializableAdminStringOptions extends SerializableAdminBaseOptions {
|
|
110
112
|
multiline?: boolean;
|
|
111
113
|
markdown?: boolean;
|
|
112
114
|
previewAsTag?: boolean;
|
|
@@ -114,40 +116,40 @@ export interface SerializableStringUIConfig extends SerializableBaseUIConfig {
|
|
|
114
116
|
url?: boolean | "image" | "video" | "audio" | "file";
|
|
115
117
|
}
|
|
116
118
|
|
|
117
|
-
/** JSON-serializable version of `
|
|
118
|
-
export interface
|
|
119
|
+
/** JSON-serializable version of `AdminNumberOptions`. */
|
|
120
|
+
export interface SerializableAdminNumberOptions extends SerializableAdminBaseOptions {
|
|
119
121
|
clearable?: boolean;
|
|
120
122
|
}
|
|
121
123
|
|
|
122
|
-
/** JSON-serializable version of `
|
|
123
|
-
export interface
|
|
124
|
+
/** JSON-serializable version of `AdminDateOptions`. */
|
|
125
|
+
export interface SerializableAdminDateOptions extends SerializableAdminBaseOptions {
|
|
124
126
|
clearable?: boolean;
|
|
125
127
|
}
|
|
126
128
|
|
|
127
|
-
/** JSON-serializable version of `
|
|
128
|
-
export interface
|
|
129
|
+
/** JSON-serializable version of `AdminVectorOptions`. */
|
|
130
|
+
export interface SerializableAdminVectorOptions extends SerializableAdminBaseOptions {
|
|
129
131
|
clearable?: boolean;
|
|
130
132
|
}
|
|
131
133
|
|
|
132
|
-
/** JSON-serializable version of `
|
|
133
|
-
export interface
|
|
134
|
+
/** JSON-serializable version of `AdminReferenceOptions`. */
|
|
135
|
+
export interface SerializableAdminReferenceOptions extends SerializableAdminBaseOptions {
|
|
134
136
|
previewProperties?: string[];
|
|
135
137
|
}
|
|
136
138
|
|
|
137
|
-
/** JSON-serializable version of `
|
|
138
|
-
export interface
|
|
139
|
+
/** JSON-serializable version of `AdminRelationOptions`. */
|
|
140
|
+
export interface SerializableAdminRelationOptions extends SerializableAdminBaseOptions {
|
|
139
141
|
previewProperties?: string[];
|
|
140
142
|
widget?: "select" | "dialog";
|
|
141
143
|
}
|
|
142
144
|
|
|
143
|
-
/** JSON-serializable version of `
|
|
144
|
-
export interface
|
|
145
|
+
/** JSON-serializable version of `AdminArrayOptions`. */
|
|
146
|
+
export interface SerializableAdminArrayOptions extends SerializableAdminBaseOptions {
|
|
145
147
|
expanded?: boolean;
|
|
146
148
|
minimalistView?: boolean;
|
|
147
149
|
}
|
|
148
150
|
|
|
149
|
-
/** JSON-serializable version of `
|
|
150
|
-
export interface
|
|
151
|
+
/** JSON-serializable version of `AdminMapOptions`. */
|
|
152
|
+
export interface SerializableAdminMapOptions extends SerializableAdminBaseOptions {
|
|
151
153
|
expanded?: boolean;
|
|
152
154
|
minimalistView?: boolean;
|
|
153
155
|
spreadChildren?: boolean;
|
|
@@ -161,7 +163,7 @@ export interface SerializableMapUIConfig extends SerializableBaseUIConfig {
|
|
|
161
163
|
* Keeps: `conditions` (JSON Logic — already serializable by design).
|
|
162
164
|
*/
|
|
163
165
|
export interface SerializableBaseProperty {
|
|
164
|
-
|
|
166
|
+
admin?: SerializableAdminBaseOptions;
|
|
165
167
|
name: string;
|
|
166
168
|
description?: string;
|
|
167
169
|
propertyConfig?: string;
|
|
@@ -185,7 +187,7 @@ export interface SerializableBaseProperty {
|
|
|
185
187
|
|
|
186
188
|
/** JSON-serializable `StringProperty`. */
|
|
187
189
|
export interface SerializableStringProperty extends SerializableBaseProperty {
|
|
188
|
-
|
|
190
|
+
admin?: SerializableAdminStringOptions;
|
|
189
191
|
type: "string";
|
|
190
192
|
columnType?: "varchar" | "text" | "char" | "uuid";
|
|
191
193
|
validation?: SerializableStringValidation;
|
|
@@ -199,7 +201,7 @@ export interface SerializableStringProperty extends SerializableBaseProperty {
|
|
|
199
201
|
|
|
200
202
|
/** JSON-serializable `NumberProperty`. */
|
|
201
203
|
export interface SerializableNumberProperty extends SerializableBaseProperty {
|
|
202
|
-
|
|
204
|
+
admin?: SerializableAdminNumberOptions;
|
|
203
205
|
type: "number";
|
|
204
206
|
columnType?: "integer" | "real" | "double precision" | "numeric" | "bigint" | "serial" | "bigserial";
|
|
205
207
|
validation?: NumberPropertyValidationSchema;
|
|
@@ -209,14 +211,14 @@ export interface SerializableNumberProperty extends SerializableBaseProperty {
|
|
|
209
211
|
|
|
210
212
|
/** JSON-serializable `BooleanProperty`. */
|
|
211
213
|
export interface SerializableBooleanProperty extends SerializableBaseProperty {
|
|
212
|
-
|
|
214
|
+
admin?: SerializableAdminBaseOptions;
|
|
213
215
|
type: "boolean";
|
|
214
216
|
validation?: PropertyValidationSchema;
|
|
215
217
|
}
|
|
216
218
|
|
|
217
219
|
/** JSON-serializable `DateProperty`. */
|
|
218
220
|
export interface SerializableDateProperty extends SerializableBaseProperty {
|
|
219
|
-
|
|
221
|
+
admin?: SerializableAdminDateOptions;
|
|
220
222
|
type: "date";
|
|
221
223
|
columnType?: "timestamp" | "date" | "time";
|
|
222
224
|
validation?: SerializableDateValidation;
|
|
@@ -227,14 +229,14 @@ export interface SerializableDateProperty extends SerializableBaseProperty {
|
|
|
227
229
|
|
|
228
230
|
/** JSON-serializable `GeopointProperty`. */
|
|
229
231
|
export interface SerializableGeopointProperty extends SerializableBaseProperty {
|
|
230
|
-
|
|
232
|
+
admin?: SerializableAdminBaseOptions;
|
|
231
233
|
type: "geopoint";
|
|
232
234
|
validation?: PropertyValidationSchema;
|
|
233
235
|
}
|
|
234
236
|
|
|
235
237
|
/** JSON-serializable `VectorProperty`. */
|
|
236
238
|
export interface SerializableVectorProperty extends SerializableBaseProperty {
|
|
237
|
-
|
|
239
|
+
admin?: SerializableAdminVectorOptions;
|
|
238
240
|
type: "vector";
|
|
239
241
|
dimensions: number;
|
|
240
242
|
validation?: PropertyValidationSchema;
|
|
@@ -251,7 +253,7 @@ export interface SerializableBinaryProperty extends SerializableBaseProperty {
|
|
|
251
253
|
* Already largely serializable; just inherits the serializable base.
|
|
252
254
|
*/
|
|
253
255
|
export interface SerializableReferenceProperty extends SerializableBaseProperty {
|
|
254
|
-
|
|
256
|
+
admin?: SerializableAdminReferenceOptions;
|
|
255
257
|
type: "reference";
|
|
256
258
|
isId?: boolean;
|
|
257
259
|
path?: string;
|
|
@@ -266,7 +268,7 @@ export interface SerializableReferenceProperty extends SerializableBaseProperty
|
|
|
266
268
|
* `() => CollectionConfig` is not serializable.
|
|
267
269
|
*/
|
|
268
270
|
export interface SerializableRelationProperty extends SerializableBaseProperty {
|
|
269
|
-
|
|
271
|
+
admin?: SerializableAdminRelationOptions;
|
|
270
272
|
type: "relation";
|
|
271
273
|
isId?: boolean;
|
|
272
274
|
/** Target collection slug. Function variant is not serializable. */
|
|
@@ -295,7 +297,7 @@ export interface SerializableRelationProperty extends SerializableBaseProperty {
|
|
|
295
297
|
|
|
296
298
|
/** JSON-serializable `ArrayProperty`. */
|
|
297
299
|
export interface SerializableArrayProperty extends SerializableBaseProperty {
|
|
298
|
-
|
|
300
|
+
admin?: SerializableAdminArrayOptions;
|
|
299
301
|
type: "array";
|
|
300
302
|
columnType?: "json" | "jsonb" | "text[]" | "integer[]" | "boolean[]" | "numeric[]";
|
|
301
303
|
of?: SerializableProperty | SerializableProperty[];
|
|
@@ -312,7 +314,7 @@ export interface SerializableArrayProperty extends SerializableBaseProperty {
|
|
|
312
314
|
|
|
313
315
|
/** JSON-serializable `MapProperty`. */
|
|
314
316
|
export interface SerializableMapProperty extends SerializableBaseProperty {
|
|
315
|
-
|
|
317
|
+
admin?: SerializableAdminMapOptions;
|
|
316
318
|
type: "map";
|
|
317
319
|
columnType?: "json" | "jsonb";
|
|
318
320
|
properties?: SerializableProperties;
|
|
@@ -8,29 +8,14 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
BinaryProperty,
|
|
15
|
-
BooleanProperty,
|
|
16
|
-
DateProperty,
|
|
17
|
-
CollectionConfig,
|
|
18
|
-
GeopointProperty,
|
|
19
|
-
MapProperty,
|
|
20
|
-
NumberProperty,
|
|
21
|
-
Properties,
|
|
22
|
-
Property,
|
|
23
|
-
ReferenceProperty,
|
|
24
|
-
RelationProperty,
|
|
25
|
-
StorageConfig,
|
|
26
|
-
StringProperty,
|
|
27
|
-
VectorProperty,
|
|
28
|
-
} from "@rebasepro/types";
|
|
11
|
+
import type { ArrayProperty, BinaryProperty, BooleanProperty, DateProperty, GeopointProperty, MapProperty, NumberProperty, Properties, Property, ReferenceProperty, RelationProperty, StorageConfig, StringProperty, VectorProperty } from "@rebasepro/types";
|
|
12
|
+
import type { AdminPropertyOptions } from "@rebasepro/admin-types";
|
|
13
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
29
14
|
|
|
30
15
|
import type {
|
|
31
16
|
SerializableArrayProperty,
|
|
32
17
|
SerializableBaseProperty,
|
|
33
|
-
|
|
18
|
+
SerializableAdminBaseOptions,
|
|
34
19
|
SerializableBinaryProperty,
|
|
35
20
|
SerializableBooleanProperty,
|
|
36
21
|
SerializableCollectionConfig,
|
|
@@ -54,12 +39,12 @@ import type {
|
|
|
54
39
|
// ═══════════════════════════════════════════════════════════════════════
|
|
55
40
|
|
|
56
41
|
/**
|
|
57
|
-
* Strip non-serializable fields from a `
|
|
42
|
+
* Strip non-serializable fields from a `AdminPropertyOptions`.
|
|
58
43
|
* Removes `Field` and `Preview` (ComponentRef).
|
|
59
44
|
*/
|
|
60
|
-
function
|
|
45
|
+
function toSerializableAdminOptions(ui: AdminPropertyOptions | undefined): SerializableAdminBaseOptions | undefined {
|
|
61
46
|
if (!ui) return undefined;
|
|
62
|
-
const { Field, Preview, ...rest } = ui as
|
|
47
|
+
const { Field, Preview, ...rest } = ui as AdminPropertyOptions & Record<string, unknown>;
|
|
63
48
|
// Only return if there are remaining fields
|
|
64
49
|
const result: Record<string, unknown> = {};
|
|
65
50
|
for (const [key, value] of Object.entries(rest)) {
|
|
@@ -67,7 +52,7 @@ function toSerializableUIConfig(ui: BaseUIConfig | undefined): SerializableBaseU
|
|
|
67
52
|
result[key] = value;
|
|
68
53
|
}
|
|
69
54
|
}
|
|
70
|
-
return Object.keys(result).length > 0 ? result as
|
|
55
|
+
return Object.keys(result).length > 0 ? result as SerializableAdminBaseOptions : undefined;
|
|
71
56
|
}
|
|
72
57
|
|
|
73
58
|
/**
|
|
@@ -107,7 +92,7 @@ function serializeMatches(matches: string | RegExp | undefined): string | undefi
|
|
|
107
92
|
|
|
108
93
|
/**
|
|
109
94
|
* Resolve a relation target to a string slug.
|
|
110
|
-
* Functions are called to extract the target;
|
|
95
|
+
* Functions are called to extract the target; AdminCollection objects
|
|
111
96
|
* use their slug.
|
|
112
97
|
*/
|
|
113
98
|
function resolveRelationTarget(target: RelationProperty["target"]): string | undefined {
|
|
@@ -118,7 +103,7 @@ function resolveRelationTarget(target: RelationProperty["target"]): string | und
|
|
|
118
103
|
const resolved = target();
|
|
119
104
|
if (typeof resolved === "string") return resolved;
|
|
120
105
|
if (resolved && typeof resolved === "object" && "slug" in resolved) {
|
|
121
|
-
return (resolved as
|
|
106
|
+
return (resolved as AdminCollection).slug;
|
|
122
107
|
}
|
|
123
108
|
} catch {
|
|
124
109
|
// If the lazy resolver throws (e.g., circular dependency not yet ready), return undefined
|
|
@@ -145,8 +130,8 @@ function toSerializableBaseFields(property: Property): Omit<SerializableBaseProp
|
|
|
145
130
|
if (property.metadata) result.metadata = property.metadata;
|
|
146
131
|
// dynamicProps and callbacks are intentionally dropped (functions)
|
|
147
132
|
|
|
148
|
-
const ui =
|
|
149
|
-
if (ui) result.
|
|
133
|
+
const ui = toSerializableAdminOptions(property.admin);
|
|
134
|
+
if (ui) result.admin = ui;
|
|
150
135
|
|
|
151
136
|
return result as Omit<SerializableBaseProperty, "validation">;
|
|
152
137
|
}
|
|
@@ -389,14 +374,14 @@ export function toSerializableProperties(properties: Properties): SerializablePr
|
|
|
389
374
|
// ═══════════════════════════════════════════════════════════════════════
|
|
390
375
|
|
|
391
376
|
/**
|
|
392
|
-
* Convert an `
|
|
377
|
+
* Convert an `AdminCollection` to its JSON-serializable form.
|
|
393
378
|
*
|
|
394
379
|
* Strips all non-serializable fields (functions, React nodes, class instances)
|
|
395
380
|
* while preserving the structural schema that the collection editor works with.
|
|
396
381
|
*
|
|
397
382
|
* The result is safe for `JSON.stringify()` and database storage.
|
|
398
383
|
*/
|
|
399
|
-
export function toSerializableCollectionConfig(collection:
|
|
384
|
+
export function toSerializableCollectionConfig(collection: AdminCollection): SerializableCollectionConfig {
|
|
400
385
|
const result: SerializableCollectionConfig = {
|
|
401
386
|
slug: collection.slug,
|
|
402
387
|
name: collection.name,
|
|
@@ -560,17 +545,17 @@ export function fromSerializableProperties(serialized: SerializableProperties):
|
|
|
560
545
|
// ═══════════════════════════════════════════════════════════════════════
|
|
561
546
|
|
|
562
547
|
/**
|
|
563
|
-
* Convert a `SerializableCollectionConfig` back to an `
|
|
548
|
+
* Convert a `SerializableCollectionConfig` back to an `AdminCollection`.
|
|
564
549
|
*
|
|
565
550
|
* The result will NOT contain any of the non-serializable fields
|
|
566
551
|
* (callbacks, entityActions, etc.) — those must be re-attached by the
|
|
567
552
|
* consumer if needed.
|
|
568
553
|
*/
|
|
569
|
-
export function fromSerializableCollectionConfig(serialized: SerializableCollectionConfig):
|
|
554
|
+
export function fromSerializableCollectionConfig(serialized: SerializableCollectionConfig): AdminCollection {
|
|
570
555
|
const { properties, ...rest } = serialized;
|
|
571
556
|
|
|
572
557
|
return {
|
|
573
558
|
...rest,
|
|
574
559
|
properties: fromSerializableProperties(properties),
|
|
575
|
-
} as
|
|
560
|
+
} as AdminCollection;
|
|
576
561
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CollectionsConfigController } from "./config_controller";
|
|
2
|
-
import { Entity,
|
|
2
|
+
import { Entity, Property } from "@rebasepro/types";
|
|
3
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Controller to open the collection editor dialog.
|
|
@@ -11,7 +12,7 @@ export interface CollectionEditorController {
|
|
|
11
12
|
id?: string,
|
|
12
13
|
path?: string,
|
|
13
14
|
parentCollectionSlugs: string[], parentEntityIds: string[],
|
|
14
|
-
parentCollection?:
|
|
15
|
+
parentCollection?: AdminCollection,
|
|
15
16
|
existingEntities?: Entity<any>[],
|
|
16
17
|
/**
|
|
17
18
|
* Initial view to open: "general", "display", or "properties"
|
|
@@ -34,9 +35,9 @@ export interface CollectionEditorController {
|
|
|
34
35
|
* A collection to duplicate from. If provided, the new collection will be
|
|
35
36
|
* pre-populated with the same properties (but with empty name, path, and id).
|
|
36
37
|
*/
|
|
37
|
-
copyFrom?:
|
|
38
|
+
copyFrom?: AdminCollection,
|
|
38
39
|
parentCollectionSlugs: string[], parentEntityIds: string[],
|
|
39
|
-
parentCollection?:
|
|
40
|
+
parentCollection?: AdminCollection,
|
|
40
41
|
redirect: boolean,
|
|
41
42
|
sourceClick?: string
|
|
42
43
|
}) => void;
|
|
@@ -47,7 +48,7 @@ export interface CollectionEditorController {
|
|
|
47
48
|
currentPropertiesOrder?: string[],
|
|
48
49
|
editedCollectionId: string,
|
|
49
50
|
parentCollectionSlugs: string[], parentEntityIds: string[],
|
|
50
|
-
collection:
|
|
51
|
+
collection: AdminCollection,
|
|
51
52
|
existingEntities: Entity<any>[]
|
|
52
53
|
}) => void;
|
|
53
54
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FilterValues } from "@rebasepro/types";
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* This function is used to infer the configuration of a collection given its path.
|
|
@@ -14,4 +15,4 @@ export type CollectionInference = (
|
|
|
14
15
|
databaseId?: string,
|
|
15
16
|
initialFilter?: FilterValues<string>,
|
|
16
17
|
initialSort?: [string, "asc" | "desc"]
|
|
17
|
-
) => Promise<Partial<
|
|
18
|
+
) => Promise<Partial<AdminCollection> | null>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Property } from "@rebasepro/types";
|
|
2
|
+
import { NavigationGroupMapping, AdminCollection } from "@rebasepro/admin-types";
|
|
2
3
|
|
|
3
4
|
export interface CollectionsSetupInfo {
|
|
4
5
|
status: "ongoing" | "complete" | "error";
|
|
@@ -13,7 +14,7 @@ export interface CollectionsConfigController {
|
|
|
13
14
|
|
|
14
15
|
loading: boolean;
|
|
15
16
|
|
|
16
|
-
collections?:
|
|
17
|
+
collections?: AdminCollection[];
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* If true, the configuration cannot be modified.
|
|
@@ -32,7 +33,7 @@ export interface CollectionsConfigController {
|
|
|
32
33
|
*/
|
|
33
34
|
collectionsSetup?: CollectionsSetupInfo;
|
|
34
35
|
|
|
35
|
-
getCollection: (id: string) =>
|
|
36
|
+
getCollection: (id: string) => AdminCollection;
|
|
36
37
|
|
|
37
38
|
saveCollection: <M extends { [Key: string]: any }>(params: SaveCollectionParams<M>) => Promise<void>;
|
|
38
39
|
updateCollection: <M extends { [Key: string]: any }>(params: UpdateCollectionParams<M>) => Promise<void>;
|
|
@@ -59,14 +60,14 @@ export interface CollectionsConfigController {
|
|
|
59
60
|
|
|
60
61
|
export type UpdateCollectionParams<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
61
62
|
id: string,
|
|
62
|
-
collectionData: Partial<
|
|
63
|
+
collectionData: Partial<AdminCollection<M>>,
|
|
63
64
|
previousId?: string,
|
|
64
65
|
parentCollectionSlugs?: string[], parentEntityIds?: string[]
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
export type SaveCollectionParams<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
68
69
|
id: string,
|
|
69
|
-
collectionData:
|
|
70
|
+
collectionData: AdminCollection<M>,
|
|
70
71
|
previousId?: string,
|
|
71
72
|
parentCollectionSlugs?: string[], parentEntityIds?: string[]
|
|
72
73
|
}
|
|
@@ -96,14 +97,14 @@ export type DeleteCollectionParams = {
|
|
|
96
97
|
export type UpdatePropertiesOrderParams = {
|
|
97
98
|
fullPath: string;
|
|
98
99
|
parentCollectionSlugs: string[], parentEntityIds: string[];
|
|
99
|
-
collection:
|
|
100
|
+
collection: AdminCollection;
|
|
100
101
|
newPropertiesOrder: string[];
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
export type UpdateKanbanColumnsOrderParams = {
|
|
104
105
|
fullPath: string;
|
|
105
106
|
parentCollectionSlugs: string[], parentEntityIds: string[];
|
|
106
|
-
collection:
|
|
107
|
+
collection: AdminCollection;
|
|
107
108
|
kanbanColumnProperty: string;
|
|
108
109
|
newColumnsOrder: string[];
|
|
109
110
|
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useTranslation
|
|
7
7
|
} from "@rebasepro/app";
|
|
8
8
|
import { getPropertyInPath } from "../_cms_internals";
|
|
9
|
-
import {
|
|
9
|
+
import { EnumValueConfig, StringProperty } from "@rebasepro/types";
|
|
10
10
|
import { resolveEnumValues } from "@rebasepro/common";
|
|
11
11
|
import {
|
|
12
12
|
Button,
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from "@rebasepro/ui";
|
|
24
24
|
import { useCollectionsConfigController } from "../useCollectionsConfigController";
|
|
25
25
|
import { toSnakeCase } from "@rebasepro/utils";
|
|
26
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Component rendered at the end of the Kanban board to add new columns (enum values).
|
|
@@ -34,7 +35,7 @@ export function AddKanbanColumnAction({
|
|
|
34
35
|
parentCollectionSlugs, parentEntityIds,
|
|
35
36
|
columnProperty
|
|
36
37
|
}: {
|
|
37
|
-
collection:
|
|
38
|
+
collection: AdminCollection;
|
|
38
39
|
fullPath: string;
|
|
39
40
|
parentCollectionSlugs: string[], parentEntityIds: string[];
|
|
40
41
|
columnProperty: string;
|