@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
|
@@ -15,6 +15,26 @@ interface PropertyContext<P extends Property> {
|
|
|
15
15
|
customFieldValidator?: CustomFieldValidator;
|
|
16
16
|
name?: string;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* `validation.unique`, for the top-level properties that declare it: whether
|
|
20
|
+
* another record already holds the value, asked of the data source through
|
|
21
|
+
* `validator`. One error per field that fails, keyed like the schema's.
|
|
22
|
+
*
|
|
23
|
+
* Asked only for a value worth asking about — set (not empty), changed from
|
|
24
|
+
* `storedValues` when there are any (a value the edit left alone is the stored
|
|
25
|
+
* record's business, and it may predate the rule), and without an error of its
|
|
26
|
+
* own already in `errors` — so a save makes one lookup per unique field it
|
|
27
|
+
* actually changes, and typing makes none: this runs where validation runs, on
|
|
28
|
+
* submit.
|
|
29
|
+
*/
|
|
30
|
+
export declare function uniqueValueErrors({ properties, values, storedValues, entityId, errors, validator }: {
|
|
31
|
+
properties: Properties;
|
|
32
|
+
values: Record<string, unknown>;
|
|
33
|
+
storedValues?: Record<string, unknown>;
|
|
34
|
+
entityId?: string | number;
|
|
35
|
+
errors?: Record<string, unknown>;
|
|
36
|
+
validator: CustomFieldValidator;
|
|
37
|
+
}): Promise<Record<string, string>>;
|
|
18
38
|
export declare function getEntitySchema<M extends Record<string, unknown>>(entityId: string | number | undefined, properties: Properties, customFieldValidator?: CustomFieldValidator): z.ZodObject<Record<string, ZodTypeAny>>;
|
|
19
39
|
export declare function mapPropertyToZod(propertyContext: PropertyContext<Property>): ZodTypeAny;
|
|
20
40
|
export declare function getZodMapObjectSchema({ property, entityId, customFieldValidator, name }: PropertyContext<MapProperty>): ZodTypeAny;
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import { deepEqual } from "fast-equals";
|
|
2
|
+
import { DEFAULT_ONE_OF_TYPE, DEFAULT_ONE_OF_VALUE, enumToObjectEntries, isPropertyBuilder } from "@rebasepro/common";
|
|
3
|
+
import { hydrateRegExp, isPlainObject, prettifyIdentifier } from "@rebasepro/utils";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/form/validation.ts
|
|
6
|
+
/** Whether an authored relation yields many rows. Derived from its kind. */
|
|
7
|
+
/**
|
|
8
|
+
* What to call this field in a validation message.
|
|
9
|
+
*
|
|
10
|
+
* `property.name` is the author's label and is optional — a headless project has
|
|
11
|
+
* no panel and no reason to invent display names. Every message here
|
|
12
|
+
* interpolated it directly, so an unnamed property produced
|
|
13
|
+
* "undefined must be min 3 characters long" in front of a user.
|
|
14
|
+
*
|
|
15
|
+
* The fallback is the field's own key, prettified the same way the panel derives
|
|
16
|
+
* a column header, so the message names the field the author would recognise.
|
|
17
|
+
*/
|
|
18
|
+
function fieldLabel(property, name) {
|
|
19
|
+
return property.name ?? (name ? prettifyIdentifier(name) : "This field");
|
|
20
|
+
}
|
|
21
|
+
function relationCardinality(relation) {
|
|
22
|
+
if (!relation) return void 0;
|
|
23
|
+
if (relation.kind === "via") return relation.cardinality;
|
|
24
|
+
if (relation.kind === "hasMany" || relation.kind === "manyToMany") return "many";
|
|
25
|
+
if (relation.kind === "belongsTo" || relation.kind === "hasOne") return "one";
|
|
26
|
+
return relation.cardinality;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* `validation.unique`, for the top-level properties that declare it: whether
|
|
30
|
+
* another record already holds the value, asked of the data source through
|
|
31
|
+
* `validator`. One error per field that fails, keyed like the schema's.
|
|
32
|
+
*
|
|
33
|
+
* Asked only for a value worth asking about — set (not empty), changed from
|
|
34
|
+
* `storedValues` when there are any (a value the edit left alone is the stored
|
|
35
|
+
* record's business, and it may predate the rule), and without an error of its
|
|
36
|
+
* own already in `errors` — so a save makes one lookup per unique field it
|
|
37
|
+
* actually changes, and typing makes none: this runs where validation runs, on
|
|
38
|
+
* submit.
|
|
39
|
+
*/
|
|
40
|
+
async function uniqueValueErrors({ properties, values, storedValues, entityId, errors, validator }) {
|
|
41
|
+
const found = {};
|
|
42
|
+
await Promise.all(Object.entries(properties).map(async ([name, property]) => {
|
|
43
|
+
if (!property?.validation?.unique) return;
|
|
44
|
+
if (errors && name in errors) return;
|
|
45
|
+
const value = values[name];
|
|
46
|
+
if (value === void 0 || value === null || value === "") return;
|
|
47
|
+
if (storedValues && deepEqual(value, storedValues[name])) return;
|
|
48
|
+
if (!await validator({
|
|
49
|
+
name,
|
|
50
|
+
value,
|
|
51
|
+
property,
|
|
52
|
+
entityId
|
|
53
|
+
})) found[name] = `${fieldLabel(property, name)} must be unique: another record already has this value`;
|
|
54
|
+
}));
|
|
55
|
+
return found;
|
|
56
|
+
}
|
|
57
|
+
function getEntitySchema(entityId, properties, customFieldValidator) {
|
|
58
|
+
const shape = {};
|
|
59
|
+
Object.entries(properties).forEach(([name, property]) => {
|
|
60
|
+
const isIdAndAuto = (property.type === "string" || property.type === "number") && "isId" in property && typeof property.isId === "string" && property.isId !== "manual";
|
|
61
|
+
if (entityId === void 0 && isIdAndAuto) return;
|
|
62
|
+
shape[name] = mapPropertyToZod({
|
|
63
|
+
property,
|
|
64
|
+
customFieldValidator,
|
|
65
|
+
name,
|
|
66
|
+
entityId
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
return z.object(shape).passthrough();
|
|
70
|
+
}
|
|
71
|
+
function mapPropertyToZod(propertyContext) {
|
|
72
|
+
const property = propertyContext.property;
|
|
73
|
+
if (isPropertyBuilder(property) && !property.type) {
|
|
74
|
+
console.error("Error in property", propertyContext);
|
|
75
|
+
return z.any().refine(() => false, { message: "Invalid property configuration: property builder should be resolved" });
|
|
76
|
+
}
|
|
77
|
+
if (property.type === "string") return getZodStringSchema(propertyContext);
|
|
78
|
+
else if (property.type === "number") return getZodNumberSchema(propertyContext);
|
|
79
|
+
else if (property.type === "boolean") return getZodBooleanSchema(propertyContext);
|
|
80
|
+
else if (property.type === "map") return getZodMapObjectSchema(propertyContext);
|
|
81
|
+
else if (property.type === "array") return getZodArraySchema(propertyContext);
|
|
82
|
+
else if (property.type === "date") return getZodDateSchema(propertyContext);
|
|
83
|
+
else if (property.type === "geopoint") return getZodGeoPointSchema(propertyContext);
|
|
84
|
+
else if (property.type === "reference") return getZodReferenceSchema(propertyContext);
|
|
85
|
+
else if (property.type === "relation") return getZodRelationSchema(propertyContext);
|
|
86
|
+
else if (property.type === "vector") return getZodVectorSchema(propertyContext);
|
|
87
|
+
else if (property.type === "binary") return getZodBinarySchema(propertyContext);
|
|
88
|
+
console.error("Unsupported data type in zod mapping", property);
|
|
89
|
+
const dataType = "dataType" in property ? String(property.dataType) : "unknown";
|
|
90
|
+
return z.any().refine(() => false, { message: `Unsupported data type: ${dataType}` });
|
|
91
|
+
}
|
|
92
|
+
function getZodMapObjectSchema({ property, entityId, customFieldValidator, name }) {
|
|
93
|
+
const shape = {};
|
|
94
|
+
const validation = property.validation;
|
|
95
|
+
if (property.properties) Object.entries(property.properties).forEach(([childName, childProperty]) => {
|
|
96
|
+
const typedChildProperty = childProperty;
|
|
97
|
+
try {
|
|
98
|
+
shape[childName] = mapPropertyToZod({
|
|
99
|
+
property: typedChildProperty,
|
|
100
|
+
parentProperty: property,
|
|
101
|
+
customFieldValidator,
|
|
102
|
+
name: `${name}[${childName}]`,
|
|
103
|
+
entityId
|
|
104
|
+
});
|
|
105
|
+
} catch (e) {
|
|
106
|
+
console.error(`Error creating validation schema for property ${childName}:`, e);
|
|
107
|
+
shape[childName] = z.any().refine(() => false, { message: `Validation error: ${e instanceof Error ? e.message : "Unknown error"}` });
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
let schema = z.object(shape).passthrough();
|
|
111
|
+
if (validation?.required) schema = schema.nullable().optional().refine((value) => value !== void 0, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
112
|
+
else schema = schema.nullable().optional();
|
|
113
|
+
return schema;
|
|
114
|
+
}
|
|
115
|
+
function getZodStringSchema({ property, parentProperty, customFieldValidator, name, entityId }) {
|
|
116
|
+
let schema = z.string().nullable().optional();
|
|
117
|
+
const validation = property.validation;
|
|
118
|
+
const isRequired = validation?.required || property.isId === true || property.isId === "manual";
|
|
119
|
+
if (property.enum) {
|
|
120
|
+
if (isRequired) schema = z.string().nullable().optional().refine((value) => value !== void 0 && value !== null && value !== "", { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
121
|
+
const entries = enumToObjectEntries(property.enum);
|
|
122
|
+
const allowedValues = (isRequired ? entries : [...entries, null]).map((enumValueConfig) => enumValueConfig?.id ?? null);
|
|
123
|
+
schema = schema.refine((value) => allowedValues.includes(value), { message: `Must be one of: ${allowedValues.filter(Boolean).join(", ")}` });
|
|
124
|
+
}
|
|
125
|
+
if (isRequired && !property.enum) schema = schema.refine((value) => value !== void 0 && value !== null && value !== "", { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
126
|
+
if (validation) {
|
|
127
|
+
if (validation.min || validation.min === 0) schema = schema.refine((value) => value == null || typeof value === "string" && value.length >= validation.min, { message: `${fieldLabel(property, name)} must be min ${validation.min} characters long` });
|
|
128
|
+
if (validation.max || validation.max === 0) schema = schema.refine((value) => value == null || typeof value === "string" && value.length <= validation.max, { message: `${fieldLabel(property, name)} must be max ${validation.max} characters long` });
|
|
129
|
+
if (validation.matches) {
|
|
130
|
+
const regExp = typeof validation.matches === "string" ? hydrateRegExp(validation.matches) : validation.matches;
|
|
131
|
+
if (regExp) schema = schema.refine((value) => value == null || typeof value === "string" && regExp.test(value), { message: validation.matchesMessage ?? "Invalid format" });
|
|
132
|
+
}
|
|
133
|
+
if (validation.length !== void 0) schema = schema.refine((value) => value == null || typeof value === "string" && value.length === validation.length, { message: `${fieldLabel(property, name)} must be exactly ${validation.length} characters long` });
|
|
134
|
+
if (validation.trim || validation.lowercase || validation.uppercase) schema = z.preprocess((v) => typeof v === "string" ? transformString(v, validation) : v, schema);
|
|
135
|
+
}
|
|
136
|
+
if (property.email) schema = schema.refine((value) => value == null || value === "" || typeof value === "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value), { message: `${fieldLabel(property, name)} must be an email` });
|
|
137
|
+
if (property.url) if (!property.storage || property.storage?.storeUrl) schema = schema.refine((value) => {
|
|
138
|
+
if (value == null || value === "") return true;
|
|
139
|
+
try {
|
|
140
|
+
new URL(value);
|
|
141
|
+
return true;
|
|
142
|
+
} catch {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
}, { message: `${fieldLabel(property, name)} must be a url` });
|
|
146
|
+
else console.warn(`Property ${fieldLabel(property, name)} has a url validation but its storage configuration is not set to store urls`);
|
|
147
|
+
return schema;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* A string's declared transforms — `trim`, `lowercase`, `uppercase` — applied.
|
|
151
|
+
* The one definition of them: validation judges its result, and
|
|
152
|
+
* {@link applyValueTransforms} writes it.
|
|
153
|
+
*/
|
|
154
|
+
function transformString(value, validation) {
|
|
155
|
+
let result = value;
|
|
156
|
+
if (validation.trim) result = result.trim();
|
|
157
|
+
if (validation.lowercase) result = result.toLowerCase();
|
|
158
|
+
if (validation.uppercase) result = result.toUpperCase();
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The values as they are to be written: every `trim`, `lowercase` and
|
|
163
|
+
* `uppercase` a string property declares applied to its value, inside maps and
|
|
164
|
+
* arrays too.
|
|
165
|
+
*
|
|
166
|
+
* They are documented as changing the value that is written, and only the
|
|
167
|
+
* panel applies them — the server checks what it receives. Validation judges
|
|
168
|
+
* the transformed value, so without this the form passed "my-slug" and sent
|
|
169
|
+
* " My-Slug ", which a `matches` on the server then refused.
|
|
170
|
+
*
|
|
171
|
+
* Returns `values` itself when nothing changes.
|
|
172
|
+
*/
|
|
173
|
+
function applyValueTransforms(values, properties) {
|
|
174
|
+
let result = values;
|
|
175
|
+
for (const [key, property] of Object.entries(properties)) {
|
|
176
|
+
if (!(key in values)) continue;
|
|
177
|
+
const transformed = transformValue(property, values[key]);
|
|
178
|
+
if (transformed !== values[key]) result = {
|
|
179
|
+
...result,
|
|
180
|
+
[key]: transformed
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
return result;
|
|
184
|
+
}
|
|
185
|
+
function transformValue(property, value) {
|
|
186
|
+
if (!property || typeof property !== "object") return value;
|
|
187
|
+
if (property.type === "string") return typeof value === "string" && property.validation ? transformString(value, property.validation) : value;
|
|
188
|
+
if (property.type === "map" && property.properties && isPlainObject(value)) return applyValueTransforms(value, property.properties);
|
|
189
|
+
if (property.type === "array" && property.of && Array.isArray(value)) {
|
|
190
|
+
const of = property.of;
|
|
191
|
+
const items = value.map((item, index) => {
|
|
192
|
+
const itemProperty = Array.isArray(of) ? of[index] : of;
|
|
193
|
+
return itemProperty ? transformValue(itemProperty, item) : item;
|
|
194
|
+
});
|
|
195
|
+
return items.some((item, index) => item !== value[index]) ? items : value;
|
|
196
|
+
}
|
|
197
|
+
return value;
|
|
198
|
+
}
|
|
199
|
+
function getZodNumberSchema({ property, parentProperty, customFieldValidator, name, entityId }) {
|
|
200
|
+
const validation = property.validation;
|
|
201
|
+
let schema = z.preprocess((val) => {
|
|
202
|
+
if (val === null || val === void 0) return null;
|
|
203
|
+
if (typeof val === "number") return val;
|
|
204
|
+
const n = Number(val);
|
|
205
|
+
return isNaN(n) ? val : n;
|
|
206
|
+
}, z.number({ error: "Must be a number" }).nullable());
|
|
207
|
+
if (validation?.required || property.isId === true || property.isId === "manual") schema = schema.refine((value) => value !== void 0 && value !== null, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
208
|
+
if (validation) {
|
|
209
|
+
if (validation.min || validation.min === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value >= validation.min, { message: `${fieldLabel(property, name)} must be higher or equal to ${validation.min}` });
|
|
210
|
+
if (validation.max || validation.max === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value <= validation.max, { message: `${fieldLabel(property, name)} must be lower or equal to ${validation.max}` });
|
|
211
|
+
if (validation.lessThan || validation.lessThan === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value < validation.lessThan, { message: `${fieldLabel(property, name)} must be lower than ${validation.lessThan}` });
|
|
212
|
+
if (validation.moreThan || validation.moreThan === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value > validation.moreThan, { message: `${fieldLabel(property, name)} must be higher than ${validation.moreThan}` });
|
|
213
|
+
if (validation.positive) schema = schema.refine((value) => value == null || typeof value === "number" && value > 0, { message: `${fieldLabel(property, name)} must be positive` });
|
|
214
|
+
if (validation.negative) schema = schema.refine((value) => value == null || typeof value === "number" && value < 0, { message: `${fieldLabel(property, name)} must be negative` });
|
|
215
|
+
}
|
|
216
|
+
if (validation?.integer || isIntegerColumn(property.columnType)) schema = schema.refine((value) => value == null || typeof value === "number" && Number.isInteger(value), { message: `${fieldLabel(property, name)} must be an integer` });
|
|
217
|
+
return schema;
|
|
218
|
+
}
|
|
219
|
+
function getZodGeoPointSchema({ property, parentProperty, customFieldValidator, name, entityId }) {
|
|
220
|
+
const coordinate = (value, axis) => {
|
|
221
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
222
|
+
const n = value[axis];
|
|
223
|
+
return typeof n === "number" ? n : void 0;
|
|
224
|
+
};
|
|
225
|
+
let schema = z.object({}).passthrough().nullable().optional().refine((value) => Math.abs(coordinate(value, "latitude") ?? 0) <= 90, { message: "Latitude must be between -90 and 90" }).refine((value) => Math.abs(coordinate(value, "longitude") ?? 0) <= 180, { message: "Longitude must be between -180 and 180" });
|
|
226
|
+
const validation = property.validation;
|
|
227
|
+
if (validation?.required) schema = schema.refine((value) => value !== void 0 && value !== null, { message: validation.requiredMessage ? validation.requiredMessage : "Required" });
|
|
228
|
+
return schema;
|
|
229
|
+
}
|
|
230
|
+
function getZodDateSchema({ property, parentProperty, customFieldValidator, name, entityId }) {
|
|
231
|
+
if (property.autoValue) return z.date().nullable().optional();
|
|
232
|
+
let schema = z.custom((v) => v === null || v === void 0 || v instanceof Date, { message: "Expected a Date" }).optional();
|
|
233
|
+
const validation = property.validation;
|
|
234
|
+
if (validation) {
|
|
235
|
+
if (validation.required) schema = schema.refine((value) => value !== void 0 && value !== null, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
236
|
+
if (validation.min) schema = schema.refine((value) => value == null || value instanceof Date && value >= validation.min, { message: `${fieldLabel(property, name)} must not be before ${formatDateBound(validation.min, property.columnType)}` });
|
|
237
|
+
if (validation.max) schema = schema.refine((value) => value == null || value instanceof Date && value <= validation.max, { message: `${fieldLabel(property, name)} must not be after ${formatDateBound(validation.max, property.columnType)}` });
|
|
238
|
+
}
|
|
239
|
+
return schema;
|
|
240
|
+
}
|
|
241
|
+
function getZodReferenceSchema({ property, parentProperty, customFieldValidator, name, entityId }) {
|
|
242
|
+
let schema = z.object({}).passthrough().nullable().optional();
|
|
243
|
+
const validation = property.validation;
|
|
244
|
+
if (validation) {
|
|
245
|
+
if (validation.required) schema = schema.refine((value) => value !== void 0 && value !== null, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
246
|
+
}
|
|
247
|
+
return schema;
|
|
248
|
+
}
|
|
249
|
+
function getZodRelationSchema({ property, parentProperty, customFieldValidator, name, entityId }) {
|
|
250
|
+
const isMany = relationCardinality(property.relation) === "many";
|
|
251
|
+
let schema = isMany ? z.array(z.object({}).passthrough()).nullable().optional() : z.object({}).passthrough().nullable().optional();
|
|
252
|
+
const validation = property.validation;
|
|
253
|
+
if (validation) {
|
|
254
|
+
if (validation.required) schema = schema.refine((value) => {
|
|
255
|
+
if (isMany) return value !== void 0 && value !== null && Array.isArray(value) && value.length > 0;
|
|
256
|
+
return value !== void 0 && value !== null;
|
|
257
|
+
}, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
258
|
+
}
|
|
259
|
+
return schema;
|
|
260
|
+
}
|
|
261
|
+
function getZodBooleanSchema({ property, parentProperty, customFieldValidator, name, entityId }) {
|
|
262
|
+
let schema = z.boolean().nullable().optional();
|
|
263
|
+
const validation = property.validation;
|
|
264
|
+
if (validation) {
|
|
265
|
+
if (validation.required) schema = schema.refine((value) => value !== void 0 && value !== null, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
266
|
+
}
|
|
267
|
+
return schema;
|
|
268
|
+
}
|
|
269
|
+
/** The Postgres number column types that hold whole numbers only. */
|
|
270
|
+
function isIntegerColumn(columnType) {
|
|
271
|
+
return columnType === "integer" || columnType === "bigint" || columnType === "serial" || columnType === "bigserial";
|
|
272
|
+
}
|
|
273
|
+
/** A date bound as a reader writes it: the day for a date column, else an ISO instant. */
|
|
274
|
+
function formatDateBound(bound, columnType) {
|
|
275
|
+
const date = bound instanceof Date ? bound : new Date(bound);
|
|
276
|
+
if (Number.isNaN(date.getTime())) return String(bound);
|
|
277
|
+
return columnType === "date" ? date.toISOString().slice(0, 10) : date.toISOString();
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* What `uniqueInArray` compares an item by. Relations and references are
|
|
281
|
+
* objects built per read, so comparing them by identity never found the same
|
|
282
|
+
* row linked twice; they compare by the row they point at.
|
|
283
|
+
*/
|
|
284
|
+
function uniqueInArrayKey(value) {
|
|
285
|
+
if (value instanceof Date) return `date:${value.getTime()}`;
|
|
286
|
+
if (typeof value === "object" && value !== null && "id" in value) {
|
|
287
|
+
const { id, path } = value;
|
|
288
|
+
if (typeof id === "string" || typeof id === "number") return `row:${typeof path === "string" ? path : ""}:${String(id)}`;
|
|
289
|
+
}
|
|
290
|
+
return value;
|
|
291
|
+
}
|
|
292
|
+
function hasUniqueInArrayModifier(property) {
|
|
293
|
+
if (property.validation?.uniqueInArray) return true;
|
|
294
|
+
else if (property.type === "map" && property.properties) return Object.entries(property.properties).filter(([key, childProperty]) => childProperty.validation?.uniqueInArray);
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
function getZodArraySchema({ property, parentProperty, customFieldValidator, name, entityId }) {
|
|
298
|
+
let arraySchema = z.array(z.any()).nullable().optional();
|
|
299
|
+
if (!property.of && property.oneOf?.properties) {
|
|
300
|
+
const typeField = property.oneOf.typeField ?? DEFAULT_ONE_OF_TYPE;
|
|
301
|
+
const valueField = property.oneOf.valueField ?? DEFAULT_ONE_OF_VALUE;
|
|
302
|
+
const blockProperties = property.oneOf.properties;
|
|
303
|
+
const blockSchemas = /* @__PURE__ */ new Map();
|
|
304
|
+
const schemaFor = (type) => {
|
|
305
|
+
if (!Object.prototype.hasOwnProperty.call(blockProperties, type)) return void 0;
|
|
306
|
+
const blockProperty = blockProperties[type];
|
|
307
|
+
if (!blockProperty || isPropertyBuilder(blockProperty)) return void 0;
|
|
308
|
+
let schema = blockSchemas.get(type);
|
|
309
|
+
if (!schema) {
|
|
310
|
+
schema = mapPropertyToZod({
|
|
311
|
+
property: blockProperty,
|
|
312
|
+
parentProperty: property,
|
|
313
|
+
entityId,
|
|
314
|
+
name: type
|
|
315
|
+
});
|
|
316
|
+
blockSchemas.set(type, schema);
|
|
317
|
+
}
|
|
318
|
+
return schema;
|
|
319
|
+
};
|
|
320
|
+
arraySchema = z.array(z.any()).superRefine(async (items, ctx) => {
|
|
321
|
+
for (let index = 0; index < items.length; index++) {
|
|
322
|
+
const item = items[index];
|
|
323
|
+
if (!isPlainObject(item)) continue;
|
|
324
|
+
const type = item[typeField];
|
|
325
|
+
if (typeof type !== "string") continue;
|
|
326
|
+
const schema = schemaFor(type);
|
|
327
|
+
if (!schema) continue;
|
|
328
|
+
const result = await schema.safeParseAsync(item[valueField]);
|
|
329
|
+
if (!result.success) result.error.issues.forEach((issue) => {
|
|
330
|
+
ctx.addIssue({
|
|
331
|
+
code: "custom",
|
|
332
|
+
message: issue.message,
|
|
333
|
+
path: [
|
|
334
|
+
index,
|
|
335
|
+
valueField,
|
|
336
|
+
...issue.path
|
|
337
|
+
]
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}).nullable().optional();
|
|
342
|
+
}
|
|
343
|
+
if (property.of) if (Array.isArray(property.of)) {
|
|
344
|
+
const positionSchemas = property.of.map((p, index) => {
|
|
345
|
+
try {
|
|
346
|
+
return mapPropertyToZod({
|
|
347
|
+
property: p,
|
|
348
|
+
parentProperty: property,
|
|
349
|
+
entityId
|
|
350
|
+
});
|
|
351
|
+
} catch (e) {
|
|
352
|
+
console.error(`Error creating validation schema for array item ${index}:`, e);
|
|
353
|
+
return z.any().refine(() => false, { message: `Validation error: ${e instanceof Error ? e.message : "Unknown error"}` });
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
arraySchema = z.array(z.any()).superRefine(async (items, ctx) => {
|
|
357
|
+
for (let index = 0; index < items.length && index < positionSchemas.length; index++) {
|
|
358
|
+
const result = await positionSchemas[index].safeParseAsync(items[index]);
|
|
359
|
+
if (!result.success) result.error.issues.forEach((issue) => {
|
|
360
|
+
ctx.addIssue({
|
|
361
|
+
code: "custom",
|
|
362
|
+
message: issue.message,
|
|
363
|
+
path: [index, ...issue.path]
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
}).nullable().optional();
|
|
368
|
+
} else {
|
|
369
|
+
try {
|
|
370
|
+
const ofSchema = mapPropertyToZod({
|
|
371
|
+
property: property.of,
|
|
372
|
+
parentProperty: property,
|
|
373
|
+
entityId
|
|
374
|
+
});
|
|
375
|
+
arraySchema = z.array(ofSchema).nullable().optional();
|
|
376
|
+
} catch (e) {
|
|
377
|
+
console.error("Error creating validation schema for array of property:", e);
|
|
378
|
+
arraySchema = z.array(z.any().refine(() => false, { message: `Validation error: ${e instanceof Error ? e.message : "Unknown error"}` })).nullable().optional();
|
|
379
|
+
}
|
|
380
|
+
const arrayUniqueFields = hasUniqueInArrayModifier(property.of);
|
|
381
|
+
if (arrayUniqueFields) {
|
|
382
|
+
if (typeof arrayUniqueFields === "boolean") arraySchema = arraySchema.refine((values) => !values || !Array.isArray(values) || values.length === new Set(values.map(uniqueInArrayKey)).size, { message: `${fieldLabel(property, name)} should have unique values within the array` });
|
|
383
|
+
else if (Array.isArray(arrayUniqueFields)) arrayUniqueFields.forEach(([fieldName, childProperty]) => {
|
|
384
|
+
arraySchema = arraySchema.refine((values) => !values || !Array.isArray(values) || values.length === new Set(values.map((v) => uniqueInArrayKey(v && typeof v === "object" ? v[fieldName] : v))).size, { message: `${fieldLabel(property, name)} → ${childProperty.name ?? fieldName}: should have unique values within the array` });
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
const validation = property.validation;
|
|
389
|
+
if (validation) {
|
|
390
|
+
if (validation.required) arraySchema = arraySchema.refine((value) => value !== void 0 && value !== null && Array.isArray(value) && value.length > 0, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
391
|
+
if (validation.min || validation.min === 0) arraySchema = arraySchema.refine((value) => !value || !Array.isArray(value) || value.length >= validation.min, { message: `${fieldLabel(property, name)} should be min ${validation.min} entries long` });
|
|
392
|
+
if (validation.max) arraySchema = arraySchema.refine((value) => !value || !Array.isArray(value) || value.length <= validation.max, { message: `${fieldLabel(property, name)} should be max ${validation.max} entries long` });
|
|
393
|
+
if (validation.uniqueInArray) arraySchema = arraySchema.refine((values) => !values || !Array.isArray(values) || values.length === new Set(values.map(uniqueInArrayKey)).size, { message: `${fieldLabel(property, name)} should have unique values within the array` });
|
|
394
|
+
}
|
|
395
|
+
return arraySchema;
|
|
396
|
+
}
|
|
397
|
+
function getZodVectorSchema({ property }) {
|
|
398
|
+
let schema = z.preprocess((val) => {
|
|
399
|
+
if (val && typeof val === "object" && "__type" in val && val.__type === "Vector") return val.value;
|
|
400
|
+
if (val && typeof val === "object" && "value" in val && Array.isArray(val.value)) return val.value;
|
|
401
|
+
return val;
|
|
402
|
+
}, z.array(z.number()).nullable().optional());
|
|
403
|
+
if (property.dimensions) schema = schema.refine((val) => val === null || val === void 0 || Array.isArray(val) && val.length === property.dimensions, { message: `${property.name ?? "Vector"} must have exactly ${property.dimensions} dimensions` });
|
|
404
|
+
if (property.validation?.required) schema = schema.refine((val) => val !== null && val !== void 0 && Array.isArray(val) && val.length > 0, { message: property.validation?.requiredMessage ?? "Required" });
|
|
405
|
+
return schema;
|
|
406
|
+
}
|
|
407
|
+
function getZodBinarySchema({ property }) {
|
|
408
|
+
let schema = z.string().nullable().optional();
|
|
409
|
+
const validation = property.validation;
|
|
410
|
+
if (validation?.required) schema = schema.nullable().optional().refine((value) => value !== void 0 && value !== null && value !== "", { message: validation.requiredMessage ? validation.requiredMessage : "Required" });
|
|
411
|
+
return schema;
|
|
412
|
+
}
|
|
413
|
+
//#endregion
|
|
414
|
+
export { applyValueTransforms, getEntitySchema, getZodMapObjectSchema, mapPropertyToZod, uniqueValueErrors };
|
|
415
|
+
|
|
416
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","names":[],"sources":["../../src/form/validation.ts"],"sourcesContent":["import type { Properties } from \"@rebasepro/types\";\nimport type { ArrayProperty, MapProperty, NumberProperty, Property, BooleanProperty, DateProperty, GeopointProperty, ReferenceProperty, RelationProperty, StringProperty, StringPropertyValidationSchema, VectorProperty, BinaryProperty } from \"@rebasepro/types\";\n;\nimport { z, ZodTypeAny } from \"zod\";\nimport { deepEqual as isDeepEqual } from \"fast-equals\";\nimport { DEFAULT_ONE_OF_TYPE, DEFAULT_ONE_OF_VALUE, enumToObjectEntries, isPropertyBuilder } from \"@rebasepro/common\";\nimport { getValueInPath, hydrateRegExp, isPlainObject, prettifyIdentifier } from \"@rebasepro/utils\";\n\n/** Whether an authored relation yields many rows. Derived from its kind. */\n/**\n * What to call this field in a validation message.\n *\n * `property.name` is the author's label and is optional — a headless project has\n * no panel and no reason to invent display names. Every message here\n * interpolated it directly, so an unnamed property produced\n * \"undefined must be min 3 characters long\" in front of a user.\n *\n * The fallback is the field's own key, prettified the same way the panel derives\n * a column header, so the message names the field the author would recognise.\n */\nfunction fieldLabel(property: Property, name?: string): string {\n return property.name ?? (name ? prettifyIdentifier(name) : \"This field\");\n}\n\nfunction relationCardinality(relation: { kind?: string; cardinality?: string } | undefined): \"one\" | \"many\" | undefined {\n if (!relation) return undefined;\n if (relation.kind === \"via\") return relation.cardinality as \"one\" | \"many\" | undefined;\n if (relation.kind === \"hasMany\" || relation.kind === \"manyToMany\") return \"many\";\n if (relation.kind === \"belongsTo\" || relation.kind === \"hasOne\") return \"one\";\n return relation.cardinality as \"one\" | \"many\" | undefined;\n}\n\n\nexport type CustomFieldValidator = (props: {\n name: string,\n value: unknown,\n property: Property,\n entityId?: string | number,\n parentProperty?: MapProperty | ArrayProperty,\n}) => Promise<boolean>;\n\ninterface PropertyContext<P extends Property> {\n property: P,\n parentProperty?: MapProperty | ArrayProperty,\n entityId?: string | number,\n customFieldValidator?: CustomFieldValidator,\n name?: string\n}\n\n/**\n * `validation.unique`, for the top-level properties that declare it: whether\n * another record already holds the value, asked of the data source through\n * `validator`. One error per field that fails, keyed like the schema's.\n *\n * Asked only for a value worth asking about — set (not empty), changed from\n * `storedValues` when there are any (a value the edit left alone is the stored\n * record's business, and it may predate the rule), and without an error of its\n * own already in `errors` — so a save makes one lookup per unique field it\n * actually changes, and typing makes none: this runs where validation runs, on\n * submit.\n */\nexport async function uniqueValueErrors({\n properties,\n values,\n storedValues,\n entityId,\n errors,\n validator\n}: {\n properties: Properties,\n values: Record<string, unknown>,\n storedValues?: Record<string, unknown>,\n entityId?: string | number,\n errors?: Record<string, unknown>,\n validator: CustomFieldValidator\n}): Promise<Record<string, string>> {\n const found: Record<string, string> = {};\n await Promise.all(Object.entries(properties as Record<string, Property>).map(async ([name, property]) => {\n if (!property?.validation?.unique) return;\n if (errors && name in errors) return;\n const value = values[name];\n if (value === undefined || value === null || value === \"\") return;\n if (storedValues && isDeepEqual(value, storedValues[name])) return;\n const unique = await validator({ name, value, property, entityId });\n if (!unique) found[name] = `${fieldLabel(property, name)} must be unique: another record already has this value`;\n }));\n return found;\n}\n\nexport function getEntitySchema<M extends Record<string, unknown>>(\n entityId: string | number | undefined,\n properties: Properties,\n customFieldValidator?: CustomFieldValidator): z.ZodObject<Record<string, ZodTypeAny>> {\n const shape: Record<string, ZodTypeAny> = {};\n Object.entries(properties as Record<string, Property>)\n .forEach(([name, property]) => {\n const isStringOrNumber = property.type === \"string\" || property.type === \"number\";\n const isIdAndAuto = isStringOrNumber && \"isId\" in property && typeof property.isId === \"string\" && property.isId !== \"manual\";\n if (entityId === undefined && isIdAndAuto) {\n return; // Skip validation for auto-generated IDs on new entities\n }\n shape[name] = mapPropertyToZod({\n property: property as Property,\n customFieldValidator,\n name,\n entityId\n });\n });\n return z.object(shape).passthrough();\n}\n\n\nexport function mapPropertyToZod(propertyContext: PropertyContext<Property>): ZodTypeAny {\n\n const property = propertyContext.property;\n if (isPropertyBuilder(property) && !property.type) {\n console.error(\"Error in property\", propertyContext);\n // Return a schema that always fails\n return z.any().refine(\n () => false,\n { message: \"Invalid property configuration: property builder should be resolved\" }\n );\n }\n\n if (property.type === \"string\") {\n return getZodStringSchema(propertyContext as PropertyContext<StringProperty>);\n } else if (property.type === \"number\") {\n return getZodNumberSchema(propertyContext as PropertyContext<NumberProperty>);\n } else if (property.type === \"boolean\") {\n return getZodBooleanSchema(propertyContext as PropertyContext<BooleanProperty>);\n } else if (property.type === \"map\") {\n return getZodMapObjectSchema(propertyContext as PropertyContext<MapProperty>);\n } else if (property.type === \"array\") {\n return getZodArraySchema(propertyContext as PropertyContext<ArrayProperty>);\n } else if (property.type === \"date\") {\n return getZodDateSchema(propertyContext as PropertyContext<DateProperty>);\n } else if (property.type === \"geopoint\") {\n return getZodGeoPointSchema(propertyContext as PropertyContext<GeopointProperty>);\n } else if (property.type === \"reference\") {\n return getZodReferenceSchema(propertyContext as PropertyContext<ReferenceProperty>);\n } else if (property.type === \"relation\") {\n return getZodRelationSchema(propertyContext as PropertyContext<RelationProperty>);\n } else if (property.type === \"vector\") {\n return getZodVectorSchema(propertyContext as PropertyContext<VectorProperty>);\n } else if (property.type === \"binary\") {\n return getZodBinarySchema(propertyContext as PropertyContext<BinaryProperty>);\n }\n\n // Log the error but don't crash the form\n console.error(\"Unsupported data type in zod mapping\", property);\n const dataType = \"dataType\" in (property as Record<string, unknown>) ? String((property as Record<string, unknown>).dataType) : \"unknown\";\n return z.any().refine(\n () => false,\n { message: `Unsupported data type: ${dataType}` }\n );\n}\n\n\nexport function getZodMapObjectSchema({\n property,\n entityId,\n customFieldValidator,\n name\n}: PropertyContext<MapProperty>): ZodTypeAny {\n const shape: Record<string, ZodTypeAny> = {};\n const validation = property.validation;\n if (property.properties)\n Object.entries(property.properties).forEach(([childName, childProperty]) => {\n const typedChildProperty = childProperty as Readonly<Property>;\n try {\n shape[childName] = mapPropertyToZod({\n property: typedChildProperty,\n parentProperty: property as MapProperty,\n customFieldValidator,\n name: `${name}[${childName}]`,\n entityId\n });\n } catch (e: unknown) {\n console.error(`Error creating validation schema for property ${childName}:`, e);\n shape[childName] = z.any().refine(\n () => false,\n { message: `Validation error: ${e instanceof Error ? e.message : \"Unknown error\"}` }\n );\n }\n });\n\n let schema: ZodTypeAny = z.object(shape).passthrough();\n if (validation?.required) {\n schema = schema.nullable().optional().refine(\n (value) => value !== undefined,\n { message: validation?.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n } else {\n schema = schema.nullable().optional();\n }\n return schema;\n}\n\nfunction getZodStringSchema({\n property,\n parentProperty,\n customFieldValidator,\n name,\n entityId\n}: PropertyContext<StringProperty>): ZodTypeAny {\n let schema: ZodTypeAny = z.string().nullable().optional();\n const validation = property.validation;\n\n const isRequired = validation?.required || property.isId === true || property.isId === \"manual\";\n\n if (property.enum) {\n if (isRequired) {\n schema = z.string().nullable().optional().refine(\n (value) => value !== undefined && value !== null && value !== \"\",\n { message: validation?.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n const entries = enumToObjectEntries(property.enum);\n const allowedValues = (isRequired ? entries : [...entries, null])\n .map((enumValueConfig) => enumValueConfig?.id ?? null);\n schema = schema.refine(\n (value: unknown) => allowedValues.includes(value as string | null),\n { message: `Must be one of: ${allowedValues.filter(Boolean).join(\", \")}` }\n );\n }\n\n if (isRequired && !property.enum) {\n schema = schema.refine(\n (value: unknown) => value !== undefined && value !== null && value !== \"\",\n { message: validation?.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n\n if (validation) {\n\n if (validation.min || validation.min === 0) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"string\" && value.length >= validation.min!),\n { message: `${fieldLabel(property, name)} must be min ${validation.min} characters long` }\n );\n if (validation.max || validation.max === 0) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"string\" && value.length <= validation.max!),\n { message: `${fieldLabel(property, name)} must be max ${validation.max} characters long` }\n );\n if (validation.matches) {\n const regExp = typeof validation.matches === \"string\" ? hydrateRegExp(validation.matches) : validation.matches;\n if (regExp) {\n schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"string\" && regExp.test(value)),\n { message: validation.matchesMessage ?? \"Invalid format\" }\n );\n }\n }\n if (validation.length !== undefined) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"string\" && value.length === validation.length),\n { message: `${fieldLabel(property, name)} must be exactly ${validation.length} characters long` }\n );\n if (validation.trim || validation.lowercase || validation.uppercase) schema = z.preprocess(\n (v: unknown) => typeof v === \"string\" ? transformString(v, validation) : v,\n schema\n );\n }\n\n // Checked the way the server checks them: on every string that declares\n // them, `validation` block or not, and with the empty string let through —\n // it is what a cleared text field holds, and whether the field may be\n // empty is `required`'s question.\n if (property.email) schema = schema.refine(\n (value: unknown) => value == null || value === \"\" || (typeof value === \"string\" && /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)),\n { message: `${fieldLabel(property, name)} must be an email` }\n );\n if (property.url) {\n if (!property.storage || property.storage?.storeUrl) {\n schema = schema.refine(\n (value: unknown) => {\n if (value == null || value === \"\") return true;\n try {\n new URL(value as string);\n return true;\n } catch {\n return false;\n }\n },\n { message: `${fieldLabel(property, name)} must be a url` }\n );\n } else {\n console.warn(`Property ${fieldLabel(property, name)} has a url validation but its storage configuration is not set to store urls`);\n }\n }\n return schema;\n}\n\n/**\n * A string's declared transforms — `trim`, `lowercase`, `uppercase` — applied.\n * The one definition of them: validation judges its result, and\n * {@link applyValueTransforms} writes it.\n */\nfunction transformString(value: string, validation: StringPropertyValidationSchema): string {\n let result = value;\n if (validation.trim) result = result.trim();\n if (validation.lowercase) result = result.toLowerCase();\n if (validation.uppercase) result = result.toUpperCase();\n return result;\n}\n\n/**\n * The values as they are to be written: every `trim`, `lowercase` and\n * `uppercase` a string property declares applied to its value, inside maps and\n * arrays too.\n *\n * They are documented as changing the value that is written, and only the\n * panel applies them — the server checks what it receives. Validation judges\n * the transformed value, so without this the form passed \"my-slug\" and sent\n * \" My-Slug \", which a `matches` on the server then refused.\n *\n * Returns `values` itself when nothing changes.\n */\nexport function applyValueTransforms<M extends Record<string, unknown>>(values: M, properties: Properties): M {\n let result: M = values;\n for (const [key, property] of Object.entries(properties)) {\n if (!(key in values)) continue;\n const transformed = transformValue(property, values[key]);\n if (transformed !== values[key]) {\n result = { ...result, [key]: transformed };\n }\n }\n return result;\n}\n\nfunction transformValue(property: Property, value: unknown): unknown {\n if (!property || typeof property !== \"object\") return value;\n if (property.type === \"string\") {\n return typeof value === \"string\" && property.validation\n ? transformString(value, property.validation)\n : value;\n }\n if (property.type === \"map\" && property.properties && isPlainObject(value)) {\n return applyValueTransforms(value, property.properties);\n }\n if (property.type === \"array\" && property.of && Array.isArray(value)) {\n const of = property.of;\n const items = value.map((item, index) => {\n const itemProperty = Array.isArray(of) ? of[index] : of;\n return itemProperty ? transformValue(itemProperty, item) : item;\n });\n return items.some((item, index) => item !== value[index]) ? items : value;\n }\n return value;\n}\n\nfunction getZodNumberSchema({\n property,\n parentProperty,\n customFieldValidator,\n name,\n entityId\n}: PropertyContext<NumberProperty>): ZodTypeAny {\n const validation = property.validation;\n // Accept number or null, coerce non-numbers to fail\n let schema: ZodTypeAny = z.preprocess(\n (val) => {\n if (val === null || val === undefined) return null;\n if (typeof val === \"number\") return val;\n const n = Number(val);\n return isNaN(n) ? val : n; // pass through non-numeric to let refine catch it\n },\n z.number({ error: \"Must be a number\" }).nullable()\n );\n\n const isRequired = validation?.required || property.isId === true || property.isId === \"manual\";\n\n if (isRequired) {\n schema = schema.refine(\n (value: unknown) => value !== undefined && value !== null,\n { message: validation?.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n\n if (validation) {\n\n if (validation.min || validation.min === 0) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"number\" && value >= validation.min!),\n { message: `${fieldLabel(property, name)} must be higher or equal to ${validation.min}` }\n );\n if (validation.max || validation.max === 0) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"number\" && value <= validation.max!),\n { message: `${fieldLabel(property, name)} must be lower or equal to ${validation.max}` }\n );\n if (validation.lessThan || validation.lessThan === 0) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"number\" && value < validation.lessThan!),\n { message: `${fieldLabel(property, name)} must be lower than ${validation.lessThan}` }\n );\n if (validation.moreThan || validation.moreThan === 0) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"number\" && value > validation.moreThan!),\n { message: `${fieldLabel(property, name)} must be higher than ${validation.moreThan}` }\n );\n if (validation.positive) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"number\" && value > 0),\n { message: `${fieldLabel(property, name)} must be positive` }\n );\n if (validation.negative) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"number\" && value < 0),\n { message: `${fieldLabel(property, name)} must be negative` }\n );\n }\n // An integer column takes a whole number whether or not the property says\n // `validation.integer`; without it, a fraction reached Postgres and came\n // back as `Invalid data format` naming no field.\n if (validation?.integer || isIntegerColumn(property.columnType)) schema = schema.refine(\n (value: unknown) => value == null || (typeof value === \"number\" && Number.isInteger(value)),\n { message: `${fieldLabel(property, name)} must be an integer` }\n );\n return schema;\n}\n\nfunction getZodGeoPointSchema({\n property,\n parentProperty,\n customFieldValidator,\n name,\n entityId\n}: PropertyContext<GeopointProperty>): ZodTypeAny {\n // The field marks a coordinate off the globe in red; the schema has to\n // refuse it too, or Save wrote latitude 200 under the red message.\n // A `GeoPoint` instance or a plain `{ latitude, longitude }`.\n const coordinate = (value: unknown, axis: \"latitude\" | \"longitude\"): number | undefined => {\n if (typeof value !== \"object\" || value === null) return undefined;\n const n = (value as Record<string, unknown>)[axis];\n return typeof n === \"number\" ? n : undefined;\n };\n let schema: ZodTypeAny = z.object({}).passthrough().nullable().optional()\n .refine(\n (value: unknown) => Math.abs(coordinate(value, \"latitude\") ?? 0) <= 90,\n { message: \"Latitude must be between -90 and 90\" }\n )\n .refine(\n (value: unknown) => Math.abs(coordinate(value, \"longitude\") ?? 0) <= 180,\n { message: \"Longitude must be between -180 and 180\" }\n );\n const validation = property.validation;\n\n if (validation?.required) {\n schema = schema.refine(\n (value: unknown) => value !== undefined && value !== null,\n { message: validation.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n return schema;\n}\n\nfunction getZodDateSchema({\n property,\n parentProperty,\n customFieldValidator,\n name,\n entityId\n}: PropertyContext<DateProperty>): ZodTypeAny {\n if (property.autoValue) {\n return z.date().nullable().optional();\n }\n // Accept Date objects and null, reject everything else\n let schema: ZodTypeAny = z.custom<Date | null | undefined>(\n (v) => v === null || v === undefined || v instanceof Date,\n { message: \"Expected a Date\" }\n ).optional();\n const validation = property.validation;\n\n if (validation) {\n if (validation.required) {\n schema = schema.refine(\n (value: unknown) => value !== undefined && value !== null,\n { message: validation?.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n\n // Both bounds are inclusive, and the message says so: it said \"after\"\n // the bound, which the bound itself is not, and printed the bound with\n // `Date.toString()` (\"Wed Jan 01 2020 01:00:00 GMT+0100 (…)\").\n if (validation.min) schema = schema.refine(\n (value: unknown) => value == null || (value instanceof Date && value >= validation.min!),\n { message: `${fieldLabel(property, name)} must not be before ${formatDateBound(validation.min, property.columnType)}` }\n );\n if (validation.max) schema = schema.refine(\n (value: unknown) => value == null || (value instanceof Date && value <= validation.max!),\n { message: `${fieldLabel(property, name)} must not be after ${formatDateBound(validation.max, property.columnType)}` }\n );\n }\n return schema;\n}\n\nfunction getZodReferenceSchema({\n property,\n parentProperty,\n customFieldValidator,\n name,\n entityId\n}: PropertyContext<ReferenceProperty>): ZodTypeAny {\n let schema: ZodTypeAny = z.object({}).passthrough().nullable().optional();\n const validation = property.validation;\n\n if (validation) {\n if (validation.required) {\n schema = schema.refine(\n (value: unknown) => value !== undefined && value !== null,\n { message: validation?.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n\n }\n return schema;\n}\n\nfunction getZodRelationSchema({\n property,\n parentProperty,\n customFieldValidator,\n name,\n entityId\n}: PropertyContext<RelationProperty>): ZodTypeAny {\n const isMany = relationCardinality(property.relation) === \"many\";\n let schema: ZodTypeAny = isMany\n ? z.array(z.object({}).passthrough()).nullable().optional()\n : z.object({}).passthrough().nullable().optional();\n const validation = property.validation;\n\n if (validation) {\n if (validation.required) {\n schema = schema.refine(\n (value: unknown) => {\n if (isMany) {\n return value !== undefined && value !== null && Array.isArray(value) && value.length > 0;\n }\n return value !== undefined && value !== null;\n },\n { message: validation?.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n\n }\n return schema;\n}\n\nfunction getZodBooleanSchema({\n property,\n parentProperty,\n customFieldValidator,\n name,\n entityId\n}: PropertyContext<BooleanProperty>): ZodTypeAny {\n let schema: ZodTypeAny = z.boolean().nullable().optional();\n const validation = property.validation;\n\n if (validation) {\n if (validation.required) {\n schema = schema.refine(\n (value: unknown) => value !== undefined && value !== null,\n { message: validation?.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n\n }\n return schema;\n}\n\n/** The Postgres number column types that hold whole numbers only. */\nfunction isIntegerColumn(columnType: string | undefined): boolean {\n return columnType === \"integer\" || columnType === \"bigint\" || columnType === \"serial\" || columnType === \"bigserial\";\n}\n\n/** A date bound as a reader writes it: the day for a date column, else an ISO instant. */\nfunction formatDateBound(bound: Date, columnType: string | undefined): string {\n const date = bound instanceof Date ? bound : new Date(bound);\n if (Number.isNaN(date.getTime())) return String(bound);\n return columnType === \"date\" ? date.toISOString().slice(0, 10) : date.toISOString();\n}\n\n/**\n * What `uniqueInArray` compares an item by. Relations and references are\n * objects built per read, so comparing them by identity never found the same\n * row linked twice; they compare by the row they point at.\n */\nfunction uniqueInArrayKey(value: unknown): unknown {\n if (value instanceof Date) return `date:${value.getTime()}`;\n if (typeof value === \"object\" && value !== null && \"id\" in value) {\n const { id, path } = value as { id?: unknown; path?: unknown };\n if (typeof id === \"string\" || typeof id === \"number\") return `row:${typeof path === \"string\" ? path : \"\"}:${String(id)}`;\n }\n return value;\n}\n\nfunction hasUniqueInArrayModifier(property: Property): boolean | [string, Property][] {\n if (property.validation?.uniqueInArray) {\n return true;\n } else if (property.type === \"map\" && property.properties) {\n return Object.entries(property.properties)\n .filter(([key, childProperty]) => (childProperty as Readonly<Property>).validation?.uniqueInArray) as [string, Property][];\n }\n return false;\n}\n\nfunction getZodArraySchema({\n property,\n parentProperty,\n customFieldValidator,\n name,\n entityId\n}: PropertyContext<ArrayProperty>): ZodTypeAny {\n\n let arraySchema: ZodTypeAny = z.array(z.any()).nullable().optional();\n\n if (!property.of && property.oneOf?.properties) {\n // Blocks: each item is `{ [typeField]: key, [valueField]: value }`, and\n // its value answers to `oneOf.properties[key]`, as an `of` item answers\n // to `of`. The error lands on `blocks.<i>.<valueField>`, which is the\n // key the block's inner field is bound to.\n const typeField = property.oneOf.typeField ?? DEFAULT_ONE_OF_TYPE;\n const valueField = property.oneOf.valueField ?? DEFAULT_ONE_OF_VALUE;\n const blockProperties = property.oneOf.properties as Record<string, Property>;\n const blockSchemas = new Map<string, ZodTypeAny>();\n const schemaFor = (type: string): ZodTypeAny | undefined => {\n if (!Object.prototype.hasOwnProperty.call(blockProperties, type)) return undefined;\n const blockProperty = blockProperties[type];\n if (!blockProperty || isPropertyBuilder(blockProperty)) return undefined;\n let schema = blockSchemas.get(type);\n if (!schema) {\n schema = mapPropertyToZod({ property: blockProperty, parentProperty: property, entityId, name: type });\n blockSchemas.set(type, schema);\n }\n return schema;\n };\n arraySchema = z.array(z.any()).superRefine(async (items, ctx) => {\n for (let index = 0; index < items.length; index++) {\n const item: unknown = items[index];\n if (!isPlainObject(item)) continue;\n const type = (item as Record<string, unknown>)[typeField];\n if (typeof type !== \"string\") continue;\n const schema = schemaFor(type);\n if (!schema) continue;\n const result = await schema.safeParseAsync((item as Record<string, unknown>)[valueField]);\n if (!result.success) {\n result.error.issues.forEach((issue) => {\n ctx.addIssue({\n code: \"custom\",\n message: issue.message,\n path: [index, valueField, ...issue.path]\n });\n });\n }\n }\n }).nullable().optional();\n }\n\n if (property.of) {\n if (Array.isArray(property.of)) {\n // One property per position: the value is a tuple, and item `i`\n // answers to `of[i]` alone. Checked against every position, a\n // mixed tuple failed its own declaration and could never be saved.\n const positionSchemas: ZodTypeAny[] = (property.of as Property[]).map((p, index) => {\n try {\n return mapPropertyToZod({\n property: p as Property,\n parentProperty: property,\n entityId\n });\n } catch (e: unknown) {\n console.error(`Error creating validation schema for array item ${index}:`, e);\n return z.any().refine(\n () => false,\n { message: `Validation error: ${e instanceof Error ? e.message : \"Unknown error\"}` }\n );\n }\n });\n arraySchema = z.array(z.any()).superRefine(async (items, ctx) => {\n for (let index = 0; index < items.length && index < positionSchemas.length; index++) {\n const result = await positionSchemas[index].safeParseAsync(items[index]);\n if (!result.success) {\n result.error.issues.forEach((issue) => {\n ctx.addIssue({\n code: \"custom\",\n message: issue.message,\n path: [index, ...issue.path]\n });\n });\n }\n }\n }).nullable().optional();\n } else {\n try {\n const ofSchema = mapPropertyToZod({\n property: property.of,\n parentProperty: property,\n entityId\n });\n arraySchema = z.array(ofSchema).nullable().optional();\n } catch (e: unknown) {\n console.error(\"Error creating validation schema for array of property:\", e);\n arraySchema = z.array(z.any().refine(\n () => false,\n { message: `Validation error: ${e instanceof Error ? e.message : \"Unknown error\"}` }\n )).nullable().optional();\n }\n const arrayUniqueFields = hasUniqueInArrayModifier(property.of);\n if (arrayUniqueFields) {\n if (typeof arrayUniqueFields === \"boolean\") {\n arraySchema = arraySchema.refine(\n (values: unknown) => !values || !Array.isArray(values) || values.length === new Set(values.map(uniqueInArrayKey)).size,\n { message: `${fieldLabel(property, name)} should have unique values within the array` }\n );\n } else if (Array.isArray(arrayUniqueFields)) {\n arrayUniqueFields.forEach(([fieldName, childProperty]) => {\n arraySchema = arraySchema.refine(\n (values: unknown) => !values || !Array.isArray(values) || values.length === new Set(values.map((v: unknown) => uniqueInArrayKey(v && typeof v === \"object\" ? (v as Record<string, unknown>)[fieldName] : v))).size,\n { message: `${fieldLabel(property, name)} → ${childProperty.name ?? fieldName}: should have unique values within the array` }\n );\n });\n }\n }\n }\n }\n const validation = property.validation;\n\n if (validation) {\n if (validation.required) {\n arraySchema = arraySchema.refine(\n (value: unknown) => value !== undefined && value !== null && Array.isArray(value) && value.length > 0,\n { message: validation?.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n if (validation.min || validation.min === 0) arraySchema = arraySchema.refine(\n (value: unknown) => !value || !Array.isArray(value) || value.length >= validation.min!,\n { message: `${fieldLabel(property, name)} should be min ${validation.min} entries long` }\n );\n if (validation.max) arraySchema = arraySchema.refine(\n (value: unknown) => !value || !Array.isArray(value) || value.length <= validation.max!,\n { message: `${fieldLabel(property, name)} should be max ${validation.max} entries long` }\n );\n // Handle uniqueInArray at the array level\n if (validation.uniqueInArray) {\n arraySchema = arraySchema.refine(\n (values: unknown) => !values || !Array.isArray(values) || values.length === new Set(values.map(uniqueInArrayKey)).size,\n { message: `${fieldLabel(property, name)} should have unique values within the array` }\n );\n }\n }\n return arraySchema;\n}\n\nfunction getZodVectorSchema({\n property\n}: PropertyContext<VectorProperty>): ZodTypeAny {\n let schema: ZodTypeAny = z.preprocess(\n (val: unknown) => {\n if (val && typeof val === \"object\" && \"__type\" in val && (val as Record<string, unknown>).__type === \"Vector\") {\n return (val as Record<string, unknown>).value;\n }\n if (val && typeof val === \"object\" && \"value\" in val && Array.isArray((val as Record<string, unknown>).value)) {\n return (val as Record<string, unknown>).value;\n }\n return val;\n },\n z.array(z.number()).nullable().optional()\n );\n\n if (property.dimensions) {\n schema = schema.refine(\n (val: unknown) => val === null || val === undefined || (Array.isArray(val) && val.length === property.dimensions),\n { message: `${property.name ?? \"Vector\"} must have exactly ${property.dimensions} dimensions` }\n );\n }\n\n if (property.validation?.required) {\n schema = schema.refine(\n (val: unknown) => val !== null && val !== undefined && Array.isArray(val) && val.length > 0,\n { message: property.validation?.requiredMessage ?? \"Required\" }\n );\n }\n\n return schema;\n}\n\nfunction getZodBinarySchema({\n property\n}: PropertyContext<BinaryProperty>): ZodTypeAny {\n let schema: ZodTypeAny = z.string().nullable().optional();\n const validation = property.validation;\n\n if (validation?.required) {\n schema = schema.nullable().optional().refine(\n (value: unknown) => value !== undefined && value !== null && value !== \"\",\n { message: validation.requiredMessage ? validation.requiredMessage : \"Required\" }\n );\n }\n return schema;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,SAAS,WAAW,UAAoB,MAAuB;CAC3D,OAAO,SAAS,SAAS,OAAO,mBAAmB,IAAI,IAAI;AAC/D;AAEA,SAAS,oBAAoB,UAA2F;CACpH,IAAI,CAAC,UAAU,OAAO,KAAA;CACtB,IAAI,SAAS,SAAS,OAAO,OAAO,SAAS;CAC7C,IAAI,SAAS,SAAS,aAAa,SAAS,SAAS,cAAc,OAAO;CAC1E,IAAI,SAAS,SAAS,eAAe,SAAS,SAAS,UAAU,OAAO;CACxE,OAAO,SAAS;AACpB;;;;;;;;;;;;;AA+BA,eAAsB,kBAAkB,EACpC,YAC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QAAQ,QAAQ,QAAQ,KAAA,KAAc,MAAM,QAAQ,GAAG,KAAK,IAAI,WAAW,SAAS,YACtG,EAAE,SAAS,GAAG,SAAS,QAAQ,SAAS,qBAAqB,SAAS,WAAW,aAAa,CAClG;CAGJ,IAAI,SAAS,YAAY,UACrB,SAAS,OAAO,QACX,QAAiB,QAAQ,QAAQ,QAAQ,KAAA,KAAa,MAAM,QAAQ,GAAG,KAAK,IAAI,SAAS,GAC1F,EAAE,SAAS,SAAS,YAAY,mBAAmB,WAAW,CAClE;CAGJ,OAAO;AACX;AAEA,SAAS,mBAAmB,EACxB,YAC4C;CAC5C,IAAI,SAAqB,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACxD,MAAM,aAAa,SAAS;CAE5B,IAAI,YAAY,UACZ,SAAS,OAAO,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,QACjC,UAAmB,UAAU,KAAA,KAAa,UAAU,QAAQ,UAAU,IACvE,EAAE,SAAS,WAAW,kBAAkB,WAAW,kBAAkB,WAAW,CACpF;CAEJ,OAAO;AACX"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { createContext } from "react";
|
|
2
|
+
//#region src/hooks/navigation/contexts/CollectionRegistryContext.tsx
|
|
3
|
+
var CollectionRegistryContext = createContext({
|
|
4
|
+
getCollection: () => void 0,
|
|
5
|
+
getRawCollection: () => void 0,
|
|
6
|
+
resolveDataPath: (path) => path,
|
|
7
|
+
resolveCollectionPath: (path) => path,
|
|
8
|
+
getParentReferencesFromPath: () => [],
|
|
9
|
+
getParentCollectionSlugs: () => [],
|
|
10
|
+
getParentEntityIds: () => [],
|
|
11
|
+
convertIdsToPaths: () => [],
|
|
12
|
+
initialised: false
|
|
13
|
+
});
|
|
14
|
+
function useCollectionRegistryController() {
|
|
15
|
+
const context = React.useContext(CollectionRegistryContext);
|
|
16
|
+
if (context === void 0) throw new Error("useCollectionRegistryController must be used within a CollectionRegistryContext.Provider");
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { CollectionRegistryContext, useCollectionRegistryController };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=CollectionRegistryContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionRegistryContext.js","names":[],"sources":["../../../../src/hooks/navigation/contexts/CollectionRegistryContext.tsx"],"sourcesContent":["\nimport React, { createContext } from \"react\";\nimport { CollectionRegistryController } from \"@rebasepro/types\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\n\nexport const CollectionRegistryContext = createContext<CollectionRegistryController>({\n getCollection: () => undefined,\n getRawCollection: () => undefined,\n resolveDataPath: (path) => path,\n resolveCollectionPath: (path) => path,\n getParentReferencesFromPath: () => [],\n getParentCollectionSlugs: () => [],\n getParentEntityIds: () => [],\n convertIdsToPaths: () => [],\n initialised: false\n});\n\nexport function useCollectionRegistryController<DB = Record<string, unknown>, EC extends AdminCollection = AdminCollection>(): CollectionRegistryController<DB, EC> {\n const context = React.useContext(CollectionRegistryContext);\n if (context === undefined) {\n throw new Error(\"useCollectionRegistryController must be used within a CollectionRegistryContext.Provider\");\n }\n return context as CollectionRegistryController<DB, EC>;\n}\n"],"mappings":";;AAKA,IAAa,4BAA4B,cAA4C;CACjF,qBAAqB,KAAA;CACrB,wBAAwB,KAAA;CACxB,kBAAkB,SAAS;CAC3B,wBAAwB,SAAS;CACjC,mCAAmC,CAAC;CACpC,gCAAgC,CAAC;CACjC,0BAA0B,CAAC;CAC3B,yBAAyB,CAAC;CAC1B,aAAa;AACjB,CAAC;AAED,SAAgB,kCAAoJ;CAChK,MAAM,UAAU,MAAM,WAAW,yBAAyB;CAC1D,IAAI,YAAY,KAAA,GACZ,MAAM,IAAI,MAAM,0FAA0F;CAE9G,OAAO;AACX"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { createContext } from "react";
|
|
2
|
+
//#region src/hooks/navigation/contexts/NavigationStateContext.tsx
|
|
3
|
+
var NavigationStateContext = createContext({
|
|
4
|
+
loading: true,
|
|
5
|
+
refreshNavigation: () => {}
|
|
6
|
+
});
|
|
7
|
+
function useNavigationStateController() {
|
|
8
|
+
const context = React.useContext(NavigationStateContext);
|
|
9
|
+
if (context === void 0) throw new Error("useNavigationStateController must be used within a NavigationStateContext.Provider");
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { NavigationStateContext, useNavigationStateController };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=NavigationStateContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationStateContext.js","names":[],"sources":["../../../../src/hooks/navigation/contexts/NavigationStateContext.tsx"],"sourcesContent":["import type { NavigationStateController } from \"@rebasepro/cms-types\";\nimport React, { createContext } from \"react\";\n\n\nexport const NavigationStateContext = createContext<NavigationStateController>({\n loading: true,\n refreshNavigation: () => { }\n});\n\nexport function useNavigationStateController(): NavigationStateController {\n const context = React.useContext(NavigationStateContext);\n if (context === undefined) {\n throw new Error(\"useNavigationStateController must be used within a NavigationStateContext.Provider\");\n }\n return context;\n}\n"],"mappings":";;AAIA,IAAa,yBAAyB,cAAyC;CAC3E,SAAS;CACT,yBAAyB,CAAE;AAC/B,CAAC;AAED,SAAgB,+BAA0D;CACtE,MAAM,UAAU,MAAM,WAAW,sBAAsB;CACvD,IAAI,YAAY,KAAA,GACZ,MAAM,IAAI,MAAM,oFAAoF;CAExG,OAAO;AACX"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { createContext } from "react";
|
|
2
|
+
//#region src/hooks/navigation/contexts/UrlContext.tsx
|
|
3
|
+
var UrlContext = createContext({
|
|
4
|
+
basePath: "/",
|
|
5
|
+
baseCollectionPath: "/c",
|
|
6
|
+
urlPathToDataPath: () => "",
|
|
7
|
+
homeUrl: "/",
|
|
8
|
+
isUrlCollectionPath: () => false,
|
|
9
|
+
buildUrlCollectionPath: () => "",
|
|
10
|
+
buildAppUrlPath: () => "",
|
|
11
|
+
resolveDatabasePathsFrom: () => "",
|
|
12
|
+
navigate: () => {}
|
|
13
|
+
});
|
|
14
|
+
function useUrlController() {
|
|
15
|
+
const context = React.useContext(UrlContext);
|
|
16
|
+
if (context === void 0) throw new Error("useUrlController must be used within a UrlContext.Provider");
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { UrlContext, useUrlController };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=UrlContext.js.map
|