@likec4/diagram 1.57.0 → 1.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LikeC4Diagram.js +1 -1
- package/dist/LikeC4Diagram.props.d.ts +1 -1
- package/dist/LikeC4Styles.js +1 -1
- package/dist/LikeC4View.js +2 -2
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/base/Base.d.ts +3 -2
- package/dist/base/Base.js +14 -26
- package/dist/base/BaseXYFlow.d.ts +2 -1
- package/dist/base/BaseXYFlow.js +63 -4
- package/dist/base/keyboardZoom.d.ts +3 -0
- package/dist/base/keyboardZoom.js +20 -0
- package/dist/base/updateEdges.js +7 -16
- package/dist/base/updateNodes.js +3 -9
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundActionButton.js +5 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +5 -2
- package/dist/base-primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundTitle.d.ts +7 -1
- package/dist/base-primitives/compound/CompoundTitle.js +2 -1
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +2 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -2
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -0
- package/dist/base-primitives/edge/EdgeLabel.js +2 -5
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeMarkers.d.ts +8 -8
- package/dist/base-primitives/element/ElementActionButtons.d.ts +2 -1
- package/dist/base-primitives/element/ElementActionButtons.js +4 -1
- package/dist/base-primitives/element/ElementData.d.ts +4 -2
- package/dist/base-primitives/element/ElementData.js +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +5 -2
- package/dist/base-primitives/element/ElementNodeContainer.js +1 -1
- package/dist/base-primitives/element/ElementShape.d.ts +1 -1
- package/dist/base-primitives/element/ElementShape.js +3 -0
- package/dist/base-primitives/element/ElementTags.d.ts +1 -1
- package/dist/base-primitives/element/ElementTags.js +1 -3
- package/dist/components/ErrorFallback.d.ts +2 -2
- package/dist/components/ErrorFallback.js +3 -5
- package/dist/components/Link.js +6 -6
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +1 -1
- package/dist/components/PortalToContainer.d.ts +1 -1
- package/dist/components/RootContainer.d.ts +1 -1
- package/dist/components/SearchControl.css.js +11 -11
- package/dist/components/SearchControl.d.ts +2 -2
- package/dist/components/ViewNotFound.d.ts +2 -2
- package/dist/context/CurrentViewModelProvider.d.ts +1 -1
- package/dist/context/DefaultMantineProvider.d.ts +1 -1
- package/dist/context/DiagramEventHandlers.d.ts +1 -1
- package/dist/context/EnsureMantine.d.ts +1 -1
- package/dist/context/FramerMotionConfig.d.ts +3 -3
- package/dist/context/FramerMotionConfig.js +2 -2
- package/dist/context/IconRenderer.d.ts +2 -2
- package/dist/context/IconRenderer.js +32 -12
- package/dist/context/LikeC4ModelContext.d.ts +1 -1
- package/dist/context/TagStylesContext.d.ts +4 -3
- package/dist/context/TagStylesContext.js +20 -22
- package/dist/custom/index.d.ts +1 -0
- package/dist/custom/index.js +3 -2
- package/dist/editor/LikeC4EditorProvider.d.ts +2 -2
- package/dist/editor/actor/actions.d.ts +74 -15
- package/dist/editor/actor/actions.js +91 -25
- package/dist/editor/actor/hotkey.d.ts +1 -1
- package/dist/editor/actor/hotkey.js +7 -0
- package/dist/editor/actor/machine.d.ts +4 -6
- package/dist/editor/actor/machine.js +1 -0
- package/dist/editor/actor/setup.d.ts +25 -4
- package/dist/editor/actor/setup.js +8 -6
- package/dist/editor/actor/state.editor.d.ts +64 -14
- package/dist/editor/actor/state.editor.js +12 -11
- package/dist/editor/actor/state.sync-queue.d.ts +283 -91
- package/dist/editor/actor/state.sync-queue.js +93 -56
- package/dist/editor/actor/types.d.ts +6 -1
- package/dist/editor/actor/types.js +1 -1
- package/dist/editor/useEditorActorLogic.js +14 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/safeContext.d.ts +156 -3
- package/dist/hooks/safeContext.js +60 -12
- package/dist/hooks/useCurrentViewModel.js +1 -1
- package/dist/hooks/useDiagram.d.ts +8 -0
- package/dist/hooks/useDiagram.js +9 -2
- package/dist/hooks/useEditorActor.d.ts +5 -0
- package/dist/hooks/useEditorActor.js +4 -3
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +5 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -2
- package/dist/likec4diagram/DiagramUI.d.ts +1 -1
- package/dist/likec4diagram/DiagramUI.js +19 -6
- package/dist/likec4diagram/DiagramXYFlow.js +54 -17
- package/dist/likec4diagram/convert-to-xyflow.d.ts +3 -5
- package/dist/likec4diagram/convert-to-xyflow.js +29 -10
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +140 -18
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +11 -4
- package/dist/likec4diagram/custom/edges/edges.css.d.ts +1 -0
- package/dist/likec4diagram/custom/edges/edges.css.js +6 -2
- package/dist/likec4diagram/custom/index.d.ts +2 -1
- package/dist/likec4diagram/custom/index.js +5 -3
- package/dist/likec4diagram/custom/nodes/CompoundActions.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -0
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +4 -4
- package/dist/likec4diagram/custom/nodes/ElementActions.js +13 -3
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +0 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +32 -19
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.ts +2 -0
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +234 -0
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +7 -7
- package/dist/likec4diagram/custom/nodes/nodes.js +20 -5
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.d.ts +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -14
- package/dist/likec4diagram/relationship-popover/components.d.ts +2 -2
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.js +11 -20
- package/dist/likec4diagram/state/aligners.js +1 -1
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/assign.js +1 -1
- package/dist/likec4diagram/state/createViewChange.js +2 -1
- package/dist/likec4diagram/state/diagram-api.d.ts +18 -10
- package/dist/likec4diagram/state/diagram-api.js +333 -229
- package/dist/likec4diagram/state/machine.actions.d.ts +1026 -332
- package/dist/likec4diagram/state/machine.actions.js +118 -46
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +123 -51
- package/dist/likec4diagram/state/machine.actions.layout.js +40 -33
- package/dist/likec4diagram/state/machine.d.ts +154 -16
- package/dist/likec4diagram/state/machine.js +5 -41
- package/dist/likec4diagram/state/machine.setup.d.ts +84 -19
- package/dist/likec4diagram/state/machine.setup.js +65 -12
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +59 -33
- package/dist/likec4diagram/state/machine.state.navigating.js +7 -3
- package/dist/likec4diagram/state/machine.state.ready.d.ts +1540 -476
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +294 -53
- package/dist/likec4diagram/state/machine.state.ready.focused.js +3 -3
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +264 -73
- package/dist/likec4diagram/state/machine.state.ready.idle.js +31 -6
- package/dist/likec4diagram/state/machine.state.ready.js +22 -16
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +23 -9
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +288 -84
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +135 -66
- package/dist/likec4diagram/state/types.d.ts +4 -2
- package/dist/likec4diagram/state/utils.d.ts +7 -0
- package/dist/likec4diagram/state/utils.js +36 -34
- package/dist/likec4diagram/types.d.ts +49 -3
- package/dist/likec4diagram/ui/FloatingSequenceActors.d.ts +6 -0
- package/dist/likec4diagram/ui/FloatingSequenceActors.js +155 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +1 -1
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +2 -2
- package/dist/likec4diagram/ui/index.d.ts +2 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -5
- package/dist/likec4diagram/ui/notation/NotationPanel.d.ts +1 -1
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +519 -0
- package/dist/likec4diagram/ui/sequence-outline/state.d.ts +36 -0
- package/dist/likec4diagram/ui/sequence-outline/state.js +55 -0
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +1 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +116 -62
- package/dist/likec4diagram/xyflow-sequence/_types.d.ts +55 -5
- package/dist/likec4diagram/xyflow-sequence/const.d.ts +5 -5
- package/dist/likec4diagram/xyflow-sequence/const.js +4 -4
- package/dist/likec4diagram/xyflow-sequence/layouter.d.ts +30 -6
- package/dist/likec4diagram/xyflow-sequence/layouter.js +561 -0
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.d.ts → sequence-view-to-xy.d.ts} +8 -2
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.js → sequence-view-to-xy.js} +112 -14
- package/dist/likec4diagram/xyflow-sequence/sequence-view.d.ts +2 -7
- package/dist/likec4diagram/xyflow-sequence/sequence-view.js +144 -0
- package/dist/likec4diagram/xyflow-sequence/utils.d.ts +9 -1
- package/dist/likec4diagram/xyflow-sequence/utils.js +96 -0
- package/dist/navigationpanel/NavigationPanel.d.ts +5 -2
- package/dist/navigationpanel/NavigationPanel.js +58 -59
- package/dist/navigationpanel/NavigationPanelControls.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +47 -40
- package/dist/navigationpanel/_common.d.ts +2 -2
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.actions.d.ts +19 -0
- package/dist/navigationpanel/actor.actions.js +45 -0
- package/dist/navigationpanel/actor.d.ts +34 -96
- package/dist/navigationpanel/actor.js +21 -84
- package/dist/navigationpanel/actor.setup.d.ts +98 -0
- package/dist/navigationpanel/actor.setup.js +31 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +4 -5
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +1 -1
- package/dist/navigationpanel/controls/DetailsControls.d.ts +1 -1
- package/dist/navigationpanel/controls/DetailsControls.js +7 -8
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +1 -1
- package/dist/navigationpanel/controls/LogoButton.d.ts +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
- package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/EditorPanel.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/styles.js +8 -8
- package/dist/navigationpanel/hooks.d.ts +20 -5
- package/dist/navigationpanel/hooks.js +4 -18
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +2 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -5
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +23 -25
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +5 -5
- package/dist/overlays/Overlays.d.ts +4 -2
- package/dist/overlays/Overlays.js +10 -10
- package/dist/overlays/element-details/ElementDetails.d.ts +1 -1
- package/dist/overlays/element-details/ElementDetailsCard.css.js +17 -17
- package/dist/overlays/element-details/ElementDetailsCard.d.ts +1 -1
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -2
- package/dist/overlays/element-details/MetadataValue.js +15 -15
- package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -11
- package/dist/overlays/element-details/TabPanelRelationships.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelRelationships.js +1 -1
- package/dist/overlays/element-details/TabPanelStructure.css.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.d.ts +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +2 -3
- package/dist/overlays/hooks.d.ts +28 -0
- package/dist/overlays/hooks.js +5 -0
- package/dist/overlays/overlay/Overlay.js +34 -25
- package/dist/overlays/overlaysActor.js +0 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
- package/dist/overlays/relationship-details/SelectEdge.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +4 -4
- package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.d.ts +1 -1
- package/dist/overlays/relationships-browser/actor.js +79 -78
- package/dist/overlays/relationships-browser/custom/ElementActions.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/EmptyNode.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +4 -4
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.js +1 -1
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/projects-overview/ProjectsOverview.d.ts +1 -1
- package/dist/projects-overview/actor.js +4 -4
- package/dist/projects-overview/custom/nodeTypes.d.ts +1 -1
- package/dist/projects-overview/panel/ProjectsOverviewPanel.d.ts +1 -1
- package/dist/search/Search.d.ts +1 -1
- package/dist/search/Search.js +1 -1
- package/dist/search/XStateSearchAdapter.d.ts +1 -1
- package/dist/search/components/ElementsColumn.css.js +2 -2
- package/dist/search/components/ElementsColumn.d.ts +1 -1
- package/dist/search/components/PickView.d.ts +1 -1
- package/dist/search/components/SearchByTags.d.ts +1 -1
- package/dist/search/components/SearchInput.d.ts +1 -1
- package/dist/search/components/ViewsColum.d.ts +3 -3
- package/dist/search/components/ViewsColum.js +1 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +23 -23
- package/dist/search/components/styles.css.js +4 -4
- package/dist/shadowroot/ShadowRoot.d.ts +2 -3
- package/dist/shadowroot/ShadowRoot.js +95 -41
- package/dist/shadowroot/index.d.ts +1 -0
- package/dist/styles2.js +1 -1
- package/dist/utils/defineActors.d.ts +21 -0
- package/dist/utils/defineActors.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +5 -4
- package/dist/utils/readableText.d.ts +11 -0
- package/dist/utils/readableText.js +18 -0
- package/package.json +30 -43
- package/panda.buildinfo.json +271 -295
- package/styles-min.css +1 -1
- package/styles-xyflow.css +1 -1
- package/styles.css +1 -1
- package/adhoc-editor/package.json +0 -4
- package/dist/adhoc-editor/EditorPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorPanel.js +0 -106
- package/dist/adhoc-editor/ElementsTree.d.ts +0 -2
- package/dist/adhoc-editor/ElementsTree.js +0 -112
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +0 -4
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +0 -83
- package/dist/adhoc-editor/components/Tree.d.ts +0 -48
- package/dist/adhoc-editor/components/Tree.js +0 -213
- package/dist/adhoc-editor/hooks.d.ts +0 -14
- package/dist/adhoc-editor/hooks.js +0 -34
- package/dist/adhoc-editor/index.d.ts +0 -2
- package/dist/adhoc-editor/index.js +0 -2
- package/dist/adhoc-editor/state/ActorProvider.d.ts +0 -5
- package/dist/adhoc-editor/state/ActorProvider.js +0 -37
- package/dist/adhoc-editor/state/actor.d.ts +0 -13
- package/dist/adhoc-editor/state/actor.editor.d.ts +0 -56
- package/dist/adhoc-editor/state/actor.editor.js +0 -167
- package/dist/adhoc-editor/state/actor.js +0 -14
- package/dist/adhoc-editor/state/actor.layouter.d.ts +0 -51
- package/dist/adhoc-editor/state/actor.layouter.js +0 -54
- package/dist/adhoc-editor/state/actor.types.d.ts +0 -63
- package/dist/adhoc-editor/state/actor.types.js +0 -25
- package/dist/adhoc-editor/state/panel.d.ts +0 -95
- package/dist/adhoc-editor/state/panel.js +0 -124
- package/dist/adhoc-editor/state/utils.d.ts +0 -17
- package/dist/adhoc-editor/state/utils.js +0 -25
- package/dist/adhoc-editor/useElementsTree.d.ts +0 -18
- package/dist/adhoc-editor/useElementsTree.js +0 -98
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +0 -6
- package/dist/shadowroot/styles.css.d.ts +0 -12
- package/dist/shadowroot/styles.css.js +0 -59
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { useOnDiagramEvent } from "../hooks/useDiagram.js";
|
|
3
3
|
import { useLikeC4Model } from "../hooks/useLikeC4Model.js";
|
|
4
|
-
import {
|
|
4
|
+
import { Tooltip as Tooltip$1 } from "./_common.js";
|
|
5
|
+
import { selectNavigationContext, useNavigationActor, useNavigationActorRef, useNavigationActorSelector } from "./hooks.js";
|
|
5
6
|
import { breadcrumbTitle } from "./styles.css.js";
|
|
6
7
|
import { NavigationLink } from "../components/NavigationLink.js";
|
|
7
8
|
import { ProjectsMenu } from "./dropdown/ProjectsMenu.js";
|
|
@@ -12,7 +13,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
13
|
import { useMountEffect } from "@react-hookz/web";
|
|
13
14
|
import { deepEqual, shallowEqual } from "fast-equals";
|
|
14
15
|
import { isArray, isEmpty, pipe, sort } from "remeda";
|
|
15
|
-
import { Breadcrumbs, Button, Divider, Highlight, Input, PopoverDropdown, ScrollAreaAutosize, UnstyledButton, createScopedKeydownHandler
|
|
16
|
+
import { Breadcrumbs, Button, Divider, Highlight, Input, PopoverDropdown, ScrollAreaAutosize, UnstyledButton, createScopedKeydownHandler } from "@mantine/core";
|
|
16
17
|
import { compareNaturalHierarchically, ifilter, ifirst, nonexhaustive, toArray } from "@likec4/core/utils";
|
|
17
18
|
import { useSelector } from "@xstate/react";
|
|
18
19
|
import { useThrottledCallback, useUncontrolled } from "@mantine/hooks";
|
|
@@ -27,12 +28,10 @@ var scopedKeydownHandler = createScopedKeydownHandler({
|
|
|
27
28
|
loop: true,
|
|
28
29
|
orientation: "vertical"
|
|
29
30
|
});
|
|
30
|
-
|
|
31
|
-
return s.context.searchQuery.trim().length >= 2;
|
|
32
|
-
}
|
|
31
|
+
var hasSearchQuerySelector = selectNavigationContext((s) => s.searchQuery.trim().length >= 2);
|
|
33
32
|
var NavigationPanelDropdown = memo(() => {
|
|
34
33
|
const actor = useNavigationActor();
|
|
35
|
-
const hasSearchQuery =
|
|
34
|
+
const hasSearchQuery = useNavigationActorSelector(hasSearchQuerySelector);
|
|
36
35
|
useOnDiagramEvent("paneClick", () => {
|
|
37
36
|
actor.closeDropdown();
|
|
38
37
|
});
|
|
@@ -70,7 +69,7 @@ var NavigationPanelDropdown = memo(() => {
|
|
|
70
69
|
scrollbars: "x",
|
|
71
70
|
type: "auto",
|
|
72
71
|
offsetScrollbars: "present",
|
|
73
|
-
classNames: { root: css({ maxWidth: ["calc(100vw - 50px)", "calc(100cqw - 50px)"] }) },
|
|
72
|
+
classNames: { root: css({ maxWidth: ["[calc(100vw - 50px)]", "[calc(100cqw - 50px)]"] }) },
|
|
74
73
|
styles: { viewport: { overscrollBehavior: "none" } },
|
|
75
74
|
children: hasSearchQuery ? /* @__PURE__ */ jsx(SearchResults, {}) : /* @__PURE__ */ jsx(FolderColumns, {})
|
|
76
75
|
})
|
|
@@ -108,8 +107,8 @@ var SearchResults = memo(() => {
|
|
|
108
107
|
offsetScrollbars: false,
|
|
109
108
|
className: css({
|
|
110
109
|
width: "100%",
|
|
111
|
-
maxWidth: ["calc(100vw - 250px)", "calc(100cqw - 250px)"],
|
|
112
|
-
maxHeight: ["calc(100vh - 200px)", "calc(100cqh - 200px)"]
|
|
110
|
+
maxWidth: ["[calc(100vw - 250px)]", "[calc(100cqw - 250px)]"],
|
|
111
|
+
maxHeight: ["[calc(100vh - 200px)]", "[calc(100cqh - 200px)]"]
|
|
113
112
|
}),
|
|
114
113
|
children: /* @__PURE__ */ jsx(VStack, {
|
|
115
114
|
gap: "0.5",
|
|
@@ -132,13 +131,13 @@ var foundedViewClass = hstack({
|
|
|
132
131
|
px: "xs",
|
|
133
132
|
py: "xxs",
|
|
134
133
|
_hover: { backgroundColor: {
|
|
135
|
-
base: "mantine.
|
|
136
|
-
_dark: "mantine.
|
|
134
|
+
base: "mantine.gray[1]",
|
|
135
|
+
_dark: "mantine.dark[5]"
|
|
137
136
|
} },
|
|
138
137
|
_focus: {
|
|
139
138
|
outline: "none",
|
|
140
|
-
color: "mantine.
|
|
141
|
-
backgroundColor: "mantine.
|
|
139
|
+
color: "mantine.primary.lightColor!",
|
|
140
|
+
backgroundColor: "mantine.primary.lightHover!"
|
|
142
141
|
}
|
|
143
142
|
});
|
|
144
143
|
var inheritColor = css({ _groupFocus: {
|
|
@@ -152,8 +151,8 @@ function FoundedView({ view, highlight, ...props }) {
|
|
|
152
151
|
component: "div",
|
|
153
152
|
className: cx(inheritColor, breadcrumbTitle({ truncate: true }), css({ "& > mark": {
|
|
154
153
|
backgroundColor: {
|
|
155
|
-
base: "mantine.
|
|
156
|
-
_dark: "mantine.
|
|
154
|
+
base: "mantine.yellow[2]/90",
|
|
155
|
+
_dark: "mantine.yellow[5]/80",
|
|
157
156
|
_groupFocus: "[transparent]"
|
|
158
157
|
},
|
|
159
158
|
color: { _groupFocus: "[inherit!]" }
|
|
@@ -235,7 +234,7 @@ var ViewTypeIcon = {
|
|
|
235
234
|
};
|
|
236
235
|
var ColumnScrollArea = ScrollAreaAutosize.withProps({
|
|
237
236
|
scrollbars: "y",
|
|
238
|
-
className: css({ maxHeight: ["calc(100vh - 160px)", "calc(100cqh - 160px)"] })
|
|
237
|
+
className: css({ maxHeight: ["[calc(100vh - 160px)]", "[calc(100cqh - 160px)]"] })
|
|
239
238
|
});
|
|
240
239
|
function folderColumn(folder, context) {
|
|
241
240
|
return {
|
|
@@ -255,17 +254,17 @@ function folderColumn(folder, context) {
|
|
|
255
254
|
}))]
|
|
256
255
|
};
|
|
257
256
|
}
|
|
258
|
-
var selectColumns = (
|
|
259
|
-
const viewModel =
|
|
257
|
+
var selectColumns = selectNavigationContext((ctx) => {
|
|
258
|
+
const viewModel = ctx.viewModel;
|
|
260
259
|
if (!viewModel) return [];
|
|
261
260
|
const likec4model = viewModel.$model;
|
|
262
|
-
const columns = [folderColumn(likec4model.rootViewFolder,
|
|
263
|
-
const folder = likec4model.viewFolder(
|
|
264
|
-
if (!folder.isRoot) for (const b of folder.breadcrumbs) columns.push(folderColumn(b,
|
|
261
|
+
const columns = [folderColumn(likec4model.rootViewFolder, ctx)];
|
|
262
|
+
const folder = likec4model.viewFolder(ctx.selectedFolder);
|
|
263
|
+
if (!folder.isRoot) for (const b of folder.breadcrumbs) columns.push(folderColumn(b, ctx));
|
|
265
264
|
return columns;
|
|
266
|
-
};
|
|
265
|
+
}, deepEqual);
|
|
267
266
|
var FolderColumns = memo(() => {
|
|
268
|
-
const columns =
|
|
267
|
+
const columns = useNavigationActorSelector(selectColumns);
|
|
269
268
|
return /* @__PURE__ */ jsx(HStack, {
|
|
270
269
|
gap: "xs",
|
|
271
270
|
alignItems: "stretch",
|
|
@@ -320,16 +319,24 @@ function FolderColumnItem({ columnItem, ...props }) {
|
|
|
320
319
|
miw: "200px",
|
|
321
320
|
...props
|
|
322
321
|
}, columnItem.folderPath);
|
|
323
|
-
case "view": return /* @__PURE__ */ jsx(
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
322
|
+
case "view": return /* @__PURE__ */ jsx(Tooltip$1, {
|
|
323
|
+
label: columnItem.description,
|
|
324
|
+
disabled: !columnItem.description,
|
|
325
|
+
multiline: true,
|
|
326
|
+
w: 260,
|
|
327
|
+
withinPortal: true,
|
|
328
|
+
position: "left",
|
|
329
|
+
children: /* @__PURE__ */ jsx(NavigationLink, {
|
|
330
|
+
variant: "filled",
|
|
331
|
+
active: columnItem.selected,
|
|
332
|
+
label: columnItem.title,
|
|
333
|
+
description: columnItem.description,
|
|
334
|
+
leftSection: ViewTypeIcon[columnItem.viewType],
|
|
335
|
+
maw: "300px",
|
|
336
|
+
miw: "200px",
|
|
337
|
+
...props
|
|
338
|
+
}, columnItem.viewId)
|
|
339
|
+
});
|
|
333
340
|
default: nonexhaustive(columnItem);
|
|
334
341
|
}
|
|
335
342
|
}
|
|
@@ -342,7 +349,7 @@ function SearchInput(props) {
|
|
|
342
349
|
size: "xs",
|
|
343
350
|
placeholder: "Search by title or id",
|
|
344
351
|
variant: "unstyled",
|
|
345
|
-
height:
|
|
352
|
+
height: 26,
|
|
346
353
|
value: _value,
|
|
347
354
|
onKeyDown: scopedKeydownHandler,
|
|
348
355
|
onChange: (e) => handleChange(e.currentTarget.value),
|
|
@@ -351,15 +358,15 @@ function SearchInput(props) {
|
|
|
351
358
|
wrapper: css({
|
|
352
359
|
flexGrow: 1,
|
|
353
360
|
backgroundColor: {
|
|
354
|
-
base: "mantine.
|
|
355
|
-
_dark: "mantine.
|
|
361
|
+
base: "mantine.gray[1]",
|
|
362
|
+
_dark: "mantine.dark[5]/80",
|
|
356
363
|
_hover: {
|
|
357
|
-
base: "mantine.
|
|
358
|
-
_dark: "mantine.
|
|
364
|
+
base: "mantine.gray[2]",
|
|
365
|
+
_dark: "mantine.dark[4]"
|
|
359
366
|
},
|
|
360
367
|
_focus: {
|
|
361
|
-
base: "mantine.
|
|
362
|
-
_dark: "mantine.
|
|
368
|
+
base: "mantine.gray[2]",
|
|
369
|
+
_dark: "mantine.dark[4]"
|
|
363
370
|
}
|
|
364
371
|
},
|
|
365
372
|
rounded: "sm"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { NavigationPanelActionIconVariant } from '
|
|
1
|
+
import { NavigationPanelActionIconVariant } from '../../styled-system/recipes';
|
|
2
2
|
import { ActionIconProps, TooltipProps, PlaceholderPolymorphicProps, BreadcrumbsProps } from '@mantine/core';
|
|
3
3
|
import { HTMLMotionProps } from 'motion/react';
|
|
4
4
|
import { NamedExoticComponent, RefAttributes, ForwardRefExoticComponent } from 'react';
|
|
5
5
|
export declare const Tooltip: NamedExoticComponent< TooltipProps & RefAttributes<HTMLDivElement> & PlaceholderPolymorphicProps>;
|
|
6
|
-
export declare const BreadcrumbsSeparator: () => import("react
|
|
6
|
+
export declare const BreadcrumbsSeparator: () => import("react").JSX.Element;
|
|
7
7
|
export declare const Breadcrumbs: NamedExoticComponent< BreadcrumbsProps & RefAttributes<HTMLDivElement> & PlaceholderPolymorphicProps>;
|
|
8
8
|
export type PanelActionIconProps = Partial<NavigationPanelActionIconVariant> & Omit<ActionIconProps, keyof NavigationPanelActionIconVariant> & Omit<HTMLMotionProps<'button'>, keyof NavigationPanelActionIconVariant>;
|
|
9
9
|
export declare const PanelActionIcon: ForwardRefExoticComponent<Omit<PanelActionIconProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
@@ -26,8 +26,8 @@ var BreadcrumbsSeparator = () => /* @__PURE__ */ jsx(ThemeIcon, {
|
|
|
26
26
|
"@/md": "flex"
|
|
27
27
|
},
|
|
28
28
|
color: {
|
|
29
|
-
base: "mantine.
|
|
30
|
-
_dark: "mantine.
|
|
29
|
+
base: "mantine.gray[5]",
|
|
30
|
+
_dark: "mantine.dark[3]"
|
|
31
31
|
}
|
|
32
32
|
}),
|
|
33
33
|
children: /* @__PURE__ */ jsx(IconChevronRight, {})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionFunction, EventObject } from 'xstate';
|
|
2
|
+
import { Context, Events } from './actor.setup';
|
|
3
|
+
export declare const updateActivatedBy: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
4
|
+
export declare const keepDropdownOpen: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
5
|
+
export declare const updateSelectedFolder: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
6
|
+
export declare const resetSelectedFolder: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
7
|
+
export declare const updateInputs: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
8
|
+
export declare const resetSearchQuery: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
9
|
+
export declare const updateSearchQuery: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
|
|
10
|
+
export declare const emitNavigateTo: () => ActionFunction<Context, Events, Events, undefined, never, never, {
|
|
11
|
+
type: "was opened on hover";
|
|
12
|
+
params: unknown;
|
|
13
|
+
} | {
|
|
14
|
+
type: "has search query";
|
|
15
|
+
params: unknown;
|
|
16
|
+
} | {
|
|
17
|
+
type: "search query is empty";
|
|
18
|
+
params: unknown;
|
|
19
|
+
}, "open timeout" | "close timeout", EventObject>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { typedSystem } from "../likec4diagram/state/utils.js";
|
|
3
|
+
import { actor } from "./actor.setup.js";
|
|
4
|
+
import { assertEvent } from "xstate";
|
|
5
|
+
//#region src/navigationpanel/actor.actions.ts
|
|
6
|
+
var updateActivatedBy = () => actor.assign({ activatedBy: ({ context, event }) => {
|
|
7
|
+
switch (true) {
|
|
8
|
+
case event.type.includes("click"): return "click";
|
|
9
|
+
case event.type.includes("mouseEnter"): return "hover";
|
|
10
|
+
default: return context.activatedBy;
|
|
11
|
+
}
|
|
12
|
+
} });
|
|
13
|
+
var keepDropdownOpen = () => actor.assign({ activatedBy: "click" });
|
|
14
|
+
var updateSelectedFolder = () => actor.assign(({ event }) => {
|
|
15
|
+
if (event.type === "breadcrumbs.click.root") return { selectedFolder: "" };
|
|
16
|
+
assertEvent(event, ["breadcrumbs.click.folder", "select.folder"]);
|
|
17
|
+
return { selectedFolder: event.folderPath };
|
|
18
|
+
});
|
|
19
|
+
var resetSelectedFolder = () => actor.assign({ selectedFolder: ({ context }) => context.viewModel?.folder.path ?? "" });
|
|
20
|
+
var updateInputs = () => actor.assign(({ context, event }) => {
|
|
21
|
+
assertEvent(event, "update.inputs");
|
|
22
|
+
const viewChanged = event.inputs.viewModel?.id !== context.viewModel?.id;
|
|
23
|
+
let selectedFolder = context.selectedFolder;
|
|
24
|
+
if (!event.inputs.viewModel?.folder.path.startsWith(selectedFolder)) selectedFolder = event.inputs.viewModel?.folder.path ?? "";
|
|
25
|
+
return {
|
|
26
|
+
view: event.inputs.view,
|
|
27
|
+
viewModel: event.inputs.viewModel,
|
|
28
|
+
selectedFolder,
|
|
29
|
+
activatedBy: viewChanged ? "hover" : context.activatedBy
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
var resetSearchQuery = () => actor.assign({ searchQuery: "" });
|
|
33
|
+
var updateSearchQuery = () => actor.assign(({ event }) => {
|
|
34
|
+
assertEvent(event, "searchQuery.change");
|
|
35
|
+
return { searchQuery: event.value ?? "" };
|
|
36
|
+
});
|
|
37
|
+
var emitNavigateTo = () => actor.enqueueActions(({ event, enqueue }) => {
|
|
38
|
+
assertEvent(event, "select.view");
|
|
39
|
+
enqueue.sendTo(typedSystem.diagramActor, {
|
|
40
|
+
type: "navigate.to",
|
|
41
|
+
viewId: event.viewId
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
//#endregion
|
|
45
|
+
export { emitNavigateTo, keepDropdownOpen, resetSearchQuery, resetSelectedFolder, updateActivatedBy, updateInputs, updateSearchQuery, updateSelectedFolder };
|
|
@@ -1,100 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type:
|
|
10
|
-
|
|
11
|
-
} | {
|
|
12
|
-
type:
|
|
13
|
-
|
|
14
|
-
} | {
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} | {
|
|
35
|
-
type: 'breadcrumbs.mouseEnter.viewtitle';
|
|
36
|
-
} | {
|
|
37
|
-
type: 'breadcrumbs.mouseLeave.viewtitle';
|
|
38
|
-
} | {
|
|
39
|
-
type: 'breadcrumbs.click.root';
|
|
40
|
-
} | {
|
|
41
|
-
type: 'breadcrumbs.click.folder';
|
|
42
|
-
folderPath: string;
|
|
43
|
-
} | {
|
|
44
|
-
type: 'breadcrumbs.click.viewtitle';
|
|
45
|
-
} | {
|
|
46
|
-
type: 'dropdown.mouseEnter';
|
|
47
|
-
} | {
|
|
48
|
-
type: 'dropdown.mouseLeave';
|
|
49
|
-
} | {
|
|
50
|
-
type: 'dropdown.dismiss';
|
|
51
|
-
};
|
|
52
|
-
export type NavigationPanelActorEmitted = {
|
|
53
|
-
type: 'navigateTo';
|
|
54
|
-
viewId: ViewId;
|
|
55
|
-
};
|
|
56
|
-
export type BreadcrumbItem = {
|
|
57
|
-
type: 'folder';
|
|
58
|
-
folderPath: string;
|
|
59
|
-
title: string;
|
|
60
|
-
} | {
|
|
61
|
-
type: 'viewtitle';
|
|
62
|
-
title: string;
|
|
63
|
-
};
|
|
64
|
-
export type DropdownColumnItem = {
|
|
65
|
-
type: 'folder';
|
|
66
|
-
folderPath: string;
|
|
67
|
-
title: string;
|
|
68
|
-
selected: boolean;
|
|
69
|
-
} | {
|
|
70
|
-
type: 'view';
|
|
71
|
-
viewType: 'element' | 'deployment' | 'dynamic' | 'index';
|
|
72
|
-
viewId: string;
|
|
73
|
-
title: string;
|
|
74
|
-
description: string | null;
|
|
75
|
-
selected: boolean;
|
|
76
|
-
};
|
|
77
|
-
export interface NavigationPanelActorContext {
|
|
78
|
-
view: LayoutedView;
|
|
79
|
-
viewModel: CurrentViewModel | null;
|
|
80
|
-
/**
|
|
81
|
-
* Who activated the dropdown
|
|
82
|
-
* (if `click` then the dropdown is always open until dismissed)
|
|
83
|
-
* @default 'hover'
|
|
84
|
-
*/
|
|
85
|
-
activatedBy: 'hover' | 'click';
|
|
86
|
-
/**
|
|
87
|
-
* The folder that is currently selected in the dropdown
|
|
88
|
-
* By default it is the root
|
|
89
|
-
*/
|
|
90
|
-
selectedFolder: string;
|
|
91
|
-
searchQuery: string;
|
|
92
|
-
}
|
|
93
|
-
type Tags = 'active';
|
|
94
|
-
export interface NavigationPanelActorLogic extends StateMachine<NavigationPanelActorContext, NavigationPanelActorEvent, {}, any, any, any, any, any, Tags, NavigationPanelActorInput, any, NavigationPanelActorEmitted, any, any> {
|
|
1
|
+
import { ActorRef, SnapshotFrom, StateMachine, StateValueFrom, NonReducibleUnknown, EventObject, MetaObject } from 'xstate';
|
|
2
|
+
import { Context as NavigationPanelActorContextFactory, Context as NavigationPanelActorContext, Events as NavigationPanelActorEvent, Input as NavigationPanelActorInput, Tags } from './actor.setup';
|
|
3
|
+
export type { NavigationPanelActorContext, NavigationPanelActorEvent, NavigationPanelActorInput, };
|
|
4
|
+
export type { BreadcrumbItem, DropdownColumnItem } from './actor.setup';
|
|
5
|
+
declare const _actorLogic: StateMachine<NavigationPanelActorContextFactory, NavigationPanelActorEvent, {}, never, never, {
|
|
6
|
+
type: "was opened on hover";
|
|
7
|
+
params: unknown;
|
|
8
|
+
} | {
|
|
9
|
+
type: "has search query";
|
|
10
|
+
params: unknown;
|
|
11
|
+
} | {
|
|
12
|
+
type: "search query is empty";
|
|
13
|
+
params: unknown;
|
|
14
|
+
}, "open timeout" | "close timeout", "pending" | "idle" | {
|
|
15
|
+
active: "search" | "opened" | "decide" | "closing";
|
|
16
|
+
}, "active", NavigationPanelActorInput, NonReducibleUnknown, EventObject, MetaObject, {
|
|
17
|
+
id: "navigationPanel";
|
|
18
|
+
states: {
|
|
19
|
+
readonly idle: {
|
|
20
|
+
id: "idle";
|
|
21
|
+
};
|
|
22
|
+
readonly pending: {};
|
|
23
|
+
readonly active: {
|
|
24
|
+
states: {
|
|
25
|
+
readonly decide: {};
|
|
26
|
+
readonly opened: {};
|
|
27
|
+
readonly search: {};
|
|
28
|
+
readonly closing: {};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
33
|
+
export interface NavigationPanelActorLogic extends StateMachine<NavigationPanelActorContext, NavigationPanelActorEvent, any, any, any, any, any, StateValueFrom<typeof _actorLogic>, Tags, NavigationPanelActorInput, any, any, any, any> {
|
|
95
34
|
}
|
|
96
35
|
export declare const navigationPanelActorLogic: NavigationPanelActorLogic;
|
|
97
36
|
export type NavigationPanelActorSnapshot = SnapshotFrom<NavigationPanelActorLogic>;
|
|
98
|
-
export interface NavigationPanelActorRef extends ActorRef<NavigationPanelActorSnapshot, NavigationPanelActorEvent,
|
|
37
|
+
export interface NavigationPanelActorRef extends ActorRef<NavigationPanelActorSnapshot, NavigationPanelActorEvent, never> {
|
|
99
38
|
}
|
|
100
|
-
export {};
|
|
@@ -1,78 +1,15 @@
|
|
|
1
1
|
import "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
tags: "",
|
|
9
|
-
input: {},
|
|
10
|
-
emitted: {}
|
|
11
|
-
},
|
|
12
|
-
delays: {
|
|
13
|
-
"open timeout": 500,
|
|
14
|
-
"close timeout": 350
|
|
15
|
-
},
|
|
16
|
-
actions: {
|
|
17
|
-
"update activatedBy": assign({ activatedBy: ({ context, event }) => {
|
|
18
|
-
switch (true) {
|
|
19
|
-
case event.type.includes("click"): return "click";
|
|
20
|
-
case event.type.includes("mouseEnter"): return "hover";
|
|
21
|
-
default: return context.activatedBy;
|
|
22
|
-
}
|
|
23
|
-
} }),
|
|
24
|
-
"keep dropdown open": assign({ activatedBy: "click" }),
|
|
25
|
-
"update selected folder": assign(({ event }) => {
|
|
26
|
-
if (event.type === "breadcrumbs.click.root") return { selectedFolder: "" };
|
|
27
|
-
assertEvent(event, ["breadcrumbs.click.folder", "select.folder"]);
|
|
28
|
-
return { selectedFolder: event.folderPath };
|
|
29
|
-
}),
|
|
30
|
-
"reset selected folder": assign({ selectedFolder: ({ context }) => context.viewModel?.folder.path ?? "" }),
|
|
31
|
-
"update inputs": assign(({ context, event }) => {
|
|
32
|
-
assertEvent(event, "update.inputs");
|
|
33
|
-
const viewChanged = event.inputs.viewModel?.id !== context.viewModel?.id;
|
|
34
|
-
let selectedFolder = context.selectedFolder;
|
|
35
|
-
if (!event.inputs.viewModel?.folder.path.startsWith(selectedFolder)) selectedFolder = event.inputs.viewModel?.folder.path ?? "";
|
|
36
|
-
return {
|
|
37
|
-
view: event.inputs.view,
|
|
38
|
-
viewModel: event.inputs.viewModel,
|
|
39
|
-
selectedFolder,
|
|
40
|
-
activatedBy: viewChanged ? "hover" : context.activatedBy
|
|
41
|
-
};
|
|
42
|
-
}),
|
|
43
|
-
"reset search query": assign({ searchQuery: "" }),
|
|
44
|
-
"update search query": assign(({ event }) => {
|
|
45
|
-
assertEvent(event, "searchQuery.change");
|
|
46
|
-
return { searchQuery: event.value ?? "" };
|
|
47
|
-
}),
|
|
48
|
-
"emit navigateTo": emit(({ event }) => {
|
|
49
|
-
assertEvent(event, "select.view");
|
|
50
|
-
return {
|
|
51
|
-
type: "navigateTo",
|
|
52
|
-
viewId: event.viewId
|
|
53
|
-
};
|
|
54
|
-
})
|
|
55
|
-
},
|
|
56
|
-
guards: {
|
|
57
|
-
"was opened on hover": ({ context }) => context.activatedBy === "hover",
|
|
58
|
-
"has search query": ({ context }) => !isEmpty(context.searchQuery),
|
|
59
|
-
"search query is empty": ({ context }) => isEmpty(context.searchQuery)
|
|
60
|
-
}
|
|
61
|
-
}).createMachine({
|
|
62
|
-
id: "breadcrumbs",
|
|
63
|
-
context: ({ input }) => ({
|
|
64
|
-
...input,
|
|
65
|
-
breadcrumbs: [],
|
|
66
|
-
activatedBy: "hover",
|
|
67
|
-
selectedFolder: "",
|
|
68
|
-
searchQuery: "",
|
|
69
|
-
folderColumns: []
|
|
70
|
-
}),
|
|
2
|
+
import { Context, actor } from "./actor.setup.js";
|
|
3
|
+
import { emitNavigateTo, keepDropdownOpen, resetSearchQuery, resetSelectedFolder, updateActivatedBy, updateInputs, updateSearchQuery, updateSelectedFolder } from "./actor.actions.js";
|
|
4
|
+
import { raise } from "xstate";
|
|
5
|
+
var navigationPanelActorLogic = actor.createMachine({
|
|
6
|
+
id: "navigationPanel",
|
|
7
|
+
context: ({ input }) => Context({ input }),
|
|
71
8
|
initial: "idle",
|
|
72
|
-
entry: [
|
|
9
|
+
entry: [updateActivatedBy(), resetSelectedFolder()],
|
|
73
10
|
on: {
|
|
74
|
-
"update.inputs": { actions:
|
|
75
|
-
"searchQuery.change": { actions: [
|
|
11
|
+
"update.inputs": { actions: updateInputs() },
|
|
12
|
+
"searchQuery.change": { actions: [updateSearchQuery(), raise({ type: "searchQuery.changed" })] }
|
|
76
13
|
},
|
|
77
14
|
states: {
|
|
78
15
|
idle: {
|
|
@@ -80,21 +17,21 @@ var navigationPanelActorLogic = setup({
|
|
|
80
17
|
on: {
|
|
81
18
|
"breadcrumbs.mouseEnter.*": {
|
|
82
19
|
target: "pending",
|
|
83
|
-
actions:
|
|
20
|
+
actions: updateActivatedBy()
|
|
84
21
|
},
|
|
85
22
|
"breadcrumbs.click.*": {
|
|
86
23
|
target: "active",
|
|
87
|
-
actions:
|
|
24
|
+
actions: updateActivatedBy()
|
|
88
25
|
}
|
|
89
26
|
}
|
|
90
27
|
},
|
|
91
28
|
pending: {
|
|
92
29
|
on: {
|
|
93
|
-
"breadcrumbs.mouseEnter.*": { actions:
|
|
30
|
+
"breadcrumbs.mouseEnter.*": { actions: updateActivatedBy() },
|
|
94
31
|
"breadcrumbs.mouseLeave.*": { target: "idle" },
|
|
95
32
|
"breadcrumbs.click.*": {
|
|
96
33
|
target: "active",
|
|
97
|
-
actions:
|
|
34
|
+
actions: updateActivatedBy()
|
|
98
35
|
}
|
|
99
36
|
},
|
|
100
37
|
after: { "open timeout": { target: "active" } }
|
|
@@ -122,24 +59,24 @@ var navigationPanelActorLogic = setup({
|
|
|
122
59
|
opened: { on: {
|
|
123
60
|
"searchQuery.changed": {
|
|
124
61
|
guard: "has search query",
|
|
125
|
-
actions:
|
|
62
|
+
actions: keepDropdownOpen(),
|
|
126
63
|
target: "search"
|
|
127
64
|
},
|
|
128
|
-
"breadcrumbs.click.viewtitle": { actions:
|
|
129
|
-
"breadcrumbs.click.*": { actions:
|
|
130
|
-
"select.folder": { actions: [
|
|
131
|
-
"select.view": { actions:
|
|
65
|
+
"breadcrumbs.click.viewtitle": { actions: resetSelectedFolder() },
|
|
66
|
+
"breadcrumbs.click.*": { actions: updateSelectedFolder() },
|
|
67
|
+
"select.folder": { actions: [keepDropdownOpen(), updateSelectedFolder()] },
|
|
68
|
+
"select.view": { actions: emitNavigateTo() }
|
|
132
69
|
} },
|
|
133
70
|
search: { on: {
|
|
134
71
|
"breadcrumbs.click.viewtitle": {
|
|
135
|
-
actions: [
|
|
72
|
+
actions: [resetSearchQuery(), resetSelectedFolder()],
|
|
136
73
|
target: "opened"
|
|
137
74
|
},
|
|
138
75
|
"breadcrumbs.click.*": {
|
|
139
|
-
actions: [
|
|
76
|
+
actions: [resetSearchQuery(), updateSelectedFolder()],
|
|
140
77
|
target: "opened"
|
|
141
78
|
},
|
|
142
|
-
"select.view": { actions:
|
|
79
|
+
"select.view": { actions: emitNavigateTo() }
|
|
143
80
|
} },
|
|
144
81
|
closing: {
|
|
145
82
|
on: {
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { LayoutedView, ViewId } from '@likec4/core/types';
|
|
2
|
+
import { CurrentViewModel } from '../hooks/useCurrentViewModel';
|
|
3
|
+
import { SetupReturn, NonReducibleUnknown, EventObject, MetaObject } from 'xstate';
|
|
4
|
+
export interface Input {
|
|
5
|
+
view: LayoutedView;
|
|
6
|
+
viewModel: CurrentViewModel | null;
|
|
7
|
+
}
|
|
8
|
+
export type Events = {
|
|
9
|
+
type: 'update.inputs';
|
|
10
|
+
inputs: Input;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'searchQuery.change';
|
|
13
|
+
value: string;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'searchQuery.changed';
|
|
16
|
+
} | {
|
|
17
|
+
type: 'select.folder';
|
|
18
|
+
folderPath: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'select.view';
|
|
21
|
+
viewId: ViewId;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'breadcrumbs.mouseLeave';
|
|
24
|
+
} | {
|
|
25
|
+
type: 'breadcrumbs.mouseEnter.root';
|
|
26
|
+
} | {
|
|
27
|
+
type: 'breadcrumbs.mouseLeave.root';
|
|
28
|
+
} | {
|
|
29
|
+
type: 'breadcrumbs.mouseEnter.folder';
|
|
30
|
+
folderPath: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'breadcrumbs.mouseLeave.folder';
|
|
33
|
+
folderPath: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'breadcrumbs.mouseEnter.viewtitle';
|
|
36
|
+
} | {
|
|
37
|
+
type: 'breadcrumbs.mouseLeave.viewtitle';
|
|
38
|
+
} | {
|
|
39
|
+
type: 'breadcrumbs.click.root';
|
|
40
|
+
} | {
|
|
41
|
+
type: 'breadcrumbs.click.folder';
|
|
42
|
+
folderPath: string;
|
|
43
|
+
} | {
|
|
44
|
+
type: 'breadcrumbs.click.viewtitle';
|
|
45
|
+
} | {
|
|
46
|
+
type: 'dropdown.mouseEnter';
|
|
47
|
+
} | {
|
|
48
|
+
type: 'dropdown.mouseLeave';
|
|
49
|
+
} | {
|
|
50
|
+
type: 'dropdown.dismiss';
|
|
51
|
+
};
|
|
52
|
+
export type Emitted = unknown;
|
|
53
|
+
export type BreadcrumbItem = {
|
|
54
|
+
type: 'folder';
|
|
55
|
+
folderPath: string;
|
|
56
|
+
title: string;
|
|
57
|
+
} | {
|
|
58
|
+
type: 'viewtitle';
|
|
59
|
+
title: string;
|
|
60
|
+
};
|
|
61
|
+
export type DropdownColumnItem = {
|
|
62
|
+
type: 'folder';
|
|
63
|
+
folderPath: string;
|
|
64
|
+
title: string;
|
|
65
|
+
selected: boolean;
|
|
66
|
+
} | {
|
|
67
|
+
type: 'view';
|
|
68
|
+
viewType: 'element' | 'deployment' | 'dynamic' | 'index';
|
|
69
|
+
viewId: string;
|
|
70
|
+
title: string;
|
|
71
|
+
description: string | null;
|
|
72
|
+
selected: boolean;
|
|
73
|
+
};
|
|
74
|
+
export interface Context {
|
|
75
|
+
view: LayoutedView;
|
|
76
|
+
viewModel: CurrentViewModel | null;
|
|
77
|
+
/**
|
|
78
|
+
* Who activated the dropdown
|
|
79
|
+
* (if `click` then the dropdown is always open until dismissed)
|
|
80
|
+
* @default 'hover'
|
|
81
|
+
*/
|
|
82
|
+
activatedBy: 'hover' | 'click';
|
|
83
|
+
/**
|
|
84
|
+
* The folder that is currently selected in the dropdown
|
|
85
|
+
* By default it is the root
|
|
86
|
+
*/
|
|
87
|
+
selectedFolder: string;
|
|
88
|
+
searchQuery: string;
|
|
89
|
+
}
|
|
90
|
+
export type Tags = 'active';
|
|
91
|
+
export declare function Context({ input }: {
|
|
92
|
+
input: Input;
|
|
93
|
+
}): Context;
|
|
94
|
+
export declare const actor: SetupReturn<Context, Events, {}, {}, {}, {
|
|
95
|
+
'was opened on hover': unknown;
|
|
96
|
+
'has search query': unknown;
|
|
97
|
+
'search query is empty': unknown;
|
|
98
|
+
}, "open timeout" | "close timeout", "active", Input, NonReducibleUnknown, EventObject, MetaObject>;
|