@rebasepro/cms 0.23.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/_cms_internals.d.ts +2 -1
- 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.d.ts +38 -18
- 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 +6 -1
- package/dist/collection_editor/serializable_utils.js +504 -0
- package/dist/collection_editor/serializable_utils.js.map +1 -0
- package/dist/collection_editor/types/config_controller.d.ts +11 -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-BeP0A4MJ.js → collection_editor/ui/collection_editor/SchemaChangeDialog.js} +73 -69
- 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.d.ts +5 -5
- package/dist/collection_editor/useLiveSchemaEditing.js +214 -0
- package/dist/collection_editor/useLiveSchemaEditing.js.map +1 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +7 -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.d.ts +7 -1
- 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.d.ts +6 -1
- package/dist/components/CollectionViewBinding/CollectionViewActions.js +146 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -0
- package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +5 -2
- 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.d.ts +5 -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.d.ts +7 -1
- 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.d.ts +29 -4
- 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.d.ts +16 -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.d.ts +15 -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.d.ts +37 -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.d.ts +11 -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/components/index.d.ts +1 -0
- package/dist/data_import/hooks/useImportConfig.js +34 -0
- package/dist/data_import/hooks/useImportConfig.js.map +1 -0
- package/dist/{import-TCgkTVlS.js → data_import/import/ImportCollectionAction.js} +84 -92
- 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.d.ts +81 -4
- 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.d.ts +48 -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.d.ts +7 -1
- 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 +28 -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.d.ts +4 -1
- 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 -3085
- 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 +48 -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 +27 -0
- 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.d.ts +28 -6
- package/dist/hooks/useRecordActions.js +108 -0
- package/dist/hooks/useRecordActions.js.map +1 -0
- package/dist/hooks/useReferencePaths.d.ts +21 -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 +25 -0
- 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 -3793
- 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 +11 -0
- 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 +8 -3
- package/dist/{util-CC0ozHoD.js → preview/util.js} +13 -6
- 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.d.ts +15 -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 +42 -1
- 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.d.ts +20 -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-DLHCka00.js +0 -3630
- package/dist/CollectionEditorDialog-DLHCka00.js.map +0 -1
- package/dist/JsonPreviewBinding-v0w3H0fp.js.map +0 -1
- package/dist/PropertyEditView-_pu5hzZn.js +0 -3837
- package/dist/PropertyEditView-_pu5hzZn.js.map +0 -1
- package/dist/RouterCollectionsStudioView-ChPNl_uU.js +0 -212
- package/dist/RouterCollectionsStudioView-ChPNl_uU.js.map +0 -1
- package/dist/SchemaChangeDialog-BeP0A4MJ.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-4bJWdlDK.js +0 -520
- package/dist/export-4bJWdlDK.js.map +0 -1
- package/dist/history-BElrZ5Rw.js +0 -313
- package/dist/history-BElrZ5Rw.js.map +0 -1
- package/dist/import-TCgkTVlS.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-CC0ozHoD.js.map +0 -1
- package/dist/util-DybQBkug.js +0 -26390
- package/dist/util-DybQBkug.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityViewBinding.js","names":[],"sources":["../../src/components/EntityViewBinding.tsx"],"sourcesContent":["import type { Property } from \"@rebasepro/types\";\n\nimport type { AdditionalFieldDelegateProps, AdminCollection } from \"@rebasepro/cms-types\";\nimport type { ResolvedFormField, ResolvedFormSection } from \"@rebasepro/app\";\nimport type { FormContext } from \"../types/fields\";\nimport React, { useCallback, useMemo, useRef, useState } from \"react\";\nimport { Entity } from \"@rebasepro/types\";\nimport {\n AlignLeftIcon,\n cls,\n defaultBorderMixin,\n ErrorBoundary,\n paperMixin\n} from \"@rebasepro/ui\";\nimport { getFormFieldKeys, resolveFormLayout } from \"@rebasepro/app\";\nimport { useRebaseContext } from \"@rebasepro/app\";\nimport { getValueInPath } from \"@rebasepro/utils\";\n\nimport { FieldBlock, LABEL_ICON_SIZE, spanClass } from \"../form/components/FieldBlock\";\nimport { AdditionalFieldValue } from \"./AdditionalFieldValue\";\nimport { EntityDisplayHeader, HEADER_DISPLAY_ROLES } from \"./EntityDisplayHeader\";\nimport { FormSections } from \"../form/components/FormSections\";\nimport { FormRail, RecordMeta } from \"../form/components/FormRail\";\nimport { useEntityDisplayValues } from \"../hooks/useEntityDisplay\";\nimport { useRailVisible } from \"../form/components/useRailVisible\";\nimport { PropertyPreview } from \"../preview\";\n\n/** Nothing can be in error in a view that cannot be submitted. */\nconst NO_ERRORS: ReadonlySet<string> = new Set<string>();\n\n/**\n * The fields the read-only view lays out, in render order.\n *\n * The same set the form uses, minus two groups. Both are dropped *before* the\n * layout resolves rather than skipped while rendering, because the resolver has\n * by then given each one a place on the grid — skipping later leaves that place\n * as a hole.\n *\n * - The `additionalFields` when there is no form context to hand them: those\n * entries are arbitrary components, not values, and one rendered against no\n * context is nothing at all.\n * - `headerKeys` — the properties {@link EntityDisplayHeader} has already\n * rendered as the record's picture, subtitle, state and labels. Leaving one in\n * prints its value twice on one screen.\n *\n * The record's **title property is not among them**, deliberately. It names the\n * page in the identity bar, but a heading and a labelled field are different\n * things: `Order #` is a column with a name and a description that someone opens\n * the record to read, and dropping it because its text also appears in the\n * breadcrumb removes a value from the record on the grounds that it is legible\n * somewhere else. See {@link HEADER_DISPLAY_ROLES}.\n */\nexport function readOnlyFieldKeys(\n collection: AdminCollection,\n hasFormContext: boolean,\n headerKeys?: ReadonlySet<string>\n): string[] {\n const keys = getFormFieldKeys(collection);\n const additional = hasFormContext\n ? undefined\n : new Set((collection.additionalFields ?? []).map(field => field.key));\n\n return keys.filter(key =>\n !additional?.has(key)\n && !headerKeys?.has(key));\n}\n\n/**\n * @group Components\n */\nexport interface EntityViewBindingProps<M extends Record<string, unknown>> {\n entity: Entity<M>;\n collection: AdminCollection<M>;\n path: string;\n className?: string;\n /**\n * Lay the record out as a page: a centred, scrolling column with the\n * metadata rail beside it, exactly as the form does. Off for the inline\n * uses — the delete dialog renders the record inside a box it already owns.\n */\n asPage?: boolean;\n /** Padding preset, matching the form's. Only read when `asPage`. */\n openEntityMode?: \"side_panel\" | \"full_screen\" | \"split\" | \"dialog\";\n /**\n * Needed only to render `additionalFields`, which are arbitrary components\n * that take a form context. Without one those entries are left out rather\n * than rendered against a fake context.\n */\n formContext?: FormContext<M>;\n}\n\n/**\n * The read-only rendering of a record's values.\n *\n * This is the same layout as {@link EntityForm}: the sections, the grid spans,\n * the labels and the rail all come from the one resolver, so the record does\n * not rearrange itself when you press Edit. Only the controls differ — each\n * field renders its {@link PropertyPreview} instead of an input.\n *\n * It used to be a flat two-column table of every value in the record: no\n * grouping, no widths, a label column sized for short names and a value column\n * that wrapped emails over two lines while the pane beside it stayed empty. A\n * boolean and a markdown body were given the same room.\n *\n * The synthetic `Id` row it used to prepend is gone with the same reasoning the\n * form applies: between that row, the collection's own id property and the\n * `path/id` chip above them, one UUID appeared three times. The id is a\n * copyable chip in the identity bar, and the rail's record block, once each.\n *\n * The labels are the form's labels, icon and all: a field is the same field\n * whether or not you are editing it. What `mode: \"read\"` drops is the per-field\n * *description*, which is input help rather than part of the label — and what it\n * adds is room. A control is a bordered box that separates itself from the next\n * one; a value is bare text, so the rows and sections are opened up rather than\n * inheriting spacing sized for inputs.\n */\nexport function EntityViewBinding<M extends Record<string, unknown>>(\n {\n entity,\n collection,\n className,\n asPage = false,\n openEntityMode = \"full_screen\",\n formContext\n }: EntityViewBindingProps<M>) {\n\n // The record's name, picture, state and labels, lifted out of the grid and\n // into a header. Resolved here rather than inside it because the fields it\n // renders have to come *out* of the layout, and the layout is resolved here.\n const display = useEntityDisplayValues<M>({\n collection,\n entity\n });\n\n const headerKeys = useMemo(() => {\n const keys = new Set<string>();\n for (const role of HEADER_DISPLAY_ROLES) {\n // Set only for a role filled by a property of this collection. A\n // role filled by a resolver has no field on the grid to remove.\n const key = display[role].source?.key;\n if (key) keys.add(key);\n }\n return keys;\n }, [display]);\n\n // Only *whether* there is a form context changes the field list, not which\n // one it is — so the memo turns on the boolean rather than on the context\n // object, which is rebuilt on every keystroke of the form above it.\n const hasFormContext = Boolean(formContext);\n const fieldKeys = useMemo(\n () => readOnlyFieldKeys(collection as AdminCollection, hasFormContext, headerKeys),\n [collection, hasFormContext, headerKeys]\n );\n\n // `status: \"existing\"` — a record you are reading exists by definition, and\n // that is what routes a generated id and the audit timestamps out of the\n // column and into the record block.\n const layout = useMemo(() => resolveFormLayout({\n collection,\n fieldKeys,\n status: \"existing\"\n }), [collection, fieldKeys]);\n\n const containerRef = useRef<HTMLDivElement>(null);\n // Measured, not a breakpoint — see `useRailVisible`. The same reasoning as\n // the form's: the resolver *moves* fields into the rail, so when the rail\n // cannot be shown they have to fold back into the column.\n const railVisible = useRailVisible(containerRef);\n const showRail = asPage && layout.hasRail && railVisible;\n\n const [collapsedSections, setCollapsedSections] = useState<Set<string>>(\n () => new Set(layout.sections.filter(section => section.collapsed).map(section => section.key))\n );\n const toggleSection = useCallback((key: string) => {\n setCollapsedSections(prev => {\n const next = new Set(prev);\n if (next.has(key)) next.delete(key); else next.add(key);\n return next;\n });\n }, []);\n\n // See the same line in `EntityForm`: the context an `additionalFields`\n // Builder is documented to receive, in place of a `FormContext` asserted\n // into its shape.\n const rebaseContext = useRebaseContext();\n\n const renderField = useCallback((field: ResolvedFormField): React.ReactNode => {\n\n if (field.additional) {\n const additionalField = collection.additionalFields?.find(f => f.key === field.key);\n if (!additionalField || !formContext) return null;\n\n const AdditionalFieldBuilder = additionalField.Builder;\n const child = AdditionalFieldBuilder\n ? <AdditionalFieldBuilder entity={entity} context={rebaseContext}/>\n : <div className={\"w-full\"}>\n <AdditionalFieldValue\n field={additionalField}\n entity={entity}\n context={rebaseContext}/>\n </div>;\n\n return (\n // Through FieldBlock like every other cell, so a computed\n // column is labelled at the same size, with the same gap to its\n // box, as the property next to it on the grid.\n <div key={`additional_${field.key}`} className={spanClass(field.span)}>\n <FieldBlock propertyKey={field.key}\n showLabel={true}\n mode={\"read\"}\n label={additionalField.name}\n icon={<AlignLeftIcon size={LABEL_ICON_SIZE}/>}>\n <div className={cls(paperMixin, \"w-full min-h-12 p-4 md:p-6 overflow-x-auto no-scrollbar\")}>\n {child}\n </div>\n </FieldBlock>\n </div>\n );\n }\n\n const property = collection.properties?.[field.key] as Property | undefined;\n if (!property) return null;\n\n return (\n <div key={`field_${field.key}`} className={spanClass(field.span)}>\n {/* Always labelled from here, unlike the form. The panel editors\n that carry their own header have no header in preview — a map\n previews as a table of its children and an array as its items,\n so leaving the label to them would leave them unlabelled. */}\n <FieldBlock propertyKey={field.key}\n property={property}\n showLabel={true}\n mode={\"read\"}>\n {/* One control's height for a single-line value, so a row of\n short fields lines up with the taller ones beside it, and\n anything longer simply grows. Matched to the form's row\n rather than shrunk to the text: it is what keeps a value\n from sitting directly on the label of the row below. */}\n <div className={\"min-h-8 flex flex-col justify-center min-w-0 text-sm text-text-primary dark:text-text-primary-dark\"}>\n <PropertyPreview propertyKey={field.key}\n value={getValueInPath(entity.values, field.key)}\n property={property}\n hideLabel\n size={\"medium\"}/>\n </div>\n </FieldBlock>\n </div>\n );\n // `rebaseContext` is read twice above and was not declared, so every\n // `additionalFields` Builder kept receiving the context captured on the\n // first render — the stale closure this dependency array exists to\n // prevent. It is handed straight to customer code, which is the worst\n // place to be one version behind: a Builder that resolves a reference or\n // checks a permission would do it against a context that has since\n // changed user, auth or data source.\n }, [collection, entity, formContext, rebaseContext]);\n\n /**\n * One field of a `readVariant: \"summary\"` section: a label/value row rather\n * than a grid cell, with the last one emphasised.\n *\n * The last row is the one a summary exists for — a run of figures is read to\n * arrive at its final line — so it is separated by a rule and set at the\n * weight the grid gave every cell equally.\n */\n const renderSummaryField = useCallback((\n field: ResolvedFormField,\n index: number,\n total: number\n ): React.ReactNode => {\n\n const property = collection.properties?.[field.key] as Property | undefined;\n if (!property) return null;\n\n const last = index === total - 1;\n\n return (\n <div key={`summary_${field.key}`}\n className={cls(\n \"flex items-baseline justify-between gap-4 min-w-0 py-2\",\n last && total > 1 && cls(\"mt-1.5 pt-3 border-t\", defaultBorderMixin)\n )}>\n <span className={cls(\n \"min-w-0 truncate\",\n last\n ? \"text-sm font-semibold text-text-primary dark:text-text-primary-dark\"\n : \"text-sm text-text-secondary dark:text-text-secondary-dark\"\n )}>\n {property.name ?? field.key}\n </span>\n <span className={cls(\n \"shrink-0 text-right text-text-primary dark:text-text-primary-dark\",\n last ? \"text-base font-semibold\" : \"text-sm\"\n )}>\n <PropertyPreview propertyKey={field.key}\n value={getValueInPath(entity.values, field.key)}\n property={property}\n hideLabel\n size={\"medium\"}/>\n </span>\n </div>\n );\n }, [collection, entity]);\n\n // Same fold-back as the form: with no room for the rail its fields become a\n // trailing group rather than disappearing.\n const sections: ResolvedFormSection[] = showRail || !layout.sidebar.length\n ? layout.sections\n : [\n ...layout.sections,\n {\n key: \"__rail\",\n title: \"Settings\",\n collapsible: false,\n collapsed: false,\n fields: layout.sidebar\n }\n ];\n\n const content = <>\n {/* The title only when nothing above is already showing it. Every\n full-page use sits under an identity bar that carries it; the\n inline ones — the delete dialog — have no bar. */}\n <EntityDisplayHeader entity={entity}\n collection={collection}\n showTitle={!asPage}\n className={\"mb-10\"}/>\n\n <FormSections sections={sections}\n collapsed={collapsedSections}\n onToggle={toggleSection}\n errorKeys={NO_ERRORS}\n renderField={renderField}\n renderSummaryField={renderSummaryField}\n mode={\"read\"}/>\n\n {/* Folded back with the rail's fields, and for the same reason. The rail\n renders only where it has been measured to fit, so on the split pane,\n the side panel and the dialog this block was dropped outright and the\n record's id was nowhere on screen but the truncated chip in the bar.\n An id you cannot read or copy is the one piece of a record you most\n often opened it for. */}\n {!showRail && layout.showRecordMeta && (\n <div className={cls(\"mt-10 pt-6 border-t max-w-sm\", defaultBorderMixin)}>\n <RecordMeta entity={entity as Entity<Record<string, unknown>>}/>\n </div>\n )}\n </>;\n\n if (!asPage) {\n // `@container/col` even here: the spans resolve against the column they\n // sit in, and inside a dialog that column is the dialog.\n return (\n <div ref={containerRef} className={cls(\"@container/col w-full min-w-0\", className)}>\n {content}\n </div>\n );\n }\n\n return (\n <div ref={containerRef} className={cls(\"@container/form flex-1 flex flex-row w-full min-h-0\", className)}>\n\n {/* `items-start`: without it the cross-axis default stretches the\n column to the scroller's height and its bottom padding lands at\n the bottom of the viewport instead of after the last field. */}\n <div className={\"flex-1 min-w-0 overflow-y-auto flex justify-center items-start\"}>\n <div className={cls(\n // Same widths as the editable form (see EntityForm) — toggling\n // between read-only and edit must not move the column.\n \"@container/col w-full max-w-3xl @7xl/form:max-w-4xl 2xl:max-w-4xl flex flex-col\",\n openEntityMode === \"dialog\"\n ? \"pt-5 pb-8 px-6 sm:px-8\"\n : \"pt-6 pb-12 px-5 sm:px-8\"\n )}>\n {content}\n </div>\n </div>\n\n {showRail && <FormRail\n fields={layout.sidebar}\n showRecordMeta={layout.showRecordMeta}\n entity={entity as Entity<Record<string, unknown>>}\n renderField={renderField}/>}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,IAAM,4BAAiC,IAAI,IAAY;;;;;;;;;;;;;;;;;;;;;;;AAwBvD,SAAgB,kBACZ,YACA,gBACA,YACQ;CACR,MAAM,OAAO,iBAAiB,UAAU;CACxC,MAAM,aAAa,iBACb,KAAA,IACA,IAAI,KAAK,WAAW,oBAAoB,CAAC,EAAA,CAAG,KAAI,UAAS,MAAM,GAAG,CAAC;CAEzE,OAAO,KAAK,QAAO,QACf,CAAC,YAAY,IAAI,GAAG,KACjB,CAAC,YAAY,IAAI,GAAG,CAAC;AAChC;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgB,kBACZ,EACI,QACA,YACA,WACA,SAAS,OACT,iBAAiB,eACjB,eAC0B;CAK9B,MAAM,UAAU,uBAA0B;EACtC;EACA;CACJ,CAAC;CAED,MAAM,aAAa,cAAc;EAC7B,MAAM,uBAAO,IAAI,IAAY;EAC7B,KAAK,MAAM,QAAQ,sBAAsB;GAGrC,MAAM,MAAM,QAAQ,KAAK,CAAC,QAAQ;GAClC,IAAI,KAAK,KAAK,IAAI,GAAG;EACzB;EACA,OAAO;CACX,GAAG,CAAC,OAAO,CAAC;CAKZ,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,YAAY,cACR,kBAAkB,YAA+B,gBAAgB,UAAU,GACjF;EAAC;EAAY;EAAgB;CAAU,CAC3C;CAKA,MAAM,SAAS,cAAc,kBAAkB;EAC3C;EACA;EACA,QAAQ;CACZ,CAAC,GAAG,CAAC,YAAY,SAAS,CAAC;CAE3B,MAAM,eAAe,OAAuB,IAAI;CAIhD,MAAM,cAAc,eAAe,YAAY;CAC/C,MAAM,WAAW,UAAU,OAAO,WAAW;CAE7C,MAAM,CAAC,mBA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MAAM;EAAQ,CAAA;EAQjB,CAAC,YAAY,OAAO,kBACjB,oBAAC,OAAD;GAAK,WAAW,IAAI,gCAAgC,kBAAkB;aAClE,oBAAC,YAAD,EAAoB,OAA2C,CAAA;EAC9D,CAAA;CAEX,EAAA,CAAA;CAEF,IAAI,CAAC,QAGD,OACI,oBAAC,OAAD;EAAK,KAAK;EAAc,WAAW,IAAI,iCAAiC,SAAS;YAC5E;CACA,CAAA;CAIb,OACI,qBAAC,OAAD;EAAK,KAAK;EAAc,WAAW,IAAI,uDAAuD,SAAS;YAAvG,CAKI,oBAAC,OAAD;GAAK,WAAW;aACZ,oBAAC,OAAD;IAAK,WAAW,IAGZ,mFACA,mBAAmB,WACb,2BACA,yBACV;cACK;GACA,CAAA;EACJ,CAAA,GAEJ,YAAY,oBAAC,UAAD;GACT,QAAQ,OAAO;GACf,gBAAgB,OAAO;GACf;GACK;EAAa,CAAA,CAC7B;;AAEb"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Typography } from "@rebasepro/ui";
|
|
4
|
+
//#region src/components/FieldCaption.tsx
|
|
5
|
+
function FieldCaption({ error, children }) {
|
|
6
|
+
if (!children) return null;
|
|
7
|
+
return /* @__PURE__ */ jsx(Typography, {
|
|
8
|
+
variant: "caption",
|
|
9
|
+
color: error ? "error" : "secondary",
|
|
10
|
+
className: "ml-3.5 mt-0.5",
|
|
11
|
+
children
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { FieldCaption };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=FieldCaption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldCaption.js","names":[],"sources":["../../src/components/FieldCaption.tsx"],"sourcesContent":["import React from \"react\";\nimport { Typography } from \"@rebasepro/ui\";\n\nexport function FieldCaption({\n error,\n children\n}: { error?: boolean, children?: React.ReactNode }) {\n if (!children) return null;\n return (\n <Typography variant={\"caption\"} color={error ? \"error\" : \"secondary\"} className={\"ml-3.5 mt-0.5\"}>\n {children}\n </Typography>\n );\n}\n"],"mappings":";;;;AAGA,SAAgB,aAAa,EACzB,OACA,YACgD;CAChD,IAAI,CAAC,UAAU,OAAO;CACtB,OACI,oBAAC,YAAD;EAAY,SAAS;EAAW,OAAO,QAAQ,UAAU;EAAa,WAAW;EAC5E;CACO,CAAA;AAEpB"}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { useAdminContext } from "../../hooks/useAdminContext.js";
|
|
2
|
+
import { useBreadcrumbsController } from "../../hooks/useBreadcrumbsController.js";
|
|
3
|
+
import { NavigationLoadingErrorView } from "../NavigationLoadingErrorView.js";
|
|
4
|
+
import { FavouritesView } from "./FavouritesView.js";
|
|
5
|
+
import { NavigationGroup } from "./NavigationGroup.js";
|
|
6
|
+
import { NavigationCardBinding } from "./NavigationCardBinding.js";
|
|
7
|
+
import { NavigationGroupDroppable, NewGroupDropZone, SortableNavigationCard, SortableNavigationGroup, useHomePageDnd } from "./HomePageDnD.js";
|
|
8
|
+
import { RenameGroupDialog } from "./RenameGroupDialog.js";
|
|
9
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Container, ErrorBoundary, SearchBar } from "@rebasepro/ui";
|
|
12
|
+
import { SchemaDriftBanner, buildCollapsedDefaults, useAdminModeController, useCollapsedGroups, useCustomizationController, useRebaseRegistry, useRestoreScroll, useSlot, useTranslation } from "@rebasepro/app";
|
|
13
|
+
import { DndContext, DragOverlay, MeasuringStrategy } from "@dnd-kit/core";
|
|
14
|
+
import { restrictToVerticalAxis, restrictToWindowEdges } from "@dnd-kit/modifiers";
|
|
15
|
+
import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
16
|
+
import Fuse from "fuse.js";
|
|
17
|
+
//#region src/components/HomePage/ContentHomePage.tsx
|
|
18
|
+
var DEFAULT_GROUP_NAME = "Views";
|
|
19
|
+
var ADMIN_GROUP_NAME = "Admin";
|
|
20
|
+
function ContentHomePage({ additionalActions, additionalChildrenStart, additionalChildrenEnd, sections, hiddenGroups }) {
|
|
21
|
+
const context = useAdminContext();
|
|
22
|
+
const { navigationStateController } = context;
|
|
23
|
+
const customizationController = useCustomizationController();
|
|
24
|
+
const adminModeController = useAdminModeController();
|
|
25
|
+
const registry = useRebaseRegistry();
|
|
26
|
+
const { resolvedSlots } = customizationController;
|
|
27
|
+
const breadcrumbs = useBreadcrumbsController();
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
breadcrumbs.set({ breadcrumbs: [] });
|
|
31
|
+
}, [breadcrumbs.set]);
|
|
32
|
+
const { allowDragAndDrop = false, navigationEntries: unFilteredNavigationEntries = [], groups: unFilteredGroupOrder = [], onNavigationEntriesUpdate = () => {} } = navigationStateController.topLevelNavigation || {};
|
|
33
|
+
const studioViewSlugs = useMemo(() => {
|
|
34
|
+
const slugs = /* @__PURE__ */ new Set();
|
|
35
|
+
(registry.studioConfig?.devViews ?? []).forEach((v) => slugs.add(v.slug));
|
|
36
|
+
if (registry.studioConfig && registry.cmsConfig?.collectionEditor) slugs.add("schema");
|
|
37
|
+
return slugs;
|
|
38
|
+
}, [registry.studioConfig, registry.cmsConfig?.collectionEditor]);
|
|
39
|
+
const rawNavigationEntries = useMemo(() => {
|
|
40
|
+
if (adminModeController.mode === "studio") return unFilteredNavigationEntries.filter((e) => e.type === "view" && studioViewSlugs.has(e.slug) || e.type === "admin");
|
|
41
|
+
return unFilteredNavigationEntries.filter((e) => e.type !== "view" || !studioViewSlugs.has(e.slug));
|
|
42
|
+
}, [
|
|
43
|
+
unFilteredNavigationEntries,
|
|
44
|
+
adminModeController.mode,
|
|
45
|
+
studioViewSlugs
|
|
46
|
+
]);
|
|
47
|
+
const groupOrderFromNavController = useMemo(() => {
|
|
48
|
+
const entryGroups = new Set(rawNavigationEntries.map((e) => e.group).filter(Boolean));
|
|
49
|
+
return unFilteredGroupOrder.filter((g) => entryGroups.has(g));
|
|
50
|
+
}, [unFilteredGroupOrder, rawNavigationEntries]);
|
|
51
|
+
const fuse = useRef(null);
|
|
52
|
+
const [filteredUrls, setFilteredUrls] = useState(null);
|
|
53
|
+
const performingSearch = Boolean(filteredUrls);
|
|
54
|
+
const filteredNavigationEntries = useMemo(() => {
|
|
55
|
+
return filteredUrls ? rawNavigationEntries.filter((e) => filteredUrls.includes(e.url)) : rawNavigationEntries;
|
|
56
|
+
}, [filteredUrls, rawNavigationEntries]);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
fuse.current = new Fuse(rawNavigationEntries, { keys: [
|
|
59
|
+
"name",
|
|
60
|
+
"description",
|
|
61
|
+
"group",
|
|
62
|
+
"path"
|
|
63
|
+
] });
|
|
64
|
+
}, [rawNavigationEntries]);
|
|
65
|
+
const updateSearch = useCallback((v) => {
|
|
66
|
+
if (!v?.trim()) {
|
|
67
|
+
setFilteredUrls(null);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const results = fuse.current?.search(v.trim());
|
|
71
|
+
setFilteredUrls(results ? results.map((x) => x.item.url) : []);
|
|
72
|
+
}, []);
|
|
73
|
+
const [items, setItems] = useState([]);
|
|
74
|
+
const [adminGroupData, setAdminGroupData] = useState(null);
|
|
75
|
+
const isDndDirtyRef = useRef(false);
|
|
76
|
+
const dndDirtyTimeoutRef = useRef(null);
|
|
77
|
+
const processedGroups = useMemo(() => {
|
|
78
|
+
const src = filteredNavigationEntries;
|
|
79
|
+
const entriesByGroup = {};
|
|
80
|
+
src.forEach((e) => {
|
|
81
|
+
const g = e.type === "admin" ? ADMIN_GROUP_NAME : e.group ?? "Views";
|
|
82
|
+
(entriesByGroup[g] ??= []).push(e);
|
|
83
|
+
});
|
|
84
|
+
const hasPluginAdditionalCards = customizationController.resolvedSlots.some((s) => s.slot === "home.cards");
|
|
85
|
+
let allProcessed;
|
|
86
|
+
if (performingSearch) allProcessed = [...new Set(src.map((e) => e.group ?? "Views"))].map((name) => ({
|
|
87
|
+
name,
|
|
88
|
+
entries: entriesByGroup[name] || []
|
|
89
|
+
})).filter((g) => g.entries.length);
|
|
90
|
+
else {
|
|
91
|
+
allProcessed = groupOrderFromNavController.map((g) => ({
|
|
92
|
+
name: g,
|
|
93
|
+
entries: entriesByGroup[g] || []
|
|
94
|
+
}));
|
|
95
|
+
Object.keys(entriesByGroup).forEach((g) => {
|
|
96
|
+
if (!groupOrderFromNavController.includes(g)) allProcessed.push({
|
|
97
|
+
name: g,
|
|
98
|
+
entries: entriesByGroup[g]
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
if (hasPluginAdditionalCards && !allProcessed.some((g) => g.name === "Views")) allProcessed.push({
|
|
102
|
+
name: DEFAULT_GROUP_NAME,
|
|
103
|
+
entries: []
|
|
104
|
+
});
|
|
105
|
+
allProcessed = allProcessed.filter((g) => g.entries.length || g.name === "Views" && hasPluginAdditionalCards);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
adminGroupData: allProcessed.find((g) => g.name === "Admin") || null,
|
|
109
|
+
items: allProcessed.filter((g) => g.name !== "Admin" && !hiddenGroups?.includes(g.name))
|
|
110
|
+
};
|
|
111
|
+
}, [
|
|
112
|
+
filteredNavigationEntries,
|
|
113
|
+
performingSearch,
|
|
114
|
+
groupOrderFromNavController,
|
|
115
|
+
customizationController.resolvedSlots,
|
|
116
|
+
hiddenGroups
|
|
117
|
+
]);
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (isDndDirtyRef.current) return;
|
|
120
|
+
setAdminGroupData(processedGroups.adminGroupData);
|
|
121
|
+
setItems(processedGroups.items);
|
|
122
|
+
}, [processedGroups]);
|
|
123
|
+
const updateItems = (updater) => {
|
|
124
|
+
setItems(updater);
|
|
125
|
+
};
|
|
126
|
+
const persistNavigationGroups = (latest) => {
|
|
127
|
+
isDndDirtyRef.current = true;
|
|
128
|
+
if (dndDirtyTimeoutRef.current) clearTimeout(dndDirtyTimeoutRef.current);
|
|
129
|
+
dndDirtyTimeoutRef.current = setTimeout(() => {
|
|
130
|
+
isDndDirtyRef.current = false;
|
|
131
|
+
}, 1e3);
|
|
132
|
+
const draggable = latest.map((g) => ({
|
|
133
|
+
name: g.name,
|
|
134
|
+
entries: g.entries.map((e) => e.slug)
|
|
135
|
+
}));
|
|
136
|
+
const all = adminGroupData ? [...draggable, {
|
|
137
|
+
name: adminGroupData.name,
|
|
138
|
+
entries: adminGroupData.entries.map((e) => e.slug)
|
|
139
|
+
}] : draggable;
|
|
140
|
+
onNavigationEntriesUpdate(all);
|
|
141
|
+
};
|
|
142
|
+
const { isGroupCollapsed, toggleGroupCollapsed } = useCollapsedGroups(useMemo(() => [...items.map((item) => item.name), ...adminGroupData ? [adminGroupData.name] : []], [items, adminGroupData]), "home", useMemo(() => buildCollapsedDefaults(registry.cmsConfig?.navigationGroupMappings, "home"), [registry.cmsConfig?.navigationGroupMappings]));
|
|
143
|
+
const { sensors, collisionDetection, onDragStart, onDragOver, onDragEnd, dropAnimation, activeItemForOverlay, activeGroupData, draggingGroupId, containers, dndKitActiveNode, onDragCancel, isDraggingCardOnly, dialogOpenForGroup, setDialogOpenForGroup, handleRenameGroup, handleDialogClose, isHoveringNewGroupDropZone, setIsHoveringNewGroupDropZone } = useHomePageDnd({
|
|
144
|
+
items,
|
|
145
|
+
setItems: updateItems,
|
|
146
|
+
disabled: !allowDragAndDrop || performingSearch,
|
|
147
|
+
onPersist: persistNavigationGroups,
|
|
148
|
+
onGroupMoved: (g) => context.analyticsController?.onAnalyticsEvent?.("home_move_group", { name: g }),
|
|
149
|
+
onCardMovedBetweenGroups: (card) => context.analyticsController?.onAnalyticsEvent?.("home_move_card", { id: card.id }),
|
|
150
|
+
onNewGroupDrop: () => context.analyticsController?.onAnalyticsEvent?.("home_drop_new_group")
|
|
151
|
+
});
|
|
152
|
+
const { containerRef, direction } = useRestoreScroll();
|
|
153
|
+
const dndDisabled = !allowDragAndDrop || performingSearch;
|
|
154
|
+
const dndModifiers = dndKitActiveNode?.data.current?.type === "group" ? [restrictToVerticalAxis, restrictToWindowEdges] : [restrictToWindowEdges];
|
|
155
|
+
const sectionProps = { context };
|
|
156
|
+
const additionalPluginChildrenStart = useSlot("home.children.start", sectionProps);
|
|
157
|
+
const additionalPluginChildrenEnd = useSlot("home.children.end", sectionProps);
|
|
158
|
+
const additionalPluginActions = useSlot("home.actions", sectionProps);
|
|
159
|
+
const homeCardContributions = useMemo(() => {
|
|
160
|
+
return resolvedSlots.filter((s) => s.slot === "home.cards").sort((a, b) => (a.order ?? 50) - (b.order ?? 50));
|
|
161
|
+
}, [resolvedSlots]);
|
|
162
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
163
|
+
ref: containerRef,
|
|
164
|
+
className: "py-2 overflow-auto h-full w-full bg-surface-sheet",
|
|
165
|
+
children: [/* @__PURE__ */ jsxs(Container, {
|
|
166
|
+
maxWidth: "6xl",
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ jsx("div", {
|
|
169
|
+
className: "mb-4 flex flex-col gap-2",
|
|
170
|
+
children: /* @__PURE__ */ jsx(SchemaDriftBanner, {})
|
|
171
|
+
}),
|
|
172
|
+
/* @__PURE__ */ jsxs("div", {
|
|
173
|
+
className: "w-full sticky py-4 transition-all duration-400 ease-in-out top-0 z-10 flex flex-row gap-4",
|
|
174
|
+
style: { top: direction === "down" ? -84 : 0 },
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ jsx(SearchBar, {
|
|
177
|
+
onTextSearch: updateSearch,
|
|
178
|
+
placeholder: t("search_collections"),
|
|
179
|
+
autoFocus: true,
|
|
180
|
+
size: "small",
|
|
181
|
+
innerClassName: "w-full",
|
|
182
|
+
className: "w-full grow"
|
|
183
|
+
}),
|
|
184
|
+
additionalActions,
|
|
185
|
+
additionalPluginActions
|
|
186
|
+
]
|
|
187
|
+
}),
|
|
188
|
+
navigationStateController.navigationLoadingError && /* @__PURE__ */ jsx("div", {
|
|
189
|
+
className: "mb-4",
|
|
190
|
+
children: /* @__PURE__ */ jsx(NavigationLoadingErrorView, {
|
|
191
|
+
error: navigationStateController.navigationLoadingError,
|
|
192
|
+
onRetry: navigationStateController.refreshNavigation
|
|
193
|
+
})
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ jsx(FavouritesView, { hidden: performingSearch }),
|
|
196
|
+
additionalChildrenStart,
|
|
197
|
+
additionalPluginChildrenStart,
|
|
198
|
+
/* @__PURE__ */ jsxs(DndContext, {
|
|
199
|
+
sensors,
|
|
200
|
+
collisionDetection,
|
|
201
|
+
measuring: { droppable: {
|
|
202
|
+
strategy: MeasuringStrategy.Always,
|
|
203
|
+
frequency: 500
|
|
204
|
+
} },
|
|
205
|
+
onDragStart,
|
|
206
|
+
onDragOver,
|
|
207
|
+
onDragEnd,
|
|
208
|
+
onDragCancel,
|
|
209
|
+
modifiers: dndModifiers,
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ jsx(SortableContext, {
|
|
212
|
+
items: containers,
|
|
213
|
+
strategy: verticalListSortingStrategy,
|
|
214
|
+
children: items.map((groupData, groupIndex) => {
|
|
215
|
+
const groupKey = groupData.name;
|
|
216
|
+
const entriesInGroup = groupData.entries;
|
|
217
|
+
const homeCardsProps = {
|
|
218
|
+
group: groupKey === "Views" ? void 0 : groupKey,
|
|
219
|
+
context
|
|
220
|
+
};
|
|
221
|
+
const additionalCards = homeCardContributions.map((s, i) => /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(s.Component, {
|
|
222
|
+
...homeCardsProps,
|
|
223
|
+
...s.props ?? {}
|
|
224
|
+
}) }, `home_cards_${groupKey}_${i}`));
|
|
225
|
+
if (entriesInGroup.length === 0 && (additionalCards.length === 0 || performingSearch)) return null;
|
|
226
|
+
return /* @__PURE__ */ jsx(SortableNavigationGroup, {
|
|
227
|
+
groupName: groupKey,
|
|
228
|
+
disabled: dndDisabled,
|
|
229
|
+
children: /* @__PURE__ */ jsx(NavigationGroup, {
|
|
230
|
+
group: groupKey === "Views" ? void 0 : groupKey,
|
|
231
|
+
minimised: draggingGroupId === groupKey && !isDraggingCardOnly,
|
|
232
|
+
isPotentialCardDropTarget: isDraggingCardOnly,
|
|
233
|
+
dndDisabled,
|
|
234
|
+
onEditGroup: () => {
|
|
235
|
+
if (dndDisabled) return;
|
|
236
|
+
setDialogOpenForGroup(groupKey);
|
|
237
|
+
},
|
|
238
|
+
collapsed: isGroupCollapsed(groupKey),
|
|
239
|
+
onToggleCollapsed: () => toggleGroupCollapsed(groupKey),
|
|
240
|
+
children: /* @__PURE__ */ jsx(NavigationGroupDroppable, {
|
|
241
|
+
id: groupKey,
|
|
242
|
+
itemIds: entriesInGroup.map((e) => e.url),
|
|
243
|
+
isPotentialCardDropTarget: isDraggingCardOnly,
|
|
244
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
245
|
+
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 ",
|
|
246
|
+
children: [entriesInGroup.map((entry) => /* @__PURE__ */ jsx(SortableNavigationCard, {
|
|
247
|
+
entry,
|
|
248
|
+
onClick: () => {
|
|
249
|
+
let event = "unmapped_event";
|
|
250
|
+
if (entry.type === "collection") event = "home_navigate_to_collection";
|
|
251
|
+
else if (entry.type === "view") event = "home_navigate_to_view";
|
|
252
|
+
else if (entry.type === "admin") event = "home_navigate_to_admin_view";
|
|
253
|
+
context.analyticsController?.onAnalyticsEvent?.(event, { path: entry.slug });
|
|
254
|
+
}
|
|
255
|
+
}, entry.url)), !performingSearch && groupKey.toLowerCase() !== "Admin".toLowerCase() && additionalCards]
|
|
256
|
+
})
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
}, `group-${groupIndex}`);
|
|
260
|
+
})
|
|
261
|
+
}, containers.join(",")),
|
|
262
|
+
/* @__PURE__ */ jsx(NewGroupDropZone, {
|
|
263
|
+
disabled: dndDisabled,
|
|
264
|
+
setIsHovering: setIsHoveringNewGroupDropZone
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ jsx(DragOverlay, {
|
|
267
|
+
adjustScale: false,
|
|
268
|
+
dropAnimation,
|
|
269
|
+
children: activeGroupData && draggingGroupId === activeGroupData.name ? /* @__PURE__ */ jsx("div", {
|
|
270
|
+
className: "rounded-lg bg-transparent",
|
|
271
|
+
style: {
|
|
272
|
+
padding: 0,
|
|
273
|
+
margin: 0
|
|
274
|
+
},
|
|
275
|
+
children: /* @__PURE__ */ jsx(NavigationGroup, {
|
|
276
|
+
group: activeGroupData.name === "Views" ? void 0 : activeGroupData.name,
|
|
277
|
+
isPreview: false,
|
|
278
|
+
minimised: true
|
|
279
|
+
})
|
|
280
|
+
}) : activeItemForOverlay ? /* @__PURE__ */ jsx(NavigationCardBinding, {
|
|
281
|
+
...activeItemForOverlay,
|
|
282
|
+
shrink: isHoveringNewGroupDropZone
|
|
283
|
+
}) : null
|
|
284
|
+
})
|
|
285
|
+
]
|
|
286
|
+
}),
|
|
287
|
+
!performingSearch && adminGroupData && /* @__PURE__ */ jsx(NavigationGroup, {
|
|
288
|
+
group: adminGroupData.name,
|
|
289
|
+
collapsed: isGroupCollapsed(adminGroupData.name),
|
|
290
|
+
onToggleCollapsed: () => toggleGroupCollapsed(adminGroupData.name),
|
|
291
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
292
|
+
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 ",
|
|
293
|
+
children: adminGroupData.entries.map((entry) => /* @__PURE__ */ jsx(NavigationCardBinding, {
|
|
294
|
+
...entry,
|
|
295
|
+
onClick: () => {
|
|
296
|
+
let event = "unmapped_event";
|
|
297
|
+
if (entry.type === "collection") event = "home_navigate_to_collection";
|
|
298
|
+
else if (entry.type === "view") event = "home_navigate_to_view";
|
|
299
|
+
else if (entry.type === "admin") event = "home_navigate_to_admin_view";
|
|
300
|
+
context.analyticsController?.onAnalyticsEvent?.(event, { path: entry.slug });
|
|
301
|
+
}
|
|
302
|
+
}, entry.url))
|
|
303
|
+
})
|
|
304
|
+
}),
|
|
305
|
+
sections && sections.map((section) => /* @__PURE__ */ jsx(NavigationGroup, {
|
|
306
|
+
group: section.title,
|
|
307
|
+
children: section.children
|
|
308
|
+
}, section.key)),
|
|
309
|
+
additionalPluginChildrenEnd,
|
|
310
|
+
additionalChildrenEnd
|
|
311
|
+
]
|
|
312
|
+
}), dialogOpenForGroup && /* @__PURE__ */ jsx(RenameGroupDialog, {
|
|
313
|
+
open: true,
|
|
314
|
+
initialName: dialogOpenForGroup,
|
|
315
|
+
existingGroupNames: items.map((g) => g.name).filter((n) => n !== dialogOpenForGroup),
|
|
316
|
+
onClose: handleDialogClose,
|
|
317
|
+
onRename: (newName) => {
|
|
318
|
+
handleRenameGroup(dialogOpenForGroup, newName);
|
|
319
|
+
}
|
|
320
|
+
})]
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
//#endregion
|
|
324
|
+
export { ADMIN_GROUP_NAME, ContentHomePage, DEFAULT_GROUP_NAME };
|
|
325
|
+
|
|
326
|
+
//# sourceMappingURL=ContentHomePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentHomePage.js","names":[],"sources":["../../../src/components/HomePage/ContentHomePage.tsx"],"sourcesContent":["import type { HomePageSection, NavigationEntry, NavigationGroupMapping, PluginGenericProps } from \"@rebasepro/cms-types\";\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport Fuse from \"fuse.js\";\nimport { Container, SearchBar } from \"@rebasepro/ui\";\nimport { AnalyticsEvent } from \"@rebasepro/cms-types\";\nimport { FavouritesView } from \"./FavouritesView\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { NavigationGroup } from \"./NavigationGroup\";\nimport {\n NavigationGroupDroppable,\n NewGroupDropZone,\n SortableNavigationCard,\n SortableNavigationGroup,\n useHomePageDnd\n} from \"./HomePageDnD\";\nimport { DndContext, DragOverlay, MeasuringStrategy } from \"@dnd-kit/core\";\nimport { NavigationCardBinding } from \"./NavigationCardBinding\";\nimport { SortableContext, verticalListSortingStrategy } from \"@dnd-kit/sortable\";\nimport { restrictToVerticalAxis, restrictToWindowEdges } from \"@dnd-kit/modifiers\";\nimport { RenameGroupDialog } from \"./RenameGroupDialog\";\nimport { toArray } from \"@rebasepro/utils\";\nimport { useCollapsedGroups, buildCollapsedDefaults, useCustomizationController, useTranslation, useSlot, useAdminModeController, useRebaseRegistry } from \"@rebasepro/app\";\nimport { useRestoreScroll } from \"@rebasepro/app\";\n\nimport { SchemaDriftBanner } from \"@rebasepro/app\";\nimport { useBreadcrumbsController } from \"../../hooks/useBreadcrumbsController\";\nimport { useAdminContext } from \"../../hooks/useAdminContext\";\nimport { NavigationLoadingErrorView } from \"../NavigationLoadingErrorView\";\n\nexport const DEFAULT_GROUP_NAME = \"Views\";\nexport const ADMIN_GROUP_NAME = \"Admin\";\n\nexport function ContentHomePage({\n additionalActions,\n additionalChildrenStart,\n additionalChildrenEnd,\n sections,\n hiddenGroups\n}: {\n additionalActions?: React.ReactNode;\n additionalChildrenStart?: React.ReactNode;\n additionalChildrenEnd?: React.ReactNode;\n sections?: HomePageSection[];\n hiddenGroups?: string[];\n}) {\n\n const context = useAdminContext();\n const { navigationStateController } = context;\n const customizationController = useCustomizationController();\n const adminModeController = useAdminModeController();\n const registry = useRebaseRegistry();\n\n const { resolvedSlots } = customizationController;\n const breadcrumbs = useBreadcrumbsController();\n const { t } = useTranslation();\n\n useEffect(() => {\n breadcrumbs.set({ breadcrumbs: [] });\n }, [breadcrumbs.set]);\n\n const {\n allowDragAndDrop = false,\n navigationEntries: unFilteredNavigationEntries = [],\n groups: unFilteredGroupOrder = [],\n onNavigationEntriesUpdate = () => {}\n } = navigationStateController.topLevelNavigation || {};\n\n // Build a set of Studio-only dev view slugs so we can distinguish them from\n // admin custom views added via <RebaseCMS views={...}> or plugins.\n const studioViewSlugs = useMemo(() => {\n const slugs = new Set<string>();\n (registry.studioConfig?.devViews ?? []).forEach(v => slugs.add(v.slug));\n if (registry.studioConfig && registry.cmsConfig?.collectionEditor) slugs.add(\"schema\");\n return slugs;\n }, [registry.studioConfig, registry.cmsConfig?.collectionEditor]);\n\n // Studio mode shows Studio dev views + admin entries (Users/Roles).\n // Content mode shows collections, admin custom views, and admin entries — but not Studio dev views.\n const rawNavigationEntries = useMemo(() => {\n if (adminModeController.mode === \"studio\") {\n return unFilteredNavigationEntries.filter(e => (e.type === \"view\" && studioViewSlugs.has(e.slug)) || e.type === \"admin\");\n }\n return unFilteredNavigationEntries.filter(e => e.type !== \"view\" || !studioViewSlugs.has(e.slug));\n }, [unFilteredNavigationEntries, adminModeController.mode, studioViewSlugs]);\n\n const groupOrderFromNavController = useMemo(() => {\n const entryGroups = new Set(rawNavigationEntries.map(e => e.group).filter(Boolean));\n return unFilteredGroupOrder.filter(g => entryGroups.has(g));\n }, [unFilteredGroupOrder, rawNavigationEntries]);\n\n const fuse = useRef<Fuse<NavigationEntry> | null>(null);\n const [filteredUrls, setFilteredUrls] = useState<string[] | null>(null);\n const performingSearch = Boolean(filteredUrls);\n\n // Memoize filtered navigation entries to prevent unnecessary recalculations\n const filteredNavigationEntries = useMemo(() => {\n return filteredUrls\n ? rawNavigationEntries.filter((e) => filteredUrls.includes(e.url))\n : rawNavigationEntries;\n }, [filteredUrls, rawNavigationEntries]);\n\n useEffect(() => {\n fuse.current = new Fuse(rawNavigationEntries, {\n keys: [\"name\", \"description\", \"group\", \"path\"]\n });\n }, [rawNavigationEntries]);\n\n const updateSearch = useCallback((v?: string) => {\n if (!v?.trim()) {\n setFilteredUrls(null);\n return;\n }\n const results = fuse.current?.search(v.trim());\n setFilteredUrls(results ? results.map((x) => x.item.url) : []);\n }, []);\n\n /* ───────────────────────────────────────────────────────────────\n Build groups (all items) + isolate Admin\n ─────────────────────────────────────────────────────────────── */\n const [items, setItems] = useState<\n { name: string; entries: NavigationEntry[] }[]\n >([]);\n const [adminGroupData, setAdminGroupData] = useState<{\n name: string;\n entries: NavigationEntry[];\n } | null>(null);\n\n // Flag to prevent useEffect from overwriting local DnD state\n const isDndDirtyRef = useRef(false);\n const dndDirtyTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Memoize the processed groups to avoid unnecessary recalculations\n const processedGroups = useMemo(() => {\n const src = filteredNavigationEntries;\n const entriesByGroup: Record<string, NavigationEntry[]> = {};\n\n src.forEach((e) => {\n const g =\n e.type === \"admin\"\n ? ADMIN_GROUP_NAME\n : e.group ?? DEFAULT_GROUP_NAME;\n (entriesByGroup[g] ??= []).push(e);\n });\n\n // Check if there are custom additional card components from plugins\n const hasPluginAdditionalCards = customizationController.resolvedSlots.some(s => s.slot === \"home.cards\");\n\n let allProcessed: { name: string; entries: NavigationEntry[] }[];\n\n if (performingSearch) {\n const ordered = [\n ...new Set(src.map((e) => e.group ?? DEFAULT_GROUP_NAME))\n ];\n allProcessed = ordered\n .map((name) => ({\n name,\n entries: entriesByGroup[name] || []\n }))\n .filter((g) => g.entries.length);\n } else {\n allProcessed = groupOrderFromNavController.map((g) => ({\n name: g,\n entries: entriesByGroup[g] || []\n }));\n Object.keys(entriesByGroup).forEach((g) => {\n if (!groupOrderFromNavController.includes(g))\n allProcessed.push({\n name: g,\n entries: entriesByGroup[g]\n });\n });\n\n // Ensure default group exists if there are plugin additional cards but no collections\n if (hasPluginAdditionalCards && !allProcessed.some(g => g.name === DEFAULT_GROUP_NAME)) {\n allProcessed.push({\n name: DEFAULT_GROUP_NAME,\n entries: []\n });\n }\n\n allProcessed = allProcessed.filter(\n (g) =>\n g.entries.length ||\n (g.name === DEFAULT_GROUP_NAME && hasPluginAdditionalCards)\n );\n }\n\n const admin = allProcessed.find((g) => g.name === ADMIN_GROUP_NAME);\n return {\n adminGroupData: admin || null,\n items: allProcessed.filter((g) => g.name !== ADMIN_GROUP_NAME && !hiddenGroups?.includes(g.name))\n };\n }, [filteredNavigationEntries, performingSearch, groupOrderFromNavController, customizationController.resolvedSlots, hiddenGroups]);\n\n // Update state only when processedGroups actually changes\n // Skip update if DnD just made a local change (dirty flag is set)\n useEffect(() => {\n if (isDndDirtyRef.current) {\n // DnD just updated the state, skip this sync\n return;\n }\n setAdminGroupData(processedGroups.adminGroupData);\n setItems(processedGroups.items);\n }, [processedGroups]);\n\n /* ───────────────────────────────────────────────────────────────\n Local update vs. persistence helpers\n ─────────────────────────────────────────────────────────────── */\n const updateItems = (\n updater:\n | { name: string; entries: NavigationEntry[] }[]\n | ((\n prev: { name: string; entries: NavigationEntry[] }[]\n ) => { name: string; entries: NavigationEntry[] }[])\n ) => {\n setItems(updater); // local only\n };\n\n const persistNavigationGroups = (\n latest: { name: string; entries: NavigationEntry[] }[]\n ) => {\n // Set dirty flag to prevent useEffect from overwriting local state\n isDndDirtyRef.current = true;\n\n // Clear any existing timeout\n if (dndDirtyTimeoutRef.current) {\n clearTimeout(dndDirtyTimeoutRef.current);\n }\n\n // Clear dirty flag after a delay to allow navigation to update\n dndDirtyTimeoutRef.current = setTimeout(() => {\n isDndDirtyRef.current = false;\n }, 1000);\n\n // Map ALL groups including \"Views\"\n const draggable: NavigationGroupMapping[] = latest.map((g) => ({\n name: g.name,\n entries: g.entries.map((e) => e.slug)\n }));\n\n const all: NavigationGroupMapping[] = adminGroupData\n ? [\n ...draggable,\n {\n name: adminGroupData.name,\n entries: adminGroupData.entries.map((e) => e.slug)\n }\n ]\n : draggable;\n\n onNavigationEntriesUpdate(all);\n };\n\n // Use custom hook for collapsed groups with localStorage persistence\n const groupNames = useMemo(() => [\n ...items.map(item => item.name),\n ...(adminGroupData ? [adminGroupData.name] : [])\n ], [items, adminGroupData]);\n\n const collapsedDefaults = useMemo(\n () => buildCollapsedDefaults(registry.cmsConfig?.navigationGroupMappings, \"home\"),\n [registry.cmsConfig?.navigationGroupMappings]\n );\n const { isGroupCollapsed, toggleGroupCollapsed } = useCollapsedGroups(groupNames, \"home\", collapsedDefaults);\n\n const {\n sensors,\n collisionDetection,\n onDragStart,\n onDragOver,\n onDragEnd,\n dropAnimation,\n activeItemForOverlay,\n activeGroupData,\n draggingGroupId,\n containers,\n dndKitActiveNode,\n onDragCancel,\n isDraggingCardOnly,\n dialogOpenForGroup,\n setDialogOpenForGroup,\n handleRenameGroup,\n handleDialogClose,\n isHoveringNewGroupDropZone,\n setIsHoveringNewGroupDropZone\n } = useHomePageDnd({\n items,\n setItems: updateItems,\n disabled: !allowDragAndDrop || performingSearch,\n onPersist: persistNavigationGroups,\n onGroupMoved: (g) =>\n context.analyticsController?.onAnalyticsEvent?.(\"home_move_group\", {\n name: g\n }),\n onCardMovedBetweenGroups: (card) =>\n context.analyticsController?.onAnalyticsEvent?.(\"home_move_card\", {\n id: card.id\n }),\n onNewGroupDrop: () =>\n context.analyticsController?.onAnalyticsEvent?.(\n \"home_drop_new_group\"\n )\n });\n\n const {\n containerRef,\n direction\n } = useRestoreScroll();\n\n const dndDisabled = !allowDragAndDrop || performingSearch;\n\n const dndModifiers = dndKitActiveNode?.data.current?.type === \"group\"\n ? [restrictToVerticalAxis, restrictToWindowEdges]\n : [restrictToWindowEdges];\n\n const sectionProps: PluginGenericProps = { context };\n const additionalPluginChildrenStart = useSlot(\"home.children.start\", sectionProps);\n const additionalPluginChildrenEnd = useSlot(\"home.children.end\", sectionProps);\n const additionalPluginActions = useSlot(\"home.actions\", sectionProps);\n\n // Pre-compute home.cards slot contributions (cannot call useSlot inside .map loop)\n const homeCardContributions = useMemo(() => {\n return resolvedSlots\n .filter(s => s.slot === \"home.cards\")\n .sort((a, b) => (a.order ?? 50) - (b.order ?? 50));\n }, [resolvedSlots]);\n\n /* ───────────────────────────────────────────────────────────────\n Render\n ─────────────────────────────────────────────────────────────── */\n return (\n <div ref={containerRef} className=\"py-2 overflow-auto h-full w-full bg-surface-sheet\">\n <Container maxWidth=\"6xl\">\n <div className=\"mb-4 flex flex-col gap-2\">\n <SchemaDriftBanner />\n </div>\n {/* search & actions */}\n <div\n className=\"w-full sticky py-4 transition-all duration-400 ease-in-out top-0 z-10 flex flex-row gap-4\"\n style={{ top: direction === \"down\" ? -84 : 0 }}\n >\n <SearchBar\n onTextSearch={updateSearch}\n placeholder={t(\"search_collections\")}\n autoFocus\n size=\"small\"\n innerClassName=\"w-full\"\n className=\"w-full grow\"\n />\n {additionalActions}\n {additionalPluginActions}\n </div>\n\n {navigationStateController.navigationLoadingError &&\n <div className=\"mb-4\">\n <NavigationLoadingErrorView error={navigationStateController.navigationLoadingError}\n onRetry={navigationStateController.refreshNavigation}/>\n </div>}\n\n <FavouritesView hidden={performingSearch}/>\n\n {additionalChildrenStart}\n {additionalPluginChildrenStart}\n\n {/* ─────── DND context ─────── */}\n <DndContext\n sensors={sensors}\n collisionDetection={collisionDetection}\n measuring={{\n droppable: {\n strategy: MeasuringStrategy.Always,\n frequency: 500\n }\n }}\n onDragStart={onDragStart}\n onDragOver={onDragOver}\n onDragEnd={onDragEnd}\n onDragCancel={onDragCancel}\n modifiers={dndModifiers}\n >\n <SortableContext\n key={containers.join(\",\")}\n items={containers}\n strategy={verticalListSortingStrategy}\n >\n {items.map((groupData, groupIndex) => {\n const groupKey = groupData.name;\n const entriesInGroup = groupData.entries;\n\n const homeCardsProps = {\n group:\n groupKey === DEFAULT_GROUP_NAME\n ? undefined\n : groupKey,\n context\n };\n // Render home.cards contributions inline (no hook call inside loop)\n const additionalCards = homeCardContributions.map((s, i) => (\n <ErrorBoundary key={`home_cards_${groupKey}_${i}`}>\n <s.Component {...homeCardsProps} {...(s.props ?? {})}/>\n </ErrorBoundary>\n ));\n\n if (\n entriesInGroup.length === 0 &&\n (additionalCards.length === 0 || performingSearch)\n )\n return null;\n\n return (\n <SortableNavigationGroup\n key={`group-${groupIndex}`}\n groupName={groupKey}\n disabled={dndDisabled}\n >\n <NavigationGroup\n group={\n groupKey === DEFAULT_GROUP_NAME\n ? undefined\n : groupKey\n }\n minimised={\n draggingGroupId === groupKey &&\n !isDraggingCardOnly\n }\n isPotentialCardDropTarget={\n isDraggingCardOnly\n }\n dndDisabled={dndDisabled}\n onEditGroup={() => {\n if (dndDisabled) return;\n setDialogOpenForGroup(groupKey);\n }}\n collapsed={isGroupCollapsed(groupKey)}\n onToggleCollapsed={() => toggleGroupCollapsed(groupKey)}\n >\n <NavigationGroupDroppable\n id={groupKey}\n itemIds={entriesInGroup.map(\n (e) => e.url\n )}\n isPotentialCardDropTarget={\n isDraggingCardOnly\n }\n >\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 \">\n {entriesInGroup.map(\n (entry) => (\n <SortableNavigationCard\n key={entry.url}\n entry={entry}\n onClick={() => {\n let event: AnalyticsEvent =\n \"unmapped_event\";\n if (\n entry.type ===\n \"collection\"\n )\n event =\n \"home_navigate_to_collection\";\n else if (\n entry.type ===\n \"view\"\n )\n event =\n \"home_navigate_to_view\";\n else if (\n entry.type ===\n \"admin\"\n )\n event =\n \"home_navigate_to_admin_view\";\n\n context.analyticsController?.onAnalyticsEvent?.(\n event,\n {\n path: entry.slug\n }\n );\n }}\n />\n )\n )}\n {!performingSearch &&\n groupKey.toLowerCase() !==\n ADMIN_GROUP_NAME.toLowerCase() &&\n additionalCards}\n </div>\n </NavigationGroupDroppable>\n </NavigationGroup>\n </SortableNavigationGroup>\n );\n })}\n </SortableContext>\n\n <NewGroupDropZone\n disabled={dndDisabled}\n setIsHovering={setIsHoveringNewGroupDropZone}\n />\n\n <DragOverlay adjustScale={false} dropAnimation={dropAnimation}>\n {activeGroupData &&\n draggingGroupId === activeGroupData.name ? (\n <div\n className=\"rounded-lg bg-transparent\"\n style={{\n padding: 0,\n margin: 0\n }}\n >\n <NavigationGroup\n group={\n activeGroupData.name ===\n DEFAULT_GROUP_NAME\n ? undefined\n : activeGroupData.name\n }\n isPreview={false}\n minimised\n />\n </div>\n ) : activeItemForOverlay ? (\n <NavigationCardBinding\n {...activeItemForOverlay}\n shrink={isHoveringNewGroupDropZone}\n />\n ) : null}\n </DragOverlay>\n </DndContext>\n\n {!performingSearch && adminGroupData && (\n <NavigationGroup\n group={adminGroupData.name}\n collapsed={isGroupCollapsed(adminGroupData.name)}\n onToggleCollapsed={() => toggleGroupCollapsed(adminGroupData.name)}\n >\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 \">\n {adminGroupData.entries.map((entry) => (\n <NavigationCardBinding\n key={entry.url}\n {...entry}\n onClick={() => {\n let event: AnalyticsEvent =\n \"unmapped_event\";\n if (entry.type === \"collection\")\n event =\n \"home_navigate_to_collection\";\n else if (entry.type === \"view\")\n event = \"home_navigate_to_view\";\n else if (entry.type === \"admin\")\n event =\n \"home_navigate_to_admin_view\";\n\n context.analyticsController?.onAnalyticsEvent?.(\n event,\n { path: entry.slug }\n );\n }}\n />\n ))}\n </div>\n </NavigationGroup>\n )}\n\n {sections && sections.map((section) => (\n <NavigationGroup\n key={section.key}\n group={section.title}\n >\n {section.children}\n </NavigationGroup>\n ))}\n\n {additionalPluginChildrenEnd}\n {additionalChildrenEnd}\n </Container>\n\n {dialogOpenForGroup && (\n <RenameGroupDialog\n open\n initialName={dialogOpenForGroup}\n existingGroupNames={items\n .map((g) => g.name)\n .filter((n) => n !== dialogOpenForGroup)}\n onClose={handleDialogClose}\n onRename={(newName) => {\n handleRenameGroup(dialogOpenForGroup, newName);\n }}\n />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA6BA,IAAa,qBAAqB;AAClC,IAAa,mBAAmB;AAEhC,SAAgB,gBAAgB,EAC5B,mBACA,yBACA,uBACA,UACA,gBAOD;CAEC,MAAM,UAAU,gBAAgB;CAChC,MAAM,EAAE,8BAA8B;CACtC,MAAM,0BAA0B,2BAA2B;CAC3D,MAAM,sBAAsB,uBAAuB;CACnD,MAAM,WAAW,kBAAkB;CAEnC,MAAM,EAAE,kBAAkB;CAC1B,MAAM,cAAc,yBAAyB;CAC7C,MAAM,EAAE,MAAM,eAAe;CAE7B,gBAA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AAM,SAAS,cACf,QACI;aACH,IAAI,MAAM,SAAS,QACpB,QAAQ;aACP,IAAI,MAAM,SAAS,SACpB,QACI;QAER,QAAQ,qBAAqB,mBACzB,OACA,EAAE,MAAM,MAAM,KAAK,CACvB;OACJ;MACH,GAnBQ,MAAM,GAmBd,CACJ;KACA,CAAA;IACQ,CAAA;IAGpB,YAAY,SAAS,KAAK,YACvB,oBAAC,iBAAD;KAEI,OAAO,QAAQ;eAEd,QAAQ;IACI,GAJR,QAAQ,GAIA,CACpB;IAEA;IACA;GACM;MAEV,sBACG,oBAAC,mBAAD;GACI,MAAA;GACA,aAAa;GACb,oBAAoB,MACf,KAAK,MAAM,EAAE,IAAI,CAAC,CAClB,QAAQ,MAAM,MAAM,kBAAkB;GAC3C,SAAS;GACT,WAAW,YAAY;IACnB,kBAAkB,oBAAoB,OAAO;GACjD;EACH,CAAA,CAEJ;;AAEb"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useNavigationStateController } from "../../hooks/navigation/contexts/NavigationStateContext.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Chip, Collapse, StarIcon, iconSize } from "@rebasepro/ui";
|
|
4
|
+
import { useUserConfigurationPersistence } from "@rebasepro/app";
|
|
5
|
+
import { useNavigate } from "react-router";
|
|
6
|
+
//#region src/components/HomePage/FavouritesView.tsx
|
|
7
|
+
function NavigationChip({ entry }) {
|
|
8
|
+
const navigate = useNavigate();
|
|
9
|
+
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
10
|
+
if (!userConfigurationPersistence) return null;
|
|
11
|
+
const favourite = userConfigurationPersistence.favouritePaths.includes(entry.slug);
|
|
12
|
+
const onIconClick = (e) => {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
e.stopPropagation();
|
|
15
|
+
if (favourite) userConfigurationPersistence.setFavouritePaths(userConfigurationPersistence.favouritePaths.filter((p) => p !== entry.slug));
|
|
16
|
+
else userConfigurationPersistence.setFavouritePaths([...userConfigurationPersistence.favouritePaths, entry.slug]);
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ jsx(Chip, {
|
|
19
|
+
onClick: () => navigate(entry.url),
|
|
20
|
+
icon: /* @__PURE__ */ jsx(StarIcon, {
|
|
21
|
+
onClick: onIconClick,
|
|
22
|
+
size: iconSize.small,
|
|
23
|
+
className: favourite ? "text-secondary" : "text-surface-400 dark:text-surface-500"
|
|
24
|
+
}),
|
|
25
|
+
children: entry.name
|
|
26
|
+
}, entry.slug);
|
|
27
|
+
}
|
|
28
|
+
function FavouritesView({ hidden }) {
|
|
29
|
+
const navigationStateController = useNavigationStateController();
|
|
30
|
+
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
31
|
+
if (!userConfigurationPersistence) return null;
|
|
32
|
+
const favouriteCollections = (userConfigurationPersistence?.favouritePaths ?? []).map((path) => navigationStateController.topLevelNavigation?.navigationEntries.find((entry) => entry.slug === path)).filter(Boolean);
|
|
33
|
+
return /* @__PURE__ */ jsx(Collapse, {
|
|
34
|
+
in: favouriteCollections.length > 0,
|
|
35
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]",
|
|
37
|
+
children: favouriteCollections.map((entry) => /* @__PURE__ */ jsx(NavigationChip, { entry }, entry.slug))
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { FavouritesView };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=FavouritesView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FavouritesView.js","names":[],"sources":["../../../src/components/HomePage/FavouritesView.tsx"],"sourcesContent":["import type { NavigationEntry } from \"@rebasepro/cms-types\";\nimport { useNavigate } from \"react-router\";\n;\nimport { Chip, Collapse, iconSize, StarIcon } from \"@rebasepro/ui\";\nimport { useUserConfigurationPersistence } from \"@rebasepro/app\";\nimport { useNavigationStateController } from \"../../hooks/navigation/contexts/NavigationStateContext\";\n\nfunction NavigationChip({ entry }: { entry: NavigationEntry }) {\n\n const navigate = useNavigate();\n const userConfigurationPersistence = useUserConfigurationPersistence();\n\n if (!userConfigurationPersistence)\n return null;\n\n const favourite = userConfigurationPersistence.favouritePaths.includes(entry.slug);\n const onIconClick = (e: React.SyntheticEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (favourite) {\n userConfigurationPersistence.setFavouritePaths(\n userConfigurationPersistence.favouritePaths.filter(p => p !== entry.slug)\n );\n } else {\n userConfigurationPersistence.setFavouritePaths(\n [...userConfigurationPersistence.favouritePaths, entry.slug]\n );\n }\n };\n return <Chip\n key={entry.slug}\n onClick={() => navigate(entry.url)}\n icon={<StarIcon\n onClick={onIconClick}\n size={iconSize.small}\n className={favourite ? \"text-secondary\" : \"text-surface-400 dark:text-surface-500\"}/>\n }>\n {entry.name}\n </Chip>;\n}\n\nexport function FavouritesView({ hidden }: { hidden: boolean }) {\n\n const navigationStateController = useNavigationStateController();\n const userConfigurationPersistence = useUserConfigurationPersistence();\n\n if (!userConfigurationPersistence)\n return null;\n\n const favouriteCollections = (userConfigurationPersistence?.favouritePaths ?? [])\n .map((path) => navigationStateController.topLevelNavigation?.navigationEntries.find((entry) => entry.slug === path))\n .filter(Boolean) as NavigationEntry[];\n\n return <Collapse in={favouriteCollections.length > 0}>\n <div className=\"flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]\">\n {favouriteCollections.map((entry) => <NavigationChip key={entry.slug}\n entry={entry}/>)}\n </div>\n </Collapse>;\n}\n"],"mappings":";;;;;;AAOA,SAAS,eAAe,EAAE,SAAqC;CAE3D,MAAM,WAAW,YAAY;CAC7B,MAAM,+BAA+B,gCAAgC;CAErE,IAAI,CAAC,8BACD,OAAO;CAEX,MAAM,YAAY,6BAA6B,eAAe,SAAS,MAAM,IAAI;CACjF,MAAM,eAAe,MAA4B;EAC7C,EAAE,eAAe;EACjB,EAAE,gBAAgB;EAClB,IAAI,WACA,6BAA6B,kBACzB,6BAA6B,eAAe,QAAO,MAAK,MAAM,MAAM,IAAI,CAC5E;OAEA,6BAA6B,kBACzB,CAAC,GAAG,6BAA6B,gBAAgB,MAAM,IAAI,CAC/D;CAER;CACA,OAAO,oBAAC,MAAD;EAEH,eAAe,SAAS,MAAM,GAAG;EACjC,MAAM,oBAAC,UAAD;GACF,SAAS;GACT,MAAM,SAAS;GACf,WAAW,YAAY,mBAAmB;EAA0C,CAAA;YAEvF,MAAM;CACL,GARG,MAAM,IAQT;AACV;AAEA,SAAgB,eAAe,EAAE,UAA+B;CAE5D,MAAM,4BAA4B,6BAA6B;CAC/D,MAAM,+BAA+B,gCAAgC;CAErE,IAAI,CAAC,8BACD,OAAO;CAEX,MAAM,wBAAwB,8BAA8B,kBAAkB,CAAC,EAAA,CAC1E,KAAK,SAAS,0BAA0B,oBAAoB,kBAAkB,MAAM,UAAU,MAAM,SAAS,IAAI,CAAC,CAAC,CACnH,OAAO,OAAO;CAEnB,OAAO,oBAAC,UAAD;EAAU,IAAI,qBAAqB,SAAS;YAC/C,oBAAC,OAAD;GAAK,WAAU;aACV,qBAAqB,KAAK,UAAU,oBAAC,gBAAD,EAC1B,MAAO,GADwC,MAAM,IAC9C,CAAC;EAClB,CAAA;CACC,CAAA;AACd"}
|