@rebasepro/cms 0.24.0 → 0.24.1-canary.g56af4a4
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/collection_editor/CollectionEditorDialogsContext.js +10 -0
- package/dist/collection_editor/CollectionEditorDialogsContext.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.js +274 -0
- package/dist/collection_editor/ConfigControllerProvider.js.map +1 -0
- package/dist/collection_editor/api/generateCollectionApi.js +64 -0
- package/dist/collection_editor/api/generateCollectionApi.js.map +1 -0
- package/dist/collection_editor/collection_wire.d.ts +13 -0
- package/dist/collection_editor/collection_wire.js +49 -0
- package/dist/collection_editor/collection_wire.js.map +1 -0
- package/dist/collection_editor/liveSchemaClient.js +130 -0
- package/dist/collection_editor/liveSchemaClient.js.map +1 -0
- package/dist/collection_editor/relation_kinds.js +74 -0
- package/dist/collection_editor/relation_kinds.js.map +1 -0
- package/dist/collection_editor/serializable_types.d.ts +4 -1
- package/dist/collection_editor/serializable_utils.js +504 -0
- package/dist/collection_editor/serializable_utils.js.map +1 -0
- package/dist/collection_editor/ui/EditorCollectionAction.js +37 -0
- package/dist/collection_editor/ui/EditorCollectionAction.js.map +1 -0
- package/dist/collection_editor/ui/MissingReferenceWidget.js +39 -0
- package/dist/collection_editor/ui/MissingReferenceWidget.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js +160 -0
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js +61 -0
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js +731 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js +220 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js +160 -0
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js +394 -0
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js +616 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js +68 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js +11 -0
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js +148 -0
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js +244 -0
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/EnumForm.js +222 -0
- package/dist/collection_editor/ui/collection_editor/EnumForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js +204 -0
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js +108 -0
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js +163 -0
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js +59 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.js +640 -0
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js +141 -0
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/PropertyTree.js +210 -0
- package/dist/collection_editor/ui/collection_editor/PropertyTree.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js +31 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js +25 -0
- package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js.map +1 -0
- package/dist/{SchemaChangeDialog-CcFSXvkK.js → collection_editor/ui/collection_editor/SchemaChangeDialog.js} +42 -59
- package/dist/collection_editor/ui/collection_editor/SchemaChangeDialog.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/SwitchControl.js +24 -0
- package/dist/collection_editor/ui/collection_editor/SwitchControl.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js +66 -0
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js +61 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js +188 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.d.ts +12 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js +74 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js +100 -0
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js +34 -0
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js +75 -0
- package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js +338 -0
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js +83 -0
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js +15 -0
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js +121 -0
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js +127 -0
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js +151 -0
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js +77 -0
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js +254 -0
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js +71 -0
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js +356 -0
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js +173 -0
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js +79 -0
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js +34 -0
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js +47 -0
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js +47 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js +62 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js +119 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +10 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js +178 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js +23 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.js +116 -0
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.js +182 -0
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/products_template.js +87 -0
- package/dist/collection_editor/ui/collection_editor/templates/products_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/templates/users_template.js +46 -0
- package/dist/collection_editor/ui/collection_editor/templates/users_template.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/util.js +20 -0
- package/dist/collection_editor/ui/collection_editor/util.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/utils/strings.js +2 -0
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js +37 -0
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js +192 -0
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js.map +1 -0
- package/dist/collection_editor/useCollectionEditorController.js +12 -0
- package/dist/collection_editor/useCollectionEditorController.js.map +1 -0
- package/dist/collection_editor/useCollectionsConfigController.js +12 -0
- package/dist/collection_editor/useCollectionsConfigController.js.map +1 -0
- package/dist/collection_editor/useJsonCollectionsConfigController.js +191 -0
- package/dist/collection_editor/useJsonCollectionsConfigController.js.map +1 -0
- package/dist/collection_editor/useLiveSchemaEditing.js +214 -0
- package/dist/collection_editor/useLiveSchemaEditing.js.map +1 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.js +228 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.js.map +1 -0
- package/dist/collection_editor/useSafeSnackbarController.js +13 -0
- package/dist/collection_editor/useSafeSnackbarController.js.map +1 -0
- package/dist/collection_editor/validateCollectionJson.js +289 -0
- package/dist/collection_editor/validateCollectionJson.js.map +1 -0
- package/dist/collection_editor_ui.js +7 -33
- package/dist/components/AdditionalFieldValue.js +60 -0
- package/dist/components/AdditionalFieldValue.js.map +1 -0
- package/dist/components/AdminModeSyncer.js +41 -0
- package/dist/components/AdminModeSyncer.js.map +1 -0
- package/dist/components/ArrayContainer.d.ts +8 -2
- package/dist/components/ArrayContainer.js +363 -0
- package/dist/components/ArrayContainer.js.map +1 -0
- package/dist/components/ClearFilterSortButton.js +33 -0
- package/dist/components/ClearFilterSortButton.js.map +1 -0
- package/dist/components/CollectionEditorDialogs.js +49 -0
- package/dist/components/CollectionEditorDialogs.js.map +1 -0
- package/dist/components/CollectionPanel.js +95 -0
- package/dist/components/CollectionPanel.js.map +1 -0
- package/dist/components/CollectionTableBinding/CollectionRowActions.js +165 -0
- package/dist/components/CollectionTableBinding/CollectionRowActions.js.map +1 -0
- package/dist/components/CollectionTableBinding/CollectionTableBinding.js +329 -0
- package/dist/components/CollectionTableBinding/CollectionTableBinding.js.map +1 -0
- package/dist/components/CollectionTableBinding/PropertyTableCell.js +311 -0
- package/dist/components/CollectionTableBinding/PropertyTableCell.js.map +1 -0
- package/dist/components/CollectionTableBinding/column_utils.js +85 -0
- package/dist/components/CollectionTableBinding/column_utils.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js +45 -0
- package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js +66 -0
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.js +86 -0
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationField.js +93 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js +33 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js +171 -0
- package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js +91 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js.map +1 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js +36 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js.map +1 -0
- package/dist/components/CollectionTableBinding/index.js +6 -0
- package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js +50 -0
- package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.d.ts +2 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.js +223 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js +58 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/TableCellOpener.js +53 -0
- package/dist/components/CollectionTableBinding/internal/TableCellOpener.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/common.js +40 -0
- package/dist/components/CollectionTableBinding/internal/common.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js +270 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js +68 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js.map +1 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js +24 -0
- package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js.map +1 -0
- package/dist/components/CollectionTableBinding/table_bindings.js +306 -0
- package/dist/components/CollectionTableBinding/table_bindings.js.map +1 -0
- package/dist/components/CollectionViewBinding/BoardCardBinding.js +160 -0
- package/dist/components/CollectionViewBinding/BoardCardBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js +471 -0
- package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js +108 -0
- package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.js +988 -0
- package/dist/components/CollectionViewBinding/CollectionListViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.js +146 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewBinding.js +1209 -0
- package/dist/components/CollectionViewBinding/CollectionViewBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.js +133 -0
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.js.map +1 -0
- package/dist/components/CollectionViewBinding/EntityCardBinding.js +133 -0
- package/dist/components/CollectionViewBinding/EntityCardBinding.js.map +1 -0
- package/dist/components/CollectionViewBinding/FilterPresetsButton.js +203 -0
- package/dist/components/CollectionViewBinding/FilterPresetsButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/FiltersDialog.js +148 -0
- package/dist/components/CollectionViewBinding/FiltersDialog.js.map +1 -0
- package/dist/components/CollectionViewBinding/SearchExplanation.js +86 -0
- package/dist/components/CollectionViewBinding/SearchExplanation.js.map +1 -0
- package/dist/components/CollectionViewBinding/SearchHighlight.js +262 -0
- package/dist/components/CollectionViewBinding/SearchHighlight.js.map +1 -0
- package/dist/components/CollectionViewBinding/SlotValue.js +117 -0
- package/dist/components/CollectionViewBinding/SlotValue.js.map +1 -0
- package/dist/components/CollectionViewBinding/SortButton.js +214 -0
- package/dist/components/CollectionViewBinding/SortButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListCloseButton.js +41 -0
- package/dist/components/CollectionViewBinding/SplitListCloseButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListShowButton.js +29 -0
- package/dist/components/CollectionViewBinding/SplitListShowButton.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitListView.js +311 -0
- package/dist/components/CollectionViewBinding/SplitListView.js.map +1 -0
- package/dist/components/CollectionViewBinding/SplitViewContext.js +21 -0
- package/dist/components/CollectionViewBinding/SplitViewContext.js.map +1 -0
- package/dist/components/CollectionViewBinding/ViewModeToggle.js +150 -0
- package/dist/components/CollectionViewBinding/ViewModeToggle.js.map +1 -0
- package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js +49 -0
- package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js.map +1 -0
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js +122 -0
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js.map +1 -0
- package/dist/components/CollectionViewBinding/useBoardDataController.js +530 -0
- package/dist/components/CollectionViewBinding/useBoardDataController.js.map +1 -0
- package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +4 -1
- package/dist/components/CollectionViewBinding/usePreviewSlots.js +384 -0
- package/dist/components/CollectionViewBinding/usePreviewSlots.js.map +1 -0
- package/dist/components/CollectionViewBinding/useSelectionController.js +104 -0
- package/dist/components/CollectionViewBinding/useSelectionController.js.map +1 -0
- package/dist/components/CollectionViewBinding/utils.js +21 -0
- package/dist/components/CollectionViewBinding/utils.js.map +1 -0
- package/dist/components/DefaultAppBar.js +179 -0
- package/dist/components/DefaultAppBar.js.map +1 -0
- package/dist/components/DefaultDrawer.js +364 -0
- package/dist/components/DefaultDrawer.js.map +1 -0
- package/dist/components/DeleteEntityDialog.js +256 -0
- package/dist/components/DeleteEntityDialog.js.map +1 -0
- package/dist/components/DetailViewBinding.js +504 -0
- package/dist/components/DetailViewBinding.js.map +1 -0
- package/dist/components/DrawerNavigationGroup.js +74 -0
- package/dist/components/DrawerNavigationGroup.js.map +1 -0
- package/dist/components/DrawerNavigationItem.d.ts +8 -0
- package/dist/components/DrawerNavigationItem.js +45 -0
- package/dist/components/DrawerNavigationItem.js.map +1 -0
- package/dist/components/EditFormActions.js +210 -0
- package/dist/components/EditFormActions.js.map +1 -0
- package/dist/components/EditViewBinding.js +802 -0
- package/dist/components/EditViewBinding.js.map +1 -0
- package/dist/components/EntityDisplayHeader.js +139 -0
- package/dist/components/EntityDisplayHeader.js.map +1 -0
- package/dist/components/EntityIdentityBar.js +364 -0
- package/dist/components/EntityIdentityBar.js.map +1 -0
- package/dist/components/EntityInspector.js +96 -0
- package/dist/components/EntityInspector.js.map +1 -0
- package/dist/components/EntityPreviewBinding.js +282 -0
- package/dist/components/EntityPreviewBinding.js.map +1 -0
- package/dist/components/EntityPreviewNesting.js +53 -0
- package/dist/components/EntityPreviewNesting.js.map +1 -0
- package/dist/components/EntityViewBinding.js +246 -0
- package/dist/components/EntityViewBinding.js.map +1 -0
- package/dist/components/FieldCaption.js +17 -0
- package/dist/components/FieldCaption.js.map +1 -0
- package/dist/components/HomePage/ContentHomePage.js +326 -0
- package/dist/components/HomePage/ContentHomePage.js.map +1 -0
- package/dist/components/HomePage/FavouritesView.js +44 -0
- package/dist/components/HomePage/FavouritesView.js.map +1 -0
- package/dist/components/HomePage/HomePageDnD.js +436 -0
- package/dist/components/HomePage/HomePageDnD.js.map +1 -0
- package/dist/components/HomePage/NavigationCard.js +59 -0
- package/dist/components/HomePage/NavigationCard.js.map +1 -0
- package/dist/components/HomePage/NavigationCardBinding.js +70 -0
- package/dist/components/HomePage/NavigationCardBinding.js.map +1 -0
- package/dist/components/HomePage/NavigationGroup.js +98 -0
- package/dist/components/HomePage/NavigationGroup.js.map +1 -0
- package/dist/components/HomePage/RenameGroupDialog.js +89 -0
- package/dist/components/HomePage/RenameGroupDialog.js.map +1 -0
- package/dist/components/InlineEntityPreview.js +116 -0
- package/dist/components/InlineEntityPreview.js.map +1 -0
- package/dist/{JsonPreviewBinding-v0w3H0fp.js → components/JsonPreviewBinding.js} +2 -2
- package/dist/components/JsonPreviewBinding.js.map +1 -0
- package/dist/components/NavigationLoadingErrorView.js +27 -0
- package/dist/components/NavigationLoadingErrorView.js.map +1 -0
- package/dist/components/PickerTrigger.js +27 -0
- package/dist/components/PickerTrigger.js.map +1 -0
- package/dist/components/PropertyCollectionView.js +215 -0
- package/dist/components/PropertyCollectionView.js.map +1 -0
- package/dist/components/PropertyConfigBadge.js +19 -0
- package/dist/components/PropertyConfigBadge.js.map +1 -0
- package/dist/components/PropertyKeyHint.js +58 -0
- package/dist/components/PropertyKeyHint.js.map +1 -0
- package/dist/components/RebaseAuthGate.js +35 -0
- package/dist/components/RebaseAuthGate.js.map +1 -0
- package/dist/components/RebaseCMS.js +44 -0
- package/dist/components/RebaseCMS.js.map +1 -0
- package/dist/components/RebaseLayout.js +59 -0
- package/dist/components/RebaseLayout.js.map +1 -0
- package/dist/components/RebaseNavigation.js +211 -0
- package/dist/components/RebaseNavigation.js.map +1 -0
- package/dist/components/RebaseRouteDefs.js +96 -0
- package/dist/components/RebaseRouteDefs.js.map +1 -0
- package/dist/components/RebaseShell.js +50 -0
- package/dist/components/RebaseShell.js.map +1 -0
- package/dist/components/ReferenceTable/SelectionTableBinding.js +224 -0
- package/dist/components/ReferenceTable/SelectionTableBinding.js.map +1 -0
- package/dist/components/ReferenceWidget.js +100 -0
- package/dist/components/ReferenceWidget.js.map +1 -0
- package/dist/components/RelationSelector.js +625 -0
- package/dist/components/RelationSelector.js.map +1 -0
- package/dist/components/SearchIconsView.js +52 -0
- package/dist/components/SearchIconsView.js.map +1 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
- package/dist/components/SelectableTable/SelectableTable.js +158 -0
- package/dist/components/SelectableTable/SelectableTable.js.map +1 -0
- package/dist/components/SelectableTable/SelectableTableContext.js +8 -0
- package/dist/components/SelectableTable/SelectableTableContext.js.map +1 -0
- package/dist/components/SelectableTable/SelectionStore.js +29 -0
- package/dist/components/SelectableTable/SelectionStore.js.map +1 -0
- package/dist/components/SelectableTable/filters/BooleanFilterField.js +28 -0
- package/dist/components/SelectableTable/filters/BooleanFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.js +93 -0
- package/dist/components/SelectableTable/filters/DateTimeFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/FilterFieldBinding.js +132 -0
- package/dist/components/SelectableTable/filters/FilterFieldBinding.js.map +1 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.js +157 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/RelationFilterField.js +169 -0
- package/dist/components/SelectableTable/filters/RelationFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/StringNumberFilterField.js +181 -0
- package/dist/components/SelectableTable/filters/StringNumberFilterField.js.map +1 -0
- package/dist/components/SelectableTable/filters/null_filter.js +36 -0
- package/dist/components/SelectableTable/filters/null_filter.js.map +1 -0
- package/dist/components/SideDialogs.js +149 -0
- package/dist/components/SideDialogs.js.map +1 -0
- package/dist/components/SidePanelBinding.js +287 -0
- package/dist/components/SidePanelBinding.js.map +1 -0
- package/dist/components/SidePanelProvider.js +69 -0
- package/dist/components/SidePanelProvider.js.map +1 -0
- package/dist/components/UserSelector.d.ts +2 -0
- package/dist/components/UserSelector.js +418 -0
- package/dist/components/UserSelector.js.map +1 -0
- package/dist/components/admin/CreationResultDialog.js +118 -0
- package/dist/components/admin/CreationResultDialog.js.map +1 -0
- package/dist/components/app/AppBar.js +14 -0
- package/dist/components/app/AppBar.js.map +1 -0
- package/dist/components/app/Drawer.js +26 -0
- package/dist/components/app/Drawer.js.map +1 -0
- package/dist/components/app/Scaffold.js +229 -0
- package/dist/components/app/Scaffold.js.map +1 -0
- package/dist/components/app/useApp.js +24 -0
- package/dist/components/app/useApp.js.map +1 -0
- package/dist/components/common/ActionMenuLabel.js +30 -0
- package/dist/components/common/ActionMenuLabel.js.map +1 -0
- package/dist/components/common/default_entity_actions.js +590 -0
- package/dist/components/common/default_entity_actions.js.map +1 -0
- package/dist/components/drawer_expansion.d.ts +25 -0
- package/dist/components/drawer_expansion.js +44 -0
- package/dist/components/drawer_expansion.js.map +1 -0
- package/dist/components/field_configs.d.ts +2 -2
- package/dist/components/field_configs.js +431 -0
- package/dist/components/field_configs.js.map +1 -0
- package/dist/components/field_ids.d.ts +11 -0
- package/dist/components/field_ids.js +58 -0
- package/dist/components/field_ids.js.map +1 -0
- package/dist/components/history/EntityHistoryEntry.js +151 -0
- package/dist/components/history/EntityHistoryEntry.js.map +1 -0
- package/dist/components/history/EntityHistoryView.js +157 -0
- package/dist/components/history/EntityHistoryView.js.map +1 -0
- package/dist/components/history/UserChip.js +21 -0
- package/dist/components/history/UserChip.js.map +1 -0
- package/dist/components/history/index.js +4 -0
- package/dist/components/lazy_record_views.d.ts +10 -0
- package/dist/components/lazy_record_views.js +57 -0
- package/dist/components/lazy_record_views.js.map +1 -0
- package/dist/contexts/BreacrumbsContext.js +28 -0
- package/dist/contexts/BreacrumbsContext.js.map +1 -0
- package/dist/contexts/EditorAIControllerContext.d.ts +18 -0
- package/dist/contexts/EditorAIControllerContext.js +29 -0
- package/dist/contexts/EditorAIControllerContext.js.map +1 -0
- package/dist/contexts/SideDialogsControllerContext.js +7 -0
- package/dist/contexts/SideDialogsControllerContext.js.map +1 -0
- package/dist/data_export/export/BasicExportAction.js +151 -0
- package/dist/data_export/export/BasicExportAction.js.map +1 -0
- package/dist/data_export/export/ExportCollectionAction.js +297 -0
- package/dist/data_export/export/ExportCollectionAction.js.map +1 -0
- package/dist/data_export/export/additional_fields.js +40 -0
- package/dist/data_export/export/additional_fields.js.map +1 -0
- package/dist/data_export/export/export.d.ts +35 -0
- package/dist/data_export/export/export.js +400 -0
- package/dist/data_export/export/export.js.map +1 -0
- package/dist/data_export/export/fetch_export_data.d.ts +17 -7
- package/dist/data_export/export/fetch_export_data.js +67 -0
- package/dist/data_export/export/fetch_export_data.js.map +1 -0
- package/dist/data_export/export/index.d.ts +4 -2
- package/dist/data_export/export/index.js +5 -0
- package/dist/data_import/components/DataNewPropertiesMapping.js +207 -0
- package/dist/data_import/components/DataNewPropertiesMapping.js.map +1 -0
- package/dist/data_import/components/ImportConversionProblems.js +89 -0
- package/dist/data_import/components/ImportConversionProblems.js.map +1 -0
- package/dist/data_import/components/ImportFileUpload.js +43 -0
- package/dist/data_import/components/ImportFileUpload.js.map +1 -0
- package/dist/data_import/components/ImportNewPropertyFieldPreview.js +42 -0
- package/dist/data_import/components/ImportNewPropertyFieldPreview.js.map +1 -0
- package/dist/data_import/components/ImportSaveInProgress.js +105 -0
- package/dist/data_import/components/ImportSaveInProgress.js.map +1 -0
- package/dist/data_import/hooks/useImportConfig.js +34 -0
- package/dist/data_import/hooks/useImportConfig.js.map +1 -0
- package/dist/{import-DjQoRrIU.js → data_import/import/ImportCollectionAction.js} +53 -43
- package/dist/data_import/import/ImportCollectionAction.js.map +1 -0
- package/dist/data_import/import/index.js +2 -0
- package/dist/data_import/utils/csv.js +146 -0
- package/dist/data_import/utils/csv.js.map +1 -0
- package/dist/data_import/utils/data.js +366 -0
- package/dist/data_import/utils/data.js.map +1 -0
- package/dist/data_import/utils/file_headers.js +32 -0
- package/dist/data_import/utils/file_headers.js.map +1 -0
- package/dist/data_import/utils/file_to_json.js +149 -0
- package/dist/data_import/utils/file_to_json.js.map +1 -0
- package/dist/data_import/utils/get_import_inference_type.js +14 -0
- package/dist/data_import/utils/get_import_inference_type.js.map +1 -0
- package/dist/data_import/utils/id_column.js +27 -0
- package/dist/data_import/utils/id_column.js.map +1 -0
- package/dist/data_import/utils/import_columns.js +92 -0
- package/dist/data_import/utils/import_columns.js.map +1 -0
- package/dist/data_import/utils/save_entities.d.ts +33 -4
- package/dist/data_import/utils/save_entities.js +244 -0
- package/dist/data_import/utils/save_entities.js.map +1 -0
- package/dist/data_import/utils/transforms.js +83 -0
- package/dist/data_import/utils/transforms.js.map +1 -0
- package/dist/editor/components/SlashCommandMenu.js +497 -0
- package/dist/editor/components/SlashCommandMenu.js.map +1 -0
- package/dist/editor/components/editor-bubble-item.js +24 -0
- package/dist/editor/components/editor-bubble-item.js.map +1 -0
- package/dist/editor/components/editor-bubble.js +97 -0
- package/dist/editor/components/editor-bubble.js.map +1 -0
- package/dist/editor/components/image-bubble.js +148 -0
- package/dist/editor/components/image-bubble.js.map +1 -0
- package/dist/editor/components/table-bubble.js +406 -0
- package/dist/editor/components/table-bubble.js.map +1 -0
- package/dist/editor/editor.js +423 -0
- package/dist/editor/editor.js.map +1 -0
- package/dist/editor/extensions/HighlightDecorationExtension.js +74 -0
- package/dist/editor/extensions/HighlightDecorationExtension.js.map +1 -0
- package/dist/editor/extensions/Image.d.ts +7 -1
- package/dist/editor/extensions/Image.js +160 -0
- package/dist/editor/extensions/Image.js.map +1 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.js +82 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.js.map +1 -0
- package/dist/editor/extensions/clipboard.js +63 -0
- package/dist/editor/extensions/clipboard.js.map +1 -0
- package/dist/editor/extensions/drag-and-drop.js +354 -0
- package/dist/editor/extensions/drag-and-drop.js.map +1 -0
- package/dist/editor/hooks/useProseMirror.js +101 -0
- package/dist/editor/hooks/useProseMirror.js.map +1 -0
- package/dist/editor/hooks/useProseMirrorContext.js +11 -0
- package/dist/editor/hooks/useProseMirrorContext.js.map +1 -0
- package/dist/editor/markdown.js +154 -0
- package/dist/editor/markdown.js.map +1 -0
- package/dist/editor/nodeViews/ImageComponent.js +35 -0
- package/dist/editor/nodeViews/ImageComponent.js.map +1 -0
- package/dist/editor/nodeViews/ReactNodeView.js +57 -0
- package/dist/editor/nodeViews/ReactNodeView.js.map +1 -0
- package/dist/editor/nodeViews/TaskItemComponent.js +29 -0
- package/dist/editor/nodeViews/TaskItemComponent.js.map +1 -0
- package/dist/editor/nodeViews/index.js +21 -0
- package/dist/editor/nodeViews/index.js.map +1 -0
- package/dist/editor/plugins/index.js +54 -0
- package/dist/editor/plugins/index.js.map +1 -0
- package/dist/editor/plugins/inputrules.js +54 -0
- package/dist/editor/plugins/inputrules.js.map +1 -0
- package/dist/editor/plugins/placeholderPlugin.js +38 -0
- package/dist/editor/plugins/placeholderPlugin.js.map +1 -0
- package/dist/editor/plugins/slashCommandPlugin.js +40 -0
- package/dist/editor/plugins/slashCommandPlugin.js.map +1 -0
- package/dist/editor/sanitize-html.js +190 -0
- package/dist/editor/sanitize-html.js.map +1 -0
- package/dist/{markdown-CCqp8ibf.js → editor/schema.js} +2 -159
- package/dist/editor/schema.js.map +1 -0
- package/dist/editor/selectors/link-selector.js +118 -0
- package/dist/editor/selectors/link-selector.js.map +1 -0
- package/dist/editor/selectors/node-selector.js +118 -0
- package/dist/editor/selectors/node-selector.js.map +1 -0
- package/dist/editor/selectors/text-buttons.js +71 -0
- package/dist/editor/selectors/text-buttons.js.map +1 -0
- package/dist/editor/utils/prosemirror-utils.js +92 -0
- package/dist/editor/utils/prosemirror-utils.js.map +1 -0
- package/dist/editor/utils/remove_classes.js +16 -0
- package/dist/editor/utils/remove_classes.js.map +1 -0
- package/dist/editor.js +1 -3147
- package/dist/form/EntityForm.js +734 -0
- package/dist/form/EntityForm.js.map +1 -0
- package/dist/form/EntityFormActions.js +101 -0
- package/dist/form/EntityFormActions.js.map +1 -0
- package/dist/form/EntityFormBinding.js +257 -0
- package/dist/form/EntityFormBinding.js.map +1 -0
- package/dist/form/PropertyFieldBinding.js +298 -0
- package/dist/form/PropertyFieldBinding.js.map +1 -0
- package/dist/form/components/ErrorFocus.js +33 -0
- package/dist/form/components/ErrorFocus.js.map +1 -0
- package/dist/form/components/FieldBlock.js +118 -0
- package/dist/form/components/FieldBlock.js.map +1 -0
- package/dist/form/components/FieldHelperText.js +56 -0
- package/dist/form/components/FieldHelperText.js.map +1 -0
- package/dist/form/components/FormRail.js +118 -0
- package/dist/form/components/FormRail.js.map +1 -0
- package/dist/form/components/FormSections.js +63 -0
- package/dist/form/components/FormSections.js.map +1 -0
- package/dist/form/components/LabelWithIcon.js +29 -0
- package/dist/form/components/LabelWithIcon.js.map +1 -0
- package/dist/form/components/LocalChangesMenu.js +127 -0
- package/dist/form/components/LocalChangesMenu.js.map +1 -0
- package/dist/form/components/StorageItemPreview.js +46 -0
- package/dist/form/components/StorageItemPreview.js.map +1 -0
- package/dist/form/components/StorageUploadProgress.js +84 -0
- package/dist/form/components/StorageUploadProgress.js.map +1 -0
- package/dist/form/components/useRailVisible.js +43 -0
- package/dist/form/components/useRailVisible.js.map +1 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js +84 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js +125 -0
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/BinaryFieldBinding.js +135 -0
- package/dist/form/field_bindings/BinaryFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/BlockFieldBinding.js +164 -0
- package/dist/form/field_bindings/BlockFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/DateTimeFieldBinding.js +47 -0
- package/dist/form/field_bindings/DateTimeFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/GeopointFieldBinding.js +148 -0
- package/dist/form/field_bindings/GeopointFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/KeyValueFieldBinding.js +450 -0
- package/dist/form/field_bindings/KeyValueFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MapFieldBinding.js +77 -0
- package/dist/form/field_bindings/MapFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.js +215 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MultiSelectFieldBinding.js +88 -0
- package/dist/form/field_bindings/MultiSelectFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/MultipleRelationFieldBinding.js +118 -0
- package/dist/form/field_bindings/MultipleRelationFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/ReadOnlyFieldBinding.js +52 -0
- package/dist/form/field_bindings/ReadOnlyFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.js +99 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/RelationFieldBinding.js +135 -0
- package/dist/form/field_bindings/RelationFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/RepeatFieldBinding.js +103 -0
- package/dist/form/field_bindings/RepeatFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/SelectFieldBinding.js +80 -0
- package/dist/form/field_bindings/SelectFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.js +266 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/SwitchFieldBinding.js +41 -0
- package/dist/form/field_bindings/SwitchFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/TextFieldBinding.js +114 -0
- package/dist/form/field_bindings/TextFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/UserSelectFieldBinding.js +48 -0
- package/dist/form/field_bindings/UserSelectFieldBinding.js.map +1 -0
- package/dist/form/field_bindings/VectorFieldBinding.js +147 -0
- package/dist/form/field_bindings/VectorFieldBinding.js.map +1 -0
- package/dist/form/form_keyboard_scope.d.ts +26 -0
- package/dist/form/form_keyboard_scope.js +39 -0
- package/dist/form/form_keyboard_scope.js.map +1 -0
- package/dist/form/form_uploads.d.ts +24 -0
- package/dist/form/form_uploads.js +31 -0
- package/dist/form/form_uploads.js.map +1 -0
- package/dist/form/form_utils.d.ts +24 -0
- package/dist/form/form_utils.js +280 -0
- package/dist/form/form_utils.js.map +1 -0
- package/dist/form/resolve_cell_property.d.ts +32 -0
- package/dist/form/resolve_cell_property.js +80 -0
- package/dist/form/resolve_cell_property.js.map +1 -0
- package/dist/form/resolve_form_properties.d.ts +2 -1
- package/dist/form/resolve_form_properties.js +78 -0
- package/dist/form/resolve_form_properties.js.map +1 -0
- package/dist/form/useClearRestoreValue.js +27 -0
- package/dist/form/useClearRestoreValue.js.map +1 -0
- package/dist/form/useUndoableDiscard.js +36 -0
- package/dist/form/useUndoableDiscard.js.map +1 -0
- package/dist/form/validation.d.ts +20 -0
- package/dist/form/validation.js +416 -0
- package/dist/form/validation.js.map +1 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.js +22 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.js.map +1 -0
- package/dist/hooks/navigation/contexts/NavigationStateContext.js +15 -0
- package/dist/hooks/navigation/contexts/NavigationStateContext.js.map +1 -0
- package/dist/hooks/navigation/contexts/UrlContext.js +22 -0
- package/dist/hooks/navigation/contexts/UrlContext.js.map +1 -0
- package/dist/hooks/navigation/useAsyncResolver.js +68 -0
- package/dist/hooks/navigation/useAsyncResolver.js.map +1 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.js +141 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.js.map +1 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.js +77 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.js.map +1 -0
- package/dist/hooks/navigation/useBuildUrlController.js +57 -0
- package/dist/hooks/navigation/useBuildUrlController.js.map +1 -0
- package/dist/hooks/navigation/useNavigationResolution.js +177 -0
- package/dist/hooks/navigation/useNavigationResolution.js.map +1 -0
- package/dist/hooks/navigation/useResolvedCollections.js +56 -0
- package/dist/hooks/navigation/useResolvedCollections.js.map +1 -0
- package/dist/hooks/navigation/useResolvedViews.js +94 -0
- package/dist/hooks/navigation/useResolvedViews.js.map +1 -0
- package/dist/hooks/navigation/useTopLevelNavigation.js +162 -0
- package/dist/hooks/navigation/useTopLevelNavigation.js.map +1 -0
- package/dist/hooks/navigation/utils.js +125 -0
- package/dist/hooks/navigation/utils.js.map +1 -0
- package/dist/hooks/useAdminContext.js +45 -0
- package/dist/hooks/useAdminContext.js.map +1 -0
- package/dist/hooks/useBreadcrumbsController.js +17 -0
- package/dist/hooks/useBreadcrumbsController.js.map +1 -0
- package/dist/hooks/useBuildSideDialogsController.js +96 -0
- package/dist/hooks/useBuildSideDialogsController.js.map +1 -0
- package/dist/hooks/useBuildSidePanel.js +208 -0
- package/dist/hooks/useBuildSidePanel.js.map +1 -0
- package/dist/hooks/useChildViewSource.js +41 -0
- package/dist/hooks/useChildViewSource.js.map +1 -0
- package/dist/hooks/useEntityDisplay.js +136 -0
- package/dist/hooks/useEntityDisplay.js.map +1 -0
- package/dist/hooks/useEntityDisplayTitle.js +34 -0
- package/dist/hooks/useEntityDisplayTitle.js.map +1 -0
- package/dist/hooks/useHistory.js +137 -0
- package/dist/hooks/useHistory.js.map +1 -0
- package/dist/hooks/useRecordActions.js +108 -0
- package/dist/hooks/useRecordActions.js.map +1 -0
- package/dist/hooks/useReferencePaths.js +32 -0
- package/dist/hooks/useReferencePaths.js.map +1 -0
- package/dist/hooks/useResolvedNavigationFrom.js +83 -0
- package/dist/hooks/useResolvedNavigationFrom.js.map +1 -0
- package/dist/hooks/useResolvedUsers.js +109 -0
- package/dist/hooks/useResolvedUsers.js.map +1 -0
- package/dist/hooks/useSelectionDialog.js +53 -0
- package/dist/hooks/useSelectionDialog.js.map +1 -0
- package/dist/hooks/useSideDialogsController.js +8 -0
- package/dist/hooks/useSideDialogsController.js.map +1 -0
- package/dist/hooks/useSidePanel.js +15 -0
- package/dist/hooks/useSidePanel.js.map +1 -0
- package/dist/hooks/useStorageReferenceResolver.d.ts +4 -2
- package/dist/hooks/useStorageReferenceResolver.js +49 -0
- package/dist/hooks/useStorageReferenceResolver.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +149 -3867
- package/dist/preview/PropertyPreview.js +260 -0
- package/dist/preview/PropertyPreview.js.map +1 -0
- package/dist/preview/compact_text.js +52 -0
- package/dist/preview/compact_text.js.map +1 -0
- package/dist/preview/components/ArrayEnumPreview.js +24 -0
- package/dist/preview/components/ArrayEnumPreview.js.map +1 -0
- package/dist/preview/components/BooleanPreview.js +25 -0
- package/dist/preview/components/BooleanPreview.js.map +1 -0
- package/dist/preview/components/DatePreview.d.ts +3 -2
- package/dist/preview/components/DatePreview.js +87 -0
- package/dist/preview/components/DatePreview.js.map +1 -0
- package/dist/preview/components/EmptyValue.js +13 -0
- package/dist/preview/components/EmptyValue.js.map +1 -0
- package/dist/preview/components/EnumValuesChip.js +26 -0
- package/dist/preview/components/EnumValuesChip.js.map +1 -0
- package/dist/preview/components/ImagePreview.d.ts +7 -1
- package/dist/preview/components/ImagePreview.js +112 -0
- package/dist/preview/components/ImagePreview.js.map +1 -0
- package/dist/preview/components/InlineEntityListPreview.js +31 -0
- package/dist/preview/components/InlineEntityListPreview.js.map +1 -0
- package/dist/preview/components/ReferencePreview.js +162 -0
- package/dist/preview/components/ReferencePreview.js.map +1 -0
- package/dist/preview/components/RelationPreview.js +196 -0
- package/dist/preview/components/RelationPreview.js.map +1 -0
- package/dist/preview/components/StorageMarkdown.d.ts +2 -1
- package/dist/preview/components/StorageMarkdown.js +49 -0
- package/dist/preview/components/StorageMarkdown.js.map +1 -0
- package/dist/preview/components/StorageThumbnail.js +183 -0
- package/dist/preview/components/StorageThumbnail.js.map +1 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +3 -1
- package/dist/preview/components/UrlComponentPreview.js +88 -0
- package/dist/preview/components/UrlComponentPreview.js.map +1 -0
- package/dist/preview/components/UserPreview.js +30 -0
- package/dist/preview/components/UserPreview.js.map +1 -0
- package/dist/preview/components/date_fns_locales.js +124 -0
- package/dist/preview/components/date_fns_locales.js.map +1 -0
- package/dist/preview/components/storageRenditions.d.ts +10 -0
- package/dist/preview/components/storageRenditions.js +93 -0
- package/dist/preview/components/storageRenditions.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfMapsPreview.js +44 -0
- package/dist/preview/property_previews/ArrayOfMapsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.js +48 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfRelationsPreview.js +50 -0
- package/dist/preview/property_previews/ArrayOfRelationsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js +30 -0
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOfStringsPreview.js +42 -0
- package/dist/preview/property_previews/ArrayOfStringsPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayOneOfPreview.js +47 -0
- package/dist/preview/property_previews/ArrayOneOfPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.js +25 -0
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.js.map +1 -0
- package/dist/preview/property_previews/ArrayPropertyPreview.js +48 -0
- package/dist/preview/property_previews/ArrayPropertyPreview.js.map +1 -0
- package/dist/preview/property_previews/MapPropertyPreview.js +137 -0
- package/dist/preview/property_previews/MapPropertyPreview.js.map +1 -0
- package/dist/preview/property_previews/NumberPropertyPreview.js +34 -0
- package/dist/preview/property_previews/NumberPropertyPreview.js.map +1 -0
- package/dist/preview/property_previews/SkeletonPropertyComponent.js +151 -0
- package/dist/preview/property_previews/SkeletonPropertyComponent.js.map +1 -0
- package/dist/preview/property_previews/StringPropertyPreview.js +49 -0
- package/dist/preview/property_previews/StringPropertyPreview.js.map +1 -0
- package/dist/preview/util.d.ts +4 -3
- package/dist/{util-D7ebttKT.js → preview/util.js} +8 -5
- package/dist/preview/util.js.map +1 -0
- package/dist/routes/CustomViewRoute.js +26 -0
- package/dist/routes/CustomViewRoute.js.map +1 -0
- package/dist/routes/RebaseRoute.js +311 -0
- package/dist/routes/RebaseRoute.js.map +1 -0
- package/dist/selection/SelectionMenu.js +90 -0
- package/dist/selection/SelectionMenu.js.map +1 -0
- package/dist/selection/resolve_selection.js +79 -0
- package/dist/selection/resolve_selection.js.map +1 -0
- package/dist/util/caller_scopes.js +25 -0
- package/dist/util/caller_scopes.js.map +1 -0
- package/dist/util/collection_open_mode.d.ts +20 -0
- package/dist/util/collection_open_mode.js +32 -0
- package/dist/util/collection_open_mode.js.map +1 -0
- package/dist/util/dataControllerAdapter.js +65 -0
- package/dist/util/dataControllerAdapter.js.map +1 -0
- package/dist/util/entity_actions.d.ts +5 -0
- package/dist/util/entity_actions.js +77 -0
- package/dist/util/entity_actions.js.map +1 -0
- package/dist/util/entity_pages.d.ts +37 -3
- package/dist/util/entity_pages.js +71 -0
- package/dist/util/entity_pages.js.map +1 -0
- package/dist/util/find_entities_by_ids.d.ts +23 -0
- package/dist/util/find_entities_by_ids.js +55 -0
- package/dist/util/find_entities_by_ids.js.map +1 -0
- package/dist/util/fit_inline_actions.js +40 -0
- package/dist/util/fit_inline_actions.js.map +1 -0
- package/dist/util/format_collection_date.d.ts +29 -0
- package/dist/util/format_collection_date.js +60 -0
- package/dist/util/format_collection_date.js.map +1 -0
- package/dist/util/map_with_concurrency.js +46 -0
- package/dist/util/map_with_concurrency.js.map +1 -0
- package/dist/util/navigation_utils.js +44 -0
- package/dist/util/navigation_utils.js.map +1 -0
- package/dist/util/number_format.js +33 -0
- package/dist/util/number_format.js.map +1 -0
- package/dist/util/previews.js +71 -0
- package/dist/util/previews.js.map +1 -0
- package/dist/util/propertyConfigMapper.js +83 -0
- package/dist/util/propertyConfigMapper.js.map +1 -0
- package/dist/util/property_utils.js +141 -0
- package/dist/util/property_utils.js.map +1 -0
- package/dist/util/resolutions.js +55 -0
- package/dist/util/resolutions.js.map +1 -0
- package/dist/util/view_constants.js +35 -0
- package/dist/util/view_constants.js.map +1 -0
- package/dist/util/view_mode.js +112 -0
- package/dist/util/view_mode.js.map +1 -0
- package/package.json +13 -9
- package/dist/CollectionEditorDialog-p5-I-Apu.js +0 -3669
- package/dist/CollectionEditorDialog-p5-I-Apu.js.map +0 -1
- package/dist/JsonPreviewBinding-v0w3H0fp.js.map +0 -1
- package/dist/PropertyEditView-DDB_X-00.js +0 -3837
- package/dist/PropertyEditView-DDB_X-00.js.map +0 -1
- package/dist/RouterCollectionsStudioView-SGBV4CMg.js +0 -212
- package/dist/RouterCollectionsStudioView-SGBV4CMg.js.map +0 -1
- package/dist/SchemaChangeDialog-CcFSXvkK.js.map +0 -1
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +0 -13
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +0 -8
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/editor.js.map +0 -1
- package/dist/export-DCHuPD1a.js +0 -520
- package/dist/export-DCHuPD1a.js.map +0 -1
- package/dist/history-CBd6SBRs.js +0 -314
- package/dist/history-CBd6SBRs.js.map +0 -1
- package/dist/import-DjQoRrIU.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-CCqp8ibf.js.map +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.js +0 -13
- package/dist/util-BRvKFMLa.js +0 -27773
- package/dist/util-BRvKFMLa.js.map +0 -1
- package/dist/util-D7ebttKT.js.map +0 -1
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
import { FieldBlock, isSelfLabellingProperty, spanClass } from "./components/FieldBlock.js";
|
|
2
|
+
import { AdditionalFieldValue } from "../components/AdditionalFieldValue.js";
|
|
3
|
+
import { FormRail, RecordMeta } from "./components/FormRail.js";
|
|
4
|
+
import { FormSections } from "./components/FormSections.js";
|
|
5
|
+
import { useRailVisible } from "./components/useRailVisible.js";
|
|
6
|
+
import { resolveFormProperty, resolvePropertiesForValidation } from "./resolve_form_properties.js";
|
|
7
|
+
import { FormUploadsContext, createFormUploadTracker } from "./form_uploads.js";
|
|
8
|
+
import { applyValueTransforms, getEntitySchema, uniqueValueErrors } from "./validation.js";
|
|
9
|
+
import { PropertyFieldBinding } from "./PropertyFieldBinding.js";
|
|
10
|
+
import { ErrorFocus } from "./components/ErrorFocus.js";
|
|
11
|
+
import { EntityFormActions } from "./EntityFormActions.js";
|
|
12
|
+
import { getChangedProperties, overlayEdit, serverViolationErrors, withoutUnsetNulls, zodToFormErrors } from "./form_utils.js";
|
|
13
|
+
import { LocalChangesMenu } from "./components/LocalChangesMenu.js";
|
|
14
|
+
import { useUndoableDiscard } from "./useUndoableDiscard.js";
|
|
15
|
+
import { ownsKeystroke, registerKeyboardScope } from "./form_keyboard_scope.js";
|
|
16
|
+
import { Suspense, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { deepEqual } from "fast-equals";
|
|
19
|
+
import { Alert, AlignLeftIcon, Button, CircularProgressCenter, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, Typography, cls, defaultBorderMixin, isKeyHandled, paperMixin, useDebouncedCallback } from "@rebasepro/ui";
|
|
20
|
+
import { getCopyValues, getDefaultValuesFor } from "@rebasepro/common";
|
|
21
|
+
import { flattenKeys, getFormFieldKeys, isDisabled, isHidden, isReadOnly, resolveFormLayout, useAuthController, useCustomizationController, useRebaseContext, useTranslation } from "@rebasepro/app";
|
|
22
|
+
import { Formex, useCreateFormex } from "@rebasepro/forms";
|
|
23
|
+
//#region src/form/EntityForm.tsx
|
|
24
|
+
/**
|
|
25
|
+
* Headless entity form component.
|
|
26
|
+
*
|
|
27
|
+
* Renders a form for a entity collection without any admin or backend dependencies.
|
|
28
|
+
* All backend concerns (save, caching, analytics, plugin slots) are provided via
|
|
29
|
+
* callback props. For admin-connected usage, use {@link EntityFormBinding} instead.
|
|
30
|
+
*
|
|
31
|
+
* @group Components
|
|
32
|
+
*/
|
|
33
|
+
function EntityForm({ path, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, initialStatus, className, onStatusChange, onEntityChange, openEntityMode = "full_screen", formex: formexProp, disabled: disabledProp, Builder, parentCollectionSlugs, parentEntityIds, EntityFormActionsComponent = EntityFormActions, showDefaultActions = true, navigateBack: navigateBackProp, children, onSubmit: onSubmitProp, onValuesChangeDeferred: onValuesChangeDeferredProp, onReset: onResetProp, uniqueFieldValidator: uniqueFieldValidatorProp, beforeFields, afterFields, pluginActions: pluginActionsProp, computedInitialValues, hasLocalChanges: hasLocalChangesProp, localChangesData, manualApplyLocalChanges, localChangesCacheKey, onClearLocalChanges }) {
|
|
34
|
+
const navigateBack = useCallback(() => {
|
|
35
|
+
if (navigateBackProp) navigateBackProp();
|
|
36
|
+
}, [navigateBackProp]);
|
|
37
|
+
const [status, setStatus] = useState(initialStatus);
|
|
38
|
+
const updateStatus = (status) => {
|
|
39
|
+
setStatus(status);
|
|
40
|
+
onStatusChange?.(status);
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The autosave due: what it writes, and the whole form it was taken from
|
|
44
|
+
* — which is what validation judges.
|
|
45
|
+
*/
|
|
46
|
+
const [valuesToBeSaved, setValuesToBeSaved] = useState(void 0);
|
|
47
|
+
useDebouncedCallback(valuesToBeSaved, () => {
|
|
48
|
+
if (!valuesToBeSaved || !onSubmitProp) return;
|
|
49
|
+
const pending = valuesToBeSaved;
|
|
50
|
+
setIsSavingAutoSave(true);
|
|
51
|
+
validateForSave(pending.values).then((errors) => {
|
|
52
|
+
if (Object.keys(errors).length > 0) {
|
|
53
|
+
formex.validate();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
return onSubmitProp(pending.toSave, formex);
|
|
57
|
+
}).catch((e) => {
|
|
58
|
+
console.error(e);
|
|
59
|
+
setSavingError(e);
|
|
60
|
+
const fieldErrors = serverViolationErrors(e, Object.keys(collection.properties ?? {}));
|
|
61
|
+
if (Object.keys(fieldErrors).length > 0) {
|
|
62
|
+
for (const [key, message] of Object.entries(fieldErrors)) formex.setFieldError(key, message);
|
|
63
|
+
formex.setSubmitCount(formex.submitCount + 1);
|
|
64
|
+
}
|
|
65
|
+
}).finally(() => setIsSavingAutoSave(false));
|
|
66
|
+
}, false, 2e3);
|
|
67
|
+
/**
|
|
68
|
+
* The properties the record changed underneath an edit of the user's own,
|
|
69
|
+
* keyed to the value they changed to — each one shown as "updated
|
|
70
|
+
* elsewhere" while the form still holds something else. Filled by the
|
|
71
|
+
* effect that follows the baseline, below.
|
|
72
|
+
*/
|
|
73
|
+
const [underlyingChanges, setUnderlyingChanges] = useState({});
|
|
74
|
+
/**
|
|
75
|
+
* Rules the stored record already broke, on fields this edit leaves alone —
|
|
76
|
+
* shown, and not held against the save. Keyed like `formex.errors`.
|
|
77
|
+
*/
|
|
78
|
+
const [predatingViolations, setPredatingViolations] = useState({});
|
|
79
|
+
const initialEntityId = useMemo(() => {
|
|
80
|
+
if (status === "new" || status === "copy") return;
|
|
81
|
+
else return entityIdProp;
|
|
82
|
+
}, [entityIdProp, status]);
|
|
83
|
+
const [entityId, setEntityId] = useState(initialEntityId);
|
|
84
|
+
const [savingError, setSavingError] = useState();
|
|
85
|
+
const [isSavingAutoSave, setIsSavingAutoSave] = useState(false);
|
|
86
|
+
const [discardDialogOpen, setDiscardDialogOpen] = useState(false);
|
|
87
|
+
const discard = useUndoableDiscard();
|
|
88
|
+
const autoSave = collection.formAutoSave;
|
|
89
|
+
const baseInitialValues = useMemo(() => {
|
|
90
|
+
if (computedInitialValues !== void 0) return computedInitialValues;
|
|
91
|
+
if (status === "copy" && entity) return getCopyValues(collection, entity.values ?? getDefaultValuesFor(collection.properties));
|
|
92
|
+
if (status === "existing" && entity) return entity.values ?? getDefaultValuesFor(collection.properties);
|
|
93
|
+
return getDefaultValuesFor(collection.properties);
|
|
94
|
+
}, [
|
|
95
|
+
computedInitialValues,
|
|
96
|
+
collection,
|
|
97
|
+
status,
|
|
98
|
+
entity
|
|
99
|
+
]);
|
|
100
|
+
const [localChangesCleared, setLocalChangesCleared] = useState(false);
|
|
101
|
+
const hasLocalChanges = hasLocalChangesProp !== void 0 ? hasLocalChangesProp && !localChangesCleared : false;
|
|
102
|
+
const onSubmit = (values, formexController) => {
|
|
103
|
+
setSavingError(void 0);
|
|
104
|
+
if (status === "existing") {
|
|
105
|
+
if (!entity?.id) throw Error("Form misconfiguration when saving, no id for existing entity");
|
|
106
|
+
} else if (status !== "new" && status !== "copy") throw Error("New FormType added, check EntityForm");
|
|
107
|
+
if (!onSubmitProp) {
|
|
108
|
+
console.warn("EntityForm: no onSubmit callback provided. Form submission has no effect.");
|
|
109
|
+
formexController.setSubmitting(false);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
return Promise.resolve(save(values))?.then((savedEntity) => {
|
|
113
|
+
if (savedEntity) formexController.resetForm({
|
|
114
|
+
values: savedEntity.values || values,
|
|
115
|
+
submitCount: 0,
|
|
116
|
+
touched: {}
|
|
117
|
+
});
|
|
118
|
+
}).finally(() => {
|
|
119
|
+
formexController.setSubmitting(false);
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* What the form opens showing, when that is not what is stored — an edit
|
|
124
|
+
* carried over from the side panel's "open full screen", or a draft
|
|
125
|
+
* restored from the local-changes backup.
|
|
126
|
+
*
|
|
127
|
+
* The merge is deliberately *not* folded into the baseline. `mergeDeep`
|
|
128
|
+
* used to produce a single `initialValues` that served as both, with a
|
|
129
|
+
* `initialDirty: true` bolted on beside it to say what the baseline could
|
|
130
|
+
* no longer show — and that flag survived exactly one render, because the
|
|
131
|
+
* record's data arriving replaced the baseline and the form recomputed
|
|
132
|
+
* dirty as false against a baseline that already contained the edit.
|
|
133
|
+
*
|
|
134
|
+
* Read once, at mount: this is a handoff, and re-reading it every render
|
|
135
|
+
* tied the form to a cache that is cleared as soon as it has been consumed.
|
|
136
|
+
*/
|
|
137
|
+
const initialModifiedValues = useRef(initialDirtyValues && Object.keys(initialDirtyValues).length > 0 ? overlayEdit(baseInitialValues, initialDirtyValues) : void 0).current;
|
|
138
|
+
/**
|
|
139
|
+
* Every key of the handed-over edit, marked touched. Read once, at mount,
|
|
140
|
+
* like the edit itself: it was rebuilt on every render — a key-value map
|
|
141
|
+
* of 1,000 entries cost ~60 ms per keystroke — by a spread that copied the
|
|
142
|
+
* map once per key.
|
|
143
|
+
*/
|
|
144
|
+
const [initialTouched] = useState(() => {
|
|
145
|
+
const touched = {};
|
|
146
|
+
if (initialDirtyValues) for (const key of flattenKeys(initialDirtyValues)) touched[key] = true;
|
|
147
|
+
return touched;
|
|
148
|
+
});
|
|
149
|
+
const [uploadTracker] = useState(createFormUploadTracker);
|
|
150
|
+
const internalFormex = useCreateFormex({
|
|
151
|
+
initialValues: baseInitialValues,
|
|
152
|
+
beforeSubmit: uploadTracker.wait,
|
|
153
|
+
initialModifiedValues,
|
|
154
|
+
debugId: `EntityForm:${path}/${entityIdProp}`,
|
|
155
|
+
initialTouched,
|
|
156
|
+
onSubmit,
|
|
157
|
+
onReset: () => {
|
|
158
|
+
setUnderlyingChanges({});
|
|
159
|
+
onResetProp?.();
|
|
160
|
+
onValuesModified?.(false, baseInitialValues);
|
|
161
|
+
},
|
|
162
|
+
onValuesChangeDeferred: onValuesChangeDeferredProp,
|
|
163
|
+
validation: (values) => validateForSave(values)
|
|
164
|
+
});
|
|
165
|
+
const formex = formexProp ?? internalFormex;
|
|
166
|
+
/**
|
|
167
|
+
* The errors that stop a save of `values`. Formex runs it on submit, and
|
|
168
|
+
* the autosave runs it before each write.
|
|
169
|
+
*/
|
|
170
|
+
async function validateForSave(values) {
|
|
171
|
+
const errors = await validationErrorsFor(values);
|
|
172
|
+
if (status !== "existing" || !entity?.values || Object.keys(errors).length === 0) {
|
|
173
|
+
setPredatingViolations({});
|
|
174
|
+
return errors;
|
|
175
|
+
}
|
|
176
|
+
const edited = getChangedProperties(values, entity.values);
|
|
177
|
+
const storedErrors = await validationErrorsFor(entity.values);
|
|
178
|
+
const blocking = {};
|
|
179
|
+
const predating = {};
|
|
180
|
+
for (const [key, error] of Object.entries(errors)) if (!(key in edited) && key in storedErrors) predating[key] = error;
|
|
181
|
+
else blocking[key] = error;
|
|
182
|
+
setPredatingViolations(predating);
|
|
183
|
+
return blocking;
|
|
184
|
+
}
|
|
185
|
+
const keyboardScope = useRef(void 0);
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
const scope = registerKeyboardScope(() => formElementRef.current);
|
|
188
|
+
keyboardScope.current = scope;
|
|
189
|
+
return () => {
|
|
190
|
+
scope.unregister();
|
|
191
|
+
keyboardScope.current = void 0;
|
|
192
|
+
};
|
|
193
|
+
}, []);
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
const handleKeyDown = (e) => {
|
|
196
|
+
if (isKeyHandled(e)) return;
|
|
197
|
+
if (!keyboardScope.current || !ownsKeystroke(keyboardScope.current, e)) return;
|
|
198
|
+
const isUndo = (e.metaKey || e.ctrlKey) && !e.shiftKey && e.key.toLowerCase() === "z";
|
|
199
|
+
const isRedo = (e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === "z" || (e.metaKey || e.ctrlKey) && !e.shiftKey && e.key.toLowerCase() === "y";
|
|
200
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "s" && !disabled && formex.dirty) {
|
|
201
|
+
e.preventDefault();
|
|
202
|
+
formex.handleSubmit();
|
|
203
|
+
} else if (isUndo && formex.canUndo) {
|
|
204
|
+
e.preventDefault();
|
|
205
|
+
formex.undo();
|
|
206
|
+
} else if (isRedo && formex.canRedo) {
|
|
207
|
+
e.preventDefault();
|
|
208
|
+
formex.redo();
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
212
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
213
|
+
}, [formex]);
|
|
214
|
+
const afterSave = (updatedEntity) => {
|
|
215
|
+
onResetProp?.();
|
|
216
|
+
onValuesModified?.(false, updatedEntity.values);
|
|
217
|
+
onEntityChange?.(updatedEntity);
|
|
218
|
+
updateStatus("existing");
|
|
219
|
+
setEntityId(updatedEntity.id);
|
|
220
|
+
if (onSaved) onSaved({
|
|
221
|
+
entity: updatedEntity,
|
|
222
|
+
status,
|
|
223
|
+
path,
|
|
224
|
+
entityId: updatedEntity.id,
|
|
225
|
+
collection
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
const lastSavedValues = useRef(baseInitialValues);
|
|
229
|
+
const save = async (values) => {
|
|
230
|
+
const writtenValues = applyValueTransforms(values, collection.properties);
|
|
231
|
+
const valuesToSave = status === "existing" ? getChangedProperties(writtenValues, entity?.values || {}) : status === "new" ? withoutUnsetNulls(writtenValues, baseInitialValues) : writtenValues;
|
|
232
|
+
if (status === "existing" && Object.keys(valuesToSave).length === 0 && entity) return Promise.resolve(entity);
|
|
233
|
+
lastSavedValues.current = values;
|
|
234
|
+
if (!onSubmitProp) return;
|
|
235
|
+
if (autoSave ?? false) {
|
|
236
|
+
setValuesToBeSaved({
|
|
237
|
+
toSave: valuesToSave,
|
|
238
|
+
values
|
|
239
|
+
});
|
|
240
|
+
return Promise.resolve();
|
|
241
|
+
}
|
|
242
|
+
return Promise.resolve(onSubmitProp(valuesToSave, formex)).then((result) => {
|
|
243
|
+
if (result) afterSave(result);
|
|
244
|
+
return result;
|
|
245
|
+
}).catch((e) => {
|
|
246
|
+
console.error(e);
|
|
247
|
+
setSavingError(e);
|
|
248
|
+
const fieldErrors = serverViolationErrors(e, Object.keys(collection.properties ?? {}));
|
|
249
|
+
for (const [key, message] of Object.entries(fieldErrors)) formex.setFieldError(key, message);
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
const disabled = formex.isSubmitting || Boolean(disabledProp);
|
|
253
|
+
const rebaseContext = useRebaseContext();
|
|
254
|
+
const formContext = {
|
|
255
|
+
setFieldValue: useCallback((key, value) => formex.setFieldValue(key, value), []),
|
|
256
|
+
values: formex.values,
|
|
257
|
+
collection,
|
|
258
|
+
entityId,
|
|
259
|
+
path,
|
|
260
|
+
save,
|
|
261
|
+
submit: formex.handleSubmit,
|
|
262
|
+
formex,
|
|
263
|
+
entity,
|
|
264
|
+
savingError,
|
|
265
|
+
status,
|
|
266
|
+
openEntityMode,
|
|
267
|
+
disabled,
|
|
268
|
+
isSaving: formex.isSubmitting || isSavingAutoSave
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* The context the fields get. Not `formContext`: that one is a new object
|
|
272
|
+
* per render, and a field memoised on its own value would re-render for it
|
|
273
|
+
* on every keystroke anywhere in the form.
|
|
274
|
+
*
|
|
275
|
+
* This one changes identity only with what a field may draw from it — the
|
|
276
|
+
* record, its status, the form's `version` (a reset or re-seed) — and reads
|
|
277
|
+
* `values`, `formex` and `save` through a ref, so a field that did not
|
|
278
|
+
* re-render still sees the current ones from its callbacks (a storage path
|
|
279
|
+
* builder, a markdown file name). A field that reads another field's value
|
|
280
|
+
* *while rendering* has to re-render with it; `PropertyFieldBinding` keeps
|
|
281
|
+
* those — custom `Field`s, `dynamicProps`, `conditions` — on that path.
|
|
282
|
+
*/
|
|
283
|
+
const latestRef = useRef({
|
|
284
|
+
formex,
|
|
285
|
+
save
|
|
286
|
+
});
|
|
287
|
+
latestRef.current = {
|
|
288
|
+
formex,
|
|
289
|
+
save
|
|
290
|
+
};
|
|
291
|
+
const isSaving = formex.isSubmitting || isSavingAutoSave;
|
|
292
|
+
const fieldContext = useMemo(() => ({
|
|
293
|
+
get values() {
|
|
294
|
+
return latestRef.current.formex.values;
|
|
295
|
+
},
|
|
296
|
+
get formex() {
|
|
297
|
+
return latestRef.current.formex;
|
|
298
|
+
},
|
|
299
|
+
setFieldValue: formContext.setFieldValue,
|
|
300
|
+
save: (values) => latestRef.current.save(values),
|
|
301
|
+
submit: () => latestRef.current.formex.handleSubmit(),
|
|
302
|
+
collection,
|
|
303
|
+
entityId,
|
|
304
|
+
path,
|
|
305
|
+
entity,
|
|
306
|
+
savingError,
|
|
307
|
+
status,
|
|
308
|
+
openEntityMode,
|
|
309
|
+
disabled,
|
|
310
|
+
isSaving
|
|
311
|
+
}), [
|
|
312
|
+
formContext.setFieldValue,
|
|
313
|
+
collection,
|
|
314
|
+
entityId,
|
|
315
|
+
path,
|
|
316
|
+
entity,
|
|
317
|
+
savingError,
|
|
318
|
+
status,
|
|
319
|
+
openEntityMode,
|
|
320
|
+
disabled,
|
|
321
|
+
isSaving,
|
|
322
|
+
formex.version
|
|
323
|
+
]);
|
|
324
|
+
useEffect(() => {
|
|
325
|
+
onFormContextReady?.(formContext);
|
|
326
|
+
}, [
|
|
327
|
+
formex.version,
|
|
328
|
+
collection,
|
|
329
|
+
entityId,
|
|
330
|
+
path,
|
|
331
|
+
formex.dirty,
|
|
332
|
+
formex.isSubmitting,
|
|
333
|
+
formex.submitCount,
|
|
334
|
+
isSavingAutoSave
|
|
335
|
+
]);
|
|
336
|
+
const actionsDisabled = disabled || formex.isSubmitting || status === "existing" && !formex.dirty || Boolean(disabledProp);
|
|
337
|
+
const modified = formex.dirty;
|
|
338
|
+
useEffect(() => {
|
|
339
|
+
if (!autoSave) onValuesModified?.(modified, formex.values);
|
|
340
|
+
}, [formex.dirty]);
|
|
341
|
+
const defaultUniqueFieldValidator = useCallback(async () => true, []);
|
|
342
|
+
const uniqueFieldValidator = useMemo(() => {
|
|
343
|
+
if (uniqueFieldValidatorProp) return uniqueFieldValidatorProp;
|
|
344
|
+
return defaultUniqueFieldValidator;
|
|
345
|
+
}, [uniqueFieldValidatorProp, defaultUniqueFieldValidator]);
|
|
346
|
+
const authController = useAuthController();
|
|
347
|
+
const customizationController = useCustomizationController();
|
|
348
|
+
const { t } = useTranslation();
|
|
349
|
+
async function validationErrorsFor(values) {
|
|
350
|
+
const properties = validationPropertiesFor(values);
|
|
351
|
+
const result = await getEntitySchema(entityId, properties, uniqueFieldValidator).safeParseAsync(values);
|
|
352
|
+
const errors = result.success ? {} : zodToFormErrors(result.error);
|
|
353
|
+
const notUnique = await uniqueValueErrors({
|
|
354
|
+
properties,
|
|
355
|
+
values,
|
|
356
|
+
storedValues: status === "existing" ? entity?.values : void 0,
|
|
357
|
+
entityId,
|
|
358
|
+
errors,
|
|
359
|
+
validator: uniqueFieldValidator
|
|
360
|
+
});
|
|
361
|
+
return {
|
|
362
|
+
...errors,
|
|
363
|
+
...notUnique
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* What the save is judged against: the properties as the form shows them
|
|
368
|
+
* for these values — `dynamicProps` and `conditions` applied — and only
|
|
369
|
+
* the ones the user can change. Built per call because both depend on the
|
|
370
|
+
* values being judged.
|
|
371
|
+
*/
|
|
372
|
+
function validationPropertiesFor(values) {
|
|
373
|
+
return resolvePropertiesForValidation({
|
|
374
|
+
properties: collection.properties,
|
|
375
|
+
isNew: status === "new" || status === "copy",
|
|
376
|
+
values,
|
|
377
|
+
previousValues: baseInitialValues,
|
|
378
|
+
path,
|
|
379
|
+
entityId,
|
|
380
|
+
propertyConfigs: customizationController.propertyConfigs,
|
|
381
|
+
authController
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
useOnAutoSave(autoSave, formex, lastSavedValues, save);
|
|
385
|
+
/**
|
|
386
|
+
* The record changed while the form was open: someone else saved it, and
|
|
387
|
+
* the listener delivered the new version as a new baseline.
|
|
388
|
+
*
|
|
389
|
+
* An unmodified form follows it whole — formex does that. A modified one
|
|
390
|
+
* keeps the edit, and formex keeps *everything* it holds: a property the
|
|
391
|
+
* user never changed would still show the old value, differ from the new
|
|
392
|
+
* stored one, and be written back by the next save, reverting the other
|
|
393
|
+
* change without a word.
|
|
394
|
+
*
|
|
395
|
+
* So each top-level property that changed underneath is judged on its own,
|
|
396
|
+
* against the baseline the form last followed. One the user has not changed
|
|
397
|
+
* follows the record. One the user has changed keeps the edit — that is
|
|
398
|
+
* what a save writes — and is marked as updated elsewhere, so the overwrite
|
|
399
|
+
* is not a surprise.
|
|
400
|
+
*/
|
|
401
|
+
const followedBaseline = useRef(baseInitialValues);
|
|
402
|
+
useEffect(() => {
|
|
403
|
+
const previous = followedBaseline.current ?? {};
|
|
404
|
+
const next = baseInitialValues ?? {};
|
|
405
|
+
followedBaseline.current = baseInitialValues;
|
|
406
|
+
if (previous === next) return;
|
|
407
|
+
const current = formex.values;
|
|
408
|
+
if (deepEqual(previous, current)) return;
|
|
409
|
+
const conflicts = {};
|
|
410
|
+
const changedUnderneath = /* @__PURE__ */ new Set([...Object.keys(previous), ...Object.keys(next)]);
|
|
411
|
+
for (const key of changedUnderneath) if (deepEqual(previous[key], next[key])) changedUnderneath.delete(key);
|
|
412
|
+
else if (deepEqual(current[key], previous[key])) formex.setFieldValue(key, next[key]);
|
|
413
|
+
else if (!deepEqual(current[key], next[key])) conflicts[key] = next[key];
|
|
414
|
+
if (changedUnderneath.size === 0) return;
|
|
415
|
+
setUnderlyingChanges((prev) => {
|
|
416
|
+
const updated = { ...prev };
|
|
417
|
+
changedUnderneath.forEach((key) => {
|
|
418
|
+
if (key in conflicts) updated[key] = conflicts[key];
|
|
419
|
+
else delete updated[key];
|
|
420
|
+
});
|
|
421
|
+
return updated;
|
|
422
|
+
});
|
|
423
|
+
}, [baseInitialValues]);
|
|
424
|
+
const formFieldKeys = getFormFieldKeys(collection);
|
|
425
|
+
const layout = useMemo(() => resolveFormLayout({
|
|
426
|
+
collection,
|
|
427
|
+
fieldKeys: formFieldKeys,
|
|
428
|
+
status
|
|
429
|
+
}), [
|
|
430
|
+
collection,
|
|
431
|
+
formFieldKeys.join(","),
|
|
432
|
+
status
|
|
433
|
+
]);
|
|
434
|
+
const formElementRef = useRef(null);
|
|
435
|
+
const railVisible = useRailVisible(formElementRef);
|
|
436
|
+
const showRail = !Builder && layout.hasRail && railVisible;
|
|
437
|
+
const [collapsedSections, setCollapsedSections] = useState(() => new Set(layout.sections.filter((s) => s.collapsed).map((s) => s.key)));
|
|
438
|
+
const toggleSection = useCallback((key) => {
|
|
439
|
+
setCollapsedSections((prev) => {
|
|
440
|
+
const next = new Set(prev);
|
|
441
|
+
if (next.has(key)) next.delete(key);
|
|
442
|
+
else next.add(key);
|
|
443
|
+
return next;
|
|
444
|
+
});
|
|
445
|
+
}, []);
|
|
446
|
+
const errorKeys = useMemo(() => new Set(formex.submitCount > 0 ? Object.keys(formex.errors) : []), [formex.errors, formex.submitCount]);
|
|
447
|
+
const autoFocusKey = useMemo(() => {
|
|
448
|
+
if (status !== "new" && status !== "copy") return void 0;
|
|
449
|
+
return [...layout.sections.flatMap((s) => s.fields), ...layout.sidebar].find((field) => {
|
|
450
|
+
const property = collection.properties?.[field.key];
|
|
451
|
+
return property ? !isFieldDisabled(property) : false;
|
|
452
|
+
})?.key;
|
|
453
|
+
}, [
|
|
454
|
+
layout,
|
|
455
|
+
collection,
|
|
456
|
+
status,
|
|
457
|
+
disabledProp
|
|
458
|
+
]);
|
|
459
|
+
function isFieldDisabled(property) {
|
|
460
|
+
const isNew = status === "new" || status === "copy";
|
|
461
|
+
const isIdAndAuto = (property.type === "string" || property.type === "number") && "isId" in property && typeof property.isId === "string" && property.isId !== "manual";
|
|
462
|
+
return Boolean(disabledProp || !autoSave && formex.isSubmitting || isReadOnly(property) || isDisabled(property) || !isNew && "isId" in property && Boolean(property.isId) || isNew && isIdAndAuto);
|
|
463
|
+
}
|
|
464
|
+
const renderField = (field) => {
|
|
465
|
+
if (field.additional) {
|
|
466
|
+
const additionalField = collection.additionalFields?.find((f) => f.key === field.key);
|
|
467
|
+
if (!additionalField || !entity) return null;
|
|
468
|
+
const AdditionalFieldBuilder = additionalField.Builder;
|
|
469
|
+
if (!AdditionalFieldBuilder && !additionalField.value) throw new Error("When using additional fields you need to provide a Builder or a value");
|
|
470
|
+
const child = AdditionalFieldBuilder ? /* @__PURE__ */ jsx(AdditionalFieldBuilder, {
|
|
471
|
+
entity,
|
|
472
|
+
context: rebaseContext
|
|
473
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
474
|
+
className: "w-full",
|
|
475
|
+
children: /* @__PURE__ */ jsx(AdditionalFieldValue, {
|
|
476
|
+
field: additionalField,
|
|
477
|
+
entity,
|
|
478
|
+
context: rebaseContext
|
|
479
|
+
})
|
|
480
|
+
});
|
|
481
|
+
return /* @__PURE__ */ jsx("div", {
|
|
482
|
+
className: spanClass(field.span),
|
|
483
|
+
children: /* @__PURE__ */ jsx(FieldBlock, {
|
|
484
|
+
propertyKey: field.key,
|
|
485
|
+
showLabel: true,
|
|
486
|
+
label: additionalField.name,
|
|
487
|
+
icon: /* @__PURE__ */ jsx(AlignLeftIcon, { size: 14 }),
|
|
488
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
489
|
+
className: cls(paperMixin, "w-full min-h-12 p-4 md:p-6 overflow-x-auto no-scrollbar"),
|
|
490
|
+
children: child
|
|
491
|
+
})
|
|
492
|
+
})
|
|
493
|
+
}, `additional_${field.key}`);
|
|
494
|
+
}
|
|
495
|
+
const property = collection.properties?.[field.key];
|
|
496
|
+
if (!property) {
|
|
497
|
+
console.warn(`Property ${field.key} not found in collection ${collection.name} in properties or additional fields. Skipping.`);
|
|
498
|
+
return null;
|
|
499
|
+
}
|
|
500
|
+
if (property.conditions?.hidden) {
|
|
501
|
+
const shown = resolveFormProperty({
|
|
502
|
+
propertyKey: field.key,
|
|
503
|
+
property,
|
|
504
|
+
values: formex.values,
|
|
505
|
+
previousValues: baseInitialValues,
|
|
506
|
+
path,
|
|
507
|
+
entityId,
|
|
508
|
+
propertyConfigs: customizationController.propertyConfigs,
|
|
509
|
+
ignoreMissingFields: true,
|
|
510
|
+
authController
|
|
511
|
+
});
|
|
512
|
+
if (!shown || isHidden(shown)) return null;
|
|
513
|
+
}
|
|
514
|
+
const underlyingValueHasChanged = field.key in underlyingChanges && !deepEqual(formex.values[field.key], underlyingChanges[field.key]);
|
|
515
|
+
const disabled = isFieldDisabled(property);
|
|
516
|
+
const selfLabelling = isSelfLabellingProperty(property);
|
|
517
|
+
const cmsFormFieldProps = {
|
|
518
|
+
propertyKey: field.key,
|
|
519
|
+
disabled,
|
|
520
|
+
property,
|
|
521
|
+
includeDescription: false,
|
|
522
|
+
hideLabel: !selfLabelling,
|
|
523
|
+
underlyingValueHasChanged: underlyingValueHasChanged && !autoSave,
|
|
524
|
+
context: fieldContext,
|
|
525
|
+
partOfArray: false,
|
|
526
|
+
minimalistView: false,
|
|
527
|
+
size: "large",
|
|
528
|
+
autoFocus: autoFocusKey === field.key
|
|
529
|
+
};
|
|
530
|
+
return /* @__PURE__ */ jsx("div", {
|
|
531
|
+
className: spanClass(field.span),
|
|
532
|
+
children: /* @__PURE__ */ jsx(FieldBlock, {
|
|
533
|
+
propertyKey: field.key,
|
|
534
|
+
property,
|
|
535
|
+
showLabel: !selfLabelling,
|
|
536
|
+
children: /* @__PURE__ */ jsx(PropertyFieldBinding, { ...cmsFormFieldProps })
|
|
537
|
+
})
|
|
538
|
+
}, `field_${field.key}`);
|
|
539
|
+
};
|
|
540
|
+
const formFields = () => {
|
|
541
|
+
if (Builder) return /* @__PURE__ */ jsx(Suspense, {
|
|
542
|
+
fallback: /* @__PURE__ */ jsx(CircularProgressCenter, {}),
|
|
543
|
+
children: /* @__PURE__ */ jsx(Builder, {
|
|
544
|
+
collection,
|
|
545
|
+
parentCollectionSlugs,
|
|
546
|
+
parentEntityIds,
|
|
547
|
+
entity,
|
|
548
|
+
modifiedValues: formex.values,
|
|
549
|
+
formContext
|
|
550
|
+
})
|
|
551
|
+
});
|
|
552
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FormSections, {
|
|
553
|
+
sections: showRail || !layout.sidebar.length ? layout.sections : [...layout.sections, {
|
|
554
|
+
key: "__rail",
|
|
555
|
+
title: "Settings",
|
|
556
|
+
collapsible: false,
|
|
557
|
+
collapsed: false,
|
|
558
|
+
fields: layout.sidebar
|
|
559
|
+
}],
|
|
560
|
+
collapsed: collapsedSections,
|
|
561
|
+
onToggle: toggleSection,
|
|
562
|
+
errorKeys,
|
|
563
|
+
renderField
|
|
564
|
+
}), !showRail && layout.showRecordMeta && status === "existing" && entity && /* @__PURE__ */ jsx("div", {
|
|
565
|
+
className: cls("mt-8 pt-5 border-t max-w-sm", defaultBorderMixin),
|
|
566
|
+
children: /* @__PURE__ */ jsx(RecordMeta, { entity })
|
|
567
|
+
})] });
|
|
568
|
+
};
|
|
569
|
+
const formRef = useRef(null);
|
|
570
|
+
const hasFormErrors = Object.keys(formex.errors).length > 0 && formex.submitCount > 0;
|
|
571
|
+
const predatingViolationLines = useMemo(() => errorLines(predatingViolations, collection.properties), [predatingViolations, collection.properties]);
|
|
572
|
+
const formView = /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
573
|
+
beforeFields,
|
|
574
|
+
!entity?.values && initialStatus === "existing" && /* @__PURE__ */ jsx(Alert, {
|
|
575
|
+
color: "warning",
|
|
576
|
+
size: "small",
|
|
577
|
+
outerClassName: "w-full mb-4 text-xs",
|
|
578
|
+
children: t("entity_does_not_exist")
|
|
579
|
+
}),
|
|
580
|
+
children,
|
|
581
|
+
initialEntityId && !entity && initialStatus !== "new" && /* @__PURE__ */ jsx(Alert, {
|
|
582
|
+
color: "info",
|
|
583
|
+
size: "small",
|
|
584
|
+
children: t("entity_does_not_exist")
|
|
585
|
+
}),
|
|
586
|
+
hasFormErrors && /* @__PURE__ */ jsx(Alert, {
|
|
587
|
+
color: "error",
|
|
588
|
+
size: "small",
|
|
589
|
+
outerClassName: "w-full mt-2",
|
|
590
|
+
children: t("fix_errors_before_saving")
|
|
591
|
+
}),
|
|
592
|
+
predatingViolationLines.length > 0 && /* @__PURE__ */ jsxs(Alert, {
|
|
593
|
+
color: "warning",
|
|
594
|
+
size: "small",
|
|
595
|
+
outerClassName: "w-full mt-2",
|
|
596
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
597
|
+
variant: "caption",
|
|
598
|
+
component: "div",
|
|
599
|
+
children: t("form_predating_rule_violations")
|
|
600
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
601
|
+
className: "list-disc pl-5 mt-1",
|
|
602
|
+
children: predatingViolationLines.map(({ path: errorPath, label, message }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Typography, {
|
|
603
|
+
variant: "caption",
|
|
604
|
+
children: `${label}: ${message}`
|
|
605
|
+
}) }, errorPath))
|
|
606
|
+
})]
|
|
607
|
+
}),
|
|
608
|
+
formContext && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", {
|
|
609
|
+
ref: formRef,
|
|
610
|
+
children: [formFields(), /* @__PURE__ */ jsx(ErrorFocus, { containerRef: formRef })]
|
|
611
|
+
}) }),
|
|
612
|
+
afterFields,
|
|
613
|
+
/* @__PURE__ */ jsxs(Dialog, {
|
|
614
|
+
open: discardDialogOpen,
|
|
615
|
+
onOpenChange: setDiscardDialogOpen,
|
|
616
|
+
maxWidth: "sm",
|
|
617
|
+
children: [
|
|
618
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: status === "existing" ? "Discard changes?" : "Clear form?" }),
|
|
619
|
+
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsxs(Typography, { children: [status === "existing" ? "All unsaved changes will be lost. " : "All entered values will be cleared. ", "You can bring them back with Undo (⌘Z / Ctrl+Z), or from the notification, for as long as this form stays open."] }) }),
|
|
620
|
+
/* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
|
|
621
|
+
variant: "text",
|
|
622
|
+
onClick: () => setDiscardDialogOpen(false),
|
|
623
|
+
children: "Cancel"
|
|
624
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
625
|
+
variant: "filled",
|
|
626
|
+
color: "error",
|
|
627
|
+
onClick: () => {
|
|
628
|
+
setDiscardDialogOpen(false);
|
|
629
|
+
discard(formex, status, baseInitialValues);
|
|
630
|
+
},
|
|
631
|
+
children: status === "existing" ? "Discard" : "Clear"
|
|
632
|
+
})] })
|
|
633
|
+
]
|
|
634
|
+
})
|
|
635
|
+
] }) });
|
|
636
|
+
useEffect(() => {
|
|
637
|
+
if (entityId && onIdChange) onIdChange(entityId);
|
|
638
|
+
}, [entityId, onIdChange]);
|
|
639
|
+
if (!collection || !path) throw Error("INTERNAL: Collection and path must be defined in form context");
|
|
640
|
+
const dialogActions = /* @__PURE__ */ jsx(EntityFormActionsComponent, {
|
|
641
|
+
collection,
|
|
642
|
+
path,
|
|
643
|
+
entity,
|
|
644
|
+
savingError,
|
|
645
|
+
formex,
|
|
646
|
+
disabled: actionsDisabled,
|
|
647
|
+
status,
|
|
648
|
+
pluginActions: pluginActionsProp ?? [],
|
|
649
|
+
openEntityMode,
|
|
650
|
+
showDefaultActions,
|
|
651
|
+
navigateBack,
|
|
652
|
+
formContext
|
|
653
|
+
});
|
|
654
|
+
return /* @__PURE__ */ jsx(Formex, {
|
|
655
|
+
value: formex,
|
|
656
|
+
children: /* @__PURE__ */ jsx(FormUploadsContext.Provider, {
|
|
657
|
+
value: uploadTracker,
|
|
658
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
659
|
+
ref: formElementRef,
|
|
660
|
+
onSubmit: formex.handleSubmit,
|
|
661
|
+
onReset: (e) => {
|
|
662
|
+
e.preventDefault();
|
|
663
|
+
if (formex.dirty) setDiscardDialogOpen(true);
|
|
664
|
+
else formex.resetForm({ values: baseInitialValues });
|
|
665
|
+
},
|
|
666
|
+
noValidate: true,
|
|
667
|
+
className: cls("@container/form flex-1 flex flex-col w-full min-h-0", className),
|
|
668
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
669
|
+
className: "flex-1 min-h-0 flex flex-row w-full",
|
|
670
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
671
|
+
className: "flex-1 min-w-0 overflow-y-auto flex justify-center items-start",
|
|
672
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
673
|
+
id: `form_${path}`,
|
|
674
|
+
className: cls("@container/col w-full max-w-3xl @7xl/form:max-w-4xl 2xl:max-w-4xl flex flex-col", openEntityMode === "dialog" ? "pt-5 pb-8 px-6 sm:px-8" : "pt-6 pb-12 px-5 sm:px-8"),
|
|
675
|
+
children: [manualApplyLocalChanges && hasLocalChanges && localChangesCacheKey && /* @__PURE__ */ jsx("div", {
|
|
676
|
+
className: "flex justify-end mb-3",
|
|
677
|
+
children: /* @__PURE__ */ jsx(LocalChangesMenu, {
|
|
678
|
+
cacheKey: localChangesCacheKey,
|
|
679
|
+
properties: collection.properties,
|
|
680
|
+
cachedData: localChangesData,
|
|
681
|
+
formex,
|
|
682
|
+
onClearLocalChanges: () => {
|
|
683
|
+
setLocalChangesCleared(true);
|
|
684
|
+
onClearLocalChanges?.();
|
|
685
|
+
}
|
|
686
|
+
})
|
|
687
|
+
}), formView]
|
|
688
|
+
})
|
|
689
|
+
}), showRail && /* @__PURE__ */ jsx(FormRail, {
|
|
690
|
+
fields: layout.sidebar,
|
|
691
|
+
showRecordMeta: layout.showRecordMeta && status === "existing",
|
|
692
|
+
entity,
|
|
693
|
+
renderField
|
|
694
|
+
})]
|
|
695
|
+
}), dialogActions]
|
|
696
|
+
})
|
|
697
|
+
})
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
function useOnAutoSave(autoSave, formex, lastSavedValues, save) {
|
|
701
|
+
useEffect(() => {
|
|
702
|
+
if (!autoSave) return;
|
|
703
|
+
if (formex.values && !deepEqual(formex.values, lastSavedValues.current)) save(formex.values);
|
|
704
|
+
}, [autoSave, formex.values]);
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* A nested error map — the shape `zodToFormErrors` builds — as one line per
|
|
708
|
+
* failing field, labelled with the property's name.
|
|
709
|
+
*/
|
|
710
|
+
function errorLines(errors, properties) {
|
|
711
|
+
const lines = [];
|
|
712
|
+
const walk = (value, path, label, props) => {
|
|
713
|
+
if (typeof value === "string") {
|
|
714
|
+
lines.push({
|
|
715
|
+
path: path.join("."),
|
|
716
|
+
label: label.join(" › "),
|
|
717
|
+
message: value
|
|
718
|
+
});
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
if (!value || typeof value !== "object") return;
|
|
722
|
+
for (const [key, child] of Object.entries(value)) {
|
|
723
|
+
const property = props?.[key];
|
|
724
|
+
const childProps = property?.type === "map" ? property.properties : void 0;
|
|
725
|
+
walk(child, [...path, key], [...label, property?.name ?? key], childProps);
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
walk(errors, [], [], properties);
|
|
729
|
+
return lines;
|
|
730
|
+
}
|
|
731
|
+
//#endregion
|
|
732
|
+
export { EntityForm };
|
|
733
|
+
|
|
734
|
+
//# sourceMappingURL=EntityForm.js.map
|