@rebasepro/admin 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -0
- package/dist/CollectionEditorDialog-jA-PLh6N.js +3549 -0
- package/dist/CollectionEditorDialog-jA-PLh6N.js.map +1 -0
- package/dist/CollectionsStudioView-UKouBPOm.js +170 -0
- package/dist/CollectionsStudioView-UKouBPOm.js.map +1 -0
- package/dist/PropertyEditView-DEUddmg_.js +3660 -0
- package/dist/PropertyEditView-DEUddmg_.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +2 -2
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -1
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -1
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -1
- package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +1 -9
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -3
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +1 -1
- package/dist/collection_editor_ui.js +4 -11
- package/dist/components/ArrayContainer.d.ts +3 -3
- package/dist/components/ClearFilterSortButton.d.ts +1 -1
- package/dist/components/CollectionEditorDialogs.d.ts +2 -1
- package/dist/components/CollectionPanel.d.ts +2 -27
- package/dist/components/DefaultAppBar.d.ts +1 -1
- package/dist/components/DefaultDrawer.d.ts +4 -4
- package/dist/components/DeleteEntityDialog.d.ts +2 -1
- package/dist/components/DrawerNavigationGroup.d.ts +1 -1
- package/dist/components/DrawerNavigationItem.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +4 -3
- package/dist/components/EntityCollectionView/Board.d.ts +2 -1
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +1 -1
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCard.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +0 -24
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
- package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +2 -1
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
- package/dist/components/EntityCollectionView/SplitListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +2 -1
- package/dist/components/EntityDetailView.d.ts +1 -1
- package/dist/components/EntityEditView.d.ts +2 -2
- package/dist/components/EntityEditViewFormActions.d.ts +2 -1
- package/dist/components/EntityJsonPreview.d.ts +2 -1
- package/dist/components/EntityPreview.d.ts +3 -3
- package/dist/components/EntitySidePanel.d.ts +2 -1
- package/dist/components/EntityView.d.ts +2 -1
- package/dist/components/FieldCaption.d.ts +1 -1
- package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
- package/dist/components/HomePage/FavouritesView.d.ts +1 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +4 -4
- package/dist/components/HomePage/NavigationCard.d.ts +1 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +2 -1
- package/dist/components/HomePage/NavigationGroup.d.ts +2 -2
- package/dist/components/HomePage/RenameGroupDialog.d.ts +2 -1
- package/dist/components/HomePage/SmallNavigationCard.d.ts +1 -1
- package/dist/components/PropertyCollectionView.d.ts +2 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +2 -2
- package/dist/components/RebaseAuthGate.d.ts +1 -1
- package/dist/components/RebaseLayout.d.ts +1 -1
- package/dist/components/RebaseNavigation.d.ts +1 -1
- package/dist/components/RebaseRouteDefs.d.ts +1 -1
- package/dist/components/RebaseShell.d.ts +1 -1
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
- package/dist/components/ReferenceWidget.d.ts +2 -1
- package/dist/components/SearchIconsView.d.ts +2 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -1
- package/dist/components/SideDialogs.d.ts +1 -1
- package/dist/components/SideEntityProvider.d.ts +1 -1
- package/dist/components/admin/CreationResultDialog.d.ts +2 -1
- package/dist/components/app/AppBar.d.ts +1 -1
- package/dist/components/app/Drawer.d.ts +1 -1
- package/dist/components/common/default_entity_actions.d.ts +2 -1
- package/dist/components/history/EntityHistoryEntry.d.ts +1 -1
- package/dist/components/history/EntityHistoryView.d.ts +1 -1
- package/dist/components/history/LastEditedByFormAction.d.ts +2 -1
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -1
- package/dist/components/history/UserChip.d.ts +1 -1
- package/dist/data_export/export/BasicExportAction.d.ts +2 -1
- package/dist/data_export/export/ExportCollectionAction.d.ts +1 -1
- package/dist/data_import/components/DataNewPropertiesMapping.d.ts +1 -1
- package/dist/data_import/components/ImportFileUpload.d.ts +1 -1
- package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +2 -1
- package/dist/data_import/components/ImportSaveInProgress.d.ts +1 -1
- package/dist/data_import/import/ImportCollectionAction.d.ts +4 -3
- package/dist/editor/components/SlashCommandMenu.d.ts +2 -1
- package/dist/editor/editor.d.ts +1 -1
- package/dist/editor/selectors/color-selector.d.ts +1 -1
- package/dist/editor/selectors/link-selector.d.ts +1 -1
- package/dist/editor/selectors/node-selector.d.ts +1 -1
- package/dist/editor/selectors/text-buttons.d.ts +1 -1
- package/dist/editor.js +2621 -3574
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -1
- package/dist/form/EntityFormActions.d.ts +2 -1
- package/dist/form/components/FieldHelperText.d.ts +1 -1
- package/dist/form/components/FormEntry.d.ts +1 -1
- package/dist/form/components/FormLayout.d.ts +1 -1
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +1 -1
- package/dist/form/components/LocalChangesMenu.d.ts +2 -1
- package/dist/form/components/StorageItemPreview.d.ts +2 -1
- package/dist/form/components/StorageUploadProgress.d.ts +2 -1
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -2
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/VectorFieldBinding.d.ts +2 -1
- package/dist/history-BL49TIDb.js +311 -0
- package/dist/history-BL49TIDb.js.map +1 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +0 -2
- package/dist/hooks/navigation/useNavigationResolution.d.ts +5 -6
- package/dist/hooks/navigation/useResolvedCollections.d.ts +0 -2
- package/dist/hooks/useBreadcrumbsController.d.ts +2 -32
- package/dist/index.js +2 -3393
- package/dist/markdown-CklalUUk.js +526 -0
- package/dist/markdown-CklalUUk.js.map +1 -0
- package/dist/preview/components/ArrayEnumPreview.d.ts +2 -1
- package/dist/preview/components/EmptyValue.d.ts +2 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/components/ImagePreview.d.ts +2 -1
- package/dist/preview/components/ReferencePreview.d.ts +2 -1
- package/dist/preview/components/RelationPreview.d.ts +2 -1
- package/dist/preview/components/StorageThumbnail.d.ts +1 -1
- package/dist/preview/components/UserPreview.d.ts +6 -3
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +2 -1
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +3 -2
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +5 -4
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/routes/RebaseRoute.d.ts +1 -1
- package/dist/src-BJ8fkM8y.js +24010 -0
- package/dist/src-BJ8fkM8y.js.map +1 -0
- package/dist/types/components/PropertyPreviewProps.d.ts +4 -0
- package/dist/types/components/formex.d.ts +1 -40
- package/dist/types/fields.d.ts +9 -1
- package/dist/util/navigation_utils.d.ts +2 -1
- package/dist/util/previews.d.ts +5 -0
- package/dist/util/property_utils.d.ts +1 -1
- package/package.json +29 -27
- package/src/collection_editor/ConfigControllerProvider.tsx +10 -7
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -1
- package/src/collection_editor/ui/EditorEntityAction.tsx +2 -1
- package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -1
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +2 -1
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +2 -3
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +0 -1
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -4
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +5 -2
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +1 -1
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +7 -2
- package/src/collection_editor/validateCollectionJson.ts +2 -2
- package/src/components/CollectionPanel.tsx +51 -25
- package/src/components/DefaultAppBar.tsx +1 -2
- package/src/components/DefaultDrawer.tsx +3 -2
- package/src/components/DrawerNavigationGroup.tsx +3 -2
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +30 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -0
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +5 -2
- package/src/components/EntityCollectionView/Board.tsx +10 -8
- package/src/components/EntityCollectionView/BoardSortableList.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +4 -2
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +14 -4
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +48 -26
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +146 -73
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +2 -1
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +3 -2
- package/src/components/EntityCollectionView/FilterPresetsButton.tsx +4 -2
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +0 -1
- package/src/components/EntityCollectionView/useBoardDataController.tsx +17 -15
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +32 -23
- package/src/components/EntityDetailView.tsx +72 -39
- package/src/components/EntityEditView.tsx +79 -47
- package/src/components/EntitySidePanel.tsx +9 -3
- package/src/components/HomePage/ContentHomePage.tsx +3 -3
- package/src/components/HomePage/NavigationCard.tsx +5 -5
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/RebaseLayout.tsx +5 -2
- package/src/components/RebaseNavigation.tsx +1 -4
- package/src/components/RebaseRouteDefs.tsx +5 -3
- package/src/components/SearchIconsView.tsx +1 -1
- package/src/components/SelectableTable/SelectableTable.tsx +2 -3
- package/src/components/SelectableTable/SelectionStore.ts +9 -3
- package/src/components/UserSelector.tsx +92 -2
- package/src/components/common/default_entity_actions.tsx +23 -6
- package/src/components/field_configs.tsx +6 -3
- package/src/editor/editor.tsx +1 -1
- package/src/editor/extensions/Image/index.ts +2 -2
- package/src/editor/extensions/Image.ts +2 -2
- package/src/editor/extensions/clipboard.ts +2 -2
- package/src/editor/markdown-it-plugins.d.ts +24 -0
- package/src/editor/markdown.ts +2 -3
- package/src/form/EntityForm.tsx +21 -15
- package/src/form/PropertyFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MapFieldBinding.tsx +5 -47
- package/src/form/field_bindings/VectorFieldBinding.tsx +3 -3
- package/src/form/validation.ts +17 -15
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -6
- package/src/hooks/navigation/useNavigationResolution.ts +143 -19
- package/src/hooks/navigation/useResolvedCollections.ts +4 -6
- package/src/hooks/useBreadcrumbsController.tsx +2 -34
- package/src/hooks/useBuildSideEntityController.tsx +25 -3
- package/src/preview/PropertyPreview.tsx +6 -2
- package/src/preview/components/ReferencePreview.tsx +64 -13
- package/src/preview/components/RelationPreview.tsx +101 -13
- package/src/preview/components/UserPreview.tsx +5 -14
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/routes/RebaseRoute.tsx +5 -4
- package/src/types/components/PropertyPreviewProps.tsx +5 -0
- package/src/types/components/formex.tsx +1 -45
- package/src/types/fields.tsx +10 -1
- package/src/util/navigation_utils.ts +14 -4
- package/src/util/previews.ts +101 -4
- package/dist/CollectionEditorDialog-Bo86h-d-.js +0 -4574
- package/dist/CollectionEditorDialog-Bo86h-d-.js.map +0 -1
- package/dist/CollectionsStudioView-bsg4AT_Z.js +0 -217
- package/dist/CollectionsStudioView-bsg4AT_Z.js.map +0 -1
- package/dist/ExportCollectionAction-Cf-Id5uO.js +0 -446
- package/dist/ExportCollectionAction-Cf-Id5uO.js.map +0 -1
- package/dist/ImportCollectionAction-LN5sreK9.js +0 -685
- package/dist/ImportCollectionAction-LN5sreK9.js.map +0 -1
- package/dist/PropertyEditView-jCWCxmCz.js +0 -8197
- package/dist/PropertyEditView-jCWCxmCz.js.map +0 -1
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/index-BrqSvMG0.js +0 -8
- package/dist/index-BrqSvMG0.js.map +0 -1
- package/dist/index-Cb0bPnzZ.js +0 -12
- package/dist/index-Cb0bPnzZ.js.map +0 -1
- package/dist/index-z3H8iqsj.js +0 -462
- package/dist/index-z3H8iqsj.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-DD2JDU1X.js +0 -618
- package/dist/markdown-DD2JDU1X.js.map +0 -1
- package/dist/useEntityHistory-UVsSclfZ.js +0 -123
- package/dist/useEntityHistory-UVsSclfZ.js.map +0 -1
- package/dist/util-CvNp6A-r.js +0 -30505
- package/dist/util-CvNp6A-r.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,3393 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
|
-
import { c as c2 } from "react-compiler-runtime";
|
|
5
|
-
import { Button, cls, CircularProgressCenter, Chip, StarIcon, Collapse, IconButton, PencilIcon, iconSize, ExpandablePanel, Typography, DialogTitle, TextField, DialogContent, DialogActions, Dialog, Container, SearchBar, ErrorBoundary } from "@rebasepro/ui";
|
|
6
|
-
import React__default, { useState, useEffect, useMemo, useCallback, useLayoutEffect, useRef, Suspense } from "react";
|
|
7
|
-
import "fast-equals";
|
|
8
|
-
import { getNavigationEntriesFromPath, getReferenceFrom, getLastSegment } from "@rebasepro/common";
|
|
9
|
-
import { addInitialSlash, getCollectionBySlugWithin, getCollectionPathsCombinations, getLastSegment as getLastSegment2, removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash, resolveCollectionPathIds } from "@rebasepro/common";
|
|
10
|
-
import { useAdminModeController, useRebaseRegistryDispatch, useRebaseRegistry, useAuthController, LoginView, useUserConfigurationPersistence, useTranslation, useRebaseContext, useSlot, IconForView, useCustomizationController, buildCollapsedDefaults, useCollapsedGroups, useRestoreScroll, BootstrapAdminBanner, NotFoundPage, UnsavedChangesDialog, UIReferenceView, RebaseRoutes, UserSettingsView, ErrorView } from "@rebasepro/core";
|
|
11
|
-
import "@rebasepro/formex";
|
|
12
|
-
import "zod";
|
|
13
|
-
import { toArray, prettifyIdentifier } from "@rebasepro/utils";
|
|
14
|
-
import "date-fns";
|
|
15
|
-
import "date-fns/locale";
|
|
16
|
-
import "@rebasepro/types";
|
|
17
|
-
import { useSensor, MouseSensor, TouchSensor, KeyboardSensor, useSensors, closestCenter, pointerWithin, closestCorners, getFirstCollision, rectIntersection, useDroppable, useDndMonitor, DndContext, MeasuringStrategy, DragOverlay } from "@dnd-kit/core";
|
|
18
|
-
import { restrictToVerticalAxis, restrictToWindowEdges } from "@dnd-kit/modifiers";
|
|
19
|
-
import { useSortable, arrayMove, defaultAnimateLayoutChanges, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
20
|
-
import { CSS } from "@dnd-kit/utilities";
|
|
21
|
-
import "react-dropzone";
|
|
22
|
-
import { useLocation, Outlet, useNavigate, useBlocker, Route } from "react-router-dom";
|
|
23
|
-
import Fuse from "fuse.js";
|
|
24
|
-
import "exceljs";
|
|
25
|
-
import "@rebasepro/schema-inference";
|
|
26
|
-
import { u as u2 } from "./useEntityHistory-UVsSclfZ.js";
|
|
27
|
-
import { I as I2, a as a7, P as P2 } from "./ImportCollectionAction-LN5sreK9.js";
|
|
28
|
-
import { B as B2, E as E2, d as d2, a as a9, b as b10, g as g2, c as c3 } from "./ExportCollectionAction-Cf-Id5uO.js";
|
|
29
|
-
function resolveNavigationFrom({
|
|
30
|
-
path,
|
|
31
|
-
context
|
|
32
|
-
}) {
|
|
33
|
-
const data = context.data;
|
|
34
|
-
const {
|
|
35
|
-
navigationStateController,
|
|
36
|
-
collectionRegistryController
|
|
37
|
-
} = context;
|
|
38
|
-
if (!navigationStateController || !collectionRegistryController) {
|
|
39
|
-
throw Error("Calling resolveNavigationFrom, but main navigation has not yet been initialised");
|
|
40
|
-
}
|
|
41
|
-
const navigationEntries = getNavigationEntriesFromPath({
|
|
42
|
-
path,
|
|
43
|
-
collections: collectionRegistryController.collections ?? []
|
|
44
|
-
});
|
|
45
|
-
const resultPromises = navigationEntries.map((entry) => {
|
|
46
|
-
if (entry.type === "collection") {
|
|
47
|
-
return Promise.resolve(entry);
|
|
48
|
-
} else if (entry.type === "entity") {
|
|
49
|
-
const collection = collectionRegistryController.getCollection(entry.slug);
|
|
50
|
-
if (!collection) {
|
|
51
|
-
throw Error(`No collection defined in the navigation for the entity with path ${entry.slug}`);
|
|
52
|
-
}
|
|
53
|
-
return data.collection(entry.slug).findById(entry.entityId).then((entity) => {
|
|
54
|
-
if (!entity) return void 0;
|
|
55
|
-
return {
|
|
56
|
-
...entry,
|
|
57
|
-
entity
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
} else if (entry.type === "custom_view") {
|
|
61
|
-
return Promise.resolve(entry);
|
|
62
|
-
} else {
|
|
63
|
-
throw Error("Unmapped element in useEntitiesFromPath");
|
|
64
|
-
}
|
|
65
|
-
}).filter((v2) => Boolean(v2));
|
|
66
|
-
return Promise.all(resultPromises);
|
|
67
|
-
}
|
|
68
|
-
function useResolvedNavigationFrom(t0) {
|
|
69
|
-
const $2 = c2(13);
|
|
70
|
-
const {
|
|
71
|
-
path
|
|
72
|
-
} = t0;
|
|
73
|
-
const context = useCMSContext();
|
|
74
|
-
const {
|
|
75
|
-
navigationStateController,
|
|
76
|
-
collectionRegistryController
|
|
77
|
-
} = context;
|
|
78
|
-
const [data, setData] = useState();
|
|
79
|
-
const [dataLoading, setDataLoading] = useState(false);
|
|
80
|
-
const [dataLoadingError, setDataLoadingError] = useState();
|
|
81
|
-
let t1;
|
|
82
|
-
if ($2[0] !== collectionRegistryController || $2[1] !== context || $2[2] !== navigationStateController || $2[3] !== path) {
|
|
83
|
-
t1 = () => {
|
|
84
|
-
if (navigationStateController && collectionRegistryController) {
|
|
85
|
-
setDataLoading(true);
|
|
86
|
-
setDataLoadingError(void 0);
|
|
87
|
-
resolveNavigationFrom({
|
|
88
|
-
path,
|
|
89
|
-
context
|
|
90
|
-
}).then(setData).catch((e2) => setDataLoadingError(e2)).finally(() => setDataLoading(false));
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
$2[0] = collectionRegistryController;
|
|
94
|
-
$2[1] = context;
|
|
95
|
-
$2[2] = navigationStateController;
|
|
96
|
-
$2[3] = path;
|
|
97
|
-
$2[4] = t1;
|
|
98
|
-
} else {
|
|
99
|
-
t1 = $2[4];
|
|
100
|
-
}
|
|
101
|
-
let t2;
|
|
102
|
-
if ($2[5] !== context || $2[6] !== path) {
|
|
103
|
-
t2 = [path, context];
|
|
104
|
-
$2[5] = context;
|
|
105
|
-
$2[6] = path;
|
|
106
|
-
$2[7] = t2;
|
|
107
|
-
} else {
|
|
108
|
-
t2 = $2[7];
|
|
109
|
-
}
|
|
110
|
-
useEffect(t1, t2);
|
|
111
|
-
let t3;
|
|
112
|
-
bb0: {
|
|
113
|
-
if (!navigationStateController) {
|
|
114
|
-
let t42;
|
|
115
|
-
if ($2[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
116
|
-
t42 = {
|
|
117
|
-
dataLoading: true
|
|
118
|
-
};
|
|
119
|
-
$2[8] = t42;
|
|
120
|
-
} else {
|
|
121
|
-
t42 = $2[8];
|
|
122
|
-
}
|
|
123
|
-
t3 = t42;
|
|
124
|
-
break bb0;
|
|
125
|
-
}
|
|
126
|
-
let t4;
|
|
127
|
-
if ($2[9] !== data || $2[10] !== dataLoading || $2[11] !== dataLoadingError) {
|
|
128
|
-
t4 = {
|
|
129
|
-
data,
|
|
130
|
-
dataLoading,
|
|
131
|
-
dataLoadingError
|
|
132
|
-
};
|
|
133
|
-
$2[9] = data;
|
|
134
|
-
$2[10] = dataLoading;
|
|
135
|
-
$2[11] = dataLoadingError;
|
|
136
|
-
$2[12] = t4;
|
|
137
|
-
} else {
|
|
138
|
-
t4 = $2[12];
|
|
139
|
-
}
|
|
140
|
-
t3 = t4;
|
|
141
|
-
}
|
|
142
|
-
return t3;
|
|
143
|
-
}
|
|
144
|
-
function ReferenceWidget({
|
|
145
|
-
name,
|
|
146
|
-
multiselect = false,
|
|
147
|
-
path,
|
|
148
|
-
disabled,
|
|
149
|
-
value,
|
|
150
|
-
onReferenceSelected,
|
|
151
|
-
onMultipleReferenceSelected,
|
|
152
|
-
previewProperties,
|
|
153
|
-
fixedFilter,
|
|
154
|
-
size,
|
|
155
|
-
className,
|
|
156
|
-
includeId,
|
|
157
|
-
includeEntityLink
|
|
158
|
-
}) {
|
|
159
|
-
const collectionRegistryController = useCollectionRegistryController();
|
|
160
|
-
const collection = useMemo(() => {
|
|
161
|
-
return collectionRegistryController.getCollection(path);
|
|
162
|
-
}, [path, collectionRegistryController.getCollection]);
|
|
163
|
-
const onSingleEntitySelected = useCallback((entity) => {
|
|
164
|
-
if (disabled) return;
|
|
165
|
-
if (onReferenceSelected) {
|
|
166
|
-
const reference = entity ? getReferenceFrom(entity) : null;
|
|
167
|
-
onReferenceSelected?.({
|
|
168
|
-
reference,
|
|
169
|
-
entity
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}, [disabled, onReferenceSelected]);
|
|
173
|
-
const onMultipleEntitiesSelected = useCallback((entities) => {
|
|
174
|
-
if (disabled) return;
|
|
175
|
-
if (onMultipleReferenceSelected) {
|
|
176
|
-
const references = entities ? entities.map((e2) => getReferenceFrom(e2)) : null;
|
|
177
|
-
onMultipleReferenceSelected({
|
|
178
|
-
references,
|
|
179
|
-
entities
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
}, [disabled, onReferenceSelected]);
|
|
183
|
-
const referenceDialogController = useEntitySelectionDialog({
|
|
184
|
-
multiselect,
|
|
185
|
-
path,
|
|
186
|
-
collection,
|
|
187
|
-
onSingleEntitySelected,
|
|
188
|
-
onMultipleEntitiesSelected,
|
|
189
|
-
fixedFilter
|
|
190
|
-
});
|
|
191
|
-
useCallback((e_0) => {
|
|
192
|
-
e_0.stopPropagation();
|
|
193
|
-
if (multiselect) {
|
|
194
|
-
onMultipleEntitiesSelected([]);
|
|
195
|
-
} else {
|
|
196
|
-
onSingleEntitySelected(null);
|
|
197
|
-
}
|
|
198
|
-
}, [onReferenceSelected]);
|
|
199
|
-
let child;
|
|
200
|
-
const onEntryClick = () => {
|
|
201
|
-
if (disabled) return;
|
|
202
|
-
referenceDialogController.open();
|
|
203
|
-
};
|
|
204
|
-
if (Array.isArray(value)) {
|
|
205
|
-
child = /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4", children: value.map((ref, index) => {
|
|
206
|
-
return /* @__PURE__ */ jsx(ReferencePreview, { onClick: onEntryClick, reference: ref, disabled, previewProperties, size, includeId, includeEntityLink }, `reference_preview_${index}`);
|
|
207
|
-
}) });
|
|
208
|
-
} else if (value?.isEntityReference && value?.isEntityReference()) {
|
|
209
|
-
child = /* @__PURE__ */ jsx(ReferencePreview, { reference: value, onClick: onEntryClick, disabled, previewProperties, size, includeId, includeEntityLink });
|
|
210
|
-
}
|
|
211
|
-
return /* @__PURE__ */ jsxs("div", { className: cls("text-sm font-medium", "min-w-80 flex flex-col gap-4", "relative transition-colors duration-200 ease-in rounded-xs font-medium", disabled ? "bg-opacity-50" : "hover:bg-opacity-75", "dark:text-white/50 text-text-primary/50 dark:text-text-primary-dark/50 dark:text-white/50", className), children: [
|
|
212
|
-
child,
|
|
213
|
-
!value && /* @__PURE__ */ jsx("div", { className: "justify-center text-left", children: /* @__PURE__ */ jsxs(Button, { disabled, onClick: onEntryClick, children: [
|
|
214
|
-
"Edit ",
|
|
215
|
-
name
|
|
216
|
-
] }) })
|
|
217
|
-
] });
|
|
218
|
-
}
|
|
219
|
-
function AdminModeSyncer({
|
|
220
|
-
devViews
|
|
221
|
-
}) {
|
|
222
|
-
const location = useLocation();
|
|
223
|
-
const urlController = useUrlController();
|
|
224
|
-
const adminModeController = useAdminModeController();
|
|
225
|
-
const currentModeRef = React__default.useRef(adminModeController.mode);
|
|
226
|
-
currentModeRef.current = adminModeController.mode;
|
|
227
|
-
const setModeRef = React__default.useRef(adminModeController.setMode);
|
|
228
|
-
setModeRef.current = adminModeController.setMode;
|
|
229
|
-
useEffect(() => {
|
|
230
|
-
const path = location.pathname;
|
|
231
|
-
const isContentRoute = urlController.isUrlCollectionPath(path) || path === urlController.basePath;
|
|
232
|
-
const studioHomePath = urlController.basePath === "/" ? "/s" : `${urlController.basePath}/s`;
|
|
233
|
-
const isStudioRoute = path === studioHomePath || path.startsWith(studioHomePath + "/") || devViews?.some((view) => {
|
|
234
|
-
const viewPath = urlController.buildAppUrlPath(view.slug);
|
|
235
|
-
return path.startsWith(`${viewPath}/`) || path === viewPath;
|
|
236
|
-
});
|
|
237
|
-
if (isStudioRoute && currentModeRef.current !== "studio") {
|
|
238
|
-
setModeRef.current("studio");
|
|
239
|
-
} else if (isContentRoute && currentModeRef.current !== "content") {
|
|
240
|
-
setModeRef.current("content");
|
|
241
|
-
}
|
|
242
|
-
}, [location.pathname, urlController, devViews]);
|
|
243
|
-
return null;
|
|
244
|
-
}
|
|
245
|
-
function RebaseCMS(t0) {
|
|
246
|
-
const $2 = c2(10);
|
|
247
|
-
const {
|
|
248
|
-
collections,
|
|
249
|
-
homePage,
|
|
250
|
-
entityViews,
|
|
251
|
-
entityActions,
|
|
252
|
-
plugins,
|
|
253
|
-
collectionEditor,
|
|
254
|
-
navigationGroupMappings
|
|
255
|
-
} = t0;
|
|
256
|
-
const dispatch = useRebaseRegistryDispatch();
|
|
257
|
-
let t1;
|
|
258
|
-
let t2;
|
|
259
|
-
if ($2[0] !== collectionEditor || $2[1] !== collections || $2[2] !== dispatch || $2[3] !== entityActions || $2[4] !== entityViews || $2[5] !== homePage || $2[6] !== navigationGroupMappings || $2[7] !== plugins) {
|
|
260
|
-
t1 = () => {
|
|
261
|
-
dispatch.registerCMS({
|
|
262
|
-
collections,
|
|
263
|
-
homePage,
|
|
264
|
-
entityViews,
|
|
265
|
-
entityActions,
|
|
266
|
-
plugins,
|
|
267
|
-
collectionEditor,
|
|
268
|
-
navigationGroupMappings
|
|
269
|
-
});
|
|
270
|
-
return () => dispatch.unregisterCMS();
|
|
271
|
-
};
|
|
272
|
-
t2 = [dispatch, collections, homePage, entityViews, entityActions, plugins, collectionEditor, navigationGroupMappings];
|
|
273
|
-
$2[0] = collectionEditor;
|
|
274
|
-
$2[1] = collections;
|
|
275
|
-
$2[2] = dispatch;
|
|
276
|
-
$2[3] = entityActions;
|
|
277
|
-
$2[4] = entityViews;
|
|
278
|
-
$2[5] = homePage;
|
|
279
|
-
$2[6] = navigationGroupMappings;
|
|
280
|
-
$2[7] = plugins;
|
|
281
|
-
$2[8] = t1;
|
|
282
|
-
$2[9] = t2;
|
|
283
|
-
} else {
|
|
284
|
-
t1 = $2[8];
|
|
285
|
-
t2 = $2[9];
|
|
286
|
-
}
|
|
287
|
-
useLayoutEffect(t1, t2);
|
|
288
|
-
return null;
|
|
289
|
-
}
|
|
290
|
-
function RebaseAuthGate(t0) {
|
|
291
|
-
const $2 = c2(8);
|
|
292
|
-
const {
|
|
293
|
-
children
|
|
294
|
-
} = t0;
|
|
295
|
-
const registry = useRebaseRegistry();
|
|
296
|
-
const authController = useAuthController();
|
|
297
|
-
if (authController?.initialLoading) {
|
|
298
|
-
let t12;
|
|
299
|
-
if ($2[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
300
|
-
t12 = /* @__PURE__ */ jsx(CircularProgressCenter, { size: "large" });
|
|
301
|
-
$2[0] = t12;
|
|
302
|
-
} else {
|
|
303
|
-
t12 = $2[0];
|
|
304
|
-
}
|
|
305
|
-
return t12;
|
|
306
|
-
}
|
|
307
|
-
if (!authController?.user) {
|
|
308
|
-
let t12;
|
|
309
|
-
if ($2[1] !== authController || $2[2] !== registry.authConfig?.loginView) {
|
|
310
|
-
t12 = registry.authConfig?.loginView ?? /* @__PURE__ */ jsx(LoginView, { authController });
|
|
311
|
-
$2[1] = authController;
|
|
312
|
-
$2[2] = registry.authConfig?.loginView;
|
|
313
|
-
$2[3] = t12;
|
|
314
|
-
} else {
|
|
315
|
-
t12 = $2[3];
|
|
316
|
-
}
|
|
317
|
-
const ActiveLoginView = t12;
|
|
318
|
-
let t2;
|
|
319
|
-
if ($2[4] !== ActiveLoginView) {
|
|
320
|
-
t2 = /* @__PURE__ */ jsx(Fragment, { children: ActiveLoginView });
|
|
321
|
-
$2[4] = ActiveLoginView;
|
|
322
|
-
$2[5] = t2;
|
|
323
|
-
} else {
|
|
324
|
-
t2 = $2[5];
|
|
325
|
-
}
|
|
326
|
-
return t2;
|
|
327
|
-
}
|
|
328
|
-
let t1;
|
|
329
|
-
if ($2[6] !== children) {
|
|
330
|
-
t1 = /* @__PURE__ */ jsx(Fragment, { children });
|
|
331
|
-
$2[6] = children;
|
|
332
|
-
$2[7] = t1;
|
|
333
|
-
} else {
|
|
334
|
-
t1 = $2[7];
|
|
335
|
-
}
|
|
336
|
-
return t1;
|
|
337
|
-
}
|
|
338
|
-
function RebaseLayout(props) {
|
|
339
|
-
const $2 = c2(17);
|
|
340
|
-
const {
|
|
341
|
-
title: t0,
|
|
342
|
-
appBar,
|
|
343
|
-
drawer,
|
|
344
|
-
autoOpenDrawer: t1,
|
|
345
|
-
devViews: t2
|
|
346
|
-
} = props;
|
|
347
|
-
const title = t0 === void 0 ? "Rebase" : t0;
|
|
348
|
-
const autoOpenDrawer = t1 === void 0 ? false : t1;
|
|
349
|
-
let t3;
|
|
350
|
-
if ($2[0] !== t2) {
|
|
351
|
-
t3 = t2 === void 0 ? [] : t2;
|
|
352
|
-
$2[0] = t2;
|
|
353
|
-
$2[1] = t3;
|
|
354
|
-
} else {
|
|
355
|
-
t3 = $2[1];
|
|
356
|
-
}
|
|
357
|
-
const devViews = t3;
|
|
358
|
-
const adminModeController = useAdminModeController();
|
|
359
|
-
let t4;
|
|
360
|
-
if ($2[2] !== appBar) {
|
|
361
|
-
t4 = appBar ?? /* @__PURE__ */ jsx(AppBar, { includeLanguageToggle: false, includeModeToggle: false, includeUserMenu: false });
|
|
362
|
-
$2[2] = appBar;
|
|
363
|
-
$2[3] = t4;
|
|
364
|
-
} else {
|
|
365
|
-
t4 = $2[3];
|
|
366
|
-
}
|
|
367
|
-
const ActiveAppBar = t4;
|
|
368
|
-
let t5;
|
|
369
|
-
if ($2[4] !== adminModeController || $2[5] !== drawer || $2[6] !== title) {
|
|
370
|
-
t5 = drawer ?? /* @__PURE__ */ jsx(Drawer, { title, logoDestination: adminModeController.mode === "studio" ? "/s" : "/" });
|
|
371
|
-
$2[4] = adminModeController;
|
|
372
|
-
$2[5] = drawer;
|
|
373
|
-
$2[6] = title;
|
|
374
|
-
$2[7] = t5;
|
|
375
|
-
} else {
|
|
376
|
-
t5 = $2[7];
|
|
377
|
-
}
|
|
378
|
-
const ActiveDrawer = t5;
|
|
379
|
-
let t6;
|
|
380
|
-
if ($2[8] !== devViews) {
|
|
381
|
-
t6 = /* @__PURE__ */ jsx(AdminModeSyncer, { devViews });
|
|
382
|
-
$2[8] = devViews;
|
|
383
|
-
$2[9] = t6;
|
|
384
|
-
} else {
|
|
385
|
-
t6 = $2[9];
|
|
386
|
-
}
|
|
387
|
-
let t7;
|
|
388
|
-
let t8;
|
|
389
|
-
if ($2[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
390
|
-
t7 = /* @__PURE__ */ jsx(Outlet, {});
|
|
391
|
-
t8 = /* @__PURE__ */ jsx(SideDialogs, {});
|
|
392
|
-
$2[10] = t7;
|
|
393
|
-
$2[11] = t8;
|
|
394
|
-
} else {
|
|
395
|
-
t7 = $2[10];
|
|
396
|
-
t8 = $2[11];
|
|
397
|
-
}
|
|
398
|
-
let t9;
|
|
399
|
-
if ($2[12] !== ActiveAppBar || $2[13] !== ActiveDrawer || $2[14] !== autoOpenDrawer || $2[15] !== t6) {
|
|
400
|
-
t9 = /* @__PURE__ */ jsxs(Scaffold, { autoOpenDrawer, children: [
|
|
401
|
-
t6,
|
|
402
|
-
ActiveAppBar,
|
|
403
|
-
ActiveDrawer,
|
|
404
|
-
t7,
|
|
405
|
-
t8
|
|
406
|
-
] });
|
|
407
|
-
$2[12] = ActiveAppBar;
|
|
408
|
-
$2[13] = ActiveDrawer;
|
|
409
|
-
$2[14] = autoOpenDrawer;
|
|
410
|
-
$2[15] = t6;
|
|
411
|
-
$2[16] = t9;
|
|
412
|
-
} else {
|
|
413
|
-
t9 = $2[16];
|
|
414
|
-
}
|
|
415
|
-
return t9;
|
|
416
|
-
}
|
|
417
|
-
function NavigationChip(t0) {
|
|
418
|
-
const $2 = c2(18);
|
|
419
|
-
const {
|
|
420
|
-
entry
|
|
421
|
-
} = t0;
|
|
422
|
-
const navigate = useNavigate();
|
|
423
|
-
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
424
|
-
if (!userConfigurationPersistence) {
|
|
425
|
-
return null;
|
|
426
|
-
}
|
|
427
|
-
let t1;
|
|
428
|
-
if ($2[0] !== entry.slug || $2[1] !== userConfigurationPersistence.favouritePaths) {
|
|
429
|
-
t1 = userConfigurationPersistence.favouritePaths.includes(entry.slug);
|
|
430
|
-
$2[0] = entry.slug;
|
|
431
|
-
$2[1] = userConfigurationPersistence.favouritePaths;
|
|
432
|
-
$2[2] = t1;
|
|
433
|
-
} else {
|
|
434
|
-
t1 = $2[2];
|
|
435
|
-
}
|
|
436
|
-
const favourite = t1;
|
|
437
|
-
let t2;
|
|
438
|
-
if ($2[3] !== entry.slug || $2[4] !== favourite || $2[5] !== userConfigurationPersistence) {
|
|
439
|
-
t2 = (e2) => {
|
|
440
|
-
e2.preventDefault();
|
|
441
|
-
e2.stopPropagation();
|
|
442
|
-
if (favourite) {
|
|
443
|
-
userConfigurationPersistence.setFavouritePaths(userConfigurationPersistence.favouritePaths.filter((p2) => p2 !== entry.slug));
|
|
444
|
-
} else {
|
|
445
|
-
userConfigurationPersistence.setFavouritePaths([...userConfigurationPersistence.favouritePaths, entry.slug]);
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
$2[3] = entry.slug;
|
|
449
|
-
$2[4] = favourite;
|
|
450
|
-
$2[5] = userConfigurationPersistence;
|
|
451
|
-
$2[6] = t2;
|
|
452
|
-
} else {
|
|
453
|
-
t2 = $2[6];
|
|
454
|
-
}
|
|
455
|
-
const onIconClick = t2;
|
|
456
|
-
let t3;
|
|
457
|
-
if ($2[7] !== entry.url || $2[8] !== navigate) {
|
|
458
|
-
t3 = () => navigate(entry.url);
|
|
459
|
-
$2[7] = entry.url;
|
|
460
|
-
$2[8] = navigate;
|
|
461
|
-
$2[9] = t3;
|
|
462
|
-
} else {
|
|
463
|
-
t3 = $2[9];
|
|
464
|
-
}
|
|
465
|
-
const t4 = favourite ? "text-secondary" : "text-surface-400 dark:text-surface-500";
|
|
466
|
-
let t5;
|
|
467
|
-
if ($2[10] !== onIconClick || $2[11] !== t4) {
|
|
468
|
-
t5 = /* @__PURE__ */ jsx(StarIcon, { onClick: onIconClick, size: "small", className: t4 });
|
|
469
|
-
$2[10] = onIconClick;
|
|
470
|
-
$2[11] = t4;
|
|
471
|
-
$2[12] = t5;
|
|
472
|
-
} else {
|
|
473
|
-
t5 = $2[12];
|
|
474
|
-
}
|
|
475
|
-
let t6;
|
|
476
|
-
if ($2[13] !== entry.name || $2[14] !== entry.slug || $2[15] !== t3 || $2[16] !== t5) {
|
|
477
|
-
t6 = /* @__PURE__ */ jsx(Chip, { onClick: t3, icon: t5, children: entry.name }, entry.slug);
|
|
478
|
-
$2[13] = entry.name;
|
|
479
|
-
$2[14] = entry.slug;
|
|
480
|
-
$2[15] = t3;
|
|
481
|
-
$2[16] = t5;
|
|
482
|
-
$2[17] = t6;
|
|
483
|
-
} else {
|
|
484
|
-
t6 = $2[17];
|
|
485
|
-
}
|
|
486
|
-
return t6;
|
|
487
|
-
}
|
|
488
|
-
function FavouritesView(t0) {
|
|
489
|
-
const $2 = c2(17);
|
|
490
|
-
const navigationStateController = useNavigationStateController();
|
|
491
|
-
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
492
|
-
if (!userConfigurationPersistence) {
|
|
493
|
-
return null;
|
|
494
|
-
}
|
|
495
|
-
let t1;
|
|
496
|
-
if ($2[0] !== userConfigurationPersistence?.favouritePaths) {
|
|
497
|
-
t1 = userConfigurationPersistence?.favouritePaths ?? [];
|
|
498
|
-
$2[0] = userConfigurationPersistence?.favouritePaths;
|
|
499
|
-
$2[1] = t1;
|
|
500
|
-
} else {
|
|
501
|
-
t1 = $2[1];
|
|
502
|
-
}
|
|
503
|
-
let T0;
|
|
504
|
-
let t2;
|
|
505
|
-
let t3;
|
|
506
|
-
let t4;
|
|
507
|
-
if ($2[2] !== navigationStateController || $2[3] !== t1) {
|
|
508
|
-
let t52;
|
|
509
|
-
if ($2[8] !== navigationStateController) {
|
|
510
|
-
t52 = (path) => navigationStateController.topLevelNavigation?.navigationEntries.find((entry) => entry.slug === path);
|
|
511
|
-
$2[8] = navigationStateController;
|
|
512
|
-
$2[9] = t52;
|
|
513
|
-
} else {
|
|
514
|
-
t52 = $2[9];
|
|
515
|
-
}
|
|
516
|
-
const favouriteCollections = t1.map(t52).filter(Boolean);
|
|
517
|
-
T0 = Collapse;
|
|
518
|
-
t4 = favouriteCollections.length > 0;
|
|
519
|
-
t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
|
|
520
|
-
t3 = favouriteCollections.map(_temp$1);
|
|
521
|
-
$2[2] = navigationStateController;
|
|
522
|
-
$2[3] = t1;
|
|
523
|
-
$2[4] = T0;
|
|
524
|
-
$2[5] = t2;
|
|
525
|
-
$2[6] = t3;
|
|
526
|
-
$2[7] = t4;
|
|
527
|
-
} else {
|
|
528
|
-
T0 = $2[4];
|
|
529
|
-
t2 = $2[5];
|
|
530
|
-
t3 = $2[6];
|
|
531
|
-
t4 = $2[7];
|
|
532
|
-
}
|
|
533
|
-
let t5;
|
|
534
|
-
if ($2[10] !== t2 || $2[11] !== t3) {
|
|
535
|
-
t5 = /* @__PURE__ */ jsx("div", { className: t2, children: t3 });
|
|
536
|
-
$2[10] = t2;
|
|
537
|
-
$2[11] = t3;
|
|
538
|
-
$2[12] = t5;
|
|
539
|
-
} else {
|
|
540
|
-
t5 = $2[12];
|
|
541
|
-
}
|
|
542
|
-
let t6;
|
|
543
|
-
if ($2[13] !== T0 || $2[14] !== t4 || $2[15] !== t5) {
|
|
544
|
-
t6 = /* @__PURE__ */ jsx(T0, { in: t4, children: t5 });
|
|
545
|
-
$2[13] = T0;
|
|
546
|
-
$2[14] = t4;
|
|
547
|
-
$2[15] = t5;
|
|
548
|
-
$2[16] = t6;
|
|
549
|
-
} else {
|
|
550
|
-
t6 = $2[16];
|
|
551
|
-
}
|
|
552
|
-
return t6;
|
|
553
|
-
}
|
|
554
|
-
function _temp$1(entry_0) {
|
|
555
|
-
return /* @__PURE__ */ jsx(NavigationChip, { entry: entry_0 }, entry_0.slug);
|
|
556
|
-
}
|
|
557
|
-
function NavigationGroup(t0) {
|
|
558
|
-
const $2 = c2(45);
|
|
559
|
-
const {
|
|
560
|
-
children,
|
|
561
|
-
group,
|
|
562
|
-
minimised,
|
|
563
|
-
isPreview,
|
|
564
|
-
isPotentialCardDropTarget,
|
|
565
|
-
onEditGroup,
|
|
566
|
-
dndDisabled,
|
|
567
|
-
collapsed,
|
|
568
|
-
onToggleCollapsed
|
|
569
|
-
} = t0;
|
|
570
|
-
const {
|
|
571
|
-
t
|
|
572
|
-
} = useTranslation();
|
|
573
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
574
|
-
let t1;
|
|
575
|
-
if ($2[0] !== group || $2[1] !== t) {
|
|
576
|
-
t1 = group ?? t("views_group");
|
|
577
|
-
$2[0] = group;
|
|
578
|
-
$2[1] = t;
|
|
579
|
-
$2[2] = t1;
|
|
580
|
-
} else {
|
|
581
|
-
t1 = $2[2];
|
|
582
|
-
}
|
|
583
|
-
const currentGroupName = t1;
|
|
584
|
-
const showCaret = !isPreview && !!onToggleCollapsed;
|
|
585
|
-
const t2 = isPreview ? "px-1 py-0.5" : "";
|
|
586
|
-
let t3;
|
|
587
|
-
if ($2[3] !== t2) {
|
|
588
|
-
t3 = cls("flex items-center", t2);
|
|
589
|
-
$2[3] = t2;
|
|
590
|
-
$2[4] = t3;
|
|
591
|
-
} else {
|
|
592
|
-
t3 = $2[4];
|
|
593
|
-
}
|
|
594
|
-
const t4 = isPreview ? "body2" : "caption";
|
|
595
|
-
let t5;
|
|
596
|
-
if ($2[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
597
|
-
t5 = cls("px-4 py-1 rounded", "font-semibold text-[11px] uppercase tracking-wider text-surface-400 dark:text-surface-400");
|
|
598
|
-
$2[5] = t5;
|
|
599
|
-
} else {
|
|
600
|
-
t5 = $2[5];
|
|
601
|
-
}
|
|
602
|
-
let t6;
|
|
603
|
-
if ($2[6] !== currentGroupName || $2[7] !== t4) {
|
|
604
|
-
t6 = /* @__PURE__ */ jsx(Typography, { variant: t4, component: "h2", color: "secondary", className: t5, children: currentGroupName });
|
|
605
|
-
$2[6] = currentGroupName;
|
|
606
|
-
$2[7] = t4;
|
|
607
|
-
$2[8] = t6;
|
|
608
|
-
} else {
|
|
609
|
-
t6 = $2[8];
|
|
610
|
-
}
|
|
611
|
-
let t7;
|
|
612
|
-
if ($2[9] !== currentGroupName || $2[10] !== dndDisabled || $2[11] !== isHovered || $2[12] !== isPreview || $2[13] !== onEditGroup) {
|
|
613
|
-
t7 = !isPreview && onEditGroup && !dndDisabled && /* @__PURE__ */ jsx(IconButton, { size: "smallest", onClick: (e2) => {
|
|
614
|
-
e2.stopPropagation();
|
|
615
|
-
onEditGroup(currentGroupName);
|
|
616
|
-
}, className: cls("ml-2 ", isHovered ? "opacity-100" : "opacity-0", "transition-opacity duration-100"), children: /* @__PURE__ */ jsx(PencilIcon, { size: iconSize.smallest }) });
|
|
617
|
-
$2[9] = currentGroupName;
|
|
618
|
-
$2[10] = dndDisabled;
|
|
619
|
-
$2[11] = isHovered;
|
|
620
|
-
$2[12] = isPreview;
|
|
621
|
-
$2[13] = onEditGroup;
|
|
622
|
-
$2[14] = t7;
|
|
623
|
-
} else {
|
|
624
|
-
t7 = $2[14];
|
|
625
|
-
}
|
|
626
|
-
let t8;
|
|
627
|
-
if ($2[15] !== t3 || $2[16] !== t6 || $2[17] !== t7) {
|
|
628
|
-
t8 = /* @__PURE__ */ jsxs("div", { className: t3, children: [
|
|
629
|
-
t6,
|
|
630
|
-
t7
|
|
631
|
-
] });
|
|
632
|
-
$2[15] = t3;
|
|
633
|
-
$2[16] = t6;
|
|
634
|
-
$2[17] = t7;
|
|
635
|
-
$2[18] = t8;
|
|
636
|
-
} else {
|
|
637
|
-
t8 = $2[18];
|
|
638
|
-
}
|
|
639
|
-
const TitleContent = t8;
|
|
640
|
-
const t9 = !isPotentialCardDropTarget ? "my-10" : "my-6";
|
|
641
|
-
let t10;
|
|
642
|
-
if ($2[19] !== t9) {
|
|
643
|
-
t10 = cls(t9, "transition-all duration-200 ease-in-out");
|
|
644
|
-
$2[19] = t9;
|
|
645
|
-
$2[20] = t10;
|
|
646
|
-
} else {
|
|
647
|
-
t10 = $2[20];
|
|
648
|
-
}
|
|
649
|
-
let t11;
|
|
650
|
-
if ($2[21] !== TitleContent || $2[22] !== children || $2[23] !== isPreview) {
|
|
651
|
-
t11 = isPreview && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
652
|
-
/* @__PURE__ */ jsx("div", { className: cls("flex items-center justify-between w-full", "p-4 py-2"), onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: TitleContent }),
|
|
653
|
-
children
|
|
654
|
-
] });
|
|
655
|
-
$2[21] = TitleContent;
|
|
656
|
-
$2[22] = children;
|
|
657
|
-
$2[23] = isPreview;
|
|
658
|
-
$2[24] = t11;
|
|
659
|
-
} else {
|
|
660
|
-
t11 = $2[24];
|
|
661
|
-
}
|
|
662
|
-
let t12;
|
|
663
|
-
if ($2[25] !== TitleContent || $2[26] !== children || $2[27] !== collapsed || $2[28] !== isPreview || $2[29] !== minimised || $2[30] !== onToggleCollapsed || $2[31] !== showCaret) {
|
|
664
|
-
t12 = !isPreview && showCaret && /* @__PURE__ */ jsx(ExpandablePanel, { invisible: true, expanded: !collapsed, onExpandedChange: (open) => {
|
|
665
|
-
if (open !== !collapsed) {
|
|
666
|
-
onToggleCollapsed?.();
|
|
667
|
-
}
|
|
668
|
-
}, className: cls("mt-6"), titleClassName: cls("min-h-0 p-0 border-none", "rounded flex items-center justify-between w-full", "hover:bg-transparent", "cursor-pointer select-none", collapsed && "bg-surface-100 dark:bg-surface-900/50"), innerClassName: cls("mt-4", !minimised ? "pt-0" : ""), title: /* @__PURE__ */ jsx("div", { onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), className: "flex items-center", children: TitleContent }), children: minimised ? /* @__PURE__ */ jsx("div", { className: cls("mt-4 p-8 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg"), style: {
|
|
669
|
-
minHeight: "50px"
|
|
670
|
-
} }) : /* @__PURE__ */ jsx("div", { className: cls("mt-4", !minimised ? "pt-0" : ""), children }) });
|
|
671
|
-
$2[25] = TitleContent;
|
|
672
|
-
$2[26] = children;
|
|
673
|
-
$2[27] = collapsed;
|
|
674
|
-
$2[28] = isPreview;
|
|
675
|
-
$2[29] = minimised;
|
|
676
|
-
$2[30] = onToggleCollapsed;
|
|
677
|
-
$2[31] = showCaret;
|
|
678
|
-
$2[32] = t12;
|
|
679
|
-
} else {
|
|
680
|
-
t12 = $2[32];
|
|
681
|
-
}
|
|
682
|
-
let t13;
|
|
683
|
-
if ($2[33] !== TitleContent || $2[34] !== children || $2[35] !== collapsed || $2[36] !== isPreview || $2[37] !== minimised || $2[38] !== showCaret) {
|
|
684
|
-
t13 = !isPreview && !showCaret && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
685
|
-
/* @__PURE__ */ jsx("div", { className: cls("flex items-center justify-between w-full", "mt-6"), onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: TitleContent }),
|
|
686
|
-
!collapsed && (minimised ? /* @__PURE__ */ jsx("div", { className: cls("mt-4 p-8 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg"), style: {
|
|
687
|
-
minHeight: "50px"
|
|
688
|
-
} }) : /* @__PURE__ */ jsx("div", { className: cls("mt-4", !minimised ? "pt-0" : ""), children }))
|
|
689
|
-
] });
|
|
690
|
-
$2[33] = TitleContent;
|
|
691
|
-
$2[34] = children;
|
|
692
|
-
$2[35] = collapsed;
|
|
693
|
-
$2[36] = isPreview;
|
|
694
|
-
$2[37] = minimised;
|
|
695
|
-
$2[38] = showCaret;
|
|
696
|
-
$2[39] = t13;
|
|
697
|
-
} else {
|
|
698
|
-
t13 = $2[39];
|
|
699
|
-
}
|
|
700
|
-
let t14;
|
|
701
|
-
if ($2[40] !== t10 || $2[41] !== t11 || $2[42] !== t12 || $2[43] !== t13) {
|
|
702
|
-
t14 = /* @__PURE__ */ jsxs("div", { className: t10, children: [
|
|
703
|
-
t11,
|
|
704
|
-
t12,
|
|
705
|
-
t13
|
|
706
|
-
] });
|
|
707
|
-
$2[40] = t10;
|
|
708
|
-
$2[41] = t11;
|
|
709
|
-
$2[42] = t12;
|
|
710
|
-
$2[43] = t13;
|
|
711
|
-
$2[44] = t14;
|
|
712
|
-
} else {
|
|
713
|
-
t14 = $2[44];
|
|
714
|
-
}
|
|
715
|
-
return t14;
|
|
716
|
-
}
|
|
717
|
-
function NavigationCardBinding(t0) {
|
|
718
|
-
const $2 = c2(38);
|
|
719
|
-
const {
|
|
720
|
-
slug,
|
|
721
|
-
collection,
|
|
722
|
-
view,
|
|
723
|
-
url,
|
|
724
|
-
name,
|
|
725
|
-
description,
|
|
726
|
-
onClick,
|
|
727
|
-
shrink
|
|
728
|
-
} = t0;
|
|
729
|
-
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
730
|
-
const t1 = collection ?? view;
|
|
731
|
-
let t2;
|
|
732
|
-
if ($2[0] !== t1) {
|
|
733
|
-
t2 = /* @__PURE__ */ jsx(IconForView, { collectionOrView: t1 });
|
|
734
|
-
$2[0] = t1;
|
|
735
|
-
$2[1] = t2;
|
|
736
|
-
} else {
|
|
737
|
-
t2 = $2[1];
|
|
738
|
-
}
|
|
739
|
-
const collectionIcon = t2;
|
|
740
|
-
const navigate = useNavigate();
|
|
741
|
-
const context = useRebaseContext();
|
|
742
|
-
let t3;
|
|
743
|
-
if ($2[2] !== userConfigurationPersistence?.favouritePaths) {
|
|
744
|
-
t3 = userConfigurationPersistence?.favouritePaths ?? [];
|
|
745
|
-
$2[2] = userConfigurationPersistence?.favouritePaths;
|
|
746
|
-
$2[3] = t3;
|
|
747
|
-
} else {
|
|
748
|
-
t3 = $2[3];
|
|
749
|
-
}
|
|
750
|
-
let t4;
|
|
751
|
-
if ($2[4] !== slug || $2[5] !== t3) {
|
|
752
|
-
t4 = t3.includes(slug);
|
|
753
|
-
$2[4] = slug;
|
|
754
|
-
$2[5] = t3;
|
|
755
|
-
$2[6] = t4;
|
|
756
|
-
} else {
|
|
757
|
-
t4 = $2[6];
|
|
758
|
-
}
|
|
759
|
-
const favourite = t4;
|
|
760
|
-
let t5;
|
|
761
|
-
if ($2[7] !== favourite || $2[8] !== slug || $2[9] !== userConfigurationPersistence) {
|
|
762
|
-
t5 = userConfigurationPersistence ? [/* @__PURE__ */ jsx(IconButton, { size: "small", onClick: (e2) => {
|
|
763
|
-
e2.preventDefault();
|
|
764
|
-
e2.stopPropagation();
|
|
765
|
-
if (favourite) {
|
|
766
|
-
userConfigurationPersistence.setFavouritePaths(userConfigurationPersistence.favouritePaths.filter((p2) => p2 !== slug));
|
|
767
|
-
} else {
|
|
768
|
-
userConfigurationPersistence.setFavouritePaths([...userConfigurationPersistence.favouritePaths, slug]);
|
|
769
|
-
}
|
|
770
|
-
}, children: /* @__PURE__ */ jsx(StarIcon, { className: favourite ? "text-secondary" : "text-surface-400 dark:text-surface-500" }) }, "favourite")] : [];
|
|
771
|
-
$2[7] = favourite;
|
|
772
|
-
$2[8] = slug;
|
|
773
|
-
$2[9] = userConfigurationPersistence;
|
|
774
|
-
$2[10] = t5;
|
|
775
|
-
} else {
|
|
776
|
-
t5 = $2[10];
|
|
777
|
-
}
|
|
778
|
-
const actionsArray = t5;
|
|
779
|
-
let t6;
|
|
780
|
-
if ($2[11] !== collection || $2[12] !== context || $2[13] !== slug) {
|
|
781
|
-
t6 = {
|
|
782
|
-
slug,
|
|
783
|
-
collection,
|
|
784
|
-
context
|
|
785
|
-
};
|
|
786
|
-
$2[11] = collection;
|
|
787
|
-
$2[12] = context;
|
|
788
|
-
$2[13] = slug;
|
|
789
|
-
$2[14] = t6;
|
|
790
|
-
} else {
|
|
791
|
-
t6 = $2[14];
|
|
792
|
-
}
|
|
793
|
-
const pluginCardActions = useSlot("home.collection.actions", t6);
|
|
794
|
-
let t7;
|
|
795
|
-
if ($2[15] !== collection || $2[16] !== context || $2[17] !== slug) {
|
|
796
|
-
t7 = {
|
|
797
|
-
slug,
|
|
798
|
-
collection,
|
|
799
|
-
context
|
|
800
|
-
};
|
|
801
|
-
$2[15] = collection;
|
|
802
|
-
$2[16] = context;
|
|
803
|
-
$2[17] = slug;
|
|
804
|
-
$2[18] = t7;
|
|
805
|
-
} else {
|
|
806
|
-
t7 = $2[18];
|
|
807
|
-
}
|
|
808
|
-
const pluginCardInsights = useSlot("home.card.insight", t7);
|
|
809
|
-
let t8;
|
|
810
|
-
if ($2[19] !== actionsArray || $2[20] !== pluginCardActions) {
|
|
811
|
-
t8 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
812
|
-
actionsArray,
|
|
813
|
-
pluginCardActions
|
|
814
|
-
] });
|
|
815
|
-
$2[19] = actionsArray;
|
|
816
|
-
$2[20] = pluginCardActions;
|
|
817
|
-
$2[21] = t8;
|
|
818
|
-
} else {
|
|
819
|
-
t8 = $2[21];
|
|
820
|
-
}
|
|
821
|
-
const actions = t8;
|
|
822
|
-
let t9;
|
|
823
|
-
if ($2[22] !== pluginCardInsights) {
|
|
824
|
-
t9 = pluginCardInsights.length > 0 ? /* @__PURE__ */ jsx(Fragment, { children: pluginCardInsights }) : void 0;
|
|
825
|
-
$2[22] = pluginCardInsights;
|
|
826
|
-
$2[23] = t9;
|
|
827
|
-
} else {
|
|
828
|
-
t9 = $2[23];
|
|
829
|
-
}
|
|
830
|
-
let t10;
|
|
831
|
-
if ($2[24] !== navigate || $2[25] !== onClick || $2[26] !== slug || $2[27] !== url || $2[28] !== userConfigurationPersistence) {
|
|
832
|
-
t10 = () => {
|
|
833
|
-
onClick?.();
|
|
834
|
-
navigate(url);
|
|
835
|
-
if (userConfigurationPersistence) {
|
|
836
|
-
userConfigurationPersistence.setRecentlyVisitedPaths([slug, ...(userConfigurationPersistence.recentlyVisitedPaths ?? []).filter((p_0) => p_0 !== slug)]);
|
|
837
|
-
}
|
|
838
|
-
};
|
|
839
|
-
$2[24] = navigate;
|
|
840
|
-
$2[25] = onClick;
|
|
841
|
-
$2[26] = slug;
|
|
842
|
-
$2[27] = url;
|
|
843
|
-
$2[28] = userConfigurationPersistence;
|
|
844
|
-
$2[29] = t10;
|
|
845
|
-
} else {
|
|
846
|
-
t10 = $2[29];
|
|
847
|
-
}
|
|
848
|
-
let t11;
|
|
849
|
-
if ($2[30] !== actions || $2[31] !== collectionIcon || $2[32] !== description || $2[33] !== name || $2[34] !== shrink || $2[35] !== t10 || $2[36] !== t9) {
|
|
850
|
-
t11 = /* @__PURE__ */ jsx(NavigationCard, { icon: collectionIcon, name, description, actions, additionalContent: t9, onClick: t10, shrink });
|
|
851
|
-
$2[30] = actions;
|
|
852
|
-
$2[31] = collectionIcon;
|
|
853
|
-
$2[32] = description;
|
|
854
|
-
$2[33] = name;
|
|
855
|
-
$2[34] = shrink;
|
|
856
|
-
$2[35] = t10;
|
|
857
|
-
$2[36] = t9;
|
|
858
|
-
$2[37] = t11;
|
|
859
|
-
} else {
|
|
860
|
-
t11 = $2[37];
|
|
861
|
-
}
|
|
862
|
-
return t11;
|
|
863
|
-
}
|
|
864
|
-
const animateLayoutChanges = (args) => defaultAnimateLayoutChanges({
|
|
865
|
-
...args,
|
|
866
|
-
wasDragging: true
|
|
867
|
-
});
|
|
868
|
-
const dropAnimationConfig = {};
|
|
869
|
-
const cloneSerializableNavigationEntry = (entry) => {
|
|
870
|
-
const clonedEntry = {
|
|
871
|
-
id: entry.id,
|
|
872
|
-
slug: entry.slug,
|
|
873
|
-
url: entry.url,
|
|
874
|
-
name: entry.name,
|
|
875
|
-
type: entry.type,
|
|
876
|
-
collection: entry.collection ? {
|
|
877
|
-
...entry.collection
|
|
878
|
-
} : void 0,
|
|
879
|
-
view: entry.view ? {
|
|
880
|
-
...entry.view
|
|
881
|
-
} : void 0,
|
|
882
|
-
...entry.group && {
|
|
883
|
-
group: entry.group
|
|
884
|
-
},
|
|
885
|
-
...entry.description && {
|
|
886
|
-
description: entry.description
|
|
887
|
-
}
|
|
888
|
-
};
|
|
889
|
-
return clonedEntry;
|
|
890
|
-
};
|
|
891
|
-
const cloneItemsForDnd = (items) => items.map((g3) => ({
|
|
892
|
-
name: g3.name,
|
|
893
|
-
entries: g3.entries.map(cloneSerializableNavigationEntry)
|
|
894
|
-
}));
|
|
895
|
-
function SortableNavigationCard(t0) {
|
|
896
|
-
const $2 = c2(17);
|
|
897
|
-
const {
|
|
898
|
-
entry,
|
|
899
|
-
onClick
|
|
900
|
-
} = t0;
|
|
901
|
-
let t1;
|
|
902
|
-
if ($2[0] !== entry.url) {
|
|
903
|
-
t1 = {
|
|
904
|
-
id: entry.url,
|
|
905
|
-
animateLayoutChanges
|
|
906
|
-
};
|
|
907
|
-
$2[0] = entry.url;
|
|
908
|
-
$2[1] = t1;
|
|
909
|
-
} else {
|
|
910
|
-
t1 = $2[1];
|
|
911
|
-
}
|
|
912
|
-
const {
|
|
913
|
-
setNodeRef,
|
|
914
|
-
listeners,
|
|
915
|
-
attributes,
|
|
916
|
-
transform,
|
|
917
|
-
transition,
|
|
918
|
-
isDragging
|
|
919
|
-
} = useSortable(t1);
|
|
920
|
-
let t2;
|
|
921
|
-
if ($2[2] !== transform) {
|
|
922
|
-
t2 = transform ? CSS.Transform.toString(transform) : void 0;
|
|
923
|
-
$2[2] = transform;
|
|
924
|
-
$2[3] = t2;
|
|
925
|
-
} else {
|
|
926
|
-
t2 = $2[3];
|
|
927
|
-
}
|
|
928
|
-
const t3 = isDragging ? 0 : 1;
|
|
929
|
-
let t4;
|
|
930
|
-
if ($2[4] !== t2 || $2[5] !== t3 || $2[6] !== transition) {
|
|
931
|
-
t4 = {
|
|
932
|
-
transform: t2,
|
|
933
|
-
transition,
|
|
934
|
-
opacity: t3
|
|
935
|
-
};
|
|
936
|
-
$2[4] = t2;
|
|
937
|
-
$2[5] = t3;
|
|
938
|
-
$2[6] = transition;
|
|
939
|
-
$2[7] = t4;
|
|
940
|
-
} else {
|
|
941
|
-
t4 = $2[7];
|
|
942
|
-
}
|
|
943
|
-
const style = t4;
|
|
944
|
-
let t5;
|
|
945
|
-
if ($2[8] !== entry || $2[9] !== onClick) {
|
|
946
|
-
t5 = /* @__PURE__ */ jsx(NavigationCardBinding, { ...entry, onClick });
|
|
947
|
-
$2[8] = entry;
|
|
948
|
-
$2[9] = onClick;
|
|
949
|
-
$2[10] = t5;
|
|
950
|
-
} else {
|
|
951
|
-
t5 = $2[10];
|
|
952
|
-
}
|
|
953
|
-
let t6;
|
|
954
|
-
if ($2[11] !== attributes || $2[12] !== listeners || $2[13] !== setNodeRef || $2[14] !== style || $2[15] !== t5) {
|
|
955
|
-
t6 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, ...attributes, ...listeners, children: t5 });
|
|
956
|
-
$2[11] = attributes;
|
|
957
|
-
$2[12] = listeners;
|
|
958
|
-
$2[13] = setNodeRef;
|
|
959
|
-
$2[14] = style;
|
|
960
|
-
$2[15] = t5;
|
|
961
|
-
$2[16] = t6;
|
|
962
|
-
} else {
|
|
963
|
-
t6 = $2[16];
|
|
964
|
-
}
|
|
965
|
-
return t6;
|
|
966
|
-
}
|
|
967
|
-
function NavigationGroupDroppable(t0) {
|
|
968
|
-
const $2 = c2(11);
|
|
969
|
-
const {
|
|
970
|
-
id,
|
|
971
|
-
itemIds,
|
|
972
|
-
children,
|
|
973
|
-
isPotentialCardDropTarget: t1
|
|
974
|
-
} = t0;
|
|
975
|
-
const isPotentialCardDropTarget = t1 === void 0 ? false : t1;
|
|
976
|
-
let t2;
|
|
977
|
-
if ($2[0] !== id) {
|
|
978
|
-
t2 = {
|
|
979
|
-
id
|
|
980
|
-
};
|
|
981
|
-
$2[0] = id;
|
|
982
|
-
$2[1] = t2;
|
|
983
|
-
} else {
|
|
984
|
-
t2 = $2[1];
|
|
985
|
-
}
|
|
986
|
-
const {
|
|
987
|
-
setNodeRef
|
|
988
|
-
} = useDroppable(t2);
|
|
989
|
-
const t3 = isPotentialCardDropTarget ? "p-2 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg" : void 0;
|
|
990
|
-
let t4;
|
|
991
|
-
if ($2[2] !== t3) {
|
|
992
|
-
t4 = cls(t3, "transition-all duration-200 ease-in-out");
|
|
993
|
-
$2[2] = t3;
|
|
994
|
-
$2[3] = t4;
|
|
995
|
-
} else {
|
|
996
|
-
t4 = $2[3];
|
|
997
|
-
}
|
|
998
|
-
let t5;
|
|
999
|
-
if ($2[4] !== children || $2[5] !== itemIds) {
|
|
1000
|
-
t5 = /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy: rectSortingStrategy, children });
|
|
1001
|
-
$2[4] = children;
|
|
1002
|
-
$2[5] = itemIds;
|
|
1003
|
-
$2[6] = t5;
|
|
1004
|
-
} else {
|
|
1005
|
-
t5 = $2[6];
|
|
1006
|
-
}
|
|
1007
|
-
let t6;
|
|
1008
|
-
if ($2[7] !== setNodeRef || $2[8] !== t4 || $2[9] !== t5) {
|
|
1009
|
-
t6 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, className: t4, children: t5 });
|
|
1010
|
-
$2[7] = setNodeRef;
|
|
1011
|
-
$2[8] = t4;
|
|
1012
|
-
$2[9] = t5;
|
|
1013
|
-
$2[10] = t6;
|
|
1014
|
-
} else {
|
|
1015
|
-
t6 = $2[10];
|
|
1016
|
-
}
|
|
1017
|
-
return t6;
|
|
1018
|
-
}
|
|
1019
|
-
function SortableNavigationGroup(t0) {
|
|
1020
|
-
const $2 = c2(15);
|
|
1021
|
-
const {
|
|
1022
|
-
groupName,
|
|
1023
|
-
children,
|
|
1024
|
-
disabled
|
|
1025
|
-
} = t0;
|
|
1026
|
-
let t1;
|
|
1027
|
-
if ($2[0] !== disabled || $2[1] !== groupName) {
|
|
1028
|
-
t1 = {
|
|
1029
|
-
id: groupName,
|
|
1030
|
-
animateLayoutChanges,
|
|
1031
|
-
disabled
|
|
1032
|
-
};
|
|
1033
|
-
$2[0] = disabled;
|
|
1034
|
-
$2[1] = groupName;
|
|
1035
|
-
$2[2] = t1;
|
|
1036
|
-
} else {
|
|
1037
|
-
t1 = $2[2];
|
|
1038
|
-
}
|
|
1039
|
-
const {
|
|
1040
|
-
attributes,
|
|
1041
|
-
listeners,
|
|
1042
|
-
setNodeRef,
|
|
1043
|
-
transform,
|
|
1044
|
-
transition,
|
|
1045
|
-
isDragging
|
|
1046
|
-
} = useSortable(t1);
|
|
1047
|
-
let t2;
|
|
1048
|
-
if ($2[3] !== transform) {
|
|
1049
|
-
t2 = transform ? CSS.Transform.toString(transform) : void 0;
|
|
1050
|
-
$2[3] = transform;
|
|
1051
|
-
$2[4] = t2;
|
|
1052
|
-
} else {
|
|
1053
|
-
t2 = $2[4];
|
|
1054
|
-
}
|
|
1055
|
-
const t3 = isDragging ? 0 : 1;
|
|
1056
|
-
let t4;
|
|
1057
|
-
if ($2[5] !== t2 || $2[6] !== t3 || $2[7] !== transition) {
|
|
1058
|
-
t4 = {
|
|
1059
|
-
transform: t2,
|
|
1060
|
-
transition,
|
|
1061
|
-
opacity: t3
|
|
1062
|
-
};
|
|
1063
|
-
$2[5] = t2;
|
|
1064
|
-
$2[6] = t3;
|
|
1065
|
-
$2[7] = transition;
|
|
1066
|
-
$2[8] = t4;
|
|
1067
|
-
} else {
|
|
1068
|
-
t4 = $2[8];
|
|
1069
|
-
}
|
|
1070
|
-
const style = t4;
|
|
1071
|
-
let t5;
|
|
1072
|
-
if ($2[9] !== attributes || $2[10] !== children || $2[11] !== listeners || $2[12] !== setNodeRef || $2[13] !== style) {
|
|
1073
|
-
t5 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, ...attributes, ...listeners, children });
|
|
1074
|
-
$2[9] = attributes;
|
|
1075
|
-
$2[10] = children;
|
|
1076
|
-
$2[11] = listeners;
|
|
1077
|
-
$2[12] = setNodeRef;
|
|
1078
|
-
$2[13] = style;
|
|
1079
|
-
$2[14] = t5;
|
|
1080
|
-
} else {
|
|
1081
|
-
t5 = $2[14];
|
|
1082
|
-
}
|
|
1083
|
-
return t5;
|
|
1084
|
-
}
|
|
1085
|
-
function useHomePageDnd({
|
|
1086
|
-
items,
|
|
1087
|
-
setItems,
|
|
1088
|
-
disabled,
|
|
1089
|
-
onCardMovedBetweenGroups,
|
|
1090
|
-
onGroupMoved,
|
|
1091
|
-
onNewGroupDrop,
|
|
1092
|
-
onPersist
|
|
1093
|
-
}) {
|
|
1094
|
-
const dndItems = items;
|
|
1095
|
-
const setDndItems = setItems;
|
|
1096
|
-
const [activeId, setActiveId] = useState(null);
|
|
1097
|
-
const [activeIsGroup, setActiveIsGroup] = useState(false);
|
|
1098
|
-
const [currentDraggingGroupId, setCurrentDraggingGroupId] = useState(null);
|
|
1099
|
-
const [dndKitActiveNode, setDndKitActiveNode] = useState(null);
|
|
1100
|
-
const [isDraggingCardOnly, setIsDraggingCardOnly] = useState(false);
|
|
1101
|
-
const [dialogOpenForGroup, setDialogOpenForGroup] = useState(null);
|
|
1102
|
-
const [isHoveringNewGroupDropZone, setIsHoveringNewGroupDropZone] = useState(false);
|
|
1103
|
-
const [pendingNewGroupName, setPendingNewGroupName] = useState(null);
|
|
1104
|
-
const [stateBeforeNewGroup, setStateBeforeNewGroup] = useState(null);
|
|
1105
|
-
const preDragItemsRef = useRef(null);
|
|
1106
|
-
const interimItemsRef = useRef(null);
|
|
1107
|
-
useEffect(() => {
|
|
1108
|
-
interimItemsRef.current = dndItems;
|
|
1109
|
-
}, [dndItems]);
|
|
1110
|
-
const mouseSensor = useSensor(MouseSensor, {
|
|
1111
|
-
activationConstraint: {
|
|
1112
|
-
distance: 10
|
|
1113
|
-
}
|
|
1114
|
-
});
|
|
1115
|
-
const touchSensor = useSensor(TouchSensor, {
|
|
1116
|
-
activationConstraint: {
|
|
1117
|
-
delay: 150,
|
|
1118
|
-
tolerance: 5
|
|
1119
|
-
}
|
|
1120
|
-
});
|
|
1121
|
-
const keyboardSensor = useSensor(KeyboardSensor);
|
|
1122
|
-
const sensors = useSensors(mouseSensor, touchSensor, keyboardSensor);
|
|
1123
|
-
const dndContainers = dndItems.map((g3) => g3.name);
|
|
1124
|
-
const findDndContainer = useCallback((id) => {
|
|
1125
|
-
if (!id) return void 0;
|
|
1126
|
-
const group = dndItems.find((g_0) => g_0.name === id);
|
|
1127
|
-
if (group) return group.name;
|
|
1128
|
-
for (const g_1 of dndItems) {
|
|
1129
|
-
if (g_1.entries.some((e2) => e2.url === id)) return g_1.name;
|
|
1130
|
-
}
|
|
1131
|
-
return void 0;
|
|
1132
|
-
}, [dndItems]);
|
|
1133
|
-
const lastOverId = useRef(null);
|
|
1134
|
-
const recentlyMovedToNewContainer = useRef(false);
|
|
1135
|
-
const collisionDetection = useCallback((args) => {
|
|
1136
|
-
if (disabled || !activeId) return [];
|
|
1137
|
-
if (activeIsGroup) {
|
|
1138
|
-
const groups = args.droppableContainers.filter((c4) => dndItems.some((g_2) => g_2.name === c4.id));
|
|
1139
|
-
if (!groups.length) return [];
|
|
1140
|
-
return closestCenter({
|
|
1141
|
-
...args,
|
|
1142
|
-
droppableContainers: groups
|
|
1143
|
-
});
|
|
1144
|
-
}
|
|
1145
|
-
const pointer = pointerWithin(args);
|
|
1146
|
-
if (pointer.length) {
|
|
1147
|
-
const zone = pointer.find((c_0) => c_0.id === "new-group-drop-zone");
|
|
1148
|
-
if (zone) return [zone];
|
|
1149
|
-
const container = pointer.find((c_1) => dndItems.some((g_3) => g_3.name === c_1.id));
|
|
1150
|
-
if (container) {
|
|
1151
|
-
const itemsIn = dndItems.find((g_4) => g_4.name === container.id)?.entries;
|
|
1152
|
-
if (itemsIn?.length) {
|
|
1153
|
-
const closest = closestCorners({
|
|
1154
|
-
...args,
|
|
1155
|
-
droppableContainers: args.droppableContainers.filter((c_2) => itemsIn.some((e_0) => e_0.url === c_2.id))
|
|
1156
|
-
});
|
|
1157
|
-
if (closest.length) return closest;
|
|
1158
|
-
}
|
|
1159
|
-
return [container];
|
|
1160
|
-
}
|
|
1161
|
-
const first = getFirstCollision(pointer, "id");
|
|
1162
|
-
if (first) return [{
|
|
1163
|
-
id: first
|
|
1164
|
-
}];
|
|
1165
|
-
}
|
|
1166
|
-
const rects = rectIntersection(args);
|
|
1167
|
-
const zoneRect = rects.find((c_3) => c_3.id === "new-group-drop-zone");
|
|
1168
|
-
if (zoneRect) return [zoneRect];
|
|
1169
|
-
let overId = getFirstCollision(rects, "id");
|
|
1170
|
-
if (overId != null) {
|
|
1171
|
-
const overIsContainer = dndItems.some((g_5) => g_5.name === overId);
|
|
1172
|
-
if (overIsContainer) {
|
|
1173
|
-
const itemsIn_0 = dndItems.find((g_6) => g_6.name === overId)?.entries;
|
|
1174
|
-
if (itemsIn_0?.length) {
|
|
1175
|
-
const closestItem = closestCorners({
|
|
1176
|
-
...args,
|
|
1177
|
-
droppableContainers: args.droppableContainers.filter((c_4) => itemsIn_0.some((e_1) => e_1.url === c_4.id))
|
|
1178
|
-
})[0]?.id;
|
|
1179
|
-
if (closestItem) overId = closestItem;
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
lastOverId.current = overId;
|
|
1183
|
-
return [{
|
|
1184
|
-
id: overId
|
|
1185
|
-
}];
|
|
1186
|
-
}
|
|
1187
|
-
if (recentlyMovedToNewContainer.current && lastOverId.current && !activeIsGroup) return [{
|
|
1188
|
-
id: lastOverId.current
|
|
1189
|
-
}];
|
|
1190
|
-
return [];
|
|
1191
|
-
}, [activeId, dndItems, disabled, activeIsGroup]);
|
|
1192
|
-
const handleDragStart = ({
|
|
1193
|
-
active
|
|
1194
|
-
}) => {
|
|
1195
|
-
setDndKitActiveNode(active);
|
|
1196
|
-
if (disabled) return;
|
|
1197
|
-
preDragItemsRef.current = cloneItemsForDnd(dndItems);
|
|
1198
|
-
const isGroup = dndItems.some((g_7) => g_7.name === active.id);
|
|
1199
|
-
if (!active.data.current) active.data.current = {};
|
|
1200
|
-
active.data.current.type = isGroup ? "group" : "item";
|
|
1201
|
-
setActiveId(active.id);
|
|
1202
|
-
setActiveIsGroup(isGroup);
|
|
1203
|
-
setIsDraggingCardOnly(!isGroup);
|
|
1204
|
-
if (isGroup) setCurrentDraggingGroupId(active.id);
|
|
1205
|
-
recentlyMovedToNewContainer.current = false;
|
|
1206
|
-
};
|
|
1207
|
-
const handleDragOver = ({
|
|
1208
|
-
active: active_0,
|
|
1209
|
-
over
|
|
1210
|
-
}) => {
|
|
1211
|
-
if (disabled || !over) return;
|
|
1212
|
-
const activeIdNow = active_0.id;
|
|
1213
|
-
const overIdNow = over.id;
|
|
1214
|
-
if (activeIdNow === overIdNow) return;
|
|
1215
|
-
if (activeIsGroup) return;
|
|
1216
|
-
const activeCont = findDndContainer(activeIdNow);
|
|
1217
|
-
const overCont = findDndContainer(overIdNow);
|
|
1218
|
-
if (!activeCont) return;
|
|
1219
|
-
if (overCont && activeCont !== overCont) {
|
|
1220
|
-
recentlyMovedToNewContainer.current = true;
|
|
1221
|
-
lastOverId.current = overIdNow;
|
|
1222
|
-
setDndItems((current) => {
|
|
1223
|
-
const newState = cloneItemsForDnd(current);
|
|
1224
|
-
const srcIdx = newState.findIndex((g_8) => g_8.name === activeCont);
|
|
1225
|
-
const tgtIdx = newState.findIndex((g_9) => g_9.name === overCont);
|
|
1226
|
-
if (srcIdx === -1 || tgtIdx === -1) return current;
|
|
1227
|
-
const src = newState[srcIdx];
|
|
1228
|
-
const tgt = newState[tgtIdx];
|
|
1229
|
-
const idxInSrc = src.entries.findIndex((e_2) => e_2.url === activeIdNow);
|
|
1230
|
-
if (idxInSrc === -1) return current;
|
|
1231
|
-
const [moved] = src.entries.splice(idxInSrc, 1);
|
|
1232
|
-
const overIsContainer_0 = overIdNow === overCont;
|
|
1233
|
-
if (overIsContainer_0) {
|
|
1234
|
-
tgt.entries.push(moved);
|
|
1235
|
-
} else {
|
|
1236
|
-
const overIdx = tgt.entries.findIndex((e_3) => e_3.url === overIdNow);
|
|
1237
|
-
if (overIdx !== -1) {
|
|
1238
|
-
tgt.entries.splice(overIdx, 0, moved);
|
|
1239
|
-
} else {
|
|
1240
|
-
tgt.entries.push(moved);
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
return newState;
|
|
1244
|
-
});
|
|
1245
|
-
} else if (activeCont === overCont) {
|
|
1246
|
-
recentlyMovedToNewContainer.current = false;
|
|
1247
|
-
}
|
|
1248
|
-
};
|
|
1249
|
-
const handleDragEnd = ({
|
|
1250
|
-
active: active_1,
|
|
1251
|
-
over: over_0
|
|
1252
|
-
}) => {
|
|
1253
|
-
if (disabled || !over_0) {
|
|
1254
|
-
resetDragState();
|
|
1255
|
-
return;
|
|
1256
|
-
}
|
|
1257
|
-
const activeIdNow_0 = active_1.id;
|
|
1258
|
-
const overIdNow_0 = over_0.id;
|
|
1259
|
-
if (activeIsGroup) {
|
|
1260
|
-
if (activeIdNow_0 !== overIdNow_0 && dndItems.some((g_12) => g_12.name === overIdNow_0)) {
|
|
1261
|
-
const from = dndItems.findIndex((g_10) => g_10.name === activeIdNow_0);
|
|
1262
|
-
const to = dndItems.findIndex((g_11) => g_11.name === overIdNow_0);
|
|
1263
|
-
if (from !== -1 && to !== -1) {
|
|
1264
|
-
const newState_0 = arrayMove(dndItems, from, to);
|
|
1265
|
-
setDndItems(newState_0);
|
|
1266
|
-
onPersist?.(newState_0);
|
|
1267
|
-
onGroupMoved?.(activeIdNow_0, from, to);
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
} else {
|
|
1271
|
-
const findContainerInState = (id_0, state) => {
|
|
1272
|
-
const group_0 = state.find((g_13) => g_13.name === id_0);
|
|
1273
|
-
if (group_0) return group_0.name;
|
|
1274
|
-
for (const g_14 of state) {
|
|
1275
|
-
if (g_14.entries.some((e_4) => e_4.url === id_0)) return g_14.name;
|
|
1276
|
-
}
|
|
1277
|
-
return void 0;
|
|
1278
|
-
};
|
|
1279
|
-
const sourceState = preDragItemsRef.current || dndItems;
|
|
1280
|
-
const activeCont_0 = findContainerInState(activeIdNow_0, sourceState);
|
|
1281
|
-
findDndContainer(overIdNow_0);
|
|
1282
|
-
if (overIdNow_0 === "new-group-drop-zone") {
|
|
1283
|
-
if (activeCont_0) {
|
|
1284
|
-
setStateBeforeNewGroup(cloneItemsForDnd(dndItems));
|
|
1285
|
-
const newState_1 = cloneItemsForDnd(dndItems);
|
|
1286
|
-
const srcIdx_0 = newState_1.findIndex((g_15) => g_15.name === activeCont_0);
|
|
1287
|
-
if (srcIdx_0 !== -1) {
|
|
1288
|
-
const src_0 = newState_1[srcIdx_0];
|
|
1289
|
-
const idxInSrc_0 = src_0.entries.findIndex((e_5) => e_5.url === activeIdNow_0);
|
|
1290
|
-
if (idxInSrc_0 !== -1) {
|
|
1291
|
-
const [dragged] = src_0.entries.splice(idxInSrc_0, 1);
|
|
1292
|
-
if (src_0.entries.length === 0) newState_1.splice(srcIdx_0, 1);
|
|
1293
|
-
let tentative = "New Group";
|
|
1294
|
-
let counter = 1;
|
|
1295
|
-
while (newState_1.some((g_16) => g_16.name === tentative)) tentative = `New Group ${counter++}`;
|
|
1296
|
-
newState_1.push({
|
|
1297
|
-
name: tentative,
|
|
1298
|
-
entries: [dragged]
|
|
1299
|
-
});
|
|
1300
|
-
setDndItems(newState_1);
|
|
1301
|
-
setPendingNewGroupName(tentative);
|
|
1302
|
-
setDialogOpenForGroup(tentative);
|
|
1303
|
-
onNewGroupDrop?.();
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
} else {
|
|
1308
|
-
const overCont_1 = findDndContainer(overIdNow_0);
|
|
1309
|
-
if (activeCont_0 === overCont_1) {
|
|
1310
|
-
const grpIdx = dndItems.findIndex((g_17) => g_17.name === activeCont_0);
|
|
1311
|
-
if (grpIdx !== -1) {
|
|
1312
|
-
const group_1 = dndItems[grpIdx];
|
|
1313
|
-
const oldIdx = group_1.entries.findIndex((e_6) => e_6.url === activeIdNow_0);
|
|
1314
|
-
let newIdx = group_1.entries.findIndex((e_7) => e_7.url === overIdNow_0);
|
|
1315
|
-
if (newIdx === -1 && overIdNow_0 === activeCont_0) newIdx = group_1.entries.length - 1;
|
|
1316
|
-
if (oldIdx !== -1 && newIdx !== -1 && oldIdx !== newIdx) {
|
|
1317
|
-
const reordered = arrayMove(group_1.entries, oldIdx, newIdx);
|
|
1318
|
-
const newState_2 = [...dndItems];
|
|
1319
|
-
newState_2[grpIdx] = {
|
|
1320
|
-
...group_1,
|
|
1321
|
-
entries: reordered
|
|
1322
|
-
};
|
|
1323
|
-
setDndItems(newState_2);
|
|
1324
|
-
onPersist?.(newState_2);
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
} else if (overCont_1 && activeCont_0 !== overCont_1) {
|
|
1328
|
-
const finalState = cloneItemsForDnd(sourceState);
|
|
1329
|
-
const finalOverId = lastOverId.current || overIdNow_0;
|
|
1330
|
-
const cleanOverCont = findContainerInState(finalOverId, sourceState) || overCont_1;
|
|
1331
|
-
const srcIdx_1 = finalState.findIndex((g_18) => g_18.name === activeCont_0);
|
|
1332
|
-
const tgtIdx_0 = finalState.findIndex((g_19) => g_19.name === cleanOverCont);
|
|
1333
|
-
if (srcIdx_1 !== -1 && tgtIdx_0 !== -1) {
|
|
1334
|
-
const src_1 = finalState[srcIdx_1];
|
|
1335
|
-
const tgt_0 = finalState[tgtIdx_0];
|
|
1336
|
-
const idxInSrc_1 = src_1.entries.findIndex((e_8) => e_8.url === activeIdNow_0);
|
|
1337
|
-
if (idxInSrc_1 !== -1) {
|
|
1338
|
-
const [moved_0] = src_1.entries.splice(idxInSrc_1, 1);
|
|
1339
|
-
const overIsContainer_1 = finalOverId === cleanOverCont;
|
|
1340
|
-
if (overIsContainer_1) {
|
|
1341
|
-
tgt_0.entries.push(moved_0);
|
|
1342
|
-
} else {
|
|
1343
|
-
const overIdx_0 = tgt_0.entries.findIndex((e_9) => e_9.url === finalOverId);
|
|
1344
|
-
if (overIdx_0 !== -1) {
|
|
1345
|
-
tgt_0.entries.splice(overIdx_0, 0, moved_0);
|
|
1346
|
-
} else {
|
|
1347
|
-
tgt_0.entries.push(moved_0);
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
if (src_1.entries.length === 0) {
|
|
1351
|
-
finalState.splice(srcIdx_1, 1);
|
|
1352
|
-
}
|
|
1353
|
-
setDndItems(finalState);
|
|
1354
|
-
onPersist?.(finalState);
|
|
1355
|
-
onCardMovedBetweenGroups?.(moved_0);
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
} else if (recentlyMovedToNewContainer.current) {
|
|
1359
|
-
console.error("Move between containers detected but conditions not met", {
|
|
1360
|
-
activeCont: activeCont_0,
|
|
1361
|
-
overCont: overCont_1,
|
|
1362
|
-
activeIdNow: activeIdNow_0,
|
|
1363
|
-
overIdNow: overIdNow_0
|
|
1364
|
-
});
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
resetDragState();
|
|
1369
|
-
};
|
|
1370
|
-
const resetDragState = () => {
|
|
1371
|
-
setDndKitActiveNode(null);
|
|
1372
|
-
setActiveId(null);
|
|
1373
|
-
setActiveIsGroup(false);
|
|
1374
|
-
setCurrentDraggingGroupId(null);
|
|
1375
|
-
setIsDraggingCardOnly(false);
|
|
1376
|
-
recentlyMovedToNewContainer.current = false;
|
|
1377
|
-
};
|
|
1378
|
-
const handleDragCancel = () => resetDragState();
|
|
1379
|
-
const handleRenameGroup = (oldName, newName) => {
|
|
1380
|
-
setDndItems((current_0) => {
|
|
1381
|
-
const idx = current_0.findIndex((g_20) => g_20.name === oldName);
|
|
1382
|
-
if (idx === -1) return current_0;
|
|
1383
|
-
if (current_0.some((g_21) => g_21.name === newName && g_21.name !== oldName)) return current_0;
|
|
1384
|
-
const updated = [...current_0];
|
|
1385
|
-
updated[idx] = {
|
|
1386
|
-
...updated[idx],
|
|
1387
|
-
name: newName
|
|
1388
|
-
};
|
|
1389
|
-
onPersist?.(updated);
|
|
1390
|
-
return updated;
|
|
1391
|
-
});
|
|
1392
|
-
setPendingNewGroupName(null);
|
|
1393
|
-
setStateBeforeNewGroup(null);
|
|
1394
|
-
setDialogOpenForGroup(null);
|
|
1395
|
-
};
|
|
1396
|
-
const handleDialogClose = () => {
|
|
1397
|
-
if (pendingNewGroupName && dialogOpenForGroup === pendingNewGroupName && stateBeforeNewGroup) {
|
|
1398
|
-
setDndItems(stateBeforeNewGroup);
|
|
1399
|
-
}
|
|
1400
|
-
setPendingNewGroupName(null);
|
|
1401
|
-
setStateBeforeNewGroup(null);
|
|
1402
|
-
setDialogOpenForGroup(null);
|
|
1403
|
-
};
|
|
1404
|
-
const activeItemForOverlay = disabled || !activeId || activeIsGroup ? null : dndItems.flatMap((g_22) => g_22.entries).find((e_10) => e_10.url === activeId) || null;
|
|
1405
|
-
const activeGroupData = disabled || !activeId || !activeIsGroup ? null : dndItems.find((g_23) => g_23.name === activeId) || null;
|
|
1406
|
-
return {
|
|
1407
|
-
sensors,
|
|
1408
|
-
collisionDetection,
|
|
1409
|
-
onDragStart: handleDragStart,
|
|
1410
|
-
onDragOver: handleDragOver,
|
|
1411
|
-
onDragEnd: handleDragEnd,
|
|
1412
|
-
onDragCancel: handleDragCancel,
|
|
1413
|
-
dropAnimation: dropAnimationConfig,
|
|
1414
|
-
activeItemForOverlay,
|
|
1415
|
-
activeGroupData,
|
|
1416
|
-
draggingGroupId: currentDraggingGroupId,
|
|
1417
|
-
containers: dndContainers,
|
|
1418
|
-
dndKitActiveNode,
|
|
1419
|
-
isDraggingCardOnly,
|
|
1420
|
-
dialogOpenForGroup,
|
|
1421
|
-
setDialogOpenForGroup,
|
|
1422
|
-
handleRenameGroup,
|
|
1423
|
-
handleDialogClose,
|
|
1424
|
-
isHoveringNewGroupDropZone,
|
|
1425
|
-
setIsHoveringNewGroupDropZone
|
|
1426
|
-
};
|
|
1427
|
-
}
|
|
1428
|
-
function NewGroupDropZone(t0) {
|
|
1429
|
-
const $2 = c2(15);
|
|
1430
|
-
const {
|
|
1431
|
-
disabled,
|
|
1432
|
-
setIsHovering
|
|
1433
|
-
} = t0;
|
|
1434
|
-
let t1;
|
|
1435
|
-
if ($2[0] !== disabled) {
|
|
1436
|
-
t1 = {
|
|
1437
|
-
id: "new-group-drop-zone",
|
|
1438
|
-
disabled
|
|
1439
|
-
};
|
|
1440
|
-
$2[0] = disabled;
|
|
1441
|
-
$2[1] = t1;
|
|
1442
|
-
} else {
|
|
1443
|
-
t1 = $2[1];
|
|
1444
|
-
}
|
|
1445
|
-
const {
|
|
1446
|
-
setNodeRef,
|
|
1447
|
-
isOver
|
|
1448
|
-
} = useDroppable(t1);
|
|
1449
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
1450
|
-
let t2;
|
|
1451
|
-
if ($2[2] !== disabled) {
|
|
1452
|
-
t2 = {
|
|
1453
|
-
onDragStart(t32) {
|
|
1454
|
-
const {
|
|
1455
|
-
active
|
|
1456
|
-
} = t32;
|
|
1457
|
-
if (disabled) {
|
|
1458
|
-
return;
|
|
1459
|
-
}
|
|
1460
|
-
const tp = active.data.current?.type;
|
|
1461
|
-
setIsVisible(tp === "item");
|
|
1462
|
-
},
|
|
1463
|
-
onDragEnd() {
|
|
1464
|
-
setIsVisible(false);
|
|
1465
|
-
},
|
|
1466
|
-
onDragCancel() {
|
|
1467
|
-
setIsVisible(false);
|
|
1468
|
-
}
|
|
1469
|
-
};
|
|
1470
|
-
$2[2] = disabled;
|
|
1471
|
-
$2[3] = t2;
|
|
1472
|
-
} else {
|
|
1473
|
-
t2 = $2[3];
|
|
1474
|
-
}
|
|
1475
|
-
useDndMonitor(t2);
|
|
1476
|
-
let t3;
|
|
1477
|
-
let t4;
|
|
1478
|
-
if ($2[4] !== isOver || $2[5] !== isVisible || $2[6] !== setIsHovering) {
|
|
1479
|
-
t3 = () => {
|
|
1480
|
-
setIsHovering(isOver && isVisible);
|
|
1481
|
-
};
|
|
1482
|
-
t4 = [isOver, isVisible, setIsHovering];
|
|
1483
|
-
$2[4] = isOver;
|
|
1484
|
-
$2[5] = isVisible;
|
|
1485
|
-
$2[6] = setIsHovering;
|
|
1486
|
-
$2[7] = t3;
|
|
1487
|
-
$2[8] = t4;
|
|
1488
|
-
} else {
|
|
1489
|
-
t3 = $2[7];
|
|
1490
|
-
t4 = $2[8];
|
|
1491
|
-
}
|
|
1492
|
-
useEffect(t3, t4);
|
|
1493
|
-
if (!isVisible || disabled) {
|
|
1494
|
-
return null;
|
|
1495
|
-
}
|
|
1496
|
-
const t5 = isOver ? "bg-surface-accent-100 dark:bg-surface-accent-800 border-surface-300 dark:border-surface-600" : "bg-surface-50 dark:bg-surface-900 border-surface-200 dark:border-surface-700";
|
|
1497
|
-
let t6;
|
|
1498
|
-
if ($2[9] !== t5) {
|
|
1499
|
-
t6 = cls("fixed right-8 top-1/2 -translate-y-1/2 w-[200px] h-[120px] border border-dashed rounded-lg flex items-center justify-center transition-all", t5);
|
|
1500
|
-
$2[9] = t5;
|
|
1501
|
-
$2[10] = t6;
|
|
1502
|
-
} else {
|
|
1503
|
-
t6 = $2[10];
|
|
1504
|
-
}
|
|
1505
|
-
let t7;
|
|
1506
|
-
if ($2[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1507
|
-
t7 = /* @__PURE__ */ jsx("div", { className: "text-center p-4", children: /* @__PURE__ */ jsx("span", { className: "block font-medium text-sm", children: "Drop here to create a new group" }) });
|
|
1508
|
-
$2[11] = t7;
|
|
1509
|
-
} else {
|
|
1510
|
-
t7 = $2[11];
|
|
1511
|
-
}
|
|
1512
|
-
let t8;
|
|
1513
|
-
if ($2[12] !== setNodeRef || $2[13] !== t6) {
|
|
1514
|
-
t8 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, className: t6, children: t7 });
|
|
1515
|
-
$2[12] = setNodeRef;
|
|
1516
|
-
$2[13] = t6;
|
|
1517
|
-
$2[14] = t8;
|
|
1518
|
-
} else {
|
|
1519
|
-
t8 = $2[14];
|
|
1520
|
-
}
|
|
1521
|
-
return t8;
|
|
1522
|
-
}
|
|
1523
|
-
function RenameGroupDialog(t0) {
|
|
1524
|
-
const $2 = c2(56);
|
|
1525
|
-
const {
|
|
1526
|
-
open,
|
|
1527
|
-
initialName,
|
|
1528
|
-
existingGroupNames,
|
|
1529
|
-
onClose,
|
|
1530
|
-
onRename
|
|
1531
|
-
} = t0;
|
|
1532
|
-
const {
|
|
1533
|
-
t
|
|
1534
|
-
} = useTranslation();
|
|
1535
|
-
const [name, setName] = useState(initialName);
|
|
1536
|
-
const [error, setError] = useState(null);
|
|
1537
|
-
const inputRef = useRef(null);
|
|
1538
|
-
let t1;
|
|
1539
|
-
let t2;
|
|
1540
|
-
if ($2[0] !== initialName || $2[1] !== open) {
|
|
1541
|
-
t1 = () => {
|
|
1542
|
-
if (open) {
|
|
1543
|
-
setName(initialName);
|
|
1544
|
-
setError(null);
|
|
1545
|
-
setTimeout(() => {
|
|
1546
|
-
if (inputRef.current) {
|
|
1547
|
-
inputRef.current.focus();
|
|
1548
|
-
inputRef.current.select();
|
|
1549
|
-
}
|
|
1550
|
-
}, 100);
|
|
1551
|
-
}
|
|
1552
|
-
};
|
|
1553
|
-
t2 = [initialName, open];
|
|
1554
|
-
$2[0] = initialName;
|
|
1555
|
-
$2[1] = open;
|
|
1556
|
-
$2[2] = t1;
|
|
1557
|
-
$2[3] = t2;
|
|
1558
|
-
} else {
|
|
1559
|
-
t1 = $2[2];
|
|
1560
|
-
t2 = $2[3];
|
|
1561
|
-
}
|
|
1562
|
-
useEffect(t1, t2);
|
|
1563
|
-
let t3;
|
|
1564
|
-
if ($2[4] !== existingGroupNames || $2[5] !== t) {
|
|
1565
|
-
t3 = (event) => {
|
|
1566
|
-
const newName = event.target.value;
|
|
1567
|
-
setName(newName);
|
|
1568
|
-
if (!newName.trim()) {
|
|
1569
|
-
setError(t("group_name_empty_error"));
|
|
1570
|
-
} else {
|
|
1571
|
-
if (existingGroupNames.includes(newName.trim())) {
|
|
1572
|
-
setError(t("group_name_exists_error"));
|
|
1573
|
-
} else {
|
|
1574
|
-
setError(null);
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
};
|
|
1578
|
-
$2[4] = existingGroupNames;
|
|
1579
|
-
$2[5] = t;
|
|
1580
|
-
$2[6] = t3;
|
|
1581
|
-
} else {
|
|
1582
|
-
t3 = $2[6];
|
|
1583
|
-
}
|
|
1584
|
-
const handleNameChange = t3;
|
|
1585
|
-
let t4;
|
|
1586
|
-
if ($2[7] !== error || $2[8] !== existingGroupNames || $2[9] !== name || $2[10] !== onClose || $2[11] !== onRename || $2[12] !== t) {
|
|
1587
|
-
t4 = () => {
|
|
1588
|
-
const trimmedName = name.trim();
|
|
1589
|
-
if (!trimmedName) {
|
|
1590
|
-
setError(t("group_name_empty_error"));
|
|
1591
|
-
return;
|
|
1592
|
-
}
|
|
1593
|
-
if (existingGroupNames.includes(trimmedName)) {
|
|
1594
|
-
setError(t("group_name_exists_error"));
|
|
1595
|
-
return;
|
|
1596
|
-
}
|
|
1597
|
-
if (!error) {
|
|
1598
|
-
onRename(trimmedName);
|
|
1599
|
-
onClose();
|
|
1600
|
-
}
|
|
1601
|
-
};
|
|
1602
|
-
$2[7] = error;
|
|
1603
|
-
$2[8] = existingGroupNames;
|
|
1604
|
-
$2[9] = name;
|
|
1605
|
-
$2[10] = onClose;
|
|
1606
|
-
$2[11] = onRename;
|
|
1607
|
-
$2[12] = t;
|
|
1608
|
-
$2[13] = t4;
|
|
1609
|
-
} else {
|
|
1610
|
-
t4 = $2[13];
|
|
1611
|
-
}
|
|
1612
|
-
const handleSave = t4;
|
|
1613
|
-
let t5;
|
|
1614
|
-
if ($2[14] !== existingGroupNames || $2[15] !== handleSave || $2[16] !== name || $2[17] !== t) {
|
|
1615
|
-
t5 = (event_0) => {
|
|
1616
|
-
if (event_0.key === "Enter") {
|
|
1617
|
-
event_0.preventDefault();
|
|
1618
|
-
const trimmedName_0 = name.trim();
|
|
1619
|
-
let currentError = null;
|
|
1620
|
-
if (!trimmedName_0) {
|
|
1621
|
-
currentError = t("group_name_empty_error");
|
|
1622
|
-
} else {
|
|
1623
|
-
if (existingGroupNames.includes(trimmedName_0)) {
|
|
1624
|
-
currentError = t("group_name_exists_error");
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
if (!currentError && trimmedName_0) {
|
|
1628
|
-
handleSave();
|
|
1629
|
-
} else {
|
|
1630
|
-
if (currentError) {
|
|
1631
|
-
setError(currentError);
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
};
|
|
1636
|
-
$2[14] = existingGroupNames;
|
|
1637
|
-
$2[15] = handleSave;
|
|
1638
|
-
$2[16] = name;
|
|
1639
|
-
$2[17] = t;
|
|
1640
|
-
$2[18] = t5;
|
|
1641
|
-
} else {
|
|
1642
|
-
t5 = $2[18];
|
|
1643
|
-
}
|
|
1644
|
-
const handleKeyDown = t5;
|
|
1645
|
-
if (!open) {
|
|
1646
|
-
return null;
|
|
1647
|
-
}
|
|
1648
|
-
let t6;
|
|
1649
|
-
if ($2[19] !== t) {
|
|
1650
|
-
t6 = t("rename_group");
|
|
1651
|
-
$2[19] = t;
|
|
1652
|
-
$2[20] = t6;
|
|
1653
|
-
} else {
|
|
1654
|
-
t6 = $2[20];
|
|
1655
|
-
}
|
|
1656
|
-
let t7;
|
|
1657
|
-
if ($2[21] !== t6) {
|
|
1658
|
-
t7 = /* @__PURE__ */ jsx(DialogTitle, { children: t6 });
|
|
1659
|
-
$2[21] = t6;
|
|
1660
|
-
$2[22] = t7;
|
|
1661
|
-
} else {
|
|
1662
|
-
t7 = $2[22];
|
|
1663
|
-
}
|
|
1664
|
-
let t8;
|
|
1665
|
-
if ($2[23] !== t) {
|
|
1666
|
-
t8 = t("group_name_label");
|
|
1667
|
-
$2[23] = t;
|
|
1668
|
-
$2[24] = t8;
|
|
1669
|
-
} else {
|
|
1670
|
-
t8 = $2[24];
|
|
1671
|
-
}
|
|
1672
|
-
const t9 = !!error;
|
|
1673
|
-
const t10 = error ? "group-name-error" : void 0;
|
|
1674
|
-
let t11;
|
|
1675
|
-
if ($2[25] !== handleKeyDown || $2[26] !== handleNameChange || $2[27] !== name || $2[28] !== t10 || $2[29] !== t8 || $2[30] !== t9) {
|
|
1676
|
-
t11 = /* @__PURE__ */ jsx(TextField, { inputRef, label: t8, value: name, onChange: handleNameChange, onKeyDown: handleKeyDown, error: t9, "aria-describedby": t10 });
|
|
1677
|
-
$2[25] = handleKeyDown;
|
|
1678
|
-
$2[26] = handleNameChange;
|
|
1679
|
-
$2[27] = name;
|
|
1680
|
-
$2[28] = t10;
|
|
1681
|
-
$2[29] = t8;
|
|
1682
|
-
$2[30] = t9;
|
|
1683
|
-
$2[31] = t11;
|
|
1684
|
-
} else {
|
|
1685
|
-
t11 = $2[31];
|
|
1686
|
-
}
|
|
1687
|
-
let t12;
|
|
1688
|
-
if ($2[32] !== error) {
|
|
1689
|
-
t12 = error && /* @__PURE__ */ jsx("p", { id: "group-name-error", style: {
|
|
1690
|
-
display: "none"
|
|
1691
|
-
}, children: error });
|
|
1692
|
-
$2[32] = error;
|
|
1693
|
-
$2[33] = t12;
|
|
1694
|
-
} else {
|
|
1695
|
-
t12 = $2[33];
|
|
1696
|
-
}
|
|
1697
|
-
let t13;
|
|
1698
|
-
if ($2[34] !== t11 || $2[35] !== t12) {
|
|
1699
|
-
t13 = /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
1700
|
-
t11,
|
|
1701
|
-
t12
|
|
1702
|
-
] });
|
|
1703
|
-
$2[34] = t11;
|
|
1704
|
-
$2[35] = t12;
|
|
1705
|
-
$2[36] = t13;
|
|
1706
|
-
} else {
|
|
1707
|
-
t13 = $2[36];
|
|
1708
|
-
}
|
|
1709
|
-
let t14;
|
|
1710
|
-
if ($2[37] !== t) {
|
|
1711
|
-
t14 = t("cancel");
|
|
1712
|
-
$2[37] = t;
|
|
1713
|
-
$2[38] = t14;
|
|
1714
|
-
} else {
|
|
1715
|
-
t14 = $2[38];
|
|
1716
|
-
}
|
|
1717
|
-
let t15;
|
|
1718
|
-
if ($2[39] !== onClose || $2[40] !== t14) {
|
|
1719
|
-
t15 = /* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "text", children: t14 });
|
|
1720
|
-
$2[39] = onClose;
|
|
1721
|
-
$2[40] = t14;
|
|
1722
|
-
$2[41] = t15;
|
|
1723
|
-
} else {
|
|
1724
|
-
t15 = $2[41];
|
|
1725
|
-
}
|
|
1726
|
-
const t16 = !!error || !name.trim();
|
|
1727
|
-
let t17;
|
|
1728
|
-
if ($2[42] !== t) {
|
|
1729
|
-
t17 = t("save");
|
|
1730
|
-
$2[42] = t;
|
|
1731
|
-
$2[43] = t17;
|
|
1732
|
-
} else {
|
|
1733
|
-
t17 = $2[43];
|
|
1734
|
-
}
|
|
1735
|
-
let t18;
|
|
1736
|
-
if ($2[44] !== handleSave || $2[45] !== t16 || $2[46] !== t17) {
|
|
1737
|
-
t18 = /* @__PURE__ */ jsx(Button, { onClick: handleSave, disabled: t16, children: t17 });
|
|
1738
|
-
$2[44] = handleSave;
|
|
1739
|
-
$2[45] = t16;
|
|
1740
|
-
$2[46] = t17;
|
|
1741
|
-
$2[47] = t18;
|
|
1742
|
-
} else {
|
|
1743
|
-
t18 = $2[47];
|
|
1744
|
-
}
|
|
1745
|
-
let t19;
|
|
1746
|
-
if ($2[48] !== t15 || $2[49] !== t18) {
|
|
1747
|
-
t19 = /* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
1748
|
-
t15,
|
|
1749
|
-
t18
|
|
1750
|
-
] });
|
|
1751
|
-
$2[48] = t15;
|
|
1752
|
-
$2[49] = t18;
|
|
1753
|
-
$2[50] = t19;
|
|
1754
|
-
} else {
|
|
1755
|
-
t19 = $2[50];
|
|
1756
|
-
}
|
|
1757
|
-
let t20;
|
|
1758
|
-
if ($2[51] !== open || $2[52] !== t13 || $2[53] !== t19 || $2[54] !== t7) {
|
|
1759
|
-
t20 = /* @__PURE__ */ jsxs(Dialog, { open, children: [
|
|
1760
|
-
t7,
|
|
1761
|
-
t13,
|
|
1762
|
-
t19
|
|
1763
|
-
] });
|
|
1764
|
-
$2[51] = open;
|
|
1765
|
-
$2[52] = t13;
|
|
1766
|
-
$2[53] = t19;
|
|
1767
|
-
$2[54] = t7;
|
|
1768
|
-
$2[55] = t20;
|
|
1769
|
-
} else {
|
|
1770
|
-
t20 = $2[55];
|
|
1771
|
-
}
|
|
1772
|
-
return t20;
|
|
1773
|
-
}
|
|
1774
|
-
const DEFAULT_GROUP_NAME = "Views";
|
|
1775
|
-
const ADMIN_GROUP_NAME = "Admin";
|
|
1776
|
-
function ContentHomePage({
|
|
1777
|
-
additionalActions,
|
|
1778
|
-
additionalChildrenStart,
|
|
1779
|
-
additionalChildrenEnd,
|
|
1780
|
-
sections,
|
|
1781
|
-
hiddenGroups
|
|
1782
|
-
}) {
|
|
1783
|
-
const context = useCMSContext();
|
|
1784
|
-
const {
|
|
1785
|
-
navigationStateController
|
|
1786
|
-
} = context;
|
|
1787
|
-
const customizationController = useCustomizationController();
|
|
1788
|
-
const adminModeController = useAdminModeController();
|
|
1789
|
-
const registry = useRebaseRegistry();
|
|
1790
|
-
const {
|
|
1791
|
-
resolvedSlots
|
|
1792
|
-
} = customizationController;
|
|
1793
|
-
const breadcrumbs = useBreadcrumbsController();
|
|
1794
|
-
const {
|
|
1795
|
-
t
|
|
1796
|
-
} = useTranslation();
|
|
1797
|
-
useEffect(() => {
|
|
1798
|
-
breadcrumbs.set({
|
|
1799
|
-
breadcrumbs: []
|
|
1800
|
-
});
|
|
1801
|
-
}, [breadcrumbs.set]);
|
|
1802
|
-
const {
|
|
1803
|
-
allowDragAndDrop = false,
|
|
1804
|
-
navigationEntries: unFilteredNavigationEntries = [],
|
|
1805
|
-
groups: unFilteredGroupOrder = [],
|
|
1806
|
-
onNavigationEntriesUpdate = () => {
|
|
1807
|
-
}
|
|
1808
|
-
} = navigationStateController.topLevelNavigation || {};
|
|
1809
|
-
const rawNavigationEntries = useMemo(() => {
|
|
1810
|
-
if (adminModeController.mode === "studio") {
|
|
1811
|
-
return unFilteredNavigationEntries.filter((e2) => e2.type === "view" || e2.type === "admin");
|
|
1812
|
-
}
|
|
1813
|
-
return unFilteredNavigationEntries.filter((e_0) => e_0.type !== "view");
|
|
1814
|
-
}, [unFilteredNavigationEntries, adminModeController.mode]);
|
|
1815
|
-
const groupOrderFromNavController = useMemo(() => {
|
|
1816
|
-
const entryGroups = new Set(rawNavigationEntries.map((e_1) => e_1.group).filter(Boolean));
|
|
1817
|
-
return unFilteredGroupOrder.filter((g3) => entryGroups.has(g3));
|
|
1818
|
-
}, [unFilteredGroupOrder, rawNavigationEntries]);
|
|
1819
|
-
const fuse = useRef(null);
|
|
1820
|
-
const [filteredUrls, setFilteredUrls] = useState(null);
|
|
1821
|
-
const performingSearch = Boolean(filteredUrls);
|
|
1822
|
-
const filteredNavigationEntries = useMemo(() => {
|
|
1823
|
-
return filteredUrls ? rawNavigationEntries.filter((e_2) => filteredUrls.includes(e_2.url)) : rawNavigationEntries;
|
|
1824
|
-
}, [filteredUrls, rawNavigationEntries]);
|
|
1825
|
-
useEffect(() => {
|
|
1826
|
-
fuse.current = new Fuse(rawNavigationEntries, {
|
|
1827
|
-
keys: ["name", "description", "group", "path"]
|
|
1828
|
-
});
|
|
1829
|
-
}, [rawNavigationEntries]);
|
|
1830
|
-
const updateSearch = useCallback((v2) => {
|
|
1831
|
-
if (!v2?.trim()) {
|
|
1832
|
-
setFilteredUrls(null);
|
|
1833
|
-
return;
|
|
1834
|
-
}
|
|
1835
|
-
const results = fuse.current?.search(v2.trim());
|
|
1836
|
-
setFilteredUrls(results ? results.map((x2) => x2.item.url) : []);
|
|
1837
|
-
}, []);
|
|
1838
|
-
const [items, setItems] = useState([]);
|
|
1839
|
-
const [adminGroupData, setAdminGroupData] = useState(null);
|
|
1840
|
-
const isDndDirtyRef = useRef(false);
|
|
1841
|
-
const dndDirtyTimeoutRef = useRef(null);
|
|
1842
|
-
const processedGroups = useMemo(() => {
|
|
1843
|
-
const src = filteredNavigationEntries;
|
|
1844
|
-
const entriesByGroup = {};
|
|
1845
|
-
src.forEach((e_3) => {
|
|
1846
|
-
const g_0 = e_3.type === "admin" ? ADMIN_GROUP_NAME : e_3.group ?? DEFAULT_GROUP_NAME;
|
|
1847
|
-
(entriesByGroup[g_0] ??= []).push(e_3);
|
|
1848
|
-
});
|
|
1849
|
-
const hasPluginAdditionalCards = customizationController.resolvedSlots.some((s2) => s2.slot === "home.cards");
|
|
1850
|
-
let allProcessed;
|
|
1851
|
-
if (performingSearch) {
|
|
1852
|
-
const ordered = [...new Set(src.map((e_4) => e_4.group ?? DEFAULT_GROUP_NAME))];
|
|
1853
|
-
allProcessed = ordered.map((name) => ({
|
|
1854
|
-
name,
|
|
1855
|
-
entries: entriesByGroup[name] || []
|
|
1856
|
-
})).filter((g_1) => g_1.entries.length);
|
|
1857
|
-
} else {
|
|
1858
|
-
allProcessed = groupOrderFromNavController.map((g_2) => ({
|
|
1859
|
-
name: g_2,
|
|
1860
|
-
entries: entriesByGroup[g_2] || []
|
|
1861
|
-
}));
|
|
1862
|
-
Object.keys(entriesByGroup).forEach((g_3) => {
|
|
1863
|
-
if (!groupOrderFromNavController.includes(g_3)) allProcessed.push({
|
|
1864
|
-
name: g_3,
|
|
1865
|
-
entries: entriesByGroup[g_3]
|
|
1866
|
-
});
|
|
1867
|
-
});
|
|
1868
|
-
if (hasPluginAdditionalCards && !allProcessed.some((g_4) => g_4.name === DEFAULT_GROUP_NAME)) {
|
|
1869
|
-
allProcessed.push({
|
|
1870
|
-
name: DEFAULT_GROUP_NAME,
|
|
1871
|
-
entries: []
|
|
1872
|
-
});
|
|
1873
|
-
}
|
|
1874
|
-
allProcessed = allProcessed.filter((g_5) => g_5.entries.length || g_5.name === DEFAULT_GROUP_NAME && hasPluginAdditionalCards);
|
|
1875
|
-
}
|
|
1876
|
-
const admin = allProcessed.find((g_6) => g_6.name === ADMIN_GROUP_NAME);
|
|
1877
|
-
return {
|
|
1878
|
-
adminGroupData: admin || null,
|
|
1879
|
-
items: allProcessed.filter((g_7) => g_7.name !== ADMIN_GROUP_NAME && !hiddenGroups?.includes(g_7.name))
|
|
1880
|
-
};
|
|
1881
|
-
}, [filteredNavigationEntries, performingSearch, groupOrderFromNavController, customizationController.resolvedSlots, hiddenGroups]);
|
|
1882
|
-
useEffect(() => {
|
|
1883
|
-
if (isDndDirtyRef.current) {
|
|
1884
|
-
return;
|
|
1885
|
-
}
|
|
1886
|
-
setAdminGroupData(processedGroups.adminGroupData);
|
|
1887
|
-
setItems(processedGroups.items);
|
|
1888
|
-
}, [processedGroups]);
|
|
1889
|
-
const updateItems = (updater) => {
|
|
1890
|
-
setItems(updater);
|
|
1891
|
-
};
|
|
1892
|
-
const persistNavigationGroups = (latest) => {
|
|
1893
|
-
isDndDirtyRef.current = true;
|
|
1894
|
-
if (dndDirtyTimeoutRef.current) {
|
|
1895
|
-
clearTimeout(dndDirtyTimeoutRef.current);
|
|
1896
|
-
}
|
|
1897
|
-
dndDirtyTimeoutRef.current = setTimeout(() => {
|
|
1898
|
-
isDndDirtyRef.current = false;
|
|
1899
|
-
}, 1e3);
|
|
1900
|
-
const draggable = latest.map((g_8) => ({
|
|
1901
|
-
name: g_8.name,
|
|
1902
|
-
entries: g_8.entries.map((e_5) => e_5.slug)
|
|
1903
|
-
}));
|
|
1904
|
-
const all = adminGroupData ? [...draggable, {
|
|
1905
|
-
name: adminGroupData.name,
|
|
1906
|
-
entries: adminGroupData.entries.map((e_6) => e_6.slug)
|
|
1907
|
-
}] : draggable;
|
|
1908
|
-
onNavigationEntriesUpdate(all);
|
|
1909
|
-
};
|
|
1910
|
-
const groupNames = useMemo(() => [...items.map((item) => item.name), ...adminGroupData ? [adminGroupData.name] : []], [items, adminGroupData]);
|
|
1911
|
-
const collapsedDefaults = useMemo(() => buildCollapsedDefaults(registry.cmsConfig?.navigationGroupMappings, "home"), [registry.cmsConfig?.navigationGroupMappings]);
|
|
1912
|
-
const {
|
|
1913
|
-
isGroupCollapsed,
|
|
1914
|
-
toggleGroupCollapsed
|
|
1915
|
-
} = useCollapsedGroups(groupNames, "home", collapsedDefaults);
|
|
1916
|
-
const {
|
|
1917
|
-
sensors,
|
|
1918
|
-
collisionDetection,
|
|
1919
|
-
onDragStart,
|
|
1920
|
-
onDragOver,
|
|
1921
|
-
onDragEnd,
|
|
1922
|
-
dropAnimation,
|
|
1923
|
-
activeItemForOverlay,
|
|
1924
|
-
activeGroupData,
|
|
1925
|
-
draggingGroupId,
|
|
1926
|
-
containers,
|
|
1927
|
-
dndKitActiveNode,
|
|
1928
|
-
onDragCancel,
|
|
1929
|
-
isDraggingCardOnly,
|
|
1930
|
-
dialogOpenForGroup,
|
|
1931
|
-
setDialogOpenForGroup,
|
|
1932
|
-
handleRenameGroup,
|
|
1933
|
-
handleDialogClose,
|
|
1934
|
-
isHoveringNewGroupDropZone,
|
|
1935
|
-
setIsHoveringNewGroupDropZone
|
|
1936
|
-
} = useHomePageDnd({
|
|
1937
|
-
items,
|
|
1938
|
-
setItems: updateItems,
|
|
1939
|
-
disabled: !allowDragAndDrop || performingSearch,
|
|
1940
|
-
onPersist: persistNavigationGroups,
|
|
1941
|
-
onGroupMoved: (g_9) => context.analyticsController?.onAnalyticsEvent?.("home_move_group", {
|
|
1942
|
-
name: g_9
|
|
1943
|
-
}),
|
|
1944
|
-
onCardMovedBetweenGroups: (card) => context.analyticsController?.onAnalyticsEvent?.("home_move_card", {
|
|
1945
|
-
id: card.id
|
|
1946
|
-
}),
|
|
1947
|
-
onNewGroupDrop: () => context.analyticsController?.onAnalyticsEvent?.("home_drop_new_group")
|
|
1948
|
-
});
|
|
1949
|
-
const {
|
|
1950
|
-
containerRef,
|
|
1951
|
-
direction
|
|
1952
|
-
} = useRestoreScroll();
|
|
1953
|
-
const dndDisabled = !allowDragAndDrop || performingSearch;
|
|
1954
|
-
const dndModifiers = dndKitActiveNode?.data.current?.type === "group" ? [restrictToVerticalAxis, restrictToWindowEdges] : [restrictToWindowEdges];
|
|
1955
|
-
const sectionProps = {
|
|
1956
|
-
context
|
|
1957
|
-
};
|
|
1958
|
-
const additionalPluginChildrenStart = useSlot("home.children.start", sectionProps);
|
|
1959
|
-
const additionalPluginChildrenEnd = useSlot("home.children.end", sectionProps);
|
|
1960
|
-
const additionalPluginActions = useSlot("home.actions", sectionProps);
|
|
1961
|
-
const homeCardContributions = useMemo(() => {
|
|
1962
|
-
return resolvedSlots.filter((s_0) => s_0.slot === "home.cards").sort((a10, b11) => (a10.order ?? 50) - (b11.order ?? 50));
|
|
1963
|
-
}, [resolvedSlots]);
|
|
1964
|
-
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "py-2 overflow-auto h-full w-full bg-surface-50 dark:bg-surface-800", children: [
|
|
1965
|
-
/* @__PURE__ */ jsxs(Container, { maxWidth: "6xl", children: [
|
|
1966
|
-
/* @__PURE__ */ jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsx(BootstrapAdminBanner, {}) }),
|
|
1967
|
-
/* @__PURE__ */ jsxs("div", { className: "w-full sticky py-4 transition-all duration-400 ease-in-out top-0 z-10 flex flex-row gap-4", style: {
|
|
1968
|
-
top: direction === "down" ? -84 : 0
|
|
1969
|
-
}, children: [
|
|
1970
|
-
/* @__PURE__ */ jsx(SearchBar, { onTextSearch: updateSearch, placeholder: t("search_collections"), autoFocus: true, size: "small", innerClassName: "w-full", className: "w-full grow" }),
|
|
1971
|
-
additionalActions,
|
|
1972
|
-
additionalPluginActions
|
|
1973
|
-
] }),
|
|
1974
|
-
/* @__PURE__ */ jsx(FavouritesView, { hidden: performingSearch }),
|
|
1975
|
-
additionalChildrenStart,
|
|
1976
|
-
additionalPluginChildrenStart,
|
|
1977
|
-
/* @__PURE__ */ jsxs(DndContext, { sensors, collisionDetection, measuring: {
|
|
1978
|
-
droppable: {
|
|
1979
|
-
strategy: MeasuringStrategy.Always,
|
|
1980
|
-
frequency: 500
|
|
1981
|
-
}
|
|
1982
|
-
}, onDragStart, onDragOver, onDragEnd, onDragCancel, modifiers: dndModifiers, children: [
|
|
1983
|
-
/* @__PURE__ */ jsx(SortableContext, { items: containers, strategy: verticalListSortingStrategy, children: items.map((groupData, groupIndex) => {
|
|
1984
|
-
const groupKey = groupData.name;
|
|
1985
|
-
const entriesInGroup = groupData.entries;
|
|
1986
|
-
const homeCardsProps = {
|
|
1987
|
-
group: groupKey === DEFAULT_GROUP_NAME ? void 0 : groupKey,
|
|
1988
|
-
context
|
|
1989
|
-
};
|
|
1990
|
-
const additionalCards = homeCardContributions.map((s_1, i2) => /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(s_1.Component, { ...homeCardsProps, ...s_1.props ?? {} }) }, `home_cards_${groupKey}_${i2}`));
|
|
1991
|
-
if (entriesInGroup.length === 0 && (additionalCards.length === 0 || performingSearch)) return null;
|
|
1992
|
-
return /* @__PURE__ */ jsx(SortableNavigationGroup, { groupName: groupKey, disabled: dndDisabled, children: /* @__PURE__ */ jsx(NavigationGroup, { group: groupKey === DEFAULT_GROUP_NAME ? void 0 : groupKey, minimised: draggingGroupId === groupKey && !isDraggingCardOnly, isPotentialCardDropTarget: isDraggingCardOnly, dndDisabled, onEditGroup: () => {
|
|
1993
|
-
if (dndDisabled) return;
|
|
1994
|
-
setDialogOpenForGroup(groupKey);
|
|
1995
|
-
}, collapsed: isGroupCollapsed(groupKey), onToggleCollapsed: () => toggleGroupCollapsed(groupKey), children: /* @__PURE__ */ jsx(NavigationGroupDroppable, { id: groupKey, itemIds: entriesInGroup.map((e_7) => e_7.url), isPotentialCardDropTarget: isDraggingCardOnly, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 ", children: [
|
|
1996
|
-
entriesInGroup.map((entry) => /* @__PURE__ */ jsx(SortableNavigationCard, { entry, onClick: () => {
|
|
1997
|
-
let event = "unmapped_event";
|
|
1998
|
-
if (entry.type === "collection") event = "home_navigate_to_collection";
|
|
1999
|
-
else if (entry.type === "view") event = "home_navigate_to_view";
|
|
2000
|
-
else if (entry.type === "admin") event = "home_navigate_to_admin_view";
|
|
2001
|
-
context.analyticsController?.onAnalyticsEvent?.(event, {
|
|
2002
|
-
path: entry.slug
|
|
2003
|
-
});
|
|
2004
|
-
} }, entry.url)),
|
|
2005
|
-
!performingSearch && groupKey.toLowerCase() !== ADMIN_GROUP_NAME.toLowerCase() && additionalCards
|
|
2006
|
-
] }) }) }) }, `group-${groupIndex}`);
|
|
2007
|
-
}) }, containers.join(",")),
|
|
2008
|
-
/* @__PURE__ */ jsx(NewGroupDropZone, { disabled: dndDisabled, setIsHovering: setIsHoveringNewGroupDropZone }),
|
|
2009
|
-
/* @__PURE__ */ jsx(DragOverlay, { adjustScale: false, dropAnimation, children: activeGroupData && draggingGroupId === activeGroupData.name ? /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-transparent", style: {
|
|
2010
|
-
padding: 0,
|
|
2011
|
-
margin: 0
|
|
2012
|
-
}, children: /* @__PURE__ */ jsx(NavigationGroup, { group: activeGroupData.name === DEFAULT_GROUP_NAME ? void 0 : activeGroupData.name, isPreview: false, minimised: true }) }) : activeItemForOverlay ? /* @__PURE__ */ jsx(NavigationCardBinding, { ...activeItemForOverlay, shrink: isHoveringNewGroupDropZone }) : null })
|
|
2013
|
-
] }),
|
|
2014
|
-
!performingSearch && adminGroupData && /* @__PURE__ */ jsx(NavigationGroup, { group: adminGroupData.name, collapsed: isGroupCollapsed(adminGroupData.name), onToggleCollapsed: () => toggleGroupCollapsed(adminGroupData.name), children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 ", children: adminGroupData.entries.map((entry_0) => /* @__PURE__ */ jsx(NavigationCardBinding, { ...entry_0, onClick: () => {
|
|
2015
|
-
let event_0 = "unmapped_event";
|
|
2016
|
-
if (entry_0.type === "collection") event_0 = "home_navigate_to_collection";
|
|
2017
|
-
else if (entry_0.type === "view") event_0 = "home_navigate_to_view";
|
|
2018
|
-
else if (entry_0.type === "admin") event_0 = "home_navigate_to_admin_view";
|
|
2019
|
-
context.analyticsController?.onAnalyticsEvent?.(event_0, {
|
|
2020
|
-
path: entry_0.slug
|
|
2021
|
-
});
|
|
2022
|
-
} }, entry_0.url)) }) }),
|
|
2023
|
-
sections && sections.map((section) => /* @__PURE__ */ jsx(NavigationGroup, { group: section.title, children: section.children }, section.key)),
|
|
2024
|
-
additionalPluginChildrenEnd,
|
|
2025
|
-
additionalChildrenEnd
|
|
2026
|
-
] }),
|
|
2027
|
-
dialogOpenForGroup && /* @__PURE__ */ jsx(RenameGroupDialog, { open: true, initialName: dialogOpenForGroup, existingGroupNames: items.map((g_10) => g_10.name).filter((n2) => n2 !== dialogOpenForGroup), onClose: handleDialogClose, onRename: (newName) => {
|
|
2028
|
-
handleRenameGroup(dialogOpenForGroup, newName);
|
|
2029
|
-
} })
|
|
2030
|
-
] });
|
|
2031
|
-
}
|
|
2032
|
-
function RebaseRoute() {
|
|
2033
|
-
const $2 = c2(57);
|
|
2034
|
-
const location = useLocation();
|
|
2035
|
-
const collectionRegistry = useCollectionRegistryController();
|
|
2036
|
-
const urlController = useUrlController();
|
|
2037
|
-
const breadcrumbs = useBreadcrumbsController();
|
|
2038
|
-
const userConfigPersistence = useUserConfigurationPersistence();
|
|
2039
|
-
const hash = location.hash;
|
|
2040
|
-
const isSidePanel = hash.includes("#side");
|
|
2041
|
-
let t0;
|
|
2042
|
-
if ($2[0] !== hash) {
|
|
2043
|
-
t0 = hash.includes("#new") || hash.includes("#new_side");
|
|
2044
|
-
$2[0] = hash;
|
|
2045
|
-
$2[1] = t0;
|
|
2046
|
-
} else {
|
|
2047
|
-
t0 = $2[1];
|
|
2048
|
-
}
|
|
2049
|
-
const isNew = t0;
|
|
2050
|
-
let t1;
|
|
2051
|
-
if ($2[2] !== hash) {
|
|
2052
|
-
t1 = hash.includes("#copy");
|
|
2053
|
-
$2[2] = hash;
|
|
2054
|
-
$2[3] = t1;
|
|
2055
|
-
} else {
|
|
2056
|
-
t1 = $2[3];
|
|
2057
|
-
}
|
|
2058
|
-
const isCopy = t1;
|
|
2059
|
-
const isFullScreen = hash.includes("#full");
|
|
2060
|
-
const pathname = location.pathname;
|
|
2061
|
-
let navigationEntries;
|
|
2062
|
-
let t2;
|
|
2063
|
-
let t3;
|
|
2064
|
-
let t4;
|
|
2065
|
-
if ($2[4] !== breadcrumbs || $2[5] !== collectionRegistry.collections || $2[6] !== pathname || $2[7] !== urlController) {
|
|
2066
|
-
const navigationPath = urlController.urlPathToDataPath(pathname);
|
|
2067
|
-
let t52;
|
|
2068
|
-
if ($2[12] !== collectionRegistry.collections) {
|
|
2069
|
-
t52 = collectionRegistry.collections ?? [];
|
|
2070
|
-
$2[12] = collectionRegistry.collections;
|
|
2071
|
-
$2[13] = t52;
|
|
2072
|
-
} else {
|
|
2073
|
-
t52 = $2[13];
|
|
2074
|
-
}
|
|
2075
|
-
navigationEntries = getNavigationEntriesFromPath({
|
|
2076
|
-
path: navigationPath,
|
|
2077
|
-
collections: t52
|
|
2078
|
-
});
|
|
2079
|
-
t3 = useEffect;
|
|
2080
|
-
t4 = () => {
|
|
2081
|
-
const lastEntry = navigationEntries[navigationEntries.length - 1];
|
|
2082
|
-
const isViewingCollection = lastEntry?.type === "collection";
|
|
2083
|
-
breadcrumbs.set({
|
|
2084
|
-
breadcrumbs: navigationEntries.map((entry, index) => {
|
|
2085
|
-
const isLastEntry = index === navigationEntries.length - 1;
|
|
2086
|
-
if (entry.type === "entity") {
|
|
2087
|
-
return {
|
|
2088
|
-
title: String(entry.entityId),
|
|
2089
|
-
url: urlController.buildUrlCollectionPath(entry.path)
|
|
2090
|
-
};
|
|
2091
|
-
} else {
|
|
2092
|
-
if (entry.type === "custom_view") {
|
|
2093
|
-
return {
|
|
2094
|
-
title: String(entry.view.name ?? entry.view.key),
|
|
2095
|
-
url: urlController.buildUrlCollectionPath(entry.path)
|
|
2096
|
-
};
|
|
2097
|
-
} else {
|
|
2098
|
-
if (entry.type === "collection") {
|
|
2099
|
-
const showCount = isLastEntry && isViewingCollection;
|
|
2100
|
-
return {
|
|
2101
|
-
title: entry.collection.name,
|
|
2102
|
-
url: urlController.buildUrlCollectionPath(entry.path),
|
|
2103
|
-
id: entry.path,
|
|
2104
|
-
...showCount ? {
|
|
2105
|
-
count: null
|
|
2106
|
-
} : {}
|
|
2107
|
-
};
|
|
2108
|
-
} else {
|
|
2109
|
-
throw new Error("Unexpected navigation entry type");
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
})
|
|
2114
|
-
});
|
|
2115
|
-
};
|
|
2116
|
-
t2 = navigationEntries.map(_temp).join(",");
|
|
2117
|
-
$2[4] = breadcrumbs;
|
|
2118
|
-
$2[5] = collectionRegistry.collections;
|
|
2119
|
-
$2[6] = pathname;
|
|
2120
|
-
$2[7] = urlController;
|
|
2121
|
-
$2[8] = navigationEntries;
|
|
2122
|
-
$2[9] = t2;
|
|
2123
|
-
$2[10] = t3;
|
|
2124
|
-
$2[11] = t4;
|
|
2125
|
-
} else {
|
|
2126
|
-
navigationEntries = $2[8];
|
|
2127
|
-
t2 = $2[9];
|
|
2128
|
-
t3 = $2[10];
|
|
2129
|
-
t4 = $2[11];
|
|
2130
|
-
}
|
|
2131
|
-
let t5;
|
|
2132
|
-
if ($2[14] !== t2) {
|
|
2133
|
-
t5 = [t2];
|
|
2134
|
-
$2[14] = t2;
|
|
2135
|
-
$2[15] = t5;
|
|
2136
|
-
} else {
|
|
2137
|
-
t5 = $2[15];
|
|
2138
|
-
}
|
|
2139
|
-
t3(t4, t5);
|
|
2140
|
-
if (isNew) {
|
|
2141
|
-
let t62;
|
|
2142
|
-
if ($2[16] !== navigationEntries || $2[17] !== pathname) {
|
|
2143
|
-
t62 = /* @__PURE__ */ jsx(EntityFullScreenRoute, { pathname, navigationEntries, isNew: true, isCopy: false });
|
|
2144
|
-
$2[16] = navigationEntries;
|
|
2145
|
-
$2[17] = pathname;
|
|
2146
|
-
$2[18] = t62;
|
|
2147
|
-
} else {
|
|
2148
|
-
t62 = $2[18];
|
|
2149
|
-
}
|
|
2150
|
-
return t62;
|
|
2151
|
-
}
|
|
2152
|
-
if (navigationEntries.length === 1 && navigationEntries[0].type === "collection") {
|
|
2153
|
-
let t62;
|
|
2154
|
-
let t72;
|
|
2155
|
-
if ($2[19] !== collectionRegistry || $2[20] !== navigationEntries[0].id || $2[21] !== navigationEntries[0].slug) {
|
|
2156
|
-
t72 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
2157
|
-
bb0: {
|
|
2158
|
-
let collection;
|
|
2159
|
-
collection = collectionRegistry.getCollection(navigationEntries[0].id);
|
|
2160
|
-
if (!collection) {
|
|
2161
|
-
collection = collectionRegistry.getCollection(navigationEntries[0].slug);
|
|
2162
|
-
}
|
|
2163
|
-
if (!collection) {
|
|
2164
|
-
if (!collectionRegistry.initialised) {
|
|
2165
|
-
let t82;
|
|
2166
|
-
if ($2[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2167
|
-
t82 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
|
|
2168
|
-
$2[24] = t82;
|
|
2169
|
-
} else {
|
|
2170
|
-
t82 = $2[24];
|
|
2171
|
-
}
|
|
2172
|
-
t72 = t82;
|
|
2173
|
-
break bb0;
|
|
2174
|
-
}
|
|
2175
|
-
t72 = null;
|
|
2176
|
-
break bb0;
|
|
2177
|
-
}
|
|
2178
|
-
let t8;
|
|
2179
|
-
let t9;
|
|
2180
|
-
if ($2[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2181
|
-
t8 = [];
|
|
2182
|
-
t9 = [];
|
|
2183
|
-
$2[25] = t8;
|
|
2184
|
-
$2[26] = t9;
|
|
2185
|
-
} else {
|
|
2186
|
-
t8 = $2[25];
|
|
2187
|
-
t9 = $2[26];
|
|
2188
|
-
}
|
|
2189
|
-
t62 = /* @__PURE__ */ jsx(EntityCollectionView, { ...collection, parentCollectionSlugs: t8, parentEntityIds: t9, path: collection.slug, updateUrl: true, Actions: toArray(collection.Actions) }, `collection_view_${collection.slug}`);
|
|
2190
|
-
}
|
|
2191
|
-
$2[19] = collectionRegistry;
|
|
2192
|
-
$2[20] = navigationEntries[0].id;
|
|
2193
|
-
$2[21] = navigationEntries[0].slug;
|
|
2194
|
-
$2[22] = t62;
|
|
2195
|
-
$2[23] = t72;
|
|
2196
|
-
} else {
|
|
2197
|
-
t62 = $2[22];
|
|
2198
|
-
t72 = $2[23];
|
|
2199
|
-
}
|
|
2200
|
-
if (t72 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
|
|
2201
|
-
return t72;
|
|
2202
|
-
}
|
|
2203
|
-
return t62;
|
|
2204
|
-
}
|
|
2205
|
-
if (isSidePanel) {
|
|
2206
|
-
const lastCollectionEntry = [...navigationEntries].reverse().find(_temp2);
|
|
2207
|
-
if (lastCollectionEntry) {
|
|
2208
|
-
let t62;
|
|
2209
|
-
let t72;
|
|
2210
|
-
if ($2[27] !== collectionRegistry || $2[28] !== navigationEntries[0]) {
|
|
2211
|
-
t72 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
2212
|
-
bb1: {
|
|
2213
|
-
let collection_0;
|
|
2214
|
-
const firstEntry = navigationEntries[0];
|
|
2215
|
-
collection_0 = collectionRegistry.getCollection(firstEntry.id);
|
|
2216
|
-
if (!collection_0) {
|
|
2217
|
-
collection_0 = collectionRegistry.getCollection(firstEntry.slug);
|
|
2218
|
-
}
|
|
2219
|
-
if (!collection_0) {
|
|
2220
|
-
if (!collectionRegistry.initialised) {
|
|
2221
|
-
let t82;
|
|
2222
|
-
if ($2[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2223
|
-
t82 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
|
|
2224
|
-
$2[31] = t82;
|
|
2225
|
-
} else {
|
|
2226
|
-
t82 = $2[31];
|
|
2227
|
-
}
|
|
2228
|
-
t72 = t82;
|
|
2229
|
-
break bb1;
|
|
2230
|
-
}
|
|
2231
|
-
t72 = null;
|
|
2232
|
-
break bb1;
|
|
2233
|
-
}
|
|
2234
|
-
let t8;
|
|
2235
|
-
let t9;
|
|
2236
|
-
if ($2[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2237
|
-
t8 = [];
|
|
2238
|
-
t9 = [];
|
|
2239
|
-
$2[32] = t8;
|
|
2240
|
-
$2[33] = t9;
|
|
2241
|
-
} else {
|
|
2242
|
-
t8 = $2[32];
|
|
2243
|
-
t9 = $2[33];
|
|
2244
|
-
}
|
|
2245
|
-
t62 = /* @__PURE__ */ jsx(EntityCollectionView, { ...collection_0, parentCollectionSlugs: t8, parentEntityIds: t9, path: collection_0.slug, updateUrl: true, Actions: toArray(collection_0.Actions) }, `collection_view_${collection_0.slug}`);
|
|
2246
|
-
}
|
|
2247
|
-
$2[27] = collectionRegistry;
|
|
2248
|
-
$2[28] = navigationEntries[0];
|
|
2249
|
-
$2[29] = t62;
|
|
2250
|
-
$2[30] = t72;
|
|
2251
|
-
} else {
|
|
2252
|
-
t62 = $2[29];
|
|
2253
|
-
t72 = $2[30];
|
|
2254
|
-
}
|
|
2255
|
-
if (t72 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
|
|
2256
|
-
return t72;
|
|
2257
|
-
}
|
|
2258
|
-
return t62;
|
|
2259
|
-
}
|
|
2260
|
-
}
|
|
2261
|
-
let t6;
|
|
2262
|
-
if ($2[34] !== navigationEntries) {
|
|
2263
|
-
t6 = navigationEntries.find(_temp3);
|
|
2264
|
-
$2[34] = navigationEntries;
|
|
2265
|
-
$2[35] = t6;
|
|
2266
|
-
} else {
|
|
2267
|
-
t6 = $2[35];
|
|
2268
|
-
}
|
|
2269
|
-
const lastEntityEntry = t6;
|
|
2270
|
-
const firstCollectionEntry = navigationEntries[0];
|
|
2271
|
-
if (!isFullScreen && !isCopy && firstCollectionEntry?.type === "collection" && lastEntityEntry?.type === "entity" && (navigationEntries.length === 2 || navigationEntries.length === 3)) {
|
|
2272
|
-
let t72;
|
|
2273
|
-
if ($2[36] !== collectionRegistry || $2[37] !== firstCollectionEntry.id || $2[38] !== firstCollectionEntry.slug || $2[39] !== lastEntityEntry || $2[40] !== location.search || $2[41] !== navigationEntries[2] || $2[42] !== navigationEntries.length || $2[43] !== pathname || $2[44] !== userConfigPersistence) {
|
|
2274
|
-
t72 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
2275
|
-
bb2: {
|
|
2276
|
-
let collection_1;
|
|
2277
|
-
collection_1 = collectionRegistry.getCollection(firstCollectionEntry.id);
|
|
2278
|
-
if (!collection_1) {
|
|
2279
|
-
collection_1 = collectionRegistry.getCollection(firstCollectionEntry.slug);
|
|
2280
|
-
}
|
|
2281
|
-
let effectiveOpenMode = collection_1?.openEntityMode;
|
|
2282
|
-
if (!effectiveOpenMode && collection_1) {
|
|
2283
|
-
const urlViewParam = new URLSearchParams(location.search).get("__view");
|
|
2284
|
-
let currentViewMode = collection_1.defaultViewMode ?? "list";
|
|
2285
|
-
if (urlViewParam && ["list", "table", "kanban", "cards"].includes(urlViewParam)) {
|
|
2286
|
-
currentViewMode = urlViewParam;
|
|
2287
|
-
} else {
|
|
2288
|
-
const savedView = userConfigPersistence?.getCollectionConfig(collection_1.slug)?.defaultViewMode;
|
|
2289
|
-
if (savedView) {
|
|
2290
|
-
currentViewMode = savedView;
|
|
2291
|
-
}
|
|
2292
|
-
}
|
|
2293
|
-
if (currentViewMode === "kanban") {
|
|
2294
|
-
effectiveOpenMode = "side_panel";
|
|
2295
|
-
} else {
|
|
2296
|
-
if (currentViewMode === "table" || currentViewMode === "cards") {
|
|
2297
|
-
effectiveOpenMode = "full_screen";
|
|
2298
|
-
} else {
|
|
2299
|
-
effectiveOpenMode = "split";
|
|
2300
|
-
}
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
if (collection_1 && effectiveOpenMode === "split") {
|
|
2304
|
-
let selectedTab;
|
|
2305
|
-
if (navigationEntries.length === 3) {
|
|
2306
|
-
const thirdEntry = navigationEntries[2];
|
|
2307
|
-
if (thirdEntry.type === "collection") {
|
|
2308
|
-
selectedTab = thirdEntry.collection.slug;
|
|
2309
|
-
} else {
|
|
2310
|
-
if (thirdEntry.type === "custom_view") {
|
|
2311
|
-
selectedTab = thirdEntry.view.key;
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
if (!selectedTab && navigationEntries.length === 2 && lastEntityEntry) {
|
|
2316
|
-
const entityIdStr = String(lastEntityEntry.entityId);
|
|
2317
|
-
const entityIdIdx = pathname.lastIndexOf(`/${entityIdStr}`);
|
|
2318
|
-
if (entityIdIdx >= 0) {
|
|
2319
|
-
let t82;
|
|
2320
|
-
if ($2[46] !== entityIdIdx || $2[47] !== entityIdStr.length || $2[48] !== pathname) {
|
|
2321
|
-
const afterEntity = pathname.substring(entityIdIdx + 1 + entityIdStr.length);
|
|
2322
|
-
t82 = afterEntity.startsWith("/") ? afterEntity.substring(1) : afterEntity;
|
|
2323
|
-
$2[46] = entityIdIdx;
|
|
2324
|
-
$2[47] = entityIdStr.length;
|
|
2325
|
-
$2[48] = pathname;
|
|
2326
|
-
$2[49] = t82;
|
|
2327
|
-
} else {
|
|
2328
|
-
t82 = $2[49];
|
|
2329
|
-
}
|
|
2330
|
-
const trailingSegment = t82;
|
|
2331
|
-
if (trailingSegment.length > 0) {
|
|
2332
|
-
selectedTab = trailingSegment;
|
|
2333
|
-
}
|
|
2334
|
-
}
|
|
2335
|
-
}
|
|
2336
|
-
let t8;
|
|
2337
|
-
let t9;
|
|
2338
|
-
if ($2[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2339
|
-
t8 = [];
|
|
2340
|
-
t9 = [];
|
|
2341
|
-
$2[50] = t8;
|
|
2342
|
-
$2[51] = t9;
|
|
2343
|
-
} else {
|
|
2344
|
-
t8 = $2[50];
|
|
2345
|
-
t9 = $2[51];
|
|
2346
|
-
}
|
|
2347
|
-
t72 = /* @__PURE__ */ jsx(EntityCollectionView, { ...collection_1, parentCollectionSlugs: t8, parentEntityIds: t9, path: collection_1.slug, updateUrl: true, selectedEntityId: lastEntityEntry.entityId, selectedTab, Actions: toArray(collection_1.Actions) }, `collection_view_${collection_1.slug}`);
|
|
2348
|
-
break bb2;
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
$2[36] = collectionRegistry;
|
|
2352
|
-
$2[37] = firstCollectionEntry.id;
|
|
2353
|
-
$2[38] = firstCollectionEntry.slug;
|
|
2354
|
-
$2[39] = lastEntityEntry;
|
|
2355
|
-
$2[40] = location.search;
|
|
2356
|
-
$2[41] = navigationEntries[2];
|
|
2357
|
-
$2[42] = navigationEntries.length;
|
|
2358
|
-
$2[43] = pathname;
|
|
2359
|
-
$2[44] = userConfigPersistence;
|
|
2360
|
-
$2[45] = t72;
|
|
2361
|
-
} else {
|
|
2362
|
-
t72 = $2[45];
|
|
2363
|
-
}
|
|
2364
|
-
if (t72 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
|
|
2365
|
-
return t72;
|
|
2366
|
-
}
|
|
2367
|
-
}
|
|
2368
|
-
let t7;
|
|
2369
|
-
if ($2[52] !== isCopy || $2[53] !== isNew || $2[54] !== navigationEntries || $2[55] !== pathname) {
|
|
2370
|
-
t7 = /* @__PURE__ */ jsx(EntityFullScreenRoute, { pathname, navigationEntries, isNew, isCopy });
|
|
2371
|
-
$2[52] = isCopy;
|
|
2372
|
-
$2[53] = isNew;
|
|
2373
|
-
$2[54] = navigationEntries;
|
|
2374
|
-
$2[55] = pathname;
|
|
2375
|
-
$2[56] = t7;
|
|
2376
|
-
} else {
|
|
2377
|
-
t7 = $2[56];
|
|
2378
|
-
}
|
|
2379
|
-
return t7;
|
|
2380
|
-
}
|
|
2381
|
-
function _temp3(entry_2) {
|
|
2382
|
-
return entry_2.type === "entity";
|
|
2383
|
-
}
|
|
2384
|
-
function _temp2(entry_1) {
|
|
2385
|
-
return entry_1.type === "collection";
|
|
2386
|
-
}
|
|
2387
|
-
function _temp(entry_0) {
|
|
2388
|
-
return entry_0.path;
|
|
2389
|
-
}
|
|
2390
|
-
function getSelectedTabFromUrl(isNew, lastCustomView) {
|
|
2391
|
-
if (isNew) {
|
|
2392
|
-
return void 0;
|
|
2393
|
-
} else if (lastCustomView) {
|
|
2394
|
-
if (lastCustomView.type === "custom_view") {
|
|
2395
|
-
return lastCustomView.view.key;
|
|
2396
|
-
} else if (lastCustomView.type === "collection") {
|
|
2397
|
-
return lastCustomView.id ?? lastCustomView.slug;
|
|
2398
|
-
}
|
|
2399
|
-
}
|
|
2400
|
-
return void 0;
|
|
2401
|
-
}
|
|
2402
|
-
function EntityFullScreenRoute(t0) {
|
|
2403
|
-
const $2 = c2(80);
|
|
2404
|
-
const {
|
|
2405
|
-
pathname,
|
|
2406
|
-
navigationEntries,
|
|
2407
|
-
isNew,
|
|
2408
|
-
isCopy
|
|
2409
|
-
} = t0;
|
|
2410
|
-
const collectionRegistry = useCollectionRegistryController();
|
|
2411
|
-
const urlController = useUrlController();
|
|
2412
|
-
const navigate = useNavigate();
|
|
2413
|
-
const location = useLocation();
|
|
2414
|
-
const defaultValues = location.state?.defaultValues;
|
|
2415
|
-
const hash = location.hash;
|
|
2416
|
-
const navigationPath = urlController.urlPathToDataPath(pathname);
|
|
2417
|
-
const blocked = useRef(false);
|
|
2418
|
-
const lastEntityEntry = [...navigationEntries].reverse().find(_temp4);
|
|
2419
|
-
const navigationEntriesAfterEntity = lastEntityEntry ? navigationEntries.slice(navigationEntries.indexOf(lastEntityEntry) + 1) : [];
|
|
2420
|
-
const lastCustomView = [...navigationEntriesAfterEntity].reverse().find(_temp5);
|
|
2421
|
-
const entityId = lastEntityEntry && "entityId" in lastEntityEntry ? lastEntityEntry.entityId : void 0;
|
|
2422
|
-
let urlTab;
|
|
2423
|
-
urlTab = getSelectedTabFromUrl(isNew, lastCustomView);
|
|
2424
|
-
if (!urlTab && entityId && !isNew) {
|
|
2425
|
-
const entityIdStr = String(entityId);
|
|
2426
|
-
const entityIdIdx = pathname.lastIndexOf(`/${entityIdStr}`);
|
|
2427
|
-
if (entityIdIdx >= 0) {
|
|
2428
|
-
const afterEntity = pathname.substring(entityIdIdx + 1 + entityIdStr.length);
|
|
2429
|
-
const trailingSegment = afterEntity.startsWith("/") ? afterEntity.substring(1) : afterEntity;
|
|
2430
|
-
if (trailingSegment.length > 0 && trailingSegment !== "edit") {
|
|
2431
|
-
urlTab = trailingSegment;
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
}
|
|
2435
|
-
const [selectedTab, setSelectedTab] = useState(urlTab);
|
|
2436
|
-
const parentCollectionSlugs = collectionRegistry.getParentCollectionSlugs(navigationPath);
|
|
2437
|
-
const parentEntityIds = collectionRegistry.getParentEntityIds(navigationPath);
|
|
2438
|
-
let t1;
|
|
2439
|
-
if ($2[0] !== selectedTab || $2[1] !== setSelectedTab || $2[2] !== urlTab) {
|
|
2440
|
-
t1 = () => {
|
|
2441
|
-
if (urlTab !== selectedTab) {
|
|
2442
|
-
setSelectedTab(urlTab);
|
|
2443
|
-
}
|
|
2444
|
-
};
|
|
2445
|
-
$2[0] = selectedTab;
|
|
2446
|
-
$2[1] = setSelectedTab;
|
|
2447
|
-
$2[2] = urlTab;
|
|
2448
|
-
$2[3] = t1;
|
|
2449
|
-
} else {
|
|
2450
|
-
t1 = $2[3];
|
|
2451
|
-
}
|
|
2452
|
-
const t2 = urlTab;
|
|
2453
|
-
let t3;
|
|
2454
|
-
if ($2[4] !== t2) {
|
|
2455
|
-
t3 = [t2];
|
|
2456
|
-
$2[4] = t2;
|
|
2457
|
-
$2[5] = t3;
|
|
2458
|
-
} else {
|
|
2459
|
-
t3 = $2[5];
|
|
2460
|
-
}
|
|
2461
|
-
useEffect(t1, t3);
|
|
2462
|
-
let t4;
|
|
2463
|
-
if ($2[6] !== entityId || $2[7] !== isNew || $2[8] !== pathname) {
|
|
2464
|
-
t4 = !entityId || isNew ? pathname : pathname.substring(0, pathname.lastIndexOf(`/${entityId}`));
|
|
2465
|
-
$2[6] = entityId;
|
|
2466
|
-
$2[7] = isNew;
|
|
2467
|
-
$2[8] = pathname;
|
|
2468
|
-
$2[9] = t4;
|
|
2469
|
-
} else {
|
|
2470
|
-
t4 = $2[9];
|
|
2471
|
-
}
|
|
2472
|
-
const basePath = t4;
|
|
2473
|
-
const entityPath = basePath + `/${entityId}`;
|
|
2474
|
-
let t5;
|
|
2475
|
-
if ($2[10] !== basePath || $2[11] !== entityPath) {
|
|
2476
|
-
t5 = (t62) => {
|
|
2477
|
-
const {
|
|
2478
|
-
currentLocation,
|
|
2479
|
-
nextLocation
|
|
2480
|
-
} = t62;
|
|
2481
|
-
if (nextLocation.pathname.startsWith(entityPath)) {
|
|
2482
|
-
return false;
|
|
2483
|
-
}
|
|
2484
|
-
const nextHash = nextLocation.hash;
|
|
2485
|
-
if (nextHash === "#side" || nextHash === "#new_side") {
|
|
2486
|
-
return false;
|
|
2487
|
-
}
|
|
2488
|
-
const currentHash = currentLocation.hash;
|
|
2489
|
-
if ((currentHash === "#side" || currentHash === "#new_side") && (nextLocation.pathname === basePath || nextLocation.pathname.startsWith(entityPath))) {
|
|
2490
|
-
return false;
|
|
2491
|
-
}
|
|
2492
|
-
return blocked.current;
|
|
2493
|
-
};
|
|
2494
|
-
$2[10] = basePath;
|
|
2495
|
-
$2[11] = entityPath;
|
|
2496
|
-
$2[12] = t5;
|
|
2497
|
-
} else {
|
|
2498
|
-
t5 = $2[12];
|
|
2499
|
-
}
|
|
2500
|
-
const blocker = useBlocker(t5);
|
|
2501
|
-
const lastCollectionEntry = [...navigationEntries].reverse().find(_temp6);
|
|
2502
|
-
if (isNew && !lastCollectionEntry) {
|
|
2503
|
-
if (!collectionRegistry.initialised) {
|
|
2504
|
-
let t62;
|
|
2505
|
-
if ($2[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2506
|
-
t62 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
|
|
2507
|
-
$2[13] = t62;
|
|
2508
|
-
} else {
|
|
2509
|
-
t62 = $2[13];
|
|
2510
|
-
}
|
|
2511
|
-
return t62;
|
|
2512
|
-
}
|
|
2513
|
-
throw new Error("INTERNAL: No collection found in the navigation");
|
|
2514
|
-
}
|
|
2515
|
-
if (!isNew && !lastEntityEntry) {
|
|
2516
|
-
if (!collectionRegistry.initialised) {
|
|
2517
|
-
let t63;
|
|
2518
|
-
if ($2[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2519
|
-
t63 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
|
|
2520
|
-
$2[14] = t63;
|
|
2521
|
-
} else {
|
|
2522
|
-
t63 = $2[14];
|
|
2523
|
-
}
|
|
2524
|
-
return t63;
|
|
2525
|
-
}
|
|
2526
|
-
let t62;
|
|
2527
|
-
if ($2[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2528
|
-
t62 = /* @__PURE__ */ jsx(NotFoundPage, {});
|
|
2529
|
-
$2[15] = t62;
|
|
2530
|
-
} else {
|
|
2531
|
-
t62 = $2[15];
|
|
2532
|
-
}
|
|
2533
|
-
return t62;
|
|
2534
|
-
}
|
|
2535
|
-
const rawCollection = isNew ? lastCollectionEntry && "collection" in lastCollectionEntry ? lastCollectionEntry.collection : void 0 : lastEntityEntry && "parentCollection" in lastEntityEntry ? lastEntityEntry.parentCollection : void 0;
|
|
2536
|
-
const collection = collectionRegistry.getCollection(rawCollection.slug) || rawCollection;
|
|
2537
|
-
const fullIdPath = isNew ? lastCollectionEntry.slug : lastEntityEntry.slug;
|
|
2538
|
-
const collectionPath = urlController.resolveDatabasePathsFrom(fullIdPath);
|
|
2539
|
-
const isEditRoute = pathname.endsWith("/edit") || pathname.split("/").pop() === "edit";
|
|
2540
|
-
const isDetailMode = collection.defaultEntityAction === "view" && !isNew && !isCopy && entityId && !isEditRoute;
|
|
2541
|
-
if (isDetailMode) {
|
|
2542
|
-
const t62 = collection.slug + "_view_" + entityId;
|
|
2543
|
-
const t72 = selectedTab ?? void 0;
|
|
2544
|
-
let t82;
|
|
2545
|
-
if ($2[16] !== collectionPath || $2[17] !== entityId || $2[18] !== hash || $2[19] !== navigate || $2[20] !== urlController) {
|
|
2546
|
-
t82 = () => {
|
|
2547
|
-
const editUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`) + "/edit";
|
|
2548
|
-
navigate(editUrl + hash);
|
|
2549
|
-
};
|
|
2550
|
-
$2[16] = collectionPath;
|
|
2551
|
-
$2[17] = entityId;
|
|
2552
|
-
$2[18] = hash;
|
|
2553
|
-
$2[19] = navigate;
|
|
2554
|
-
$2[20] = urlController;
|
|
2555
|
-
$2[21] = t82;
|
|
2556
|
-
} else {
|
|
2557
|
-
t82 = $2[21];
|
|
2558
|
-
}
|
|
2559
|
-
let t92;
|
|
2560
|
-
if ($2[22] !== basePath || $2[23] !== entityId || $2[24] !== hash || $2[25] !== navigate || $2[26] !== setSelectedTab) {
|
|
2561
|
-
t92 = (params) => {
|
|
2562
|
-
setSelectedTab(params.selectedTab);
|
|
2563
|
-
const newSelectedTab = params.selectedTab;
|
|
2564
|
-
if (newSelectedTab) {
|
|
2565
|
-
navigate(`${basePath}/${entityId}/${newSelectedTab}${hash}`, {
|
|
2566
|
-
replace: true
|
|
2567
|
-
});
|
|
2568
|
-
} else {
|
|
2569
|
-
navigate(`${basePath}/${entityId}${hash}`, {
|
|
2570
|
-
replace: true
|
|
2571
|
-
});
|
|
2572
|
-
}
|
|
2573
|
-
};
|
|
2574
|
-
$2[22] = basePath;
|
|
2575
|
-
$2[23] = entityId;
|
|
2576
|
-
$2[24] = hash;
|
|
2577
|
-
$2[25] = navigate;
|
|
2578
|
-
$2[26] = setSelectedTab;
|
|
2579
|
-
$2[27] = t92;
|
|
2580
|
-
} else {
|
|
2581
|
-
t92 = $2[27];
|
|
2582
|
-
}
|
|
2583
|
-
let t102;
|
|
2584
|
-
if ($2[28] !== collection || $2[29] !== collectionPath || $2[30] !== entityId || $2[31] !== parentCollectionSlugs || $2[32] !== parentEntityIds || $2[33] !== t62 || $2[34] !== t72 || $2[35] !== t82 || $2[36] !== t92) {
|
|
2585
|
-
t102 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(EntityDetailView, { entityId, collection, layout: "full_screen", path: collectionPath, selectedTab: t72, onEditClick: t82, onTabChange: t92, parentCollectionSlugs, parentEntityIds }, t62) });
|
|
2586
|
-
$2[28] = collection;
|
|
2587
|
-
$2[29] = collectionPath;
|
|
2588
|
-
$2[30] = entityId;
|
|
2589
|
-
$2[31] = parentCollectionSlugs;
|
|
2590
|
-
$2[32] = parentEntityIds;
|
|
2591
|
-
$2[33] = t62;
|
|
2592
|
-
$2[34] = t72;
|
|
2593
|
-
$2[35] = t82;
|
|
2594
|
-
$2[36] = t92;
|
|
2595
|
-
$2[37] = t102;
|
|
2596
|
-
} else {
|
|
2597
|
-
t102 = $2[37];
|
|
2598
|
-
}
|
|
2599
|
-
return t102;
|
|
2600
|
-
}
|
|
2601
|
-
const t6 = collection.slug + "_" + (isNew ? "new" : isCopy ? entityId + "_copy" : entityId);
|
|
2602
|
-
const t7 = isNew ? void 0 : entityId;
|
|
2603
|
-
const t8 = selectedTab ?? void 0;
|
|
2604
|
-
const t9 = isNew ? defaultValues : void 0;
|
|
2605
|
-
let t10;
|
|
2606
|
-
if ($2[38] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2607
|
-
t10 = (modified) => blocked.current = modified;
|
|
2608
|
-
$2[38] = t10;
|
|
2609
|
-
} else {
|
|
2610
|
-
t10 = $2[38];
|
|
2611
|
-
}
|
|
2612
|
-
let t11;
|
|
2613
|
-
if ($2[39] !== collectionPath || $2[40] !== entityId || $2[41] !== hash || $2[42] !== navigate || $2[43] !== urlController) {
|
|
2614
|
-
t11 = () => {
|
|
2615
|
-
const detailUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`);
|
|
2616
|
-
navigate(detailUrl + hash);
|
|
2617
|
-
};
|
|
2618
|
-
$2[39] = collectionPath;
|
|
2619
|
-
$2[40] = entityId;
|
|
2620
|
-
$2[41] = hash;
|
|
2621
|
-
$2[42] = navigate;
|
|
2622
|
-
$2[43] = urlController;
|
|
2623
|
-
$2[44] = t11;
|
|
2624
|
-
} else {
|
|
2625
|
-
t11 = $2[44];
|
|
2626
|
-
}
|
|
2627
|
-
let t12;
|
|
2628
|
-
if ($2[45] !== basePath || $2[46] !== hash || $2[47] !== isNew || $2[48] !== navigate) {
|
|
2629
|
-
t12 = (params_0) => {
|
|
2630
|
-
const newSelectedTab_0 = params_0.selectedTab;
|
|
2631
|
-
const newEntityId = params_0.entityId;
|
|
2632
|
-
const savedHash = isNew ? "" : hash;
|
|
2633
|
-
if (newSelectedTab_0) {
|
|
2634
|
-
navigate(`${basePath}/${newEntityId}/${newSelectedTab_0}${savedHash}`, {
|
|
2635
|
-
replace: true
|
|
2636
|
-
});
|
|
2637
|
-
} else {
|
|
2638
|
-
navigate(`${basePath}/${newEntityId}${savedHash}`, {
|
|
2639
|
-
replace: true
|
|
2640
|
-
});
|
|
2641
|
-
}
|
|
2642
|
-
};
|
|
2643
|
-
$2[45] = basePath;
|
|
2644
|
-
$2[46] = hash;
|
|
2645
|
-
$2[47] = isNew;
|
|
2646
|
-
$2[48] = navigate;
|
|
2647
|
-
$2[49] = t12;
|
|
2648
|
-
} else {
|
|
2649
|
-
t12 = $2[49];
|
|
2650
|
-
}
|
|
2651
|
-
let t13;
|
|
2652
|
-
if ($2[50] !== basePath || $2[51] !== entityId || $2[52] !== hash || $2[53] !== isNew || $2[54] !== navigate || $2[55] !== setSelectedTab) {
|
|
2653
|
-
t13 = (params_1) => {
|
|
2654
|
-
setSelectedTab(params_1.selectedTab);
|
|
2655
|
-
if (isNew) {
|
|
2656
|
-
return;
|
|
2657
|
-
}
|
|
2658
|
-
const newSelectedTab_1 = params_1.selectedTab;
|
|
2659
|
-
if (newSelectedTab_1) {
|
|
2660
|
-
navigate(`${basePath}/${entityId}/${newSelectedTab_1}${hash}`, {
|
|
2661
|
-
replace: true
|
|
2662
|
-
});
|
|
2663
|
-
} else {
|
|
2664
|
-
navigate(`${basePath}/${entityId}${hash}`, {
|
|
2665
|
-
replace: true
|
|
2666
|
-
});
|
|
2667
|
-
}
|
|
2668
|
-
};
|
|
2669
|
-
$2[50] = basePath;
|
|
2670
|
-
$2[51] = entityId;
|
|
2671
|
-
$2[52] = hash;
|
|
2672
|
-
$2[53] = isNew;
|
|
2673
|
-
$2[54] = navigate;
|
|
2674
|
-
$2[55] = setSelectedTab;
|
|
2675
|
-
$2[56] = t13;
|
|
2676
|
-
} else {
|
|
2677
|
-
t13 = $2[56];
|
|
2678
|
-
}
|
|
2679
|
-
let t14;
|
|
2680
|
-
if ($2[57] !== collection || $2[58] !== collectionPath || $2[59] !== isCopy || $2[60] !== parentCollectionSlugs || $2[61] !== parentEntityIds || $2[62] !== t11 || $2[63] !== t12 || $2[64] !== t13 || $2[65] !== t6 || $2[66] !== t7 || $2[67] !== t8 || $2[68] !== t9) {
|
|
2681
|
-
t14 = /* @__PURE__ */ jsx(EntityEditView, { entityId: t7, collection, layout: "full_screen", path: collectionPath, copy: isCopy, selectedTab: t8, defaultValues: t9, onValuesModified: t10, navigateBack: t11, onSaved: t12, onTabChange: t13, parentCollectionSlugs, parentEntityIds }, t6);
|
|
2682
|
-
$2[57] = collection;
|
|
2683
|
-
$2[58] = collectionPath;
|
|
2684
|
-
$2[59] = isCopy;
|
|
2685
|
-
$2[60] = parentCollectionSlugs;
|
|
2686
|
-
$2[61] = parentEntityIds;
|
|
2687
|
-
$2[62] = t11;
|
|
2688
|
-
$2[63] = t12;
|
|
2689
|
-
$2[64] = t13;
|
|
2690
|
-
$2[65] = t6;
|
|
2691
|
-
$2[66] = t7;
|
|
2692
|
-
$2[67] = t8;
|
|
2693
|
-
$2[68] = t9;
|
|
2694
|
-
$2[69] = t14;
|
|
2695
|
-
} else {
|
|
2696
|
-
t14 = $2[69];
|
|
2697
|
-
}
|
|
2698
|
-
const t15 = blocker?.state === "blocked";
|
|
2699
|
-
let t16;
|
|
2700
|
-
let t17;
|
|
2701
|
-
if ($2[70] !== blocker) {
|
|
2702
|
-
t16 = () => blocker?.proceed?.();
|
|
2703
|
-
t17 = () => blocker?.reset?.();
|
|
2704
|
-
$2[70] = blocker;
|
|
2705
|
-
$2[71] = t16;
|
|
2706
|
-
$2[72] = t17;
|
|
2707
|
-
} else {
|
|
2708
|
-
t16 = $2[71];
|
|
2709
|
-
t17 = $2[72];
|
|
2710
|
-
}
|
|
2711
|
-
let t18;
|
|
2712
|
-
if ($2[73] !== t15 || $2[74] !== t16 || $2[75] !== t17) {
|
|
2713
|
-
t18 = /* @__PURE__ */ jsx(UnsavedChangesDialog, { open: t15, handleOk: t16, handleCancel: t17, body: "You have unsaved changes in this entity." });
|
|
2714
|
-
$2[73] = t15;
|
|
2715
|
-
$2[74] = t16;
|
|
2716
|
-
$2[75] = t17;
|
|
2717
|
-
$2[76] = t18;
|
|
2718
|
-
} else {
|
|
2719
|
-
t18 = $2[76];
|
|
2720
|
-
}
|
|
2721
|
-
let t19;
|
|
2722
|
-
if ($2[77] !== t14 || $2[78] !== t18) {
|
|
2723
|
-
t19 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2724
|
-
t14,
|
|
2725
|
-
t18
|
|
2726
|
-
] });
|
|
2727
|
-
$2[77] = t14;
|
|
2728
|
-
$2[78] = t18;
|
|
2729
|
-
$2[79] = t19;
|
|
2730
|
-
} else {
|
|
2731
|
-
t19 = $2[79];
|
|
2732
|
-
}
|
|
2733
|
-
return t19;
|
|
2734
|
-
}
|
|
2735
|
-
function _temp6(entry_1) {
|
|
2736
|
-
return entry_1.type === "collection";
|
|
2737
|
-
}
|
|
2738
|
-
function _temp5(entry_0) {
|
|
2739
|
-
return entry_0.type === "custom_view" || entry_0.type === "collection";
|
|
2740
|
-
}
|
|
2741
|
-
function _temp4(entry) {
|
|
2742
|
-
return entry.type === "entity";
|
|
2743
|
-
}
|
|
2744
|
-
function CustomViewRoute(t0) {
|
|
2745
|
-
const $2 = c2(8);
|
|
2746
|
-
const {
|
|
2747
|
-
view
|
|
2748
|
-
} = t0;
|
|
2749
|
-
const breadcrumbs = useBreadcrumbsController();
|
|
2750
|
-
const urlController = useUrlController();
|
|
2751
|
-
let t1;
|
|
2752
|
-
if ($2[0] !== breadcrumbs || $2[1] !== urlController || $2[2] !== view.name || $2[3] !== view.slug) {
|
|
2753
|
-
t1 = () => {
|
|
2754
|
-
breadcrumbs.set({
|
|
2755
|
-
breadcrumbs: [{
|
|
2756
|
-
title: view.name,
|
|
2757
|
-
url: urlController.buildAppUrlPath(view.slug)
|
|
2758
|
-
}]
|
|
2759
|
-
});
|
|
2760
|
-
};
|
|
2761
|
-
$2[0] = breadcrumbs;
|
|
2762
|
-
$2[1] = urlController;
|
|
2763
|
-
$2[2] = view.name;
|
|
2764
|
-
$2[3] = view.slug;
|
|
2765
|
-
$2[4] = t1;
|
|
2766
|
-
} else {
|
|
2767
|
-
t1 = $2[4];
|
|
2768
|
-
}
|
|
2769
|
-
let t2;
|
|
2770
|
-
if ($2[5] !== urlController || $2[6] !== view.slug) {
|
|
2771
|
-
t2 = [view.slug, urlController];
|
|
2772
|
-
$2[5] = urlController;
|
|
2773
|
-
$2[6] = view.slug;
|
|
2774
|
-
$2[7] = t2;
|
|
2775
|
-
} else {
|
|
2776
|
-
t2 = $2[7];
|
|
2777
|
-
}
|
|
2778
|
-
useEffect(t1, t2);
|
|
2779
|
-
return view.view;
|
|
2780
|
-
}
|
|
2781
|
-
function SettingsView() {
|
|
2782
|
-
const $2 = c2(5);
|
|
2783
|
-
const {
|
|
2784
|
-
t
|
|
2785
|
-
} = useTranslation();
|
|
2786
|
-
const breadcrumbs = useBreadcrumbsController();
|
|
2787
|
-
let t0;
|
|
2788
|
-
if ($2[0] !== breadcrumbs || $2[1] !== t) {
|
|
2789
|
-
t0 = () => {
|
|
2790
|
-
breadcrumbs.set({
|
|
2791
|
-
breadcrumbs: [{
|
|
2792
|
-
title: t("account_settings"),
|
|
2793
|
-
url: "/settings"
|
|
2794
|
-
}]
|
|
2795
|
-
});
|
|
2796
|
-
};
|
|
2797
|
-
$2[0] = breadcrumbs;
|
|
2798
|
-
$2[1] = t;
|
|
2799
|
-
$2[2] = t0;
|
|
2800
|
-
} else {
|
|
2801
|
-
t0 = $2[2];
|
|
2802
|
-
}
|
|
2803
|
-
let t1;
|
|
2804
|
-
if ($2[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2805
|
-
t1 = [];
|
|
2806
|
-
$2[3] = t1;
|
|
2807
|
-
} else {
|
|
2808
|
-
t1 = $2[3];
|
|
2809
|
-
}
|
|
2810
|
-
useEffect(t0, t1);
|
|
2811
|
-
let t2;
|
|
2812
|
-
if ($2[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2813
|
-
t2 = /* @__PURE__ */ jsx(UserSettingsView, {});
|
|
2814
|
-
$2[4] = t2;
|
|
2815
|
-
} else {
|
|
2816
|
-
t2 = $2[4];
|
|
2817
|
-
}
|
|
2818
|
-
return t2;
|
|
2819
|
-
}
|
|
2820
|
-
function RebaseRouteDefs({
|
|
2821
|
-
children,
|
|
2822
|
-
layout
|
|
2823
|
-
}) {
|
|
2824
|
-
const registry = useRebaseRegistry();
|
|
2825
|
-
const navigationStateController = useNavigationStateController();
|
|
2826
|
-
const cmsHomePage = registry.cmsConfig?.homePage ?? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(CircularProgressCenter, {}), children: /* @__PURE__ */ jsx(ContentHomePage, {}) });
|
|
2827
|
-
const studioHomePage = registry.studioConfig?.homePage;
|
|
2828
|
-
const combinedViews = useMemo(() => [...navigationStateController.views ?? [], ...navigationStateController.adminViews ?? []], [navigationStateController.views, navigationStateController.adminViews]);
|
|
2829
|
-
const routeContents = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2830
|
-
/* @__PURE__ */ jsx(Route, { path: "/", element: cmsHomePage }),
|
|
2831
|
-
registry.studioConfig && /* @__PURE__ */ jsx(Route, { path: "/s", element: studioHomePage }),
|
|
2832
|
-
/* @__PURE__ */ jsx(Route, { path: "/c/*", element: /* @__PURE__ */ jsx(RebaseRoute, {}) }),
|
|
2833
|
-
/* @__PURE__ */ jsx(Route, { path: "/settings", element: /* @__PURE__ */ jsx(SettingsView, {}) }),
|
|
2834
|
-
/* @__PURE__ */ jsx(Route, { path: "/debug/ui", element: /* @__PURE__ */ jsx(UIReferenceView, {}) }),
|
|
2835
|
-
combinedViews.map((view) => {
|
|
2836
|
-
const slugs = Array.isArray(view.slug) ? view.slug : [view.slug];
|
|
2837
|
-
return slugs.flatMap((slug) => {
|
|
2838
|
-
const routes = [/* @__PURE__ */ jsx(Route, { path: slug, element: /* @__PURE__ */ jsx(CustomViewRoute, { view }) }, slug)];
|
|
2839
|
-
if (view.nestedRoutes) {
|
|
2840
|
-
routes.push(/* @__PURE__ */ jsx(Route, { path: slug + "/*", element: /* @__PURE__ */ jsx(CustomViewRoute, { view }) }, slug + "/*"));
|
|
2841
|
-
}
|
|
2842
|
-
return routes;
|
|
2843
|
-
});
|
|
2844
|
-
}),
|
|
2845
|
-
children,
|
|
2846
|
-
/* @__PURE__ */ jsx(Route, { path: "*", element: navigationStateController.loading ? /* @__PURE__ */ jsx(CircularProgressCenter, {}) : /* @__PURE__ */ jsx(NotFoundPage, {}) })
|
|
2847
|
-
] });
|
|
2848
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2849
|
-
/* @__PURE__ */ jsx(RebaseRoutes, { children: layout ? /* @__PURE__ */ jsx(Route, { element: layout, children: routeContents }) : /* @__PURE__ */ jsx(Route, { element: /* @__PURE__ */ jsx(Fragment, { children: routeContents }), children: routeContents }) }),
|
|
2850
|
-
/* @__PURE__ */ jsx(CollectionEditorDialogs, {})
|
|
2851
|
-
] });
|
|
2852
|
-
}
|
|
2853
|
-
function RebaseShell(props) {
|
|
2854
|
-
const $2 = c2(11);
|
|
2855
|
-
const {
|
|
2856
|
-
title: t0,
|
|
2857
|
-
appBar,
|
|
2858
|
-
drawer,
|
|
2859
|
-
autoOpenDrawer: t1,
|
|
2860
|
-
children
|
|
2861
|
-
} = props;
|
|
2862
|
-
const title = t0 === void 0 ? "Rebase" : t0;
|
|
2863
|
-
const autoOpenDrawer = t1 === void 0 ? false : t1;
|
|
2864
|
-
const registry = useRebaseRegistry();
|
|
2865
|
-
registry.studioConfig?.devViews;
|
|
2866
|
-
let t2;
|
|
2867
|
-
let t3;
|
|
2868
|
-
if ($2[0] !== registry.studioConfig?.devViews) {
|
|
2869
|
-
t3 = registry.studioConfig?.devViews ?? [];
|
|
2870
|
-
$2[0] = registry.studioConfig?.devViews;
|
|
2871
|
-
$2[1] = t3;
|
|
2872
|
-
} else {
|
|
2873
|
-
t3 = $2[1];
|
|
2874
|
-
}
|
|
2875
|
-
t2 = t3;
|
|
2876
|
-
const devViews = t2;
|
|
2877
|
-
let t4;
|
|
2878
|
-
if ($2[2] !== appBar || $2[3] !== autoOpenDrawer || $2[4] !== devViews || $2[5] !== drawer || $2[6] !== title) {
|
|
2879
|
-
t4 = /* @__PURE__ */ jsx(RebaseLayout, { title, appBar, drawer, autoOpenDrawer, devViews });
|
|
2880
|
-
$2[2] = appBar;
|
|
2881
|
-
$2[3] = autoOpenDrawer;
|
|
2882
|
-
$2[4] = devViews;
|
|
2883
|
-
$2[5] = drawer;
|
|
2884
|
-
$2[6] = title;
|
|
2885
|
-
$2[7] = t4;
|
|
2886
|
-
} else {
|
|
2887
|
-
t4 = $2[7];
|
|
2888
|
-
}
|
|
2889
|
-
let t5;
|
|
2890
|
-
if ($2[8] !== children || $2[9] !== t4) {
|
|
2891
|
-
t5 = /* @__PURE__ */ jsx(RebaseAuthGate, { children: /* @__PURE__ */ jsx(RebaseNavigation, { children: /* @__PURE__ */ jsx(ErrorBoundary, { fullPage: true, children: /* @__PURE__ */ jsx(RebaseRouteDefs, { layout: t4, children }) }) }) });
|
|
2892
|
-
$2[8] = children;
|
|
2893
|
-
$2[9] = t4;
|
|
2894
|
-
$2[10] = t5;
|
|
2895
|
-
} else {
|
|
2896
|
-
t5 = $2[10];
|
|
2897
|
-
}
|
|
2898
|
-
return t5;
|
|
2899
|
-
}
|
|
2900
|
-
function CollectionPanel(t0) {
|
|
2901
|
-
const $2 = c2(30);
|
|
2902
|
-
const {
|
|
2903
|
-
path,
|
|
2904
|
-
title,
|
|
2905
|
-
viewMode,
|
|
2906
|
-
sort,
|
|
2907
|
-
limit,
|
|
2908
|
-
updateUrl: t1,
|
|
2909
|
-
openEntityMode,
|
|
2910
|
-
className,
|
|
2911
|
-
collectionOverrides
|
|
2912
|
-
} = t0;
|
|
2913
|
-
const updateUrl = t1 === void 0 ? false : t1;
|
|
2914
|
-
const collectionRegistry = useCollectionRegistryController();
|
|
2915
|
-
let t2;
|
|
2916
|
-
if ($2[0] !== collectionRegistry || $2[1] !== path) {
|
|
2917
|
-
t2 = collectionRegistry.getCollection(path);
|
|
2918
|
-
$2[0] = collectionRegistry;
|
|
2919
|
-
$2[1] = path;
|
|
2920
|
-
$2[2] = t2;
|
|
2921
|
-
} else {
|
|
2922
|
-
t2 = $2[2];
|
|
2923
|
-
}
|
|
2924
|
-
const registeredCollection = t2;
|
|
2925
|
-
let t3;
|
|
2926
|
-
bb0: {
|
|
2927
|
-
if (!registeredCollection) {
|
|
2928
|
-
t3 = void 0;
|
|
2929
|
-
break bb0;
|
|
2930
|
-
}
|
|
2931
|
-
let propOverrides;
|
|
2932
|
-
if ($2[3] !== limit || $2[4] !== openEntityMode || $2[5] !== sort || $2[6] !== viewMode) {
|
|
2933
|
-
propOverrides = {};
|
|
2934
|
-
if (viewMode) {
|
|
2935
|
-
propOverrides.defaultViewMode = viewMode;
|
|
2936
|
-
}
|
|
2937
|
-
if (sort) {
|
|
2938
|
-
propOverrides.sort = sort;
|
|
2939
|
-
}
|
|
2940
|
-
if (limit) {
|
|
2941
|
-
propOverrides.pagination = limit;
|
|
2942
|
-
}
|
|
2943
|
-
if (openEntityMode) {
|
|
2944
|
-
propOverrides.openEntityMode = openEntityMode;
|
|
2945
|
-
}
|
|
2946
|
-
$2[3] = limit;
|
|
2947
|
-
$2[4] = openEntityMode;
|
|
2948
|
-
$2[5] = sort;
|
|
2949
|
-
$2[6] = viewMode;
|
|
2950
|
-
$2[7] = propOverrides;
|
|
2951
|
-
} else {
|
|
2952
|
-
propOverrides = $2[7];
|
|
2953
|
-
}
|
|
2954
|
-
let t42;
|
|
2955
|
-
if ($2[8] !== collectionOverrides) {
|
|
2956
|
-
t42 = collectionOverrides ?? {};
|
|
2957
|
-
$2[8] = collectionOverrides;
|
|
2958
|
-
$2[9] = t42;
|
|
2959
|
-
} else {
|
|
2960
|
-
t42 = $2[9];
|
|
2961
|
-
}
|
|
2962
|
-
let t52;
|
|
2963
|
-
if ($2[10] !== propOverrides || $2[11] !== registeredCollection || $2[12] !== t42) {
|
|
2964
|
-
t52 = {
|
|
2965
|
-
...registeredCollection,
|
|
2966
|
-
...t42,
|
|
2967
|
-
...propOverrides
|
|
2968
|
-
};
|
|
2969
|
-
$2[10] = propOverrides;
|
|
2970
|
-
$2[11] = registeredCollection;
|
|
2971
|
-
$2[12] = t42;
|
|
2972
|
-
$2[13] = t52;
|
|
2973
|
-
} else {
|
|
2974
|
-
t52 = $2[13];
|
|
2975
|
-
}
|
|
2976
|
-
t3 = t52;
|
|
2977
|
-
}
|
|
2978
|
-
const mergedCollection = t3;
|
|
2979
|
-
if (!mergedCollection) {
|
|
2980
|
-
let t42;
|
|
2981
|
-
if ($2[14] !== path) {
|
|
2982
|
-
t42 = /* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "secondary", children: [
|
|
2983
|
-
'Collection "',
|
|
2984
|
-
path,
|
|
2985
|
-
'" not found.'
|
|
2986
|
-
] });
|
|
2987
|
-
$2[14] = path;
|
|
2988
|
-
$2[15] = t42;
|
|
2989
|
-
} else {
|
|
2990
|
-
t42 = $2[15];
|
|
2991
|
-
}
|
|
2992
|
-
let t52;
|
|
2993
|
-
if ($2[16] !== className || $2[17] !== t42) {
|
|
2994
|
-
t52 = /* @__PURE__ */ jsx("div", { className, children: t42 });
|
|
2995
|
-
$2[16] = className;
|
|
2996
|
-
$2[17] = t42;
|
|
2997
|
-
$2[18] = t52;
|
|
2998
|
-
} else {
|
|
2999
|
-
t52 = $2[18];
|
|
3000
|
-
}
|
|
3001
|
-
return t52;
|
|
3002
|
-
}
|
|
3003
|
-
let t4;
|
|
3004
|
-
if ($2[19] !== mergedCollection || $2[20] !== title) {
|
|
3005
|
-
t4 = title !== false && /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "font-bold mb-2 text-surface-700 dark:text-surface-300", children: title ?? mergedCollection.name });
|
|
3006
|
-
$2[19] = mergedCollection;
|
|
3007
|
-
$2[20] = title;
|
|
3008
|
-
$2[21] = t4;
|
|
3009
|
-
} else {
|
|
3010
|
-
t4 = $2[21];
|
|
3011
|
-
}
|
|
3012
|
-
let t5;
|
|
3013
|
-
if ($2[22] !== mergedCollection || $2[23] !== path || $2[24] !== updateUrl) {
|
|
3014
|
-
t5 = /* @__PURE__ */ jsx(EntityCollectionView, { ...mergedCollection, path, updateUrl });
|
|
3015
|
-
$2[22] = mergedCollection;
|
|
3016
|
-
$2[23] = path;
|
|
3017
|
-
$2[24] = updateUrl;
|
|
3018
|
-
$2[25] = t5;
|
|
3019
|
-
} else {
|
|
3020
|
-
t5 = $2[25];
|
|
3021
|
-
}
|
|
3022
|
-
let t6;
|
|
3023
|
-
if ($2[26] !== className || $2[27] !== t4 || $2[28] !== t5) {
|
|
3024
|
-
t6 = /* @__PURE__ */ jsxs("div", { className, children: [
|
|
3025
|
-
t4,
|
|
3026
|
-
t5
|
|
3027
|
-
] });
|
|
3028
|
-
$2[26] = className;
|
|
3029
|
-
$2[27] = t4;
|
|
3030
|
-
$2[28] = t5;
|
|
3031
|
-
$2[29] = t6;
|
|
3032
|
-
} else {
|
|
3033
|
-
t6 = $2[29];
|
|
3034
|
-
}
|
|
3035
|
-
return t6;
|
|
3036
|
-
}
|
|
3037
|
-
function ArrayOfMapsPreview(t0) {
|
|
3038
|
-
const $2 = c2(9);
|
|
3039
|
-
let t1;
|
|
3040
|
-
let t2;
|
|
3041
|
-
let t3;
|
|
3042
|
-
if ($2[0] !== t0) {
|
|
3043
|
-
t3 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
3044
|
-
bb0: {
|
|
3045
|
-
const {
|
|
3046
|
-
propertyKey,
|
|
3047
|
-
value,
|
|
3048
|
-
property,
|
|
3049
|
-
size
|
|
3050
|
-
} = t0;
|
|
3051
|
-
if (Array.isArray(property?.of)) {
|
|
3052
|
-
throw Error("Using array properties instead of single one in `of` in ArrayProperty");
|
|
3053
|
-
}
|
|
3054
|
-
if (property?.type !== "array" || !property.of || property.of.type !== "map") {
|
|
3055
|
-
throw Error("Picked wrong preview component ArrayOfMapsPreview");
|
|
3056
|
-
}
|
|
3057
|
-
const mapProperty = property.of;
|
|
3058
|
-
const properties = mapProperty.properties;
|
|
3059
|
-
if (!properties) {
|
|
3060
|
-
throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property ${propertyKey}`);
|
|
3061
|
-
}
|
|
3062
|
-
const values = value;
|
|
3063
|
-
const previewProperties = mapProperty.previewProperties;
|
|
3064
|
-
if (!values) {
|
|
3065
|
-
t3 = null;
|
|
3066
|
-
break bb0;
|
|
3067
|
-
}
|
|
3068
|
-
let mapProperties;
|
|
3069
|
-
mapProperties = previewProperties;
|
|
3070
|
-
if (!mapProperties || !mapProperties.length) {
|
|
3071
|
-
mapProperties = Object.keys(properties);
|
|
3072
|
-
if (size) {
|
|
3073
|
-
mapProperties = mapProperties.slice(0, 3);
|
|
3074
|
-
}
|
|
3075
|
-
}
|
|
3076
|
-
t2 = "table-auto text-xs";
|
|
3077
|
-
t1 = values && values.map((v2, index) => /* @__PURE__ */ jsx("div", { className: "border-b last:border-b-0 py-2", children: mapProperties && mapProperties.map((key) => /* @__PURE__ */ jsx("div", { className: "table-cell", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyPreview, { propertyKey: key, value: v2[key], property: properties[key], size: "small" }) }) }, `table-cell-${key}`)) }, `table_${v2}_${index}`));
|
|
3078
|
-
}
|
|
3079
|
-
$2[0] = t0;
|
|
3080
|
-
$2[1] = t1;
|
|
3081
|
-
$2[2] = t2;
|
|
3082
|
-
$2[3] = t3;
|
|
3083
|
-
} else {
|
|
3084
|
-
t1 = $2[1];
|
|
3085
|
-
t2 = $2[2];
|
|
3086
|
-
t3 = $2[3];
|
|
3087
|
-
}
|
|
3088
|
-
if (t3 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
|
|
3089
|
-
return t3;
|
|
3090
|
-
}
|
|
3091
|
-
let t4;
|
|
3092
|
-
if ($2[4] !== t1) {
|
|
3093
|
-
t4 = /* @__PURE__ */ jsx("div", { children: t1 });
|
|
3094
|
-
$2[4] = t1;
|
|
3095
|
-
$2[5] = t4;
|
|
3096
|
-
} else {
|
|
3097
|
-
t4 = $2[5];
|
|
3098
|
-
}
|
|
3099
|
-
let t5;
|
|
3100
|
-
if ($2[6] !== t2 || $2[7] !== t4) {
|
|
3101
|
-
t5 = /* @__PURE__ */ jsx("div", { className: t2, children: t4 });
|
|
3102
|
-
$2[6] = t2;
|
|
3103
|
-
$2[7] = t4;
|
|
3104
|
-
$2[8] = t5;
|
|
3105
|
-
} else {
|
|
3106
|
-
t5 = $2[8];
|
|
3107
|
-
}
|
|
3108
|
-
return t5;
|
|
3109
|
-
}
|
|
3110
|
-
function MissingReferenceWidget(t0) {
|
|
3111
|
-
const $2 = c2(22);
|
|
3112
|
-
const {
|
|
3113
|
-
path: pathProp
|
|
3114
|
-
} = t0;
|
|
3115
|
-
const registry = useCollectionRegistryController();
|
|
3116
|
-
const path = getLastSegment(pathProp);
|
|
3117
|
-
let t1;
|
|
3118
|
-
if ($2[0] !== pathProp || $2[1] !== registry) {
|
|
3119
|
-
t1 = registry.getParentCollectionSlugs(pathProp);
|
|
3120
|
-
$2[0] = pathProp;
|
|
3121
|
-
$2[1] = registry;
|
|
3122
|
-
$2[2] = t1;
|
|
3123
|
-
} else {
|
|
3124
|
-
t1 = $2[2];
|
|
3125
|
-
}
|
|
3126
|
-
const parentCollectionSlugs = t1;
|
|
3127
|
-
let t2;
|
|
3128
|
-
if ($2[3] !== pathProp || $2[4] !== registry) {
|
|
3129
|
-
t2 = registry.getParentEntityIds(pathProp);
|
|
3130
|
-
$2[3] = pathProp;
|
|
3131
|
-
$2[4] = registry;
|
|
3132
|
-
$2[5] = t2;
|
|
3133
|
-
} else {
|
|
3134
|
-
t2 = $2[5];
|
|
3135
|
-
}
|
|
3136
|
-
const parentEntityIds = t2;
|
|
3137
|
-
const collectionEditor = useCollectionEditorController();
|
|
3138
|
-
const {
|
|
3139
|
-
t
|
|
3140
|
-
} = useTranslation();
|
|
3141
|
-
const t3 = "p-1 flex flex-col items-center";
|
|
3142
|
-
const T0 = ErrorView;
|
|
3143
|
-
const t4 = t("studio_missing_reference_error", {
|
|
3144
|
-
path
|
|
3145
|
-
});
|
|
3146
|
-
let t5;
|
|
3147
|
-
if ($2[6] !== T0 || $2[7] !== t4) {
|
|
3148
|
-
t5 = /* @__PURE__ */ jsx(T0, { error: t4 });
|
|
3149
|
-
$2[6] = T0;
|
|
3150
|
-
$2[7] = t4;
|
|
3151
|
-
$2[8] = t5;
|
|
3152
|
-
} else {
|
|
3153
|
-
t5 = $2[8];
|
|
3154
|
-
}
|
|
3155
|
-
let t6;
|
|
3156
|
-
if ($2[9] !== collectionEditor || $2[10] !== parentCollectionSlugs || $2[11] !== parentEntityIds || $2[12] !== path) {
|
|
3157
|
-
t6 = () => {
|
|
3158
|
-
collectionEditor.createCollection({
|
|
3159
|
-
initialValues: {
|
|
3160
|
-
path,
|
|
3161
|
-
name: prettifyIdentifier(path)
|
|
3162
|
-
},
|
|
3163
|
-
parentCollectionSlugs,
|
|
3164
|
-
parentEntityIds,
|
|
3165
|
-
redirect: false,
|
|
3166
|
-
sourceClick: "missing_reference"
|
|
3167
|
-
});
|
|
3168
|
-
};
|
|
3169
|
-
$2[9] = collectionEditor;
|
|
3170
|
-
$2[10] = parentCollectionSlugs;
|
|
3171
|
-
$2[11] = parentEntityIds;
|
|
3172
|
-
$2[12] = path;
|
|
3173
|
-
$2[13] = t6;
|
|
3174
|
-
} else {
|
|
3175
|
-
t6 = $2[13];
|
|
3176
|
-
}
|
|
3177
|
-
let t7;
|
|
3178
|
-
if ($2[14] !== t) {
|
|
3179
|
-
t7 = t("studio_missing_reference_create");
|
|
3180
|
-
$2[14] = t;
|
|
3181
|
-
$2[15] = t7;
|
|
3182
|
-
} else {
|
|
3183
|
-
t7 = $2[15];
|
|
3184
|
-
}
|
|
3185
|
-
let t8;
|
|
3186
|
-
if ($2[16] !== t6 || $2[17] !== t7) {
|
|
3187
|
-
t8 = /* @__PURE__ */ jsx(Button, { className: "mx-2", size: "small", onClick: t6, children: t7 });
|
|
3188
|
-
$2[16] = t6;
|
|
3189
|
-
$2[17] = t7;
|
|
3190
|
-
$2[18] = t8;
|
|
3191
|
-
} else {
|
|
3192
|
-
t8 = $2[18];
|
|
3193
|
-
}
|
|
3194
|
-
let t9;
|
|
3195
|
-
if ($2[19] !== t5 || $2[20] !== t8) {
|
|
3196
|
-
t9 = /* @__PURE__ */ jsxs("div", { className: t3, children: [
|
|
3197
|
-
t5,
|
|
3198
|
-
t8
|
|
3199
|
-
] });
|
|
3200
|
-
$2[19] = t5;
|
|
3201
|
-
$2[20] = t8;
|
|
3202
|
-
$2[21] = t9;
|
|
3203
|
-
} else {
|
|
3204
|
-
t9 = $2[21];
|
|
3205
|
-
}
|
|
3206
|
-
return t9;
|
|
3207
|
-
}
|
|
3208
|
-
export {
|
|
3209
|
-
AdminModeSyncer,
|
|
3210
|
-
AppBar,
|
|
3211
|
-
a as ArrayContainer,
|
|
3212
|
-
b as ArrayCustomShapedFieldBinding,
|
|
3213
|
-
c as ArrayEnumPreview,
|
|
3214
|
-
ArrayOfMapsPreview,
|
|
3215
|
-
d as ArrayOfReferencesFieldBinding,
|
|
3216
|
-
e as ArrayOfReferencesPreview,
|
|
3217
|
-
f as ArrayOfStorageComponentsPreview,
|
|
3218
|
-
g as ArrayOfStringsPreview,
|
|
3219
|
-
h as ArrayOneOfPreview,
|
|
3220
|
-
i as ArrayPropertyEnumPreview,
|
|
3221
|
-
j as ArrayPropertyPreview,
|
|
3222
|
-
B2 as BasicExportAction,
|
|
3223
|
-
B as BlockFieldBinding,
|
|
3224
|
-
k as BooleanPreview,
|
|
3225
|
-
l as CollectionGenerationApiError,
|
|
3226
|
-
CollectionPanel,
|
|
3227
|
-
m as CollectionRegistryContext,
|
|
3228
|
-
n as CreationResultDialog,
|
|
3229
|
-
CustomViewRoute,
|
|
3230
|
-
D as DEFAULT_COLLECTION_GENERATION_ENDPOINT,
|
|
3231
|
-
o as DEFAULT_FIELD_CONFIGS,
|
|
3232
|
-
p as DataNewPropertiesMapping,
|
|
3233
|
-
q as DatePreview,
|
|
3234
|
-
r as DateTimeFieldBinding,
|
|
3235
|
-
s as DefaultDrawer,
|
|
3236
|
-
Drawer,
|
|
3237
|
-
u as DrawerFooterActions,
|
|
3238
|
-
E as EmptyValue,
|
|
3239
|
-
v as EntityCard,
|
|
3240
|
-
w as EntityCollectionCardView,
|
|
3241
|
-
x as EntityCollectionRowActions,
|
|
3242
|
-
y as EntityCollectionTable,
|
|
3243
|
-
EntityCollectionView,
|
|
3244
|
-
F as EntityCollectionViewActions,
|
|
3245
|
-
I as EntityForm,
|
|
3246
|
-
J as EntityPreview,
|
|
3247
|
-
K as EntitySelectionTable,
|
|
3248
|
-
L as EntityView,
|
|
3249
|
-
M as EnumValuesChip,
|
|
3250
|
-
E2 as ExportCollectionAction,
|
|
3251
|
-
N as FieldCaption,
|
|
3252
|
-
O as FieldHelperText,
|
|
3253
|
-
P as FormEntry,
|
|
3254
|
-
Q as FormLayout,
|
|
3255
|
-
R as ImagePreview,
|
|
3256
|
-
I2 as ImportCollectionAction,
|
|
3257
|
-
a7 as ImportDataPreview,
|
|
3258
|
-
S as ImportFileUpload,
|
|
3259
|
-
T as ImportNewPropertyFieldPreview,
|
|
3260
|
-
U as ImportSaveInProgress,
|
|
3261
|
-
V as KeyValueFieldBinding,
|
|
3262
|
-
W as KeyValuePreview,
|
|
3263
|
-
X as LabelWithIcon,
|
|
3264
|
-
Y as LabelWithIconAndTooltip,
|
|
3265
|
-
Z as MapFieldBinding,
|
|
3266
|
-
_ as MapPropertyPreview,
|
|
3267
|
-
$ as MarkdownEditorFieldBinding,
|
|
3268
|
-
MissingReferenceWidget,
|
|
3269
|
-
a0 as MultiSelectFieldBinding,
|
|
3270
|
-
a2 as NavigationStateContext,
|
|
3271
|
-
a3 as NumberPropertyPreview,
|
|
3272
|
-
a4 as PropertyConfigBadge,
|
|
3273
|
-
a5 as PropertyFieldBinding,
|
|
3274
|
-
a6 as PropertyIdCopyTooltip,
|
|
3275
|
-
PropertyPreview,
|
|
3276
|
-
P2 as PropertySelectEntry,
|
|
3277
|
-
a8 as ReadOnlyFieldBinding,
|
|
3278
|
-
RebaseAuthGate,
|
|
3279
|
-
RebaseCMS,
|
|
3280
|
-
RebaseLayout,
|
|
3281
|
-
RebaseNavigation,
|
|
3282
|
-
RebaseRoute,
|
|
3283
|
-
RebaseRouteDefs,
|
|
3284
|
-
RebaseShell,
|
|
3285
|
-
aa as ReferenceAsStringFieldBinding,
|
|
3286
|
-
ab as ReferenceFieldBinding,
|
|
3287
|
-
ReferencePreview,
|
|
3288
|
-
ReferenceWidget,
|
|
3289
|
-
ad as RelationPreview,
|
|
3290
|
-
ae as RepeatFieldBinding,
|
|
3291
|
-
Scaffold,
|
|
3292
|
-
ag as SearchIconsView,
|
|
3293
|
-
ah as SelectFieldBinding,
|
|
3294
|
-
ai as SelectableTable,
|
|
3295
|
-
aj as SelectableTableContext,
|
|
3296
|
-
SideDialogs,
|
|
3297
|
-
al as SideEntityControllerContext,
|
|
3298
|
-
am as SideEntityProvider,
|
|
3299
|
-
an as SkeletonPropertyComponent,
|
|
3300
|
-
ao as StorageThumbnail,
|
|
3301
|
-
ap as StorageThumbnailInternal,
|
|
3302
|
-
aq as StorageUploadFieldBinding,
|
|
3303
|
-
ar as StringPropertyPreview,
|
|
3304
|
-
as as SwitchFieldBinding,
|
|
3305
|
-
at as TextFieldBinding,
|
|
3306
|
-
au as UrlComponentPreview,
|
|
3307
|
-
av as UrlContext,
|
|
3308
|
-
aw as UserPreview,
|
|
3309
|
-
ax as VectorFieldBinding,
|
|
3310
|
-
ay as VirtualTableInput,
|
|
3311
|
-
addInitialSlash,
|
|
3312
|
-
az as buildCollectionGenerationCallback,
|
|
3313
|
-
aA as buildSidePanelsFromUrl,
|
|
3314
|
-
aB as convertDataToEntity,
|
|
3315
|
-
aC as convertFileToJson,
|
|
3316
|
-
aD as copyEntityAction,
|
|
3317
|
-
aE as deleteEntityAction,
|
|
3318
|
-
d2 as downloadBlob,
|
|
3319
|
-
a9 as downloadDataAsCsv,
|
|
3320
|
-
b10 as downloadEntitiesExport,
|
|
3321
|
-
aF as editEntityAction,
|
|
3322
|
-
aG as flattenEntry,
|
|
3323
|
-
aH as getBracketNotation,
|
|
3324
|
-
getCollectionBySlugWithin,
|
|
3325
|
-
getCollectionPathsCombinations,
|
|
3326
|
-
aI as getDefaultFieldConfig,
|
|
3327
|
-
aJ as getDefaultFieldId,
|
|
3328
|
-
aK as getDefaultPropertiesOrder,
|
|
3329
|
-
g2 as getEntityCSVExportableData,
|
|
3330
|
-
c3 as getEntityJsonExportableData,
|
|
3331
|
-
aL as getEntityPreviewKeys,
|
|
3332
|
-
aM as getEntityTitlePropertyKey,
|
|
3333
|
-
aN as getEntityViewWidth,
|
|
3334
|
-
aO as getFieldConfig,
|
|
3335
|
-
aP as getFieldId,
|
|
3336
|
-
aQ as getFullId,
|
|
3337
|
-
aR as getFullIdPath,
|
|
3338
|
-
aS as getIconForProperty,
|
|
3339
|
-
aT as getIconForWidget,
|
|
3340
|
-
aU as getInferenceType,
|
|
3341
|
-
getLastSegment2 as getLastSegment,
|
|
3342
|
-
aV as getPropertiesWithPropertiesOrder,
|
|
3343
|
-
aW as getPropertyInPath,
|
|
3344
|
-
aX as getResolvedPropertyInPath,
|
|
3345
|
-
aY as idToPropertiesPath,
|
|
3346
|
-
aZ as isReferenceProperty,
|
|
3347
|
-
a_ as isRelationProperty,
|
|
3348
|
-
a$ as mergeEntityActions,
|
|
3349
|
-
b0 as namespaceToPropertiesOrderPath,
|
|
3350
|
-
b1 as namespaceToPropertiesPath,
|
|
3351
|
-
b2 as processValueMapping,
|
|
3352
|
-
removeInitialAndTrailingSlashes,
|
|
3353
|
-
removeInitialSlash,
|
|
3354
|
-
removeTrailingSlash,
|
|
3355
|
-
b3 as renderSkeletonCaptionText,
|
|
3356
|
-
b4 as renderSkeletonIcon,
|
|
3357
|
-
b5 as renderSkeletonImageThumbnail,
|
|
3358
|
-
b6 as renderSkeletonText,
|
|
3359
|
-
b7 as resetPasswordAction,
|
|
3360
|
-
resolveCollectionPathIds,
|
|
3361
|
-
b8 as resolveEntityAction,
|
|
3362
|
-
b9 as resolveEntityView,
|
|
3363
|
-
resolveNavigationFrom,
|
|
3364
|
-
ba as sanitizeUrl,
|
|
3365
|
-
bb as unflattenObject,
|
|
3366
|
-
bc as useApp,
|
|
3367
|
-
useBreadcrumbsController,
|
|
3368
|
-
be as useBuildCollectionRegistryController,
|
|
3369
|
-
bf as useBuildNavigationStateController,
|
|
3370
|
-
bg as useBuildSideEntityController,
|
|
3371
|
-
bh as useBuildUrlController,
|
|
3372
|
-
useCMSContext,
|
|
3373
|
-
bj as useClearRestoreValue,
|
|
3374
|
-
useCollectionEditorController,
|
|
3375
|
-
useCollectionRegistryController,
|
|
3376
|
-
bm as useCollectionsConfigController,
|
|
3377
|
-
u2 as useEntityHistory,
|
|
3378
|
-
useEntitySelectionDialog,
|
|
3379
|
-
bo as useImportConfig,
|
|
3380
|
-
bp as useLocalCollectionsConfigController,
|
|
3381
|
-
useNavigationStateController,
|
|
3382
|
-
br as useResolvedCollections,
|
|
3383
|
-
useResolvedNavigationFrom,
|
|
3384
|
-
bs as useResolvedViews,
|
|
3385
|
-
bt as useSelectionController,
|
|
3386
|
-
bu as useSideDialogsController,
|
|
3387
|
-
bv as useSideEntityController,
|
|
3388
|
-
bw as useTopLevelNavigation,
|
|
3389
|
-
useUrlController,
|
|
3390
|
-
by as validateCollectionJson,
|
|
3391
|
-
bz as zodToFormErrors
|
|
3392
|
-
};
|
|
3393
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { $ as useApp, $n as getBracketNotation, $t as SideDialogs, A as KeyValuePreview, An as useSideDialogsController, At as RepeatFieldBinding, B as RebaseRouteDefs, Bn as SelectableTableContext, Bt as ArrayContainer, C as zodToFormErrors, Cn as useCMSContext, Ct as getFieldConfig, D as NumberPropertyPreview, Dn as useNavigationStateController, Dt as SwitchFieldBinding, E as UserPreview, En as NavigationStateContext, Et as TextFieldBinding, F as ArrayEnumPreview, Fn as useSelectionController, Ft as MapFieldBinding, G as useLocalCollectionsConfigController, Gn as resolveEntityAction, Gt as FormEntry, H as RebaseRoute, Hn as useSideEntityController, Ht as PropertyFieldBinding, I as ArrayOfStorageComponentsPreview, In as EntityCollectionTable, It as KeyValueFieldBinding, J as Scaffold, Jn as ArrayOfReferencesPreview, Jt as LabelWithIcon, K as RebaseAuthGate, Kn as resolveEntityView, Kt as LabelWithIconAndTooltip, L as RelationPreview, Ln as SelectableTable, Lt as DateTimeFieldBinding, M as ArrayOneOfPreview, Mn as getEntityViewWidth, Mt as ReferenceAsStringFieldBinding, N as ArrayOfStringsPreview, Nn as useBuildSideEntityController, Nt as MultiSelectFieldBinding, O as BooleanPreview, On as CollectionRegistryContext, Ot as StorageUploadFieldBinding, P as ArrayPropertyEnumPreview, Pn as mergeEntityActions, Pt as MarkdownEditorFieldBinding, Q as AppBar, Qn as getEntityTitlePropertyKey, Qt as EntitySelectionTable, R as CollectionPanel, Rn as EntityCollectionRowActions, Rt as BlockFieldBinding, S as EntityForm, Sn as useResolvedNavigationFrom, St as getDefaultFieldId, T as PropertyPreview, Tn as useUrlController, Tt as VectorFieldBinding, U as RebaseLayout, Un as useEntitySelectionDialog, Ut as ReadOnlyFieldBinding, V as CustomViewRoute, Vn as SideEntityControllerContext, Vt as ArrayCustomShapedFieldBinding, W as RebaseNavigation, Wn as VirtualTableInput, Wt as FormLayout, X as DefaultDrawer, Xn as EntityPreview, Xt as SearchIconsView, Y as Drawer, Yn as ReferencePreview, Yt as FieldHelperText, Z as DrawerFooterActions, Zn as getEntityPreviewKeys, Zt as FieldCaption, _ as getEntityCSVExportableData, _n as removeTrailingSlash, _r as renderSkeletonText, _t as convertFileToJson, a as namespaceToPropertiesPath, an as useResolvedCollections, ar as getResolvedPropertyInPath, at as EntityCard, b as ImportDataPreview, bn as useEntityHistory, br as ImagePreview, bt as DEFAULT_FIELD_CONFIGS, c as DEFAULT_COLLECTION_GENERATION_ENDPOINT, cn as editEntityAction, cr as ArrayPropertyPreview, ct as ImportNewPropertyFieldPreview, d as useCollectionsConfigController, dn as addInitialSlash, dr as StorageThumbnail, dt as flattenEntry, en as useBreadcrumbsController, er as getDefaultPropertiesOrder, et as AdminModeSyncer, f as ExportCollectionAction, fn as getCollectionBySlugWithin, fr as StorageThumbnailInternal, ft as processValueMapping, g as downloadEntitiesExport, gn as removeInitialSlash, gr as renderSkeletonImageThumbnail, gt as ImportFileUpload, h as downloadDataAsCsv, hn as removeInitialAndTrailingSlashes, hr as renderSkeletonIcon, ht as ImportSaveInProgress, i as namespaceToPropertiesOrderPath, in as useResolvedViews, ir as getPropertyInPath, it as EntityCollectionCardView, j as MapPropertyPreview, jn as buildSidePanelsFromUrl, jt as ReferenceFieldBinding, k as DatePreview, kn as useCollectionRegistryController, kt as SelectFieldBinding, l as buildCollectionGenerationCallback, ln as resetPasswordAction, lr as StringPropertyPreview, lt as DataNewPropertiesMapping, m as downloadBlob, mn as getLastSegment, mr as renderSkeletonCaptionText, mt as useImportConfig, n as getFullIdPath, nn as useBuildNavigationStateController, nr as getIconForWidget, nt as ReferenceWidget, o as MissingReferenceWidget, on as copyEntityAction, or as isReferenceProperty, ot as EntityCollectionViewActions, p as BasicExportAction, pn as getCollectionPathsCombinations, pr as SkeletonPropertyComponent, pt as getInferenceType, q as RebaseCMS, qn as EntityView, qt as PropertyIdCopyTooltip, r as idToPropertiesPath, rn as useTopLevelNavigation, rr as getPropertiesWithPropertiesOrder, rt as EntityCollectionView, s as CollectionGenerationApiError, sn as deleteEntityAction, sr as isRelationProperty, st as useCollectionEditorController, t as getFullId, tn as useBuildUrlController, tr as getIconForProperty, tt as SideEntityProvider, u as validateCollectionJson, un as CreationResultDialog, ur as EnumValuesChip, ut as convertDataToEntity, v as getEntityJsonExportableData, vn as resolveCollectionPathIds, vr as UrlComponentPreview, vt as unflattenObject, w as ArrayOfMapsPreview, wn as UrlContext, wt as getFieldId, x as PropertySelectEntry, xn as resolveNavigationFrom, xr as EmptyValue, xt as getDefaultFieldConfig, y as ImportCollectionAction, yn as useBuildCollectionRegistryController, yr as sanitizeUrl, yt as PropertyConfigBadge, z as RebaseShell, zn as useClearRestoreValue, zt as ArrayOfReferencesFieldBinding } from "./src-BJ8fkM8y.js";
|
|
2
|
+
export { AdminModeSyncer, AppBar, ArrayContainer, ArrayCustomShapedFieldBinding, ArrayEnumPreview, ArrayOfMapsPreview, ArrayOfReferencesFieldBinding, ArrayOfReferencesPreview, ArrayOfStorageComponentsPreview, ArrayOfStringsPreview, ArrayOneOfPreview, ArrayPropertyEnumPreview, ArrayPropertyPreview, BasicExportAction, BlockFieldBinding, BooleanPreview, CollectionGenerationApiError, CollectionPanel, CollectionRegistryContext, CreationResultDialog, CustomViewRoute, DEFAULT_COLLECTION_GENERATION_ENDPOINT, DEFAULT_FIELD_CONFIGS, DataNewPropertiesMapping, DatePreview, DateTimeFieldBinding, DefaultDrawer, Drawer, DrawerFooterActions, EmptyValue, EntityCard, EntityCollectionCardView, EntityCollectionRowActions, EntityCollectionTable, EntityCollectionView, EntityCollectionViewActions, EntityForm, EntityPreview, EntitySelectionTable, EntityView, EnumValuesChip, ExportCollectionAction, FieldCaption, FieldHelperText, FormEntry, FormLayout, ImagePreview, ImportCollectionAction, ImportDataPreview, ImportFileUpload, ImportNewPropertyFieldPreview, ImportSaveInProgress, KeyValueFieldBinding, KeyValuePreview, LabelWithIcon, LabelWithIconAndTooltip, MapFieldBinding, MapPropertyPreview, MarkdownEditorFieldBinding, MissingReferenceWidget, MultiSelectFieldBinding, NavigationStateContext, NumberPropertyPreview, PropertyConfigBadge, PropertyFieldBinding, PropertyIdCopyTooltip, PropertyPreview, PropertySelectEntry, ReadOnlyFieldBinding, RebaseAuthGate, RebaseCMS, RebaseLayout, RebaseNavigation, RebaseRoute, RebaseRouteDefs, RebaseShell, ReferenceAsStringFieldBinding, ReferenceFieldBinding, ReferencePreview, ReferenceWidget, RelationPreview, RepeatFieldBinding, Scaffold, SearchIconsView, SelectFieldBinding, SelectableTable, SelectableTableContext, SideDialogs, SideEntityControllerContext, SideEntityProvider, SkeletonPropertyComponent, StorageThumbnail, StorageThumbnailInternal, StorageUploadFieldBinding, StringPropertyPreview, SwitchFieldBinding, TextFieldBinding, UrlComponentPreview, UrlContext, UserPreview, VectorFieldBinding, VirtualTableInput, addInitialSlash, buildCollectionGenerationCallback, buildSidePanelsFromUrl, convertDataToEntity, convertFileToJson, copyEntityAction, deleteEntityAction, downloadBlob, downloadDataAsCsv, downloadEntitiesExport, editEntityAction, flattenEntry, getBracketNotation, getCollectionBySlugWithin, getCollectionPathsCombinations, getDefaultFieldConfig, getDefaultFieldId, getDefaultPropertiesOrder, getEntityCSVExportableData, getEntityJsonExportableData, getEntityPreviewKeys, getEntityTitlePropertyKey, getEntityViewWidth, getFieldConfig, getFieldId, getFullId, getFullIdPath, getIconForProperty, getIconForWidget, getInferenceType, getLastSegment, getPropertiesWithPropertiesOrder, getPropertyInPath, getResolvedPropertyInPath, idToPropertiesPath, isReferenceProperty, isRelationProperty, mergeEntityActions, namespaceToPropertiesOrderPath, namespaceToPropertiesPath, processValueMapping, removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash, renderSkeletonCaptionText, renderSkeletonIcon, renderSkeletonImageThumbnail, renderSkeletonText, resetPasswordAction, resolveCollectionPathIds, resolveEntityAction, resolveEntityView, resolveNavigationFrom, sanitizeUrl, unflattenObject, useApp, useBreadcrumbsController, useBuildCollectionRegistryController, useBuildNavigationStateController, useBuildSideEntityController, useBuildUrlController, useCMSContext, useClearRestoreValue, useCollectionEditorController, useCollectionRegistryController, useCollectionsConfigController, useEntityHistory, useEntitySelectionDialog, useImportConfig, useLocalCollectionsConfigController, useNavigationStateController, useResolvedCollections, useResolvedNavigationFrom, useResolvedViews, useSelectionController, useSideDialogsController, useSideEntityController, useTopLevelNavigation, useUrlController, validateCollectionJson, zodToFormErrors };
|