@rebasepro/cms 0.24.0 → 0.24.1-canary.g19596ef
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 +95 -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,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
3
|
+
/**
|
|
4
|
+
* @group Components
|
|
5
|
+
*/
|
|
6
|
+
export interface CollectionsProviderProps {
|
|
7
|
+
/**
|
|
8
|
+
* The collections this scope can show and edit — `defineCollection`
|
|
9
|
+
* configs or resolved collections. Keep the array stable (a module
|
|
10
|
+
* constant, or `useMemo`): a new array is a new set of collections.
|
|
11
|
+
*/
|
|
12
|
+
collections: AdminCollection[];
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Everything a collection view or a record form needs to work in a page of
|
|
17
|
+
* your own app, without `<RebaseCMS>`, `<RebaseNavigation>` or
|
|
18
|
+
* `<RebaseShell>`: a registry of the collections you hand it, the record side
|
|
19
|
+
* panel and dialogs (rendered here), and the navigation guard.
|
|
20
|
+
*
|
|
21
|
+
* It needs `<Rebase>` above it and a React Router router — any router, at any
|
|
22
|
+
* path; a data router is not required. No CMS route serves the page, so a
|
|
23
|
+
* record opens in a side panel or a dialog over it, never by URL.
|
|
24
|
+
*
|
|
25
|
+
* `CollectionPanel` and `EntityFormPanel` given a `collection` bring one of
|
|
26
|
+
* these themselves when none is above; mount it yourself to share one between
|
|
27
|
+
* several of them, or to use the lower-level pieces (`CollectionViewBinding`,
|
|
28
|
+
* `useSidePanel`) directly.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <Rebase client={client} authController={authController}>
|
|
33
|
+
* <BrowserRouter>
|
|
34
|
+
* <CollectionsProvider collections={[postsCollection, authorsCollection]}>
|
|
35
|
+
* <CollectionPanel path="posts"/>
|
|
36
|
+
* <CollectionPanel path="authors"/>
|
|
37
|
+
* </CollectionsProvider>
|
|
38
|
+
* </BrowserRouter>
|
|
39
|
+
* </Rebase>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @group Components
|
|
43
|
+
*/
|
|
44
|
+
export declare function CollectionsProvider({ collections, children }: CollectionsProviderProps): React.JSX.Element;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { CollectionRegistryContext } from "../hooks/navigation/contexts/CollectionRegistryContext.js";
|
|
2
|
+
import { NavigationStateContext } from "../hooks/navigation/contexts/NavigationStateContext.js";
|
|
3
|
+
import { UrlContext } from "../hooks/navigation/contexts/UrlContext.js";
|
|
4
|
+
import { useBuildCollectionRegistryController } from "../hooks/navigation/useBuildCollectionRegistryController.js";
|
|
5
|
+
import { useBuildNavigationStateController } from "../hooks/navigation/useBuildNavigationStateController.js";
|
|
6
|
+
import { useBuildUrlController } from "../hooks/navigation/useBuildUrlController.js";
|
|
7
|
+
import { SideDialogs } from "./SideDialogs.js";
|
|
8
|
+
import { SidePanelProvider } from "./SidePanelProvider.js";
|
|
9
|
+
import { CollectionsScopeContext } from "./CollectionsScopeContext.js";
|
|
10
|
+
import { useCallback, useContext, useEffect, useId, useMemo, useRef } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { buildRoutedRebaseData, resolveDataSource } from "@rebasepro/common";
|
|
13
|
+
import { CollectionResolverRegistrationContext, RebaseDataContext, StudioBridgeRegistryContext, useAdminModeController, useCustomizationController, useData, useDataSources, useRebaseContext, useUserConfigurationPersistence } from "@rebasepro/app";
|
|
14
|
+
import { resolveAdminCollection } from "@rebasepro/cms-types";
|
|
15
|
+
//#region src/components/CollectionsProvider.tsx
|
|
16
|
+
var EMPTY_PLUGINS = [];
|
|
17
|
+
/**
|
|
18
|
+
* Whether `path` starts with a collection this registry holds — the longest
|
|
19
|
+
* leading run of whole segments, since a slug may contain slashes.
|
|
20
|
+
*/
|
|
21
|
+
function holdsLeadingCollection(registry, path) {
|
|
22
|
+
const segments = path.split("/").filter(Boolean);
|
|
23
|
+
for (let length = segments.length; length > 0; length--) if (registry.get(segments.slice(0, length).join("/"))) return true;
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
var NO_VIEWS = [];
|
|
27
|
+
/**
|
|
28
|
+
* Everything a collection view or a record form needs to work in a page of
|
|
29
|
+
* your own app, without `<RebaseCMS>`, `<RebaseNavigation>` or
|
|
30
|
+
* `<RebaseShell>`: a registry of the collections you hand it, the record side
|
|
31
|
+
* panel and dialogs (rendered here), and the navigation guard.
|
|
32
|
+
*
|
|
33
|
+
* It needs `<Rebase>` above it and a React Router router — any router, at any
|
|
34
|
+
* path; a data router is not required. No CMS route serves the page, so a
|
|
35
|
+
* record opens in a side panel or a dialog over it, never by URL.
|
|
36
|
+
*
|
|
37
|
+
* `CollectionPanel` and `EntityFormPanel` given a `collection` bring one of
|
|
38
|
+
* these themselves when none is above; mount it yourself to share one between
|
|
39
|
+
* several of them, or to use the lower-level pieces (`CollectionViewBinding`,
|
|
40
|
+
* `useSidePanel`) directly.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <Rebase client={client} authController={authController}>
|
|
45
|
+
* <BrowserRouter>
|
|
46
|
+
* <CollectionsProvider collections={[postsCollection, authorsCollection]}>
|
|
47
|
+
* <CollectionPanel path="posts"/>
|
|
48
|
+
* <CollectionPanel path="authors"/>
|
|
49
|
+
* </CollectionsProvider>
|
|
50
|
+
* </BrowserRouter>
|
|
51
|
+
* </Rebase>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @group Components
|
|
55
|
+
*/
|
|
56
|
+
function CollectionsProvider({ collections, children }) {
|
|
57
|
+
const context = useRebaseContext();
|
|
58
|
+
const adminModeController = useAdminModeController();
|
|
59
|
+
const userConfigPersistence = useUserConfigurationPersistence();
|
|
60
|
+
const customizationController = useCustomizationController();
|
|
61
|
+
const dataSources = useDataSources();
|
|
62
|
+
const collectionRegistryController = useBuildCollectionRegistryController({
|
|
63
|
+
userConfigPersistence,
|
|
64
|
+
dataSources: dataSources.registry
|
|
65
|
+
});
|
|
66
|
+
const registerCollectionResolver = useContext(CollectionResolverRegistrationContext);
|
|
67
|
+
const owner = useId();
|
|
68
|
+
const getCollectionRef = useRef(collectionRegistryController.getCollection);
|
|
69
|
+
getCollectionRef.current = collectionRegistryController.getCollection;
|
|
70
|
+
const registryRef = collectionRegistryController.collectionRegistryRef;
|
|
71
|
+
const resolveCollection = useCallback((slug) => holdsLeadingCollection(registryRef.current, slug) ? getCollectionRef.current(slug) : void 0, [registryRef]);
|
|
72
|
+
const resolveDataPath = collectionRegistryController.resolveDataPath;
|
|
73
|
+
registerCollectionResolver(resolveCollection, resolveDataPath, owner);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
registerCollectionResolver(resolveCollection, resolveDataPath, owner);
|
|
76
|
+
return () => registerCollectionResolver(void 0, void 0, owner);
|
|
77
|
+
}, [
|
|
78
|
+
registerCollectionResolver,
|
|
79
|
+
resolveCollection,
|
|
80
|
+
resolveDataPath,
|
|
81
|
+
owner
|
|
82
|
+
]);
|
|
83
|
+
const defaultData = useData();
|
|
84
|
+
const routedData = useMemo(() => buildRoutedRebaseData({
|
|
85
|
+
defaultData,
|
|
86
|
+
sources: dataSources.sources,
|
|
87
|
+
resolveKey: (slugOrPath) => resolveDataSource(resolveCollection(slugOrPath), dataSources.registry).key
|
|
88
|
+
}), [
|
|
89
|
+
defaultData,
|
|
90
|
+
dataSources,
|
|
91
|
+
resolveCollection
|
|
92
|
+
]);
|
|
93
|
+
const builtUrlController = useBuildUrlController({
|
|
94
|
+
basePath: "/",
|
|
95
|
+
baseCollectionPath: "/c",
|
|
96
|
+
collectionRegistryController
|
|
97
|
+
});
|
|
98
|
+
const urlController = useMemo(() => ({
|
|
99
|
+
...builtUrlController,
|
|
100
|
+
isUrlCollectionPath: () => false,
|
|
101
|
+
routesMounted: false
|
|
102
|
+
}), [builtUrlController]);
|
|
103
|
+
const resolvedCollections = useMemo(() => collections.map((collection) => resolveAdminCollection(collection)), [collections]);
|
|
104
|
+
const navigationStateController = useBuildNavigationStateController({
|
|
105
|
+
plugins: customizationController.plugins ?? EMPTY_PLUGINS,
|
|
106
|
+
collections: resolvedCollections,
|
|
107
|
+
views: NO_VIEWS,
|
|
108
|
+
authController: context.authController,
|
|
109
|
+
data: routedData,
|
|
110
|
+
collectionRegistryController,
|
|
111
|
+
urlController,
|
|
112
|
+
adminMode: adminModeController?.mode
|
|
113
|
+
});
|
|
114
|
+
return /* @__PURE__ */ jsx(CollectionsScopeContext.Provider, {
|
|
115
|
+
value: true,
|
|
116
|
+
children: /* @__PURE__ */ jsx(StudioBridgeRegistryContext.Provider, {
|
|
117
|
+
value: null,
|
|
118
|
+
children: /* @__PURE__ */ jsx(RebaseDataContext.Provider, {
|
|
119
|
+
value: routedData,
|
|
120
|
+
children: /* @__PURE__ */ jsx(CollectionRegistryContext.Provider, {
|
|
121
|
+
value: collectionRegistryController,
|
|
122
|
+
children: /* @__PURE__ */ jsx(UrlContext.Provider, {
|
|
123
|
+
value: urlController,
|
|
124
|
+
children: /* @__PURE__ */ jsx(NavigationStateContext.Provider, {
|
|
125
|
+
value: navigationStateController,
|
|
126
|
+
children: /* @__PURE__ */ jsxs(SidePanelProvider, { children: [children, /* @__PURE__ */ jsx(SideDialogs, {})] })
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { CollectionsProvider };
|
|
136
|
+
|
|
137
|
+
//# sourceMappingURL=CollectionsProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionsProvider.js","names":[],"sources":["../../src/components/CollectionsProvider.tsx"],"sourcesContent":["import React, { useCallback, useContext, useEffect, useId, useMemo, useRef } from \"react\";\nimport {\n CollectionResolverRegistrationContext,\n RebaseDataContext,\n StudioBridgeRegistryContext,\n useAdminModeController,\n useCustomizationController,\n useData,\n useDataSources,\n useRebaseContext,\n useUserConfigurationPersistence\n} from \"@rebasepro/app\";\nimport { buildRoutedRebaseData, CollectionRegistry, resolveDataSource } from \"@rebasepro/common\";\nimport { resolveAdminCollection } from \"@rebasepro/cms-types\";\nimport type { AdminCollection, AppView, RebasePlugin, UrlController } from \"@rebasepro/cms-types\";\n\nimport { useBuildCollectionRegistryController } from \"../hooks/navigation/useBuildCollectionRegistryController\";\nimport { useBuildUrlController } from \"../hooks/navigation/useBuildUrlController\";\nimport { useBuildNavigationStateController } from \"../hooks/navigation/useBuildNavigationStateController\";\nimport { CollectionRegistryContext } from \"../hooks/navigation/contexts/CollectionRegistryContext\";\nimport { UrlContext } from \"../hooks/navigation/contexts/UrlContext\";\nimport { NavigationStateContext } from \"../hooks/navigation/contexts/NavigationStateContext\";\nimport { SidePanelProvider } from \"./SidePanelProvider\";\nimport { SideDialogs } from \"./SideDialogs\";\nimport { CollectionsScopeContext } from \"./CollectionsScopeContext\";\n\nconst EMPTY_PLUGINS: RebasePlugin[] = [];\n\n/**\n * Whether `path` starts with a collection this registry holds — the longest\n * leading run of whole segments, since a slug may contain slashes.\n */\nfunction holdsLeadingCollection(registry: CollectionRegistry, path: string): boolean {\n const segments = path.split(\"/\").filter(Boolean);\n for (let length = segments.length; length > 0; length--) {\n if (registry.get(segments.slice(0, length).join(\"/\"))) return true;\n }\n return false;\n}\nconst NO_VIEWS: AppView[] = [];\n\n/**\n * @group Components\n */\nexport interface CollectionsProviderProps {\n /**\n * The collections this scope can show and edit — `defineCollection`\n * configs or resolved collections. Keep the array stable (a module\n * constant, or `useMemo`): a new array is a new set of collections.\n */\n collections: AdminCollection[];\n children: React.ReactNode;\n}\n\n/**\n * Everything a collection view or a record form needs to work in a page of\n * your own app, without `<RebaseCMS>`, `<RebaseNavigation>` or\n * `<RebaseShell>`: a registry of the collections you hand it, the record side\n * panel and dialogs (rendered here), and the navigation guard.\n *\n * It needs `<Rebase>` above it and a React Router router — any router, at any\n * path; a data router is not required. No CMS route serves the page, so a\n * record opens in a side panel or a dialog over it, never by URL.\n *\n * `CollectionPanel` and `EntityFormPanel` given a `collection` bring one of\n * these themselves when none is above; mount it yourself to share one between\n * several of them, or to use the lower-level pieces (`CollectionViewBinding`,\n * `useSidePanel`) directly.\n *\n * @example\n * ```tsx\n * <Rebase client={client} authController={authController}>\n * <BrowserRouter>\n * <CollectionsProvider collections={[postsCollection, authorsCollection]}>\n * <CollectionPanel path=\"posts\"/>\n * <CollectionPanel path=\"authors\"/>\n * </CollectionsProvider>\n * </BrowserRouter>\n * </Rebase>\n * ```\n *\n * @group Components\n */\nexport function CollectionsProvider({ collections, children }: CollectionsProviderProps) {\n const context = useRebaseContext();\n const adminModeController = useAdminModeController();\n const userConfigPersistence = useUserConfigurationPersistence();\n const customizationController = useCustomizationController();\n const dataSources = useDataSources();\n const collectionRegistryController = useBuildCollectionRegistryController({ userConfigPersistence, dataSources: dataSources.registry });\n\n // The data layer gives a row its address from its collection's primary\n // key, and these collections are known only here. Registered under this\n // scope's own owner, so several scopes on one page — and the full CMS\n // beside them — do not overwrite each other. During render for the reason\n // `RebaseNavigation` gives (the views that fetch rows are below), and again\n // on mount, since a strict-mode remount runs the cleanup in between.\n const registerCollectionResolver = useContext(CollectionResolverRegistrationContext);\n const owner = useId();\n const getCollectionRef = useRef(collectionRegistryController.getCollection);\n getCollectionRef.current = collectionRegistryController.getCollection;\n const registryRef = collectionRegistryController.collectionRegistryRef;\n // Asked about every collection any owner has, so a path this scope does\n // not hold is answered quietly rather than by the registry's warning.\n const resolveCollection = useCallback((slug: string) =>\n holdsLeadingCollection(registryRef.current, slug) ? getCollectionRef.current(slug) : undefined, [registryRef]);\n const resolveDataPath = collectionRegistryController.resolveDataPath;\n registerCollectionResolver(resolveCollection, resolveDataPath, owner);\n useEffect(() => {\n registerCollectionResolver(resolveCollection, resolveDataPath, owner);\n return () => registerCollectionResolver(undefined, undefined, owner);\n }, [registerCollectionResolver, resolveCollection, resolveDataPath, owner]);\n\n // Each collection routed to the data source it declares, as in the CMS.\n const defaultData = useData();\n const routedData = useMemo(() => buildRoutedRebaseData({\n defaultData,\n sources: dataSources.sources,\n resolveKey: (slugOrPath) => resolveDataSource(resolveCollection(slugOrPath), dataSources.registry).key\n }), [defaultData, dataSources, resolveCollection]);\n\n // Paths are still built — a panel keys its records by them — but nothing\n // navigates to one, and no URL is read as a record to open.\n const builtUrlController = useBuildUrlController({\n basePath: \"/\",\n baseCollectionPath: \"/c\",\n collectionRegistryController\n });\n const urlController = useMemo<UrlController>(() => ({\n ...builtUrlController,\n isUrlCollectionPath: () => false,\n routesMounted: false\n }), [builtUrlController]);\n\n const resolvedCollections = useMemo(() => collections.map(collection => resolveAdminCollection(collection)), [collections]);\n const navigationStateController = useBuildNavigationStateController({\n plugins: customizationController.plugins ?? EMPTY_PLUGINS,\n collections: resolvedCollections,\n views: NO_VIEWS,\n authController: context.authController!,\n data: routedData,\n collectionRegistryController,\n urlController,\n adminMode: adminModeController?.mode\n });\n\n // The Studio bridge describes the CMS's own controllers. A scope embedded\n // in the shell must not replace them there, so its registrations go nowhere.\n return (\n <CollectionsScopeContext.Provider value={true}>\n <StudioBridgeRegistryContext.Provider value={null}>\n <RebaseDataContext.Provider value={routedData}>\n <CollectionRegistryContext.Provider value={collectionRegistryController}>\n <UrlContext.Provider value={urlController}>\n <NavigationStateContext.Provider value={navigationStateController}>\n <SidePanelProvider>\n {children}\n <SideDialogs/>\n </SidePanelProvider>\n </NavigationStateContext.Provider>\n </UrlContext.Provider>\n </CollectionRegistryContext.Provider>\n </RebaseDataContext.Provider>\n </StudioBridgeRegistryContext.Provider>\n </CollectionsScopeContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0BA,IAAM,gBAAgC,CAAC;;;;;AAMvC,SAAS,uBAAuB,UAA8B,MAAuB;CACjF,MAAM,WAAW,KAAK,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;CAC/C,KAAK,IAAI,SAAS,SAAS,QAAQ,SAAS,GAAG,UAC3C,IAAI,SAAS,IAAI,SAAS,MAAM,GAAG,MAAM,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,OAAO;CAElE,OAAO;AACX;AACA,IAAM,WAAsB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4C7B,SAAgB,oBAAoB,EAAE,aAAa,YAAsC;CACrF,MAAM,UAAU,iBAAiB;CACjC,MAAM,sBAAsB,uBAAuB;CACnD,MAAM,wBAAwB,gCAAgC;CAC9D,MAAM,0BAA0B,2BAA2B;CAC3D,MAAM,cAAc,eAAe;CACnC,MAAM,+BAA+B,qCAAqC;EAAE;EAAuB,aAAa,YAAY;CAAS,CAAC;CAQtI,MAAM,6BAA6B,WAAW,qCAAqC;CACnF,MAAM,QAAQ,MAAM;CACpB,MAAM,mBAAmB,OAAO,6BAA6B,aAAa;CAC1E,iBAAiB,UAAU,6BAA6B;CACxD,MAAM,cAAc,6BAA6B;CAGjD,MAAM,oBAAoB,aAAa,SACnC,uBAAuB,YAAY,SAAS,IAAI,IAAI,iBAAiB,QAAQ,IAAI,IAAI,KAAA,GAAW,CAAC,WAAW,CAAC;CACjH,MAAM,kBAAkB,6BAA6B;CACrD,2BAA2B,mBAAmB,iBAAiB,KAAK;CACpE,gBAAgB;EACZ,2BAA2B,mBAAmB,iBAAiB,KAAK;EACpE,aAAa,2BAA2B,KAAA,GAAW,KAAA,GAAW,KAAK;CACvE,GAAG;EAAC;EAA4B;EAAmB;EAAiB;CAAK,CAAC;CAG1E,MAAM,cAAc,QAAQ;CAC5B,MAAM,aAAa,cAAc,sBAAsB;EACnD;EACA,SAAS,YAAY;EACrB,aAAa,eAAe,kBAAkB,kBAAkB,UAAU,GAAG,YAAY,QAAQ,CAAC,CAAC;CACvG,CAAC,GAAG;EAAC;EAAa;EAAa;CAAiB,CAAC;CAIjD,MAAM,qBAAqB,sBAAsB;EAC7C,UAAU;EACV,oBAAoB;EACpB;CACJ,CAAC;CACD,MAAM,gBAAgB,eAA8B;EAChD,GAAG;EACH,2BAA2B;EAC3B,eAAe;CACnB,IAAI,CAAC,kBAAkB,CAAC;CAExB,MAAM,sBAAsB,cAAc,YAAY,KAAI,eAAc,uBAAuB,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC;CAC1H,MAAM,4BAA4B,kCAAkC;EAChE,SAAS,wBAAwB,WAAW;EAC5C,aAAa;EACb,OAAO;EACP,gBAAgB,QAAQ;EACxB,MAAM;EACN;EACA;EACA,WAAW,qBAAqB;CACpC,CAAC;CAID,OACI,oBAAC,wBAAwB,UAAzB;EAAkC,OAAO;YACrC,oBAAC,4BAA4B,UAA7B;GAAsC,OAAO;aACzC,oBAAC,kBAAkB,UAAnB;IAA4B,OAAO;cAC/B,oBAAC,0BAA0B,UAA3B;KAAoC,OAAO;eACvC,oBAAC,WAAW,UAAZ;MAAqB,OAAO;gBACxB,oBAAC,uBAAuB,UAAxB;OAAiC,OAAO;iBACpC,qBAAC,mBAAD,EAAA,UAAA,CACK,UACD,oBAAC,aAAD,CAAa,CAAA,CACE,EAAA,CAAA;MACU,CAAA;KAChB,CAAA;IACW,CAAA;GACZ,CAAA;EACM,CAAA;CACR,CAAA;AAE1C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
2
|
+
/**
|
|
3
|
+
* Whether a collections scope — the registry, URL controller, navigation state
|
|
4
|
+
* and record panels — is mounted above: `<RebaseNavigation>` (the full CMS) or
|
|
5
|
+
* a `<CollectionsProvider>`. The components that can stand on their own
|
|
6
|
+
* (`CollectionPanel`, `EntityFormPanel`) read it to decide whether to bring
|
|
7
|
+
* their own.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare const CollectionsScopeContext: import("react").Context<boolean>;
|
|
12
|
+
/**
|
|
13
|
+
* Whether a scope's top-level collections include the one at `path` — asked
|
|
14
|
+
* quietly, unlike a registry lookup, which warns about a path it cannot place.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function isRegistered(collections: AdminCollection[] | undefined, path: string): boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
//#region src/components/CollectionsScopeContext.ts
|
|
3
|
+
/**
|
|
4
|
+
* Whether a collections scope — the registry, URL controller, navigation state
|
|
5
|
+
* and record panels — is mounted above: `<RebaseNavigation>` (the full CMS) or
|
|
6
|
+
* a `<CollectionsProvider>`. The components that can stand on their own
|
|
7
|
+
* (`CollectionPanel`, `EntityFormPanel`) read it to decide whether to bring
|
|
8
|
+
* their own.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
var CollectionsScopeContext = createContext(false);
|
|
13
|
+
/**
|
|
14
|
+
* Whether a scope's top-level collections include the one at `path` — asked
|
|
15
|
+
* quietly, unlike a registry lookup, which warns about a path it cannot place.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
function isRegistered(collections, path) {
|
|
20
|
+
return collections?.some((collection) => collection.slug === path) ?? false;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { CollectionsScopeContext, isRegistered };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=CollectionsScopeContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionsScopeContext.js","names":[],"sources":["../../src/components/CollectionsScopeContext.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\n\n/**\n * Whether a collections scope — the registry, URL controller, navigation state\n * and record panels — is mounted above: `<RebaseNavigation>` (the full CMS) or\n * a `<CollectionsProvider>`. The components that can stand on their own\n * (`CollectionPanel`, `EntityFormPanel`) read it to decide whether to bring\n * their own.\n *\n * @internal\n */\nexport const CollectionsScopeContext = createContext<boolean>(false);\n\n/**\n * Whether a scope's top-level collections include the one at `path` — asked\n * quietly, unlike a registry lookup, which warns about a path it cannot place.\n *\n * @internal\n */\nexport function isRegistered(collections: AdminCollection[] | undefined, path: string): boolean {\n return collections?.some(collection => collection.slug === path) ?? false;\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAa,0BAA0B,cAAuB,KAAK;;;;;;;AAQnE,SAAgB,aAAa,aAA4C,MAAuB;CAC5F,OAAO,aAAa,MAAK,eAAc,WAAW,SAAS,IAAI,KAAK;AACxE"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { useUrlController } from "../hooks/navigation/contexts/UrlContext.js";
|
|
2
|
+
import { useBreadcrumbsController } from "../hooks/useBreadcrumbsController.js";
|
|
3
|
+
import { useApp } from "./app/useApp.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Avatar, ErrorBoundary, IconButton, LogOutIcon, Menu, MenuItem, MoonIcon, SettingsIcon, Skeleton, SunIcon, SunMoonIcon, Typography, cls, iconSize } from "@rebasepro/ui";
|
|
7
|
+
import { LanguageToggle, RebaseLogo, useAdminModeController, useAuthController, useLargeLayout, useModeController, useRebaseContext, useSlot, useTranslation } from "@rebasepro/app";
|
|
8
|
+
import { Link, useNavigate } from "react-router";
|
|
9
|
+
//#region src/components/DefaultAppBar.tsx
|
|
10
|
+
/**
|
|
11
|
+
* This component renders the main app bar of Rebase.
|
|
12
|
+
* You will likely not need to use this component directly.
|
|
13
|
+
*
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
var DefaultAppBar = function DefaultAppBar({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle = true, includeLanguageToggle = true, includeUserMenu = true, className, style, user: userProp, logo: logoProp }) {
|
|
17
|
+
const { hasDrawer, drawerOpen, logo: appLogo } = useApp();
|
|
18
|
+
const logo = logoProp ?? appLogo;
|
|
19
|
+
const navigation = useUrlController();
|
|
20
|
+
const breadcrumbs = useBreadcrumbsController();
|
|
21
|
+
const authController = useAuthController();
|
|
22
|
+
useAdminModeController();
|
|
23
|
+
const { mode, setMode } = useModeController();
|
|
24
|
+
const navigate = useNavigate();
|
|
25
|
+
const largeLayout = useLargeLayout();
|
|
26
|
+
const user = userProp ?? authController.user;
|
|
27
|
+
const { t } = useTranslation();
|
|
28
|
+
const rebaseContext = useRebaseContext();
|
|
29
|
+
const slotProps = React.useMemo(() => ({ context: rebaseContext }), [rebaseContext]);
|
|
30
|
+
const globalSearch = useSlot("global.search", slotProps);
|
|
31
|
+
const shellToolbar = useSlot("shell.toolbar", slotProps);
|
|
32
|
+
let avatarComponent;
|
|
33
|
+
if (user) {
|
|
34
|
+
const initial = user?.displayName ? user.displayName[0].toUpperCase() : user?.email ? user.email[0].toUpperCase() : "A";
|
|
35
|
+
avatarComponent = /* @__PURE__ */ jsx(Avatar, {
|
|
36
|
+
src: user.photoURL ?? void 0,
|
|
37
|
+
children: initial
|
|
38
|
+
});
|
|
39
|
+
} else if (user === void 0 || authController.initialLoading) avatarComponent = /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "p-1 flex justify-center",
|
|
41
|
+
children: /* @__PURE__ */ jsx(Skeleton, { className: "w-10 h-10 rounded-full" })
|
|
42
|
+
});
|
|
43
|
+
else avatarComponent = null;
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
style,
|
|
46
|
+
role: "banner",
|
|
47
|
+
className: cls("w-full h-14 transition-all ease-in duration-75 absolute top-0 max-w-full overflow-x-auto no-scrollbar", "flex flex-row gap-2 px-4 items-center", "backdrop-blur-sm bg-surface-frame/90", {
|
|
48
|
+
"pl-[19rem]": drawerOpen && largeLayout,
|
|
49
|
+
"pl-24": hasDrawer && !(drawerOpen && largeLayout),
|
|
50
|
+
"z-10": largeLayout,
|
|
51
|
+
"duration-100": drawerOpen && largeLayout
|
|
52
|
+
}, className),
|
|
53
|
+
children: [
|
|
54
|
+
navigation && (!hasDrawer || title) && /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: "mr-2 hidden lg:block",
|
|
56
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
57
|
+
className: "visited:text-inherit dark:visited:text-inherit block",
|
|
58
|
+
to: navigation?.basePath ?? "/",
|
|
59
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: "flex flex-row gap-4",
|
|
61
|
+
children: [!hasDrawer && (logo ? /* @__PURE__ */ jsx("img", {
|
|
62
|
+
src: logo,
|
|
63
|
+
alt: "Logo",
|
|
64
|
+
className: cls("w-[32px] h-[32px] object-contain")
|
|
65
|
+
}) : /* @__PURE__ */ jsx(RebaseLogo, {
|
|
66
|
+
width: "32px",
|
|
67
|
+
height: "32px"
|
|
68
|
+
})), typeof title === "string" ? /* @__PURE__ */ jsx(Typography, {
|
|
69
|
+
variant: "subtitle1",
|
|
70
|
+
noWrap: true,
|
|
71
|
+
children: title
|
|
72
|
+
}) : title]
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ jsx("div", {
|
|
77
|
+
className: "mr-8 hidden lg:block",
|
|
78
|
+
children: /* @__PURE__ */ jsx("nav", {
|
|
79
|
+
"aria-label": "Breadcrumb",
|
|
80
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
81
|
+
className: "flex flex-row gap-2 items-center",
|
|
82
|
+
children: breadcrumbs.breadcrumbs.map((breadcrumb, index) => {
|
|
83
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [index > 0 && /* @__PURE__ */ jsx(Typography, {
|
|
84
|
+
variant: "caption",
|
|
85
|
+
color: "secondary",
|
|
86
|
+
children: "/"
|
|
87
|
+
}), /* @__PURE__ */ jsx(Link, {
|
|
88
|
+
className: "visited:text-inherit dark:visited:text-inherit block",
|
|
89
|
+
to: breadcrumb.url,
|
|
90
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
91
|
+
className: "flex flex-row items-center gap-2 whitespace-nowrap",
|
|
92
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
93
|
+
variant: "body2",
|
|
94
|
+
children: breadcrumb.title
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
}, index)] }, breadcrumb.url + "_" + index);
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
}),
|
|
102
|
+
startAdornment,
|
|
103
|
+
globalSearch,
|
|
104
|
+
/* @__PURE__ */ jsx("div", { className: "grow" }),
|
|
105
|
+
endAdornment && /* @__PURE__ */ jsx(ErrorBoundary, { children: endAdornment }),
|
|
106
|
+
shellToolbar,
|
|
107
|
+
includeLanguageToggle && /* @__PURE__ */ jsx(LanguageToggle, {}),
|
|
108
|
+
includeModeToggle && /* @__PURE__ */ jsxs(Menu, {
|
|
109
|
+
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
110
|
+
"aria-label": "Toggle theme",
|
|
111
|
+
children: mode === "dark" ? /* @__PURE__ */ jsx(MoonIcon, { size: iconSize.small }) : /* @__PURE__ */ jsx(SunIcon, { size: iconSize.small })
|
|
112
|
+
}),
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsxs(MenuItem, {
|
|
115
|
+
onClick: () => setMode("dark"),
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ jsx(MoonIcon, { size: iconSize.smallest }),
|
|
118
|
+
" ",
|
|
119
|
+
t("dark_mode")
|
|
120
|
+
]
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ jsxs(MenuItem, {
|
|
123
|
+
onClick: () => setMode("light"),
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsx(SunIcon, { size: iconSize.smallest }),
|
|
126
|
+
" ",
|
|
127
|
+
t("light_mode"),
|
|
128
|
+
" "
|
|
129
|
+
]
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ jsxs(MenuItem, {
|
|
132
|
+
onClick: () => setMode("system"),
|
|
133
|
+
children: [
|
|
134
|
+
" ",
|
|
135
|
+
/* @__PURE__ */ jsx(SunMoonIcon, { size: iconSize.smallest }),
|
|
136
|
+
t("system_mode")
|
|
137
|
+
]
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
}),
|
|
141
|
+
includeUserMenu && /* @__PURE__ */ jsxs(Menu, {
|
|
142
|
+
trigger: /* @__PURE__ */ jsx("div", {
|
|
143
|
+
"aria-label": "User menu",
|
|
144
|
+
role: "button",
|
|
145
|
+
children: avatarComponent
|
|
146
|
+
}),
|
|
147
|
+
children: [
|
|
148
|
+
user && /* @__PURE__ */ jsxs("div", {
|
|
149
|
+
className: "px-4 py-2 mb-2",
|
|
150
|
+
children: [user.displayName && /* @__PURE__ */ jsx(Typography, {
|
|
151
|
+
variant: "body1",
|
|
152
|
+
color: "secondary",
|
|
153
|
+
children: user.displayName
|
|
154
|
+
}), user.email && /* @__PURE__ */ jsx(Typography, {
|
|
155
|
+
variant: "body2",
|
|
156
|
+
color: "secondary",
|
|
157
|
+
children: user.email
|
|
158
|
+
})]
|
|
159
|
+
}),
|
|
160
|
+
dropDownActions,
|
|
161
|
+
!dropDownActions && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(MenuItem, {
|
|
162
|
+
onClick: () => navigate("/settings"),
|
|
163
|
+
children: [/* @__PURE__ */ jsx(SettingsIcon, {}), t("account_settings")]
|
|
164
|
+
}), /* @__PURE__ */ jsxs(MenuItem, {
|
|
165
|
+
onClick: async () => {
|
|
166
|
+
await authController.signOut();
|
|
167
|
+
navigate("/");
|
|
168
|
+
},
|
|
169
|
+
children: [/* @__PURE__ */ jsx(LogOutIcon, {}), t("log_out")]
|
|
170
|
+
})] })
|
|
171
|
+
]
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
//#endregion
|
|
177
|
+
export { DefaultAppBar };
|
|
178
|
+
|
|
179
|
+
//# sourceMappingURL=DefaultAppBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultAppBar.js","names":[],"sources":["../../src/components/DefaultAppBar.tsx"],"sourcesContent":["\nimport React from \"react\";\n\nimport { Link, useNavigate } from \"react-router\";\nimport { RebaseLogo, LanguageToggle } from \"@rebasepro/app\";\nimport { ErrorBoundary, iconSize } from \"@rebasepro/ui\";\nimport {\n Avatar,\n cls,\n IconButton,\n LogOutIcon,\n Menu,\n MenuItem,\n MoonIcon,\n SettingsIcon,\n Skeleton,\n SunIcon,\n SunMoonIcon,\n Typography\n} from \"@rebasepro/ui\";\nimport { useAuthController, useLargeLayout, useModeController, useAdminModeController, useTranslation, useRebaseContext, useSlot } from \"@rebasepro/app\";\nimport { useUrlController } from \"../hooks/navigation/contexts/UrlContext\";\nimport { User } from \"@rebasepro/types\";\nimport { useApp } from \"./app/useApp\";\nimport { useBreadcrumbsController } from \"../hooks/useBreadcrumbsController\";\nimport { UserSettingsView } from \"@rebasepro/app\";\n\nexport type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {\n\n /**\n * The content of the app bar, usually a title or logo. This includes a link to the home page.\n */\n title?: React.ReactNode;\n\n /**\n * A component that gets rendered on the upper side to the end of the main toolbar\n */\n endAdornment?: React.ReactNode;\n\n /**\n * A component that gets rendered on the upper side to the start of the main toolbar\n */\n startAdornment?: React.ReactNode;\n\n dropDownActions?: React.ReactNode;\n\n /**\n * Whether to render the dark/light/system mode toggle in the app bar.\n * Set to `false` when the drawer owns this action.\n * @default true\n */\n includeModeToggle?: boolean;\n\n /**\n * Whether to render the language switcher in the app bar.\n * Set to `false` when the drawer owns this action.\n * @default true\n */\n includeLanguageToggle?: boolean;\n\n /**\n * Whether to render the user avatar / menu in the app bar.\n * Set to `false` when the drawer owns this action.\n * @default true\n */\n includeUserMenu?: boolean;\n\n className?: string;\n\n style?: React.CSSProperties;\n\n logo?: string;\n\n user?: User;\n} & ADDITIONAL_PROPS;\n\n/**\n * This component renders the main app bar of Rebase.\n * You will likely not need to use this component directly.\n *\n\n */\nexport const DefaultAppBar = function DefaultAppBar({\n title,\n endAdornment,\n startAdornment,\n dropDownActions,\n includeModeToggle = true,\n includeLanguageToggle = true,\n includeUserMenu = true,\n className,\n style,\n user: userProp,\n logo: logoProp\n}: DefaultAppBarProps) {\n\n const {\n hasDrawer,\n drawerOpen,\n logo: appLogo\n } = useApp();\n\n const logo = logoProp ?? appLogo;\n\n const navigation = useUrlController();\n\n const breadcrumbs = useBreadcrumbsController();\n\n const authController = useAuthController();\n const adminModeController = useAdminModeController();\n const {\n mode,\n setMode\n } = useModeController();\n\n const navigate = useNavigate();\n\n const largeLayout = useLargeLayout();\n\n const user = userProp ?? authController.user;\n const { t } = useTranslation();\n\n // The two shell slots. Both take the context and nothing else, which is why\n // they are told apart by *where* they render rather than by their props: a\n // cross-collection search belongs beside the breadcrumbs, where a search\n // box goes, and a toolbar action belongs with the other actions at the end.\n const rebaseContext = useRebaseContext();\n const slotProps = React.useMemo(() => ({ context: rebaseContext }), [rebaseContext]);\n const globalSearch = useSlot(\"global.search\", slotProps);\n const shellToolbar = useSlot(\"shell.toolbar\", slotProps);\n\n let avatarComponent: React.ReactElement | null;\n\n if (user) {\n const initial = user?.displayName\n ? user.displayName[0].toUpperCase()\n : (user?.email ? user.email[0].toUpperCase() : \"A\");\n avatarComponent = <Avatar src={user.photoURL ?? undefined}>\n {initial}\n </Avatar>;\n } else if (user === undefined || authController.initialLoading) {\n avatarComponent = <div className={\"p-1 flex justify-center\"}>\n <Skeleton className={\"w-10 h-10 rounded-full\"}/>\n </div>;\n } else {\n avatarComponent = null;\n }\n\n\n return (\n <div\n style={style}\n role=\"banner\"\n className={cls(\"w-full h-14 transition-all ease-in duration-75 absolute top-0 max-w-full overflow-x-auto no-scrollbar\",\n \"flex flex-row gap-2 px-4 items-center\",\n \"backdrop-blur-sm bg-surface-frame/90\",\n {\n \"pl-[19rem]\": drawerOpen && largeLayout,\n \"pl-24\": hasDrawer && !(drawerOpen && largeLayout),\n \"z-10\": largeLayout,\n \"duration-100\": drawerOpen && largeLayout\n },\n className)}>\n\n {navigation && (!hasDrawer || title) && <div className=\"mr-2 hidden lg:block\">\n <Link\n className=\"visited:text-inherit dark:visited:text-inherit block\"\n to={navigation?.basePath ?? \"/\"}\n >\n <div className={\"flex flex-row gap-4\"}>\n {!hasDrawer && (logo\n ? <img src={logo}\n alt=\"Logo\"\n className={cls(\"w-[32px] h-[32px] object-contain\")}/>\n : <RebaseLogo width={\"32px\"} height={\"32px\"}/>)}\n\n {typeof title === \"string\"\n ? <Typography variant=\"subtitle1\"\n noWrap>\n {title}\n </Typography>\n : title}\n </div>\n </Link>\n </div>}\n\n <div className=\"mr-8 hidden lg:block\">\n <nav aria-label=\"Breadcrumb\">\n <div className={\"flex flex-row gap-2 items-center\"}>\n {breadcrumbs.breadcrumbs.map((breadcrumb, index) => {\n return <React.Fragment key={breadcrumb.url + \"_\" + index}>\n {index > 0 && (\n <Typography variant={\"caption\"} color={\"secondary\"}>\n /\n </Typography>\n )}\n <Link\n key={index}\n className=\"visited:text-inherit dark:visited:text-inherit block\"\n to={breadcrumb.url}\n >\n <div className=\"flex flex-row items-center gap-2 whitespace-nowrap\">\n <Typography variant={\"body2\"}>\n {breadcrumb.title}\n </Typography>\n </div>\n </Link>\n </React.Fragment>;\n })}\n </div>\n </nav>\n </div>\n {startAdornment}\n\n {globalSearch}\n\n <div className={\"grow\"}/>\n\n {endAdornment &&\n <ErrorBoundary>\n {endAdornment}\n </ErrorBoundary>}\n\n {shellToolbar}\n\n {includeLanguageToggle && <LanguageToggle/>}\n\n {includeModeToggle &&\n <Menu\n trigger={<IconButton\n aria-label=\"Toggle theme\"\n>\n {mode === \"dark\"\n ? <MoonIcon size={iconSize.small}/>\n : <SunIcon size={iconSize.small}/>}\n </IconButton>}>\n <MenuItem onClick={() => setMode(\"dark\")}><MoonIcon size={iconSize.smallest}/> {t(\"dark_mode\")}</MenuItem>\n <MenuItem onClick={() => setMode(\"light\")}><SunIcon size={iconSize.smallest}/> {t(\"light_mode\")} </MenuItem>\n <MenuItem onClick={() => setMode(\"system\")}> <SunMoonIcon\n size={iconSize.smallest}/>{t(\"system_mode\")}</MenuItem>\n </Menu>}\n\n\n {includeUserMenu &&\n <Menu trigger={<div aria-label=\"User menu\" role=\"button\">{avatarComponent}</div>}>\n {user && <div className={\"px-4 py-2 mb-2\"}>\n {user.displayName && <Typography variant={\"body1\"} color={\"secondary\"}>\n {user.displayName}\n </Typography>}\n {user.email && <Typography variant={\"body2\"} color={\"secondary\"}>\n {user.email}\n </Typography>}\n </div>}\n\n {dropDownActions}\n\n {!dropDownActions && <>\n <MenuItem onClick={() => navigate(\"/settings\")}>\n <SettingsIcon/>\n {t(\"account_settings\")}\n </MenuItem>\n <MenuItem onClick={async () => {\n await authController.signOut();\n // replace current route with home\n navigate(\"/\");\n }}>\n <LogOutIcon/>\n {t(\"log_out\")}\n </MenuItem>\n </>}\n\n </Menu>}\n\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkFA,IAAa,gBAAgB,SAAS,cAAc,EAChD,OACA,cACA,gBACA,iBACA,oBAAoB,MACpB,wBAAwB,MACxB,kBAAkB,MAClB,WACA,OACA,MAAM,UACN,MAAM,YACa;CAEnB,MAAM,EACF,WACA,YACA,MAAM,YACN,OAAO;CAEX,MAAM,OAAO,YAAY;CAEzB,MAAM,aAAa,iBAAiB;CAEpC,MAAM,cAAc,yBAAyB;CAE7C,MAAM,iBAAiB,kBAAkB;CACb,uBAAuB;CACnD,MAAM,EACF,MACA,YACA,kBAAkB;CAEtB,MAAM,WAAW,YAAY;CAE7B,MAAM,cAAc,eAAe;CAEnC,MAAM,OAAO,YAAY,eAAe;CACxC,MAAM,EAAE,MAAM,eAAe;CAM7B,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,YAAY,MAAM,eAAe,EAAE,SAAS,cAAc,IAAI,CAAC,aAAa,CAAC;CACnF,MAAM,eAAe,QAAQ,iBAAiB,SAAS;CACvD,MAAM,eAAe,QAAQ,iBAAiB,SAAS;CAEvD,IAAI;CAEJ,IAAI,MAAM;EACN,MAAM,UAAU,MAAM,cAChB,KAAK,YAAY,EAAE,CAAC,YAAY,IAC/B,MAAM,QAAQ,KAAK,MAAM,EAAE,CAAC,YAAY,IAAI;EACnD,kBAAkB,oBAAC,QAAD;GAAQ,KAAK,KAAK,YAAY,KAAA;aAC3C;EACG,CAAA;CACZ,OAAO,IAAI,SAAS,KAAA,KAAa,eAAe,gBAC5C,kBAAkB,oBAAC,OAAD;EAAK,WAAW;YAC9B,oBAAC,UAAD,EAAU,WAAW,yBAA0B,CAAA;CAC9C,CAAA;MAEL,kBAAkB;CAItB,OACI,qBAAC,OAAD;EACW;EACP,MAAK;EACL,WAAW,IAAI,yGACX,yCACA,wCACA;GACI,cAAc,cAAc;GAC5B,SAAS,aAAa,EAAE,cAAc;GACtC,QAAQ;GACR,gBAAgB,cAAc;EAClC,GACA,SAAS;YAZjB;GAcK,eAAe,CAAC,aAAa,UAAU,oBAAC,OAAD;IAAK,WAAU;cACnD,oBAAC,MAAD;KACI,WAAU;KACV,IAAI,YAAY,YAAY;eAE5B,qBAAC,OAAD;MAAK,WAAW;gBAAhB,CACK,CAAC,cAAc,OACV,oBAAC,OAAD;OAAK,KAAK;OACR,KAAI;OACJ,WAAW,IAAI,kCAAkC;MAAG,CAAA,IACtD,oBAAC,YAAD;OAAY,OAAO;OAAQ,QAAQ;MAAQ,CAAA,IAEhD,OAAO,UAAU,WACZ,oBAAC,YAAD;OAAY,SAAQ;OAClB,QAAA;iBACC;MACO,CAAA,IACV,KACL;;IACH,CAAA;GACL,CAAA;GAEL,oBAAC,OAAD;IAAK,WAAU;cACX,oBAAC,OAAD;KAAK,cAAW;eAChB,oBAAC,OAAD;MAAK,WAAW;gBACX,YAAY,YAAY,KAAK,YAAY,UAAU;OAChD,OAAO,qBAAC,MAAM,UAAP,EAAA,UAAA,CACF,QAAQ,KACL,oBAAC,YAAD;QAAY,SAAS;QAAW,OAAO;kBAAa;OAExC,CAAA,GAEhB,oBAAC,MAAD;QAEI,WAAU;QACV,IAAI,WAAW;kBAEf,oBAAC,OAAD;SAAK,WAAU;mBACX,oBAAC,YAAD;UAAY,SAAS;oBAChB,WAAW;SACJ,CAAA;QACX,CAAA;OACH,GATG,KASH,CACM,EAAA,GAjBY,WAAW,MAAM,MAAM,KAiBnC;MACpB,CAAC;KACA,CAAA;IACA,CAAA;GACJ,CAAA;GACJ;GAEA;GAED,oBAAC,OAAD,EAAK,WAAW,OAAQ,CAAA;GAEvB,gBACG,oBAAC,eAAD,EAAA,UACK,aACU,CAAA;GAElB;GAEA,yBAAyB,oBAAC,gBAAD,CAAgB,CAAA;GAEzC,qBACG,qBAAC,MAAD;IACI,SAAS,oBAAC,YAAD;KACL,cAAW;eAEV,SAAS,SACJ,oBAAC,UAAD,EAAU,MAAM,SAAS,MAAO,CAAA,IAChC,oBAAC,SAAD,EAAS,MAAM,SAAS,MAAO,CAAA;IAC7B,CAAA;cAPhB;KAQI,qBAAC,UAAD;MAAU,eAAe,QAAQ,MAAM;gBAAvC;OAA0C,oBAAC,UAAD,EAAU,MAAM,SAAS,SAAU,CAAA;OAAC;OAAE,EAAE,WAAW;MAAY;;KACzG,qBAAC,UAAD;MAAU,eAAe,QAAQ,OAAO;gBAAxC;OAA2C,oBAAC,SAAD,EAAS,MAAM,SAAS,SAAU,CAAA;OAAC;OAAE,EAAE,YAAY;OAAE;MAAW;;KAC3G,qBAAC,UAAD;MAAU,eAAe,QAAQ,QAAQ;gBAAzC;OAA4C;OAAC,oBAAC,aAAD,EACzC,MAAM,SAAS,SAAU,CAAA;OAAE,EAAE,aAAa;MAAY;;IACxD;;GAGT,mBACG,qBAAC,MAAD;IAAM,SAAS,oBAAC,OAAD;KAAK,cAAW;KAAY,MAAK;eAAU;IAAqB,CAAA;cAA/E;KACK,QAAQ,qBAAC,OAAD;MAAK,WAAW;gBAAhB,CACJ,KAAK,eAAe,oBAAC,YAAD;OAAY,SAAS;OAAS,OAAO;iBACrD,KAAK;MACE,CAAA,GACX,KAAK,SAAS,oBAAC,YAAD;OAAY,SAAS;OAAS,OAAO;iBAC/C,KAAK;MACE,CAAA,CACX;;KAEJ;KAEA,CAAC,mBAAmB,qBAAA,UAAA,EAAA,UAAA,CACjB,qBAAC,UAAD;MAAU,eAAe,SAAS,WAAW;gBAA7C,CACI,oBAAC,cAAD,CAAc,CAAA,GACb,EAAE,kBAAkB,CACf;SACV,qBAAC,UAAD;MAAU,SAAS,YAAY;OAC3B,MAAM,eAAe,QAAQ;OAE7B,SAAS,GAAG;MAChB;gBAJA,CAKI,oBAAC,YAAD,CAAY,CAAA,GACX,EAAE,SAAS,CACN;OACZ,EAAA,CAAA;IAEA;;EAET;;AAEb"}
|