@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
|
@@ -4,7 +4,7 @@ import React, { useMemo, useState } from "react";
|
|
|
4
4
|
import { useCustomizationController } from "@rebasepro/app";
|
|
5
5
|
import { getFieldConfig } from "../../../components/field_configs";
|
|
6
6
|
import { PropertyConfigBadge } from "../../../components/PropertyConfigBadge";
|
|
7
|
-
import {
|
|
7
|
+
import { Property } from "@rebasepro/types";
|
|
8
8
|
import {
|
|
9
9
|
BooleanSwitchWithLabel,
|
|
10
10
|
Button,
|
|
@@ -25,6 +25,7 @@ import { KanbanConfigSection } from "./KanbanConfigSection";
|
|
|
25
25
|
import { PropertyFormDialog } from "./PropertyEditView";
|
|
26
26
|
import { useCollectionsConfigController } from "../../useCollectionsConfigController";
|
|
27
27
|
import { unslugify } from "@rebasepro/utils";
|
|
28
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
28
29
|
|
|
29
30
|
export function DisplaySettingsForm({
|
|
30
31
|
expandKanban,
|
|
@@ -39,7 +40,7 @@ export function DisplaySettingsForm({
|
|
|
39
40
|
setFieldValue,
|
|
40
41
|
handleChange,
|
|
41
42
|
submitCount
|
|
42
|
-
} = useFormex<
|
|
43
|
+
} = useFormex<AdminCollection>();
|
|
43
44
|
|
|
44
45
|
const [orderPropertyDialogOpen, setOrderPropertyDialogOpen] = useState(false);
|
|
45
46
|
|
|
@@ -198,7 +199,7 @@ export function DisplaySettingsForm({
|
|
|
198
199
|
property={{
|
|
199
200
|
type: "string",
|
|
200
201
|
name: dialogPropertyName,
|
|
201
|
-
|
|
202
|
+
admin: { disabled: true,
|
|
202
203
|
hideFromCollection: true }
|
|
203
204
|
}}
|
|
204
205
|
propertyKey={dialogPropertyKey}
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
useCustomizationController
|
|
6
6
|
} from "@rebasepro/app";
|
|
7
7
|
import { resolveEntityAction } from "../../_cms_internals";
|
|
8
|
-
|
|
9
|
-
import { EntityAction } from "@rebasepro/types";
|
|
8
|
+
|
|
9
|
+
import { EntityAction, AdminCollection } from "@rebasepro/admin-types";
|
|
10
10
|
import {
|
|
11
11
|
Alert,
|
|
12
12
|
Button,
|
|
@@ -30,7 +30,7 @@ export function EntityActionsEditTab({
|
|
|
30
30
|
collection,
|
|
31
31
|
embedded = false
|
|
32
32
|
}: {
|
|
33
|
-
collection:
|
|
33
|
+
collection: AdminCollection,
|
|
34
34
|
embedded?: boolean;
|
|
35
35
|
}) {
|
|
36
36
|
|
|
@@ -42,7 +42,7 @@ export function EntityActionsEditTab({
|
|
|
42
42
|
const {
|
|
43
43
|
values,
|
|
44
44
|
setFieldValue
|
|
45
|
-
} = useFormex<
|
|
45
|
+
} = useFormex<AdminCollection>();
|
|
46
46
|
|
|
47
47
|
const resolvedEntityActions = ((values.entityActions ?? []) as (string | EntityAction<any>)[])
|
|
48
48
|
.filter((e): e is string => typeof e === "string")
|
|
@@ -4,7 +4,7 @@ import { FieldCaption } from "../../_cms_internals";
|
|
|
4
4
|
import React, { useState } from "react";
|
|
5
5
|
|
|
6
6
|
import { SearchIconsView } from "../../_cms_internals";
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
import {
|
|
9
9
|
BooleanSwitchWithLabel,
|
|
10
10
|
Chip,
|
|
@@ -28,6 +28,7 @@ import { useCollectionsConfigController } from "../../useCollectionsConfigContro
|
|
|
28
28
|
import { singular, toSnakeCase } from "@rebasepro/utils";
|
|
29
29
|
import type { ExtraCollectionFieldsParams } from "../../extensibility_types";
|
|
30
30
|
import { toSerializableCollectionConfig } from "../../serializable_utils";
|
|
31
|
+
import type { AdminCollection, AdminPostgresCollection } from "@rebasepro/admin-types";
|
|
31
32
|
|
|
32
33
|
export function GeneralSettingsForm({
|
|
33
34
|
isNewCollection,
|
|
@@ -40,7 +41,7 @@ export function GeneralSettingsForm({
|
|
|
40
41
|
isNewCollection: boolean;
|
|
41
42
|
existingPaths?: string[];
|
|
42
43
|
existingIds?: string[];
|
|
43
|
-
parentCollection?:
|
|
44
|
+
parentCollection?: AdminCollection;
|
|
44
45
|
renderExtraCollectionFields?: (params: ExtraCollectionFieldsParams) => React.ReactNode;
|
|
45
46
|
standalone?: boolean;
|
|
46
47
|
}) {
|
|
@@ -53,7 +54,7 @@ export function GeneralSettingsForm({
|
|
|
53
54
|
errors,
|
|
54
55
|
setFieldTouched,
|
|
55
56
|
submitCount
|
|
56
|
-
} = useFormex<
|
|
57
|
+
} = useFormex<AdminPostgresCollection>();
|
|
57
58
|
|
|
58
59
|
const [iconDialogOpen, setIconDialogOpen] = useState(false);
|
|
59
60
|
|
|
@@ -151,7 +152,6 @@ export function GeneralSettingsForm({
|
|
|
151
152
|
</FieldCaption>
|
|
152
153
|
</div>
|
|
153
154
|
|
|
154
|
-
|
|
155
155
|
{/* Singular Name */}
|
|
156
156
|
<div className={"col-span-12"}>
|
|
157
157
|
<TextField
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSafeSnackbarController } from "../../useSafeSnackbarController";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { Button, CopyIcon, Dialog, DialogActions, DialogContent, DialogTitle, Typography } from "@rebasepro/ui";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import JSON5 from "json5";
|
|
@@ -7,17 +7,18 @@ import { Highlight, themes } from "prism-react-renderer"
|
|
|
7
7
|
import { camelCase } from "./utils/strings";
|
|
8
8
|
import { clone } from "@rebasepro/forms";
|
|
9
9
|
import { isEmptyObject } from "@rebasepro/utils";
|
|
10
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
10
11
|
|
|
11
12
|
export function GetCodeDialog({
|
|
12
13
|
collection,
|
|
13
14
|
onOpenChange,
|
|
14
15
|
open
|
|
15
|
-
}: { onOpenChange: (open: boolean) => void, collection:
|
|
16
|
+
}: { onOpenChange: (open: boolean) => void, collection: AdminCollection, open: boolean }) {
|
|
16
17
|
|
|
17
18
|
const snackbarController = useSafeSnackbarController();
|
|
18
19
|
|
|
19
20
|
const code = collection
|
|
20
|
-
? "import {
|
|
21
|
+
? "import { AdminCollection } from \"@rebasepro/app\";\n\nconst " + (collection?.name ? camelCase(collection.name) : "my") + "Collection:AdminCollection = " + JSON5.stringify(collectionToCode({ ...collection }), null, "\t")
|
|
21
22
|
: "No collection selected";
|
|
22
23
|
return <Dialog open={open}
|
|
23
24
|
onOpenChange={onOpenChange}
|
|
@@ -78,7 +79,7 @@ export function GetCodeDialog({
|
|
|
78
79
|
</Dialog>;
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
function collectionToCode(collection:
|
|
82
|
+
function collectionToCode(collection: AdminCollection): object {
|
|
82
83
|
|
|
83
84
|
const propertyCleanup = (value: unknown): unknown => {
|
|
84
85
|
if (value === undefined || value === null) {
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
import { FieldCaption } from "../../_cms_internals";
|
|
3
3
|
import React, { useMemo, useRef, useState } from "react";
|
|
4
4
|
import { useAuthController, useCustomizationController } from "@rebasepro/app";
|
|
5
|
-
import {
|
|
5
|
+
import { Property } from "@rebasepro/types";
|
|
6
6
|
import { PropertyConfigBadge } from "../../../components/PropertyConfigBadge";
|
|
7
7
|
import { getFieldConfig } from "../../../components/field_configs";
|
|
8
8
|
import { Button, IconButton, iconSize, Select, SelectItem, Typography, XIcon } from "@rebasepro/ui";
|
|
9
9
|
import { useFormex } from "@rebasepro/forms";
|
|
10
10
|
import { PropertyFormDialog } from "./PropertyEditView";
|
|
11
11
|
import { unslugify } from "@rebasepro/utils";
|
|
12
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
12
13
|
|
|
13
14
|
export function KanbanConfigSection({
|
|
14
15
|
className,
|
|
@@ -19,7 +20,7 @@ export function KanbanConfigSection({
|
|
|
19
20
|
}) {
|
|
20
21
|
const authController = useAuthController();
|
|
21
22
|
const customizationController = useCustomizationController();
|
|
22
|
-
const { values, setFieldValue } = useFormex<
|
|
23
|
+
const { values, setFieldValue } = useFormex<AdminCollection>();
|
|
23
24
|
const panelRef = useRef<HTMLDivElement>(null);
|
|
24
25
|
const [columnPropertyDialogOpen, setColumnPropertyDialogOpen] = useState(false);
|
|
25
26
|
|
|
@@ -6,7 +6,8 @@ import { Formex, FormexController, getIn, useCreateFormex } from "@rebasepro/for
|
|
|
6
6
|
import { ConfirmationDialog } from "@rebasepro/app";
|
|
7
7
|
import { DEFAULT_FIELD_CONFIGS, getFieldConfig, getFieldId } from "../../../components/field_configs";
|
|
8
8
|
import { PropertyConfigBadge } from "../../../components/PropertyConfigBadge";
|
|
9
|
-
import {
|
|
9
|
+
import { Property } from "@rebasepro/types";
|
|
10
|
+
import { PropertyConfig, PropertyConfigId, AdminCollection } from "@rebasepro/admin-types";
|
|
10
11
|
import type { PropertyTypePreset, PropertyType } from "../../extensibility_types";
|
|
11
12
|
import { toSerializableProperty, toSerializableCollectionConfig } from "../../serializable_utils";
|
|
12
13
|
import type { SerializableProperty, SerializableCollectionConfig } from "../../serializable_types";
|
|
@@ -93,7 +94,7 @@ export type PropertyFormProps = {
|
|
|
93
94
|
property: SerializableProperty;
|
|
94
95
|
collection: SerializableCollectionConfig;
|
|
95
96
|
}) => React.ReactNode;
|
|
96
|
-
collectionValues?:
|
|
97
|
+
collectionValues?: AdminCollection;
|
|
97
98
|
|
|
98
99
|
};
|
|
99
100
|
|
|
@@ -368,7 +369,7 @@ function PropertyEditFormFields({
|
|
|
368
369
|
propertyTypePresets?: PropertyTypePreset[];
|
|
369
370
|
hiddenPropertyTypes?: PropertyType[];
|
|
370
371
|
renderExtraPropertyFields?: PropertyFormProps["renderExtraPropertyFields"];
|
|
371
|
-
collectionValues?:
|
|
372
|
+
collectionValues?: AdminCollection;
|
|
372
373
|
|
|
373
374
|
} & FormexController<PropertyWithId>) {
|
|
374
375
|
|
|
@@ -3,7 +3,8 @@ import React from "react";
|
|
|
3
3
|
import { deepEqual as equal } from "fast-equals"
|
|
4
4
|
|
|
5
5
|
import { AIModifiedIndicator } from "@rebasepro/app";
|
|
6
|
-
import {
|
|
6
|
+
import { Properties, Property } from "@rebasepro/types";
|
|
7
|
+
import { AdditionalFieldDelegate } from "@rebasepro/admin-types";
|
|
7
8
|
import { isPropertyBuilder } from "@rebasepro/common";
|
|
8
9
|
import {
|
|
9
10
|
ArrowDownToLineIcon,
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
useCustomizationController
|
|
6
6
|
} from "@rebasepro/app";
|
|
7
7
|
import { resolveEntityView } from "../../_cms_internals";
|
|
8
|
-
import {
|
|
8
|
+
import { User } from "@rebasepro/types";
|
|
9
|
+
import { EntityCustomView, AdminCollection } from "@rebasepro/admin-types";
|
|
9
10
|
import { getSubcollections } from "@rebasepro/common";
|
|
10
11
|
import {
|
|
11
12
|
Alert,
|
|
@@ -37,8 +38,8 @@ export function SubcollectionsEditTab({
|
|
|
37
38
|
getUser,
|
|
38
39
|
parentCollectionSlugs
|
|
39
40
|
}: {
|
|
40
|
-
collection:
|
|
41
|
-
parentCollection?:
|
|
41
|
+
collection: AdminCollection,
|
|
42
|
+
parentCollection?: AdminCollection,
|
|
42
43
|
configController: CollectionsConfigController;
|
|
43
44
|
collectionInference?: CollectionInference;
|
|
44
45
|
getUser?: (uid: string) => User | null;
|
|
@@ -59,9 +60,9 @@ export function SubcollectionsEditTab({
|
|
|
59
60
|
const {
|
|
60
61
|
values,
|
|
61
62
|
setFieldValue
|
|
62
|
-
} = useFormex<
|
|
63
|
+
} = useFormex<AdminCollection>();
|
|
63
64
|
|
|
64
|
-
const [subcollections, setSubcollections] = React.useState<
|
|
65
|
+
const [subcollections, setSubcollections] = React.useState<AdminCollection[]>(getSubcollections(collection) ?? []);
|
|
65
66
|
const resolvedEntityViews = values.entityViews?.filter(e => typeof e === "string")
|
|
66
67
|
.map(e => resolveEntityView(e, contextEntityViews))
|
|
67
68
|
.filter(Boolean) as EntityCustomView[] ?? [];
|
|
@@ -6,7 +6,8 @@ import { getIn, useFormex } from "@rebasepro/forms";
|
|
|
6
6
|
|
|
7
7
|
import { getFieldConfig, getFieldId } from "../../../../components/field_configs";
|
|
8
8
|
import { PropertyConfigBadge } from "../../../../components/PropertyConfigBadge";
|
|
9
|
-
import {
|
|
9
|
+
import { Properties, Property } from "@rebasepro/types";
|
|
10
|
+
import { PropertyConfig, AdminCollection } from "@rebasepro/admin-types";
|
|
10
11
|
import { cls, Container, Select, SelectItem, Tooltip, Typography } from "@rebasepro/ui";
|
|
11
12
|
import React, { useState } from "react";
|
|
12
13
|
import { OnPropertyChangedParams, PropertyFormDialog, PropertyWithId } from "../PropertyEditView";
|
|
@@ -36,7 +37,7 @@ export function CollectionEditorImportMapping({
|
|
|
36
37
|
setFieldValue,
|
|
37
38
|
setFieldTouched,
|
|
38
39
|
values
|
|
39
|
-
} = useFormex<
|
|
40
|
+
} = useFormex<AdminCollection>();
|
|
40
41
|
const [selectedProperty, setSelectedProperty] = useState<PropertyWithId | undefined>(undefined);
|
|
41
42
|
|
|
42
43
|
const currentPropertiesOrderRef = React.useRef<{
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
namespaceToPropertiesPath
|
|
11
11
|
} from "../util";
|
|
12
12
|
import { PropertyTree } from "../PropertyTree";
|
|
13
|
-
import { ArrayProperty,
|
|
13
|
+
import { ArrayProperty, Property } from "@rebasepro/types";
|
|
14
|
+
import { PropertyConfig } from "@rebasepro/admin-types";
|
|
14
15
|
|
|
15
16
|
export function BlockPropertyField({
|
|
16
17
|
disabled,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FieldCaption } from "../../../_cms_internals";
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
;
|
|
4
|
-
import { MapProperty, Property
|
|
4
|
+
import { MapProperty, Property } from "@rebasepro/types";
|
|
5
|
+
import { PropertyConfig } from "@rebasepro/admin-types";
|
|
5
6
|
import { BooleanSwitchWithLabel, Button, Paper, PlusIcon, Typography } from "@rebasepro/ui";
|
|
6
7
|
import { PropertyFormDialog } from "../PropertyEditView";
|
|
7
8
|
import { getIn, useFormex } from "@rebasepro/forms";
|
|
@@ -111,7 +112,7 @@ export function MapPropertyField({ disabled, getData, allowDataInference, proper
|
|
|
111
112
|
size={"medium"}
|
|
112
113
|
label={t("spread_children_as_columns")}
|
|
113
114
|
onValueChange={(v) => setFieldValue("ui.spreadChildren", v)}
|
|
114
|
-
value={values.
|
|
115
|
+
value={values.admin?.spreadChildren ?? false}
|
|
115
116
|
/>
|
|
116
117
|
<FieldCaption>
|
|
117
118
|
Set this flag to true if you want to display the children of this group as individual columns. This
|
|
@@ -8,9 +8,10 @@ import {
|
|
|
8
8
|
TextField,
|
|
9
9
|
Typography
|
|
10
10
|
} from "@rebasepro/ui";
|
|
11
|
-
import {
|
|
11
|
+
import { OnAction, RelationProperty } from "@rebasepro/types";
|
|
12
12
|
|
|
13
13
|
import { CollectionsSelect } from "./ReferencePropertyField";
|
|
14
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
14
15
|
|
|
15
16
|
const ON_ACTION_OPTIONS: OnAction[] = ["cascade", "restrict", "no action", "set null", "set default"];
|
|
16
17
|
|
|
@@ -87,7 +88,7 @@ targetColumn: "" };
|
|
|
87
88
|
}
|
|
88
89
|
}, [targetSlug, relationName, setFieldValue]);
|
|
89
90
|
|
|
90
|
-
const collections:
|
|
91
|
+
const collections: AdminCollection[] = collectionRegistry?.collections ?? [];
|
|
91
92
|
|
|
92
93
|
return (
|
|
93
94
|
<>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { getFieldConfig } from "../../../../components/field_configs";
|
|
3
|
-
import { ArrayProperty, Property
|
|
3
|
+
import { ArrayProperty, Property } from "@rebasepro/types";
|
|
4
|
+
import { PropertyConfig } from "@rebasepro/admin-types";
|
|
4
5
|
import { Button, Paper, Typography } from "@rebasepro/ui";
|
|
5
6
|
import { Field, getIn, useFormex } from "@rebasepro/forms";
|
|
6
7
|
import { PropertyFormDialog } from "../PropertyEditView";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
2
2
|
|
|
3
3
|
export const blogCollectionTemplate = {
|
|
4
4
|
slug: "blog",
|
|
@@ -93,7 +93,7 @@ export const blogCollectionTemplate = {
|
|
|
93
93
|
publish_date: {
|
|
94
94
|
name: "Publish date",
|
|
95
95
|
type: "date",
|
|
96
|
-
|
|
96
|
+
admin: { clearable: true }
|
|
97
97
|
},
|
|
98
98
|
reviewed: {
|
|
99
99
|
name: "Reviewed",
|
|
@@ -109,4 +109,4 @@ export const blogCollectionTemplate = {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
} as unknown as
|
|
112
|
+
} as unknown as AdminCollection;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
2
2
|
|
|
3
3
|
export const pagesCollectionTemplate = {
|
|
4
4
|
slug: "pages",
|
|
@@ -176,8 +176,8 @@ export const pagesCollectionTemplate = {
|
|
|
176
176
|
is_published: {
|
|
177
177
|
type: "boolean",
|
|
178
178
|
name: "Is Published",
|
|
179
|
-
|
|
179
|
+
admin: { columnWidth: 100 },
|
|
180
180
|
description: "Should this page be live on the site?"
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
} as unknown as
|
|
183
|
+
} as unknown as AdminCollection;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
2
2
|
|
|
3
3
|
export const productsCollectionTemplate = {
|
|
4
4
|
slug: "products",
|
|
@@ -41,7 +41,7 @@ export const productsCollectionTemplate = {
|
|
|
41
41
|
available: {
|
|
42
42
|
type: "boolean",
|
|
43
43
|
name: "Available",
|
|
44
|
-
|
|
44
|
+
admin: { columnWidth: 100 },
|
|
45
45
|
description: "Is this product available in the website"
|
|
46
46
|
},
|
|
47
47
|
price: {
|
|
@@ -55,7 +55,7 @@ export const productsCollectionTemplate = {
|
|
|
55
55
|
images: {
|
|
56
56
|
type: "array",
|
|
57
57
|
name: "Images",
|
|
58
|
-
|
|
58
|
+
admin: { hideFromCollection: true },
|
|
59
59
|
of: {
|
|
60
60
|
type: "string",
|
|
61
61
|
storage: {
|
|
@@ -85,4 +85,4 @@ export const productsCollectionTemplate = {
|
|
|
85
85
|
autoValue: "on_create"
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
} as unknown as
|
|
88
|
+
} as unknown as AdminCollection;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
2
2
|
|
|
3
3
|
export const usersCollectionTemplate = {
|
|
4
4
|
slug: "users",
|
|
@@ -39,4 +39,4 @@ export const usersCollectionTemplate = {
|
|
|
39
39
|
url: "image"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
} as unknown as
|
|
42
|
+
} as unknown as AdminCollection;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_FIELD_CONFIGS } from "../../../../components/field_configs";
|
|
2
|
-
import { PropertyConfigId, PropertyConfig } from "@rebasepro/types";
|
|
2
|
+
import { PropertyConfigId, PropertyConfig } from "@rebasepro/admin-types";
|
|
3
3
|
|
|
4
4
|
export const supportedFieldsIds: PropertyConfigId[] = [
|
|
5
5
|
"text_field",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ArrayProperty, BooleanProperty, DateProperty, MapProperty, NumberProperty, Property,
|
|
1
|
+
import { ArrayProperty, BooleanProperty, DateProperty, MapProperty, NumberProperty, Property, StringProperty } from "@rebasepro/types";
|
|
2
|
+
import { PropertyConfig } from "@rebasepro/admin-types";
|
|
2
3
|
import { mergeDeep } from "@rebasepro/utils";
|
|
3
4
|
|
|
4
5
|
|
|
@@ -14,7 +15,7 @@ export function updatePropertyFromWidget(propertyData: any,
|
|
|
14
15
|
type: "string",
|
|
15
16
|
propertyConfig: "text_field",
|
|
16
17
|
storage: undefined,
|
|
17
|
-
|
|
18
|
+
admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },
|
|
18
19
|
email: undefined,
|
|
19
20
|
enum: undefined,
|
|
20
21
|
userSelect: undefined
|
|
@@ -27,7 +28,7 @@ export function updatePropertyFromWidget(propertyData: any,
|
|
|
27
28
|
type: "string",
|
|
28
29
|
propertyConfig: "user_select",
|
|
29
30
|
storage: undefined,
|
|
30
|
-
|
|
31
|
+
admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },
|
|
31
32
|
email: undefined,
|
|
32
33
|
enum: undefined,
|
|
33
34
|
userSelect: true
|
|
@@ -39,7 +40,7 @@ export function updatePropertyFromWidget(propertyData: any,
|
|
|
39
40
|
{
|
|
40
41
|
type: "string",
|
|
41
42
|
propertyConfig: "multiline",
|
|
42
|
-
|
|
43
|
+
admin: { multiline: true, markdown: undefined, urlPreview: undefined },
|
|
43
44
|
storage: undefined,
|
|
44
45
|
email: undefined,
|
|
45
46
|
enum: undefined,
|
|
@@ -53,7 +54,7 @@ export function updatePropertyFromWidget(propertyData: any,
|
|
|
53
54
|
type: "string",
|
|
54
55
|
propertyConfig: "markdown",
|
|
55
56
|
storage: undefined,
|
|
56
|
-
|
|
57
|
+
admin: { multiline: undefined, markdown: true, urlPreview: undefined },
|
|
57
58
|
email: undefined,
|
|
58
59
|
userSelect: undefined
|
|
59
60
|
} as StringProperty
|
|
@@ -65,7 +66,8 @@ export function updatePropertyFromWidget(propertyData: any,
|
|
|
65
66
|
type: "string",
|
|
66
67
|
propertyConfig: "url",
|
|
67
68
|
storage: undefined,
|
|
68
|
-
|
|
69
|
+
url: true,
|
|
70
|
+
admin: { multiline: undefined, markdown: undefined },
|
|
69
71
|
email: undefined,
|
|
70
72
|
enum: undefined,
|
|
71
73
|
userSelect: undefined
|
|
@@ -78,7 +80,7 @@ export function updatePropertyFromWidget(propertyData: any,
|
|
|
78
80
|
type: "string",
|
|
79
81
|
propertyConfig: "email",
|
|
80
82
|
storage: undefined,
|
|
81
|
-
|
|
83
|
+
admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },
|
|
82
84
|
email: true,
|
|
83
85
|
enum: undefined,
|
|
84
86
|
userSelect: undefined
|
|
@@ -91,7 +93,7 @@ export function updatePropertyFromWidget(propertyData: any,
|
|
|
91
93
|
type: "string",
|
|
92
94
|
propertyConfig: "select",
|
|
93
95
|
storage: undefined,
|
|
94
|
-
|
|
96
|
+
admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },
|
|
95
97
|
email: undefined,
|
|
96
98
|
enum: propertyData.enum ?? [],
|
|
97
99
|
userSelect: undefined
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
-
import type { EngineProperties,
|
|
2
|
+
import type { EngineProperties, Property } from "@rebasepro/types";
|
|
3
|
+
import type { NavigationGroupMapping, AdminCollection } from "@rebasepro/admin-types";
|
|
3
4
|
import type {
|
|
4
5
|
CollectionsConfigController,
|
|
5
6
|
SaveCollectionParams,
|
|
@@ -55,7 +56,7 @@ export function useJsonCollectionsConfigController({
|
|
|
55
56
|
readOnly = false,
|
|
56
57
|
autoLoad = true,
|
|
57
58
|
}: UseJsonCollectionsConfigControllerOptions): CollectionsConfigController {
|
|
58
|
-
const [collections, setCollections] = useState<
|
|
59
|
+
const [collections, setCollections] = useState<AdminCollection[]>([]);
|
|
59
60
|
const [loading, setLoading] = useState(autoLoad);
|
|
60
61
|
const [navigationEntries, setNavigationEntries] = useState<NavigationGroupMapping[]>([]);
|
|
61
62
|
|
|
@@ -92,7 +93,7 @@ export function useJsonCollectionsConfigController({
|
|
|
92
93
|
/**
|
|
93
94
|
* Update local state and persist a collection to the store.
|
|
94
95
|
*/
|
|
95
|
-
const persistCollection = useCallback(async (collection:
|
|
96
|
+
const persistCollection = useCallback(async (collection: AdminCollection) => {
|
|
96
97
|
const serializable = toSerializableCollectionConfig(collection);
|
|
97
98
|
await storeRef.current.save(collection.slug, serializable);
|
|
98
99
|
}, []);
|
|
@@ -100,7 +101,7 @@ export function useJsonCollectionsConfigController({
|
|
|
100
101
|
/**
|
|
101
102
|
* Find collection by id (slug).
|
|
102
103
|
*/
|
|
103
|
-
const getCollection = useCallback((id: string):
|
|
104
|
+
const getCollection = useCallback((id: string): AdminCollection => {
|
|
104
105
|
const found = collections.find(c => c.slug === id);
|
|
105
106
|
if (found) return found;
|
|
106
107
|
throw new Error(`Collection "${id}" not found`);
|
|
@@ -111,7 +112,7 @@ export function useJsonCollectionsConfigController({
|
|
|
111
112
|
const saveCollection = useCallback(async <M extends Record<string, unknown>>(
|
|
112
113
|
{ id, collectionData }: SaveCollectionParams<M>
|
|
113
114
|
) => {
|
|
114
|
-
const collection = collectionData as
|
|
115
|
+
const collection = collectionData as AdminCollection;
|
|
115
116
|
await persistCollection(collection);
|
|
116
117
|
setCollections(prev => {
|
|
117
118
|
const idx = prev.findIndex(c => c.slug === id);
|
|
@@ -132,7 +133,7 @@ export function useJsonCollectionsConfigController({
|
|
|
132
133
|
const idx = prev.findIndex(c => c.slug === lookupId);
|
|
133
134
|
if (idx < 0) return prev;
|
|
134
135
|
|
|
135
|
-
const merged = { ...prev[idx], ...collectionData } as
|
|
136
|
+
const merged = { ...prev[idx], ...collectionData } as AdminCollection;
|
|
136
137
|
const next = [...prev];
|
|
137
138
|
next[idx] = merged;
|
|
138
139
|
|
|
@@ -177,7 +178,7 @@ export function useJsonCollectionsConfigController({
|
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
const next = [...prev];
|
|
180
|
-
next[idx] = collection as
|
|
181
|
+
next[idx] = collection as AdminCollection;
|
|
181
182
|
|
|
182
183
|
persistCollection(next[idx]).catch(e =>
|
|
183
184
|
console.error("useJsonCollectionsConfigController: failed to save property", e)
|
|
@@ -204,7 +205,7 @@ export function useJsonCollectionsConfigController({
|
|
|
204
205
|
}
|
|
205
206
|
|
|
206
207
|
const next = [...prev];
|
|
207
|
-
next[idx] = collection as
|
|
208
|
+
next[idx] = collection as AdminCollection;
|
|
208
209
|
|
|
209
210
|
persistCollection(next[idx]).catch(e =>
|
|
210
211
|
console.error("useJsonCollectionsConfigController: failed to delete property", e)
|
|
@@ -221,7 +222,7 @@ export function useJsonCollectionsConfigController({
|
|
|
221
222
|
const updated = {
|
|
222
223
|
...collection,
|
|
223
224
|
propertiesOrder: newPropertiesOrder,
|
|
224
|
-
} as
|
|
225
|
+
} as AdminCollection;
|
|
225
226
|
|
|
226
227
|
setCollections(prev => {
|
|
227
228
|
const idx = prev.findIndex(c => c.slug === collection.slug);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CollectionsConfigController, SaveCollectionParams, UpdateCollectionParams, DeleteCollectionParams, SavePropertyParams, DeletePropertyParams, UpdatePropertiesOrderParams } from "./types/config_controller";
|
|
2
|
-
import {
|
|
2
|
+
import { Properties } from "@rebasepro/types";
|
|
3
3
|
import { getSubcollections } from "@rebasepro/common";
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
import React, { useMemo, useRef } from "react";
|
|
6
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
7
7
|
export function useLocalCollectionsConfigController(
|
|
8
8
|
clientOrUrl: any,
|
|
9
|
-
baseCollections:
|
|
9
|
+
baseCollections: AdminCollection[] = [],
|
|
10
10
|
options?: {
|
|
11
11
|
readOnly?: boolean;
|
|
12
12
|
getAuthToken?: () => Promise<string | null>;
|
|
@@ -73,7 +73,7 @@ export function useLocalCollectionsConfigController(
|
|
|
73
73
|
readOnlyReason: "Local collection editing is only available in development mode.",
|
|
74
74
|
collections: parsedCollections,
|
|
75
75
|
getCollection: (id: string) => {
|
|
76
|
-
const found = parsedCollections.find(c => (c as
|
|
76
|
+
const found = parsedCollections.find(c => (c as AdminCollection & { id?: string }).id === id || c.slug === id);
|
|
77
77
|
if (found) return found;
|
|
78
78
|
throw Error(`Collection ${id} not found in local mode`);
|
|
79
79
|
},
|
|
@@ -109,7 +109,7 @@ collectionData: { propertiesOrder: newPropertiesOrder } });
|
|
|
109
109
|
},
|
|
110
110
|
|
|
111
111
|
updatePropertiesOrder: async ({ collection, fullPath, newPropertiesOrder }: UpdatePropertiesOrderParams) => {
|
|
112
|
-
const collectionId = (collection as
|
|
112
|
+
const collectionId = (collection as AdminCollection & { id?: string }).id || fullPath.split("/").pop();
|
|
113
113
|
await request("/collection/save", { collectionId,
|
|
114
114
|
collectionData: { propertiesOrder: newPropertiesOrder } });
|
|
115
115
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataType
|
|
2
|
-
|
|
1
|
+
import { DataType } from "@rebasepro/types";
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Valid dataType values for properties
|
|
@@ -18,7 +18,6 @@ const VALID_DATA_TYPES = [
|
|
|
18
18
|
"binary"
|
|
19
19
|
] as const;
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
/**
|
|
23
22
|
* Validation error with path and message
|
|
24
23
|
*/
|
|
@@ -33,7 +32,7 @@ export interface CollectionValidationError {
|
|
|
33
32
|
export interface CollectionValidationResult {
|
|
34
33
|
valid: boolean;
|
|
35
34
|
errors: CollectionValidationError[];
|
|
36
|
-
collection?:
|
|
35
|
+
collection?: AdminCollection;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
/**
|
|
@@ -461,6 +460,6 @@ export function validateCollectionJson(jsonString: string): CollectionValidation
|
|
|
461
460
|
return {
|
|
462
461
|
valid: errors.length === 0,
|
|
463
462
|
errors,
|
|
464
|
-
collection: errors.length === 0 ? parsed as unknown as
|
|
463
|
+
collection: errors.length === 0 ? parsed as unknown as AdminCollection : undefined
|
|
465
464
|
};
|
|
466
465
|
}
|