@rebasepro/admin 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -0
- package/dist/CollectionEditorDialog-jA-PLh6N.js +3549 -0
- package/dist/CollectionEditorDialog-jA-PLh6N.js.map +1 -0
- package/dist/CollectionsStudioView-UKouBPOm.js +170 -0
- package/dist/CollectionsStudioView-UKouBPOm.js.map +1 -0
- package/dist/PropertyEditView-DEUddmg_.js +3660 -0
- package/dist/PropertyEditView-DEUddmg_.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +2 -2
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -1
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -1
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -1
- package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +1 -9
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -3
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +1 -1
- package/dist/collection_editor_ui.js +4 -11
- package/dist/components/ArrayContainer.d.ts +3 -3
- package/dist/components/ClearFilterSortButton.d.ts +1 -1
- package/dist/components/CollectionEditorDialogs.d.ts +2 -1
- package/dist/components/CollectionPanel.d.ts +2 -27
- package/dist/components/DefaultAppBar.d.ts +1 -1
- package/dist/components/DefaultDrawer.d.ts +4 -4
- package/dist/components/DeleteEntityDialog.d.ts +2 -1
- package/dist/components/DrawerNavigationGroup.d.ts +1 -1
- package/dist/components/DrawerNavigationItem.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +4 -3
- package/dist/components/EntityCollectionView/Board.d.ts +2 -1
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +1 -1
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCard.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +0 -24
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
- package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +2 -1
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
- package/dist/components/EntityCollectionView/SplitListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +2 -1
- package/dist/components/EntityDetailView.d.ts +1 -1
- package/dist/components/EntityEditView.d.ts +2 -2
- package/dist/components/EntityEditViewFormActions.d.ts +2 -1
- package/dist/components/EntityJsonPreview.d.ts +2 -1
- package/dist/components/EntityPreview.d.ts +3 -3
- package/dist/components/EntitySidePanel.d.ts +2 -1
- package/dist/components/EntityView.d.ts +2 -1
- package/dist/components/FieldCaption.d.ts +1 -1
- package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
- package/dist/components/HomePage/FavouritesView.d.ts +1 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +4 -4
- package/dist/components/HomePage/NavigationCard.d.ts +1 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +2 -1
- package/dist/components/HomePage/NavigationGroup.d.ts +2 -2
- package/dist/components/HomePage/RenameGroupDialog.d.ts +2 -1
- package/dist/components/HomePage/SmallNavigationCard.d.ts +1 -1
- package/dist/components/PropertyCollectionView.d.ts +2 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +2 -2
- package/dist/components/RebaseAuthGate.d.ts +1 -1
- package/dist/components/RebaseLayout.d.ts +1 -1
- package/dist/components/RebaseNavigation.d.ts +1 -1
- package/dist/components/RebaseRouteDefs.d.ts +1 -1
- package/dist/components/RebaseShell.d.ts +1 -1
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
- package/dist/components/ReferenceWidget.d.ts +2 -1
- package/dist/components/SearchIconsView.d.ts +2 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -1
- package/dist/components/SideDialogs.d.ts +1 -1
- package/dist/components/SideEntityProvider.d.ts +1 -1
- package/dist/components/admin/CreationResultDialog.d.ts +2 -1
- package/dist/components/app/AppBar.d.ts +1 -1
- package/dist/components/app/Drawer.d.ts +1 -1
- package/dist/components/common/default_entity_actions.d.ts +2 -1
- package/dist/components/history/EntityHistoryEntry.d.ts +1 -1
- package/dist/components/history/EntityHistoryView.d.ts +1 -1
- package/dist/components/history/LastEditedByFormAction.d.ts +2 -1
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -1
- package/dist/components/history/UserChip.d.ts +1 -1
- package/dist/data_export/export/BasicExportAction.d.ts +2 -1
- package/dist/data_export/export/ExportCollectionAction.d.ts +1 -1
- package/dist/data_import/components/DataNewPropertiesMapping.d.ts +1 -1
- package/dist/data_import/components/ImportFileUpload.d.ts +1 -1
- package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +2 -1
- package/dist/data_import/components/ImportSaveInProgress.d.ts +1 -1
- package/dist/data_import/import/ImportCollectionAction.d.ts +4 -3
- package/dist/editor/components/SlashCommandMenu.d.ts +2 -1
- package/dist/editor/editor.d.ts +1 -1
- package/dist/editor/selectors/color-selector.d.ts +1 -1
- package/dist/editor/selectors/link-selector.d.ts +1 -1
- package/dist/editor/selectors/node-selector.d.ts +1 -1
- package/dist/editor/selectors/text-buttons.d.ts +1 -1
- package/dist/editor.js +2621 -3574
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -1
- package/dist/form/EntityFormActions.d.ts +2 -1
- package/dist/form/components/FieldHelperText.d.ts +1 -1
- package/dist/form/components/FormEntry.d.ts +1 -1
- package/dist/form/components/FormLayout.d.ts +1 -1
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +1 -1
- package/dist/form/components/LocalChangesMenu.d.ts +2 -1
- package/dist/form/components/StorageItemPreview.d.ts +2 -1
- package/dist/form/components/StorageUploadProgress.d.ts +2 -1
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -2
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/VectorFieldBinding.d.ts +2 -1
- package/dist/history-BL49TIDb.js +311 -0
- package/dist/history-BL49TIDb.js.map +1 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +0 -2
- package/dist/hooks/navigation/useNavigationResolution.d.ts +5 -6
- package/dist/hooks/navigation/useResolvedCollections.d.ts +0 -2
- package/dist/hooks/useBreadcrumbsController.d.ts +2 -32
- package/dist/index.js +2 -3393
- package/dist/markdown-CklalUUk.js +526 -0
- package/dist/markdown-CklalUUk.js.map +1 -0
- package/dist/preview/components/ArrayEnumPreview.d.ts +2 -1
- package/dist/preview/components/EmptyValue.d.ts +2 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/components/ImagePreview.d.ts +2 -1
- package/dist/preview/components/ReferencePreview.d.ts +2 -1
- package/dist/preview/components/RelationPreview.d.ts +2 -1
- package/dist/preview/components/StorageThumbnail.d.ts +1 -1
- package/dist/preview/components/UserPreview.d.ts +6 -3
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +2 -1
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +3 -2
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +5 -4
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/routes/RebaseRoute.d.ts +1 -1
- package/dist/src-BJ8fkM8y.js +24010 -0
- package/dist/src-BJ8fkM8y.js.map +1 -0
- package/dist/types/components/PropertyPreviewProps.d.ts +4 -0
- package/dist/types/components/formex.d.ts +1 -40
- package/dist/types/fields.d.ts +9 -1
- package/dist/util/navigation_utils.d.ts +2 -1
- package/dist/util/previews.d.ts +5 -0
- package/dist/util/property_utils.d.ts +1 -1
- package/package.json +29 -27
- package/src/collection_editor/ConfigControllerProvider.tsx +10 -7
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -1
- package/src/collection_editor/ui/EditorEntityAction.tsx +2 -1
- package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -1
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +2 -1
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +2 -3
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +0 -1
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -4
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +5 -2
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +1 -1
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +7 -2
- package/src/collection_editor/validateCollectionJson.ts +2 -2
- package/src/components/CollectionPanel.tsx +51 -25
- package/src/components/DefaultAppBar.tsx +1 -2
- package/src/components/DefaultDrawer.tsx +3 -2
- package/src/components/DrawerNavigationGroup.tsx +3 -2
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +30 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -0
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +5 -2
- package/src/components/EntityCollectionView/Board.tsx +10 -8
- package/src/components/EntityCollectionView/BoardSortableList.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +4 -2
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +14 -4
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +48 -26
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +146 -73
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +2 -1
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +3 -2
- package/src/components/EntityCollectionView/FilterPresetsButton.tsx +4 -2
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +0 -1
- package/src/components/EntityCollectionView/useBoardDataController.tsx +17 -15
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +32 -23
- package/src/components/EntityDetailView.tsx +72 -39
- package/src/components/EntityEditView.tsx +79 -47
- package/src/components/EntitySidePanel.tsx +9 -3
- package/src/components/HomePage/ContentHomePage.tsx +3 -3
- package/src/components/HomePage/NavigationCard.tsx +5 -5
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/RebaseLayout.tsx +5 -2
- package/src/components/RebaseNavigation.tsx +1 -4
- package/src/components/RebaseRouteDefs.tsx +5 -3
- package/src/components/SearchIconsView.tsx +1 -1
- package/src/components/SelectableTable/SelectableTable.tsx +2 -3
- package/src/components/SelectableTable/SelectionStore.ts +9 -3
- package/src/components/UserSelector.tsx +92 -2
- package/src/components/common/default_entity_actions.tsx +23 -6
- package/src/components/field_configs.tsx +6 -3
- package/src/editor/editor.tsx +1 -1
- package/src/editor/extensions/Image/index.ts +2 -2
- package/src/editor/extensions/Image.ts +2 -2
- package/src/editor/extensions/clipboard.ts +2 -2
- package/src/editor/markdown-it-plugins.d.ts +24 -0
- package/src/editor/markdown.ts +2 -3
- package/src/form/EntityForm.tsx +21 -15
- package/src/form/PropertyFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MapFieldBinding.tsx +5 -47
- package/src/form/field_bindings/VectorFieldBinding.tsx +3 -3
- package/src/form/validation.ts +17 -15
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -6
- package/src/hooks/navigation/useNavigationResolution.ts +143 -19
- package/src/hooks/navigation/useResolvedCollections.ts +4 -6
- package/src/hooks/useBreadcrumbsController.tsx +2 -34
- package/src/hooks/useBuildSideEntityController.tsx +25 -3
- package/src/preview/PropertyPreview.tsx +6 -2
- package/src/preview/components/ReferencePreview.tsx +64 -13
- package/src/preview/components/RelationPreview.tsx +101 -13
- package/src/preview/components/UserPreview.tsx +5 -14
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/routes/RebaseRoute.tsx +5 -4
- package/src/types/components/PropertyPreviewProps.tsx +5 -0
- package/src/types/components/formex.tsx +1 -45
- package/src/types/fields.tsx +10 -1
- package/src/util/navigation_utils.ts +14 -4
- package/src/util/previews.ts +101 -4
- package/dist/CollectionEditorDialog-Bo86h-d-.js +0 -4574
- package/dist/CollectionEditorDialog-Bo86h-d-.js.map +0 -1
- package/dist/CollectionsStudioView-bsg4AT_Z.js +0 -217
- package/dist/CollectionsStudioView-bsg4AT_Z.js.map +0 -1
- package/dist/ExportCollectionAction-Cf-Id5uO.js +0 -446
- package/dist/ExportCollectionAction-Cf-Id5uO.js.map +0 -1
- package/dist/ImportCollectionAction-LN5sreK9.js +0 -685
- package/dist/ImportCollectionAction-LN5sreK9.js.map +0 -1
- package/dist/PropertyEditView-jCWCxmCz.js +0 -8197
- package/dist/PropertyEditView-jCWCxmCz.js.map +0 -1
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/index-BrqSvMG0.js +0 -8
- package/dist/index-BrqSvMG0.js.map +0 -1
- package/dist/index-Cb0bPnzZ.js +0 -12
- package/dist/index-Cb0bPnzZ.js.map +0 -1
- package/dist/index-z3H8iqsj.js +0 -462
- package/dist/index-z3H8iqsj.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-DD2JDU1X.js +0 -618
- package/dist/markdown-DD2JDU1X.js.map +0 -1
- package/dist/useEntityHistory-UVsSclfZ.js +0 -123
- package/dist/useEntityHistory-UVsSclfZ.js.map +0 -1
- package/dist/util-CvNp6A-r.js +0 -30505
- package/dist/util-CvNp6A-r.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrowRightIcon, Card, cls, Markdown, Typography } from "@rebasepro/ui";
|
|
1
|
+
import { ArrowRightIcon, Card, cls, iconSize, Markdown, Typography } from "@rebasepro/ui";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
export type NavigationCardProps = {
|
|
@@ -40,7 +40,7 @@ export const NavigationCard = React.memo(function NavigationCard({
|
|
|
40
40
|
{/* Header: title + icon left, actions right */}
|
|
41
41
|
<div className="flex items-center w-full justify-between mb-1">
|
|
42
42
|
<div className="flex items-center gap-4">
|
|
43
|
-
<div className="flex items-center justify-center w-
|
|
43
|
+
<div className="flex items-center justify-center w-6 h-6 rounded-lg bg-primary/8 dark:bg-primary/10 text-primary/70 dark:text-primary/60 transition-colors duration-200 group-hover:bg-primary/12 dark:group-hover:bg-primary/15 group-hover:text-primary dark:group-hover:text-primary/80">
|
|
44
44
|
{icon}
|
|
45
45
|
</div>
|
|
46
46
|
<Typography variant="subtitle1"
|
|
@@ -60,7 +60,7 @@ export const NavigationCard = React.memo(function NavigationCard({
|
|
|
60
60
|
</div>
|
|
61
61
|
|
|
62
62
|
{/* Description */}
|
|
63
|
-
<div className="grow pl-[
|
|
63
|
+
<div className="grow pl-[40px]">
|
|
64
64
|
{description && <Typography variant="caption"
|
|
65
65
|
color="secondary"
|
|
66
66
|
component="div">
|
|
@@ -69,7 +69,7 @@ export const NavigationCard = React.memo(function NavigationCard({
|
|
|
69
69
|
</div>
|
|
70
70
|
|
|
71
71
|
{additionalContent && (
|
|
72
|
-
<div className="pl-[
|
|
72
|
+
<div className="pl-[40px] pointer-events-none">
|
|
73
73
|
{additionalContent}
|
|
74
74
|
</div>
|
|
75
75
|
)}
|
|
@@ -77,7 +77,7 @@ export const NavigationCard = React.memo(function NavigationCard({
|
|
|
77
77
|
{/* Arrow */}
|
|
78
78
|
<div className="self-end mt-1">
|
|
79
79
|
<div className={"transition-transform duration-200 group-hover:translate-x-0.5"}>
|
|
80
|
-
<ArrowRightIcon className="text-primary"/>
|
|
80
|
+
<ArrowRightIcon className="text-primary" size={iconSize.small}/>
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
|
|
@@ -38,7 +38,7 @@ export function NavigationCardBinding({
|
|
|
38
38
|
}) {
|
|
39
39
|
|
|
40
40
|
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
41
|
-
const collectionIcon = <IconForView collectionOrView={collection ?? view}/>;
|
|
41
|
+
const collectionIcon = <IconForView collectionOrView={collection ?? view} size={"small"}/>;
|
|
42
42
|
|
|
43
43
|
const navigate = useNavigate();
|
|
44
44
|
const context = useRebaseContext();
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Outlet } from "react-router-dom";
|
|
3
3
|
import {
|
|
4
4
|
useAdminModeController,
|
|
5
|
+
useComponentOverride,
|
|
5
6
|
useRebaseRegistry
|
|
6
7
|
} from "@rebasepro/core";
|
|
7
8
|
|
|
@@ -52,14 +53,16 @@ export function RebaseLayout(props: RebaseLayoutProps) {
|
|
|
52
53
|
} = props;
|
|
53
54
|
|
|
54
55
|
const adminModeController = useAdminModeController();
|
|
56
|
+
const ResolvedAppBar = useComponentOverride("Shell.AppBar", AppBar);
|
|
57
|
+
const ResolvedDrawer = useComponentOverride("Shell.Drawer", Drawer);
|
|
55
58
|
|
|
56
|
-
const ActiveAppBar = appBar ?? <
|
|
59
|
+
const ActiveAppBar = appBar ?? <ResolvedAppBar
|
|
57
60
|
includeLanguageToggle={false}
|
|
58
61
|
includeModeToggle={false}
|
|
59
62
|
includeUserMenu={false}
|
|
60
63
|
/>;
|
|
61
64
|
const ActiveDrawer = drawer ?? (
|
|
62
|
-
<
|
|
65
|
+
<ResolvedDrawer
|
|
63
66
|
title={title}
|
|
64
67
|
logoDestination={adminModeController.mode === "studio" ? "/s" : "/"}
|
|
65
68
|
/>
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
useCustomizationController,
|
|
7
7
|
useAdminModeController,
|
|
8
8
|
useBuildLocalConfigurationPersistence,
|
|
9
|
-
useInternalUserManagementController,
|
|
10
9
|
useRebaseClient,
|
|
11
10
|
StudioBridgeRegistryProvider,
|
|
12
11
|
useBridgeRegistration,
|
|
@@ -67,7 +66,6 @@ export function RebaseNavigation({ children }: RebaseNavigationProps) {
|
|
|
67
66
|
const registry = useRebaseRegistry();
|
|
68
67
|
const context = useRebaseContext();
|
|
69
68
|
const adminModeController = useAdminModeController();
|
|
70
|
-
const userManagement = useInternalUserManagementController();
|
|
71
69
|
const userConfigPersistence = useBuildLocalConfigurationPersistence();
|
|
72
70
|
|
|
73
71
|
// ── Collection Editor resolution ──────────────────────────────────
|
|
@@ -147,8 +145,7 @@ export function RebaseNavigation({ children }: RebaseNavigationProps) {
|
|
|
147
145
|
data: context.data,
|
|
148
146
|
collectionRegistryController,
|
|
149
147
|
urlController,
|
|
150
|
-
adminMode: adminModeController?.mode
|
|
151
|
-
userManagement
|
|
148
|
+
adminMode: adminModeController?.mode
|
|
152
149
|
});
|
|
153
150
|
|
|
154
151
|
// ── Merge CMS-registered entityViews/entityActions into the customization controller ──
|
|
@@ -5,11 +5,12 @@ import {
|
|
|
5
5
|
RebaseRoutes,
|
|
6
6
|
UserSettingsView,
|
|
7
7
|
UIReferenceView,
|
|
8
|
-
NotFoundPage
|
|
8
|
+
NotFoundPage,
|
|
9
|
+
useComponentOverride
|
|
9
10
|
} from "@rebasepro/core";
|
|
10
11
|
import { CircularProgressCenter } from "@rebasepro/ui";
|
|
11
12
|
|
|
12
|
-
import { ContentHomePage } from "./HomePage/ContentHomePage";
|
|
13
|
+
import { ContentHomePage as DefaultHomePage } from "./HomePage/ContentHomePage";
|
|
13
14
|
|
|
14
15
|
import { RebaseRoute } from "../routes/RebaseRoute";
|
|
15
16
|
import { CustomViewRoute } from "../routes/CustomViewRoute";
|
|
@@ -65,7 +66,8 @@ export function RebaseRouteDefs({ children, layout }: RebaseRouteDefsProps) {
|
|
|
65
66
|
const registry = useRebaseRegistry();
|
|
66
67
|
const navigationStateController = useNavigationStateController();
|
|
67
68
|
|
|
68
|
-
const
|
|
69
|
+
const ResolvedHomePage = useComponentOverride("HomePage", DefaultHomePage);
|
|
70
|
+
const cmsHomePage = registry.cmsConfig?.homePage ?? <Suspense fallback={<CircularProgressCenter/>}><ResolvedHomePage/></Suspense>;
|
|
69
71
|
const studioHomePage = registry.studioConfig?.homePage;
|
|
70
72
|
|
|
71
73
|
const combinedViews = useMemo(() => [
|
|
@@ -17,7 +17,7 @@ const UPDATE_SEARCH_INDEX_WAIT_MS = 220;
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
function toPascalCase(str: string): string {
|
|
20
|
-
return str.split(/[-_]/).map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(
|
|
20
|
+
return str.split(/[-_]/).map(word => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function resolveIcon(iconKey: string): React.ComponentType<{ size: number }> | null {
|
|
@@ -24,7 +24,7 @@ export type SelectableTableProps<M extends Record<string, unknown>> = {
|
|
|
24
24
|
|
|
25
25
|
columns: VirtualTableColumn[];
|
|
26
26
|
|
|
27
|
-
cellRenderer:
|
|
27
|
+
cellRenderer: (props: CellRendererParams<Entity<M>>) => React.ReactNode;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Builder for creating the buttons in each row
|
|
@@ -247,8 +247,7 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
|
|
|
247
247
|
<VirtualTable
|
|
248
248
|
data={data as unknown as Record<string, unknown>[]}
|
|
249
249
|
columns={columns}
|
|
250
|
-
|
|
251
|
-
cellRenderer={cellRenderer}
|
|
250
|
+
cellRenderer={(props) => cellRenderer(props as unknown as CellRendererParams<Entity<M>>)}
|
|
252
251
|
onRowClick={inlineEditing ? undefined : (onEntityClick ? onRowClick : undefined)}
|
|
253
252
|
onEndReached={loadNextPage}
|
|
254
253
|
onResetPagination={resetPagination}
|
|
@@ -32,7 +32,9 @@ export function createSelectionStore() {
|
|
|
32
32
|
listeners.forEach(l => l());
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
return { getSnapshot,
|
|
35
|
+
return { getSnapshot,
|
|
36
|
+
subscribe,
|
|
37
|
+
select };
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
export type SelectionStore = ReturnType<typeof createSelectionStore>;
|
|
@@ -51,8 +53,12 @@ export function useCellSelected(
|
|
|
51
53
|
// Memoize a selector that derives a boolean from the store snapshot.
|
|
52
54
|
// useSyncExternalStore calls this on every store notification, but
|
|
53
55
|
// React only re-renders when the returned value !== the previous one.
|
|
54
|
-
const selectorRef = useRef({ propertyKey,
|
|
55
|
-
|
|
56
|
+
const selectorRef = useRef({ propertyKey,
|
|
57
|
+
entityPath,
|
|
58
|
+
entityId });
|
|
59
|
+
selectorRef.current = { propertyKey,
|
|
60
|
+
entityPath,
|
|
61
|
+
entityId };
|
|
56
62
|
|
|
57
63
|
const getSnapshot = useCallback(() => {
|
|
58
64
|
const cell = store.getSnapshot();
|
|
@@ -21,10 +21,100 @@ import * as React from "react";
|
|
|
21
21
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
22
22
|
import { Command as CommandPrimitive } from "cmdk";
|
|
23
23
|
import { User } from "@rebasepro/types";
|
|
24
|
-
import {
|
|
25
|
-
import { UserDisplay } from "@rebasepro/core";
|
|
24
|
+
import { useRebaseClient, useAuthController, UserDisplay } from "@rebasepro/core";
|
|
26
25
|
import { EmptyValue } from "../preview";
|
|
27
26
|
|
|
27
|
+
interface UserSelectorItem {
|
|
28
|
+
uid: string;
|
|
29
|
+
label: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
user: User;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const DEFAULT_PAGE_SIZE = 10;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Local hook to fetch users from the collection REST API with search and pagination.
|
|
38
|
+
*/
|
|
39
|
+
function useUserSelector({ pageSize = DEFAULT_PAGE_SIZE }: { pageSize?: number } = {}) {
|
|
40
|
+
const client = useRebaseClient<{ baseUrl?: string }>();
|
|
41
|
+
const { getAuthToken } = useAuthController();
|
|
42
|
+
|
|
43
|
+
const [items, setItems] = useState<UserSelectorItem[]>([]);
|
|
44
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
45
|
+
const [hasMore, setHasMore] = useState(true);
|
|
46
|
+
const [currentSearch, setCurrentSearch] = useState("");
|
|
47
|
+
const offsetRef = useRef(0);
|
|
48
|
+
const userCacheRef = useRef<Map<string, User>>(new Map());
|
|
49
|
+
|
|
50
|
+
const fetchUsers = useCallback(async (searchStr: string, offset: number, append: boolean) => {
|
|
51
|
+
if (!client?.baseUrl) return;
|
|
52
|
+
setIsLoading(true);
|
|
53
|
+
try {
|
|
54
|
+
const token = await getAuthToken?.();
|
|
55
|
+
const params = new URLSearchParams({
|
|
56
|
+
limit: String(pageSize),
|
|
57
|
+
offset: String(offset)
|
|
58
|
+
});
|
|
59
|
+
if (searchStr) params.set("search", searchStr);
|
|
60
|
+
const response = await fetch(`${client.baseUrl}/api/users?${params}`, {
|
|
61
|
+
headers: token ? { Authorization: `Bearer ${token}` } : {}
|
|
62
|
+
});
|
|
63
|
+
if (!response.ok) throw new Error("Failed to fetch users");
|
|
64
|
+
const data = await response.json();
|
|
65
|
+
const rows: Record<string, unknown>[] = data.data ?? data.users ?? [];
|
|
66
|
+
const newItems: UserSelectorItem[] = rows.map((r: Record<string, unknown>) => {
|
|
67
|
+
const user: User = {
|
|
68
|
+
uid: (r.id as string) ?? "",
|
|
69
|
+
email: (r.email as string) ?? "",
|
|
70
|
+
displayName: (r.displayName as string) ?? (r.display_name as string) ?? null,
|
|
71
|
+
photoURL: (r.photoURL as string) ?? (r.photo_url as string) ?? null,
|
|
72
|
+
providerId: "custom",
|
|
73
|
+
isAnonymous: false,
|
|
74
|
+
roles: (r.roles as string[]) ?? []
|
|
75
|
+
};
|
|
76
|
+
userCacheRef.current.set(user.uid, user);
|
|
77
|
+
return { uid: user.uid,
|
|
78
|
+
label: user.displayName ?? user.email ?? user.uid,
|
|
79
|
+
user };
|
|
80
|
+
});
|
|
81
|
+
setItems(prev => append ? [...prev, ...newItems] : newItems);
|
|
82
|
+
setHasMore(newItems.length >= pageSize);
|
|
83
|
+
offsetRef.current = offset + newItems.length;
|
|
84
|
+
} catch {
|
|
85
|
+
setHasMore(false);
|
|
86
|
+
} finally {
|
|
87
|
+
setIsLoading(false);
|
|
88
|
+
}
|
|
89
|
+
}, [client?.baseUrl, getAuthToken, pageSize]);
|
|
90
|
+
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
offsetRef.current = 0;
|
|
93
|
+
fetchUsers("", 0, false);
|
|
94
|
+
}, [fetchUsers]);
|
|
95
|
+
|
|
96
|
+
const search = useCallback((searchStr: string) => {
|
|
97
|
+
setCurrentSearch(searchStr);
|
|
98
|
+
offsetRef.current = 0;
|
|
99
|
+
fetchUsers(searchStr, 0, false);
|
|
100
|
+
}, [fetchUsers]);
|
|
101
|
+
|
|
102
|
+
const loadMore = useCallback(() => {
|
|
103
|
+
fetchUsers(currentSearch, offsetRef.current, true);
|
|
104
|
+
}, [fetchUsers, currentSearch]);
|
|
105
|
+
|
|
106
|
+
const getUser = useCallback((uid: string): User | null => {
|
|
107
|
+
return userCacheRef.current.get(uid) ?? null;
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
110
|
+
return { items,
|
|
111
|
+
isLoading,
|
|
112
|
+
hasMore,
|
|
113
|
+
search,
|
|
114
|
+
loadMore,
|
|
115
|
+
getUser };
|
|
116
|
+
}
|
|
117
|
+
|
|
28
118
|
export interface UserSelectorProps {
|
|
29
119
|
className?: string;
|
|
30
120
|
name?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CopyIcon, iconSize, KeyRoundIcon, PencilIcon, Trash2Icon } from "@rebasepro/ui";
|
|
2
2
|
import type { EntityAction, User, UserCreationResult } from "@rebasepro/types";
|
|
3
|
-
import { ConfirmationDialog,
|
|
3
|
+
import { ConfirmationDialog, useSnackbarController, useTranslation, useRebaseClient, useAuthController } from "@rebasepro/core";
|
|
4
4
|
import { DeleteEntityDialog } from "../DeleteEntityDialog";
|
|
5
5
|
import { addRecentId } from "../EntityCollectionView/utils";
|
|
6
6
|
import { navigateToEntity } from "../../util/navigation_utils";
|
|
@@ -168,18 +168,35 @@ export function ResetPasswordActionDialog({
|
|
|
168
168
|
open: boolean;
|
|
169
169
|
onClose: () => void;
|
|
170
170
|
}) {
|
|
171
|
-
const
|
|
171
|
+
const client = useRebaseClient<{ baseUrl?: string }>();
|
|
172
|
+
const { getAuthToken } = useAuthController();
|
|
172
173
|
const snackbarController = useSnackbarController();
|
|
173
174
|
const { t } = useTranslation();
|
|
174
175
|
const [loading, setLoading] = useState(false);
|
|
175
176
|
const [creationResult, setCreationResult] = useState<UserCreationResult | null>(null);
|
|
176
177
|
|
|
177
178
|
const handleConfirm = async () => {
|
|
178
|
-
if (!userManagement?.resetPassword) return;
|
|
179
179
|
setLoading(true);
|
|
180
180
|
try {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const baseUrl = client?.baseUrl || "";
|
|
182
|
+
const token = await getAuthToken?.();
|
|
183
|
+
const response = await fetch(`${baseUrl}/api/admin/users/${user.uid}/reset-password`, {
|
|
184
|
+
method: "POST",
|
|
185
|
+
headers: {
|
|
186
|
+
"Content-Type": "application/json",
|
|
187
|
+
...(token ? { "Authorization": `Bearer ${token}` } : {})
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
if (!response.ok) {
|
|
191
|
+
const error = await response.json().catch(() => ({}));
|
|
192
|
+
throw new Error(error.message || "Failed to reset password");
|
|
193
|
+
}
|
|
194
|
+
const data = await response.json();
|
|
195
|
+
setCreationResult({
|
|
196
|
+
user,
|
|
197
|
+
invitationSent: data.invitationSent ?? false,
|
|
198
|
+
temporaryPassword: data.temporaryPassword
|
|
199
|
+
});
|
|
183
200
|
snackbarController.open({
|
|
184
201
|
type: "success",
|
|
185
202
|
message: t("reset_password_success") || "Password reset successfully"
|
|
@@ -228,7 +245,7 @@ export const resetPasswordAction: EntityAction = {
|
|
|
228
245
|
isEnabled: ({ entity }) => Boolean(entity),
|
|
229
246
|
onClick({
|
|
230
247
|
entity,
|
|
231
|
-
context
|
|
248
|
+
context
|
|
232
249
|
}): Promise<void> {
|
|
233
250
|
if (!entity) {
|
|
234
251
|
throw new Error("INTERNAL: resetPasswordAction: Entity is undefined");
|
|
@@ -63,7 +63,8 @@ export const DEFAULT_FIELD_CONFIGS: Record<DefaultFieldConfig, PropertyConfig> =
|
|
|
63
63
|
color: "#2d7ff9",
|
|
64
64
|
property: {
|
|
65
65
|
type: "string",
|
|
66
|
-
ui: { multiline: true,
|
|
66
|
+
ui: { multiline: true,
|
|
67
|
+
Field: TextFieldBinding }
|
|
67
68
|
}
|
|
68
69
|
},
|
|
69
70
|
markdown: {
|
|
@@ -74,7 +75,8 @@ export const DEFAULT_FIELD_CONFIGS: Record<DefaultFieldConfig, PropertyConfig> =
|
|
|
74
75
|
color: "#2d7ff9",
|
|
75
76
|
property: {
|
|
76
77
|
type: "string",
|
|
77
|
-
ui: { markdown: true,
|
|
78
|
+
ui: { markdown: true,
|
|
79
|
+
Field: MarkdownEditorFieldBinding }
|
|
78
80
|
}
|
|
79
81
|
},
|
|
80
82
|
url: {
|
|
@@ -85,7 +87,8 @@ export const DEFAULT_FIELD_CONFIGS: Record<DefaultFieldConfig, PropertyConfig> =
|
|
|
85
87
|
color: "#154fb3",
|
|
86
88
|
property: {
|
|
87
89
|
type: "string",
|
|
88
|
-
ui: { url: true,
|
|
90
|
+
ui: { url: true,
|
|
91
|
+
Field: TextFieldBinding }
|
|
89
92
|
}
|
|
90
93
|
},
|
|
91
94
|
email: {
|
package/src/editor/editor.tsx
CHANGED
|
@@ -154,7 +154,7 @@ onJsonContentChange };
|
|
|
154
154
|
// the reverted value.
|
|
155
155
|
const versionRef = useRef(version);
|
|
156
156
|
useEffect(() => {
|
|
157
|
-
if (versionRef.current === version) return;
|
|
157
|
+
if (versionRef.current === version) return; // skip initial render
|
|
158
158
|
versionRef.current = version;
|
|
159
159
|
if (!view) return;
|
|
160
160
|
try {
|
|
@@ -5,8 +5,8 @@ import { schema } from "../../schema";
|
|
|
5
5
|
export type UploadFn = (image: File) => Promise<string>;
|
|
6
6
|
|
|
7
7
|
export async function onFileRead(view: EditorView, readerEvent: ProgressEvent<FileReader>, pos: number, upload: UploadFn, image: File) {
|
|
8
|
-
|
|
9
|
-
const plugin =
|
|
8
|
+
const state = view.state as typeof view.state & { plugins: Plugin[] };
|
|
9
|
+
const plugin = state.plugins.find((p: Plugin) => p.spec.key === ImagePluginKey);
|
|
10
10
|
if (!plugin) {
|
|
11
11
|
console.error("Image plugin not found");
|
|
12
12
|
return;
|
|
@@ -8,8 +8,8 @@ export async function onFileRead(view: EditorView, readerEvent: ProgressEvent<Fi
|
|
|
8
8
|
|
|
9
9
|
const { schema } = view.state;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
const plugin =
|
|
11
|
+
const state = view.state as typeof view.state & { plugins: Plugin[] };
|
|
12
|
+
const plugin = state.plugins.find((p: Plugin) => p.spec.key === ImagePluginKey);
|
|
13
13
|
if (!plugin) {
|
|
14
14
|
console.error("Image plugin not found");
|
|
15
15
|
return;
|
|
@@ -16,8 +16,8 @@ export function serializeForClipboard(view: EditorView, slice: Slice) {
|
|
|
16
16
|
openStart--
|
|
17
17
|
openEnd--
|
|
18
18
|
const node = content.firstChild!
|
|
19
|
-
|
|
20
|
-
context.push(node.type.name, node.attrs !=
|
|
19
|
+
const nodeType = node.type as typeof node.type & { defaultAttrs?: unknown };
|
|
20
|
+
context.push(node.type.name, node.attrs != nodeType.defaultAttrs ? node.attrs : null)
|
|
21
21
|
content = node.content
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ambient module declarations for markdown-it plugins that do not ship
|
|
3
|
+
* their own type declarations and have no DefinitelyTyped packages.
|
|
4
|
+
*
|
|
5
|
+
* Each plugin exports a default function that is a standard markdown-it
|
|
6
|
+
* plugin: it receives a MarkdownIt instance and optional options.
|
|
7
|
+
*/
|
|
8
|
+
declare module "markdown-it-task-lists" {
|
|
9
|
+
import type MarkdownIt from "markdown-it";
|
|
10
|
+
const markdownItTaskLists: MarkdownIt.PluginSimple;
|
|
11
|
+
export default markdownItTaskLists;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module "markdown-it-mark" {
|
|
15
|
+
import type MarkdownIt from "markdown-it";
|
|
16
|
+
const markdownItMark: MarkdownIt.PluginSimple;
|
|
17
|
+
export default markdownItMark;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare module "markdown-it-ins" {
|
|
21
|
+
import type MarkdownIt from "markdown-it";
|
|
22
|
+
const markdownItIns: MarkdownIt.PluginSimple;
|
|
23
|
+
export default markdownItIns;
|
|
24
|
+
}
|
package/src/editor/markdown.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/triple-slash-reference */
|
|
2
|
+
/// <reference path="./markdown-it-plugins.d.ts" />
|
|
1
3
|
import {
|
|
2
4
|
MarkdownParser,
|
|
3
5
|
MarkdownSerializer,
|
|
@@ -5,11 +7,8 @@ import {
|
|
|
5
7
|
defaultMarkdownSerializer
|
|
6
8
|
} from "prosemirror-markdown";
|
|
7
9
|
import markdownIt from "markdown-it";
|
|
8
|
-
// @ts-expect-error -- markdown-it-task-lists does not ship type declarations
|
|
9
10
|
import markdownItTaskLists from "markdown-it-task-lists";
|
|
10
|
-
// @ts-expect-error -- markdown-it-mark does not ship type declarations
|
|
11
11
|
import markdownItMark from "markdown-it-mark";
|
|
12
|
-
// @ts-expect-error -- markdown-it-ins does not ship type declarations
|
|
13
12
|
import markdownItIns from "markdown-it-ins";
|
|
14
13
|
|
|
15
14
|
import { schema } from "./schema";
|
package/src/form/EntityForm.tsx
CHANGED
|
@@ -31,7 +31,7 @@ import { EntityFormActions } from "./EntityFormActions";
|
|
|
31
31
|
import type { EntityFormActionsProps } from "../types/components/EntityFormActionsProps";
|
|
32
32
|
import { LocalChangesMenu } from "./components/LocalChangesMenu";
|
|
33
33
|
|
|
34
|
-
import { getEntityTitlePropertyKey } from "../util/previews";
|
|
34
|
+
import { getEntityTitlePropertyKey, resolveTitleToString } from "../util/previews";
|
|
35
35
|
import { getValueInPath, isObject, mergeDeep } from "@rebasepro/utils";
|
|
36
36
|
import { useCollectionRegistryController, useSideEntityController, useCMSContext } from "../index";
|
|
37
37
|
|
|
@@ -249,11 +249,19 @@ export function EntityForm<M extends Record<string, unknown>>({
|
|
|
249
249
|
|
|
250
250
|
return save(values)
|
|
251
251
|
?.then((savedEntity) => {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
if (savedEntity) {
|
|
253
|
+
formexController.resetForm({
|
|
254
|
+
values: savedEntity.values || values,
|
|
255
|
+
submitCount: 0,
|
|
256
|
+
touched: {}
|
|
257
|
+
});
|
|
258
|
+
if (!autoSave) {
|
|
259
|
+
snackbarController.open({
|
|
260
|
+
type: "success",
|
|
261
|
+
message: `${collection.singularName ?? collection.name}: ${t("saved_correctly")}`
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
257
265
|
})
|
|
258
266
|
.finally(() => {
|
|
259
267
|
formexController.setSubmitting(false);
|
|
@@ -372,11 +380,6 @@ export function EntityForm<M extends Record<string, unknown>>({
|
|
|
372
380
|
|
|
373
381
|
clearDirtyCache();
|
|
374
382
|
onValuesModified?.(false, updatedEntity.values);
|
|
375
|
-
if (!autoSave)
|
|
376
|
-
snackbarController.open({
|
|
377
|
-
type: "success",
|
|
378
|
-
message: `${collection.singularName ?? collection.name}: ${t("saved_correctly")}`
|
|
379
|
-
});
|
|
380
383
|
onEntityChange?.(updatedEntity);
|
|
381
384
|
updateStatus("existing");
|
|
382
385
|
setEntityId(updatedEntity.id);
|
|
@@ -502,6 +505,7 @@ export function EntityForm<M extends Record<string, unknown>>({
|
|
|
502
505
|
entityId: entityId as string,
|
|
503
506
|
path,
|
|
504
507
|
save,
|
|
508
|
+
submit: formex.handleSubmit,
|
|
505
509
|
formex,
|
|
506
510
|
entity,
|
|
507
511
|
savingError,
|
|
@@ -520,7 +524,8 @@ export function EntityForm<M extends Record<string, unknown>>({
|
|
|
520
524
|
|
|
521
525
|
const formActionProps: PluginFormActionProps = {
|
|
522
526
|
entityId,
|
|
523
|
-
parentCollectionSlugs,
|
|
527
|
+
parentCollectionSlugs,
|
|
528
|
+
parentEntityIds,
|
|
524
529
|
path: path,
|
|
525
530
|
status,
|
|
526
531
|
collection: collection as EntityCollection,
|
|
@@ -534,9 +539,10 @@ export function EntityForm<M extends Record<string, unknown>>({
|
|
|
534
539
|
const pluginFormAfter = useSlot("form.after", formActionProps);
|
|
535
540
|
|
|
536
541
|
const titlePropertyKey = getEntityTitlePropertyKey(collection, customizationController.propertyConfigs);
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
|
|
542
|
+
const rawTitle = formex.values && titlePropertyKey ? getValueInPath(formex.values, titlePropertyKey) : undefined;
|
|
543
|
+
const title = rawTitle !== undefined && rawTitle !== null
|
|
544
|
+
? resolveTitleToString(rawTitle)
|
|
545
|
+
: (collection.singularName ?? collection.name);
|
|
540
546
|
|
|
541
547
|
useEffect(() => {
|
|
542
548
|
if (!autoSave) {
|
|
@@ -219,7 +219,7 @@ function FieldInternal<CustomProps, M extends Record<string, unknown>>
|
|
|
219
219
|
collection: context.collection,
|
|
220
220
|
propertyKey: propertyKey,
|
|
221
221
|
property: property,
|
|
222
|
-
Component: Component as
|
|
222
|
+
Component: Component as ComponentType<FieldProps<Property, unknown, M>>,
|
|
223
223
|
plugins: plugins
|
|
224
224
|
});
|
|
225
225
|
const UsedComponent: ComponentType<FieldProps<Property, any, any>> = WrappedComponent ?? Component;
|
|
@@ -348,7 +348,7 @@ function MapKeyValueRow<T extends Record<string, unknown>>({
|
|
|
348
348
|
value={arrayValue[index]}
|
|
349
349
|
disabled={disabled || !fieldKey}
|
|
350
350
|
setValue={(newValue) => {
|
|
351
|
-
const newArrayValue = [...arrayValue] as
|
|
351
|
+
const newArrayValue = [...arrayValue] as unknown[];
|
|
352
352
|
newArrayValue[index] = newValue;
|
|
353
353
|
setValue({
|
|
354
354
|
...value,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Properties } from "@rebasepro/types";
|
|
2
1
|
import type { FieldProps, PropertyFieldBindingProps } from "../../types/fields";
|
|
3
2
|
import type { MapProperty } from "@rebasepro/types";
|
|
4
3
|
import React from "react";
|
|
@@ -10,8 +9,7 @@ import { getIconForProperty } from "../../util/property_utils";
|
|
|
10
9
|
import { isHidden, isReadOnly } from "@rebasepro/common";
|
|
11
10
|
import { FieldHelperText, LabelWithIconAndTooltip } from "../components";
|
|
12
11
|
import { PropertyFieldBinding } from "../PropertyFieldBinding";
|
|
13
|
-
import { cls, ExpandablePanel
|
|
14
|
-
import { pick } from "@rebasepro/utils";
|
|
12
|
+
import { cls, ExpandablePanel } from "@rebasepro/ui";
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
* Field that renders the children property fields
|
|
@@ -35,28 +33,15 @@ export function MapFieldBinding({
|
|
|
35
33
|
onPropertyChange
|
|
36
34
|
}: FieldProps<MapProperty>) {
|
|
37
35
|
|
|
38
|
-
const pickOnlySomeKeys = property.pickOnlySomeKeys || false;
|
|
39
36
|
const expanded = property.ui?.expanded === undefined ? true : property.ui?.expanded;
|
|
40
37
|
const minimalistView = minimalistViewProp || property.ui?.minimalistView;
|
|
41
38
|
const { t } = useTranslation();
|
|
42
39
|
|
|
43
40
|
if (!property.properties) {
|
|
44
|
-
throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property ${propertyKey}`);
|
|
41
|
+
throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property '${propertyKey}'${property.name ? ` ("${property.name}")` : ""}`);
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
if (pickOnlySomeKeys) {
|
|
49
|
-
if (value) {
|
|
50
|
-
mapProperties = pick(property.properties,
|
|
51
|
-
...Object.keys(value)
|
|
52
|
-
.filter(key => key in property.properties!)
|
|
53
|
-
) as Properties;
|
|
54
|
-
} else {
|
|
55
|
-
mapProperties = {};
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
mapProperties = property.properties;
|
|
59
|
-
}
|
|
44
|
+
const mapProperties = property.properties;
|
|
60
45
|
|
|
61
46
|
const mapFormView = <>
|
|
62
47
|
<div
|
|
@@ -96,7 +81,6 @@ export function MapFieldBinding({
|
|
|
96
81
|
}
|
|
97
82
|
</div>
|
|
98
83
|
|
|
99
|
-
{/*{pickOnlySomeKeys && buildPickKeysSelect(disabled, property.properties, setValue, value)}*/}
|
|
100
84
|
|
|
101
85
|
</>
|
|
102
86
|
;
|
|
@@ -107,7 +91,8 @@ export function MapFieldBinding({
|
|
|
107
91
|
{!minimalistView && <ExpandablePanel initiallyExpanded={expanded}
|
|
108
92
|
onExpandedChange={(expanded: boolean) => {
|
|
109
93
|
onPropertyChange?.({
|
|
110
|
-
ui: { ...property.ui,
|
|
94
|
+
ui: { ...property.ui,
|
|
95
|
+
expanded }
|
|
111
96
|
});
|
|
112
97
|
}}
|
|
113
98
|
className={property.ui?.widthPercentage !== undefined ? "mt-8" : undefined}
|
|
@@ -133,30 +118,3 @@ export function MapFieldBinding({
|
|
|
133
118
|
);
|
|
134
119
|
}
|
|
135
120
|
|
|
136
|
-
const buildPickKeysSelect = (disabled: boolean, properties: Properties, setValue: (value: Record<string, unknown> | null) => void, value: Record<string, unknown> | undefined) => {
|
|
137
|
-
|
|
138
|
-
const keys = Object.keys(properties)
|
|
139
|
-
.filter((key) => !value || !(key in value));
|
|
140
|
-
|
|
141
|
-
const handleAddProperty = (updatedValue: string | string[]) => {
|
|
142
|
-
setValue({
|
|
143
|
-
...value,
|
|
144
|
-
[updatedValue as string]: null
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
if (!keys.length) return <></>;
|
|
149
|
-
|
|
150
|
-
return <div className={"m-4"}>
|
|
151
|
-
<InputLabel>Add property</InputLabel>
|
|
152
|
-
<Select
|
|
153
|
-
value={""}
|
|
154
|
-
fullWidth={true}
|
|
155
|
-
disabled={disabled}
|
|
156
|
-
onValueChange={handleAddProperty}
|
|
157
|
-
renderValue={(key) => (properties as Properties)[key].name || key}>
|
|
158
|
-
{keys.map((key) => <SelectItem key={key}
|
|
159
|
-
value={key}>{(properties as Properties)[key].name || key}</SelectItem>)}
|
|
160
|
-
</Select>
|
|
161
|
-
</div>;
|
|
162
|
-
};
|