@rebasepro/cms 0.17.3 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/{CollectionEditorDialog-B-akreOU.js → CollectionEditorDialog-BeX4b92r.js} +13 -7
- package/dist/{CollectionEditorDialog-B-akreOU.js.map → CollectionEditorDialog-BeX4b92r.js.map} +1 -1
- package/dist/{PropertyEditView-CiY84wkR.js → PropertyEditView-C7thfj4L.js} +3 -3
- package/dist/{PropertyEditView-CiY84wkR.js.map → PropertyEditView-C7thfj4L.js.map} +1 -1
- package/dist/{RouterCollectionsStudioView-DkAWda4N.js → RouterCollectionsStudioView-BtjzvB6E.js} +4 -4
- package/dist/{RouterCollectionsStudioView-DkAWda4N.js.map → RouterCollectionsStudioView-BtjzvB6E.js.map} +1 -1
- package/dist/{SchemaChangeDialog-DceT8QFX.js → SchemaChangeDialog-CkqK6KOC.js} +4 -2
- package/dist/{SchemaChangeDialog-DceT8QFX.js.map → SchemaChangeDialog-CkqK6KOC.js.map} +1 -1
- package/dist/collection_editor/api/generateCollectionApi.d.ts +1 -2
- package/dist/collection_editor_ui.d.ts +2 -0
- package/dist/collection_editor_ui.js +6 -5
- package/dist/collection_editor_ui.js.map +1 -1
- package/dist/components/DeleteEntityDialog.d.ts +2 -3
- package/dist/components/RebaseLayout.d.ts +11 -4
- package/dist/components/field_configs.d.ts +1 -1
- package/dist/editor/sanitize-html.d.ts +15 -0
- package/dist/editor.js +195 -10
- package/dist/editor.js.map +1 -1
- package/dist/{export-Ben8E355.js → export--arni_VY.js} +2 -2
- package/dist/{export-Ben8E355.js.map → export--arni_VY.js.map} +1 -1
- package/dist/form/components/LabelWithIcon.d.ts +10 -0
- package/dist/{history-DIEVd26f.js → history-C2TpoQwi.js} +2 -2
- package/dist/{history-DIEVd26f.js.map → history-C2TpoQwi.js.map} +1 -1
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +1 -1
- package/dist/hooks/navigation/useResolvedViews.d.ts +1 -1
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +1 -1
- package/dist/{import-D25x7ko-.js → import-DTkXNoBg.js} +2 -2
- package/dist/{import-D25x7ko-.js.map → import-DTkXNoBg.js.map} +1 -1
- package/dist/index.js +78 -33
- package/dist/index.js.map +1 -1
- package/dist/util/propertyConfigMapper.d.ts +1 -1
- package/dist/util-CfLFggP7.js +57 -0
- package/dist/util-CfLFggP7.js.map +1 -0
- package/dist/{util-DVqnqlLn.js → util-DE1WQW6h.js} +134 -112
- package/dist/util-DE1WQW6h.js.map +1 -0
- package/package.json +42 -34
- package/dist/util-DVqnqlLn.js.map +0 -1
- package/src/collection_editor/CollectionEditorDialogsContext.tsx +0 -25
- package/src/collection_editor/ConfigControllerProvider.tsx +0 -395
- package/src/collection_editor/_cms_internals.ts +0 -41
- package/src/collection_editor/api/generateCollectionApi.ts +0 -126
- package/src/collection_editor/api/index.ts +0 -1
- package/src/collection_editor/extensibility_types.ts +0 -168
- package/src/collection_editor/index.ts +0 -108
- package/src/collection_editor/liveSchemaClient.ts +0 -285
- package/src/collection_editor/relation_kinds.ts +0 -44
- package/src/collection_editor/serializable_types.ts +0 -535
- package/src/collection_editor/serializable_utils.ts +0 -729
- package/src/collection_editor/types/collection_editor_controller.tsx +0 -62
- package/src/collection_editor/types/collection_inference.ts +0 -18
- package/src/collection_editor/types/config_controller.tsx +0 -121
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +0 -199
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +0 -51
- package/src/collection_editor/ui/EditorCollectionAction.tsx +0 -54
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +0 -90
- package/src/collection_editor/ui/EditorEntityAction.tsx +0 -50
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +0 -114
- package/src/collection_editor/ui/KanbanSetupAction.tsx +0 -43
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +0 -35
- package/src/collection_editor/ui/NewCollectionButton.tsx +0 -27
- package/src/collection_editor/ui/NewCollectionCard.tsx +0 -48
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +0 -49
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +0 -260
- package/src/collection_editor/ui/collection_editor/AIModifiedPathsContext.tsx +0 -90
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +0 -388
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +0 -1098
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +0 -301
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +0 -172
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +0 -620
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +0 -530
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +0 -462
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +0 -104
- package/src/collection_editor/ui/collection_editor/CollectionYupValidation.tsx +0 -9
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +0 -199
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +0 -315
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +0 -164
- package/src/collection_editor/ui/collection_editor/EntityActionsSelectDialog.tsx +0 -40
- package/src/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +0 -39
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +0 -373
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +0 -288
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +0 -141
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +0 -194
- package/src/collection_editor/ui/collection_editor/LayoutModeSwitch.tsx +0 -53
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +0 -980
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +0 -164
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +0 -364
- package/src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx +0 -44
- package/src/collection_editor/ui/collection_editor/RouterCollectionsStudioView.tsx +0 -41
- package/src/collection_editor/ui/collection_editor/SchemaChangeDialog.tsx +0 -470
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +0 -256
- package/src/collection_editor/ui/collection_editor/SwitchControl.tsx +0 -39
- package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +0 -68
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +0 -67
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +0 -296
- package/src/collection_editor/ui/collection_editor/import/clean_import_data.ts +0 -57
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +0 -147
- package/src/collection_editor/ui/collection_editor/properties/BooleanPropertyField.tsx +0 -41
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +0 -113
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +0 -250
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +0 -126
- package/src/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.tsx +0 -20
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +0 -153
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +0 -217
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +0 -117
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +0 -129
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +0 -335
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +0 -107
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +0 -403
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +0 -148
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +0 -91
- package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +0 -34
- package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +0 -49
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +0 -925
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +0 -28
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +0 -626
- package/src/collection_editor/ui/collection_editor/properties/conditions/index.ts +0 -6
- package/src/collection_editor/ui/collection_editor/properties/conditions/property_paths.ts +0 -93
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +0 -52
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +0 -63
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +0 -114
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +0 -154
- package/src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx +0 -28
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +0 -112
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +0 -183
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +0 -88
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +0 -42
- package/src/collection_editor/ui/collection_editor/util.ts +0 -28
- package/src/collection_editor/ui/collection_editor/utils/strings.ts +0 -1
- package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +0 -39
- package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +0 -276
- package/src/collection_editor/useCollectionEditorController.tsx +0 -9
- package/src/collection_editor/useCollectionsConfigController.tsx +0 -9
- package/src/collection_editor/useJsonCollectionsConfigController.tsx +0 -297
- package/src/collection_editor/useLiveSchemaEditing.tsx +0 -315
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +0 -341
- package/src/collection_editor/useSafeSnackbarController.ts +0 -9
- package/src/collection_editor/validateCollectionJson.ts +0 -440
- package/src/collection_editor_ui.ts +0 -21
- package/src/components/AdditionalFieldValue.tsx +0 -68
- package/src/components/AdminModeSyncer.tsx +0 -56
- package/src/components/ArrayContainer.tsx +0 -542
- package/src/components/ClearFilterSortButton.tsx +0 -56
- package/src/components/CollectionEditorDialogs.tsx +0 -69
- package/src/components/CollectionPanel.tsx +0 -179
- package/src/components/CollectionTableBinding/CollectionRowActions.tsx +0 -244
- package/src/components/CollectionTableBinding/CollectionTableBinding.tsx +0 -394
- package/src/components/CollectionTableBinding/CollectionTableBindingProps.tsx +0 -172
- package/src/components/CollectionTableBinding/PropertyTableCell.tsx +0 -350
- package/src/components/CollectionTableBinding/column_utils.tsx +0 -155
- package/src/components/CollectionTableBinding/fields/TableMultipleRelationField.tsx +0 -131
- package/src/components/CollectionTableBinding/fields/TableReferenceField.tsx +0 -193
- package/src/components/CollectionTableBinding/fields/TableRelationField.tsx +0 -192
- package/src/components/CollectionTableBinding/fields/TableRelationSelectorField.tsx +0 -42
- package/src/components/CollectionTableBinding/fields/TableStorageUpload.tsx +0 -324
- package/src/components/CollectionTableBinding/fields/VirtualTableSelect.tsx +0 -132
- package/src/components/CollectionTableBinding/fields/VirtualTableUserSelect.tsx +0 -41
- package/src/components/CollectionTableBinding/index.tsx +0 -14
- package/src/components/CollectionTableBinding/internal/CollectionTableToolbar.tsx +0 -96
- package/src/components/CollectionTableBinding/internal/EntityTableCell.tsx +0 -309
- package/src/components/CollectionTableBinding/internal/EntityTableCellActions.tsx +0 -80
- package/src/components/CollectionTableBinding/internal/common.tsx +0 -74
- package/src/components/CollectionTableBinding/internal/popup_field/PopupFormField.tsx +0 -422
- package/src/components/CollectionTableBinding/internal/popup_field/useDraggable.tsx +0 -99
- package/src/components/CollectionTableBinding/internal/popup_field/useWindowSize.tsx +0 -22
- package/src/components/CollectionTableBinding/table_bindings.tsx +0 -350
- package/src/components/CollectionViewBinding/BoardCardBinding.tsx +0 -263
- package/src/components/CollectionViewBinding/CollectionBoardViewBinding.tsx +0 -662
- package/src/components/CollectionViewBinding/CollectionCardViewBinding.tsx +0 -159
- package/src/components/CollectionViewBinding/CollectionListViewBinding.tsx +0 -1430
- package/src/components/CollectionViewBinding/CollectionViewActions.tsx +0 -227
- package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +0 -1603
- package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +0 -240
- package/src/components/CollectionViewBinding/EntityCardBinding.tsx +0 -239
- package/src/components/CollectionViewBinding/FilterPresetsButton.tsx +0 -298
- package/src/components/CollectionViewBinding/FiltersDialog.tsx +0 -218
- package/src/components/CollectionViewBinding/SearchExplanation.tsx +0 -106
- package/src/components/CollectionViewBinding/SearchHighlight.tsx +0 -311
- package/src/components/CollectionViewBinding/SlotValue.tsx +0 -156
- package/src/components/CollectionViewBinding/SortButton.tsx +0 -354
- package/src/components/CollectionViewBinding/SplitListCloseButton.tsx +0 -49
- package/src/components/CollectionViewBinding/SplitListShowButton.tsx +0 -28
- package/src/components/CollectionViewBinding/SplitListView.tsx +0 -488
- package/src/components/CollectionViewBinding/SplitViewContext.tsx +0 -34
- package/src/components/CollectionViewBinding/ViewModeToggle.tsx +0 -250
- package/src/components/CollectionViewBinding/hooks/useCollectionInlineEditor.ts +0 -81
- package/src/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.ts +0 -181
- package/src/components/CollectionViewBinding/useBoardDataController.tsx +0 -802
- package/src/components/CollectionViewBinding/usePreviewSlots.ts +0 -703
- package/src/components/CollectionViewBinding/useSelectionController.tsx +0 -40
- package/src/components/CollectionViewBinding/utils.ts +0 -22
- package/src/components/DefaultAppBar.tsx +0 -264
- package/src/components/DefaultDrawer.tsx +0 -593
- package/src/components/DeleteEntityDialog.tsx +0 -205
- package/src/components/DetailViewBinding.tsx +0 -731
- package/src/components/DrawerNavigationGroup.tsx +0 -141
- package/src/components/DrawerNavigationItem.tsx +0 -115
- package/src/components/EditFormActions.tsx +0 -303
- package/src/components/EditViewBinding.tsx +0 -1069
- package/src/components/EntityDisplayHeader.tsx +0 -170
- package/src/components/EntityIdentityBar.tsx +0 -428
- package/src/components/EntityInspector.tsx +0 -156
- package/src/components/EntityPreviewBinding.tsx +0 -432
- package/src/components/EntityPreviewNesting.tsx +0 -50
- package/src/components/EntityViewBinding.tsx +0 -374
- package/src/components/FieldCaption.tsx +0 -14
- package/src/components/HomePage/ContentHomePage.tsx +0 -586
- package/src/components/HomePage/FavouritesView.tsx +0 -60
- package/src/components/HomePage/HomePageDnD.tsx +0 -704
- package/src/components/HomePage/NavigationCard.tsx +0 -81
- package/src/components/HomePage/NavigationCardBinding.tsx +0 -107
- package/src/components/HomePage/NavigationGroup.tsx +0 -156
- package/src/components/HomePage/RenameGroupDialog.tsx +0 -123
- package/src/components/HomePage/SmallNavigationCard.tsx +0 -41
- package/src/components/HomePage/index.tsx +0 -5
- package/src/components/InlineEntityPreview.tsx +0 -149
- package/src/components/JsonPreviewBinding.tsx +0 -66
- package/src/components/PropertyCollectionView.tsx +0 -336
- package/src/components/PropertyConfigBadge.tsx +0 -28
- package/src/components/PropertyIdCopyTooltip.tsx +0 -47
- package/src/components/RebaseAuthGate.tsx +0 -44
- package/src/components/RebaseCMS.tsx +0 -30
- package/src/components/RebaseLayout.tsx +0 -80
- package/src/components/RebaseNavigation.tsx +0 -369
- package/src/components/RebaseRouteDefs.tsx +0 -127
- package/src/components/RebaseShell.tsx +0 -83
- package/src/components/ReferenceTable/SelectionTableBinding.tsx +0 -389
- package/src/components/ReferenceWidget.tsx +0 -156
- package/src/components/RelationSelector.tsx +0 -926
- package/src/components/SearchIconsView.tsx +0 -78
- package/src/components/SelectableTable/SelectableTable.tsx +0 -309
- package/src/components/SelectableTable/SelectableTableContext.tsx +0 -7
- package/src/components/SelectableTable/SelectionStore.ts +0 -43
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +0 -59
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +0 -146
- package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +0 -190
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +0 -250
- package/src/components/SelectableTable/filters/RelationFilterField.tsx +0 -238
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +0 -282
- package/src/components/SelectableTable/filters/null_filter.ts +0 -63
- package/src/components/SideDialogs.tsx +0 -238
- package/src/components/SidePanelBinding.tsx +0 -361
- package/src/components/SidePanelProvider.tsx +0 -80
- package/src/components/UserSelector.tsx +0 -513
- package/src/components/admin/CreationResultDialog.tsx +0 -138
- package/src/components/admin/index.ts +0 -1
- package/src/components/app/AppBar.tsx +0 -17
- package/src/components/app/Drawer.tsx +0 -38
- package/src/components/app/Scaffold.tsx +0 -366
- package/src/components/app/index.ts +0 -4
- package/src/components/app/useApp.tsx +0 -36
- package/src/components/common/default_entity_actions.tsx +0 -440
- package/src/components/common/index.ts +0 -1
- package/src/components/field_configs.tsx +0 -506
- package/src/components/history/EntityHistoryEntry.tsx +0 -203
- package/src/components/history/EntityHistoryView.tsx +0 -206
- package/src/components/history/LastEditedByFormAction.tsx +0 -24
- package/src/components/history/LastEditedByIndicator.tsx +0 -95
- package/src/components/history/UserChip.tsx +0 -15
- package/src/components/history/index.tsx +0 -5
- package/src/components/index.ts +0 -63
- package/src/contexts/BreacrumbsContext.tsx +0 -45
- package/src/contexts/SideDialogsControllerContext.tsx +0 -5
- package/src/contexts/SidePanelControllerContext.tsx +0 -5
- package/src/data_export/export/BasicExportAction.tsx +0 -142
- package/src/data_export/export/ExportCollectionAction.tsx +0 -321
- package/src/data_export/export/export.ts +0 -295
- package/src/data_export/export/fetch_export_data.ts +0 -90
- package/src/data_export/export/index.ts +0 -4
- package/src/data_export/index.ts +0 -1
- package/src/data_import/components/DataNewPropertiesMapping.tsx +0 -261
- package/src/data_import/components/ImportFileUpload.tsx +0 -42
- package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +0 -58
- package/src/data_import/components/ImportSaveInProgress.tsx +0 -121
- package/src/data_import/components/index.ts +0 -4
- package/src/data_import/hooks/index.ts +0 -1
- package/src/data_import/hooks/useImportConfig.tsx +0 -34
- package/src/data_import/import/ImportCollectionAction.tsx +0 -461
- package/src/data_import/import/index.ts +0 -1
- package/src/data_import/index.ts +0 -5
- package/src/data_import/types/column_mapping.ts +0 -32
- package/src/data_import/types/index.ts +0 -1
- package/src/data_import/utils/csv.ts +0 -153
- package/src/data_import/utils/data.ts +0 -181
- package/src/data_import/utils/file_headers.ts +0 -14
- package/src/data_import/utils/file_to_json.ts +0 -149
- package/src/data_import/utils/get_import_inference_type.ts +0 -33
- package/src/data_import/utils/get_properties_mapping.ts +0 -67
- package/src/data_import/utils/index.ts +0 -5
- package/src/data_import/utils/save_entities.ts +0 -138
- package/src/data_import/utils/transforms.ts +0 -70
- package/src/editor/components/SlashCommandMenu.tsx +0 -532
- package/src/editor/components/editor-bubble-item.tsx +0 -32
- package/src/editor/components/editor-bubble.tsx +0 -143
- package/src/editor/components/image-bubble.tsx +0 -183
- package/src/editor/components/index.ts +0 -14
- package/src/editor/components/table-bubble.tsx +0 -233
- package/src/editor/editor.tsx +0 -529
- package/src/editor/extensions/HighlightDecorationExtension.ts +0 -115
- package/src/editor/extensions/Image.ts +0 -159
- package/src/editor/extensions/TextLoadingDecorationExtension.tsx +0 -107
- package/src/editor/extensions/clipboard.ts +0 -72
- package/src/editor/extensions/custom-keymap.ts +0 -25
- package/src/editor/extensions/drag-and-drop.tsx +0 -508
- package/src/editor/hooks/useProseMirror.ts +0 -126
- package/src/editor/hooks/useProseMirrorContext.ts +0 -15
- package/src/editor/index.ts +0 -2
- package/src/editor/markdown-it-plugins.d.ts +0 -24
- package/src/editor/markdown.ts +0 -204
- package/src/editor/nodeViews/ImageComponent.tsx +0 -20
- package/src/editor/nodeViews/ReactNodeView.tsx +0 -89
- package/src/editor/nodeViews/TaskItemComponent.tsx +0 -30
- package/src/editor/nodeViews/index.ts +0 -35
- package/src/editor/plugins/index.ts +0 -58
- package/src/editor/plugins/inputrules.ts +0 -82
- package/src/editor/plugins/placeholderPlugin.ts +0 -55
- package/src/editor/plugins/slashCommandPlugin.ts +0 -65
- package/src/editor/schema.ts +0 -339
- package/src/editor/selectors/ai-selector.tsx +0 -110
- package/src/editor/selectors/color-selector.tsx +0 -199
- package/src/editor/selectors/link-selector.tsx +0 -122
- package/src/editor/selectors/node-selector.tsx +0 -159
- package/src/editor/selectors/text-buttons.tsx +0 -79
- package/src/editor/types.ts +0 -6
- package/src/editor/useProseMirror.ts +0 -125
- package/src/editor/utils/prosemirror-utils.ts +0 -113
- package/src/editor/utils/remove_classes.ts +0 -18
- package/src/editor/utils/useDebouncedCallback.ts +0 -25
- package/src/form/EntityForm.tsx +0 -761
- package/src/form/EntityFormActions.tsx +0 -160
- package/src/form/EntityFormBinding.tsx +0 -342
- package/src/form/PropertyFieldBinding.tsx +0 -348
- package/src/form/components/ErrorFocus.tsx +0 -44
- package/src/form/components/FieldBlock.tsx +0 -189
- package/src/form/components/FieldHelperText.tsx +0 -84
- package/src/form/components/FormRail.tsx +0 -153
- package/src/form/components/FormSections.tsx +0 -145
- package/src/form/components/LabelWithIcon.tsx +0 -43
- package/src/form/components/LabelWithIconAndTooltip.tsx +0 -28
- package/src/form/components/LocalChangesMenu.tsx +0 -147
- package/src/form/components/StorageItemPreview.tsx +0 -81
- package/src/form/components/StorageUploadProgress.tsx +0 -118
- package/src/form/components/index.tsx +0 -6
- package/src/form/components/useRailVisible.tsx +0 -47
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +0 -109
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +0 -172
- package/src/form/field_bindings/BinaryFieldBinding.tsx +0 -177
- package/src/form/field_bindings/BlockFieldBinding.tsx +0 -282
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +0 -78
- package/src/form/field_bindings/GeopointFieldBinding.tsx +0 -200
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +0 -574
- package/src/form/field_bindings/MapFieldBinding.tsx +0 -120
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +0 -259
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +0 -130
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +0 -168
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +0 -94
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +0 -146
- package/src/form/field_bindings/RelationFieldBinding.tsx +0 -202
- package/src/form/field_bindings/RepeatFieldBinding.tsx +0 -143
- package/src/form/field_bindings/SelectFieldBinding.tsx +0 -111
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +0 -521
- package/src/form/field_bindings/SwitchFieldBinding.tsx +0 -70
- package/src/form/field_bindings/TextFieldBinding.tsx +0 -189
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +0 -71
- package/src/form/field_bindings/VectorFieldBinding.tsx +0 -209
- package/src/form/form_utils.ts +0 -243
- package/src/form/index.tsx +0 -36
- package/src/form/useClearRestoreValue.tsx +0 -36
- package/src/form/useUndoableDiscard.ts +0 -39
- package/src/form/validation.ts +0 -583
- package/src/hooks/index.ts +0 -16
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +0 -22
- package/src/hooks/navigation/contexts/NavigationStateContext.tsx +0 -16
- package/src/hooks/navigation/contexts/UrlContext.tsx +0 -24
- package/src/hooks/navigation/contexts/index.ts +0 -14
- package/src/hooks/navigation/useAsyncResolver.ts +0 -100
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +0 -218
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +0 -134
- package/src/hooks/navigation/useBuildUrlController.tsx +0 -66
- package/src/hooks/navigation/useNavigationResolution.ts +0 -271
- package/src/hooks/navigation/useResolvedCollections.ts +0 -102
- package/src/hooks/navigation/useResolvedViews.tsx +0 -139
- package/src/hooks/navigation/useTopLevelNavigation.ts +0 -273
- package/src/hooks/navigation/utils.ts +0 -200
- package/src/hooks/useAdminContext.tsx +0 -83
- package/src/hooks/useBreadcrumbsController.tsx +0 -17
- package/src/hooks/useBuildSideDialogsController.tsx +0 -145
- package/src/hooks/useBuildSidePanel.tsx +0 -315
- package/src/hooks/useChildViewSource.ts +0 -46
- package/src/hooks/useEntityDisplay.tsx +0 -262
- package/src/hooks/useEntityDisplayTitle.tsx +0 -49
- package/src/hooks/useHistory.ts +0 -178
- package/src/hooks/useRecordActions.tsx +0 -69
- package/src/hooks/useResolvedNavigationFrom.tsx +0 -167
- package/src/hooks/useResolvedUsers.ts +0 -148
- package/src/hooks/useSelectionDialog.tsx +0 -58
- package/src/hooks/useSideDialogsController.tsx +0 -25
- package/src/hooks/useSidePanel.tsx +0 -13
- package/src/index.ts +0 -124
- package/src/preview/PropertyPreview.tsx +0 -331
- package/src/preview/compact_text.ts +0 -68
- package/src/preview/components/ArrayEnumPreview.tsx +0 -39
- package/src/preview/components/BooleanPreview.tsx +0 -28
- package/src/preview/components/DatePreview.tsx +0 -106
- package/src/preview/components/EmptyValue.tsx +0 -10
- package/src/preview/components/EnumValuesChip.tsx +0 -39
- package/src/preview/components/ImagePreview.tsx +0 -144
- package/src/preview/components/InlineEntityListPreview.tsx +0 -42
- package/src/preview/components/ReferencePreview.tsx +0 -235
- package/src/preview/components/RelationPreview.tsx +0 -271
- package/src/preview/components/StorageThumbnail.tsx +0 -147
- package/src/preview/components/UrlComponentPreview.tsx +0 -116
- package/src/preview/components/UserPreview.tsx +0 -30
- package/src/preview/components/date_fns_locales.ts +0 -125
- package/src/preview/index.ts +0 -26
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +0 -73
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +0 -67
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +0 -77
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +0 -49
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +0 -70
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +0 -79
- package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +0 -35
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +0 -79
- package/src/preview/property_previews/MapPropertyPreview.tsx +0 -198
- package/src/preview/property_previews/NumberPropertyPreview.tsx +0 -39
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +0 -276
- package/src/preview/property_previews/StringPropertyPreview.tsx +0 -70
- package/src/preview/util.ts +0 -39
- package/src/routes/CustomViewRoute.tsx +0 -33
- package/src/routes/RebaseRoute.tsx +0 -467
- package/src/routes/index.ts +0 -2
- package/src/types/components/EntityFormActionsProps.tsx +0 -20
- package/src/types/components/EntityFormProps.tsx +0 -119
- package/src/types/components/PropertyPreviewProps.tsx +0 -85
- package/src/types/components/formex.tsx +0 -2
- package/src/types/components/index.ts +0 -3
- package/src/types/fields.tsx +0 -340
- package/src/types/index.ts +0 -4
- package/src/util/dataControllerAdapter.ts +0 -88
- package/src/util/entity_actions.ts +0 -28
- package/src/util/index.ts +0 -5
- package/src/util/navigation_utils.ts +0 -89
- package/src/util/number_format.ts +0 -46
- package/src/util/previews.ts +0 -131
- package/src/util/propertyConfigMapper.ts +0 -134
- package/src/util/property_utils.tsx +0 -236
- package/src/util/resolutions.ts +0 -96
- package/src/util/view_constants.ts +0 -33
- package/src/util/view_mode.ts +0 -176
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { n as getThumbnailMeasure, r as sanitizeUrl, t as getPreviewSizeFrom } from "./util-CfLFggP7.js";
|
|
1
2
|
import * as React$1 from "react";
|
|
2
3
|
import React, { Suspense, createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
3
4
|
import { deepEqual } from "fast-equals";
|
|
4
5
|
import { Alert, AlertCircleIcon, AlertTriangleIcon, AlignLeftIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightToLineIcon, ArrowUpDownIcon, ArrowUpIcon, Badge, BooleanSwitchWithLabel, Button, CHIP_COLORS, CHIP_SEED_KEYS, CalendarIcon, Card, CardView, CenteredView, CheckCircleIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, Chip, CircleIcon, CircularProgress, CircularProgressCenter, CodeIcon, Collapse, ColumnsIcon, CopyIcon, DateTimeField, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, ExpandablePanel, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, FileUpload, FilterChip, FilterIcon, FilterXIcon, FlagIcon, FolderUpIcon, FunctionSquareIcon, GlobeIcon, HandleIcon, HashIcon, HistoryIcon, IconButton, ImageOffIcon, KanbanIcon, KanbanView, KeyRoundIcon, Label, LayoutGridIcon, Link2Icon, LinkIcon, ListIcon, ListOrderedIcon, ListView, LoadingButton, LucideIconByName, MailIcon, Markdown, Maximize2Icon, Menu, MenuItem, MinusIcon, MoreVerticalIcon, MultiSelect, MultiSelectItem, PanelLeftCloseIcon, PanelLeftOpenIcon, PencilIcon, PlusIcon, Popover, PopoverPrimitive, Portal, QuoteIcon, RadioGroup, RadioGroupItem, RefreshCwIcon, RepeatIcon, ResizablePanels, Rows3Icon, SearchBar, SearchIcon, Select, SelectItem, Separator, SettingsIcon, Sheet, Skeleton, Tab, Table, TableBody, TableCell, TableHeader, TableIcon, TableRow, Tabs, TextField, TextIcon, TextareaAutosize, ToggleButtonGroup, Tooltip, Trash2Icon, Typography, Unlink2Icon, UploadIcon, UserIcon, VirtualTable, VirtualTableDateField, VirtualTableInput, VirtualTableInput as VirtualTableInput$1, VirtualTableNumberInput, VirtualTableSwitch, VoteIcon, XCircleIcon, XIcon, cls, coolIconKeys, createVirtualTableSelectionStore, debounce, defaultBorderMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, fieldBackgroundInvisibleMixin, fieldBackgroundMixin, focusedDisabled, getColorSchemeForSeed, iconSize, lazyChunk, paperMixin, useDebouncedCallback, useOutsideAlerter, usePortalContainer } from "@rebasepro/ui";
|
|
5
6
|
import { CollectionRegistry, DEFAULT_ONE_OF_TYPE, DEFAULT_ONE_OF_VALUE, canReadCollection, enumToObjectEntries, getArrayResolvedProperties, getDefaultValueFor, getDefaultValueFortype, getDefaultValuesFor, getEntityChildViews, getLabelOrConfigFrom, getReferenceFrom, getRelationFrom, getRelationTargetPath, getSubcollections, getTableName, isPropertyBuilder, normalizeOrderBy, normalizeToEntityRelation, resolveArrayProperties, resolveEnumValues, resolveProperty, resolveRelationProperty, resolveStorageFilenameString, resolveStoragePathString, resolveStorageSource, serializeOrderBy } from "@rebasepro/common";
|
|
6
|
-
import { CONTAINER_FULL_WIDTH, CollectionScopeProvider, DEFAULT_PAGE_SIZE, EntityDisplayCache, ErrorTooltip, ErrorView, IconForView, PluginProviderStack, SIDE_PANEL_DEFAULT_WIDTH, StorageSourceContext, UnsavedChangesDialog, UserDisplay, addInitialSlash, apiBaseOf, buildEnumLabel, createFormexStub, deleteEntityWithCallbacks, entityDisplayKey, flattenKeys, getAdminEntityChildViews, getCollectionBySlugWithin, getCollectionPathsCombinations, getColorScheme, getColumnKeysForProperty, getDisplayPropertyKey, getDisplayResolver, getEntityFromCache, getEntityFromMemoryCache, getEntityImagePreviewPropertyKey, getEntityPreviewKeys, getFormFieldKeys, getIcon, getLastSegment as getLastSegment$1, getLeadingRelationTitleKey, getLocalChangesBackup, getNavigationEntriesFromPath, getParentReferencesFromPath, getPropertyInPath, getRedundantChildViewColumnIds, getRelationIncludeParams, getRowHeight, getTitlePropertyCandidates, getTitlePropertyKey, getTitlePropertyKeyForValues, hasDeclaredDisplay, iconsSearch, isDisabled, isFilterableRelation, isHidden, isReadOnly, looksLikeIdentifierValue, removeEntityFromCache, removeEntityFromMemoryCache, removeInitialAndTrailingSlashes, removeInitialAndTrailingSlashes as removeInitialAndTrailingSlashes$1, removeInitialSlash, removeTrailingSlash, removeTrailingSlash as removeTrailingSlash$1, resolveCollectionPathIds, resolveCollectionPathIds as resolveCollectionPathIds$1, resolveComponentRef, resolveDefaultSelectedView, resolveFilterOperators, resolveFormLayout, saveEntityToCache, saveEntityToMemoryCache, saveEntityWithCallbacks, useAnalyticsController, useApiBase, useApiConfig, useAuthController, useCollectionScope, useColumnIds, useComponentOverride, useCustomizationController, useData, useDataTableController, useFetch, useLargeLayout, useModeController, useNavigationBlocker, usePermissions, useRebaseClient, useRebaseContext, useRelationSelector, useResolvedComponent, useScrollRestoration, useSlot, useSnackbarController, useStorageSource, useStorageSources, useStorageUploadController, useTranslation, useUnsavedChangesDialog, useUserConfigurationPersistence } from "@rebasepro/app";
|
|
7
|
+
import { CONTAINER_FULL_WIDTH, CollectionScopeProvider, DEFAULT_PAGE_SIZE, EntityDisplayCache, ErrorTooltip, ErrorView, IconForView, PluginProviderStack, SIDE_PANEL_DEFAULT_WIDTH, StorageSourceContext, UnsavedChangesDialog, UserDisplay, addInitialSlash, apiBaseOf, buildEnumLabel, createFormexStub, deleteEntityWithCallbacks, entityDisplayKey, flattenKeys, getAdminEntityChildViews, getCollectionBySlugWithin, getCollectionPathsCombinations, getColorScheme, getColumnKeysForProperty, getDisplayPropertyKey, getDisplayResolver, getEntityFromCache, getEntityFromMemoryCache, getEntityImagePreviewPropertyKey, getEntityPreviewKeys, getFormFieldKeys, getIcon, getLastSegment as getLastSegment$1, getLeadingRelationTitleKey, getLocalChangesBackup, getNavigationEntriesFromPath, getParentReferencesFromPath, getPropertyInPath, getRedundantChildViewColumnIds, getRelationIncludeParams, getRowHeight, getTitlePropertyCandidates, getTitlePropertyKey, getTitlePropertyKeyForValues, hasDeclaredDisplay, iconsSearch, isDisabled, isFilterableRelation, isHidden, isReadOnly, looksLikeIdentifierValue, removeEntityFromCache, removeEntityFromMemoryCache, removeInitialAndTrailingSlashes, removeInitialAndTrailingSlashes as removeInitialAndTrailingSlashes$1, removeInitialSlash, removeTrailingSlash, removeTrailingSlash as removeTrailingSlash$1, resolveCollectionPathIds, resolveCollectionPathIds as resolveCollectionPathIds$1, resolveComponentRef, resolveDefaultSelectedView, resolveFilterOperators, resolveFormLayout, saveEntityToCache, saveEntityToMemoryCache, saveEntityWithCallbacks, useAnalyticsController, useApiBase, useApiConfig, useAuthController, useBridgeRegistration, useCollectionScope, useColumnIds, useComponentOverride, useCustomizationController, useData, useDataTableController, useFetch, useLargeLayout, useModeController, useNavigationBlocker, usePermissions, useRebaseClient, useRebaseContext, useRelationSelector, useResolvedComponent, useScrollRestoration, useSlot, useSnackbarController, useStorageSource, useStorageSources, useStorageUploadController, useTranslation, useUnsavedChangesDialog, useUserConfigurationPersistence } from "@rebasepro/app";
|
|
7
8
|
import { Field, Formex, getIn, setIn, useCreateFormex, useFormex } from "@rebasepro/forms";
|
|
8
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import {
|
|
10
|
+
import { EntityReference, EntityRelation, GeoPoint, MAX_LIST_LIMIT, Vector, getCollectionDataPath, getDataSourceCapabilities, isRelationalCollectionConfig, resourceKeyOf } from "@rebasepro/types";
|
|
11
|
+
import { defaultDateFormat, formatRelativeTime, getHashValue, getValueInPath, hydrateRegExp, isArrayValue, isObject, isPrototypePollutingKey, mergeDeep, pathTraversesPrototype, prettifyIdentifier, randomString, readStoredJson, toArray, writeStoredJson } from "@rebasepro/utils";
|
|
10
12
|
import { resolveAdminCollection } from "@rebasepro/cms-types";
|
|
11
13
|
import { format } from "date-fns";
|
|
12
14
|
import { Command } from "cmdk";
|
|
13
15
|
import { useDropzone } from "react-dropzone";
|
|
14
|
-
import { EntityReference, EntityRelation, GeoPoint, MAX_LIST_LIMIT, Vector, getCollectionDataPath, getDataSourceCapabilities, isRelationalCollectionConfig } from "@rebasepro/types";
|
|
15
16
|
import { z } from "zod";
|
|
16
17
|
import useMeasure from "react-use-measure";
|
|
17
18
|
import { Link, useLocation, useNavigate, useSearchParams } from "react-router";
|
|
@@ -577,30 +578,6 @@ function EmptyValue({ className }) {
|
|
|
577
578
|
return /* @__PURE__ */ jsx("div", { className: "rounded-full bg-surface-200 bg-opacity-30 bg-surface-200/30 dark:bg-opacity-20 dark:bg-surface-200/20 w-5 h-2 inline-block" });
|
|
578
579
|
}
|
|
579
580
|
//#endregion
|
|
580
|
-
//#region src/preview/util.ts
|
|
581
|
-
function sanitizeUrl(url) {
|
|
582
|
-
if (!url) return "about:blank";
|
|
583
|
-
const trimmed = url.trim();
|
|
584
|
-
if (/^(?:javascript|data|vbscript):/i.test(trimmed)) return "about:blank";
|
|
585
|
-
return trimmed;
|
|
586
|
-
}
|
|
587
|
-
function getThumbnailMeasure(size) {
|
|
588
|
-
if (size === "small") return 40;
|
|
589
|
-
else if (size === "medium") return 100;
|
|
590
|
-
else if (size === "large") return 200;
|
|
591
|
-
else throw Error("Thumbnail size not mapped");
|
|
592
|
-
}
|
|
593
|
-
function getPreviewSizeFrom(size) {
|
|
594
|
-
switch (size) {
|
|
595
|
-
case "xs":
|
|
596
|
-
case "s": return "small";
|
|
597
|
-
case "m": return "medium";
|
|
598
|
-
case "l":
|
|
599
|
-
case "xl": return "large";
|
|
600
|
-
default: throw Error("Missing mapping value in getPreviewSizeFrom: " + size);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
//#endregion
|
|
604
581
|
//#region src/preview/components/ImagePreview.tsx
|
|
605
582
|
/**
|
|
606
583
|
* @group Preview components
|
|
@@ -3181,7 +3158,7 @@ var PropertyPreview = React.memo(function PropertyPreview(props) {
|
|
|
3181
3158
|
content = /* @__PURE__ */ jsx(StorageThumbnail, {
|
|
3182
3159
|
interactive,
|
|
3183
3160
|
storeUrl: property.storage?.storeUrl ?? false,
|
|
3184
|
-
storageSourceKey: stringProperty.storage.storageSource,
|
|
3161
|
+
storageSourceKey: stringProperty.storage.storageSource === void 0 ? void 0 : resourceKeyOf(stringProperty.storage.storageSource),
|
|
3185
3162
|
size: props.size,
|
|
3186
3163
|
fill,
|
|
3187
3164
|
storagePathOrDownloadUrl: filePath
|
|
@@ -3461,11 +3438,12 @@ function FieldHelperText({ error, showError, property, includeDescription = true
|
|
|
3461
3438
|
* Render the label of with an icon and the title of a property
|
|
3462
3439
|
* @group Form custom fields
|
|
3463
3440
|
*/
|
|
3464
|
-
var LabelWithIcon = forwardRef(({ icon, title, small, className, required }, ref) => {
|
|
3441
|
+
var LabelWithIcon = forwardRef(({ icon, title, small, className, required, labelId }, ref) => {
|
|
3465
3442
|
return /* @__PURE__ */ jsxs("div", {
|
|
3466
3443
|
ref,
|
|
3467
3444
|
className: cls("align-middle inline-flex items-center my-0.5", small ? "gap-1" : "gap-2", className),
|
|
3468
3445
|
children: [icon, /* @__PURE__ */ jsx("span", {
|
|
3446
|
+
id: labelId,
|
|
3469
3447
|
className: `text-start font-medium text-${small ? "base" : "sm"} origin-top-left transform ${small ? "translate-x-2 scale-75" : ""}`,
|
|
3470
3448
|
children: (title ?? "") + (required ? " *" : "")
|
|
3471
3449
|
})]
|
|
@@ -5429,6 +5407,20 @@ function RelationSelectorBindingComponent({ propertyKey, internalValue, updateVa
|
|
|
5429
5407
|
//#endregion
|
|
5430
5408
|
//#region src/form/validation.ts
|
|
5431
5409
|
/** Whether an authored relation yields many rows. Derived from its kind. */
|
|
5410
|
+
/**
|
|
5411
|
+
* What to call this field in a validation message.
|
|
5412
|
+
*
|
|
5413
|
+
* `property.name` is the author's label and is optional — a headless project has
|
|
5414
|
+
* no panel and no reason to invent display names. Every message here
|
|
5415
|
+
* interpolated it directly, so an unnamed property produced
|
|
5416
|
+
* "undefined must be min 3 characters long" in front of a user.
|
|
5417
|
+
*
|
|
5418
|
+
* The fallback is the field's own key, prettified the same way the panel derives
|
|
5419
|
+
* a column header, so the message names the field the author would recognise.
|
|
5420
|
+
*/
|
|
5421
|
+
function fieldLabel$1(property, name) {
|
|
5422
|
+
return property.name ?? (name ? prettifyIdentifier(name) : "This field");
|
|
5423
|
+
}
|
|
5432
5424
|
function relationCardinality$1(relation) {
|
|
5433
5425
|
if (!relation) return void 0;
|
|
5434
5426
|
if (relation.kind === "via") return relation.cardinality;
|
|
@@ -5506,8 +5498,8 @@ function getZodStringSchema({ property, parentProperty, customFieldValidator, na
|
|
|
5506
5498
|
}
|
|
5507
5499
|
if (isRequired && !property.enum) schema = schema.refine((value) => value !== void 0 && value !== null && value !== "", { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
5508
5500
|
if (validation) {
|
|
5509
|
-
if (validation.min || validation.min === 0) schema = schema.refine((value) => value == null || typeof value === "string" && value.length >= validation.min, { message: `${property
|
|
5510
|
-
if (validation.max || validation.max === 0) schema = schema.refine((value) => value == null || typeof value === "string" && value.length <= validation.max, { message: `${property
|
|
5501
|
+
if (validation.min || validation.min === 0) schema = schema.refine((value) => value == null || typeof value === "string" && value.length >= validation.min, { message: `${fieldLabel$1(property, name)} must be min ${validation.min} characters long` });
|
|
5502
|
+
if (validation.max || validation.max === 0) schema = schema.refine((value) => value == null || typeof value === "string" && value.length <= validation.max, { message: `${fieldLabel$1(property, name)} must be max ${validation.max} characters long` });
|
|
5511
5503
|
if (validation.matches) {
|
|
5512
5504
|
const regExp = typeof validation.matches === "string" ? hydrateRegExp(validation.matches) : validation.matches;
|
|
5513
5505
|
if (regExp) schema = schema.refine((value) => value == null || typeof value === "string" && regExp.test(value), { message: validation.matchesMessage ?? "Invalid format" });
|
|
@@ -5515,7 +5507,7 @@ function getZodStringSchema({ property, parentProperty, customFieldValidator, na
|
|
|
5515
5507
|
if (validation.trim) schema = z.preprocess((v) => typeof v === "string" ? v.trim() : v, schema);
|
|
5516
5508
|
if (validation.lowercase) schema = z.preprocess((v) => typeof v === "string" ? v.toLowerCase() : v, schema);
|
|
5517
5509
|
if (validation.uppercase) schema = z.preprocess((v) => typeof v === "string" ? v.toUpperCase() : v, schema);
|
|
5518
|
-
if (property.email) schema = schema.refine((value) => value == null || typeof value === "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value), { message: `${property
|
|
5510
|
+
if (property.email) schema = schema.refine((value) => value == null || typeof value === "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value), { message: `${fieldLabel$1(property, name)} must be an email` });
|
|
5519
5511
|
if (property.url) if (!property.storage || property.storage?.storeUrl) schema = schema.refine((value) => {
|
|
5520
5512
|
if (value == null) return true;
|
|
5521
5513
|
try {
|
|
@@ -5524,8 +5516,8 @@ function getZodStringSchema({ property, parentProperty, customFieldValidator, na
|
|
|
5524
5516
|
} catch {
|
|
5525
5517
|
return false;
|
|
5526
5518
|
}
|
|
5527
|
-
}, { message: `${property
|
|
5528
|
-
else console.warn(`Property ${property
|
|
5519
|
+
}, { message: `${fieldLabel$1(property, name)} must be a url` });
|
|
5520
|
+
else console.warn(`Property ${fieldLabel$1(property, name)} has a url validation but its storage configuration is not set to store urls`);
|
|
5529
5521
|
}
|
|
5530
5522
|
return schema;
|
|
5531
5523
|
}
|
|
@@ -5539,13 +5531,13 @@ function getZodNumberSchema({ property, parentProperty, customFieldValidator, na
|
|
|
5539
5531
|
}, z.number({ error: "Must be a number" }).nullable());
|
|
5540
5532
|
if (validation?.required || property.isId === true || property.isId === "manual") schema = schema.refine((value) => value !== void 0 && value !== null, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
5541
5533
|
if (validation) {
|
|
5542
|
-
if (validation.min || validation.min === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value >= validation.min, { message: `${property
|
|
5543
|
-
if (validation.max || validation.max === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value <= validation.max, { message: `${property
|
|
5544
|
-
if (validation.lessThan || validation.lessThan === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value < validation.lessThan, { message: `${property
|
|
5545
|
-
if (validation.moreThan || validation.moreThan === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value > validation.moreThan, { message: `${property
|
|
5546
|
-
if (validation.positive) schema = schema.refine((value) => value == null || typeof value === "number" && value > 0, { message: `${property
|
|
5547
|
-
if (validation.negative) schema = schema.refine((value) => value == null || typeof value === "number" && value < 0, { message: `${property
|
|
5548
|
-
if (validation.integer) schema = schema.refine((value) => value == null || typeof value === "number" && Number.isInteger(value), { message: `${property
|
|
5534
|
+
if (validation.min || validation.min === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value >= validation.min, { message: `${fieldLabel$1(property, name)} must be higher or equal to ${validation.min}` });
|
|
5535
|
+
if (validation.max || validation.max === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value <= validation.max, { message: `${fieldLabel$1(property, name)} must be lower or equal to ${validation.max}` });
|
|
5536
|
+
if (validation.lessThan || validation.lessThan === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value < validation.lessThan, { message: `${fieldLabel$1(property, name)} must be higher than ${validation.lessThan}` });
|
|
5537
|
+
if (validation.moreThan || validation.moreThan === 0) schema = schema.refine((value) => value == null || typeof value === "number" && value > validation.moreThan, { message: `${fieldLabel$1(property, name)} must be lower than ${validation.moreThan}` });
|
|
5538
|
+
if (validation.positive) schema = schema.refine((value) => value == null || typeof value === "number" && value > 0, { message: `${fieldLabel$1(property, name)} must be positive` });
|
|
5539
|
+
if (validation.negative) schema = schema.refine((value) => value == null || typeof value === "number" && value < 0, { message: `${fieldLabel$1(property, name)} must be negative` });
|
|
5540
|
+
if (validation.integer) schema = schema.refine((value) => value == null || typeof value === "number" && Number.isInteger(value), { message: `${fieldLabel$1(property, name)} must be an integer` });
|
|
5549
5541
|
}
|
|
5550
5542
|
return schema;
|
|
5551
5543
|
}
|
|
@@ -5561,8 +5553,8 @@ function getZodDateSchema({ property, parentProperty, customFieldValidator, name
|
|
|
5561
5553
|
const validation = property.validation;
|
|
5562
5554
|
if (validation) {
|
|
5563
5555
|
if (validation.required) schema = schema.refine((value) => value !== void 0 && value !== null, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
5564
|
-
if (validation.min) schema = schema.refine((value) => value == null || value instanceof Date && value >= validation.min, { message: `${property
|
|
5565
|
-
if (validation.max) schema = schema.refine((value) => value == null || value instanceof Date && value <= validation.max, { message: `${property
|
|
5556
|
+
if (validation.min) schema = schema.refine((value) => value == null || value instanceof Date && value >= validation.min, { message: `${fieldLabel$1(property, name)} must be after ${validation.min}` });
|
|
5557
|
+
if (validation.max) schema = schema.refine((value) => value == null || value instanceof Date && value <= validation.max, { message: `${fieldLabel$1(property, name)} must be before ${validation.min}` });
|
|
5566
5558
|
}
|
|
5567
5559
|
return schema;
|
|
5568
5560
|
}
|
|
@@ -5640,18 +5632,18 @@ function getZodArraySchema({ property, parentProperty, customFieldValidator, nam
|
|
|
5640
5632
|
}
|
|
5641
5633
|
const arrayUniqueFields = hasUniqueInArrayModifier(property.of);
|
|
5642
5634
|
if (arrayUniqueFields) {
|
|
5643
|
-
if (typeof arrayUniqueFields === "boolean") arraySchema = arraySchema.refine((values) => !values || !Array.isArray(values) || values.length === new Set(values).size, { message: `${property
|
|
5635
|
+
if (typeof arrayUniqueFields === "boolean") arraySchema = arraySchema.refine((values) => !values || !Array.isArray(values) || values.length === new Set(values).size, { message: `${fieldLabel$1(property, name)} should have unique values within the array` });
|
|
5644
5636
|
else if (Array.isArray(arrayUniqueFields)) arrayUniqueFields.forEach(([fieldName, childProperty]) => {
|
|
5645
|
-
arraySchema = arraySchema.refine((values) => !values || !Array.isArray(values) || values.length === new Set(values.map((v) => v && typeof v === "object" ? v[fieldName] : v)).size, { message: `${property
|
|
5637
|
+
arraySchema = arraySchema.refine((values) => !values || !Array.isArray(values) || values.length === new Set(values.map((v) => v && typeof v === "object" ? v[fieldName] : v)).size, { message: `${fieldLabel$1(property, name)} → ${childProperty.name ?? fieldName}: should have unique values within the array` });
|
|
5646
5638
|
});
|
|
5647
5639
|
}
|
|
5648
5640
|
}
|
|
5649
5641
|
const validation = property.validation;
|
|
5650
5642
|
if (validation) {
|
|
5651
5643
|
if (validation.required) arraySchema = arraySchema.refine((value) => value !== void 0 && value !== null && Array.isArray(value) && value.length > 0, { message: validation?.requiredMessage ? validation.requiredMessage : "Required" });
|
|
5652
|
-
if (validation.min || validation.min === 0) arraySchema = arraySchema.refine((value) => !value || !Array.isArray(value) || value.length >= validation.min, { message: `${property
|
|
5653
|
-
if (validation.max) arraySchema = arraySchema.refine((value) => !value || !Array.isArray(value) || value.length <= validation.max, { message: `${property
|
|
5654
|
-
if (validation.uniqueInArray) arraySchema = arraySchema.refine((values) => !values || !Array.isArray(values) || values.length === new Set(values).size, { message: `${property
|
|
5644
|
+
if (validation.min || validation.min === 0) arraySchema = arraySchema.refine((value) => !value || !Array.isArray(value) || value.length >= validation.min, { message: `${fieldLabel$1(property, name)} should be min ${validation.min} entries long` });
|
|
5645
|
+
if (validation.max) arraySchema = arraySchema.refine((value) => !value || !Array.isArray(value) || value.length <= validation.max, { message: `${fieldLabel$1(property, name)} should be max ${validation.max} entries long` });
|
|
5646
|
+
if (validation.uniqueInArray) arraySchema = arraySchema.refine((values) => !values || !Array.isArray(values) || values.length === new Set(values).size, { message: `${fieldLabel$1(property, name)} should have unique values within the array` });
|
|
5655
5647
|
}
|
|
5656
5648
|
return arraySchema;
|
|
5657
5649
|
}
|
|
@@ -9163,6 +9155,13 @@ var ConfigControllerProvider = React.memo(function ConfigControllerProvider({ ch
|
|
|
9163
9155
|
authController.user,
|
|
9164
9156
|
collectionConfigController.collections
|
|
9165
9157
|
]);
|
|
9158
|
+
useBridgeRegistration("schemaEditing", useMemo(() => ({
|
|
9159
|
+
available: !collectionConfigController.readOnly,
|
|
9160
|
+
updateCollection: (collectionId, patch) => collectionConfigController.updateCollection({
|
|
9161
|
+
id: collectionId,
|
|
9162
|
+
collectionData: patch
|
|
9163
|
+
})
|
|
9164
|
+
}), [collectionConfigController]));
|
|
9166
9165
|
const onFetchTableMetadata = useCallback(async (tableName) => {
|
|
9167
9166
|
return databaseAdmin?.fetchTableMetadata?.(tableName);
|
|
9168
9167
|
}, [databaseAdmin]);
|
|
@@ -9427,8 +9426,8 @@ function EditorCollectionAction({ path, parentCollectionSlugs, parentEntityIds,
|
|
|
9427
9426
|
}
|
|
9428
9427
|
//#endregion
|
|
9429
9428
|
//#region src/components/CollectionViewBinding/CollectionViewActions.tsx
|
|
9430
|
-
var ImportCollectionAction = lazyChunk(() => import("./import-
|
|
9431
|
-
var ExportCollectionAction = lazyChunk(() => import("./export
|
|
9429
|
+
var ImportCollectionAction = lazyChunk(() => import("./import-DTkXNoBg.js").then((n) => n.t).then((m) => ({ default: m.ImportCollectionAction })));
|
|
9430
|
+
var ExportCollectionAction = lazyChunk(() => import("./export--arni_VY.js").then((n) => n.t).then((m) => ({ default: m.ExportCollectionAction })));
|
|
9432
9431
|
function CollectionViewActions({ collection, relativePath, parentCollectionSlugs, parentEntityIds, onNewClick, onAddExistingClick, onMultipleDeleteClick, selectionEnabled, path, selectionController, tableController, collectionEntitiesCount, compact, children, openNewDocument }) {
|
|
9433
9432
|
const context = useAdminContext();
|
|
9434
9433
|
const { canCreate, canDelete } = usePermissions();
|
|
@@ -11776,7 +11775,7 @@ function JsonPreviewBinding({ values }) {
|
|
|
11776
11775
|
}
|
|
11777
11776
|
//#endregion
|
|
11778
11777
|
//#region src/components/EntityInspector.tsx
|
|
11779
|
-
var EntityHistoryView = lazyChunk(() => import("./history-
|
|
11778
|
+
var EntityHistoryView = lazyChunk(() => import("./history-C2TpoQwi.js").then((m) => ({ default: m.EntityHistoryView })));
|
|
11780
11779
|
/**
|
|
11781
11780
|
* Raw values and revision history, as an inspector rather than as tabs.
|
|
11782
11781
|
*
|
|
@@ -12974,9 +12973,9 @@ function useBoardDataController({ fullPath, collection, columnProperty, columns,
|
|
|
12974
12973
|
if (isBEmpty) return -1;
|
|
12975
12974
|
return valA < valB ? -1 : valA > valB ? 1 : 0;
|
|
12976
12975
|
});
|
|
12977
|
-
if (currentCollection.
|
|
12976
|
+
if (currentCollection.browserCallbacks?.afterRead) try {
|
|
12978
12977
|
processed = await Promise.all(processed.map(async (entity) => {
|
|
12979
|
-
const processedRow = await currentCollection.
|
|
12978
|
+
const processedRow = await currentCollection.browserCallbacks.afterRead({
|
|
12980
12979
|
collection: currentCollection,
|
|
12981
12980
|
path: currentResolvedPath,
|
|
12982
12981
|
row: {
|
|
@@ -14011,7 +14010,7 @@ function ViewModeToggle({ viewMode = "table", onViewModeChange, enabledViews = A
|
|
|
14011
14010
|
}
|
|
14012
14011
|
//#endregion
|
|
14013
14012
|
//#region src/components/DeleteEntityDialog.tsx
|
|
14014
|
-
function DeleteEntityDialog({ entityOrEntitiesToDelete, collection, onClose, open,
|
|
14013
|
+
function DeleteEntityDialog({ entityOrEntitiesToDelete, collection, onClose, open, onEntityDelete, onMultipleEntitiesDelete, path, variant = "delete" }) {
|
|
14015
14014
|
useAuthController();
|
|
14016
14015
|
const dataClient = useData();
|
|
14017
14016
|
useCustomizationController();
|
|
@@ -14040,14 +14039,12 @@ function DeleteEntityDialog({ entityOrEntitiesToDelete, collection, onClose, ope
|
|
|
14040
14039
|
data: dataClient,
|
|
14041
14040
|
entity,
|
|
14042
14041
|
collection,
|
|
14043
|
-
callbacks,
|
|
14044
14042
|
onDeleteSuccess,
|
|
14045
14043
|
onDeleteFailure,
|
|
14046
14044
|
context
|
|
14047
14045
|
}), [
|
|
14048
14046
|
dataClient,
|
|
14049
14047
|
collection,
|
|
14050
|
-
callbacks,
|
|
14051
14048
|
onDeleteSuccess,
|
|
14052
14049
|
onDeleteFailure,
|
|
14053
14050
|
context
|
|
@@ -14375,7 +14372,6 @@ function buildRemoveEntityAction({ key, name, icon, variant }) {
|
|
|
14375
14372
|
entityOrEntitiesToDelete: entity,
|
|
14376
14373
|
path,
|
|
14377
14374
|
collection,
|
|
14378
|
-
callbacks: collection.callbacks,
|
|
14379
14375
|
variant,
|
|
14380
14376
|
open,
|
|
14381
14377
|
onEntityDelete: () => {
|
|
@@ -14426,7 +14422,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14426
14422
|
const canSubmit = mode === "email" || password.length > 0 && passwordsMatch;
|
|
14427
14423
|
const handleConfirm = async () => {
|
|
14428
14424
|
if (mode === "manual" && !passwordsMatch) {
|
|
14429
|
-
setError(t("passwords_dont_match"
|
|
14425
|
+
setError(t("passwords_dont_match", { defaultValue: "Passwords don't match" }));
|
|
14430
14426
|
return;
|
|
14431
14427
|
}
|
|
14432
14428
|
setLoading(true);
|
|
@@ -14449,7 +14445,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14449
14445
|
const data = await response.json();
|
|
14450
14446
|
snackbarController.open({
|
|
14451
14447
|
type: "success",
|
|
14452
|
-
message: t("reset_password_success"
|
|
14448
|
+
message: t("reset_password_success", { defaultValue: "Password reset successfully" })
|
|
14453
14449
|
});
|
|
14454
14450
|
if (data.invitationSent || data.temporaryPassword) setCreationResult({
|
|
14455
14451
|
user,
|
|
@@ -14459,7 +14455,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14459
14455
|
});
|
|
14460
14456
|
else onClose();
|
|
14461
14457
|
} catch (e) {
|
|
14462
|
-
setError(e instanceof Error ? e.message : t("error_resetting_password"
|
|
14458
|
+
setError(e instanceof Error ? e.message : t("error_resetting_password", { defaultValue: "Error resetting password" }));
|
|
14463
14459
|
} finally {
|
|
14464
14460
|
setLoading(false);
|
|
14465
14461
|
}
|
|
@@ -14479,7 +14475,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14479
14475
|
/* @__PURE__ */ jsx(DialogTitle, {
|
|
14480
14476
|
variant: "h5",
|
|
14481
14477
|
gutterBottom: false,
|
|
14482
|
-
children: t("reset_password"
|
|
14478
|
+
children: t("reset_password", { defaultValue: "Reset Password" })
|
|
14483
14479
|
}),
|
|
14484
14480
|
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsxs("div", {
|
|
14485
14481
|
className: "flex flex-col gap-4 py-2",
|
|
@@ -14502,7 +14498,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14502
14498
|
id: "reset-password-mode-email"
|
|
14503
14499
|
}), /* @__PURE__ */ jsx(Label, {
|
|
14504
14500
|
htmlFor: "reset-password-mode-email",
|
|
14505
|
-
children: t("reset_password_send_email"
|
|
14501
|
+
children: t("reset_password_send_email", { defaultValue: "Send a password reset email" })
|
|
14506
14502
|
})]
|
|
14507
14503
|
}), /* @__PURE__ */ jsxs("div", {
|
|
14508
14504
|
className: "flex items-center gap-2",
|
|
@@ -14511,7 +14507,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14511
14507
|
id: "reset-password-mode-manual"
|
|
14512
14508
|
}), /* @__PURE__ */ jsx(Label, {
|
|
14513
14509
|
htmlFor: "reset-password-mode-manual",
|
|
14514
|
-
children: t("reset_password_set_manually"
|
|
14510
|
+
children: t("reset_password_set_manually", { defaultValue: "Set a password manually" })
|
|
14515
14511
|
})]
|
|
14516
14512
|
})]
|
|
14517
14513
|
}),
|
|
@@ -14521,7 +14517,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14521
14517
|
value: password,
|
|
14522
14518
|
autoFocus: true,
|
|
14523
14519
|
autoComplete: "new-password",
|
|
14524
|
-
label: t("new_password"
|
|
14520
|
+
label: t("new_password", { defaultValue: "New Password" }),
|
|
14525
14521
|
onChange: (e) => {
|
|
14526
14522
|
setPassword(e.target.value);
|
|
14527
14523
|
setError(null);
|
|
@@ -14532,7 +14528,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14532
14528
|
value: confirmPassword,
|
|
14533
14529
|
autoComplete: "new-password",
|
|
14534
14530
|
error: confirmPassword.length > 0 && !passwordsMatch,
|
|
14535
|
-
label: t("confirm_password"
|
|
14531
|
+
label: t("confirm_password", { defaultValue: "Confirm New Password" }),
|
|
14536
14532
|
onChange: (e) => {
|
|
14537
14533
|
setConfirmPassword(e.target.value);
|
|
14538
14534
|
setError(null);
|
|
@@ -14541,7 +14537,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14541
14537
|
/* @__PURE__ */ jsx(Typography, {
|
|
14542
14538
|
variant: "caption",
|
|
14543
14539
|
color: "secondary",
|
|
14544
|
-
children: t("reset_password_set_manually_description"
|
|
14540
|
+
children: t("reset_password_set_manually_description", { defaultValue: "The password is updated immediately and no email is sent. Share it with the user securely." })
|
|
14545
14541
|
})
|
|
14546
14542
|
] }),
|
|
14547
14543
|
error && /* @__PURE__ */ jsx(Alert, {
|
|
@@ -14563,7 +14559,7 @@ function ResetPasswordActionDialog({ user, open, onClose }) {
|
|
|
14563
14559
|
onClick: handleConfirm,
|
|
14564
14560
|
loading,
|
|
14565
14561
|
disabled: !canSubmit,
|
|
14566
|
-
children: t("reset_password"
|
|
14562
|
+
children: t("reset_password", { defaultValue: "Reset Password" })
|
|
14567
14563
|
})] })
|
|
14568
14564
|
]
|
|
14569
14565
|
});
|
|
@@ -16481,7 +16477,6 @@ var CollectionViewBindingInner = React.memo(function CollectionViewBindingInner(
|
|
|
16481
16477
|
entityOrEntitiesToDelete: deleteEntityClicked,
|
|
16482
16478
|
path,
|
|
16483
16479
|
collection,
|
|
16484
|
-
callbacks: collection.callbacks,
|
|
16485
16480
|
open: Boolean(deleteEntityClicked),
|
|
16486
16481
|
onEntityDelete: internalOnEntityDelete,
|
|
16487
16482
|
onMultipleEntitiesDelete: internalOnMultipleEntitiesDelete,
|
|
@@ -17098,6 +17093,8 @@ function EditViewBinding({ entityId, ...props }) {
|
|
|
17098
17093
|
}, [handoffKey]);
|
|
17099
17094
|
const initialDirtyValues = carriesAsNew ? props.defaultValues ?? handoff.current.values : handoff.current.values;
|
|
17100
17095
|
const { canEdit: canEditHook } = usePermissions();
|
|
17096
|
+
const { t } = useTranslation();
|
|
17097
|
+
const urlController = useUrlController();
|
|
17101
17098
|
const [status, setStatus] = useState(props.copy ? "copy" : entityId ? "existing" : "new");
|
|
17102
17099
|
const canEdit = useMemo(() => {
|
|
17103
17100
|
if (status === "new" || status === "copy") return true;
|
|
@@ -17110,11 +17107,27 @@ function EditViewBinding({ entityId, ...props }) {
|
|
|
17110
17107
|
props.path
|
|
17111
17108
|
]);
|
|
17112
17109
|
if (!dataLoading && dataLoadingError) return /* @__PURE__ */ jsx(CenteredView, { children: /* @__PURE__ */ jsx(ErrorView, { error: dataLoadingError }) });
|
|
17113
|
-
if (!dataLoading && !initialDirtyValues && !entity && (status === "existing" || status === "copy")) {
|
|
17114
|
-
console.
|
|
17115
|
-
return /* @__PURE__ */ jsx(CenteredView, { children: /* @__PURE__ */
|
|
17116
|
-
|
|
17117
|
-
children:
|
|
17110
|
+
if (!dataLoading && !initialDirtyValues && !entity && !!entityId && (status === "existing" || status === "copy")) {
|
|
17111
|
+
console.warn(`Entity with id ${entityId} not found in collection ${props.path}`);
|
|
17112
|
+
return /* @__PURE__ */ jsx(CenteredView, { children: /* @__PURE__ */ jsxs("div", {
|
|
17113
|
+
className: "flex flex-col items-center gap-2 text-center",
|
|
17114
|
+
children: [
|
|
17115
|
+
/* @__PURE__ */ jsx(Typography, {
|
|
17116
|
+
variant: "label",
|
|
17117
|
+
children: t("entity_not_found")
|
|
17118
|
+
}),
|
|
17119
|
+
/* @__PURE__ */ jsx(Typography, {
|
|
17120
|
+
variant: "body2",
|
|
17121
|
+
color: "secondary",
|
|
17122
|
+
children: t("entity_not_found_body")
|
|
17123
|
+
}),
|
|
17124
|
+
/* @__PURE__ */ jsx(Button, {
|
|
17125
|
+
variant: "text",
|
|
17126
|
+
component: Link,
|
|
17127
|
+
to: urlController.buildUrlCollectionPath(props.path),
|
|
17128
|
+
children: t("back_to_collection", { name: props.collection.name ?? props.path })
|
|
17129
|
+
})
|
|
17130
|
+
]
|
|
17118
17131
|
}) });
|
|
17119
17132
|
}
|
|
17120
17133
|
const content = /* @__PURE__ */ jsx(EditViewBindingInner, {
|
|
@@ -18555,8 +18568,9 @@ function applyPluginModifyCollection(resolvedCollections, modifyCollection) {
|
|
|
18555
18568
|
* adapters mount their own admin routes and may not implement
|
|
18556
18569
|
* `POST /admin/users/:userId/reset-password`; injecting the action anyway
|
|
18557
18570
|
* would show a button that can only ever 404.
|
|
18558
|
-
* 2. **afterSave
|
|
18559
|
-
* is created with `invitationSent` or `temporaryPassword` in the
|
|
18571
|
+
* 2. **browserCallbacks.afterSave** — shows the `CreationResultDialog` when a
|
|
18572
|
+
* new user is created with `invitationSent` or `temporaryPassword` in the
|
|
18573
|
+
* response
|
|
18560
18574
|
*
|
|
18561
18575
|
* Skips injection if the collection already has the action/callback present.
|
|
18562
18576
|
*/
|
|
@@ -18581,39 +18595,44 @@ function injectAuthCollectionConfig(collections, adminPasswordResetSupported) {
|
|
|
18581
18595
|
entityActions: [...existing, injectedAction]
|
|
18582
18596
|
};
|
|
18583
18597
|
}
|
|
18584
|
-
const existingAfterSave = result.
|
|
18598
|
+
const existingAfterSave = result.browserCallbacks?.afterSave;
|
|
18599
|
+
const injectedAfterSave = {
|
|
18600
|
+
...result.browserCallbacks,
|
|
18601
|
+
afterSave: (async (props) => {
|
|
18602
|
+
await existingAfterSave?.(props);
|
|
18603
|
+
const { values, status, context } = props;
|
|
18604
|
+
if (status !== "new" && status !== "copy") return;
|
|
18605
|
+
if (!(values.invitationSent !== void 0 || values.temporaryPassword !== void 0) || !isRebaseContext(context) || !context.dialogsController) return;
|
|
18606
|
+
const { dialogsController } = context;
|
|
18607
|
+
const creationResult = {
|
|
18608
|
+
user: {
|
|
18609
|
+
uid: String(props.id),
|
|
18610
|
+
email: typeof values.email === "string" ? values.email : "",
|
|
18611
|
+
displayName: typeof values.displayName === "string" ? values.displayName : "",
|
|
18612
|
+
roles: Array.isArray(values.roles) ? values.roles : [],
|
|
18613
|
+
photoURL: typeof values.photoURL === "string" ? values.photoURL : typeof values.photoUrl === "string" ? values.photoUrl : null,
|
|
18614
|
+
providerId: "password",
|
|
18615
|
+
isAnonymous: false
|
|
18616
|
+
},
|
|
18617
|
+
invitationSent: !!values.invitationSent,
|
|
18618
|
+
temporaryPassword: typeof values.temporaryPassword === "string" ? values.temporaryPassword : void 0,
|
|
18619
|
+
emailDeliveryFailed: !!values.emailDeliveryFailed
|
|
18620
|
+
};
|
|
18621
|
+
const { closeDialog } = dialogsController.open({
|
|
18622
|
+
key: "user_creation_result",
|
|
18623
|
+
Component: () => React.createElement(CreationResultDialog, {
|
|
18624
|
+
result: creationResult,
|
|
18625
|
+
onClose: () => closeDialog()
|
|
18626
|
+
})
|
|
18627
|
+
});
|
|
18628
|
+
})
|
|
18629
|
+
};
|
|
18585
18630
|
result = {
|
|
18586
18631
|
...result,
|
|
18587
|
-
|
|
18588
|
-
|
|
18589
|
-
|
|
18590
|
-
|
|
18591
|
-
const { values, status, context } = props;
|
|
18592
|
-
if (status !== "new" && status !== "copy") return;
|
|
18593
|
-
if (!(values.invitationSent !== void 0 || values.temporaryPassword !== void 0) || !isRebaseContext(context) || !context.dialogsController) return;
|
|
18594
|
-
const { dialogsController } = context;
|
|
18595
|
-
const creationResult = {
|
|
18596
|
-
user: {
|
|
18597
|
-
uid: String(props.id),
|
|
18598
|
-
email: typeof values.email === "string" ? values.email : "",
|
|
18599
|
-
displayName: typeof values.displayName === "string" ? values.displayName : "",
|
|
18600
|
-
roles: Array.isArray(values.roles) ? values.roles : [],
|
|
18601
|
-
photoURL: typeof values.photoURL === "string" ? values.photoURL : typeof values.photoUrl === "string" ? values.photoUrl : null,
|
|
18602
|
-
providerId: "password",
|
|
18603
|
-
isAnonymous: false
|
|
18604
|
-
},
|
|
18605
|
-
invitationSent: !!values.invitationSent,
|
|
18606
|
-
temporaryPassword: typeof values.temporaryPassword === "string" ? values.temporaryPassword : void 0,
|
|
18607
|
-
emailDeliveryFailed: !!values.emailDeliveryFailed
|
|
18608
|
-
};
|
|
18609
|
-
const { closeDialog } = dialogsController.open({
|
|
18610
|
-
key: "user_creation_result",
|
|
18611
|
-
Component: () => React.createElement(CreationResultDialog, {
|
|
18612
|
-
result: creationResult,
|
|
18613
|
-
onClose: () => closeDialog()
|
|
18614
|
-
})
|
|
18615
|
-
});
|
|
18616
|
-
}
|
|
18632
|
+
browserCallbacks: injectedAfterSave,
|
|
18633
|
+
admin: {
|
|
18634
|
+
...result.admin,
|
|
18635
|
+
browserCallbacks: injectedAfterSave
|
|
18617
18636
|
}
|
|
18618
18637
|
};
|
|
18619
18638
|
return result;
|
|
@@ -19899,6 +19918,7 @@ function BlockEntry({ name, index, value, typeField, valueField, properties, aut
|
|
|
19899
19918
|
const value1 = fieldProps.field.value !== void 0 && fieldProps.field.value !== null ? fieldProps.field.value : "";
|
|
19900
19919
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Select, {
|
|
19901
19920
|
className: "mb-2",
|
|
19921
|
+
"aria-label": t("type"),
|
|
19902
19922
|
placeholder: /* @__PURE__ */ jsx(Typography, {
|
|
19903
19923
|
variant: "caption",
|
|
19904
19924
|
className: "px-4 py-2 font-medium",
|
|
@@ -20520,7 +20540,7 @@ function MarkdownEditorFieldBinding({ property, propertyKey, value, setValue, in
|
|
|
20520
20540
|
const storage = property.storage;
|
|
20521
20541
|
const storageSources = useStorageSources();
|
|
20522
20542
|
const storageSource = useMemo(() => resolveStorageSource({
|
|
20523
|
-
sourceKey: storage?.storageSource,
|
|
20543
|
+
sourceKey: storage?.storageSource === void 0 ? void 0 : resourceKeyOf(storage.storageSource),
|
|
20524
20544
|
sources: storageSources.sources,
|
|
20525
20545
|
defaultSource: defaultStorageSource
|
|
20526
20546
|
}), [
|
|
@@ -20707,6 +20727,7 @@ function MultiSelectFieldBinding({ propertyKey, value, setValue, error, showErro
|
|
|
20707
20727
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MultiSelect, {
|
|
20708
20728
|
className: "w-full",
|
|
20709
20729
|
size,
|
|
20730
|
+
"aria-label": property.name ?? propertyKey,
|
|
20710
20731
|
value: validValue ? value.map((v) => v?.toString()) : [],
|
|
20711
20732
|
disabled,
|
|
20712
20733
|
modalPopover: true,
|
|
@@ -20934,6 +20955,7 @@ function SelectFieldBinding({ propertyKey, value, setValue, error, showError, di
|
|
|
20934
20955
|
}, [setValue]);
|
|
20935
20956
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Select, {
|
|
20936
20957
|
value: value !== void 0 && value != null ? value.toString() : "",
|
|
20958
|
+
"aria-label": property.name ?? propertyKey,
|
|
20937
20959
|
disabled,
|
|
20938
20960
|
size,
|
|
20939
20961
|
fullWidth: true,
|
|
@@ -21130,6 +21152,7 @@ function FileDropComponent({ storage, disabled, onFilesAdded, multipleFilesSuppo
|
|
|
21130
21152
|
[ext]: []
|
|
21131
21153
|
}), {}) : void 0,
|
|
21132
21154
|
disabled: disabled || isDndItemDragging,
|
|
21155
|
+
multiple: multipleFilesSupported,
|
|
21133
21156
|
noDragEventsBubbling: true,
|
|
21134
21157
|
maxSize: storage.maxSize,
|
|
21135
21158
|
onDrop: onFilesAdded,
|
|
@@ -24099,7 +24122,7 @@ function toSerializableStorageConfig(storage) {
|
|
|
24099
24122
|
if (storage.includeBucketUrl !== void 0) result.includeBucketUrl = storage.includeBucketUrl;
|
|
24100
24123
|
if (storage.storeUrl !== void 0) result.storeUrl = storage.storeUrl;
|
|
24101
24124
|
if (storage.maxSize !== void 0) result.maxSize = storage.maxSize;
|
|
24102
|
-
if (storage.storageSource !== void 0) result.storageSource = storage.storageSource;
|
|
24125
|
+
if (storage.storageSource !== void 0) result.storageSource = resourceKeyOf(storage.storageSource);
|
|
24103
24126
|
return result;
|
|
24104
24127
|
}
|
|
24105
24128
|
/**
|
|
@@ -24825,8 +24848,7 @@ var DEFAULT_COLLECTION_GENERATION_ENDPOINT = "https://api.rebase.pro/collections
|
|
|
24825
24848
|
*
|
|
24826
24849
|
* @example
|
|
24827
24850
|
* ```tsx
|
|
24828
|
-
* import { RebaseCMS } from "@rebasepro/cms";
|
|
24829
|
-
* import { buildCollectionGenerationCallback } from "@rebasepro/cms/collection_editor";
|
|
24851
|
+
* import { RebaseCMS, buildCollectionGenerationCallback } from "@rebasepro/cms";
|
|
24830
24852
|
* import { useFirebaseAuthController } from "@rebasepro/firebase";
|
|
24831
24853
|
*
|
|
24832
24854
|
* const authController = useFirebaseAuthController({ firebaseApp });
|
|
@@ -24884,6 +24906,6 @@ function getFullIdPath(propertyKey, propertyNamespace) {
|
|
|
24884
24906
|
return idToPropertiesPath(propertyNamespace ? `${propertyNamespace}.${propertyKey}` : propertyKey);
|
|
24885
24907
|
}
|
|
24886
24908
|
//#endregion
|
|
24887
|
-
export {
|
|
24909
|
+
export { NAVIGATION_DEFAULT_GROUP_NAME as $, getEntityTitlePropertyKeyForEntity as $n, getCollectionBySlugWithin as $t, getFieldId as A, NumberPropertyPreview as An, convertDataToEntity as At, MapFieldBinding as B, RelationPreview as Bn, detectCsvDelimiter as Bt, EntityFormBinding as C, ReadOnlyFieldBinding as Cn, getIconForProperty as Cr, EntityCardBinding as Ct, getDefaultFieldConfig as D, ArrayOfMapsPreview as Dn, getResolvedPropertyInPath as Dr, useCollectionEditorDialogsState as Dt, DEFAULT_FIELD_CONFIGS as E, FieldHelperText as En, getPropertyInPath$1 as Er, ConfigControllerProvider as Et, SelectFieldBinding as F, ArrayOneOfPreview as Fn, ImportSaveInProgress as Ft, useSelectionDialog as G, SidePanelControllerContext as Gn, SearchIconsView as Gt, DateTimeFieldBinding as H, InlineEntityListPreview as Hn, parseCsvToObjects as Ht, RepeatFieldBinding as I, ArrayOfStringsPreview as In, IMPORT_BATCH_SIZE as It, useBuildUrlController as J, useCollectionRegistryController as Jn, BreadcrumbsProvider as Jt, SelectionTableBinding as K, useSidePanel as Kn, FieldCaption as Kt, ReferenceFieldBinding as L, ArrayPropertyEnumPreview as Ln, saveImportedEntities as Lt, TextFieldBinding as M, DatePreview as Mn, processValueMapping as Mt, SwitchFieldBinding as N, KeyValuePreview as Nn, getInferenceType as Nt, getDefaultFieldId as O, PropertyPreview as On, isReferenceProperty as Or, ImportNewPropertyFieldPreview as Ot, StorageUploadFieldBinding as P, MapPropertyPreview as Pn, useImportConfig as Pt, useResolvedCollections as Q, getEntityTitlePropertyKey as Qn, addInitialSlash as Qt, MultiSelectFieldBinding as R, ArrayEnumPreview as Rn, ImportFileUpload as Rt, isSchemaChangeCancelled as S, useClearRestoreValue as Sn, getDefaultPropertiesOrder as Sr, CollectionCardViewBinding as St, PropertyFieldBinding as T, LabelWithIcon as Tn, getPropertiesWithPropertiesOrder as Tr, useCollectionEditorController as Tt, BlockFieldBinding as U, ReferencePreview as Un, ArrayContainer as Ut, KeyValueFieldBinding as V, ArrayOfReferencesPreview as Vn, parseCsvRows as Vt, ArrayOfReferencesFieldBinding as W, EntityPreviewBinding as Wn, PropertyConfigBadge as Wt, useTopLevelNavigation as X, useResolvedUser as Xn, resolveEntityView as Xt, useBuildNavigationStateController as Y, getUserLabel as Yn, resolveEntityAction as Yt, useResolvedViews as Z, getEntityPreviewKeys as Zn, mergeEntityActions as Zt, useCollectionsConfigController as _, useNavigationStateController as _n, LABEL_ICON_SIZE as _r, editEntityAction as _t, namespaceToPropertiesPath as a, resolveCollectionPathIds$1 as an, SkeletonPropertyComponent as ar, getEntityViewWidth as at, asUnavailable as b, SelectableTableContext as bn, PropertyIdCopyTooltip as br, DetailViewBinding as bt, buildCollectionGenerationCallback as c, useSelectionController as cn, renderSkeletonImageThumbnail as cr, useSafeSnackbarController as ct, fromSerializableCollectionConfigs as d, SelectableTable as dn, ImagePreview as dr, getInitialEntityValues as dt, getCollectionPathsCombinations as en, ArrayPropertyPreview as er, useBuildCollectionRegistryController as et, fromSerializableProperties as f, CollectionRowActions as fn, EmptyValue as fr, removeEmptyContainers as ft, toSerializableProperty as g, NavigationStateContext as gn, FieldBlock as gr, deleteEntityAction as gt, toSerializableProperties as h, useUrlController as hn, RecordMeta as hr, copyEntityAction as ht, namespaceToPropertiesOrderPath as i, removeTrailingSlash$1 as in, StorageThumbnailInternal as ir, buildSidePanelsFromUrl as it, VectorFieldBinding as j, BooleanPreview as jn, flattenEntry as jt, getFieldConfig as k, UserPreview as kn, isRelationProperty as kr, DataNewPropertiesMapping as kt, validateCollectionJson as l, VirtualTableInput$1 as ln, renderSkeletonText as lr, extractTouchedValues as lt, toSerializableCollectionConfig as m, UrlContext as mn, FormRail as mr, CollectionViewBinding as mt, getFullIdPath as n, removeInitialAndTrailingSlashes$1 as nn, EnumValuesChip as nr, resolveNavigationFrom as nt, CollectionGenerationApiError as o, resolveOpenEntityMode as on, renderSkeletonCaptionText as or, useBuildSidePanel as ot, fromSerializableProperty as p, useAdminContext as pn, FormSections as pr, zodToFormErrors as pt, SideDialogs as q, CollectionRegistryContext as qn, useBreadcrumbsController as qt, idToPropertiesPath as r, removeInitialSlash as rn, StorageThumbnail as rr, useResolvedNavigationFrom as rt, DEFAULT_COLLECTION_GENERATION_ENDPOINT as s, resolveViewMode as sn, renderSkeletonIcon as sr, EditViewBinding as st, getFullId as t, getLastSegment$1 as tn, StringPropertyPreview as tr, useHistory as tt, fromSerializableCollectionConfig as u, CollectionTableBinding as un, UrlComponentPreview as ur, getChanges as ut, LiveSchemaError as v, useSideDialogsController as vn, isSelfLabellingProperty as vr, resetPasswordAction as vt, EntityForm as w, LabelWithIconAndTooltip as wn, getIconForWidget as wr, CollectionViewActions as wt, createLiveSchemaClient as x, ArrayCustomShapedFieldBinding as xn, getBracketNotation as xr, EntityViewBinding as xt, SchemaChangeCancelled as y, SideDialogsControllerContext as yn, spanClass as yr, CreationResultDialog as yt, MarkdownEditorFieldBinding as z, ArrayOfStorageComponentsPreview as zn, convertFileToJson as zt };
|
|
24888
24910
|
|
|
24889
|
-
//# sourceMappingURL=util-
|
|
24911
|
+
//# sourceMappingURL=util-DE1WQW6h.js.map
|