@rebasepro/admin 0.0.1-canary.4f204c2
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/LICENSE +6 -0
- package/dist/CollectionEditorDialog-B2M9lCyL.js +4720 -0
- package/dist/CollectionEditorDialog-B2M9lCyL.js.map +1 -0
- package/dist/CollectionsStudioView-WG6soyfs.js +218 -0
- package/dist/CollectionsStudioView-WG6soyfs.js.map +1 -0
- package/dist/ContentHomePage-CDF_a6Lp.js +1786 -0
- package/dist/ContentHomePage-CDF_a6Lp.js.map +1 -0
- package/dist/ExportCollectionAction-Dc0VOWMN.js +439 -0
- package/dist/ExportCollectionAction-Dc0VOWMN.js.map +1 -0
- package/dist/ImportCollectionAction-DpCagAOy.js +686 -0
- package/dist/ImportCollectionAction-DpCagAOy.js.map +1 -0
- package/dist/PropertyEditView-DS67DxoT.js +8138 -0
- package/dist/PropertyEditView-DS67DxoT.js.map +1 -0
- package/dist/RoleChip-QtUFXeTp.js +67 -0
- package/dist/RoleChip-QtUFXeTp.js.map +1 -0
- package/dist/RolesView-CIuYBimF.js +424 -0
- package/dist/RolesView-CIuYBimF.js.map +1 -0
- package/dist/UsersView-B5zelXnH.js +493 -0
- package/dist/UsersView-B5zelXnH.js.map +1 -0
- package/dist/collection_editor/CollectionEditorDialogsContext.d.ts +19 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +45 -0
- package/dist/collection_editor/_cms_internals.d.ts +29 -0
- package/dist/collection_editor/api/generateCollectionApi.d.ts +77 -0
- package/dist/collection_editor/api/index.d.ts +1 -0
- package/dist/collection_editor/index.d.ts +16 -0
- package/dist/collection_editor/pgColumnToProperty.d.ts +6 -0
- package/dist/collection_editor/types/collection_editor_controller.d.ts +56 -0
- package/dist/collection_editor/types/collection_inference.d.ts +10 -0
- package/dist/collection_editor/types/config_controller.d.ts +91 -0
- package/dist/collection_editor/types/config_permissions.d.ts +19 -0
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +11 -0
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +10 -0
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +2 -0
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +2 -0
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +2 -0
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +2 -0
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +10 -0
- package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +3 -0
- package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -0
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +2 -0
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +36 -0
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +20 -0
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +72 -0
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +19 -0
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +17 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +12 -0
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +1 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +14 -0
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +12 -0
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +47 -0
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +16 -0
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +31 -0
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +8 -0
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +13 -0
- package/dist/collection_editor/ui/collection_editor/import/clean_import_data.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.d.ts +10 -0
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +9 -0
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +7 -0
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +14 -0
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +15 -0
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +9 -0
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +10 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/index.d.ts +6 -0
- package/dist/collection_editor/ui/collection_editor/properties/conditions/property_paths.d.ts +19 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +4 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -0
- package/dist/collection_editor/ui/collection_editor/util.d.ts +5 -0
- package/dist/collection_editor/ui/collection_editor/utils/strings.d.ts +1 -0
- package/dist/collection_editor/ui/collection_editor/utils/supported_fields.d.ts +3 -0
- package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -0
- package/dist/collection_editor/useCollectionEditorController.d.ts +6 -0
- package/dist/collection_editor/useCollectionsConfigController.d.ts +6 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +6 -0
- package/dist/collection_editor/validateCollectionJson.d.ts +22 -0
- package/dist/collection_editor_ui.d.ts +8 -0
- package/dist/collection_editor_ui.js +11 -0
- package/dist/collection_editor_ui.js.map +1 -0
- package/dist/components/AdminModeSyncer.d.ts +17 -0
- package/dist/components/ArrayContainer.d.ts +58 -0
- package/dist/components/ClearFilterSortButton.d.ts +5 -0
- package/dist/components/CollectionEditorDialogs.d.ts +15 -0
- package/dist/components/DefaultAppBar.d.ts +29 -0
- package/dist/components/DefaultDrawer.d.ts +29 -0
- package/dist/components/DeleteEntityDialog.d.ts +13 -0
- package/dist/components/DrawerNavigationGroup.d.ts +49 -0
- package/dist/components/DrawerNavigationItem.d.ts +10 -0
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +39 -0
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +27 -0
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +129 -0
- package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +26 -0
- package/dist/components/EntityCollectionTable/column_utils.d.ts +16 -0
- package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +21 -0
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +22 -0
- package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +22 -0
- package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +20 -0
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +35 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +12 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +9 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +8 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +15 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +7 -0
- package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +12 -0
- package/dist/components/EntityCollectionTable/index.d.ts +6 -0
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +21 -0
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +32 -0
- package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +9 -0
- package/dist/components/EntityCollectionTable/internal/common.d.ts +5 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +27 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/useDraggable.d.ts +13 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/useWindowSize.d.ts +6 -0
- package/dist/components/EntityCollectionTable/table_bindings.d.ts +28 -0
- package/dist/components/EntityCollectionView/Board.d.ts +2 -0
- package/dist/components/EntityCollectionView/BoardColumn.d.ts +42 -0
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +9 -0
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +14 -0
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +31 -0
- package/dist/components/EntityCollectionView/EntityCard.d.ts +20 -0
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +21 -0
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +32 -0
- package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +34 -0
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +64 -0
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +18 -0
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +18 -0
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +15 -0
- package/dist/components/EntityCollectionView/SplitListView.d.ts +57 -0
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +44 -0
- package/dist/components/EntityCollectionView/board_types.d.ts +105 -0
- package/dist/components/EntityCollectionView/hooks/useCollectionInlineEditor.d.ts +12 -0
- package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +19 -0
- package/dist/components/EntityCollectionView/useBoardDataController.d.ts +61 -0
- package/dist/components/EntityCollectionView/useEntityPreviewSlots.d.ts +101 -0
- package/dist/components/EntityCollectionView/useSelectionController.d.ts +2 -0
- package/dist/components/EntityCollectionView/utils.d.ts +3 -0
- package/dist/components/EntityEditView.d.ts +49 -0
- package/dist/components/EntityEditViewFormActions.d.ts +2 -0
- package/dist/components/EntityJsonPreview.d.ts +3 -0
- package/dist/components/EntityPreview.d.ts +56 -0
- package/dist/components/EntitySidePanel.d.ts +10 -0
- package/dist/components/EntityView.d.ts +12 -0
- package/dist/components/FieldCaption.d.ts +5 -0
- package/dist/components/HomePage/ContentHomePage.d.ts +11 -0
- package/dist/components/HomePage/FavouritesView.d.ts +3 -0
- package/dist/components/HomePage/HomePageDnD.d.ts +77 -0
- package/dist/components/HomePage/NavigationCard.d.ts +11 -0
- package/dist/components/HomePage/NavigationCardBinding.d.ts +18 -0
- package/dist/components/HomePage/NavigationGroup.d.ts +11 -0
- package/dist/components/HomePage/RenameGroupDialog.d.ts +9 -0
- package/dist/components/HomePage/SmallNavigationCard.d.ts +6 -0
- package/dist/components/HomePage/index.d.ts +4 -0
- package/dist/components/PropertyCollectionView.d.ts +24 -0
- package/dist/components/PropertyConfigBadge.d.ts +6 -0
- package/dist/components/PropertyIdCopyTooltip.d.ts +8 -0
- package/dist/components/RebaseAuthGate.d.ts +21 -0
- package/dist/components/RebaseCMS.d.ts +10 -0
- package/dist/components/RebaseLayout.d.ts +32 -0
- package/dist/components/RebaseNavigation.d.ts +24 -0
- package/dist/components/RebaseRouteDefs.d.ts +30 -0
- package/dist/components/RebaseShell.d.ts +25 -0
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +59 -0
- package/dist/components/ReferenceWidget.d.ts +30 -0
- package/dist/components/RelationSelector.d.ts +32 -0
- package/dist/components/SearchIconsView.d.ts +5 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +95 -0
- package/dist/components/SelectableTable/SelectableTableContext.d.ts +4 -0
- package/dist/components/SelectableTable/SelectionStore.d.ts +26 -0
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +9 -0
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +12 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +15 -0
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +12 -0
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +13 -0
- package/dist/components/SideDialogs.d.ts +25 -0
- package/dist/components/SideEntityProvider.d.ts +32 -0
- package/dist/components/UserSelector.d.ts +18 -0
- package/dist/components/admin/RoleChip.d.ts +4 -0
- package/dist/components/admin/RolesView.d.ts +4 -0
- package/dist/components/admin/UsersView.d.ts +4 -0
- package/dist/components/admin/index.d.ts +3 -0
- package/dist/components/app/AppBar.d.ts +12 -0
- package/dist/components/app/Drawer.d.ts +19 -0
- package/dist/components/app/Scaffold.d.ts +34 -0
- package/dist/components/app/index.d.ts +4 -0
- package/dist/components/app/useApp.d.ts +17 -0
- package/dist/components/common/default_entity_actions.d.ts +4 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/field_configs.d.ts +7 -0
- package/dist/components/history/EntityHistoryEntry.d.ts +17 -0
- package/dist/components/history/EntityHistoryView.d.ts +6 -0
- package/dist/components/history/LastEditedByFormAction.d.ts +6 -0
- package/dist/components/history/LastEditedByIndicator.d.ts +10 -0
- package/dist/components/history/UserChip.d.ts +4 -0
- package/dist/components/history/index.d.ts +5 -0
- package/dist/components/index.d.ts +38 -0
- package/dist/contexts/BreacrumbsContext.d.ts +8 -0
- package/dist/contexts/SideDialogsControllerContext.d.ts +3 -0
- package/dist/contexts/SideEntityControllerContext.d.ts +3 -0
- package/dist/data_export/export/BasicExportAction.d.ts +7 -0
- package/dist/data_export/export/ExportCollectionAction.d.ts +11 -0
- package/dist/data_export/export/export.d.ts +22 -0
- package/dist/data_export/export/index.d.ts +3 -0
- package/dist/data_export/index.d.ts +1 -0
- package/dist/data_import/components/DataNewPropertiesMapping.d.ts +13 -0
- package/dist/data_import/components/ImportFileUpload.d.ts +3 -0
- package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +9 -0
- package/dist/data_import/components/ImportSaveInProgress.d.ts +8 -0
- package/dist/data_import/components/index.d.ts +4 -0
- package/dist/data_import/hooks/index.d.ts +1 -0
- package/dist/data_import/hooks/useImportConfig.d.ts +2 -0
- package/dist/data_import/import/ImportCollectionAction.d.ts +15 -0
- package/dist/data_import/import/index.d.ts +1 -0
- package/dist/data_import/index.d.ts +5 -0
- package/dist/data_import/types/column_mapping.d.ts +20 -0
- package/dist/data_import/types/index.d.ts +1 -0
- package/dist/data_import/utils/data.d.ts +4 -0
- package/dist/data_import/utils/file_headers.d.ts +1 -0
- package/dist/data_import/utils/file_to_json.d.ts +16 -0
- package/dist/data_import/utils/get_import_inference_type.d.ts +2 -0
- package/dist/data_import/utils/get_properties_mapping.d.ts +1 -0
- package/dist/data_import/utils/index.d.ts +3 -0
- package/dist/editor/components/SlashCommandMenu.d.ts +6 -0
- package/dist/editor/components/editor-bubble-item.d.ts +8 -0
- package/dist/editor/components/editor-bubble.d.ts +8 -0
- package/dist/editor/components/image-bubble.d.ts +5 -0
- package/dist/editor/components/index.d.ts +16 -0
- package/dist/editor/components/table-bubble.d.ts +5 -0
- package/dist/editor/editor.d.ts +30 -0
- package/dist/editor/extensions/HighlightDecorationExtension.d.ts +24 -0
- package/dist/editor/extensions/Image/index.d.ts +6 -0
- package/dist/editor/extensions/Image.d.ts +6 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.d.ts +16 -0
- package/dist/editor/extensions/clipboard.d.ts +7 -0
- package/dist/editor/extensions/custom-keymap.d.ts +1 -0
- package/dist/editor/extensions/drag-and-drop.d.ts +9 -0
- package/dist/editor/hooks/useProseMirror.d.ts +13 -0
- package/dist/editor/hooks/useProseMirrorContext.d.ts +9 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/markdown.d.ts +5 -0
- package/dist/editor/nodeViews/ImageComponent.d.ts +3 -0
- package/dist/editor/nodeViews/ReactNodeView.d.ts +29 -0
- package/dist/editor/nodeViews/TaskItemComponent.d.ts +3 -0
- package/dist/editor/nodeViews/index.d.ts +6 -0
- package/dist/editor/plugins/index.d.ts +2 -0
- package/dist/editor/plugins/inputrules.d.ts +6 -0
- package/dist/editor/plugins/placeholderPlugin.d.ts +3 -0
- package/dist/editor/plugins/slashCommandPlugin.d.ts +12 -0
- package/dist/editor/schema.d.ts +2 -0
- package/dist/editor/selectors/ai-selector.d.ts +0 -0
- package/dist/editor/selectors/color-selector.d.ts +10 -0
- package/dist/editor/selectors/link-selector.d.ts +8 -0
- package/dist/editor/selectors/node-selector.d.ts +15 -0
- package/dist/editor/selectors/text-buttons.d.ts +1 -0
- package/dist/editor/types.d.ts +5 -0
- package/dist/editor/useProseMirror.d.ts +16 -0
- package/dist/editor/utils/prosemirror-utils.d.ts +7 -0
- package/dist/editor/utils/remove_classes.d.ts +1 -0
- package/dist/editor/utils/useDebouncedCallback.d.ts +1 -0
- package/dist/editor.js +3834 -0
- package/dist/editor.js.map +1 -0
- package/dist/form/EntityForm.d.ts +10 -0
- package/dist/form/EntityFormActions.d.ts +2 -0
- package/dist/form/PropertyFieldBinding.d.ts +30 -0
- package/dist/form/components/ErrorFocus.d.ts +4 -0
- package/dist/form/components/FieldHelperText.d.ts +12 -0
- package/dist/form/components/FormEntry.d.ts +6 -0
- package/dist/form/components/FormLayout.d.ts +5 -0
- package/dist/form/components/LabelWithIcon.d.ts +14 -0
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +15 -0
- package/dist/form/components/LocalChangesMenu.d.ts +11 -0
- package/dist/form/components/StorageItemPreview.d.ts +14 -0
- package/dist/form/components/StorageUploadProgress.d.ts +10 -0
- package/dist/form/components/index.d.ts +5 -0
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +13 -0
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +12 -0
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +8 -0
- package/dist/form/field_bindings/MapFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +12 -0
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +3 -0
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +21 -0
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +10 -0
- package/dist/form/field_bindings/TextFieldBinding.d.ts +9 -0
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +14 -0
- package/dist/form/index.d.ts +20 -0
- package/dist/form/useClearRestoreValue.d.ts +13 -0
- package/dist/form/validation.d.ts +21 -0
- package/dist/hooks/index.d.ts +15 -0
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +5 -0
- package/dist/hooks/navigation/contexts/NavigationStateContext.d.ts +4 -0
- package/dist/hooks/navigation/contexts/UrlContext.d.ts +4 -0
- package/dist/hooks/navigation/contexts/index.d.ts +3 -0
- package/dist/hooks/navigation/useBuildCollectionRegistryController.d.ts +7 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +34 -0
- package/dist/hooks/navigation/useBuildUrlController.d.ts +7 -0
- package/dist/hooks/navigation/useNavigationRegistry.d.ts +11 -0
- package/dist/hooks/navigation/useNavigationResolution.d.ts +7 -0
- package/dist/hooks/navigation/useNavigationURLs.d.ts +11 -0
- package/dist/hooks/navigation/useResolvedCollections.d.ts +28 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +29 -0
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +27 -0
- package/dist/hooks/navigation/utils.d.ts +12 -0
- package/dist/hooks/useBreadcrumbsController.d.ts +42 -0
- package/dist/hooks/useBuildSideDialogsController.d.ts +2 -0
- package/dist/hooks/useBuildSideEntityController.d.ts +6 -0
- package/dist/hooks/useCMSContext.d.ts +27 -0
- package/dist/hooks/useEntityHistory.d.ts +30 -0
- package/dist/hooks/useEntitySelectionDialog.d.ts +18 -0
- package/dist/hooks/useResolvedNavigationFrom.d.ts +73 -0
- package/dist/hooks/useSideDialogsController.d.ts +19 -0
- package/dist/hooks/useSideEntityController.d.ts +11 -0
- package/dist/index-CBhrgpR7.js +12 -0
- package/dist/index-CBhrgpR7.js.map +1 -0
- package/dist/index-CHxgwt6E.js +456 -0
- package/dist/index-CHxgwt6E.js.map +1 -0
- package/dist/index-Dey5WJpO.js +8 -0
- package/dist/index-Dey5WJpO.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +799 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown-z2Ir7Cgo.js +618 -0
- package/dist/markdown-z2Ir7Cgo.js.map +1 -0
- package/dist/preview/PropertyPreview.d.ts +7 -0
- package/dist/preview/components/ArrayEnumPreview.d.ts +11 -0
- package/dist/preview/components/BooleanPreview.d.ts +11 -0
- package/dist/preview/components/DatePreview.d.ts +17 -0
- package/dist/preview/components/EmptyValue.d.ts +6 -0
- package/dist/preview/components/EnumValuesChip.d.ts +13 -0
- package/dist/preview/components/ImagePreview.d.ts +16 -0
- package/dist/preview/components/ReferencePreview.d.ts +17 -0
- package/dist/preview/components/RelationPreview.d.ts +17 -0
- package/dist/preview/components/StorageThumbnail.d.ts +15 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +14 -0
- package/dist/preview/components/UserPreview.d.ts +9 -0
- package/dist/preview/index.d.ts +23 -0
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +6 -0
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +6 -0
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +9 -0
- package/dist/preview/property_previews/NumberPropertyPreview.d.ts +7 -0
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +14 -0
- package/dist/preview/property_previews/StringPropertyPreview.d.ts +7 -0
- package/dist/preview/util.d.ts +7 -0
- package/dist/routes/CustomViewRoute.d.ts +4 -0
- package/dist/routes/RebaseRoute.d.ts +1 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +19 -0
- package/dist/types/components/EntityFormProps.d.ts +48 -0
- package/dist/types/components/PropertyPreviewProps.d.ts +47 -0
- package/dist/types/components/formex.d.ts +40 -0
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/fields.d.ts +221 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/useEntityHistory-Dcj4zhGj.js +121 -0
- package/dist/useEntityHistory-Dcj4zhGj.js.map +1 -0
- package/dist/util/entity_actions.d.ts +2 -0
- package/dist/util/index.d.ts +5 -0
- package/dist/util/navigation_utils.d.ts +17 -0
- package/dist/util/previews.d.ts +4 -0
- package/dist/util/property_utils.d.ts +25 -0
- package/dist/util/resolutions.d.ts +9 -0
- package/dist/util-BQ82ySL3.js +27720 -0
- package/dist/util-BQ82ySL3.js.map +1 -0
- package/package.json +171 -0
- package/src/collection_editor/CollectionEditorDialogsContext.tsx +25 -0
- package/src/collection_editor/ConfigControllerProvider.tsx +407 -0
- package/src/collection_editor/_cms_internals.ts +41 -0
- package/src/collection_editor/api/generateCollectionApi.ts +125 -0
- package/src/collection_editor/api/index.ts +1 -0
- package/src/collection_editor/index.ts +63 -0
- package/src/collection_editor/pgColumnToProperty.ts +273 -0
- package/src/collection_editor/types/collection_editor_controller.tsx +64 -0
- package/src/collection_editor/types/collection_inference.ts +17 -0
- package/src/collection_editor/types/config_controller.tsx +109 -0
- package/src/collection_editor/types/config_permissions.ts +20 -0
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +186 -0
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +50 -0
- package/src/collection_editor/ui/EditorCollectionAction.tsx +58 -0
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +93 -0
- package/src/collection_editor/ui/EditorEntityAction.tsx +54 -0
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +120 -0
- package/src/collection_editor/ui/KanbanSetupAction.tsx +40 -0
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +33 -0
- package/src/collection_editor/ui/NewCollectionButton.tsx +27 -0
- package/src/collection_editor/ui/NewCollectionCard.tsx +53 -0
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +53 -0
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +246 -0
- package/src/collection_editor/ui/collection_editor/AIModifiedPathsContext.tsx +90 -0
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +417 -0
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +977 -0
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +286 -0
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +164 -0
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +589 -0
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +332 -0
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +242 -0
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +101 -0
- package/src/collection_editor/ui/collection_editor/CollectionYupValidation.tsx +9 -0
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +133 -0
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +302 -0
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +151 -0
- package/src/collection_editor/ui/collection_editor/EntityActionsSelectDialog.tsx +40 -0
- package/src/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +39 -0
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +358 -0
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +252 -0
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +142 -0
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +194 -0
- package/src/collection_editor/ui/collection_editor/LayoutModeSwitch.tsx +41 -0
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +777 -0
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +155 -0
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +350 -0
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +241 -0
- package/src/collection_editor/ui/collection_editor/SwitchControl.tsx +39 -0
- package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +47 -0
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +67 -0
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +295 -0
- package/src/collection_editor/ui/collection_editor/import/clean_import_data.ts +57 -0
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +147 -0
- package/src/collection_editor/ui/collection_editor/properties/BooleanPropertyField.tsx +41 -0
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +113 -0
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +250 -0
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +125 -0
- package/src/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.tsx +20 -0
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +153 -0
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +210 -0
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +117 -0
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +163 -0
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +346 -0
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +106 -0
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +360 -0
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +148 -0
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +90 -0
- package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +47 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +915 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +29 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +614 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/index.ts +6 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/property_paths.ts +93 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +52 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +63 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +117 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +154 -0
- package/src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx +29 -0
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +112 -0
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +183 -0
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +88 -0
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +42 -0
- package/src/collection_editor/ui/collection_editor/util.ts +28 -0
- package/src/collection_editor/ui/collection_editor/utils/strings.ts +1 -0
- package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +34 -0
- package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +281 -0
- package/src/collection_editor/useCollectionEditorController.tsx +9 -0
- package/src/collection_editor/useCollectionsConfigController.tsx +9 -0
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +120 -0
- package/src/collection_editor/validateCollectionJson.ts +379 -0
- package/src/collection_editor_ui.ts +15 -0
- package/src/components/AdminModeSyncer.tsx +56 -0
- package/src/components/ArrayContainer.tsx +538 -0
- package/src/components/ClearFilterSortButton.tsx +48 -0
- package/src/components/CollectionEditorDialogs.tsx +68 -0
- package/src/components/DefaultAppBar.tsx +242 -0
- package/src/components/DefaultDrawer.tsx +347 -0
- package/src/components/DeleteEntityDialog.tsx +182 -0
- package/src/components/DrawerNavigationGroup.tsx +130 -0
- package/src/components/DrawerNavigationItem.tsx +65 -0
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +233 -0
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +385 -0
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +171 -0
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +340 -0
- package/src/components/EntityCollectionTable/column_utils.tsx +75 -0
- package/src/components/EntityCollectionTable/fields/TableMultipleRelationField.tsx +130 -0
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +172 -0
- package/src/components/EntityCollectionTable/fields/TableRelationField.tsx +181 -0
- package/src/components/EntityCollectionTable/fields/TableRelationSelectorField.tsx +42 -0
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +322 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableDateField.tsx +39 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableInput.tsx +90 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +80 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableSelect.tsx +133 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableSwitch.tsx +32 -0
- package/src/components/EntityCollectionTable/fields/VirtualTableUserSelect.tsx +41 -0
- package/src/components/EntityCollectionTable/index.tsx +14 -0
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +102 -0
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +310 -0
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +81 -0
- package/src/components/EntityCollectionTable/internal/common.tsx +73 -0
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +418 -0
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +96 -0
- package/src/components/EntityCollectionTable/internal/popup_field/useWindowSize.tsx +22 -0
- package/src/components/EntityCollectionTable/table_bindings.tsx +346 -0
- package/src/components/EntityCollectionView/Board.tsx +474 -0
- package/src/components/EntityCollectionView/BoardColumn.tsx +158 -0
- package/src/components/EntityCollectionView/BoardColumnTitle.tsx +45 -0
- package/src/components/EntityCollectionView/BoardSortableList.tsx +177 -0
- package/src/components/EntityCollectionView/EntityBoardCard.tsx +264 -0
- package/src/components/EntityCollectionView/EntityCard.tsx +224 -0
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +614 -0
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +267 -0
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +816 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +1277 -0
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +179 -0
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +148 -0
- package/src/components/EntityCollectionView/FiltersDialog.tsx +242 -0
- package/src/components/EntityCollectionView/SplitListView.tsx +314 -0
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +199 -0
- package/src/components/EntityCollectionView/board_types.ts +113 -0
- package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +79 -0
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +140 -0
- package/src/components/EntityCollectionView/useBoardDataController.tsx +675 -0
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +442 -0
- package/src/components/EntityCollectionView/useSelectionController.tsx +39 -0
- package/src/components/EntityCollectionView/utils.ts +19 -0
- package/src/components/EntityEditView.tsx +632 -0
- package/src/components/EntityEditViewFormActions.tsx +352 -0
- package/src/components/EntityJsonPreview.tsx +66 -0
- package/src/components/EntityPreview.tsx +372 -0
- package/src/components/EntitySidePanel.tsx +160 -0
- package/src/components/EntityView.tsx +69 -0
- package/src/components/FieldCaption.tsx +14 -0
- package/src/components/HomePage/ContentHomePage.tsx +567 -0
- package/src/components/HomePage/FavouritesView.tsx +61 -0
- package/src/components/HomePage/HomePageDnD.tsx +703 -0
- package/src/components/HomePage/NavigationCard.tsx +88 -0
- package/src/components/HomePage/NavigationCardBinding.tsx +108 -0
- package/src/components/HomePage/NavigationGroup.tsx +157 -0
- package/src/components/HomePage/RenameGroupDialog.tsx +123 -0
- package/src/components/HomePage/SmallNavigationCard.tsx +46 -0
- package/src/components/HomePage/index.tsx +5 -0
- package/src/components/PropertyCollectionView.tsx +335 -0
- package/src/components/PropertyConfigBadge.tsx +27 -0
- package/src/components/PropertyIdCopyTooltip.tsx +48 -0
- package/src/components/RebaseAuthGate.tsx +42 -0
- package/src/components/RebaseCMS.tsx +27 -0
- package/src/components/RebaseLayout.tsx +73 -0
- package/src/components/RebaseNavigation.tsx +230 -0
- package/src/components/RebaseRouteDefs.tsx +130 -0
- package/src/components/RebaseShell.tsx +70 -0
- package/src/components/ReferenceTable/EntitySelectionTable.tsx +363 -0
- package/src/components/ReferenceWidget.tsx +155 -0
- package/src/components/RelationSelector.tsx +672 -0
- package/src/components/SearchIconsView.tsx +96 -0
- package/src/components/SelectableTable/SelectableTable.tsx +356 -0
- package/src/components/SelectableTable/SelectableTableContext.tsx +6 -0
- package/src/components/SelectableTable/SelectionStore.ts +67 -0
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +51 -0
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +125 -0
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +208 -0
- package/src/components/SelectableTable/filters/RelationFilterField.tsx +138 -0
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +221 -0
- package/src/components/SideDialogs.tsx +208 -0
- package/src/components/SideEntityProvider.tsx +76 -0
- package/src/components/UserSelector.tsx +339 -0
- package/src/components/admin/RoleChip.tsx +23 -0
- package/src/components/admin/RolesView.tsx +419 -0
- package/src/components/admin/UsersView.tsx +782 -0
- package/src/components/admin/index.ts +3 -0
- package/src/components/app/AppBar.tsx +17 -0
- package/src/components/app/Drawer.tsx +30 -0
- package/src/components/app/Scaffold.tsx +242 -0
- package/src/components/app/index.ts +4 -0
- package/src/components/app/useApp.tsx +36 -0
- package/src/components/common/default_entity_actions.tsx +156 -0
- package/src/components/common/index.ts +1 -0
- package/src/components/field_configs.tsx +423 -0
- package/src/components/history/EntityHistoryEntry.tsx +182 -0
- package/src/components/history/EntityHistoryView.tsx +191 -0
- package/src/components/history/LastEditedByFormAction.tsx +24 -0
- package/src/components/history/LastEditedByIndicator.tsx +98 -0
- package/src/components/history/UserChip.tsx +15 -0
- package/src/components/history/index.tsx +5 -0
- package/src/components/index.ts +55 -0
- package/src/contexts/BreacrumbsContext.tsx +53 -0
- package/src/contexts/SideDialogsControllerContext.tsx +5 -0
- package/src/contexts/SideEntityControllerContext.tsx +5 -0
- package/src/data_export/export/BasicExportAction.tsx +143 -0
- package/src/data_export/export/ExportCollectionAction.tsx +266 -0
- package/src/data_export/export/export.ts +248 -0
- package/src/data_export/export/index.ts +3 -0
- package/src/data_export/index.ts +1 -0
- package/src/data_import/components/DataNewPropertiesMapping.tsx +231 -0
- package/src/data_import/components/ImportFileUpload.tsx +43 -0
- package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +60 -0
- package/src/data_import/components/ImportSaveInProgress.tsx +121 -0
- package/src/data_import/components/index.ts +4 -0
- package/src/data_import/hooks/index.ts +1 -0
- package/src/data_import/hooks/useImportConfig.tsx +34 -0
- package/src/data_import/import/ImportCollectionAction.tsx +436 -0
- package/src/data_import/import/index.ts +1 -0
- package/src/data_import/index.ts +5 -0
- package/src/data_import/types/column_mapping.ts +32 -0
- package/src/data_import/types/index.ts +1 -0
- package/src/data_import/utils/data.ts +148 -0
- package/src/data_import/utils/file_headers.ts +90 -0
- package/src/data_import/utils/file_to_json.ts +106 -0
- package/src/data_import/utils/get_import_inference_type.ts +27 -0
- package/src/data_import/utils/get_properties_mapping.ts +67 -0
- package/src/data_import/utils/index.ts +3 -0
- package/src/editor/components/SlashCommandMenu.tsx +517 -0
- package/src/editor/components/editor-bubble-item.tsx +32 -0
- package/src/editor/components/editor-bubble.tsx +120 -0
- package/src/editor/components/image-bubble.tsx +165 -0
- package/src/editor/components/index.ts +14 -0
- package/src/editor/components/table-bubble.tsx +171 -0
- package/src/editor/editor.tsx +510 -0
- package/src/editor/extensions/HighlightDecorationExtension.ts +114 -0
- package/src/editor/extensions/Image/index.ts +133 -0
- package/src/editor/extensions/Image.ts +159 -0
- package/src/editor/extensions/TextLoadingDecorationExtension.tsx +107 -0
- package/src/editor/extensions/clipboard.ts +72 -0
- package/src/editor/extensions/custom-keymap.ts +25 -0
- package/src/editor/extensions/drag-and-drop.tsx +508 -0
- package/src/editor/hooks/useProseMirror.ts +126 -0
- package/src/editor/hooks/useProseMirrorContext.ts +15 -0
- package/src/editor/index.ts +2 -0
- package/src/editor/markdown.ts +205 -0
- package/src/editor/nodeViews/ImageComponent.tsx +20 -0
- package/src/editor/nodeViews/ReactNodeView.tsx +89 -0
- package/src/editor/nodeViews/TaskItemComponent.tsx +29 -0
- package/src/editor/nodeViews/index.ts +35 -0
- package/src/editor/plugins/index.ts +58 -0
- package/src/editor/plugins/inputrules.ts +82 -0
- package/src/editor/plugins/placeholderPlugin.ts +55 -0
- package/src/editor/plugins/slashCommandPlugin.ts +65 -0
- package/src/editor/schema.ts +263 -0
- package/src/editor/selectors/ai-selector.tsx +111 -0
- package/src/editor/selectors/color-selector.tsx +200 -0
- package/src/editor/selectors/link-selector.tsx +119 -0
- package/src/editor/selectors/node-selector.tsx +145 -0
- package/src/editor/selectors/text-buttons.tsx +80 -0
- package/src/editor/types.ts +6 -0
- package/src/editor/useProseMirror.ts +125 -0
- package/src/editor/utils/prosemirror-utils.ts +113 -0
- package/src/editor/utils/remove_classes.ts +17 -0
- package/src/editor/utils/useDebouncedCallback.ts +25 -0
- package/src/form/EntityForm.tsx +855 -0
- package/src/form/EntityFormActions.tsx +214 -0
- package/src/form/PropertyFieldBinding.tsx +344 -0
- package/src/form/components/ErrorFocus.tsx +44 -0
- package/src/form/components/FieldHelperText.tsx +85 -0
- package/src/form/components/FormEntry.tsx +22 -0
- package/src/form/components/FormLayout.tsx +16 -0
- package/src/form/components/LabelWithIcon.tsx +43 -0
- package/src/form/components/LabelWithIconAndTooltip.tsx +28 -0
- package/src/form/components/LocalChangesMenu.tsx +132 -0
- package/src/form/components/StorageItemPreview.tsx +82 -0
- package/src/form/components/StorageUploadProgress.tsx +105 -0
- package/src/form/components/index.tsx +5 -0
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +107 -0
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +171 -0
- package/src/form/field_bindings/BlockFieldBinding.tsx +280 -0
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +72 -0
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +554 -0
- package/src/form/field_bindings/MapFieldBinding.tsx +162 -0
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +232 -0
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +123 -0
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +157 -0
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +66 -0
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +141 -0
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +141 -0
- package/src/form/field_bindings/RelationFieldBinding.tsx +184 -0
- package/src/form/field_bindings/RepeatFieldBinding.tsx +139 -0
- package/src/form/field_bindings/SelectFieldBinding.tsx +110 -0
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +493 -0
- package/src/form/field_bindings/SwitchFieldBinding.tsx +65 -0
- package/src/form/field_bindings/TextFieldBinding.tsx +156 -0
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +66 -0
- package/src/form/index.tsx +27 -0
- package/src/form/useClearRestoreValue.tsx +36 -0
- package/src/form/validation.ts +519 -0
- package/src/hooks/index.ts +15 -0
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +20 -0
- package/src/hooks/navigation/contexts/NavigationStateContext.tsx +16 -0
- package/src/hooks/navigation/contexts/UrlContext.tsx +25 -0
- package/src/hooks/navigation/contexts/index.ts +14 -0
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +171 -0
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +133 -0
- package/src/hooks/navigation/useBuildUrlController.tsx +66 -0
- package/src/hooks/navigation/useNavigationRegistry.ts +153 -0
- package/src/hooks/navigation/useNavigationResolution.ts +91 -0
- package/src/hooks/navigation/useNavigationURLs.ts +56 -0
- package/src/hooks/navigation/useResolvedCollections.ts +133 -0
- package/src/hooks/navigation/useResolvedViews.tsx +216 -0
- package/src/hooks/navigation/useTopLevelNavigation.ts +257 -0
- package/src/hooks/navigation/utils.ts +176 -0
- package/src/hooks/useBreadcrumbsController.tsx +49 -0
- package/src/hooks/useBuildSideDialogsController.tsx +145 -0
- package/src/hooks/useBuildSideEntityController.tsx +310 -0
- package/src/hooks/useCMSContext.tsx +79 -0
- package/src/hooks/useEntityHistory.ts +167 -0
- package/src/hooks/useEntitySelectionDialog.tsx +57 -0
- package/src/hooks/useResolvedNavigationFrom.tsx +160 -0
- package/src/hooks/useSideDialogsController.tsx +25 -0
- package/src/hooks/useSideEntityController.tsx +13 -0
- package/src/index.ts +95 -0
- package/src/preview/PropertyPreview.tsx +292 -0
- package/src/preview/components/ArrayEnumPreview.tsx +39 -0
- package/src/preview/components/BooleanPreview.tsx +25 -0
- package/src/preview/components/DatePreview.tsx +93 -0
- package/src/preview/components/EmptyValue.tsx +10 -0
- package/src/preview/components/EnumValuesChip.tsx +39 -0
- package/src/preview/components/ImagePreview.tsx +143 -0
- package/src/preview/components/ReferencePreview.tsx +166 -0
- package/src/preview/components/RelationPreview.tsx +160 -0
- package/src/preview/components/StorageThumbnail.tsx +90 -0
- package/src/preview/components/UrlComponentPreview.tsx +115 -0
- package/src/preview/components/UserPreview.tsx +30 -0
- package/src/preview/index.ts +25 -0
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +73 -0
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +44 -0
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +50 -0
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +49 -0
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +44 -0
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +72 -0
- package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +35 -0
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +70 -0
- package/src/preview/property_previews/MapPropertyPreview.tsx +146 -0
- package/src/preview/property_previews/NumberPropertyPreview.tsx +29 -0
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +277 -0
- package/src/preview/property_previews/StringPropertyPreview.tsx +59 -0
- package/src/preview/util.ts +30 -0
- package/src/routes/CustomViewRoute.tsx +24 -0
- package/src/routes/RebaseRoute.tsx +344 -0
- package/src/routes/index.ts +2 -0
- package/src/types/components/EntityFormActionsProps.tsx +20 -0
- package/src/types/components/EntityFormProps.tsx +54 -0
- package/src/types/components/PropertyPreviewProps.tsx +59 -0
- package/src/types/components/formex.tsx +46 -0
- package/src/types/components/index.ts +3 -0
- package/src/types/fields.tsx +299 -0
- package/src/types/index.ts +4 -0
- package/src/util/entity_actions.ts +28 -0
- package/src/util/index.ts +5 -0
- package/src/util/navigation_utils.ts +69 -0
- package/src/util/previews.ts +50 -0
- package/src/util/property_utils.tsx +215 -0
- package/src/util/resolutions.ts +71 -0
|
@@ -0,0 +1,1786 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useState, useRef, useEffect, useCallback, useMemo } from "react";
|
|
3
|
+
import Fuse from "fuse.js";
|
|
4
|
+
import { Chip, Collapse, cls, IconButton, iconSize, ExpandablePanel, Typography, Markdown, Card, DialogTitle, TextField, DialogContent, Button, DialogActions, Dialog, Container, SearchBar, ErrorBoundary } from "@rebasepro/ui";
|
|
5
|
+
import { c } from "react-compiler-runtime";
|
|
6
|
+
import { useNavigate } from "react-router-dom";
|
|
7
|
+
import { StarIcon, PencilIcon, ArrowRightIcon } from "lucide-react";
|
|
8
|
+
import { useUserConfigurationPersistence, useTranslation, useRebaseContext, useSlot, IconForView, useCustomizationController, useAdminModeController, STUDIO_NAVIGATION_GROUPS, useCollapsedGroups, useRestoreScroll } from "@rebasepro/core";
|
|
9
|
+
import "fast-equals";
|
|
10
|
+
import "@rebasepro/common";
|
|
11
|
+
import "@rebasepro/formex";
|
|
12
|
+
import "zod";
|
|
13
|
+
import "@rebasepro/utils";
|
|
14
|
+
import { m as useNavigationStateController, k as useCMSContext, i as useBreadcrumbsController } from "./util-BQ82ySL3.js";
|
|
15
|
+
import "date-fns";
|
|
16
|
+
import "date-fns/locale";
|
|
17
|
+
import "@rebasepro/types";
|
|
18
|
+
import { useSensor, MouseSensor, TouchSensor, KeyboardSensor, useSensors, closestCenter, pointerWithin, closestCorners, getFirstCollision, rectIntersection, useDroppable, useDndMonitor, DndContext, MeasuringStrategy, DragOverlay } from "@dnd-kit/core";
|
|
19
|
+
import { restrictToVerticalAxis, restrictToWindowEdges } from "@dnd-kit/modifiers";
|
|
20
|
+
import { useSortable, arrayMove, defaultAnimateLayoutChanges, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
21
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
22
|
+
import "react-dropzone";
|
|
23
|
+
import "react-router";
|
|
24
|
+
import "xlsx";
|
|
25
|
+
import "@rebasepro/schema-inference";
|
|
26
|
+
function NavigationChip(t0) {
|
|
27
|
+
const $ = c(18);
|
|
28
|
+
const {
|
|
29
|
+
entry
|
|
30
|
+
} = t0;
|
|
31
|
+
const navigate = useNavigate();
|
|
32
|
+
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
33
|
+
if (!userConfigurationPersistence) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
let t1;
|
|
37
|
+
if ($[0] !== entry.slug || $[1] !== userConfigurationPersistence.favouritePaths) {
|
|
38
|
+
t1 = userConfigurationPersistence.favouritePaths.includes(entry.slug);
|
|
39
|
+
$[0] = entry.slug;
|
|
40
|
+
$[1] = userConfigurationPersistence.favouritePaths;
|
|
41
|
+
$[2] = t1;
|
|
42
|
+
} else {
|
|
43
|
+
t1 = $[2];
|
|
44
|
+
}
|
|
45
|
+
const favourite = t1;
|
|
46
|
+
let t2;
|
|
47
|
+
if ($[3] !== entry.slug || $[4] !== favourite || $[5] !== userConfigurationPersistence) {
|
|
48
|
+
t2 = (e) => {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
e.stopPropagation();
|
|
51
|
+
if (favourite) {
|
|
52
|
+
userConfigurationPersistence.setFavouritePaths(userConfigurationPersistence.favouritePaths.filter((p) => p !== entry.slug));
|
|
53
|
+
} else {
|
|
54
|
+
userConfigurationPersistence.setFavouritePaths([...userConfigurationPersistence.favouritePaths, entry.slug]);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
$[3] = entry.slug;
|
|
58
|
+
$[4] = favourite;
|
|
59
|
+
$[5] = userConfigurationPersistence;
|
|
60
|
+
$[6] = t2;
|
|
61
|
+
} else {
|
|
62
|
+
t2 = $[6];
|
|
63
|
+
}
|
|
64
|
+
const onIconClick = t2;
|
|
65
|
+
let t3;
|
|
66
|
+
if ($[7] !== entry.url || $[8] !== navigate) {
|
|
67
|
+
t3 = () => navigate(entry.url);
|
|
68
|
+
$[7] = entry.url;
|
|
69
|
+
$[8] = navigate;
|
|
70
|
+
$[9] = t3;
|
|
71
|
+
} else {
|
|
72
|
+
t3 = $[9];
|
|
73
|
+
}
|
|
74
|
+
const t4 = favourite ? "text-secondary" : "text-surface-400 dark:text-surface-500";
|
|
75
|
+
let t5;
|
|
76
|
+
if ($[10] !== onIconClick || $[11] !== t4) {
|
|
77
|
+
t5 = /* @__PURE__ */ jsx(StarIcon, { onClick: onIconClick, size: "small", className: t4 });
|
|
78
|
+
$[10] = onIconClick;
|
|
79
|
+
$[11] = t4;
|
|
80
|
+
$[12] = t5;
|
|
81
|
+
} else {
|
|
82
|
+
t5 = $[12];
|
|
83
|
+
}
|
|
84
|
+
let t6;
|
|
85
|
+
if ($[13] !== entry.name || $[14] !== entry.slug || $[15] !== t3 || $[16] !== t5) {
|
|
86
|
+
t6 = /* @__PURE__ */ jsx(Chip, { onClick: t3, icon: t5, children: entry.name }, entry.slug);
|
|
87
|
+
$[13] = entry.name;
|
|
88
|
+
$[14] = entry.slug;
|
|
89
|
+
$[15] = t3;
|
|
90
|
+
$[16] = t5;
|
|
91
|
+
$[17] = t6;
|
|
92
|
+
} else {
|
|
93
|
+
t6 = $[17];
|
|
94
|
+
}
|
|
95
|
+
return t6;
|
|
96
|
+
}
|
|
97
|
+
function FavouritesView(t0) {
|
|
98
|
+
const $ = c(17);
|
|
99
|
+
const navigationStateController = useNavigationStateController();
|
|
100
|
+
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
101
|
+
if (!userConfigurationPersistence) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
let t1;
|
|
105
|
+
if ($[0] !== userConfigurationPersistence?.favouritePaths) {
|
|
106
|
+
t1 = userConfigurationPersistence?.favouritePaths ?? [];
|
|
107
|
+
$[0] = userConfigurationPersistence?.favouritePaths;
|
|
108
|
+
$[1] = t1;
|
|
109
|
+
} else {
|
|
110
|
+
t1 = $[1];
|
|
111
|
+
}
|
|
112
|
+
let T0;
|
|
113
|
+
let t2;
|
|
114
|
+
let t3;
|
|
115
|
+
let t4;
|
|
116
|
+
if ($[2] !== navigationStateController || $[3] !== t1) {
|
|
117
|
+
let t52;
|
|
118
|
+
if ($[8] !== navigationStateController) {
|
|
119
|
+
t52 = (path) => navigationStateController.topLevelNavigation?.navigationEntries.find((entry) => entry.slug === path);
|
|
120
|
+
$[8] = navigationStateController;
|
|
121
|
+
$[9] = t52;
|
|
122
|
+
} else {
|
|
123
|
+
t52 = $[9];
|
|
124
|
+
}
|
|
125
|
+
const favouriteCollections = t1.map(t52).filter(Boolean);
|
|
126
|
+
T0 = Collapse;
|
|
127
|
+
t4 = favouriteCollections.length > 0;
|
|
128
|
+
t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
|
|
129
|
+
t3 = favouriteCollections.map(_temp$1);
|
|
130
|
+
$[2] = navigationStateController;
|
|
131
|
+
$[3] = t1;
|
|
132
|
+
$[4] = T0;
|
|
133
|
+
$[5] = t2;
|
|
134
|
+
$[6] = t3;
|
|
135
|
+
$[7] = t4;
|
|
136
|
+
} else {
|
|
137
|
+
T0 = $[4];
|
|
138
|
+
t2 = $[5];
|
|
139
|
+
t3 = $[6];
|
|
140
|
+
t4 = $[7];
|
|
141
|
+
}
|
|
142
|
+
let t5;
|
|
143
|
+
if ($[10] !== t2 || $[11] !== t3) {
|
|
144
|
+
t5 = /* @__PURE__ */ jsx("div", { className: t2, children: t3 });
|
|
145
|
+
$[10] = t2;
|
|
146
|
+
$[11] = t3;
|
|
147
|
+
$[12] = t5;
|
|
148
|
+
} else {
|
|
149
|
+
t5 = $[12];
|
|
150
|
+
}
|
|
151
|
+
let t6;
|
|
152
|
+
if ($[13] !== T0 || $[14] !== t4 || $[15] !== t5) {
|
|
153
|
+
t6 = /* @__PURE__ */ jsx(T0, { in: t4, children: t5 });
|
|
154
|
+
$[13] = T0;
|
|
155
|
+
$[14] = t4;
|
|
156
|
+
$[15] = t5;
|
|
157
|
+
$[16] = t6;
|
|
158
|
+
} else {
|
|
159
|
+
t6 = $[16];
|
|
160
|
+
}
|
|
161
|
+
return t6;
|
|
162
|
+
}
|
|
163
|
+
function _temp$1(entry_0) {
|
|
164
|
+
return /* @__PURE__ */ jsx(NavigationChip, { entry: entry_0 }, entry_0.slug);
|
|
165
|
+
}
|
|
166
|
+
function NavigationGroup(t0) {
|
|
167
|
+
const $ = c(45);
|
|
168
|
+
const {
|
|
169
|
+
children,
|
|
170
|
+
group,
|
|
171
|
+
minimised,
|
|
172
|
+
isPreview,
|
|
173
|
+
isPotentialCardDropTarget,
|
|
174
|
+
onEditGroup,
|
|
175
|
+
dndDisabled,
|
|
176
|
+
collapsed,
|
|
177
|
+
onToggleCollapsed
|
|
178
|
+
} = t0;
|
|
179
|
+
const {
|
|
180
|
+
t
|
|
181
|
+
} = useTranslation();
|
|
182
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
183
|
+
let t1;
|
|
184
|
+
if ($[0] !== group || $[1] !== t) {
|
|
185
|
+
t1 = group ?? t("views_group");
|
|
186
|
+
$[0] = group;
|
|
187
|
+
$[1] = t;
|
|
188
|
+
$[2] = t1;
|
|
189
|
+
} else {
|
|
190
|
+
t1 = $[2];
|
|
191
|
+
}
|
|
192
|
+
const currentGroupName = t1;
|
|
193
|
+
const showCaret = !isPreview && !!onToggleCollapsed;
|
|
194
|
+
const t2 = isPreview ? "px-1 py-0.5" : "";
|
|
195
|
+
let t3;
|
|
196
|
+
if ($[3] !== t2) {
|
|
197
|
+
t3 = cls("flex items-center", t2);
|
|
198
|
+
$[3] = t2;
|
|
199
|
+
$[4] = t3;
|
|
200
|
+
} else {
|
|
201
|
+
t3 = $[4];
|
|
202
|
+
}
|
|
203
|
+
const t4 = isPreview ? "body2" : "caption";
|
|
204
|
+
let t5;
|
|
205
|
+
if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
206
|
+
t5 = cls("p-4 py-2 rounded", "font-medium text-sm text-surface-600 dark:text-surface-400");
|
|
207
|
+
$[5] = t5;
|
|
208
|
+
} else {
|
|
209
|
+
t5 = $[5];
|
|
210
|
+
}
|
|
211
|
+
let t6;
|
|
212
|
+
if ($[6] !== currentGroupName || $[7] !== t4) {
|
|
213
|
+
t6 = /* @__PURE__ */ jsx(Typography, { variant: t4, component: "h2", color: "secondary", className: t5, children: currentGroupName });
|
|
214
|
+
$[6] = currentGroupName;
|
|
215
|
+
$[7] = t4;
|
|
216
|
+
$[8] = t6;
|
|
217
|
+
} else {
|
|
218
|
+
t6 = $[8];
|
|
219
|
+
}
|
|
220
|
+
let t7;
|
|
221
|
+
if ($[9] !== currentGroupName || $[10] !== dndDisabled || $[11] !== isHovered || $[12] !== isPreview || $[13] !== onEditGroup) {
|
|
222
|
+
t7 = !isPreview && onEditGroup && !dndDisabled && /* @__PURE__ */ jsx(IconButton, { size: "smallest", onClick: (e) => {
|
|
223
|
+
e.stopPropagation();
|
|
224
|
+
onEditGroup(currentGroupName);
|
|
225
|
+
}, className: cls("ml-2 ", isHovered ? "opacity-100" : "opacity-0", "transition-opacity duration-100"), children: /* @__PURE__ */ jsx(PencilIcon, { size: iconSize.smallest }) });
|
|
226
|
+
$[9] = currentGroupName;
|
|
227
|
+
$[10] = dndDisabled;
|
|
228
|
+
$[11] = isHovered;
|
|
229
|
+
$[12] = isPreview;
|
|
230
|
+
$[13] = onEditGroup;
|
|
231
|
+
$[14] = t7;
|
|
232
|
+
} else {
|
|
233
|
+
t7 = $[14];
|
|
234
|
+
}
|
|
235
|
+
let t8;
|
|
236
|
+
if ($[15] !== t3 || $[16] !== t6 || $[17] !== t7) {
|
|
237
|
+
t8 = /* @__PURE__ */ jsxs("div", { className: t3, children: [
|
|
238
|
+
t6,
|
|
239
|
+
t7
|
|
240
|
+
] });
|
|
241
|
+
$[15] = t3;
|
|
242
|
+
$[16] = t6;
|
|
243
|
+
$[17] = t7;
|
|
244
|
+
$[18] = t8;
|
|
245
|
+
} else {
|
|
246
|
+
t8 = $[18];
|
|
247
|
+
}
|
|
248
|
+
const TitleContent = t8;
|
|
249
|
+
const t9 = !isPotentialCardDropTarget ? "my-10" : "my-6";
|
|
250
|
+
let t10;
|
|
251
|
+
if ($[19] !== t9) {
|
|
252
|
+
t10 = cls(t9, "transition-all duration-200 ease-in-out");
|
|
253
|
+
$[19] = t9;
|
|
254
|
+
$[20] = t10;
|
|
255
|
+
} else {
|
|
256
|
+
t10 = $[20];
|
|
257
|
+
}
|
|
258
|
+
let t11;
|
|
259
|
+
if ($[21] !== TitleContent || $[22] !== children || $[23] !== isPreview) {
|
|
260
|
+
t11 = isPreview && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
261
|
+
/* @__PURE__ */ jsx("div", { className: cls("flex items-center justify-between w-full", "p-4 py-2"), onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: TitleContent }),
|
|
262
|
+
children
|
|
263
|
+
] });
|
|
264
|
+
$[21] = TitleContent;
|
|
265
|
+
$[22] = children;
|
|
266
|
+
$[23] = isPreview;
|
|
267
|
+
$[24] = t11;
|
|
268
|
+
} else {
|
|
269
|
+
t11 = $[24];
|
|
270
|
+
}
|
|
271
|
+
let t12;
|
|
272
|
+
if ($[25] !== TitleContent || $[26] !== children || $[27] !== collapsed || $[28] !== isPreview || $[29] !== minimised || $[30] !== onToggleCollapsed || $[31] !== showCaret) {
|
|
273
|
+
t12 = !isPreview && showCaret && /* @__PURE__ */ jsx(ExpandablePanel, { invisible: true, expanded: !collapsed, onExpandedChange: (open) => {
|
|
274
|
+
if (open !== !collapsed) {
|
|
275
|
+
onToggleCollapsed?.();
|
|
276
|
+
}
|
|
277
|
+
}, 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: {
|
|
278
|
+
minHeight: "50px"
|
|
279
|
+
} }) : /* @__PURE__ */ jsx("div", { className: cls("mt-4", !minimised ? "pt-0" : ""), children }) });
|
|
280
|
+
$[25] = TitleContent;
|
|
281
|
+
$[26] = children;
|
|
282
|
+
$[27] = collapsed;
|
|
283
|
+
$[28] = isPreview;
|
|
284
|
+
$[29] = minimised;
|
|
285
|
+
$[30] = onToggleCollapsed;
|
|
286
|
+
$[31] = showCaret;
|
|
287
|
+
$[32] = t12;
|
|
288
|
+
} else {
|
|
289
|
+
t12 = $[32];
|
|
290
|
+
}
|
|
291
|
+
let t13;
|
|
292
|
+
if ($[33] !== TitleContent || $[34] !== children || $[35] !== collapsed || $[36] !== isPreview || $[37] !== minimised || $[38] !== showCaret) {
|
|
293
|
+
t13 = !isPreview && !showCaret && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
294
|
+
/* @__PURE__ */ jsx("div", { className: cls("flex items-center justify-between w-full", "mt-6"), onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: TitleContent }),
|
|
295
|
+
!collapsed && (minimised ? /* @__PURE__ */ jsx("div", { className: cls("mt-4 p-8 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg"), style: {
|
|
296
|
+
minHeight: "50px"
|
|
297
|
+
} }) : /* @__PURE__ */ jsx("div", { className: cls("mt-4", !minimised ? "pt-0" : ""), children }))
|
|
298
|
+
] });
|
|
299
|
+
$[33] = TitleContent;
|
|
300
|
+
$[34] = children;
|
|
301
|
+
$[35] = collapsed;
|
|
302
|
+
$[36] = isPreview;
|
|
303
|
+
$[37] = minimised;
|
|
304
|
+
$[38] = showCaret;
|
|
305
|
+
$[39] = t13;
|
|
306
|
+
} else {
|
|
307
|
+
t13 = $[39];
|
|
308
|
+
}
|
|
309
|
+
let t14;
|
|
310
|
+
if ($[40] !== t10 || $[41] !== t11 || $[42] !== t12 || $[43] !== t13) {
|
|
311
|
+
t14 = /* @__PURE__ */ jsxs("div", { className: t10, children: [
|
|
312
|
+
t11,
|
|
313
|
+
t12,
|
|
314
|
+
t13
|
|
315
|
+
] });
|
|
316
|
+
$[40] = t10;
|
|
317
|
+
$[41] = t11;
|
|
318
|
+
$[42] = t12;
|
|
319
|
+
$[43] = t13;
|
|
320
|
+
$[44] = t14;
|
|
321
|
+
} else {
|
|
322
|
+
t14 = $[44];
|
|
323
|
+
}
|
|
324
|
+
return t14;
|
|
325
|
+
}
|
|
326
|
+
const NavigationCard = React__default.memo(function NavigationCard2(t0) {
|
|
327
|
+
const $ = c(31);
|
|
328
|
+
const {
|
|
329
|
+
name,
|
|
330
|
+
description,
|
|
331
|
+
icon,
|
|
332
|
+
actions,
|
|
333
|
+
additionalContent,
|
|
334
|
+
onClick,
|
|
335
|
+
shrink
|
|
336
|
+
} = t0;
|
|
337
|
+
const t1 = shrink && "w-full max-w-full min-h-0 scale-75";
|
|
338
|
+
let t2;
|
|
339
|
+
if ($[0] !== t1) {
|
|
340
|
+
t2 = cls("group h-full p-5 cursor-pointer transition-all duration-200 ease-in-out", "border-surface-200/40 dark:border-surface-700/40", "hover:-translate-y-0.5 hover:shadow-md hover:shadow-primary/5", "hover:border-primary/30 dark:hover:border-primary/20", t1);
|
|
341
|
+
$[0] = t1;
|
|
342
|
+
$[1] = t2;
|
|
343
|
+
} else {
|
|
344
|
+
t2 = $[1];
|
|
345
|
+
}
|
|
346
|
+
let t3;
|
|
347
|
+
if ($[2] !== onClick) {
|
|
348
|
+
t3 = () => {
|
|
349
|
+
onClick?.();
|
|
350
|
+
};
|
|
351
|
+
$[2] = onClick;
|
|
352
|
+
$[3] = t3;
|
|
353
|
+
} else {
|
|
354
|
+
t3 = $[3];
|
|
355
|
+
}
|
|
356
|
+
let t4;
|
|
357
|
+
if ($[4] !== icon) {
|
|
358
|
+
t4 = /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-7 h-7 rounded-lg bg-primary/8 dark:bg-primary/10 text-primary/70 dark:text-primary/60 transition-colors duration-200 group-hover:bg-primary/12 dark:group-hover:bg-primary/15 group-hover:text-primary dark:group-hover:text-primary/80", children: icon });
|
|
359
|
+
$[4] = icon;
|
|
360
|
+
$[5] = t4;
|
|
361
|
+
} else {
|
|
362
|
+
t4 = $[5];
|
|
363
|
+
}
|
|
364
|
+
let t5;
|
|
365
|
+
if ($[6] !== name) {
|
|
366
|
+
t5 = /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", component: "h2", children: name });
|
|
367
|
+
$[6] = name;
|
|
368
|
+
$[7] = t5;
|
|
369
|
+
} else {
|
|
370
|
+
t5 = $[7];
|
|
371
|
+
}
|
|
372
|
+
let t6;
|
|
373
|
+
if ($[8] !== t4 || $[9] !== t5) {
|
|
374
|
+
t6 = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
375
|
+
t4,
|
|
376
|
+
t5
|
|
377
|
+
] });
|
|
378
|
+
$[8] = t4;
|
|
379
|
+
$[9] = t5;
|
|
380
|
+
$[10] = t6;
|
|
381
|
+
} else {
|
|
382
|
+
t6 = $[10];
|
|
383
|
+
}
|
|
384
|
+
let t7;
|
|
385
|
+
if ($[11] !== actions) {
|
|
386
|
+
t7 = /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5", onClick: _temp, children: actions });
|
|
387
|
+
$[11] = actions;
|
|
388
|
+
$[12] = t7;
|
|
389
|
+
} else {
|
|
390
|
+
t7 = $[12];
|
|
391
|
+
}
|
|
392
|
+
let t8;
|
|
393
|
+
if ($[13] !== t6 || $[14] !== t7) {
|
|
394
|
+
t8 = /* @__PURE__ */ jsxs("div", { className: "flex items-center w-full justify-between mb-1", children: [
|
|
395
|
+
t6,
|
|
396
|
+
t7
|
|
397
|
+
] });
|
|
398
|
+
$[13] = t6;
|
|
399
|
+
$[14] = t7;
|
|
400
|
+
$[15] = t8;
|
|
401
|
+
} else {
|
|
402
|
+
t8 = $[15];
|
|
403
|
+
}
|
|
404
|
+
let t9;
|
|
405
|
+
if ($[16] !== description) {
|
|
406
|
+
t9 = description && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", component: "div", children: /* @__PURE__ */ jsx(Markdown, { source: description, size: "small" }) });
|
|
407
|
+
$[16] = description;
|
|
408
|
+
$[17] = t9;
|
|
409
|
+
} else {
|
|
410
|
+
t9 = $[17];
|
|
411
|
+
}
|
|
412
|
+
let t10;
|
|
413
|
+
if ($[18] !== t9) {
|
|
414
|
+
t10 = /* @__PURE__ */ jsx("div", { className: "grow pl-[44px]", children: t9 });
|
|
415
|
+
$[18] = t9;
|
|
416
|
+
$[19] = t10;
|
|
417
|
+
} else {
|
|
418
|
+
t10 = $[19];
|
|
419
|
+
}
|
|
420
|
+
let t11;
|
|
421
|
+
if ($[20] !== additionalContent) {
|
|
422
|
+
t11 = additionalContent && /* @__PURE__ */ jsx("div", { className: "pl-[44px] pointer-events-none", children: additionalContent });
|
|
423
|
+
$[20] = additionalContent;
|
|
424
|
+
$[21] = t11;
|
|
425
|
+
} else {
|
|
426
|
+
t11 = $[21];
|
|
427
|
+
}
|
|
428
|
+
let t12;
|
|
429
|
+
if ($[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
430
|
+
t12 = /* @__PURE__ */ jsx("div", { className: "self-end mt-1", children: /* @__PURE__ */ jsx("div", { className: "transition-transform duration-200 group-hover:translate-x-0.5", children: /* @__PURE__ */ jsx(ArrowRightIcon, { className: "text-primary" }) }) });
|
|
431
|
+
$[22] = t12;
|
|
432
|
+
} else {
|
|
433
|
+
t12 = $[22];
|
|
434
|
+
}
|
|
435
|
+
let t13;
|
|
436
|
+
if ($[23] !== t10 || $[24] !== t11 || $[25] !== t8) {
|
|
437
|
+
t13 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full", children: [
|
|
438
|
+
t8,
|
|
439
|
+
t10,
|
|
440
|
+
t11,
|
|
441
|
+
t12
|
|
442
|
+
] });
|
|
443
|
+
$[23] = t10;
|
|
444
|
+
$[24] = t11;
|
|
445
|
+
$[25] = t8;
|
|
446
|
+
$[26] = t13;
|
|
447
|
+
} else {
|
|
448
|
+
t13 = $[26];
|
|
449
|
+
}
|
|
450
|
+
let t14;
|
|
451
|
+
if ($[27] !== t13 || $[28] !== t2 || $[29] !== t3) {
|
|
452
|
+
t14 = /* @__PURE__ */ jsx(Card, { className: t2, onClick: t3, children: t13 });
|
|
453
|
+
$[27] = t13;
|
|
454
|
+
$[28] = t2;
|
|
455
|
+
$[29] = t3;
|
|
456
|
+
$[30] = t14;
|
|
457
|
+
} else {
|
|
458
|
+
t14 = $[30];
|
|
459
|
+
}
|
|
460
|
+
return t14;
|
|
461
|
+
});
|
|
462
|
+
function _temp(event) {
|
|
463
|
+
event.preventDefault();
|
|
464
|
+
event.stopPropagation();
|
|
465
|
+
}
|
|
466
|
+
function NavigationCardBinding(t0) {
|
|
467
|
+
const $ = c(38);
|
|
468
|
+
const {
|
|
469
|
+
slug,
|
|
470
|
+
collection,
|
|
471
|
+
view,
|
|
472
|
+
url,
|
|
473
|
+
name,
|
|
474
|
+
description,
|
|
475
|
+
onClick,
|
|
476
|
+
shrink
|
|
477
|
+
} = t0;
|
|
478
|
+
const userConfigurationPersistence = useUserConfigurationPersistence();
|
|
479
|
+
const t1 = collection ?? view;
|
|
480
|
+
let t2;
|
|
481
|
+
if ($[0] !== t1) {
|
|
482
|
+
t2 = /* @__PURE__ */ jsx(IconForView, { collectionOrView: t1 });
|
|
483
|
+
$[0] = t1;
|
|
484
|
+
$[1] = t2;
|
|
485
|
+
} else {
|
|
486
|
+
t2 = $[1];
|
|
487
|
+
}
|
|
488
|
+
const collectionIcon = t2;
|
|
489
|
+
const navigate = useNavigate();
|
|
490
|
+
const context = useRebaseContext();
|
|
491
|
+
let t3;
|
|
492
|
+
if ($[2] !== userConfigurationPersistence?.favouritePaths) {
|
|
493
|
+
t3 = userConfigurationPersistence?.favouritePaths ?? [];
|
|
494
|
+
$[2] = userConfigurationPersistence?.favouritePaths;
|
|
495
|
+
$[3] = t3;
|
|
496
|
+
} else {
|
|
497
|
+
t3 = $[3];
|
|
498
|
+
}
|
|
499
|
+
let t4;
|
|
500
|
+
if ($[4] !== slug || $[5] !== t3) {
|
|
501
|
+
t4 = t3.includes(slug);
|
|
502
|
+
$[4] = slug;
|
|
503
|
+
$[5] = t3;
|
|
504
|
+
$[6] = t4;
|
|
505
|
+
} else {
|
|
506
|
+
t4 = $[6];
|
|
507
|
+
}
|
|
508
|
+
const favourite = t4;
|
|
509
|
+
let t5;
|
|
510
|
+
if ($[7] !== favourite || $[8] !== slug || $[9] !== userConfigurationPersistence) {
|
|
511
|
+
t5 = userConfigurationPersistence ? [/* @__PURE__ */ jsx(IconButton, { size: "small", onClick: (e) => {
|
|
512
|
+
e.preventDefault();
|
|
513
|
+
e.stopPropagation();
|
|
514
|
+
if (favourite) {
|
|
515
|
+
userConfigurationPersistence.setFavouritePaths(userConfigurationPersistence.favouritePaths.filter((p) => p !== slug));
|
|
516
|
+
} else {
|
|
517
|
+
userConfigurationPersistence.setFavouritePaths([...userConfigurationPersistence.favouritePaths, slug]);
|
|
518
|
+
}
|
|
519
|
+
}, children: /* @__PURE__ */ jsx(StarIcon, { className: favourite ? "text-secondary" : "text-surface-400 dark:text-surface-500" }) }, "favourite")] : [];
|
|
520
|
+
$[7] = favourite;
|
|
521
|
+
$[8] = slug;
|
|
522
|
+
$[9] = userConfigurationPersistence;
|
|
523
|
+
$[10] = t5;
|
|
524
|
+
} else {
|
|
525
|
+
t5 = $[10];
|
|
526
|
+
}
|
|
527
|
+
const actionsArray = t5;
|
|
528
|
+
let t6;
|
|
529
|
+
if ($[11] !== collection || $[12] !== context || $[13] !== slug) {
|
|
530
|
+
t6 = {
|
|
531
|
+
slug,
|
|
532
|
+
collection,
|
|
533
|
+
context
|
|
534
|
+
};
|
|
535
|
+
$[11] = collection;
|
|
536
|
+
$[12] = context;
|
|
537
|
+
$[13] = slug;
|
|
538
|
+
$[14] = t6;
|
|
539
|
+
} else {
|
|
540
|
+
t6 = $[14];
|
|
541
|
+
}
|
|
542
|
+
const pluginCardActions = useSlot("home.collection.actions", t6);
|
|
543
|
+
let t7;
|
|
544
|
+
if ($[15] !== collection || $[16] !== context || $[17] !== slug) {
|
|
545
|
+
t7 = {
|
|
546
|
+
slug,
|
|
547
|
+
collection,
|
|
548
|
+
context
|
|
549
|
+
};
|
|
550
|
+
$[15] = collection;
|
|
551
|
+
$[16] = context;
|
|
552
|
+
$[17] = slug;
|
|
553
|
+
$[18] = t7;
|
|
554
|
+
} else {
|
|
555
|
+
t7 = $[18];
|
|
556
|
+
}
|
|
557
|
+
const pluginCardInsights = useSlot("home.card.insight", t7);
|
|
558
|
+
let t8;
|
|
559
|
+
if ($[19] !== actionsArray || $[20] !== pluginCardActions) {
|
|
560
|
+
t8 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
561
|
+
actionsArray,
|
|
562
|
+
pluginCardActions
|
|
563
|
+
] });
|
|
564
|
+
$[19] = actionsArray;
|
|
565
|
+
$[20] = pluginCardActions;
|
|
566
|
+
$[21] = t8;
|
|
567
|
+
} else {
|
|
568
|
+
t8 = $[21];
|
|
569
|
+
}
|
|
570
|
+
const actions = t8;
|
|
571
|
+
let t9;
|
|
572
|
+
if ($[22] !== pluginCardInsights) {
|
|
573
|
+
t9 = pluginCardInsights.length > 0 ? /* @__PURE__ */ jsx(Fragment, { children: pluginCardInsights }) : void 0;
|
|
574
|
+
$[22] = pluginCardInsights;
|
|
575
|
+
$[23] = t9;
|
|
576
|
+
} else {
|
|
577
|
+
t9 = $[23];
|
|
578
|
+
}
|
|
579
|
+
let t10;
|
|
580
|
+
if ($[24] !== navigate || $[25] !== onClick || $[26] !== slug || $[27] !== url || $[28] !== userConfigurationPersistence) {
|
|
581
|
+
t10 = () => {
|
|
582
|
+
onClick?.();
|
|
583
|
+
navigate(url);
|
|
584
|
+
if (userConfigurationPersistence) {
|
|
585
|
+
userConfigurationPersistence.setRecentlyVisitedPaths([slug, ...(userConfigurationPersistence.recentlyVisitedPaths ?? []).filter((p_0) => p_0 !== slug)]);
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
$[24] = navigate;
|
|
589
|
+
$[25] = onClick;
|
|
590
|
+
$[26] = slug;
|
|
591
|
+
$[27] = url;
|
|
592
|
+
$[28] = userConfigurationPersistence;
|
|
593
|
+
$[29] = t10;
|
|
594
|
+
} else {
|
|
595
|
+
t10 = $[29];
|
|
596
|
+
}
|
|
597
|
+
let t11;
|
|
598
|
+
if ($[30] !== actions || $[31] !== collectionIcon || $[32] !== description || $[33] !== name || $[34] !== shrink || $[35] !== t10 || $[36] !== t9) {
|
|
599
|
+
t11 = /* @__PURE__ */ jsx(NavigationCard, { icon: collectionIcon, name, description, actions, additionalContent: t9, onClick: t10, shrink });
|
|
600
|
+
$[30] = actions;
|
|
601
|
+
$[31] = collectionIcon;
|
|
602
|
+
$[32] = description;
|
|
603
|
+
$[33] = name;
|
|
604
|
+
$[34] = shrink;
|
|
605
|
+
$[35] = t10;
|
|
606
|
+
$[36] = t9;
|
|
607
|
+
$[37] = t11;
|
|
608
|
+
} else {
|
|
609
|
+
t11 = $[37];
|
|
610
|
+
}
|
|
611
|
+
return t11;
|
|
612
|
+
}
|
|
613
|
+
const animateLayoutChanges = (args) => defaultAnimateLayoutChanges({
|
|
614
|
+
...args,
|
|
615
|
+
wasDragging: true
|
|
616
|
+
});
|
|
617
|
+
const dropAnimationConfig = {};
|
|
618
|
+
const cloneSerializableNavigationEntry = (entry) => {
|
|
619
|
+
const clonedEntry = {
|
|
620
|
+
id: entry.id,
|
|
621
|
+
slug: entry.slug,
|
|
622
|
+
url: entry.url,
|
|
623
|
+
name: entry.name,
|
|
624
|
+
type: entry.type,
|
|
625
|
+
collection: entry.collection ? {
|
|
626
|
+
...entry.collection
|
|
627
|
+
} : void 0,
|
|
628
|
+
view: entry.view ? {
|
|
629
|
+
...entry.view
|
|
630
|
+
} : void 0,
|
|
631
|
+
...entry.group && {
|
|
632
|
+
group: entry.group
|
|
633
|
+
},
|
|
634
|
+
...entry.description && {
|
|
635
|
+
description: entry.description
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
return clonedEntry;
|
|
639
|
+
};
|
|
640
|
+
const cloneItemsForDnd = (items) => items.map((g) => ({
|
|
641
|
+
name: g.name,
|
|
642
|
+
entries: g.entries.map(cloneSerializableNavigationEntry)
|
|
643
|
+
}));
|
|
644
|
+
function SortableNavigationCard(t0) {
|
|
645
|
+
const $ = c(17);
|
|
646
|
+
const {
|
|
647
|
+
entry,
|
|
648
|
+
onClick
|
|
649
|
+
} = t0;
|
|
650
|
+
let t1;
|
|
651
|
+
if ($[0] !== entry.url) {
|
|
652
|
+
t1 = {
|
|
653
|
+
id: entry.url,
|
|
654
|
+
animateLayoutChanges
|
|
655
|
+
};
|
|
656
|
+
$[0] = entry.url;
|
|
657
|
+
$[1] = t1;
|
|
658
|
+
} else {
|
|
659
|
+
t1 = $[1];
|
|
660
|
+
}
|
|
661
|
+
const {
|
|
662
|
+
setNodeRef,
|
|
663
|
+
listeners,
|
|
664
|
+
attributes,
|
|
665
|
+
transform,
|
|
666
|
+
transition,
|
|
667
|
+
isDragging
|
|
668
|
+
} = useSortable(t1);
|
|
669
|
+
let t2;
|
|
670
|
+
if ($[2] !== transform) {
|
|
671
|
+
t2 = transform ? CSS.Transform.toString(transform) : void 0;
|
|
672
|
+
$[2] = transform;
|
|
673
|
+
$[3] = t2;
|
|
674
|
+
} else {
|
|
675
|
+
t2 = $[3];
|
|
676
|
+
}
|
|
677
|
+
const t3 = isDragging ? 0 : 1;
|
|
678
|
+
let t4;
|
|
679
|
+
if ($[4] !== t2 || $[5] !== t3 || $[6] !== transition) {
|
|
680
|
+
t4 = {
|
|
681
|
+
transform: t2,
|
|
682
|
+
transition,
|
|
683
|
+
opacity: t3
|
|
684
|
+
};
|
|
685
|
+
$[4] = t2;
|
|
686
|
+
$[5] = t3;
|
|
687
|
+
$[6] = transition;
|
|
688
|
+
$[7] = t4;
|
|
689
|
+
} else {
|
|
690
|
+
t4 = $[7];
|
|
691
|
+
}
|
|
692
|
+
const style = t4;
|
|
693
|
+
let t5;
|
|
694
|
+
if ($[8] !== entry || $[9] !== onClick) {
|
|
695
|
+
t5 = /* @__PURE__ */ jsx(NavigationCardBinding, { ...entry, onClick });
|
|
696
|
+
$[8] = entry;
|
|
697
|
+
$[9] = onClick;
|
|
698
|
+
$[10] = t5;
|
|
699
|
+
} else {
|
|
700
|
+
t5 = $[10];
|
|
701
|
+
}
|
|
702
|
+
let t6;
|
|
703
|
+
if ($[11] !== attributes || $[12] !== listeners || $[13] !== setNodeRef || $[14] !== style || $[15] !== t5) {
|
|
704
|
+
t6 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, ...attributes, ...listeners, children: t5 });
|
|
705
|
+
$[11] = attributes;
|
|
706
|
+
$[12] = listeners;
|
|
707
|
+
$[13] = setNodeRef;
|
|
708
|
+
$[14] = style;
|
|
709
|
+
$[15] = t5;
|
|
710
|
+
$[16] = t6;
|
|
711
|
+
} else {
|
|
712
|
+
t6 = $[16];
|
|
713
|
+
}
|
|
714
|
+
return t6;
|
|
715
|
+
}
|
|
716
|
+
function NavigationGroupDroppable(t0) {
|
|
717
|
+
const $ = c(11);
|
|
718
|
+
const {
|
|
719
|
+
id,
|
|
720
|
+
itemIds,
|
|
721
|
+
children,
|
|
722
|
+
isPotentialCardDropTarget: t1
|
|
723
|
+
} = t0;
|
|
724
|
+
const isPotentialCardDropTarget = t1 === void 0 ? false : t1;
|
|
725
|
+
let t2;
|
|
726
|
+
if ($[0] !== id) {
|
|
727
|
+
t2 = {
|
|
728
|
+
id
|
|
729
|
+
};
|
|
730
|
+
$[0] = id;
|
|
731
|
+
$[1] = t2;
|
|
732
|
+
} else {
|
|
733
|
+
t2 = $[1];
|
|
734
|
+
}
|
|
735
|
+
const {
|
|
736
|
+
setNodeRef
|
|
737
|
+
} = useDroppable(t2);
|
|
738
|
+
const t3 = isPotentialCardDropTarget ? "p-2 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg" : void 0;
|
|
739
|
+
let t4;
|
|
740
|
+
if ($[2] !== t3) {
|
|
741
|
+
t4 = cls(t3, "transition-all duration-200 ease-in-out");
|
|
742
|
+
$[2] = t3;
|
|
743
|
+
$[3] = t4;
|
|
744
|
+
} else {
|
|
745
|
+
t4 = $[3];
|
|
746
|
+
}
|
|
747
|
+
let t5;
|
|
748
|
+
if ($[4] !== children || $[5] !== itemIds) {
|
|
749
|
+
t5 = /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy: rectSortingStrategy, children });
|
|
750
|
+
$[4] = children;
|
|
751
|
+
$[5] = itemIds;
|
|
752
|
+
$[6] = t5;
|
|
753
|
+
} else {
|
|
754
|
+
t5 = $[6];
|
|
755
|
+
}
|
|
756
|
+
let t6;
|
|
757
|
+
if ($[7] !== setNodeRef || $[8] !== t4 || $[9] !== t5) {
|
|
758
|
+
t6 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, className: t4, children: t5 });
|
|
759
|
+
$[7] = setNodeRef;
|
|
760
|
+
$[8] = t4;
|
|
761
|
+
$[9] = t5;
|
|
762
|
+
$[10] = t6;
|
|
763
|
+
} else {
|
|
764
|
+
t6 = $[10];
|
|
765
|
+
}
|
|
766
|
+
return t6;
|
|
767
|
+
}
|
|
768
|
+
function SortableNavigationGroup(t0) {
|
|
769
|
+
const $ = c(15);
|
|
770
|
+
const {
|
|
771
|
+
groupName,
|
|
772
|
+
children,
|
|
773
|
+
disabled
|
|
774
|
+
} = t0;
|
|
775
|
+
let t1;
|
|
776
|
+
if ($[0] !== disabled || $[1] !== groupName) {
|
|
777
|
+
t1 = {
|
|
778
|
+
id: groupName,
|
|
779
|
+
animateLayoutChanges,
|
|
780
|
+
disabled
|
|
781
|
+
};
|
|
782
|
+
$[0] = disabled;
|
|
783
|
+
$[1] = groupName;
|
|
784
|
+
$[2] = t1;
|
|
785
|
+
} else {
|
|
786
|
+
t1 = $[2];
|
|
787
|
+
}
|
|
788
|
+
const {
|
|
789
|
+
attributes,
|
|
790
|
+
listeners,
|
|
791
|
+
setNodeRef,
|
|
792
|
+
transform,
|
|
793
|
+
transition,
|
|
794
|
+
isDragging
|
|
795
|
+
} = useSortable(t1);
|
|
796
|
+
let t2;
|
|
797
|
+
if ($[3] !== transform) {
|
|
798
|
+
t2 = transform ? CSS.Transform.toString(transform) : void 0;
|
|
799
|
+
$[3] = transform;
|
|
800
|
+
$[4] = t2;
|
|
801
|
+
} else {
|
|
802
|
+
t2 = $[4];
|
|
803
|
+
}
|
|
804
|
+
const t3 = isDragging ? 0 : 1;
|
|
805
|
+
let t4;
|
|
806
|
+
if ($[5] !== t2 || $[6] !== t3 || $[7] !== transition) {
|
|
807
|
+
t4 = {
|
|
808
|
+
transform: t2,
|
|
809
|
+
transition,
|
|
810
|
+
opacity: t3
|
|
811
|
+
};
|
|
812
|
+
$[5] = t2;
|
|
813
|
+
$[6] = t3;
|
|
814
|
+
$[7] = transition;
|
|
815
|
+
$[8] = t4;
|
|
816
|
+
} else {
|
|
817
|
+
t4 = $[8];
|
|
818
|
+
}
|
|
819
|
+
const style = t4;
|
|
820
|
+
let t5;
|
|
821
|
+
if ($[9] !== attributes || $[10] !== children || $[11] !== listeners || $[12] !== setNodeRef || $[13] !== style) {
|
|
822
|
+
t5 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, ...attributes, ...listeners, children });
|
|
823
|
+
$[9] = attributes;
|
|
824
|
+
$[10] = children;
|
|
825
|
+
$[11] = listeners;
|
|
826
|
+
$[12] = setNodeRef;
|
|
827
|
+
$[13] = style;
|
|
828
|
+
$[14] = t5;
|
|
829
|
+
} else {
|
|
830
|
+
t5 = $[14];
|
|
831
|
+
}
|
|
832
|
+
return t5;
|
|
833
|
+
}
|
|
834
|
+
function useHomePageDnd({
|
|
835
|
+
items,
|
|
836
|
+
setItems,
|
|
837
|
+
disabled,
|
|
838
|
+
onCardMovedBetweenGroups,
|
|
839
|
+
onGroupMoved,
|
|
840
|
+
onNewGroupDrop,
|
|
841
|
+
onPersist
|
|
842
|
+
}) {
|
|
843
|
+
const dndItems = items;
|
|
844
|
+
const setDndItems = setItems;
|
|
845
|
+
const [activeId, setActiveId] = useState(null);
|
|
846
|
+
const [activeIsGroup, setActiveIsGroup] = useState(false);
|
|
847
|
+
const [currentDraggingGroupId, setCurrentDraggingGroupId] = useState(null);
|
|
848
|
+
const [dndKitActiveNode, setDndKitActiveNode] = useState(null);
|
|
849
|
+
const [isDraggingCardOnly, setIsDraggingCardOnly] = useState(false);
|
|
850
|
+
const [dialogOpenForGroup, setDialogOpenForGroup] = useState(null);
|
|
851
|
+
const [isHoveringNewGroupDropZone, setIsHoveringNewGroupDropZone] = useState(false);
|
|
852
|
+
const [pendingNewGroupName, setPendingNewGroupName] = useState(null);
|
|
853
|
+
const [stateBeforeNewGroup, setStateBeforeNewGroup] = useState(null);
|
|
854
|
+
const preDragItemsRef = useRef(null);
|
|
855
|
+
const interimItemsRef = useRef(null);
|
|
856
|
+
useEffect(() => {
|
|
857
|
+
interimItemsRef.current = dndItems;
|
|
858
|
+
}, [dndItems]);
|
|
859
|
+
const mouseSensor = useSensor(MouseSensor, {
|
|
860
|
+
activationConstraint: {
|
|
861
|
+
distance: 10
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
const touchSensor = useSensor(TouchSensor, {
|
|
865
|
+
activationConstraint: {
|
|
866
|
+
delay: 150,
|
|
867
|
+
tolerance: 5
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
const keyboardSensor = useSensor(KeyboardSensor);
|
|
871
|
+
const sensors = useSensors(mouseSensor, touchSensor, keyboardSensor);
|
|
872
|
+
const dndContainers = dndItems.map((g) => g.name);
|
|
873
|
+
const findDndContainer = useCallback((id) => {
|
|
874
|
+
if (!id) return void 0;
|
|
875
|
+
const group = dndItems.find((g_0) => g_0.name === id);
|
|
876
|
+
if (group) return group.name;
|
|
877
|
+
for (const g_1 of dndItems) {
|
|
878
|
+
if (g_1.entries.some((e) => e.url === id)) return g_1.name;
|
|
879
|
+
}
|
|
880
|
+
return void 0;
|
|
881
|
+
}, [dndItems]);
|
|
882
|
+
const lastOverId = useRef(null);
|
|
883
|
+
const recentlyMovedToNewContainer = useRef(false);
|
|
884
|
+
const collisionDetection = useCallback((args) => {
|
|
885
|
+
if (disabled || !activeId) return [];
|
|
886
|
+
if (activeIsGroup) {
|
|
887
|
+
const groups = args.droppableContainers.filter((c2) => dndItems.some((g_2) => g_2.name === c2.id));
|
|
888
|
+
if (!groups.length) return [];
|
|
889
|
+
return closestCenter({
|
|
890
|
+
...args,
|
|
891
|
+
droppableContainers: groups
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
const pointer = pointerWithin(args);
|
|
895
|
+
if (pointer.length) {
|
|
896
|
+
const zone = pointer.find((c_0) => c_0.id === "new-group-drop-zone");
|
|
897
|
+
if (zone) return [zone];
|
|
898
|
+
const container = pointer.find((c_1) => dndItems.some((g_3) => g_3.name === c_1.id));
|
|
899
|
+
if (container) {
|
|
900
|
+
const itemsIn = dndItems.find((g_4) => g_4.name === container.id)?.entries;
|
|
901
|
+
if (itemsIn?.length) {
|
|
902
|
+
const closest = closestCorners({
|
|
903
|
+
...args,
|
|
904
|
+
droppableContainers: args.droppableContainers.filter((c_2) => itemsIn.some((e_0) => e_0.url === c_2.id))
|
|
905
|
+
});
|
|
906
|
+
if (closest.length) return closest;
|
|
907
|
+
}
|
|
908
|
+
return [container];
|
|
909
|
+
}
|
|
910
|
+
const first = getFirstCollision(pointer, "id");
|
|
911
|
+
if (first) return [{
|
|
912
|
+
id: first
|
|
913
|
+
}];
|
|
914
|
+
}
|
|
915
|
+
const rects = rectIntersection(args);
|
|
916
|
+
const zoneRect = rects.find((c_3) => c_3.id === "new-group-drop-zone");
|
|
917
|
+
if (zoneRect) return [zoneRect];
|
|
918
|
+
let overId = getFirstCollision(rects, "id");
|
|
919
|
+
if (overId != null) {
|
|
920
|
+
const overIsContainer = dndItems.some((g_5) => g_5.name === overId);
|
|
921
|
+
if (overIsContainer) {
|
|
922
|
+
const itemsIn_0 = dndItems.find((g_6) => g_6.name === overId)?.entries;
|
|
923
|
+
if (itemsIn_0?.length) {
|
|
924
|
+
const closestItem = closestCorners({
|
|
925
|
+
...args,
|
|
926
|
+
droppableContainers: args.droppableContainers.filter((c_4) => itemsIn_0.some((e_1) => e_1.url === c_4.id))
|
|
927
|
+
})[0]?.id;
|
|
928
|
+
if (closestItem) overId = closestItem;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
lastOverId.current = overId;
|
|
932
|
+
return [{
|
|
933
|
+
id: overId
|
|
934
|
+
}];
|
|
935
|
+
}
|
|
936
|
+
if (recentlyMovedToNewContainer.current && lastOverId.current && !activeIsGroup) return [{
|
|
937
|
+
id: lastOverId.current
|
|
938
|
+
}];
|
|
939
|
+
return [];
|
|
940
|
+
}, [activeId, dndItems, disabled, activeIsGroup]);
|
|
941
|
+
const handleDragStart = ({
|
|
942
|
+
active
|
|
943
|
+
}) => {
|
|
944
|
+
setDndKitActiveNode(active);
|
|
945
|
+
if (disabled) return;
|
|
946
|
+
preDragItemsRef.current = cloneItemsForDnd(dndItems);
|
|
947
|
+
const isGroup = dndItems.some((g_7) => g_7.name === active.id);
|
|
948
|
+
if (!active.data.current) active.data.current = {};
|
|
949
|
+
active.data.current.type = isGroup ? "group" : "item";
|
|
950
|
+
setActiveId(active.id);
|
|
951
|
+
setActiveIsGroup(isGroup);
|
|
952
|
+
setIsDraggingCardOnly(!isGroup);
|
|
953
|
+
if (isGroup) setCurrentDraggingGroupId(active.id);
|
|
954
|
+
recentlyMovedToNewContainer.current = false;
|
|
955
|
+
};
|
|
956
|
+
const handleDragOver = ({
|
|
957
|
+
active: active_0,
|
|
958
|
+
over
|
|
959
|
+
}) => {
|
|
960
|
+
if (disabled || !over) return;
|
|
961
|
+
const activeIdNow = active_0.id;
|
|
962
|
+
const overIdNow = over.id;
|
|
963
|
+
if (activeIdNow === overIdNow) return;
|
|
964
|
+
if (activeIsGroup) return;
|
|
965
|
+
const activeCont = findDndContainer(activeIdNow);
|
|
966
|
+
const overCont = findDndContainer(overIdNow);
|
|
967
|
+
if (!activeCont) return;
|
|
968
|
+
if (overCont && activeCont !== overCont) {
|
|
969
|
+
recentlyMovedToNewContainer.current = true;
|
|
970
|
+
lastOverId.current = overIdNow;
|
|
971
|
+
setDndItems((current) => {
|
|
972
|
+
const newState = cloneItemsForDnd(current);
|
|
973
|
+
const srcIdx = newState.findIndex((g_8) => g_8.name === activeCont);
|
|
974
|
+
const tgtIdx = newState.findIndex((g_9) => g_9.name === overCont);
|
|
975
|
+
if (srcIdx === -1 || tgtIdx === -1) return current;
|
|
976
|
+
const src = newState[srcIdx];
|
|
977
|
+
const tgt = newState[tgtIdx];
|
|
978
|
+
const idxInSrc = src.entries.findIndex((e_2) => e_2.url === activeIdNow);
|
|
979
|
+
if (idxInSrc === -1) return current;
|
|
980
|
+
const [moved] = src.entries.splice(idxInSrc, 1);
|
|
981
|
+
const overIsContainer_0 = overIdNow === overCont;
|
|
982
|
+
if (overIsContainer_0) {
|
|
983
|
+
tgt.entries.push(moved);
|
|
984
|
+
} else {
|
|
985
|
+
const overIdx = tgt.entries.findIndex((e_3) => e_3.url === overIdNow);
|
|
986
|
+
if (overIdx !== -1) {
|
|
987
|
+
tgt.entries.splice(overIdx, 0, moved);
|
|
988
|
+
} else {
|
|
989
|
+
tgt.entries.push(moved);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
return newState;
|
|
993
|
+
});
|
|
994
|
+
} else if (activeCont === overCont) {
|
|
995
|
+
recentlyMovedToNewContainer.current = false;
|
|
996
|
+
}
|
|
997
|
+
};
|
|
998
|
+
const handleDragEnd = ({
|
|
999
|
+
active: active_1,
|
|
1000
|
+
over: over_0
|
|
1001
|
+
}) => {
|
|
1002
|
+
if (disabled || !over_0) {
|
|
1003
|
+
resetDragState();
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
const activeIdNow_0 = active_1.id;
|
|
1007
|
+
const overIdNow_0 = over_0.id;
|
|
1008
|
+
if (activeIsGroup) {
|
|
1009
|
+
if (activeIdNow_0 !== overIdNow_0 && dndItems.some((g_12) => g_12.name === overIdNow_0)) {
|
|
1010
|
+
const from = dndItems.findIndex((g_10) => g_10.name === activeIdNow_0);
|
|
1011
|
+
const to = dndItems.findIndex((g_11) => g_11.name === overIdNow_0);
|
|
1012
|
+
if (from !== -1 && to !== -1) {
|
|
1013
|
+
const newState_0 = arrayMove(dndItems, from, to);
|
|
1014
|
+
setDndItems(newState_0);
|
|
1015
|
+
onPersist?.(newState_0);
|
|
1016
|
+
onGroupMoved?.(activeIdNow_0, from, to);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
} else {
|
|
1020
|
+
const findContainerInState = (id_0, state) => {
|
|
1021
|
+
const group_0 = state.find((g_13) => g_13.name === id_0);
|
|
1022
|
+
if (group_0) return group_0.name;
|
|
1023
|
+
for (const g_14 of state) {
|
|
1024
|
+
if (g_14.entries.some((e_4) => e_4.url === id_0)) return g_14.name;
|
|
1025
|
+
}
|
|
1026
|
+
return void 0;
|
|
1027
|
+
};
|
|
1028
|
+
const sourceState = preDragItemsRef.current || dndItems;
|
|
1029
|
+
const activeCont_0 = findContainerInState(activeIdNow_0, sourceState);
|
|
1030
|
+
findDndContainer(overIdNow_0);
|
|
1031
|
+
if (overIdNow_0 === "new-group-drop-zone") {
|
|
1032
|
+
if (activeCont_0) {
|
|
1033
|
+
setStateBeforeNewGroup(cloneItemsForDnd(dndItems));
|
|
1034
|
+
const newState_1 = cloneItemsForDnd(dndItems);
|
|
1035
|
+
const srcIdx_0 = newState_1.findIndex((g_15) => g_15.name === activeCont_0);
|
|
1036
|
+
if (srcIdx_0 !== -1) {
|
|
1037
|
+
const src_0 = newState_1[srcIdx_0];
|
|
1038
|
+
const idxInSrc_0 = src_0.entries.findIndex((e_5) => e_5.url === activeIdNow_0);
|
|
1039
|
+
if (idxInSrc_0 !== -1) {
|
|
1040
|
+
const [dragged] = src_0.entries.splice(idxInSrc_0, 1);
|
|
1041
|
+
if (src_0.entries.length === 0) newState_1.splice(srcIdx_0, 1);
|
|
1042
|
+
let tentative = "New Group";
|
|
1043
|
+
let counter = 1;
|
|
1044
|
+
while (newState_1.some((g_16) => g_16.name === tentative)) tentative = `New Group ${counter++}`;
|
|
1045
|
+
newState_1.push({
|
|
1046
|
+
name: tentative,
|
|
1047
|
+
entries: [dragged]
|
|
1048
|
+
});
|
|
1049
|
+
setDndItems(newState_1);
|
|
1050
|
+
setPendingNewGroupName(tentative);
|
|
1051
|
+
setDialogOpenForGroup(tentative);
|
|
1052
|
+
onNewGroupDrop?.();
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
} else {
|
|
1057
|
+
const overCont_1 = findDndContainer(overIdNow_0);
|
|
1058
|
+
if (activeCont_0 === overCont_1) {
|
|
1059
|
+
const grpIdx = dndItems.findIndex((g_17) => g_17.name === activeCont_0);
|
|
1060
|
+
if (grpIdx !== -1) {
|
|
1061
|
+
const group_1 = dndItems[grpIdx];
|
|
1062
|
+
const oldIdx = group_1.entries.findIndex((e_6) => e_6.url === activeIdNow_0);
|
|
1063
|
+
let newIdx = group_1.entries.findIndex((e_7) => e_7.url === overIdNow_0);
|
|
1064
|
+
if (newIdx === -1 && overIdNow_0 === activeCont_0) newIdx = group_1.entries.length - 1;
|
|
1065
|
+
if (oldIdx !== -1 && newIdx !== -1 && oldIdx !== newIdx) {
|
|
1066
|
+
const reordered = arrayMove(group_1.entries, oldIdx, newIdx);
|
|
1067
|
+
const newState_2 = [...dndItems];
|
|
1068
|
+
newState_2[grpIdx] = {
|
|
1069
|
+
...group_1,
|
|
1070
|
+
entries: reordered
|
|
1071
|
+
};
|
|
1072
|
+
setDndItems(newState_2);
|
|
1073
|
+
onPersist?.(newState_2);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
} else if (overCont_1 && activeCont_0 !== overCont_1) {
|
|
1077
|
+
const finalState = cloneItemsForDnd(sourceState);
|
|
1078
|
+
const finalOverId = lastOverId.current || overIdNow_0;
|
|
1079
|
+
const cleanOverCont = findContainerInState(finalOverId, sourceState) || overCont_1;
|
|
1080
|
+
const srcIdx_1 = finalState.findIndex((g_18) => g_18.name === activeCont_0);
|
|
1081
|
+
const tgtIdx_0 = finalState.findIndex((g_19) => g_19.name === cleanOverCont);
|
|
1082
|
+
if (srcIdx_1 !== -1 && tgtIdx_0 !== -1) {
|
|
1083
|
+
const src_1 = finalState[srcIdx_1];
|
|
1084
|
+
const tgt_0 = finalState[tgtIdx_0];
|
|
1085
|
+
const idxInSrc_1 = src_1.entries.findIndex((e_8) => e_8.url === activeIdNow_0);
|
|
1086
|
+
if (idxInSrc_1 !== -1) {
|
|
1087
|
+
const [moved_0] = src_1.entries.splice(idxInSrc_1, 1);
|
|
1088
|
+
const overIsContainer_1 = finalOverId === cleanOverCont;
|
|
1089
|
+
if (overIsContainer_1) {
|
|
1090
|
+
tgt_0.entries.push(moved_0);
|
|
1091
|
+
} else {
|
|
1092
|
+
const overIdx_0 = tgt_0.entries.findIndex((e_9) => e_9.url === finalOverId);
|
|
1093
|
+
if (overIdx_0 !== -1) {
|
|
1094
|
+
tgt_0.entries.splice(overIdx_0, 0, moved_0);
|
|
1095
|
+
} else {
|
|
1096
|
+
tgt_0.entries.push(moved_0);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
if (src_1.entries.length === 0) {
|
|
1100
|
+
finalState.splice(srcIdx_1, 1);
|
|
1101
|
+
}
|
|
1102
|
+
setDndItems(finalState);
|
|
1103
|
+
onPersist?.(finalState);
|
|
1104
|
+
onCardMovedBetweenGroups?.(moved_0);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
} else if (recentlyMovedToNewContainer.current) {
|
|
1108
|
+
console.error("Move between containers detected but conditions not met", {
|
|
1109
|
+
activeCont: activeCont_0,
|
|
1110
|
+
overCont: overCont_1,
|
|
1111
|
+
activeIdNow: activeIdNow_0,
|
|
1112
|
+
overIdNow: overIdNow_0
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
resetDragState();
|
|
1118
|
+
};
|
|
1119
|
+
const resetDragState = () => {
|
|
1120
|
+
setDndKitActiveNode(null);
|
|
1121
|
+
setActiveId(null);
|
|
1122
|
+
setActiveIsGroup(false);
|
|
1123
|
+
setCurrentDraggingGroupId(null);
|
|
1124
|
+
setIsDraggingCardOnly(false);
|
|
1125
|
+
recentlyMovedToNewContainer.current = false;
|
|
1126
|
+
};
|
|
1127
|
+
const handleDragCancel = () => resetDragState();
|
|
1128
|
+
const handleRenameGroup = (oldName, newName) => {
|
|
1129
|
+
setDndItems((current_0) => {
|
|
1130
|
+
const idx = current_0.findIndex((g_20) => g_20.name === oldName);
|
|
1131
|
+
if (idx === -1) return current_0;
|
|
1132
|
+
if (current_0.some((g_21) => g_21.name === newName && g_21.name !== oldName)) return current_0;
|
|
1133
|
+
const updated = [...current_0];
|
|
1134
|
+
updated[idx] = {
|
|
1135
|
+
...updated[idx],
|
|
1136
|
+
name: newName
|
|
1137
|
+
};
|
|
1138
|
+
onPersist?.(updated);
|
|
1139
|
+
return updated;
|
|
1140
|
+
});
|
|
1141
|
+
setPendingNewGroupName(null);
|
|
1142
|
+
setStateBeforeNewGroup(null);
|
|
1143
|
+
setDialogOpenForGroup(null);
|
|
1144
|
+
};
|
|
1145
|
+
const handleDialogClose = () => {
|
|
1146
|
+
if (pendingNewGroupName && dialogOpenForGroup === pendingNewGroupName && stateBeforeNewGroup) {
|
|
1147
|
+
setDndItems(stateBeforeNewGroup);
|
|
1148
|
+
}
|
|
1149
|
+
setPendingNewGroupName(null);
|
|
1150
|
+
setStateBeforeNewGroup(null);
|
|
1151
|
+
setDialogOpenForGroup(null);
|
|
1152
|
+
};
|
|
1153
|
+
const activeItemForOverlay = disabled || !activeId || activeIsGroup ? null : dndItems.flatMap((g_22) => g_22.entries).find((e_10) => e_10.url === activeId) || null;
|
|
1154
|
+
const activeGroupData = disabled || !activeId || !activeIsGroup ? null : dndItems.find((g_23) => g_23.name === activeId) || null;
|
|
1155
|
+
return {
|
|
1156
|
+
sensors,
|
|
1157
|
+
collisionDetection,
|
|
1158
|
+
onDragStart: handleDragStart,
|
|
1159
|
+
onDragOver: handleDragOver,
|
|
1160
|
+
onDragEnd: handleDragEnd,
|
|
1161
|
+
onDragCancel: handleDragCancel,
|
|
1162
|
+
dropAnimation: dropAnimationConfig,
|
|
1163
|
+
activeItemForOverlay,
|
|
1164
|
+
activeGroupData,
|
|
1165
|
+
draggingGroupId: currentDraggingGroupId,
|
|
1166
|
+
containers: dndContainers,
|
|
1167
|
+
dndKitActiveNode,
|
|
1168
|
+
isDraggingCardOnly,
|
|
1169
|
+
dialogOpenForGroup,
|
|
1170
|
+
setDialogOpenForGroup,
|
|
1171
|
+
handleRenameGroup,
|
|
1172
|
+
handleDialogClose,
|
|
1173
|
+
isHoveringNewGroupDropZone,
|
|
1174
|
+
setIsHoveringNewGroupDropZone
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
function NewGroupDropZone(t0) {
|
|
1178
|
+
const $ = c(15);
|
|
1179
|
+
const {
|
|
1180
|
+
disabled,
|
|
1181
|
+
setIsHovering
|
|
1182
|
+
} = t0;
|
|
1183
|
+
let t1;
|
|
1184
|
+
if ($[0] !== disabled) {
|
|
1185
|
+
t1 = {
|
|
1186
|
+
id: "new-group-drop-zone",
|
|
1187
|
+
disabled
|
|
1188
|
+
};
|
|
1189
|
+
$[0] = disabled;
|
|
1190
|
+
$[1] = t1;
|
|
1191
|
+
} else {
|
|
1192
|
+
t1 = $[1];
|
|
1193
|
+
}
|
|
1194
|
+
const {
|
|
1195
|
+
setNodeRef,
|
|
1196
|
+
isOver
|
|
1197
|
+
} = useDroppable(t1);
|
|
1198
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
1199
|
+
let t2;
|
|
1200
|
+
if ($[2] !== disabled) {
|
|
1201
|
+
t2 = {
|
|
1202
|
+
onDragStart(t32) {
|
|
1203
|
+
const {
|
|
1204
|
+
active
|
|
1205
|
+
} = t32;
|
|
1206
|
+
if (disabled) {
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
const tp = active.data.current?.type;
|
|
1210
|
+
setIsVisible(tp === "item");
|
|
1211
|
+
},
|
|
1212
|
+
onDragEnd() {
|
|
1213
|
+
setIsVisible(false);
|
|
1214
|
+
},
|
|
1215
|
+
onDragCancel() {
|
|
1216
|
+
setIsVisible(false);
|
|
1217
|
+
}
|
|
1218
|
+
};
|
|
1219
|
+
$[2] = disabled;
|
|
1220
|
+
$[3] = t2;
|
|
1221
|
+
} else {
|
|
1222
|
+
t2 = $[3];
|
|
1223
|
+
}
|
|
1224
|
+
useDndMonitor(t2);
|
|
1225
|
+
let t3;
|
|
1226
|
+
let t4;
|
|
1227
|
+
if ($[4] !== isOver || $[5] !== isVisible || $[6] !== setIsHovering) {
|
|
1228
|
+
t3 = () => {
|
|
1229
|
+
setIsHovering(isOver && isVisible);
|
|
1230
|
+
};
|
|
1231
|
+
t4 = [isOver, isVisible, setIsHovering];
|
|
1232
|
+
$[4] = isOver;
|
|
1233
|
+
$[5] = isVisible;
|
|
1234
|
+
$[6] = setIsHovering;
|
|
1235
|
+
$[7] = t3;
|
|
1236
|
+
$[8] = t4;
|
|
1237
|
+
} else {
|
|
1238
|
+
t3 = $[7];
|
|
1239
|
+
t4 = $[8];
|
|
1240
|
+
}
|
|
1241
|
+
useEffect(t3, t4);
|
|
1242
|
+
if (!isVisible || disabled) {
|
|
1243
|
+
return null;
|
|
1244
|
+
}
|
|
1245
|
+
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";
|
|
1246
|
+
let t6;
|
|
1247
|
+
if ($[9] !== t5) {
|
|
1248
|
+
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);
|
|
1249
|
+
$[9] = t5;
|
|
1250
|
+
$[10] = t6;
|
|
1251
|
+
} else {
|
|
1252
|
+
t6 = $[10];
|
|
1253
|
+
}
|
|
1254
|
+
let t7;
|
|
1255
|
+
if ($[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1256
|
+
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" }) });
|
|
1257
|
+
$[11] = t7;
|
|
1258
|
+
} else {
|
|
1259
|
+
t7 = $[11];
|
|
1260
|
+
}
|
|
1261
|
+
let t8;
|
|
1262
|
+
if ($[12] !== setNodeRef || $[13] !== t6) {
|
|
1263
|
+
t8 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, className: t6, children: t7 });
|
|
1264
|
+
$[12] = setNodeRef;
|
|
1265
|
+
$[13] = t6;
|
|
1266
|
+
$[14] = t8;
|
|
1267
|
+
} else {
|
|
1268
|
+
t8 = $[14];
|
|
1269
|
+
}
|
|
1270
|
+
return t8;
|
|
1271
|
+
}
|
|
1272
|
+
function RenameGroupDialog(t0) {
|
|
1273
|
+
const $ = c(56);
|
|
1274
|
+
const {
|
|
1275
|
+
open,
|
|
1276
|
+
initialName,
|
|
1277
|
+
existingGroupNames,
|
|
1278
|
+
onClose,
|
|
1279
|
+
onRename
|
|
1280
|
+
} = t0;
|
|
1281
|
+
const {
|
|
1282
|
+
t
|
|
1283
|
+
} = useTranslation();
|
|
1284
|
+
const [name, setName] = useState(initialName);
|
|
1285
|
+
const [error, setError] = useState(null);
|
|
1286
|
+
const inputRef = useRef(null);
|
|
1287
|
+
let t1;
|
|
1288
|
+
let t2;
|
|
1289
|
+
if ($[0] !== initialName || $[1] !== open) {
|
|
1290
|
+
t1 = () => {
|
|
1291
|
+
if (open) {
|
|
1292
|
+
setName(initialName);
|
|
1293
|
+
setError(null);
|
|
1294
|
+
setTimeout(() => {
|
|
1295
|
+
if (inputRef.current) {
|
|
1296
|
+
inputRef.current.focus();
|
|
1297
|
+
inputRef.current.select();
|
|
1298
|
+
}
|
|
1299
|
+
}, 100);
|
|
1300
|
+
}
|
|
1301
|
+
};
|
|
1302
|
+
t2 = [initialName, open];
|
|
1303
|
+
$[0] = initialName;
|
|
1304
|
+
$[1] = open;
|
|
1305
|
+
$[2] = t1;
|
|
1306
|
+
$[3] = t2;
|
|
1307
|
+
} else {
|
|
1308
|
+
t1 = $[2];
|
|
1309
|
+
t2 = $[3];
|
|
1310
|
+
}
|
|
1311
|
+
useEffect(t1, t2);
|
|
1312
|
+
let t3;
|
|
1313
|
+
if ($[4] !== existingGroupNames || $[5] !== t) {
|
|
1314
|
+
t3 = (event) => {
|
|
1315
|
+
const newName = event.target.value;
|
|
1316
|
+
setName(newName);
|
|
1317
|
+
if (!newName.trim()) {
|
|
1318
|
+
setError(t("group_name_empty_error"));
|
|
1319
|
+
} else {
|
|
1320
|
+
if (existingGroupNames.includes(newName.trim())) {
|
|
1321
|
+
setError(t("group_name_exists_error"));
|
|
1322
|
+
} else {
|
|
1323
|
+
setError(null);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
$[4] = existingGroupNames;
|
|
1328
|
+
$[5] = t;
|
|
1329
|
+
$[6] = t3;
|
|
1330
|
+
} else {
|
|
1331
|
+
t3 = $[6];
|
|
1332
|
+
}
|
|
1333
|
+
const handleNameChange = t3;
|
|
1334
|
+
let t4;
|
|
1335
|
+
if ($[7] !== error || $[8] !== existingGroupNames || $[9] !== name || $[10] !== onClose || $[11] !== onRename || $[12] !== t) {
|
|
1336
|
+
t4 = () => {
|
|
1337
|
+
const trimmedName = name.trim();
|
|
1338
|
+
if (!trimmedName) {
|
|
1339
|
+
setError(t("group_name_empty_error"));
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
if (existingGroupNames.includes(trimmedName)) {
|
|
1343
|
+
setError(t("group_name_exists_error"));
|
|
1344
|
+
return;
|
|
1345
|
+
}
|
|
1346
|
+
if (!error) {
|
|
1347
|
+
onRename(trimmedName);
|
|
1348
|
+
onClose();
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
$[7] = error;
|
|
1352
|
+
$[8] = existingGroupNames;
|
|
1353
|
+
$[9] = name;
|
|
1354
|
+
$[10] = onClose;
|
|
1355
|
+
$[11] = onRename;
|
|
1356
|
+
$[12] = t;
|
|
1357
|
+
$[13] = t4;
|
|
1358
|
+
} else {
|
|
1359
|
+
t4 = $[13];
|
|
1360
|
+
}
|
|
1361
|
+
const handleSave = t4;
|
|
1362
|
+
let t5;
|
|
1363
|
+
if ($[14] !== existingGroupNames || $[15] !== handleSave || $[16] !== name || $[17] !== t) {
|
|
1364
|
+
t5 = (event_0) => {
|
|
1365
|
+
if (event_0.key === "Enter") {
|
|
1366
|
+
event_0.preventDefault();
|
|
1367
|
+
const trimmedName_0 = name.trim();
|
|
1368
|
+
let currentError = null;
|
|
1369
|
+
if (!trimmedName_0) {
|
|
1370
|
+
currentError = t("group_name_empty_error");
|
|
1371
|
+
} else {
|
|
1372
|
+
if (existingGroupNames.includes(trimmedName_0)) {
|
|
1373
|
+
currentError = t("group_name_exists_error");
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
if (!currentError && trimmedName_0) {
|
|
1377
|
+
handleSave();
|
|
1378
|
+
} else {
|
|
1379
|
+
if (currentError) {
|
|
1380
|
+
setError(currentError);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
};
|
|
1385
|
+
$[14] = existingGroupNames;
|
|
1386
|
+
$[15] = handleSave;
|
|
1387
|
+
$[16] = name;
|
|
1388
|
+
$[17] = t;
|
|
1389
|
+
$[18] = t5;
|
|
1390
|
+
} else {
|
|
1391
|
+
t5 = $[18];
|
|
1392
|
+
}
|
|
1393
|
+
const handleKeyDown = t5;
|
|
1394
|
+
if (!open) {
|
|
1395
|
+
return null;
|
|
1396
|
+
}
|
|
1397
|
+
let t6;
|
|
1398
|
+
if ($[19] !== t) {
|
|
1399
|
+
t6 = t("rename_group");
|
|
1400
|
+
$[19] = t;
|
|
1401
|
+
$[20] = t6;
|
|
1402
|
+
} else {
|
|
1403
|
+
t6 = $[20];
|
|
1404
|
+
}
|
|
1405
|
+
let t7;
|
|
1406
|
+
if ($[21] !== t6) {
|
|
1407
|
+
t7 = /* @__PURE__ */ jsx(DialogTitle, { children: t6 });
|
|
1408
|
+
$[21] = t6;
|
|
1409
|
+
$[22] = t7;
|
|
1410
|
+
} else {
|
|
1411
|
+
t7 = $[22];
|
|
1412
|
+
}
|
|
1413
|
+
let t8;
|
|
1414
|
+
if ($[23] !== t) {
|
|
1415
|
+
t8 = t("group_name_label");
|
|
1416
|
+
$[23] = t;
|
|
1417
|
+
$[24] = t8;
|
|
1418
|
+
} else {
|
|
1419
|
+
t8 = $[24];
|
|
1420
|
+
}
|
|
1421
|
+
const t9 = !!error;
|
|
1422
|
+
const t10 = error ? "group-name-error" : void 0;
|
|
1423
|
+
let t11;
|
|
1424
|
+
if ($[25] !== handleKeyDown || $[26] !== handleNameChange || $[27] !== name || $[28] !== t10 || $[29] !== t8 || $[30] !== t9) {
|
|
1425
|
+
t11 = /* @__PURE__ */ jsx(TextField, { inputRef, label: t8, value: name, onChange: handleNameChange, onKeyDown: handleKeyDown, error: t9, "aria-describedby": t10 });
|
|
1426
|
+
$[25] = handleKeyDown;
|
|
1427
|
+
$[26] = handleNameChange;
|
|
1428
|
+
$[27] = name;
|
|
1429
|
+
$[28] = t10;
|
|
1430
|
+
$[29] = t8;
|
|
1431
|
+
$[30] = t9;
|
|
1432
|
+
$[31] = t11;
|
|
1433
|
+
} else {
|
|
1434
|
+
t11 = $[31];
|
|
1435
|
+
}
|
|
1436
|
+
let t12;
|
|
1437
|
+
if ($[32] !== error) {
|
|
1438
|
+
t12 = error && /* @__PURE__ */ jsx("p", { id: "group-name-error", style: {
|
|
1439
|
+
display: "none"
|
|
1440
|
+
}, children: error });
|
|
1441
|
+
$[32] = error;
|
|
1442
|
+
$[33] = t12;
|
|
1443
|
+
} else {
|
|
1444
|
+
t12 = $[33];
|
|
1445
|
+
}
|
|
1446
|
+
let t13;
|
|
1447
|
+
if ($[34] !== t11 || $[35] !== t12) {
|
|
1448
|
+
t13 = /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
1449
|
+
t11,
|
|
1450
|
+
t12
|
|
1451
|
+
] });
|
|
1452
|
+
$[34] = t11;
|
|
1453
|
+
$[35] = t12;
|
|
1454
|
+
$[36] = t13;
|
|
1455
|
+
} else {
|
|
1456
|
+
t13 = $[36];
|
|
1457
|
+
}
|
|
1458
|
+
let t14;
|
|
1459
|
+
if ($[37] !== t) {
|
|
1460
|
+
t14 = t("cancel");
|
|
1461
|
+
$[37] = t;
|
|
1462
|
+
$[38] = t14;
|
|
1463
|
+
} else {
|
|
1464
|
+
t14 = $[38];
|
|
1465
|
+
}
|
|
1466
|
+
let t15;
|
|
1467
|
+
if ($[39] !== onClose || $[40] !== t14) {
|
|
1468
|
+
t15 = /* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "text", children: t14 });
|
|
1469
|
+
$[39] = onClose;
|
|
1470
|
+
$[40] = t14;
|
|
1471
|
+
$[41] = t15;
|
|
1472
|
+
} else {
|
|
1473
|
+
t15 = $[41];
|
|
1474
|
+
}
|
|
1475
|
+
const t16 = !!error || !name.trim();
|
|
1476
|
+
let t17;
|
|
1477
|
+
if ($[42] !== t) {
|
|
1478
|
+
t17 = t("save");
|
|
1479
|
+
$[42] = t;
|
|
1480
|
+
$[43] = t17;
|
|
1481
|
+
} else {
|
|
1482
|
+
t17 = $[43];
|
|
1483
|
+
}
|
|
1484
|
+
let t18;
|
|
1485
|
+
if ($[44] !== handleSave || $[45] !== t16 || $[46] !== t17) {
|
|
1486
|
+
t18 = /* @__PURE__ */ jsx(Button, { onClick: handleSave, disabled: t16, children: t17 });
|
|
1487
|
+
$[44] = handleSave;
|
|
1488
|
+
$[45] = t16;
|
|
1489
|
+
$[46] = t17;
|
|
1490
|
+
$[47] = t18;
|
|
1491
|
+
} else {
|
|
1492
|
+
t18 = $[47];
|
|
1493
|
+
}
|
|
1494
|
+
let t19;
|
|
1495
|
+
if ($[48] !== t15 || $[49] !== t18) {
|
|
1496
|
+
t19 = /* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
1497
|
+
t15,
|
|
1498
|
+
t18
|
|
1499
|
+
] });
|
|
1500
|
+
$[48] = t15;
|
|
1501
|
+
$[49] = t18;
|
|
1502
|
+
$[50] = t19;
|
|
1503
|
+
} else {
|
|
1504
|
+
t19 = $[50];
|
|
1505
|
+
}
|
|
1506
|
+
let t20;
|
|
1507
|
+
if ($[51] !== open || $[52] !== t13 || $[53] !== t19 || $[54] !== t7) {
|
|
1508
|
+
t20 = /* @__PURE__ */ jsxs(Dialog, { open, children: [
|
|
1509
|
+
t7,
|
|
1510
|
+
t13,
|
|
1511
|
+
t19
|
|
1512
|
+
] });
|
|
1513
|
+
$[51] = open;
|
|
1514
|
+
$[52] = t13;
|
|
1515
|
+
$[53] = t19;
|
|
1516
|
+
$[54] = t7;
|
|
1517
|
+
$[55] = t20;
|
|
1518
|
+
} else {
|
|
1519
|
+
t20 = $[55];
|
|
1520
|
+
}
|
|
1521
|
+
return t20;
|
|
1522
|
+
}
|
|
1523
|
+
const DEFAULT_GROUP_NAME = "Views";
|
|
1524
|
+
const ADMIN_GROUP_NAME = "Admin";
|
|
1525
|
+
function ContentHomePage({
|
|
1526
|
+
additionalActions,
|
|
1527
|
+
additionalChildrenStart,
|
|
1528
|
+
additionalChildrenEnd,
|
|
1529
|
+
sections,
|
|
1530
|
+
hiddenGroups
|
|
1531
|
+
}) {
|
|
1532
|
+
const context = useCMSContext();
|
|
1533
|
+
const {
|
|
1534
|
+
navigationStateController
|
|
1535
|
+
} = context;
|
|
1536
|
+
const customizationController = useCustomizationController();
|
|
1537
|
+
const adminModeController = useAdminModeController();
|
|
1538
|
+
const isStudioMode = adminModeController.mode === "studio";
|
|
1539
|
+
const {
|
|
1540
|
+
resolvedSlots
|
|
1541
|
+
} = customizationController;
|
|
1542
|
+
const breadcrumbs = useBreadcrumbsController();
|
|
1543
|
+
const {
|
|
1544
|
+
t
|
|
1545
|
+
} = useTranslation();
|
|
1546
|
+
useEffect(() => {
|
|
1547
|
+
breadcrumbs.set({
|
|
1548
|
+
breadcrumbs: []
|
|
1549
|
+
});
|
|
1550
|
+
}, [breadcrumbs.set]);
|
|
1551
|
+
const {
|
|
1552
|
+
allowDragAndDrop = false,
|
|
1553
|
+
navigationEntries: unFilteredNavigationEntries = [],
|
|
1554
|
+
groups: unFilteredGroupOrder = [],
|
|
1555
|
+
onNavigationEntriesUpdate = () => {
|
|
1556
|
+
}
|
|
1557
|
+
} = navigationStateController.topLevelNavigation || {};
|
|
1558
|
+
const rawNavigationEntries = useMemo(() => {
|
|
1559
|
+
return unFilteredNavigationEntries.filter((e) => {
|
|
1560
|
+
const isStudioGroup = e.group ? STUDIO_NAVIGATION_GROUPS.includes(e.group) : false;
|
|
1561
|
+
return isStudioMode ? isStudioGroup : !isStudioGroup;
|
|
1562
|
+
});
|
|
1563
|
+
}, [unFilteredNavigationEntries, isStudioMode]);
|
|
1564
|
+
const groupOrderFromNavController = useMemo(() => {
|
|
1565
|
+
return unFilteredGroupOrder.filter((g) => {
|
|
1566
|
+
const isStudioGroup_0 = STUDIO_NAVIGATION_GROUPS.includes(g);
|
|
1567
|
+
return isStudioMode ? isStudioGroup_0 : !isStudioGroup_0;
|
|
1568
|
+
});
|
|
1569
|
+
}, [unFilteredGroupOrder, isStudioMode]);
|
|
1570
|
+
const fuse = useRef(null);
|
|
1571
|
+
const [filteredUrls, setFilteredUrls] = useState(null);
|
|
1572
|
+
const performingSearch = Boolean(filteredUrls);
|
|
1573
|
+
const filteredNavigationEntries = useMemo(() => {
|
|
1574
|
+
return filteredUrls ? rawNavigationEntries.filter((e_0) => filteredUrls.includes(e_0.url)) : rawNavigationEntries;
|
|
1575
|
+
}, [filteredUrls, rawNavigationEntries]);
|
|
1576
|
+
useEffect(() => {
|
|
1577
|
+
fuse.current = new Fuse(rawNavigationEntries, {
|
|
1578
|
+
keys: ["name", "description", "group", "path"]
|
|
1579
|
+
});
|
|
1580
|
+
}, [rawNavigationEntries]);
|
|
1581
|
+
const updateSearch = useCallback((v) => {
|
|
1582
|
+
if (!v?.trim()) {
|
|
1583
|
+
setFilteredUrls(null);
|
|
1584
|
+
return;
|
|
1585
|
+
}
|
|
1586
|
+
const results = fuse.current?.search(v.trim());
|
|
1587
|
+
setFilteredUrls(results ? results.map((x) => x.item.url) : []);
|
|
1588
|
+
}, []);
|
|
1589
|
+
const [items, setItems] = useState([]);
|
|
1590
|
+
const [adminGroupData, setAdminGroupData] = useState(null);
|
|
1591
|
+
const isDndDirtyRef = useRef(false);
|
|
1592
|
+
const dndDirtyTimeoutRef = useRef(null);
|
|
1593
|
+
const processedGroups = useMemo(() => {
|
|
1594
|
+
const src = filteredNavigationEntries;
|
|
1595
|
+
const entriesByGroup = {};
|
|
1596
|
+
src.forEach((e_1) => {
|
|
1597
|
+
const g_0 = e_1.type === "admin" ? ADMIN_GROUP_NAME : e_1.group ?? DEFAULT_GROUP_NAME;
|
|
1598
|
+
(entriesByGroup[g_0] ??= []).push(e_1);
|
|
1599
|
+
});
|
|
1600
|
+
const hasPluginAdditionalCards = customizationController.resolvedSlots.some((s) => s.slot === "home.cards");
|
|
1601
|
+
let allProcessed;
|
|
1602
|
+
if (performingSearch) {
|
|
1603
|
+
const ordered = [...new Set(src.map((e_2) => e_2.group ?? DEFAULT_GROUP_NAME))];
|
|
1604
|
+
allProcessed = ordered.map((name) => ({
|
|
1605
|
+
name,
|
|
1606
|
+
entries: entriesByGroup[name] || []
|
|
1607
|
+
})).filter((g_1) => g_1.entries.length);
|
|
1608
|
+
} else {
|
|
1609
|
+
allProcessed = groupOrderFromNavController.map((g_2) => ({
|
|
1610
|
+
name: g_2,
|
|
1611
|
+
entries: entriesByGroup[g_2] || []
|
|
1612
|
+
}));
|
|
1613
|
+
Object.keys(entriesByGroup).forEach((g_3) => {
|
|
1614
|
+
if (!groupOrderFromNavController.includes(g_3)) allProcessed.push({
|
|
1615
|
+
name: g_3,
|
|
1616
|
+
entries: entriesByGroup[g_3]
|
|
1617
|
+
});
|
|
1618
|
+
});
|
|
1619
|
+
if (hasPluginAdditionalCards && !allProcessed.some((g_4) => g_4.name === DEFAULT_GROUP_NAME)) {
|
|
1620
|
+
allProcessed.push({
|
|
1621
|
+
name: DEFAULT_GROUP_NAME,
|
|
1622
|
+
entries: []
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
allProcessed = allProcessed.filter((g_5) => g_5.entries.length || g_5.name === DEFAULT_GROUP_NAME && hasPluginAdditionalCards);
|
|
1626
|
+
}
|
|
1627
|
+
const admin = allProcessed.find((g_6) => g_6.name === ADMIN_GROUP_NAME);
|
|
1628
|
+
return {
|
|
1629
|
+
adminGroupData: admin || null,
|
|
1630
|
+
items: allProcessed.filter((g_7) => g_7.name !== ADMIN_GROUP_NAME && !hiddenGroups?.includes(g_7.name))
|
|
1631
|
+
};
|
|
1632
|
+
}, [filteredNavigationEntries, performingSearch, groupOrderFromNavController, customizationController.resolvedSlots, hiddenGroups]);
|
|
1633
|
+
useEffect(() => {
|
|
1634
|
+
if (isDndDirtyRef.current) {
|
|
1635
|
+
return;
|
|
1636
|
+
}
|
|
1637
|
+
setAdminGroupData(processedGroups.adminGroupData);
|
|
1638
|
+
setItems(processedGroups.items);
|
|
1639
|
+
}, [processedGroups]);
|
|
1640
|
+
const updateItems = (updater) => {
|
|
1641
|
+
setItems(updater);
|
|
1642
|
+
};
|
|
1643
|
+
const persistNavigationGroups = (latest) => {
|
|
1644
|
+
isDndDirtyRef.current = true;
|
|
1645
|
+
if (dndDirtyTimeoutRef.current) {
|
|
1646
|
+
clearTimeout(dndDirtyTimeoutRef.current);
|
|
1647
|
+
}
|
|
1648
|
+
dndDirtyTimeoutRef.current = setTimeout(() => {
|
|
1649
|
+
isDndDirtyRef.current = false;
|
|
1650
|
+
}, 1e3);
|
|
1651
|
+
const draggable = latest.map((g_8) => ({
|
|
1652
|
+
name: g_8.name,
|
|
1653
|
+
entries: g_8.entries.map((e_3) => e_3.slug)
|
|
1654
|
+
}));
|
|
1655
|
+
const all = adminGroupData ? [...draggable, {
|
|
1656
|
+
name: adminGroupData.name,
|
|
1657
|
+
entries: adminGroupData.entries.map((e_4) => e_4.slug)
|
|
1658
|
+
}] : draggable;
|
|
1659
|
+
onNavigationEntriesUpdate(all);
|
|
1660
|
+
};
|
|
1661
|
+
const groupNames = useMemo(() => [...items.map((item) => item.name), ...adminGroupData ? [adminGroupData.name] : []], [items, adminGroupData]);
|
|
1662
|
+
const {
|
|
1663
|
+
isGroupCollapsed,
|
|
1664
|
+
toggleGroupCollapsed
|
|
1665
|
+
} = useCollapsedGroups(groupNames, "home");
|
|
1666
|
+
const {
|
|
1667
|
+
sensors,
|
|
1668
|
+
collisionDetection,
|
|
1669
|
+
onDragStart,
|
|
1670
|
+
onDragOver,
|
|
1671
|
+
onDragEnd,
|
|
1672
|
+
dropAnimation,
|
|
1673
|
+
activeItemForOverlay,
|
|
1674
|
+
activeGroupData,
|
|
1675
|
+
draggingGroupId,
|
|
1676
|
+
containers,
|
|
1677
|
+
dndKitActiveNode,
|
|
1678
|
+
onDragCancel,
|
|
1679
|
+
isDraggingCardOnly,
|
|
1680
|
+
dialogOpenForGroup,
|
|
1681
|
+
setDialogOpenForGroup,
|
|
1682
|
+
handleRenameGroup,
|
|
1683
|
+
handleDialogClose,
|
|
1684
|
+
isHoveringNewGroupDropZone,
|
|
1685
|
+
setIsHoveringNewGroupDropZone
|
|
1686
|
+
} = useHomePageDnd({
|
|
1687
|
+
items,
|
|
1688
|
+
setItems: updateItems,
|
|
1689
|
+
disabled: !allowDragAndDrop || performingSearch,
|
|
1690
|
+
onPersist: persistNavigationGroups,
|
|
1691
|
+
onGroupMoved: (g_9) => context.analyticsController?.onAnalyticsEvent?.("home_move_group", {
|
|
1692
|
+
name: g_9
|
|
1693
|
+
}),
|
|
1694
|
+
onCardMovedBetweenGroups: (card) => context.analyticsController?.onAnalyticsEvent?.("home_move_card", {
|
|
1695
|
+
id: card.id
|
|
1696
|
+
}),
|
|
1697
|
+
onNewGroupDrop: () => context.analyticsController?.onAnalyticsEvent?.("home_drop_new_group")
|
|
1698
|
+
});
|
|
1699
|
+
const {
|
|
1700
|
+
containerRef,
|
|
1701
|
+
direction
|
|
1702
|
+
} = useRestoreScroll();
|
|
1703
|
+
const dndDisabled = !allowDragAndDrop || performingSearch;
|
|
1704
|
+
const dndModifiers = dndKitActiveNode?.data.current?.type === "group" ? [restrictToVerticalAxis, restrictToWindowEdges] : [restrictToWindowEdges];
|
|
1705
|
+
const sectionProps = {
|
|
1706
|
+
context
|
|
1707
|
+
};
|
|
1708
|
+
const additionalPluginChildrenStart = useSlot("home.children.start", sectionProps);
|
|
1709
|
+
const additionalPluginChildrenEnd = useSlot("home.children.end", sectionProps);
|
|
1710
|
+
const additionalPluginActions = useSlot("home.actions", sectionProps);
|
|
1711
|
+
const homeCardContributions = useMemo(() => {
|
|
1712
|
+
return resolvedSlots.filter((s_0) => s_0.slot === "home.cards").sort((a, b) => (a.order ?? 50) - (b.order ?? 50));
|
|
1713
|
+
}, [resolvedSlots]);
|
|
1714
|
+
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "py-2 overflow-auto h-full w-full dark:bg-surface-800", children: [
|
|
1715
|
+
/* @__PURE__ */ jsxs(Container, { maxWidth: "6xl", children: [
|
|
1716
|
+
/* @__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: {
|
|
1717
|
+
top: direction === "down" ? -84 : 0
|
|
1718
|
+
}, children: [
|
|
1719
|
+
/* @__PURE__ */ jsx(SearchBar, { onTextSearch: updateSearch, placeholder: t("search_collections"), autoFocus: true, size: "small", innerClassName: "w-full", className: "w-full grow" }),
|
|
1720
|
+
additionalActions,
|
|
1721
|
+
additionalPluginActions
|
|
1722
|
+
] }),
|
|
1723
|
+
/* @__PURE__ */ jsx(FavouritesView, { hidden: performingSearch }),
|
|
1724
|
+
additionalChildrenStart,
|
|
1725
|
+
additionalPluginChildrenStart,
|
|
1726
|
+
/* @__PURE__ */ jsxs(DndContext, { sensors, collisionDetection, measuring: {
|
|
1727
|
+
droppable: {
|
|
1728
|
+
strategy: MeasuringStrategy.Always,
|
|
1729
|
+
frequency: 500
|
|
1730
|
+
}
|
|
1731
|
+
}, onDragStart, onDragOver, onDragEnd, onDragCancel, modifiers: dndModifiers, children: [
|
|
1732
|
+
/* @__PURE__ */ jsx(SortableContext, { items: containers, strategy: verticalListSortingStrategy, children: items.map((groupData, groupIndex) => {
|
|
1733
|
+
const groupKey = groupData.name;
|
|
1734
|
+
const entriesInGroup = groupData.entries;
|
|
1735
|
+
const homeCardsProps = {
|
|
1736
|
+
group: groupKey === DEFAULT_GROUP_NAME ? void 0 : groupKey,
|
|
1737
|
+
context
|
|
1738
|
+
};
|
|
1739
|
+
const additionalCards = homeCardContributions.map((s_1, i) => /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(s_1.Component, { ...homeCardsProps, ...s_1.props ?? {} }) }, `home_cards_${groupKey}_${i}`));
|
|
1740
|
+
if (entriesInGroup.length === 0 && (additionalCards.length === 0 || performingSearch)) return null;
|
|
1741
|
+
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: () => {
|
|
1742
|
+
if (dndDisabled) return;
|
|
1743
|
+
setDialogOpenForGroup(groupKey);
|
|
1744
|
+
}, collapsed: isGroupCollapsed(groupKey), onToggleCollapsed: () => toggleGroupCollapsed(groupKey), children: /* @__PURE__ */ jsx(NavigationGroupDroppable, { id: groupKey, itemIds: entriesInGroup.map((e_5) => e_5.url), isPotentialCardDropTarget: isDraggingCardOnly, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 ", children: [
|
|
1745
|
+
entriesInGroup.map((entry) => /* @__PURE__ */ jsx(SortableNavigationCard, { entry, onClick: () => {
|
|
1746
|
+
let event = "unmapped_event";
|
|
1747
|
+
if (entry.type === "collection") event = "home_navigate_to_collection";
|
|
1748
|
+
else if (entry.type === "view") event = "home_navigate_to_view";
|
|
1749
|
+
else if (entry.type === "admin") event = "home_navigate_to_admin_view";
|
|
1750
|
+
context.analyticsController?.onAnalyticsEvent?.(event, {
|
|
1751
|
+
path: entry.slug
|
|
1752
|
+
});
|
|
1753
|
+
} }, entry.url)),
|
|
1754
|
+
!performingSearch && groupKey.toLowerCase() !== ADMIN_GROUP_NAME.toLowerCase() && additionalCards
|
|
1755
|
+
] }) }) }) }, `group-${groupIndex}`);
|
|
1756
|
+
}) }, JSON.stringify(containers)),
|
|
1757
|
+
/* @__PURE__ */ jsx(NewGroupDropZone, { disabled: dndDisabled, setIsHovering: setIsHoveringNewGroupDropZone }),
|
|
1758
|
+
/* @__PURE__ */ jsx(DragOverlay, { adjustScale: false, dropAnimation, children: activeGroupData && draggingGroupId === activeGroupData.name ? /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-transparent", style: {
|
|
1759
|
+
padding: 0,
|
|
1760
|
+
margin: 0
|
|
1761
|
+
}, 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 })
|
|
1762
|
+
] }),
|
|
1763
|
+
!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: () => {
|
|
1764
|
+
let event_0 = "unmapped_event";
|
|
1765
|
+
if (entry_0.type === "collection") event_0 = "home_navigate_to_collection";
|
|
1766
|
+
else if (entry_0.type === "view") event_0 = "home_navigate_to_view";
|
|
1767
|
+
else if (entry_0.type === "admin") event_0 = "home_navigate_to_admin_view";
|
|
1768
|
+
context.analyticsController?.onAnalyticsEvent?.(event_0, {
|
|
1769
|
+
path: entry_0.slug
|
|
1770
|
+
});
|
|
1771
|
+
} }, entry_0.url)) }) }),
|
|
1772
|
+
sections && sections.map((section) => /* @__PURE__ */ jsx(NavigationGroup, { group: section.title, children: section.children }, section.key)),
|
|
1773
|
+
additionalPluginChildrenEnd,
|
|
1774
|
+
additionalChildrenEnd
|
|
1775
|
+
] }),
|
|
1776
|
+
dialogOpenForGroup && /* @__PURE__ */ jsx(RenameGroupDialog, { open: true, initialName: dialogOpenForGroup, existingGroupNames: items.map((g_10) => g_10.name).filter((n) => n !== dialogOpenForGroup), onClose: handleDialogClose, onRename: (newName) => {
|
|
1777
|
+
handleRenameGroup(dialogOpenForGroup, newName);
|
|
1778
|
+
} })
|
|
1779
|
+
] });
|
|
1780
|
+
}
|
|
1781
|
+
export {
|
|
1782
|
+
ADMIN_GROUP_NAME,
|
|
1783
|
+
ContentHomePage,
|
|
1784
|
+
DEFAULT_GROUP_NAME
|
|
1785
|
+
};
|
|
1786
|
+
//# sourceMappingURL=ContentHomePage-CDF_a6Lp.js.map
|