@rebasepro/cms 0.24.0 → 0.24.1-canary.gcb918fc
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 +3 -1
- 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.d.ts +26 -5
- package/dist/components/CollectionPanel.js +142 -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/CollectionsProvider.d.ts +44 -0
- package/dist/components/CollectionsProvider.js +137 -0
- package/dist/components/CollectionsProvider.js.map +1 -0
- package/dist/components/CollectionsScopeContext.d.ts +18 -0
- package/dist/components/CollectionsScopeContext.js +25 -0
- package/dist/components/CollectionsScopeContext.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/EntityFormPanel.d.ts +58 -0
- package/dist/components/EntityFormPanel.js +126 -0
- package/dist/components/EntityFormPanel.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 +215 -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/index.d.ts +2 -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 +256 -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 +221 -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 +3 -2
- package/dist/index.js +151 -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 +45 -0
- package/dist/util/navigation_utils.js.map +1 -0
- package/dist/util/number_format.js +33 -0
- package/dist/util/number_format.js.map +1 -0
- package/dist/util/previews.js +71 -0
- package/dist/util/previews.js.map +1 -0
- package/dist/util/propertyConfigMapper.js +83 -0
- package/dist/util/propertyConfigMapper.js.map +1 -0
- package/dist/util/property_utils.js +141 -0
- package/dist/util/property_utils.js.map +1 -0
- package/dist/util/resolutions.js +55 -0
- package/dist/util/resolutions.js.map +1 -0
- package/dist/util/view_constants.js +35 -0
- package/dist/util/view_constants.js.map +1 -0
- package/dist/util/view_mode.js +112 -0
- package/dist/util/view_mode.js.map +1 -0
- package/package.json +13 -9
- package/dist/CollectionEditorDialog-p5-I-Apu.js +0 -3669
- package/dist/CollectionEditorDialog-p5-I-Apu.js.map +0 -1
- package/dist/JsonPreviewBinding-v0w3H0fp.js.map +0 -1
- package/dist/PropertyEditView-DDB_X-00.js +0 -3837
- package/dist/PropertyEditView-DDB_X-00.js.map +0 -1
- package/dist/RouterCollectionsStudioView-SGBV4CMg.js +0 -212
- package/dist/RouterCollectionsStudioView-SGBV4CMg.js.map +0 -1
- package/dist/SchemaChangeDialog-CcFSXvkK.js.map +0 -1
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +0 -13
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +0 -8
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/editor.js.map +0 -1
- package/dist/export-DCHuPD1a.js +0 -520
- package/dist/export-DCHuPD1a.js.map +0 -1
- package/dist/history-CBd6SBRs.js +0 -314
- package/dist/history-CBd6SBRs.js.map +0 -1
- package/dist/import-DjQoRrIU.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-CCqp8ibf.js.map +0 -1
- package/dist/rolldown-runtime-D7D4PA-g.js +0 -13
- package/dist/util-BRvKFMLa.js +0 -27773
- package/dist/util-BRvKFMLa.js.map +0 -1
- package/dist/util-D7ebttKT.js.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "../hooks/navigation/utils.js";
|
|
2
|
+
import { DrawerExpansionContext } from "./drawer_expansion.js";
|
|
3
|
+
import { DrawerNavigationItem } from "./DrawerNavigationItem.js";
|
|
4
|
+
import React, { useContext } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronDownIcon, Typography, cls, iconSize } from "@rebasepro/ui";
|
|
7
|
+
import { IconForView, getIcon, useComponentOverride, useNavigationGroupLabel } from "@rebasepro/app";
|
|
8
|
+
//#region src/components/DrawerNavigationGroup.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Shared drawer navigation group component used by both DefaultDrawer and RebaseCloudDrawer.
|
|
11
|
+
* Renders a collapsible group with header and navigation items.
|
|
12
|
+
*/
|
|
13
|
+
function DrawerNavigationGroup({ group, entries, collapsed, onToggleCollapsed, drawerOpen, headerActions, onItemClick, hideHeader, icon }) {
|
|
14
|
+
const groupLabel = useNavigationGroupLabel();
|
|
15
|
+
const ResolvedDrawerNavigationItem = useComponentOverride("Shell.DrawerNavigationItem", DrawerNavigationItem);
|
|
16
|
+
const rowDrawerOpen = useContext(DrawerExpansionContext) !== null && ResolvedDrawerNavigationItem === DrawerNavigationItem ? false : drawerOpen;
|
|
17
|
+
const groupIcon = !hideHeader && drawerOpen ? getIcon(icon, void 0, void 0, "small") : void 0;
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: "my-2 mx-2 flex flex-col",
|
|
20
|
+
children: [!hideHeader && /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: cls("pl-3 pr-2 py-0.5 flex flex-row items-center transition-colors", drawerOpen ? "cursor-pointer hover:bg-surface-hover rounded-lg" : "opacity-0 invisible pointer-events-none"),
|
|
22
|
+
onClick: drawerOpen ? onToggleCollapsed : void 0,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
25
|
+
size: iconSize.small,
|
|
26
|
+
className: cls("text-surface-400 dark:text-surface-400 transition-transform duration-200 mr-1", collapsed ? "-rotate-90" : "rotate-0")
|
|
27
|
+
}),
|
|
28
|
+
groupIcon && /* @__PURE__ */ jsx("span", {
|
|
29
|
+
className: "shrink-0 mr-2 flex items-center text-surface-600 dark:text-surface-300 [&>svg]:size-4",
|
|
30
|
+
children: groupIcon
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ jsx(Typography, {
|
|
33
|
+
variant: "caption",
|
|
34
|
+
color: "secondary",
|
|
35
|
+
className: "font-semibold text-[11px] uppercase tracking-wider flex-grow line-clamp-1 text-surface-400 dark:text-surface-400",
|
|
36
|
+
children: groupLabel(group || "Views")
|
|
37
|
+
}),
|
|
38
|
+
headerActions && /* @__PURE__ */ jsx("div", {
|
|
39
|
+
onClick: (e) => e.stopPropagation(),
|
|
40
|
+
children: headerActions
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
44
|
+
className: cls("transition-all duration-200 ease-in-out", "overflow-hidden", !hideHeader && "dark:bg-transparent", "rounded-lg", !hideHeader && collapsed ? "max-h-0 opacity-0" : "max-h-[2000px] opacity-100"),
|
|
45
|
+
children: entries.map((entry) => /* @__PURE__ */ jsx(DrawerNavigationEntry, {
|
|
46
|
+
entry,
|
|
47
|
+
Item: ResolvedDrawerNavigationItem,
|
|
48
|
+
drawerOpen: rowDrawerOpen,
|
|
49
|
+
onItemClick
|
|
50
|
+
}, entry.id))
|
|
51
|
+
})]
|
|
52
|
+
}, `drawer_group_${group}`);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* One row, memoised on the entry: its icon element and click handler are made
|
|
56
|
+
* here, once per entry, so a group re-rendering (its header follows the hover)
|
|
57
|
+
* hands its rows nothing new.
|
|
58
|
+
*/
|
|
59
|
+
var DrawerNavigationEntry = React.memo(function DrawerNavigationRow({ entry, Item, drawerOpen, onItemClick }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(Item, {
|
|
61
|
+
icon: /* @__PURE__ */ jsx(IconForView, {
|
|
62
|
+
collectionOrView: entry.collection ?? entry.view,
|
|
63
|
+
size: "small"
|
|
64
|
+
}),
|
|
65
|
+
drawerOpen,
|
|
66
|
+
onClick: () => onItemClick?.(entry),
|
|
67
|
+
url: entry.url,
|
|
68
|
+
name: entry.name
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
//#endregion
|
|
72
|
+
export { DrawerNavigationGroup };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=DrawerNavigationGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerNavigationGroup.js","names":[],"sources":["../../src/components/DrawerNavigationGroup.tsx"],"sourcesContent":["import type { NavigationEntry } from \"@rebasepro/cms-types\";\nimport React, { useContext } from \"react\";\nimport { ChevronDownIcon, cls, iconSize, Typography } from \"@rebasepro/ui\";\n\nimport { IconForView, getIcon } from \"@rebasepro/app\";\nimport { DrawerNavigationItem, DrawerNavigationItemProps } from \"./DrawerNavigationItem\";\nimport { DrawerExpansionContext } from \"./drawer_expansion\";\nimport { useComponentOverride, useNavigationGroupLabel } from \"@rebasepro/app\";\nimport { NAVIGATION_DEFAULT_GROUP_NAME } from \"../hooks/navigation/utils\";\n\nexport interface DrawerNavigationGroupProps {\n /**\n * Group name to display in header\n */\n group: string;\n /**\n * Navigation entries in this group\n */\n entries: NavigationEntry[];\n /**\n * Whether the group is collapsed\n */\n collapsed: boolean;\n /**\n * Callback when collapse state should toggle\n */\n onToggleCollapsed: () => void;\n /**\n * Whether the drawer is in open (expanded) state\n */\n drawerOpen: boolean;\n /**\n * Optional actions to render in the group header (e.g., \"Add collection\" button)\n */\n headerActions?: React.ReactNode;\n /**\n * Optional callback when a navigation item is clicked\n */\n onItemClick?: (entry: NavigationEntry) => void;\n /**\n * Hide the group header (title and expandable panel)\n */\n hideHeader?: boolean;\n /**\n * Lucide icon name for the group header, from `NavigationGroupMapping.icon`.\n *\n * It decorates the header and nothing else: the entries below are untouched and\n * keep their own icons. An app that wants the categorised look — rows giving up\n * their icons to indent under the group — builds it in its own drawer, by\n * overriding `Shell.DrawerNavigationItem` and passing `indented`.\n */\n icon?: string;\n}\n\n/**\n * Shared drawer navigation group component used by both DefaultDrawer and RebaseCloudDrawer.\n * Renders a collapsible group with header and navigation items.\n */\nexport function DrawerNavigationGroup({\n group,\n entries,\n collapsed,\n onToggleCollapsed,\n drawerOpen,\n headerActions,\n onItemClick,\n hideHeader,\n icon\n}: DrawerNavigationGroupProps) {\n // The group name is the identifier everything else keys off — the icon\n // mapping, the collapse memory, `AppView.group`. Only the header is\n // translated, and only for the groups Rebase itself ships.\n const groupLabel = useNavigationGroupLabel();\n const ResolvedDrawerNavigationItem = useComponentOverride(\"Shell.DrawerNavigationItem\", DrawerNavigationItem);\n\n // Inside the stock drawer, the stock rows follow the drawer themselves (see\n // DrawerNavigationItem), so they are handed a `drawerOpen` that does not\n // change with the hover and are not re-rendered by it. An app's own row is\n // still told the drawer's state, as it always was.\n const rowsFollowDrawer = useContext(DrawerExpansionContext) !== null\n && ResolvedDrawerNavigationItem === DrawerNavigationItem;\n const rowDrawerOpen = rowsFollowDrawer ? false : drawerOpen;\n\n // The icon decorates the header, and stops there. It used to also strip the\n // entries of theirs and indent them, which made a per-app styling choice into\n // framework behaviour: every project that labelled a group with an icon lost the\n // icons on its rows, with nothing to turn it off. An app that wants that look\n // now opts into it in its own drawer — see `indented` on\n // {@link DrawerNavigationItem}.\n const groupIcon = !hideHeader && drawerOpen ? getIcon(icon, undefined, undefined, \"small\") : undefined;\n return (\n <div\n className={\"my-2 mx-2 flex flex-col\"}\n key={`drawer_group_${group}`}\n >\n {/* Group Header */}\n {!hideHeader && (\n <div\n className={cls(\"pl-3 pr-2 py-0.5 flex flex-row items-center transition-colors\",\n drawerOpen ? \"cursor-pointer hover:bg-surface-hover rounded-lg\" : \"opacity-0 invisible pointer-events-none\"\n )}\n onClick={drawerOpen ? onToggleCollapsed : undefined}\n >\n <ChevronDownIcon\n size={iconSize.small}\n className={cls(\n \"text-surface-400 dark:text-surface-400 transition-transform duration-200 mr-1\",\n collapsed ? \"-rotate-90\" : \"rotate-0\"\n )}\n />\n {groupIcon && (\n <span className=\"shrink-0 mr-2 flex items-center text-surface-600 dark:text-surface-300 [&>svg]:size-4\">\n {groupIcon}\n </span>\n )}\n <Typography\n variant={\"caption\"}\n color={\"secondary\"}\n className=\"font-semibold text-[11px] uppercase tracking-wider flex-grow line-clamp-1 text-surface-400 dark:text-surface-400\"\n >\n {groupLabel(group || NAVIGATION_DEFAULT_GROUP_NAME)}\n </Typography>\n {headerActions && (\n <div onClick={(e) => e.stopPropagation()}>\n {headerActions}\n </div>\n )}\n </div>\n )}\n\n {/* Collapsible Content */}\n <div\n className={cls(\n \"transition-all duration-200 ease-in-out\",\n \"overflow-hidden\",\n !hideHeader && \"dark:bg-transparent\",\n \"rounded-lg\",\n (!hideHeader && collapsed) ? \"max-h-0 opacity-0\" : \"max-h-[2000px] opacity-100\"\n )}\n >\n {entries.map((entry) => (\n <DrawerNavigationEntry\n key={entry.id}\n entry={entry}\n Item={ResolvedDrawerNavigationItem}\n drawerOpen={rowDrawerOpen}\n onItemClick={onItemClick}\n />\n ))}\n </div>\n </div>\n );\n}\n\n/**\n * One row, memoised on the entry: its icon element and click handler are made\n * here, once per entry, so a group re-rendering (its header follows the hover)\n * hands its rows nothing new.\n */\nconst DrawerNavigationEntry = React.memo(function DrawerNavigationRow({\n entry,\n Item,\n drawerOpen,\n onItemClick\n}: {\n entry: NavigationEntry,\n Item: React.ComponentType<DrawerNavigationItemProps>,\n drawerOpen: boolean,\n onItemClick?: (entry: NavigationEntry) => void\n}) {\n return <Item\n icon={<IconForView collectionOrView={entry.collection ?? entry.view} size={\"small\"}/>}\n drawerOpen={drawerOpen}\n onClick={() => onItemClick?.(entry)}\n url={entry.url}\n name={entry.name}\n />;\n});\n"],"mappings":";;;;;;;;;;;;AA0DA,SAAgB,sBAAsB,EAClC,OACA,SACA,WACA,mBACA,YACA,eACA,aACA,YACA,QAC2B;CAI3B,MAAM,aAAa,wBAAwB;CAC3C,MAAM,+BAA+B,qBAAqB,8BAA8B,oBAAoB;CAQ5G,MAAM,gBAFmB,WAAW,sBAAsB,MAAM,QACzD,iCAAiC,uBACC,QAAQ;CAQjD,MAAM,YAAY,CAAC,cAAc,aAAa,QAAQ,MAAM,KAAA,GAAW,KAAA,GAAW,OAAO,IAAI,KAAA;CAC7F,OACI,qBAAC,OAAD;EACI,WAAW;YADf,CAKK,CAAC,cACE,qBAAC,OAAD;GACI,WAAW,IAAI,iEACX,aAAa,qDAAqD,yCACtE;GACA,SAAS,aAAa,oBAAoB,KAAA;aAJ9C;IAMI,oBAAC,iBAAD;KACI,MAAM,SAAS;KACf,WAAW,IACP,iFACA,YAAY,eAAe,UAC/B;IACH,CAAA;IACA,aACG,oBAAC,QAAD;KAAM,WAAU;eACX;IACC,CAAA;IAEV,oBAAC,YAAD;KACI,SAAS;KACT,OAAO;KACP,WAAU;eAET,WAAW,SAAA,OAAsC;IAC1C,CAAA;IACX,iBACG,oBAAC,OAAD;KAAK,UAAU,MAAM,EAAE,gBAAgB;eAClC;IACA,CAAA;GAER;MAIT,oBAAC,OAAD;GACI,WAAW,IACP,2CACA,mBACA,CAAC,cAAc,uBACf,cACC,CAAC,cAAc,YAAa,sBAAsB,4BACvD;aAEC,QAAQ,KAAK,UACV,oBAAC,uBAAD;IAEW;IACP,MAAM;IACN,YAAY;IACC;GAChB,GALQ,MAAM,EAKd,CACJ;EACA,CAAA,CACJ;IAzDI,gBAAgB,OAyDpB;AAEb;;;;;;AAOA,IAAM,wBAAwB,MAAM,KAAK,SAAS,oBAAoB,EAClE,OACA,MACA,YACA,eAMD;CACC,OAAO,oBAAC,MAAD;EACH,MAAM,oBAAC,aAAD;GAAa,kBAAkB,MAAM,cAAc,MAAM;GAAM,MAAM;EAAS,CAAA;EACxE;EACZ,eAAe,cAAc,KAAK;EAClC,KAAK,MAAM;EACX,MAAM,MAAM;CACf,CAAA;AACL,CAAC"}
|
|
@@ -6,6 +6,14 @@ import React from "react";
|
|
|
6
6
|
export type DrawerNavigationItemProps = {
|
|
7
7
|
icon: React.ReactElement;
|
|
8
8
|
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the drawer is open, so the row shows its label rather than a
|
|
11
|
+
* tooltip. Inside `DefaultDrawer` the stock group passes `false` to the
|
|
12
|
+
* stock row, which then follows the drawer itself (its `data-expanded`
|
|
13
|
+
* attribute), so the rail floating open under the pointer re-renders no
|
|
14
|
+
* row. An overriding `Shell.DrawerNavigationItem` is still passed the
|
|
15
|
+
* drawer's state.
|
|
16
|
+
*/
|
|
9
17
|
drawerOpen: boolean;
|
|
10
18
|
url: string;
|
|
11
19
|
onClick?: () => void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useDrawerExpandedWhile } from "./drawer_expansion.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Tooltip, cls } from "@rebasepro/ui";
|
|
5
|
+
import { NavLink } from "react-router";
|
|
6
|
+
//#region src/components/DrawerNavigationItem.tsx
|
|
7
|
+
function DrawerNavigationItem({ name, icon, drawerOpen, url, onClick, indented = false }) {
|
|
8
|
+
const iconSlot = "w-[44px]";
|
|
9
|
+
const iconWrap = indented ? /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className: cls("shrink-0 h-[30px]", iconSlot),
|
|
11
|
+
"aria-hidden": true
|
|
12
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: cls("shrink-0 flex items-center justify-center h-[30px] text-surface-500 dark:text-text-secondary-dark [&>svg]:size-4 group-hover/nav:text-primary transition-colors duration-150", iconSlot),
|
|
14
|
+
children: icon
|
|
15
|
+
});
|
|
16
|
+
const [wantsTooltip, setWantsTooltip] = React.useState(false);
|
|
17
|
+
const drawerExpanded = useDrawerExpandedWhile(wantsTooltip);
|
|
18
|
+
const labelShown = drawerOpen || drawerExpanded;
|
|
19
|
+
if (labelShown && wantsTooltip) setWantsTooltip(false);
|
|
20
|
+
const listItem = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(NavLink, {
|
|
21
|
+
onClick,
|
|
22
|
+
"aria-label": name,
|
|
23
|
+
style: {
|
|
24
|
+
width: "100%",
|
|
25
|
+
transition: drawerOpen ? "width 150ms ease-in" : void 0
|
|
26
|
+
},
|
|
27
|
+
className: ({ isActive }) => cls("rounded-lg truncate group/nav", "hover:bg-surface-hover text-surface-700 dark:text-surface-300 hover:text-surface-900 dark:hover:text-white", "flex flex-row items-center", drawerOpen ? "pr-4 h-[30px]" : "h-[30px] group-data-[expanded=true]/drawer:pr-4", "font-medium text-[13px]", isActive ? "bg-primary/8 dark:bg-primary/10 text-primary dark:text-primary [&_div]:text-primary" : ""),
|
|
28
|
+
to: url,
|
|
29
|
+
children: [iconWrap, /* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: cls("text-text-primary dark:text-surface-200", drawerOpen ? "opacity-100" : "opacity-0 hidden group-data-[expanded=true]/drawer:block group-data-[expanded=true]/drawer:opacity-100", "font-inherit truncate space-x-2"),
|
|
31
|
+
children: name
|
|
32
|
+
})]
|
|
33
|
+
}) });
|
|
34
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
35
|
+
open: !labelShown && wantsTooltip,
|
|
36
|
+
onOpenChange: setWantsTooltip,
|
|
37
|
+
side: "right",
|
|
38
|
+
title: name,
|
|
39
|
+
children: listItem
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { DrawerNavigationItem };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=DrawerNavigationItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerNavigationItem.js","names":[],"sources":["../../src/components/DrawerNavigationItem.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { NavLink } from \"react-router\";\nimport { cls, Tooltip } from \"@rebasepro/ui\";\nimport { useDrawerExpandedWhile } from \"./drawer_expansion\";\n\n/**\n * Props of a drawer navigation row, named so an app overriding\n * `Shell.DrawerNavigationItem` can type its wrapper against them.\n */\nexport type DrawerNavigationItemProps = {\n icon: React.ReactElement,\n name: string,\n /**\n * Whether the drawer is open, so the row shows its label rather than a\n * tooltip. Inside `DefaultDrawer` the stock group passes `false` to the\n * stock row, which then follows the drawer itself (its `data-expanded`\n * attribute), so the rail floating open under the pointer re-renders no\n * row. An overriding `Shell.DrawerNavigationItem` is still passed the\n * drawer's state.\n */\n drawerOpen: boolean,\n url: string,\n onClick?: () => void,\n /**\n * Drop the row's icon and indent the label into the space it occupied, so the\n * row reads as a child of the group header above it.\n *\n * Nothing in the framework sets this: the stock drawer always passes `false`,\n * and an app that wants the categorised look opts into it by overriding\n * `Shell.DrawerNavigationItem` and deciding for itself which rows get it.\n */\n indented?: boolean,\n};\n\nexport function DrawerNavigationItem({\n name,\n icon,\n drawerOpen,\n url,\n onClick,\n indented = false\n}: DrawerNavigationItemProps) {\n\n // Indented rows give up the icon rather than keeping it *and* indenting: a\n // per-row icon repeated down a group is what flattens the hierarchy, since\n // every row then reads at the weight of the category above it. The indent is\n // the same 44px the icon occupied, so labels stay on the original grid and the\n // rail width does not change.\n // The slot is 44px in BOTH states, and must stay that way: the collapsed rail\n // floats open under the pointer, so anything that measures the icon off the\n // open state animates every icon as the drawer expands. A slot that was\n // `w-full` while collapsed (40px: a 72px rail, less the scroller's `px-2` and\n // the group's `mx-2`) and 44px once open moved every icon, the collapse\n // chevron and the footer avatar 2px to the right the moment you hovered the\n // rail — a whole column of chrome twitching under the cursor.\n //\n // The cost of the fixed slot is that on a collapsed row it is 4px wider than\n // the 40px row containing it, so it overflows right and centres the icon 2px\n // right of the row's own box. That shows only as a focus ring sitting 2px left\n // of the icon it rings, on a rail nobody tabs into with the drawer shut. A\n // standing 2px offset is cheaper than 2px of movement.\n const iconSlot = \"w-[44px]\";\n const iconWrap = indented\n ? <div className={cls(\"shrink-0 h-[30px]\", iconSlot)} aria-hidden={true}/>\n : <div\n className={cls(\"shrink-0 flex items-center justify-center h-[30px] text-surface-500 dark:text-text-secondary-dark [&>svg]:size-4 group-hover/nav:text-primary transition-colors duration-150\", iconSlot)}>\n {icon}\n </div>;\n\n const [wantsTooltip, setWantsTooltip] = React.useState(false);\n\n // Inside the stock drawer a row is told `drawerOpen={false}` and follows the\n // drawer itself: its label and padding through the drawer's `data-expanded`\n // attribute (the `group-data-[expanded=true]/drawer:` classes below), and\n // its tooltip mask through the drawer's expansion store — read only while\n // the tooltip wants to open, so the rail floating open under the pointer\n // re-renders no row but the one whose tooltip is up.\n const drawerExpanded = useDrawerExpandedWhile(wantsTooltip);\n const labelShown = drawerOpen || drawerExpanded;\n\n // Radix will not report a close it never noticed: while the tooltip is masked\n // the pointer can leave the row without `onOpenChange(false)` ever firing. So\n // the stale `true` is dropped on the way *into* the masked state — otherwise\n // it surfaces the moment the mask lifts, as a tooltip hanging over a rail the\n // pointer left long ago.\n if (labelShown && wantsTooltip) setWantsTooltip(false);\n\n const listItem = <div>\n <NavLink\n onClick={onClick}\n // The label below is `hidden` (display:none) while the rail is\n // collapsed, which takes it out of the accessibility tree along with\n // the row's only text — a collapsed rail was a column of links with no\n // accessible name at all. The tooltip does not cover this: Radix wires\n // a trigger to its content with `aria-describedby`, which is a\n // description rather than a name, and only while the tooltip is open —\n // and this one is masked shut whenever the drawer is open.\n //\n // Named unconditionally rather than only when collapsed: expanded, this\n // is the same string the row already displays, so the accessible name\n // stays stable across the transition instead of appearing with it.\n aria-label={name}\n style={{\n width: \"100%\",\n transition: drawerOpen ? \"width 150ms ease-in\" : undefined\n }}\n className={({ isActive }: { isActive: boolean }) => cls(\"rounded-lg truncate group/nav\",\n \"hover:bg-surface-hover text-surface-700 dark:text-surface-300 hover:text-surface-900 dark:hover:text-white\",\n \"flex flex-row items-center\",\n drawerOpen ? \"pr-4 h-[30px]\" : \"h-[30px] group-data-[expanded=true]/drawer:pr-4\",\n \"font-medium text-[13px]\",\n isActive ? \"bg-primary/8 dark:bg-primary/10 text-primary dark:text-primary [&_div]:text-primary\" : \"\"\n )}\n to={url}\n >\n\n {iconWrap}\n\n <div\n className={cls(\n \"text-text-primary dark:text-surface-200\",\n drawerOpen\n ? \"opacity-100\"\n : \"opacity-0 hidden group-data-[expanded=true]/drawer:block group-data-[expanded=true]/drawer:opacity-100\",\n \"font-inherit truncate space-x-2\"\n )}>\n {name}\n </div>\n </NavLink>\n </div>;\n\n // Per row, and always controlled. The old shared flag could only say \"every\n // tooltip\" or \"none\", and the state it needed was unreachable, so no entry\n // tooltip ever opened — leaving a bare rail of unlabelled icons. Radix decides\n // when this one wants to be open, from the pointer and from focus; the drawer\n // only masks it once the label says the same thing.\n //\n // Masked rather than withheld: dropping `open`, or the title, would move the\n // tooltip between controlled and uncontrolled as the drawer opens, which\n // strands the old state — a tooltip left up over a pointer nowhere near it.\n return <Tooltip\n open={!labelShown && wantsTooltip}\n onOpenChange={setWantsTooltip}\n side=\"right\"\n title={name}>\n {listItem}\n </Tooltip>;\n}\n"],"mappings":";;;;;;AAmCA,SAAgB,qBAAqB,EACjC,MACA,MACA,YACA,KACA,SACA,WAAW,SACe;CAoB1B,MAAM,WAAW;CACjB,MAAM,WAAW,WACX,oBAAC,OAAD;EAAK,WAAW,IAAI,qBAAqB,QAAQ;EAAG,eAAa;CAAM,CAAA,IACvE,oBAAC,OAAD;EACE,WAAW,IAAI,gLAAgL,QAAQ;YACtM;CACA,CAAA;CAET,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAS,KAAK;CAQ5D,MAAM,iBAAiB,uBAAuB,YAAY;CAC1D,MAAM,aAAa,cAAc;CAOjC,IAAI,cAAc,cAAc,gBAAgB,KAAK;CAErD,MAAM,WAAW,oBAAC,OAAD,EAAA,UACb,qBAAC,SAAD;EACa;EAYT,cAAY;EACZ,OAAO;GACH,OAAO;GACP,YAAY,aAAa,wBAAwB,KAAA;EACrD;EACA,YAAY,EAAE,eAAsC,IAAI,iCACpD,8GACA,8BACA,aAAa,kBAAkB,mDAC/B,2BACA,WAAW,wFAAwF,EACvG;EACA,IAAI;YAzBR,CA4BK,UAED,oBAAC,OAAD;GACI,WAAW,IACP,2CACA,aACM,gBACA,0GACN,iCACJ;aACC;EACA,CAAA,CACA;IACR,CAAA;CAWL,OAAO,oBAAC,SAAD;EACH,MAAM,CAAC,cAAc;EACrB,cAAc;EACd,MAAK;EACL,OAAO;YACN;CACI,CAAA;AACb"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { useAdminContext } from "../hooks/useAdminContext.js";
|
|
2
|
+
import { entityActionName, mergeEntityActions, resolveEntityActionState } from "../util/entity_actions.js";
|
|
3
|
+
import { copyEntityAction, deleteEntityAction, unlinkEntityAction } from "./common/default_entity_actions.js";
|
|
4
|
+
import { useSideDialogContext } from "./SideDialogs.js";
|
|
5
|
+
import { resolveEntityAction } from "../util/resolutions.js";
|
|
6
|
+
import { useChildViewSource } from "../hooks/useChildViewSource.js";
|
|
7
|
+
import React, { useMemo } from "react";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { AlertCircleIcon, Button, CircularProgress, DialogActions, IconButton, LoadingButton, Tooltip, Typography, iconSize } from "@rebasepro/ui";
|
|
10
|
+
import { ErrorTooltip, getIcon, useCustomizationController, usePermissions, useSnackbarController, useTranslation } from "@rebasepro/app";
|
|
11
|
+
//#region src/components/EditFormActions.tsx
|
|
12
|
+
/**
|
|
13
|
+
* The entity form's footer.
|
|
14
|
+
*
|
|
15
|
+
* It used to render in two shapes: this footer, and a `w-80 2xl:w-96` sticky
|
|
16
|
+
* side rail carrying the same Save and Discard above several hundred pixels of
|
|
17
|
+
* nothing. The rail is gone, and Save/Discard have moved to the identity bar
|
|
18
|
+
* where they stay visible while the form scrolls — so with
|
|
19
|
+
* `showDefaultActions={false}` this renders only what the bar cannot host:
|
|
20
|
+
* record actions (copy, delete, custom), plugin actions, the saving error, and
|
|
21
|
+
* the side-panel-only "save and close".
|
|
22
|
+
*/
|
|
23
|
+
function EditFormActions({ collection, path, entity, savingError, formex, disabled, status, pluginActions, openEntityMode, showDefaultActions = true, navigateBack, formContext }) {
|
|
24
|
+
const { canCreate, canDelete } = usePermissions();
|
|
25
|
+
const context = useAdminContext();
|
|
26
|
+
const sidePanelController = context.sidePanelController;
|
|
27
|
+
const sideDialogContext = useSideDialogContext();
|
|
28
|
+
const customizationController = useCustomizationController();
|
|
29
|
+
const { t } = useTranslation();
|
|
30
|
+
const childViewSource = useChildViewSource(path);
|
|
31
|
+
const isLinkedChildView = childViewSource?.kind === "relation" && childViewSource.mode === "linked";
|
|
32
|
+
return buildBottomActions({
|
|
33
|
+
savingError,
|
|
34
|
+
entity,
|
|
35
|
+
formActions: useMemo(() => {
|
|
36
|
+
const customEntityActions = (collection.entityActions ?? []).map((action) => resolveEntityAction(action, customizationController.entityActions)).filter(Boolean);
|
|
37
|
+
const createEnabled = canCreate(collection, path);
|
|
38
|
+
const deleteEnabled = entity ? canDelete(collection, path, entity) : false;
|
|
39
|
+
const disableActions = collection.disableDefaultActions ?? [];
|
|
40
|
+
const actions = [];
|
|
41
|
+
if (createEnabled && !disableActions.includes("copy")) actions.push(copyEntityAction);
|
|
42
|
+
if (deleteEnabled && !disableActions.includes("delete")) actions.push(isLinkedChildView ? unlinkEntityAction : deleteEntityAction);
|
|
43
|
+
if (customEntityActions) return mergeEntityActions(actions, customEntityActions);
|
|
44
|
+
return actions;
|
|
45
|
+
}, [
|
|
46
|
+
canCreate,
|
|
47
|
+
canDelete,
|
|
48
|
+
collection,
|
|
49
|
+
path,
|
|
50
|
+
customizationController.entityActions?.length,
|
|
51
|
+
entity,
|
|
52
|
+
collection.disableDefaultActions,
|
|
53
|
+
isLinkedChildView
|
|
54
|
+
]).filter((a) => a.includeInForm === void 0 || a.includeInForm),
|
|
55
|
+
collection,
|
|
56
|
+
context,
|
|
57
|
+
sidePanelController,
|
|
58
|
+
disabled,
|
|
59
|
+
status,
|
|
60
|
+
sideDialogContext,
|
|
61
|
+
pluginActions,
|
|
62
|
+
openEntityMode,
|
|
63
|
+
navigateBack,
|
|
64
|
+
formContext,
|
|
65
|
+
formex,
|
|
66
|
+
t,
|
|
67
|
+
showDefaultActions
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function buildBottomActions({ savingError, entity, formActions, collection, context, sidePanelController, disabled, status, sideDialogContext, pluginActions, openEntityMode, navigateBack, formContext, formex, t, showDefaultActions, className }) {
|
|
71
|
+
const hasErrors = Object.keys(formex.errors).length > 0 && formex.submitCount > 0;
|
|
72
|
+
const canClose = openEntityMode === "side_panel" || openEntityMode === "dialog";
|
|
73
|
+
const showBackToDetail = collection.defaultEntityAction === "view" && status === "existing";
|
|
74
|
+
if (!(showDefaultActions || Boolean(savingError))) return null;
|
|
75
|
+
return /* @__PURE__ */ jsxs(DialogActions, {
|
|
76
|
+
className,
|
|
77
|
+
position: "sticky",
|
|
78
|
+
children: [
|
|
79
|
+
savingError && /* @__PURE__ */ jsx("div", {
|
|
80
|
+
className: "text-right",
|
|
81
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
82
|
+
color: "error",
|
|
83
|
+
children: savingError.message
|
|
84
|
+
})
|
|
85
|
+
}),
|
|
86
|
+
formActions.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
87
|
+
className: "grow flex overflow-auto no-scrollbar",
|
|
88
|
+
children: formActions.map((action, index) => {
|
|
89
|
+
const props = {
|
|
90
|
+
view: "form",
|
|
91
|
+
entity,
|
|
92
|
+
path: collection.slug,
|
|
93
|
+
collection,
|
|
94
|
+
context,
|
|
95
|
+
sidePanelController,
|
|
96
|
+
openEntityMode,
|
|
97
|
+
navigateBack,
|
|
98
|
+
formContext
|
|
99
|
+
};
|
|
100
|
+
const { enabled: isEnabled, disabledReason } = resolveEntityActionState(action, props);
|
|
101
|
+
return /* @__PURE__ */ jsx(EntityActionButton, {
|
|
102
|
+
action,
|
|
103
|
+
enabled: isEnabled,
|
|
104
|
+
disabledReason,
|
|
105
|
+
props
|
|
106
|
+
}, action.key ?? action.name ?? index);
|
|
107
|
+
})
|
|
108
|
+
}),
|
|
109
|
+
pluginActions,
|
|
110
|
+
hasErrors ? /* @__PURE__ */ jsx(ErrorTooltip, {
|
|
111
|
+
title: "This form has errors",
|
|
112
|
+
children: /* @__PURE__ */ jsx(AlertCircleIcon, {
|
|
113
|
+
className: "ml-4 text-red-500",
|
|
114
|
+
size: iconSize.smallest
|
|
115
|
+
})
|
|
116
|
+
}) : null,
|
|
117
|
+
showBackToDetail && /* @__PURE__ */ jsx(Button, {
|
|
118
|
+
variant: "text",
|
|
119
|
+
color: "primary",
|
|
120
|
+
disabled,
|
|
121
|
+
onClick: navigateBack,
|
|
122
|
+
children: t("back_to_detail") ?? "Back to details"
|
|
123
|
+
}),
|
|
124
|
+
showDefaultActions && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
125
|
+
variant: "text",
|
|
126
|
+
color: "primary",
|
|
127
|
+
disabled: disabled || formex.isSubmitting,
|
|
128
|
+
type: "reset",
|
|
129
|
+
children: status === "existing" ? t("discard") : t("clear")
|
|
130
|
+
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
131
|
+
title: hasErrors ? t("fix_errors_before_saving") ?? "Fix highlighted errors before saving" : void 0,
|
|
132
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
133
|
+
variant: canClose ? "text" : "filled",
|
|
134
|
+
color: "primary",
|
|
135
|
+
type: "submit",
|
|
136
|
+
disabled: disabled || formex.isSubmitting,
|
|
137
|
+
onClick: () => {
|
|
138
|
+
sideDialogContext.setPendingClose(false);
|
|
139
|
+
},
|
|
140
|
+
children: [
|
|
141
|
+
status === "existing" && t("save"),
|
|
142
|
+
status === "copy" && t("create_copy"),
|
|
143
|
+
status === "new" && t("create")
|
|
144
|
+
]
|
|
145
|
+
})
|
|
146
|
+
})] }),
|
|
147
|
+
canClose && /* @__PURE__ */ jsxs(LoadingButton, {
|
|
148
|
+
variant: "filled",
|
|
149
|
+
color: "primary",
|
|
150
|
+
type: "submit",
|
|
151
|
+
loading: formex.isSubmitting,
|
|
152
|
+
disabled,
|
|
153
|
+
onClick: () => {
|
|
154
|
+
sideDialogContext.setPendingClose?.(true);
|
|
155
|
+
},
|
|
156
|
+
children: [
|
|
157
|
+
status === "existing" && t("save_and_close"),
|
|
158
|
+
status === "copy" && t("create_copy_and_close"),
|
|
159
|
+
status === "new" && t("create_and_close")
|
|
160
|
+
]
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
function EntityActionButton({ action, enabled, disabledReason, props }) {
|
|
166
|
+
const snackbarController = useSnackbarController();
|
|
167
|
+
const { t } = useTranslation();
|
|
168
|
+
const name = entityActionName(action, t);
|
|
169
|
+
const [loading, setLoading] = React.useState(false);
|
|
170
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
171
|
+
title: disabledReason ? `${name}: ${disabledReason}` : name,
|
|
172
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
173
|
+
"aria-label": name,
|
|
174
|
+
disabled: !enabled,
|
|
175
|
+
onClick: (event) => {
|
|
176
|
+
console.debug("Executing action", action.key, props);
|
|
177
|
+
try {
|
|
178
|
+
event.stopPropagation();
|
|
179
|
+
if (props.entity) {
|
|
180
|
+
const onClick = action.onClick(props);
|
|
181
|
+
if (onClick instanceof Promise) {
|
|
182
|
+
setLoading(true);
|
|
183
|
+
onClick.catch((error) => {
|
|
184
|
+
console.error("Error executing action", action.key, error);
|
|
185
|
+
snackbarController.open({
|
|
186
|
+
message: `Error executing action: ${error.message}`,
|
|
187
|
+
type: "error"
|
|
188
|
+
});
|
|
189
|
+
}).finally(() => setLoading(false));
|
|
190
|
+
} else snackbarController.open({
|
|
191
|
+
message: `Action ${name} executed successfully`,
|
|
192
|
+
type: "success"
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
} catch (e) {
|
|
196
|
+
console.error("Error executing action", action.key, e);
|
|
197
|
+
snackbarController.open({
|
|
198
|
+
message: `Error executing action: ${e instanceof Error ? e.message : String(e)}`,
|
|
199
|
+
type: "error"
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
children: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: "smallest" }) : getIcon(action.icon, void 0, void 0, "smallest")
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
export { EditFormActions };
|
|
209
|
+
|
|
210
|
+
//# sourceMappingURL=EditFormActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditFormActions.js","names":[],"sources":["../../src/components/EditFormActions.tsx"],"sourcesContent":["\n\nimport type { FormContext } from \"../types/fields\";\nimport type { EntityAction, EntityActionClickProps, SidePanelController, AdminCollection } from \"@rebasepro/cms-types\";\nimport React, { useMemo } from \"react\";\nimport { Entity } from \"@rebasepro/types\";\nimport { RebaseContext } from \"@rebasepro/cms-types\";\nimport type { EntityFormActionsProps } from \"../types/components/EntityFormActionsProps\";\nimport { copyEntityAction, deleteEntityAction, unlinkEntityAction } from \"./common/default_entity_actions\";\nimport { entityActionName, mergeEntityActions, resolveEntityActionState } from \"../util/entity_actions\";\nimport { resolveEntityAction } from \"../util/resolutions\";\nimport { Button, CircularProgress, cls, defaultBorderMixin, DialogActions, IconButton, LoadingButton, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { AlertCircleIcon, iconSize } from \"@rebasepro/ui\";\nimport {\n useCustomizationController,\n useSnackbarController,\n useTranslation\n} from \"@rebasepro/app\";\nimport { SideDialogController, useSideDialogContext } from \"./SideDialogs\";\nimport { FormexController } from \"@rebasepro/forms\";\nimport { ErrorTooltip } from \"@rebasepro/app\";\nimport { usePermissions } from \"@rebasepro/app\";\nimport { getIcon } from \"@rebasepro/app\";\nimport { useAdminContext } from \"../hooks/useAdminContext\";\nimport { useChildViewSource } from \"../hooks/useChildViewSource\";\n\n/**\n * The entity form's footer.\n *\n * It used to render in two shapes: this footer, and a `w-80 2xl:w-96` sticky\n * side rail carrying the same Save and Discard above several hundred pixels of\n * nothing. The rail is gone, and Save/Discard have moved to the identity bar\n * where they stay visible while the form scrolls — so with\n * `showDefaultActions={false}` this renders only what the bar cannot host:\n * record actions (copy, delete, custom), plugin actions, the saving error, and\n * the side-panel-only \"save and close\".\n */\nexport function EditFormActions({\n collection,\n path,\n entity,\n savingError,\n formex,\n disabled,\n status,\n pluginActions,\n openEntityMode,\n showDefaultActions = true,\n navigateBack,\n formContext\n}: EntityFormActionsProps) {\n\n const { canCreate, canDelete } = usePermissions();\n const context = useAdminContext();\n const sidePanelController = context.sidePanelController;\n const sideDialogContext = useSideDialogContext();\n const customizationController = useCustomizationController();\n const { t } = useTranslation();\n\n // Rows shared through a junction: the delete button here removes the\n // link, because that is what the server does for this path.\n const childViewSource = useChildViewSource(path);\n const isLinkedChildView = childViewSource?.kind === \"relation\" && childViewSource.mode === \"linked\";\n\n const entityActions = useMemo((): EntityAction[] => {\n const customEntityActions = (collection.entityActions ?? [])\n .map(action => resolveEntityAction(action, customizationController.entityActions))\n .filter(Boolean) as EntityAction[];\n const createEnabled = canCreate(collection, path);\n const deleteEnabled = entity ? canDelete(collection, path, entity) : false;\n const disableActions = collection.disableDefaultActions ?? [];\n const actions: EntityAction[] = [];\n if (createEnabled && !disableActions.includes(\"copy\"))\n actions.push(copyEntityAction);\n if (deleteEnabled && !disableActions.includes(\"delete\"))\n actions.push(isLinkedChildView ? unlinkEntityAction : deleteEntityAction);\n if (customEntityActions)\n return mergeEntityActions(actions, customEntityActions);\n return actions;\n }, [canCreate, canDelete, collection, path, customizationController.entityActions?.length, entity, collection.disableDefaultActions, isLinkedChildView]);\n\n // Record actions stay in the footer whether or not the bar carries Save;\n // they are things you do *to* the record, not ways to leave the form.\n const formActions = entityActions.filter(a => a.includeInForm === undefined || a.includeInForm);\n\n return buildBottomActions({\n savingError,\n entity,\n formActions,\n collection,\n context,\n sidePanelController,\n disabled,\n status,\n sideDialogContext,\n pluginActions,\n openEntityMode,\n navigateBack,\n formContext,\n formex,\n t,\n showDefaultActions\n });\n}\n\ntype ActionsViewProps<M extends Record<string, unknown>> = {\n savingError: Error | undefined,\n entity: Entity<M> | undefined,\n formActions: EntityAction[],\n collection: AdminCollection,\n context: RebaseContext,\n sidePanelController: SidePanelController,\n disabled: boolean,\n status: \"new\" | \"existing\" | \"copy\",\n sideDialogContext: SideDialogController,\n pluginActions?: React.ReactNode[],\n openEntityMode?: \"side_panel\" | \"full_screen\" | \"split\" | \"dialog\";\n navigateBack: () => void;\n formContext: FormContext,\n formex: FormexController<Record<string, unknown>>;\n t: (key: string, vars?: Record<string, string>) => string;\n showDefaultActions: boolean;\n className?: string;\n};\n\nfunction buildBottomActions<M extends Record<string, unknown>>({\n savingError,\n entity,\n formActions,\n collection,\n context,\n sidePanelController,\n disabled,\n status,\n sideDialogContext,\n pluginActions,\n openEntityMode,\n navigateBack,\n formContext,\n formex,\n t,\n showDefaultActions,\n className\n}: ActionsViewProps<M>) {\n\n const hasErrors = Object.keys(formex.errors).length > 0 && formex.submitCount > 0;\n // \"Save and close\" only means something where there is something to close.\n const canClose = openEntityMode === \"side_panel\" || openEntityMode === \"dialog\";\n const showBackToDetail = collection.defaultEntityAction === \"view\" && status === \"existing\";\n\n // When the container carries the actions — the entity view's identity bar\n // does — this renders nothing at all. A full-width bar holding a copy icon\n // and a delete icon is the same waste as the side rail it replaced: the\n // record actions moved into the bar's overflow menu, and Save, Discard and\n // \"save and close\" are buttons up there too.\n const hasContent = showDefaultActions || Boolean(savingError);\n\n if (!hasContent) return null;\n\n return <DialogActions\n className={className}\n // In normal flow at the foot of the form column, not overlaying it.\n position={\"sticky\"}>\n {savingError &&\n <div className=\"text-right\">\n <Typography color={\"error\"}>{savingError.message}</Typography>\n </div>\n }\n\n {formActions.length > 0 && <div className=\"grow flex overflow-auto no-scrollbar\">\n {formActions.map((action, index) => {\n\n const props = {\n view: \"form\",\n entity,\n // The slug, not the path a Firestore collection declares for\n // its store: actions route, copy and delete by `path`, and\n // the stored path can be another collection's slug.\n path: collection.slug,\n collection: collection,\n context,\n sidePanelController,\n openEntityMode,\n navigateBack,\n formContext\n } satisfies EntityActionClickProps<Record<string, unknown>>;\n\n const { enabled: isEnabled, disabledReason } = resolveEntityActionState(action, props);\n return (\n <EntityActionButton\n key={action.key ?? action.name ?? index}\n action={action}\n enabled={isEnabled}\n disabledReason={disabledReason}\n props={props}\n />\n );\n })}\n </div>}\n\n {pluginActions}\n\n {hasErrors ?\n <ErrorTooltip title={\"This form has errors\"}>\n <AlertCircleIcon className=\"ml-4 text-red-500\" size={iconSize.smallest}/>\n </ErrorTooltip> : null}\n\n {showBackToDetail && (\n <Button variant=\"text\"\n color=\"primary\"\n disabled={disabled}\n onClick={navigateBack}>\n {t(\"back_to_detail\") ?? \"Back to details\"}\n </Button>\n )}\n\n {showDefaultActions && <>\n <Button variant=\"text\"\n color=\"primary\"\n disabled={disabled || formex.isSubmitting}\n type=\"reset\">\n {status === \"existing\" ? t(\"discard\") : t(\"clear\")}\n </Button>\n <Tooltip title={hasErrors ? (t(\"fix_errors_before_saving\") ?? \"Fix highlighted errors before saving\") : undefined}>\n <Button variant={canClose ? \"text\" : \"filled\"}\n color=\"primary\"\n type=\"submit\"\n disabled={disabled || formex.isSubmitting}\n onClick={() => {\n sideDialogContext.setPendingClose(false);\n }}>\n {status === \"existing\" && t(\"save\")}\n {status === \"copy\" && t(\"create_copy\")}\n {status === \"new\" && t(\"create\")}\n </Button>\n </Tooltip>\n </>}\n\n {canClose && <LoadingButton variant=\"filled\"\n color=\"primary\"\n type=\"submit\"\n loading={formex.isSubmitting}\n disabled={disabled}\n onClick={() => {\n sideDialogContext.setPendingClose?.(true);\n }}>\n {status === \"existing\" && t(\"save_and_close\")}\n {status === \"copy\" && t(\"create_copy_and_close\")}\n {status === \"new\" && t(\"create_and_close\")}\n </LoadingButton>}\n </DialogActions>;\n}\n\nfunction EntityActionButton({\n action,\n enabled,\n disabledReason,\n props\n}: {\n action: EntityAction,\n enabled: boolean,\n disabledReason?: string,\n props: EntityActionClickProps<Record<string, unknown>>\n}) {\n const snackbarController = useSnackbarController();\n const { t } = useTranslation();\n const name = entityActionName(action, t);\n const [loading, setLoading] = React.useState(false);\n return <Tooltip\n title={disabledReason ? `${name}: ${disabledReason}` : name}>\n <IconButton aria-label={name}\n disabled={!enabled}\n onClick={(event) => {\n console.debug(\"Executing action\", action.key, props);\n try {\n event.stopPropagation();\n if (props.entity) {\n const onClick = action.onClick(props);\n // If the action returns a promise, we can handle it\n if (onClick instanceof Promise) {\n setLoading(true);\n onClick\n .catch((error) => {\n console.error(\"Error executing action\", action.key, error);\n snackbarController.open({\n message: `Error executing action: ${error.message}`,\n type: \"error\"\n })\n })\n .finally(() => setLoading(false));\n } else {\n snackbarController.open({\n message: `Action ${name} executed successfully`,\n type: \"success\"\n });\n }\n\n }\n } catch (e: unknown) {\n console.error(\"Error executing action\", action.key, e);\n snackbarController.open({\n message: `Error executing action: ${e instanceof Error ? e.message : String(e)}`,\n type: \"error\"\n });\n }\n }}>\n {loading ? <CircularProgress size={\"smallest\"}/> : getIcon(action.icon, undefined, undefined, \"smallest\")}\n </IconButton>\n </Tooltip>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,gBAAgB,EAC5B,YACA,MACA,QACA,aACA,QACA,UACA,QACA,eACA,gBACA,qBAAqB,MACrB,cACA,eACuB;CAEvB,MAAM,EAAE,WAAW,cAAc,eAAe;CAChD,MAAM,UAAU,gBAAgB;CAChC,MAAM,sBAAsB,QAAQ;CACpC,MAAM,oBAAoB,qBAAqB;CAC/C,MAAM,0BAA0B,2BAA2B;CAC3D,MAAM,EAAE,MAAM,eAAe;CAI7B,MAAM,kBAAkB,mBAAmB,IAAI;CAC/C,MAAM,oBAAoB,iBAAiB,SAAS,cAAc,gBAAgB,SAAS;CAuB3F,OAAO,mBAAmB;EACtB;EACA;EACA,aAxBkB,cAA8B;GAChD,MAAM,uBAAuB,WAAW,iBAAiB,CAAC,EAAA,CACrD,KAAI,WAAU,oBAAoB,QAAQ,wBAAwB,aAAa,CAAC,CAAC,CACjF,OAAO,OAAO;GACnB,MAAM,gBAAgB,UAAU,YAAY,IAAI;GAChD,MAAM,gBAAgB,SAAS,UAAU,YAAY,MAAM,MAAM,IAAI;GACrE,MAAM,iBAAiB,WAAW,yBAAyB,CAAC;GAC5D,MAAM,UAA0B,CAAC;GACjC,IAAI,iBAAiB,CAAC,eAAe,SAAS,MAAM,GAChD,QAAQ,KAAK,gBAAgB;GACjC,IAAI,iBAAiB,CAAC,eAAe,SAAS,QAAQ,GAClD,QAAQ,KAAK,oBAAoB,qBAAqB,kBAAkB;GAC5E,IAAI,qBACA,OAAO,mBAAmB,SAAS,mBAAmB;GAC1D,OAAO;EACX,GAAG;GAAC;GAAW;GAAW;GAAY;GAAM,wBAAwB,eAAe;GAAQ;GAAQ,WAAW;GAAuB;EAAiB,CAIlI,CAAA,CAAc,QAAO,MAAK,EAAE,kBAAkB,KAAA,KAAa,EAAE,aAK7E;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,CAAC;AACL;AAsBA,SAAS,mBAAsD,EAC3D,aACA,QACA,aACA,YACA,SACA,qBACA,UACA,QACA,mBACA,eACA,gBACA,cACA,aACA,QACA,GACA,oBACA,aACoB;CAEpB,MAAM,YAAY,OAAO,KAAK,OAAO,MAAM,CAAC,CAAC,SAAS,KAAK,OAAO,cAAc;CAEhF,MAAM,WAAW,mBAAmB,gBAAgB,mBAAmB;CACvE,MAAM,mBAAmB,WAAW,wBAAwB,UAAU,WAAW;CASjF,IAAI,EAFe,sBAAsB,QAAQ,WAAW,IAE3C,OAAO;CAExB,OAAO,qBAAC,eAAD;EACQ;EAEX,UAAU;YAHP;GAIF,eACG,oBAAC,OAAD;IAAK,WAAU;cACX,oBAAC,YAAD;KAAY,OAAO;eAAU,YAAY;IAAoB,CAAA;GAC5D,CAAA;GAGR,YAAY,SAAS,KAAK,oBAAC,OAAD;IAAK,WAAU;cACrC,YAAY,KAAK,QAAQ,UAAU;KAEhC,MAAM,QAAQ;MACV,MAAM;MACN;MAIA,MAAM,WAAW;MACL;MACZ;MACA;MACA;MACA;MACA;KACJ;KAEA,MAAM,EAAE,SAAS,WAAW,mBAAmB,yBAAyB,QAAQ,KAAK;KACrF,OACI,oBAAC,oBAAD;MAEY;MACR,SAAS;MACO;MACT;KACV,GALQ,OAAO,OAAO,OAAO,QAAQ,KAKrC;IAET,CAAC;GACA,CAAA;GAEJ;GAEA,YACG,oBAAC,cAAD;IAAc,OAAO;cACjB,oBAAC,iBAAD;KAAiB,WAAU;KAAoB,MAAM,SAAS;IAAU,CAAA;GAC9D,CAAA,IAAI;GAErB,oBACG,oBAAC,QAAD;IAAQ,SAAQ;IACZ,OAAM;IACI;IACV,SAAS;cACR,EAAE,gBAAgB,KAAK;GACpB,CAAA;GAGX,sBAAsB,qBAAA,UAAA,EAAA,UAAA,CACnB,oBAAC,QAAD;IAAQ,SAAQ;IACZ,OAAM;IACN,UAAU,YAAY,OAAO;IAC7B,MAAK;cACJ,WAAW,aAAa,EAAE,SAAS,IAAI,EAAE,OAAO;GAC7C,CAAA,GACR,oBAAC,SAAD;IAAS,OAAO,YAAa,EAAE,0BAA0B,KAAK,yCAA0C,KAAA;cACpG,qBAAC,QAAD;KAAQ,SAAS,WAAW,SAAS;KACjC,OAAM;KACN,MAAK;KACL,UAAU,YAAY,OAAO;KAC7B,eAAe;MACX,kBAAkB,gBAAgB,KAAK;KAC3C;eANJ;MAOK,WAAW,cAAc,EAAE,MAAM;MACjC,WAAW,UAAU,EAAE,aAAa;MACpC,WAAW,SAAS,EAAE,QAAQ;KAC3B;;GACH,CAAA,CACX,EAAA,CAAA;GAED,YAAY,qBAAC,eAAD;IAAe,SAAQ;IAChC,OAAM;IACN,MAAK;IACL,SAAS,OAAO;IACN;IACV,eAAe;KACX,kBAAkB,kBAAkB,IAAI;IAC5C;cAPS;KAQR,WAAW,cAAc,EAAE,gBAAgB;KAC3C,WAAW,UAAU,EAAE,uBAAuB;KAC9C,WAAW,SAAS,EAAE,kBAAkB;IAC9B;;EACJ;;AACnB;AAEA,SAAS,mBAAmB,EACxB,QACA,SACA,gBACA,SAMD;CACC,MAAM,qBAAqB,sBAAsB;CACjD,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,OAAO,iBAAiB,QAAQ,CAAC;CACvC,MAAM,CAAC,SAAS,cAAc,MAAM,SAAS,KAAK;CAClD,OAAO,oBAAC,SAAD;EACH,OAAO,iBAAiB,GAAG,KAAK,IAAI,mBAAmB;YACvD,oBAAC,YAAD;GAAY,cAAY;GACpB,UAAU,CAAC;GACX,UAAU,UAAU;IAChB,QAAQ,MAAM,oBAAoB,OAAO,KAAK,KAAK;IACnD,IAAI;KACA,MAAM,gBAAgB;KACtB,IAAI,MAAM,QAAQ;MACd,MAAM,UAAU,OAAO,QAAQ,KAAK;MAEpC,IAAI,mBAAmB,SAAS;OAC5B,WAAW,IAAI;OACf,QACK,OAAO,UAAU;QACd,QAAQ,MAAM,0BAA0B,OAAO,KAAK,KAAK;QACzD,mBAAmB,KAAK;SACpB,SAAS,2BAA2B,MAAM;SAC1C,MAAM;QACV,CAAC;OACL,CAAC,CAAC,CACD,cAAc,WAAW,KAAK,CAAC;MACxC,OACI,mBAAmB,KAAK;OACpB,SAAS,UAAU,KAAK;OACxB,MAAM;MACV,CAAC;KAGT;IACJ,SAAS,GAAY;KACjB,QAAQ,MAAM,0BAA0B,OAAO,KAAK,CAAC;KACrD,mBAAmB,KAAK;MACpB,SAAS,2BAA2B,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;MAC7E,MAAM;KACV,CAAC;IACL;GACJ;aACC,UAAU,oBAAC,kBAAD,EAAkB,MAAM,WAAY,CAAA,IAAI,QAAQ,OAAO,MAAM,KAAA,GAAW,KAAA,GAAW,UAAU;EAChG,CAAA;CACP,CAAA;AACb"}
|