@likec4/diagram 1.55.1 → 1.57.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 +150 -194
- package/dist/LikeC4ModelProvider.js +13 -9
- package/dist/LikeC4ProjectsOverview.js +24 -30
- package/dist/LikeC4ProjectsProvider.js +33 -26
- package/dist/LikeC4Styles.js +40 -57
- package/dist/LikeC4View.js +148 -196
- package/dist/ReactLikeC4.js +43 -65
- package/dist/StaticLikeC4Diagram.js +36 -41
- package/dist/_virtual/_rolldown/runtime.js +17 -0
- package/dist/adhoc-editor/EditorPanel.js +102 -101
- package/dist/adhoc-editor/ElementsTree.js +109 -139
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +77 -70
- package/dist/adhoc-editor/components/Tree.d.ts +2 -2
- package/dist/adhoc-editor/components/Tree.js +205 -288
- package/dist/adhoc-editor/hooks.js +28 -23
- package/dist/adhoc-editor/index.js +2 -1
- package/dist/adhoc-editor/state/ActorProvider.js +33 -36
- package/dist/adhoc-editor/state/actor.editor.js +148 -186
- package/dist/adhoc-editor/state/actor.js +12 -14
- package/dist/adhoc-editor/state/actor.layouter.js +49 -65
- package/dist/adhoc-editor/state/actor.types.js +19 -23
- package/dist/adhoc-editor/state/panel.js +112 -127
- package/dist/adhoc-editor/state/utils.js +22 -29
- package/dist/adhoc-editor/useElementsTree.js +89 -121
- package/dist/base/Background.js +26 -29
- package/dist/base/Base.js +34 -41
- package/dist/base/BaseXYFlow.js +135 -165
- package/dist/base/const.js +18 -19
- package/dist/base/updateEdges.js +38 -57
- package/dist/base/updateNodes.js +46 -65
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/Markdown.js +32 -47
- package/dist/base-primitives/NodeHandles.js +39 -49
- package/dist/base-primitives/compound/CompoundActionButton.js +49 -69
- package/dist/base-primitives/compound/CompoundDetailsButton.js +39 -64
- package/dist/base-primitives/compound/CompoundNodeContainer.js +46 -66
- package/dist/base-primitives/compound/CompoundTitle.js +15 -12
- package/dist/base-primitives/compound/actionbtns.css.js +9 -18
- package/dist/base-primitives/edge/EdgeActionButton.js +17 -19
- package/dist/base-primitives/edge/EdgeContainer.js +29 -48
- package/dist/base-primitives/edge/EdgeLabel.js +44 -65
- package/dist/base-primitives/edge/EdgeLabelContainer.js +35 -73
- package/dist/base-primitives/edge/EdgeMarkers.js +157 -215
- package/dist/base-primitives/edge/EdgePath.js +62 -115
- package/dist/base-primitives/element/ElementActionButtons.js +92 -81
- package/dist/base-primitives/element/ElementData.js +107 -126
- package/dist/base-primitives/element/ElementDetailsButton.js +78 -98
- package/dist/base-primitives/element/ElementNodeContainer.js +51 -82
- package/dist/base-primitives/element/ElementShape.js +331 -317
- package/dist/base-primitives/element/ElementTags.d.ts +1 -1
- package/dist/base-primitives/element/ElementTags.js +133 -193
- package/dist/base-primitives/memoEdge.js +11 -10
- package/dist/base-primitives/memoNode.js +16 -20
- package/dist/components/ErrorFallback.js +111 -75
- package/dist/components/GithubIcon.js +14 -16
- package/dist/components/Link.js +99 -113
- package/dist/components/Logo.js +38 -41
- package/dist/components/NavigationLink.js +15 -23
- package/dist/components/NavigationPanel.js +26 -47
- package/dist/components/PortalToContainer.js +16 -10
- package/dist/components/RootContainer.js +36 -31
- package/dist/components/SearchControl.css.js +65 -75
- package/dist/components/SearchControl.js +36 -14
- package/dist/components/ViewNotFound.js +22 -29
- package/dist/context/CurrentViewModelProvider.js +11 -9
- package/dist/context/DefaultMantineProvider.js +45 -72
- package/dist/context/DiagramEventHandlers.js +43 -48
- package/dist/context/DiagramFeatures.d.ts +1 -1
- package/dist/context/DiagramFeatures.js +78 -69
- package/dist/context/EnsureMantine.js +13 -16
- package/dist/context/FramerMotionConfig.js +17 -11
- package/dist/context/IconRenderer.js +90 -106
- package/dist/context/LikeC4ModelContext.js +14 -10
- package/dist/context/LikeC4ProjectsContext.js +7 -6
- package/dist/context/RootContainerContext.d.ts +9 -19
- package/dist/context/RootContainerContext.js +14 -28
- package/dist/context/TagStylesContext.js +49 -57
- package/dist/custom/customNodes.js +224 -28
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +40 -40
- package/dist/editor/LikeC4EditorCallbacks.d.ts +5 -0
- package/dist/editor/LikeC4EditorCallbacks.js +4 -2
- package/dist/editor/LikeC4EditorProvider.js +32 -7
- package/dist/editor/actor/actions.d.ts +115 -0
- package/dist/editor/actor/actions.js +122 -0
- package/dist/editor/{hotkeyActor.d.ts → actor/hotkey.d.ts} +1 -1
- package/dist/editor/actor/hotkey.js +20 -0
- package/dist/editor/actor/machine.d.ts +11 -0
- package/dist/editor/actor/machine.js +22 -0
- package/dist/editor/{editorActor.setup.d.ts → actor/setup.d.ts} +13 -49
- package/dist/editor/actor/setup.js +35 -0
- package/dist/editor/actor/state.editor.d.ts +97 -0
- package/dist/editor/actor/state.editor.js +55 -0
- package/dist/editor/actor/state.sync-queue.d.ts +420 -0
- package/dist/editor/actor/state.sync-queue.js +235 -0
- package/dist/editor/actor/types.d.ts +59 -0
- package/dist/editor/actor/types.js +5 -0
- package/dist/editor/applyChangesToManualLayout.js +144 -163
- package/dist/editor/index.d.ts +2 -1
- package/dist/editor/useEditorActorLogic.d.ts +8 -2
- package/dist/editor/useEditorActorLogic.js +51 -43
- package/dist/hooks/safeContext.js +17 -17
- package/dist/hooks/useCallbackRef.js +18 -11
- package/dist/hooks/useCurrentView.js +16 -7
- package/dist/hooks/useCurrentViewModel.js +14 -9
- package/dist/hooks/useDiagram.js +60 -37
- package/dist/hooks/useDiagramCompareLayout.js +77 -81
- package/dist/hooks/useEditorActor.d.ts +4 -0
- package/dist/hooks/useEditorActor.js +26 -0
- package/dist/hooks/useId.js +8 -6
- package/dist/hooks/useLikeC4ElementsTree.d.ts +3 -2
- package/dist/hooks/useLikeC4ElementsTree.js +24 -21
- package/dist/hooks/useLikeC4Model.js +21 -20
- package/dist/hooks/useLikeC4Project.js +40 -29
- package/dist/hooks/useLikeC4Styles.js +6 -6
- package/dist/hooks/useMantinePortalProps.js +10 -6
- package/dist/hooks/useSetState.js +21 -19
- package/dist/hooks/useUpdateEffect.js +18 -29
- package/dist/hooks/useXYFlow.js +13 -15
- package/dist/index.js +24 -23
- package/dist/likec4diagram/DiagramUI.js +37 -37
- package/dist/likec4diagram/DiagramXYFlow.js +215 -224
- package/dist/likec4diagram/convert-to-xyflow.js +21 -22
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +22 -32
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +275 -372
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +71 -75
- package/dist/likec4diagram/custom/edges/edges.css.js +41 -47
- package/dist/likec4diagram/custom/edges/useControlPoints.js +52 -56
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +54 -76
- package/dist/likec4diagram/custom/index.js +17 -17
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +19 -26
- package/dist/likec4diagram/custom/nodes/ElementActions.js +131 -82
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +20 -26
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +215 -273
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +131 -147
- package/dist/likec4diagram/custom/nodes/nodes.js +135 -146
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +155 -159
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +58 -86
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +108 -164
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +56 -68
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +3 -6
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +97 -102
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +13 -13
- package/dist/likec4diagram/custom/nodes/toolbar/types.js +6 -5
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +36 -41
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +510 -541
- package/dist/likec4diagram/relationship-popover/actor.js +113 -152
- package/dist/likec4diagram/relationship-popover/components.js +39 -43
- package/dist/likec4diagram/state/DiagramActorProvider.js +135 -136
- package/dist/likec4diagram/state/aligners.js +286 -360
- package/dist/likec4diagram/state/assign.js +84 -108
- package/dist/likec4diagram/state/createViewChange.js +72 -92
- package/dist/likec4diagram/state/diagram-api.d.ts +16 -0
- package/dist/likec4diagram/state/diagram-api.js +230 -152
- package/dist/likec4diagram/state/hotkeyActor.js +54 -45
- package/dist/likec4diagram/state/machine.actions.js +708 -821
- package/dist/likec4diagram/state/machine.actions.layout.js +154 -183
- package/dist/likec4diagram/state/machine.d.ts +1 -1
- package/dist/likec4diagram/state/machine.js +113 -134
- package/dist/likec4diagram/state/machine.setup.js +104 -113
- package/dist/likec4diagram/state/machine.state.initializing.js +54 -54
- package/dist/likec4diagram/state/machine.state.navigating.js +192 -227
- package/dist/likec4diagram/state/machine.state.ready.focused.js +72 -88
- package/dist/likec4diagram/state/machine.state.ready.idle.js +79 -98
- package/dist/likec4diagram/state/machine.state.ready.js +126 -202
- package/dist/likec4diagram/state/machine.state.ready.printing.js +38 -39
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +153 -193
- package/dist/likec4diagram/state/mediaPrintActor.js +20 -16
- package/dist/likec4diagram/state/persistence.js +20 -21
- package/dist/likec4diagram/state/types.d.ts +1 -1
- package/dist/likec4diagram/state/utils.d.ts +1 -1
- package/dist/likec4diagram/state/utils.js +131 -162
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +53 -64
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +58 -80
- package/dist/likec4diagram/ui/notation/NotationPanel.js +183 -214
- package/dist/likec4diagram/useLayoutConstraints.js +388 -433
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +216 -227
- package/dist/likec4diagram/xyflow-sequence/const.js +11 -7
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +177 -180
- package/dist/navigationpanel/NavigationPanel.js +113 -123
- package/dist/navigationpanel/NavigationPanelControls.js +124 -150
- package/dist/navigationpanel/NavigationPanelDropdown.js +365 -477
- package/dist/navigationpanel/_common.d.ts +4 -10
- package/dist/navigationpanel/_common.js +57 -70
- package/dist/navigationpanel/actor.js +153 -236
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +66 -83
- package/dist/navigationpanel/comparepanel/ComparePanel.js +135 -164
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +50 -58
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +207 -254
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +33 -35
- package/dist/navigationpanel/controls/DetailsControls.js +219 -246
- package/dist/navigationpanel/controls/LayoutWarning.js +89 -100
- package/dist/navigationpanel/controls/LogoButton.js +46 -70
- package/dist/navigationpanel/controls/NavigationButtons.js +35 -52
- package/dist/navigationpanel/controls/OpenSource.js +27 -25
- package/dist/navigationpanel/controls/SearchControl.js +50 -61
- package/dist/navigationpanel/controls/ToggleReadonly.js +86 -81
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +69 -87
- package/dist/navigationpanel/editorpanel/ApplySemanticLayout.d.ts +4 -0
- package/dist/navigationpanel/editorpanel/ApplySemanticLayout.js +36 -0
- package/dist/navigationpanel/editorpanel/CenterCamera.js +17 -13
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +182 -154
- package/dist/navigationpanel/editorpanel/EditorPanel.js +59 -45
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +122 -173
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +20 -13
- package/dist/navigationpanel/editorpanel/_common.d.ts +3 -6
- package/dist/navigationpanel/editorpanel/_common.js +13 -13
- package/dist/navigationpanel/editorpanel/styles.js +58 -75
- package/dist/navigationpanel/hooks.js +35 -29
- package/dist/navigationpanel/styles.css.js +20 -28
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +107 -134
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +65 -65
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +105 -120
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +75 -83
- package/dist/overlays/Overlays.js +94 -112
- package/dist/overlays/element-details/ElementDetails.js +22 -28
- package/dist/overlays/element-details/ElementDetailsCard.css.js +198 -221
- package/dist/overlays/element-details/ElementDetailsCard.js +517 -499
- package/dist/overlays/element-details/MetadataValue.js +210 -250
- package/dist/overlays/element-details/TabPanelDeployments.css.js +40 -60
- package/dist/overlays/element-details/TabPanelDeployments.js +185 -178
- package/dist/overlays/element-details/TabPanelRelationships.css.js +63 -71
- package/dist/overlays/element-details/TabPanelRelationships.js +155 -140
- package/dist/overlays/element-details/TabPanelStructure.css.js +29 -33
- package/dist/overlays/element-details/TabPanelStructure.js +93 -93
- package/dist/overlays/element-details/actor.js +45 -55
- package/dist/overlays/element-details/actorContext.js +12 -10
- package/dist/overlays/overlay/Overlay.d.ts +16 -0
- package/dist/overlays/overlay/Overlay.js +102 -151
- package/dist/overlays/overlaysActor.js +215 -265
- package/dist/overlays/relationship-details/RelationshipDetails.js +270 -253
- package/dist/overlays/relationship-details/SelectEdge.css.js +62 -74
- package/dist/overlays/relationship-details/SelectEdge.js +146 -126
- package/dist/overlays/relationship-details/actor.js +242 -303
- package/dist/overlays/relationship-details/compute.js +109 -135
- package/dist/overlays/relationship-details/custom/ElementActions.js +43 -56
- package/dist/overlays/relationship-details/custom/edgeTypes.js +43 -49
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +4 -5
- package/dist/overlays/relationship-details/custom/nodeTypes.js +96 -121
- package/dist/overlays/relationship-details/hooks.js +44 -38
- package/dist/overlays/relationship-details/layout-to-xyflow.js +119 -141
- package/dist/overlays/relationship-details/layout.js +275 -304
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +319 -321
- package/dist/overlays/relationships-browser/SelectElement.css.js +18 -21
- package/dist/overlays/relationships-browser/SelectElement.js +192 -218
- package/dist/overlays/relationships-browser/actor.js +364 -462
- package/dist/overlays/relationships-browser/const.js +7 -6
- package/dist/overlays/relationships-browser/custom/ElementActions.js +60 -63
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +25 -29
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +66 -99
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +98 -123
- package/dist/overlays/relationships-browser/hooks.js +49 -51
- package/dist/overlays/relationships-browser/layout.js +413 -465
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +141 -157
- package/dist/projects-overview/ProjectsOverview.js +56 -55
- package/dist/projects-overview/ProjectsOverviewXY.js +105 -94
- package/dist/projects-overview/actor.js +252 -345
- package/dist/projects-overview/context.js +8 -7
- package/dist/projects-overview/custom/edgeTypes.js +22 -21
- package/dist/projects-overview/custom/nodeTypes.js +38 -42
- package/dist/projects-overview/hooks.js +9 -9
- package/dist/projects-overview/layouted-to-xyflow.js +46 -42
- package/dist/projects-overview/panel/ProjectsOverviewPanel.js +7 -9
- package/dist/projects-overview/persistence.js +22 -22
- package/dist/search/Search.d.ts +6 -3
- package/dist/search/Search.js +189 -182
- package/dist/search/SearchContext.js +16 -15
- package/dist/search/XStateSearchAdapter.js +68 -62
- package/dist/search/components/ElementsColumn.css.js +50 -68
- package/dist/search/components/ElementsColumn.js +253 -291
- package/dist/search/components/PickView.js +116 -140
- package/dist/search/components/SearchByTags.js +76 -94
- package/dist/search/components/SearchInput.js +187 -209
- package/dist/search/components/ViewsColum.js +151 -141
- package/dist/search/components/ViewsColumn.css.js +12 -26
- package/dist/search/components/_shared.css.js +127 -153
- package/dist/search/components/styles.css.js +47 -53
- package/dist/search/components/utils.js +44 -47
- package/dist/search/hooks.js +10 -10
- package/dist/search/searchActor.js +97 -128
- package/dist/shadowroot/ShadowRoot.d.ts +7 -6
- package/dist/shadowroot/ShadowRoot.js +106 -79
- package/dist/shadowroot/styles.css.d.ts +10 -2
- package/dist/shadowroot/styles.css.js +56 -69
- package/dist/styles-font2.js +4 -0
- package/dist/styles2.js +4 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/roundDpr.js +19 -15
- package/dist/utils/view-bounds.js +48 -55
- package/dist/utils/xyflow.js +143 -113
- package/package.json +18 -25
- package/panda.buildinfo.json +15 -15
- package/src/styles-font.css +114 -0
- package/src/styles-min.css +2 -0
- package/src/styles-xyflow.css +1 -0
- package/src/styles.css +3 -0
- package/styles-font.css +1 -1
- package/styles-min.css +1 -1
- package/styles-xyflow.css +1 -1
- package/styles.css +1 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -3
- package/dist/_virtual/assign-f10db67b.cjs.js +0 -3
- package/dist/_virtual/log-30abbb83.cjs.js +0 -3
- package/dist/_virtual/raise-f051f097.cjs.js +0 -3
- package/dist/_virtual/store-cfe7da62.cjs.js +0 -3
- package/dist/_virtual/xstate-actions.cjs.js +0 -5
- package/dist/_virtual/xstate-actions.cjs2.js +0 -3
- package/dist/_virtual/xstate-dev.cjs.js +0 -3
- package/dist/_virtual/xstate-guards.cjs.js +0 -5
- package/dist/_virtual/xstate-guards.cjs2.js +0 -3
- package/dist/_virtual/xstate-store-react.cjs.js +0 -5
- package/dist/_virtual/xstate-store-react.cjs2.js +0 -3
- package/dist/bundle/index.d.ts +0 -1
- package/dist/editor/editorActor.actions.d.ts +0 -153
- package/dist/editor/editorActor.actions.js +0 -149
- package/dist/editor/editorActor.setup.js +0 -38
- package/dist/editor/editorActor.states.d.ts +0 -9
- package/dist/editor/editorActor.states.js +0 -273
- package/dist/editor/hotkeyActor.js +0 -19
- package/dist/hooks/useOverlaysActor.js +0 -10
- package/dist/hooks/useSearchActor.js +0 -10
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -41
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -30
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -14
- package/dist/node_modules/.pnpm/@xstate_store@3.17.1_react@19.2.4/node_modules/@xstate/store/dist/store-cfe7da62.cjs.js +0 -761
- package/dist/node_modules/.pnpm/@xstate_store@3.17.1_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +0 -180
- package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/actions/dist/xstate-actions.cjs.js +0 -37
- package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/dev/dist/xstate-dev.cjs.js +0 -59
- package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/dist/assign-f10db67b.cjs.js +0 -140
- package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/dist/log-30abbb83.cjs.js +0 -401
- package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/dist/raise-f051f097.cjs.js +0 -2830
- package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/guards/dist/xstate-guards.cjs.js +0 -26
- package/dist/styles-font.css2.js +0 -3
- package/dist/styles.css2.js +0 -3
|
@@ -1,824 +1,711 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
|
|
1
|
+
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { Base } from "../../base/Base.js";
|
|
3
|
+
import { findDiagramEdge, findDiagramNode, typedSystem, viewBounds } from "./utils.js";
|
|
4
|
+
import { machine } from "./machine.setup.js";
|
|
5
|
+
import { createLayoutConstraints } from "../useLayoutConstraints.js";
|
|
6
|
+
import { focusNodesEdges, mergeXYNodesEdges, resetEdgeControlPoints } from "./assign.js";
|
|
7
|
+
import { convertToXYFlow } from "../convert-to-xyflow.js";
|
|
8
|
+
import { getAligner, toNodeRect } from "./aligners.js";
|
|
9
|
+
import { cancelFitDiagram, raiseFitDiagram, setViewport, setViewportCenter } from "./machine.actions.layout.js";
|
|
10
|
+
import { hasAtLeast, isTruthy } from "remeda";
|
|
11
|
+
import { exact, invariant, nonNullable, nonexhaustive } from "@likec4/core";
|
|
12
|
+
import { BBox as BBox$1 } from "@likec4/core/geometry";
|
|
13
|
+
import { difference as difference$1 } from "@likec4/core/utils";
|
|
14
|
+
import { nodeToRect } from "@xyflow/system";
|
|
15
|
+
import { assertEvent } from "xstate";
|
|
16
|
+
import { produce } from "immer";
|
|
17
|
+
//#region src/likec4diagram/state/machine.actions.ts
|
|
18
|
+
var disableCompareWithLatest = () => machine.assign(({ context }) => {
|
|
19
|
+
return {
|
|
20
|
+
toggledFeatures: {
|
|
21
|
+
...context.toggledFeatures,
|
|
22
|
+
enableCompareWithLatest: false
|
|
23
|
+
},
|
|
24
|
+
viewportOnAutoLayout: null,
|
|
25
|
+
viewportOnManualLayout: null
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
var onEdgeDoubleClick = () => machine.assign(({ context, event }) => {
|
|
29
|
+
assertEvent(event, "xyflow.edgeDoubleClick");
|
|
30
|
+
if (!event.edge.data.controlPoints) return {};
|
|
31
|
+
const { nodeLookup } = context.xystore.getState();
|
|
32
|
+
return { xyedges: context.xyedges.map((e) => {
|
|
33
|
+
if (e.id !== event.edge.id) return e;
|
|
34
|
+
const controlPoints = resetEdgeControlPoints(nodeLookup, e);
|
|
35
|
+
const pt = controlPoints[0];
|
|
36
|
+
return {
|
|
37
|
+
...e,
|
|
38
|
+
data: {
|
|
39
|
+
...e.data,
|
|
40
|
+
controlPoints,
|
|
41
|
+
labelBBox: e.data.labelBBox ? {
|
|
42
|
+
...e.data.labelBBox,
|
|
43
|
+
...pt
|
|
44
|
+
} : null,
|
|
45
|
+
labelXY: null
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}) };
|
|
49
|
+
});
|
|
50
|
+
var assignLastClickedNode = () => machine.assign(({ context, event }) => {
|
|
51
|
+
assertEvent(event, "xyflow.nodeClick");
|
|
52
|
+
const { lastClickedNode } = context;
|
|
53
|
+
if (!lastClickedNode || lastClickedNode.id !== event.node.id) return { lastClickedNode: {
|
|
54
|
+
id: event.node.id,
|
|
55
|
+
clicks: 1,
|
|
56
|
+
timestamp: Date.now()
|
|
57
|
+
} };
|
|
58
|
+
return { lastClickedNode: {
|
|
59
|
+
id: lastClickedNode.id,
|
|
60
|
+
clicks: lastClickedNode.clicks + 1,
|
|
61
|
+
timestamp: Date.now()
|
|
62
|
+
} };
|
|
63
|
+
});
|
|
64
|
+
var assignFocusedNode = () => machine.assign(({ event }) => {
|
|
65
|
+
let focusedNode;
|
|
66
|
+
let autoUnfocusTimer = false;
|
|
67
|
+
switch (event.type) {
|
|
68
|
+
case "xyflow.nodeClick":
|
|
69
|
+
focusedNode = event.node.data.id;
|
|
70
|
+
break;
|
|
71
|
+
case "focus.node":
|
|
72
|
+
focusedNode = event.nodeId;
|
|
73
|
+
autoUnfocusTimer = event.autoUnfocus === true;
|
|
74
|
+
break;
|
|
75
|
+
default: throw new Error(`Unexpected event type: ${event.type} in action 'assign: focusedNode'`);
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
focusedNode,
|
|
79
|
+
autoUnfocusTimer
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
var resetLastClickedNode = () => machine.assign(() => ({ lastClickedNode: null }));
|
|
83
|
+
var updateFeatures = () => machine.assign(({ context, event }) => {
|
|
84
|
+
assertEvent(event, "update.features");
|
|
85
|
+
return { features: {
|
|
86
|
+
...context.features,
|
|
87
|
+
...event.features
|
|
88
|
+
} };
|
|
89
|
+
});
|
|
90
|
+
var updateInputs = () => machine.assign(({ event }) => {
|
|
91
|
+
assertEvent(event, "update.inputs");
|
|
92
|
+
return exact({ ...event.inputs });
|
|
93
|
+
});
|
|
94
|
+
var assignXYDataFromView = (view) => machine.assign(({ context, event }) => {
|
|
95
|
+
let xydata;
|
|
96
|
+
if (view) xydata = convertToXYFlow({
|
|
97
|
+
currentViewId: context.view.id,
|
|
98
|
+
dynamicViewVariant: context.dynamicViewVariant,
|
|
99
|
+
view,
|
|
100
|
+
where: context.where
|
|
101
|
+
});
|
|
102
|
+
else {
|
|
103
|
+
assertEvent(event, "update.view");
|
|
104
|
+
xydata = "xynodes" in event ? event : convertToXYFlow({
|
|
105
|
+
currentViewId: context.view.id,
|
|
106
|
+
dynamicViewVariant: context.dynamicViewVariant,
|
|
107
|
+
view: event.view,
|
|
108
|
+
where: context.where
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
const update = mergeXYNodesEdges(context, xydata);
|
|
112
|
+
let { lastClickedNode, focusedNode, activeWalkthrough } = context;
|
|
113
|
+
if (lastClickedNode || focusedNode || activeWalkthrough) {
|
|
114
|
+
const nodeIds = new Set(update.xynodes.map((n) => n.id));
|
|
115
|
+
if (lastClickedNode && !nodeIds.has(lastClickedNode.id)) lastClickedNode = null;
|
|
116
|
+
if (focusedNode && !nodeIds.has(focusedNode)) focusedNode = null;
|
|
117
|
+
const stepId = activeWalkthrough?.stepId;
|
|
118
|
+
if (stepId && !update.xyedges.some((e) => e.id === stepId)) activeWalkthrough = null;
|
|
119
|
+
return {
|
|
120
|
+
...update,
|
|
121
|
+
lastClickedNode,
|
|
122
|
+
focusedNode,
|
|
123
|
+
activeWalkthrough
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return update;
|
|
127
|
+
});
|
|
128
|
+
var focusOnNodesAndEdges = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
129
|
+
const next = focusNodesEdges(context);
|
|
130
|
+
if (next) enqueue.assign(next);
|
|
131
|
+
else enqueue.raise({ type: "key.esc" });
|
|
132
|
+
});
|
|
133
|
+
var undimEverything = () => machine.assign(({ context }) => ({
|
|
134
|
+
xynodes: context.xynodes.map(Base.setDimmed(false)),
|
|
135
|
+
xyedges: context.xyedges.map(Base.setData({
|
|
136
|
+
dimmed: false,
|
|
137
|
+
active: false
|
|
138
|
+
}))
|
|
95
139
|
}));
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
focusedNode,
|
|
138
|
-
activeWalkthrough
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
return update;
|
|
142
|
-
});
|
|
143
|
-
const focusOnNodesAndEdges = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
144
|
-
const next = focusNodesEdges(context);
|
|
145
|
-
if (next) {
|
|
146
|
-
enqueue.assign(next);
|
|
147
|
-
} else {
|
|
148
|
-
enqueue.raise({ type: "key.esc" });
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
const undimEverything = () => machine.assign(({ context }) => ({
|
|
152
|
-
xynodes: context.xynodes.map(Base.setDimmed(false)),
|
|
153
|
-
xyedges: context.xyedges.map(Base.setData({
|
|
154
|
-
dimmed: false,
|
|
155
|
-
active: false
|
|
156
|
-
}))
|
|
140
|
+
var assignDynamicViewVariant = () => machine.assign(({ event }) => {
|
|
141
|
+
assertEvent(event, "switch.dynamicViewVariant");
|
|
142
|
+
return { dynamicViewVariant: event.variant };
|
|
143
|
+
});
|
|
144
|
+
var onNodeMouseEnter = (params) => machine.assign(({ context, event }) => {
|
|
145
|
+
let node = params?.node;
|
|
146
|
+
if (!node) {
|
|
147
|
+
assertEvent(event, "xyflow.nodeMouseEnter");
|
|
148
|
+
node = event.node;
|
|
149
|
+
}
|
|
150
|
+
return { xynodes: context.xynodes.map((n) => {
|
|
151
|
+
if (n.id === node.id) return Base.setHovered(n, true);
|
|
152
|
+
return n;
|
|
153
|
+
}) };
|
|
154
|
+
});
|
|
155
|
+
var onNodeMouseLeave = (params) => machine.assign(({ context, event }) => {
|
|
156
|
+
let node = params?.node;
|
|
157
|
+
if (!node) {
|
|
158
|
+
assertEvent(event, "xyflow.nodeMouseLeave");
|
|
159
|
+
node = event.node;
|
|
160
|
+
}
|
|
161
|
+
return { xynodes: context.xynodes.map((n) => {
|
|
162
|
+
if (n.id === node.id) return Base.setHovered(n, false);
|
|
163
|
+
return n;
|
|
164
|
+
}) };
|
|
165
|
+
});
|
|
166
|
+
var emitPaneClick = () => machine.emit(() => ({ type: "paneClick" }));
|
|
167
|
+
var emitOpenSource = (params) => machine.emit(({ event }) => {
|
|
168
|
+
if (params) return {
|
|
169
|
+
type: "openSource",
|
|
170
|
+
params
|
|
171
|
+
};
|
|
172
|
+
assertEvent(event, "open.source");
|
|
173
|
+
return {
|
|
174
|
+
type: "openSource",
|
|
175
|
+
params: event
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
var emitOpenSourceOfView = () => machine.emit(({ context }) => ({
|
|
179
|
+
type: "openSource",
|
|
180
|
+
params: { view: context.view.id }
|
|
157
181
|
}));
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
})
|
|
177
|
-
};
|
|
178
|
-
});
|
|
179
|
-
const onNodeMouseLeave = (params) => machine.assign(({ context, event }) => {
|
|
180
|
-
let node = params?.node;
|
|
181
|
-
if (!node) {
|
|
182
|
-
assertEvent(event, "xyflow.nodeMouseLeave");
|
|
183
|
-
node = event.node;
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
xynodes: context.xynodes.map((n) => {
|
|
187
|
-
if (n.id === node.id) {
|
|
188
|
-
return Base.setHovered(n, false);
|
|
189
|
-
}
|
|
190
|
-
return n;
|
|
191
|
-
})
|
|
192
|
-
};
|
|
193
|
-
});
|
|
194
|
-
const emitPaneClick = () => machine.emit(() => ({
|
|
195
|
-
type: "paneClick"
|
|
182
|
+
var emitInitialized = () => machine.emit(({ context }) => {
|
|
183
|
+
invariant(context.xyflow, "XYFlow instance not found");
|
|
184
|
+
return {
|
|
185
|
+
type: "initialized",
|
|
186
|
+
instance: context.xyflow
|
|
187
|
+
};
|
|
188
|
+
});
|
|
189
|
+
var emitNodeClick = () => machine.emit(({ context, event }) => {
|
|
190
|
+
assertEvent(event, "xyflow.nodeClick");
|
|
191
|
+
return {
|
|
192
|
+
type: "nodeClick",
|
|
193
|
+
node: nonNullable(findDiagramNode(context, event.node.id), `Node ${event.node.id} not found in diagram`),
|
|
194
|
+
xynode: event.node
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
var emitNavigateTo = (params) => machine.emit(({ context }) => ({
|
|
198
|
+
type: "navigateTo",
|
|
199
|
+
viewId: params?.viewId ?? nonNullable(context.lastOnNavigate, "Invalid state, lastOnNavigate is null").toView
|
|
196
200
|
}));
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
);
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
);
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
);
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
})
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
draft.focusedNode = focusedNode;
|
|
709
|
-
if (view._type === "dynamic") {
|
|
710
|
-
draft.activeWalkthrough = activeWalkthrough?.stepId ?? null;
|
|
711
|
-
draft.dynamicViewVariant = dynamicViewVariant;
|
|
712
|
-
} else {
|
|
713
|
-
draft.activeWalkthrough = null;
|
|
714
|
-
draft.dynamicViewVariant = null;
|
|
715
|
-
}
|
|
716
|
-
if (viewportBefore) {
|
|
717
|
-
draft.viewportBefore = structuredClone(viewportBefore);
|
|
718
|
-
} else {
|
|
719
|
-
delete draft.viewportBefore;
|
|
720
|
-
}
|
|
721
|
-
});
|
|
722
|
-
history = [..._history];
|
|
723
|
-
history[currentIndex] = updatedEntry;
|
|
724
|
-
}
|
|
725
|
-
switch (event.type) {
|
|
726
|
-
case "navigate.to": {
|
|
727
|
-
enqueue.assign({
|
|
728
|
-
navigationHistory: {
|
|
729
|
-
currentIndex,
|
|
730
|
-
history
|
|
731
|
-
},
|
|
732
|
-
lastOnNavigate: {
|
|
733
|
-
fromView: context.view.id,
|
|
734
|
-
toView: event.viewId,
|
|
735
|
-
fromNode: event.fromNode ?? null,
|
|
736
|
-
focusOnElement: event.focusOnElement ?? null
|
|
737
|
-
}
|
|
738
|
-
});
|
|
739
|
-
enqueue(emitNavigateTo());
|
|
740
|
-
break;
|
|
741
|
-
}
|
|
742
|
-
case "navigate.back": {
|
|
743
|
-
invariant(currentIndex > 0, "Cannot navigate back");
|
|
744
|
-
const stepBack = history[currentIndex - 1];
|
|
745
|
-
enqueue.assign({
|
|
746
|
-
navigationHistory: {
|
|
747
|
-
currentIndex: currentIndex - 1,
|
|
748
|
-
history
|
|
749
|
-
},
|
|
750
|
-
lastOnNavigate: null
|
|
751
|
-
});
|
|
752
|
-
enqueue(emitNavigateTo({ viewId: stepBack.viewId }));
|
|
753
|
-
break;
|
|
754
|
-
}
|
|
755
|
-
case "navigate.forward": {
|
|
756
|
-
invariant(currentIndex < history.length - 1, "Cannot navigate forward");
|
|
757
|
-
const stepForward = history[currentIndex + 1];
|
|
758
|
-
enqueue.assign({
|
|
759
|
-
navigationHistory: {
|
|
760
|
-
currentIndex: currentIndex + 1,
|
|
761
|
-
history
|
|
762
|
-
},
|
|
763
|
-
lastOnNavigate: null
|
|
764
|
-
});
|
|
765
|
-
enqueue(emitNavigateTo({ viewId: stepForward.viewId }));
|
|
766
|
-
break;
|
|
767
|
-
}
|
|
768
|
-
default:
|
|
769
|
-
nonexhaustive(event);
|
|
770
|
-
}
|
|
771
|
-
});
|
|
772
|
-
const updateView = () => machine.enqueueActions(
|
|
773
|
-
({ enqueue, event, context }) => {
|
|
774
|
-
if (event.type !== "update.view") {
|
|
775
|
-
console.warn(`Ignoring unexpected event type: ${event.type} in action 'update.view'`);
|
|
776
|
-
return;
|
|
777
|
-
}
|
|
778
|
-
const nextView = event.view;
|
|
779
|
-
const isAnotherView = nextView.id !== context.view.id;
|
|
780
|
-
if (isAnotherView) {
|
|
781
|
-
console.warn("updateView called for another view - ignoring", { event });
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
enqueue(assignXYDataFromView());
|
|
785
|
-
if (event.source === "editor") {
|
|
786
|
-
return;
|
|
787
|
-
}
|
|
788
|
-
enqueue(sendSynced());
|
|
789
|
-
if (context.toggledFeatures.enableCompareWithLatest === true && context.view._layout !== nextView._layout) {
|
|
790
|
-
if (nextView._layout === "auto" && context.viewportOnAutoLayout) {
|
|
791
|
-
enqueue(
|
|
792
|
-
setViewport({
|
|
793
|
-
viewport: context.viewportOnAutoLayout,
|
|
794
|
-
duration: 0
|
|
795
|
-
})
|
|
796
|
-
);
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
if (nextView._layout === "manual" && context.viewportOnManualLayout) {
|
|
800
|
-
enqueue(
|
|
801
|
-
setViewport({
|
|
802
|
-
viewport: context.viewportOnManualLayout,
|
|
803
|
-
duration: 0
|
|
804
|
-
})
|
|
805
|
-
);
|
|
806
|
-
return;
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
let recenter = !context.viewportChangedManually && !context.focusedNode && !context.activeWalkthrough;
|
|
810
|
-
recenter = recenter || context.toggledFeatures.enableCompareWithLatest === true && !!nextView._layout && context.view._layout !== nextView._layout;
|
|
811
|
-
if (nextView._type === "dynamic" && context.view._type === "dynamic") {
|
|
812
|
-
if (nextView.variant === context.view.variant && nextView.variant !== context.dynamicViewVariant) {
|
|
813
|
-
const nextCenter = BBox.center(viewBounds(context, nextView));
|
|
814
|
-
enqueue(setViewportCenter(nextCenter));
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
if (recenter) {
|
|
818
|
-
enqueue(cancelFitDiagram());
|
|
819
|
-
enqueue(raiseFitDiagram());
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
);
|
|
823
|
-
|
|
824
|
-
export { assignDynamicViewVariant, assignFocusedNode, assignLastClickedNode, assignToggledFeatures, assignXYDataFromView, cancelAutoUnfocusTimer, cancelEditing, cancelFitDiagram, closeAllOverlays, closeSearch, disableCompareWithLatest, emitEdgeClick, emitInitialized, emitNavigateTo, emitNodeClick, emitOnLayoutTypeChange, emitOpenSource, emitOpenSourceOfView, emitPaneClick, ensureEditorActor, ensureOverlaysActor, ensureSearchActor, focusOnNodesAndEdges, handleNavigate, highlightNodeOrEdge, layoutAlign, notationsHighlight, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseLeave, onNodeMouseEnter, onNodeMouseLeave, openElementDetails, openOverlay, openSourceOfFocusedOrLastClickedNode, raiseFitDiagram, resetEdgesControlPoints, resetLastClickedNode, sendSynced, setViewport, setViewportCenter, startAutoUnfocusTimer, startEditing, startHotKeyActor, stopEditing, stopEditorActor, stopHotKeyActor, tagHighlight, triggerChange, undimEverything, updateFeatures, updateInputs, updateView };
|
|
201
|
+
var emitEdgeClick = () => machine.emit(({ context, event }) => {
|
|
202
|
+
assertEvent(event, "xyflow.edgeClick");
|
|
203
|
+
return {
|
|
204
|
+
type: "edgeClick",
|
|
205
|
+
edge: nonNullable(findDiagramEdge(context, event.edge.id), `Edge ${event.edge.id} not found in diagram`),
|
|
206
|
+
xyedge: event.edge
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
var triggerChange = (viewChange) => machine.enqueueActions(({ event, enqueue }) => {
|
|
210
|
+
let change = viewChange;
|
|
211
|
+
if (!change) {
|
|
212
|
+
assertEvent(event, "trigger.change");
|
|
213
|
+
change = event.change;
|
|
214
|
+
}
|
|
215
|
+
enqueue.assign({ viewportChangedManually: true });
|
|
216
|
+
enqueue.sendTo(typedSystem.editorActor, {
|
|
217
|
+
type: "change.view",
|
|
218
|
+
change
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
var emitOnLayoutTypeChange = () => machine.enqueueActions(({ event, system, context, enqueue }) => {
|
|
222
|
+
if (!context.features.enableCompareWithLatest) {
|
|
223
|
+
console.warn("Layout type cannot be changed while CompareWithLatest feature is disabled");
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const currentLayoutType = context.view._layout;
|
|
227
|
+
let nextLayoutType = currentLayoutType === "auto" ? "manual" : "auto";
|
|
228
|
+
if (event.type === "emit.onLayoutTypeChange") nextLayoutType = event.layoutType;
|
|
229
|
+
if (currentLayoutType === nextLayoutType) {
|
|
230
|
+
console.warn("Ignoring layout type change event, layout type is already", currentLayoutType);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (context.toggledFeatures.enableCompareWithLatest === true) {
|
|
234
|
+
if (currentLayoutType === "manual" && nextLayoutType === "auto") typedSystem(system).editorActorRef?.send({ type: "cancel" });
|
|
235
|
+
const currentViewport = context.viewport;
|
|
236
|
+
if (currentLayoutType === "auto") enqueue.assign({ viewportOnAutoLayout: currentViewport });
|
|
237
|
+
if (currentLayoutType === "manual") enqueue.assign({ viewportOnManualLayout: currentViewport });
|
|
238
|
+
}
|
|
239
|
+
enqueue.emit({
|
|
240
|
+
type: "onLayoutTypeChange",
|
|
241
|
+
layoutType: nextLayoutType
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
var layoutAlign = (params) => machine.createAction(({ context, event }) => {
|
|
245
|
+
let mode;
|
|
246
|
+
if (params) mode = params.mode;
|
|
247
|
+
else {
|
|
248
|
+
assertEvent(event, "layout.align");
|
|
249
|
+
mode = event.mode;
|
|
250
|
+
}
|
|
251
|
+
const xystore = nonNullable(context.xystore, "xystore is not initialized");
|
|
252
|
+
const { nodeLookup, parentLookup } = xystore.getState();
|
|
253
|
+
const nodesToAlign = [...difference$1(new Set(nodeLookup.values().filter((n) => n.selected).map((n) => n.id)), new Set(parentLookup.keys()))];
|
|
254
|
+
if (!hasAtLeast(nodesToAlign, 2)) {
|
|
255
|
+
console.warn("At least 2 nodes must be selected to align");
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const constraints = createLayoutConstraints(xystore, nodesToAlign);
|
|
259
|
+
const aligner = getAligner(mode);
|
|
260
|
+
const nodes = nodesToAlign.map((id) => ({
|
|
261
|
+
node: nonNullable(nodeLookup.get(id)),
|
|
262
|
+
rect: nonNullable(constraints.rects.get(id))
|
|
263
|
+
}));
|
|
264
|
+
aligner.computeLayout(nodes.map(({ node }) => toNodeRect(node)));
|
|
265
|
+
for (const { rect, node } of nodes) rect.positionAbsolute = {
|
|
266
|
+
...rect.positionAbsolute,
|
|
267
|
+
...aligner.applyPosition(toNodeRect(node))
|
|
268
|
+
};
|
|
269
|
+
constraints.updateXYFlow();
|
|
270
|
+
});
|
|
271
|
+
var resetEdgesControlPoints = () => machine.assign(({ context }) => {
|
|
272
|
+
const { nodeLookup } = context.xystore.getState();
|
|
273
|
+
return { xyedges: context.xyedges.map((edge) => {
|
|
274
|
+
if (!edge.data.controlPoints) return edge;
|
|
275
|
+
const controlPoints = resetEdgeControlPoints(nodeLookup, edge);
|
|
276
|
+
const pt = controlPoints[0];
|
|
277
|
+
return {
|
|
278
|
+
...edge,
|
|
279
|
+
data: {
|
|
280
|
+
...edge.data,
|
|
281
|
+
controlPoints,
|
|
282
|
+
labelBBox: edge.data.labelBBox ? {
|
|
283
|
+
...edge.data.labelBBox,
|
|
284
|
+
x: pt.x,
|
|
285
|
+
y: pt.y
|
|
286
|
+
} : null,
|
|
287
|
+
labelXY: edge.data.labelXY ? pt : null
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}) };
|
|
291
|
+
});
|
|
292
|
+
var notationsHighlight = () => machine.assign(({ context, event }) => {
|
|
293
|
+
assertEvent(event, "notations.highlight");
|
|
294
|
+
const { notation, kind } = event;
|
|
295
|
+
const targetKinds = kind ? [kind] : notation.kinds;
|
|
296
|
+
const shouldHighlight = (node) => node.notation === notation.title && node.shape === notation.shape && node.color === notation.color && targetKinds.includes(node.kind);
|
|
297
|
+
return {
|
|
298
|
+
xynodes: context.xynodes.map((n) => {
|
|
299
|
+
const node = findDiagramNode(context, n.id);
|
|
300
|
+
const highlighted = node && shouldHighlight(node);
|
|
301
|
+
return Base.setDimmed(n, highlighted ? false : "immediate");
|
|
302
|
+
}),
|
|
303
|
+
xyedges: context.xyedges.map((edge) => {
|
|
304
|
+
return Base.setDimmed(edge, true);
|
|
305
|
+
})
|
|
306
|
+
};
|
|
307
|
+
});
|
|
308
|
+
var tagHighlight = () => machine.assign(({ context, event }) => {
|
|
309
|
+
assertEvent(event, "tag.highlight");
|
|
310
|
+
return { xynodes: context.xynodes.map((n) => {
|
|
311
|
+
if (n.data.tags?.includes(event.tag)) return Base.setDimmed(n, false);
|
|
312
|
+
return Base.setDimmed(n, true);
|
|
313
|
+
}) };
|
|
314
|
+
});
|
|
315
|
+
var highlightNodeOrEdge = () => machine.assign(({ context, event }) => {
|
|
316
|
+
assertEvent(event, ["highlight.edge", "highlight.node"]);
|
|
317
|
+
switch (event.type) {
|
|
318
|
+
case "highlight.node": {
|
|
319
|
+
const nodeId = event.nodeId;
|
|
320
|
+
if (!context.xynodes.find((n) => n.id === nodeId)) {
|
|
321
|
+
console.warn(`Node with id ${nodeId} not found for highlighting`);
|
|
322
|
+
return {};
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
xynodes: context.xynodes.map((n) => {
|
|
326
|
+
return Base.setDimmed(n, n.id === nodeId ? false : true);
|
|
327
|
+
}),
|
|
328
|
+
xyedges: context.xyedges.map(Base.setData({
|
|
329
|
+
dimmed: true,
|
|
330
|
+
active: false
|
|
331
|
+
}))
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
case "highlight.edge": {
|
|
335
|
+
const edgeId = event.edgeId;
|
|
336
|
+
let edge = context.xyedges.find((e) => e.id === edgeId);
|
|
337
|
+
if (!edge) {
|
|
338
|
+
console.warn(`Edge with id ${edgeId} not found for highlighting`);
|
|
339
|
+
return {};
|
|
340
|
+
}
|
|
341
|
+
return {
|
|
342
|
+
xynodes: context.xynodes.map((n) => {
|
|
343
|
+
return Base.setDimmed(n, edge.source !== n.id && edge.target !== n.id);
|
|
344
|
+
}),
|
|
345
|
+
xyedges: context.xyedges.map((e) => {
|
|
346
|
+
return Base.setData(e, {
|
|
347
|
+
dimmed: e.id !== edgeId,
|
|
348
|
+
active: e.id === edgeId
|
|
349
|
+
});
|
|
350
|
+
})
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
default: nonexhaustive(event);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
var assignToggledFeatures = () => machine.assign(({ context, event }) => {
|
|
357
|
+
assertEvent(event, "toggle.feature");
|
|
358
|
+
const feature = `enable${event.feature}`;
|
|
359
|
+
const currentValue = context.toggledFeatures[feature] ?? context.features[feature];
|
|
360
|
+
const nextValue = event.forceValue ?? !currentValue;
|
|
361
|
+
return { toggledFeatures: {
|
|
362
|
+
...context.toggledFeatures,
|
|
363
|
+
[feature]: nextValue
|
|
364
|
+
} };
|
|
365
|
+
});
|
|
366
|
+
var closeSearch = () => machine.sendTo(typedSystem.searchActor, { type: "close" });
|
|
367
|
+
var closeAllOverlays = () => machine.sendTo(typedSystem.overlaysActor, { type: "close.all" });
|
|
368
|
+
var stopEditorActor = () => machine.enqueueActions(({ enqueue, system }) => {
|
|
369
|
+
const actor = typedSystem(system).editorActorRef;
|
|
370
|
+
if (!actor) return;
|
|
371
|
+
enqueue.stopChild(actor);
|
|
372
|
+
});
|
|
373
|
+
/**
|
|
374
|
+
* Ensure that the sync layout actor is running or stopped based on the read-only state
|
|
375
|
+
*/
|
|
376
|
+
var ensureEditorActor = () => machine.enqueueActions(({ enqueue, context, system, check }) => {
|
|
377
|
+
const hasEditor = check("enabled: Editor");
|
|
378
|
+
const editor = typedSystem(system).editorActorRef;
|
|
379
|
+
if (!hasEditor && editor) {
|
|
380
|
+
enqueue.stopChild(editor);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if (hasEditor && !editor) enqueue.spawnChild("editorActor", {
|
|
384
|
+
id: "editor",
|
|
385
|
+
systemId: "editor",
|
|
386
|
+
input: { viewId: context.view.id },
|
|
387
|
+
syncSnapshot: true
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
var startEditing = (subject = "node") => machine.sendTo(typedSystem.editorActor, {
|
|
391
|
+
type: "edit.move.start",
|
|
392
|
+
subject
|
|
393
|
+
});
|
|
394
|
+
var sendSynced = () => {
|
|
395
|
+
return machine.sendTo(typedSystem.editorActor, { type: "view.synched" });
|
|
396
|
+
};
|
|
397
|
+
var stopEditing = (wasChanged = false) => machine.sendTo(typedSystem.editorActor, { type: wasChanged ? "edit.move.end" : "edit.move.cancel" });
|
|
398
|
+
var cancelEditing = () => machine.sendTo(typedSystem.editorActor, { type: "cancel" });
|
|
399
|
+
var hasModelFqn = (node) => "modelFqn" in node.data && isTruthy(node.data.modelFqn);
|
|
400
|
+
var openElementDetails = (params) => machine.enqueueActions(({ context, event, enqueue }) => {
|
|
401
|
+
let initiatedFrom = null;
|
|
402
|
+
let fromNodeId;
|
|
403
|
+
let subject;
|
|
404
|
+
switch (true) {
|
|
405
|
+
case !!params:
|
|
406
|
+
subject = params.fqn;
|
|
407
|
+
fromNodeId = params.fromNode ?? context.view.nodes.find((n) => n.modelRef === params.fqn)?.id;
|
|
408
|
+
break;
|
|
409
|
+
case event.type === "xyflow.nodeClick":
|
|
410
|
+
if (!hasModelFqn(event.node)) {
|
|
411
|
+
console.warn("No modelFqn in clicked node data");
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
subject = event.node.data.modelFqn;
|
|
415
|
+
fromNodeId = event.node.data.id;
|
|
416
|
+
break;
|
|
417
|
+
case event.type === "open.elementDetails":
|
|
418
|
+
subject = event.fqn;
|
|
419
|
+
fromNodeId = event.fromNode;
|
|
420
|
+
break;
|
|
421
|
+
default: {
|
|
422
|
+
if (!context.lastClickedNode) {
|
|
423
|
+
console.warn("No last clicked node");
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
fromNodeId = context.lastClickedNode.id;
|
|
427
|
+
const node = context.xynodes.find((n) => n.id === fromNodeId);
|
|
428
|
+
if (!node || !hasModelFqn(node)) {
|
|
429
|
+
console.warn("No modelFqn in last clicked node");
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
subject = node.data.modelFqn;
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
const internalNode = fromNodeId ? context.xystore.getState().nodeLookup.get(fromNodeId) : null;
|
|
437
|
+
if (fromNodeId && internalNode) {
|
|
438
|
+
const nodeRect = nodeToRect(internalNode);
|
|
439
|
+
const zoom = context.xyflow.getZoom();
|
|
440
|
+
const clientRect = {
|
|
441
|
+
...context.xyflow.flowToScreenPosition(nodeRect),
|
|
442
|
+
width: nodeRect.width * zoom,
|
|
443
|
+
height: nodeRect.height * zoom
|
|
444
|
+
};
|
|
445
|
+
initiatedFrom = {
|
|
446
|
+
node: fromNodeId,
|
|
447
|
+
clientRect
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
enqueue.sendTo(typedSystem.overlaysActor, {
|
|
451
|
+
type: "open.elementDetails",
|
|
452
|
+
subject,
|
|
453
|
+
currentView: context.view,
|
|
454
|
+
...initiatedFrom && { initiatedFrom }
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
var openOverlay = () => machine.enqueueActions(({ context, event, enqueue, check }) => {
|
|
458
|
+
assertEvent(event, [
|
|
459
|
+
"open.relationshipsBrowser",
|
|
460
|
+
"open.relationshipDetails",
|
|
461
|
+
"open.elementDetails"
|
|
462
|
+
]);
|
|
463
|
+
if (!check("enabled: Overlays")) {
|
|
464
|
+
console.warn("Overlays feature is disabled");
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
switch (event.type) {
|
|
468
|
+
case "open.elementDetails":
|
|
469
|
+
check("enabled: ElementDetails") ? enqueue(openElementDetails()) : console.warn("ElementDetails feature is disabled");
|
|
470
|
+
break;
|
|
471
|
+
case "open.relationshipsBrowser":
|
|
472
|
+
if (!context.features.enableRelationshipBrowser) {
|
|
473
|
+
console.warn("RelationshipBrowser feature is disabled");
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
enqueue.sendTo(typedSystem.overlaysActor, {
|
|
477
|
+
type: "open.relationshipsBrowser",
|
|
478
|
+
subject: event.fqn,
|
|
479
|
+
viewId: context.view.id,
|
|
480
|
+
scope: "view",
|
|
481
|
+
closeable: true,
|
|
482
|
+
enableChangeScope: true,
|
|
483
|
+
enableSelectSubject: true
|
|
484
|
+
});
|
|
485
|
+
break;
|
|
486
|
+
case "open.relationshipDetails":
|
|
487
|
+
if (!context.features.enableRelationshipDetails) {
|
|
488
|
+
console.warn("RelationshipDetails feature is disabled");
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
enqueue.sendTo(typedSystem.overlaysActor, {
|
|
492
|
+
type: "open.relationshipDetails",
|
|
493
|
+
viewId: context.view.id,
|
|
494
|
+
...event.params
|
|
495
|
+
});
|
|
496
|
+
break;
|
|
497
|
+
default: nonexhaustive(event);
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
var openSourceOfFocusedOrLastClickedNode = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
501
|
+
const nodeId = context.focusedNode ?? context.lastClickedNode?.id;
|
|
502
|
+
if (!nodeId || !context.features.enableVscode) return;
|
|
503
|
+
const diagramNode = findDiagramNode(context, nodeId);
|
|
504
|
+
if (!diagramNode) return;
|
|
505
|
+
if (diagramNode.deploymentRef) enqueue.raise({
|
|
506
|
+
type: "open.source",
|
|
507
|
+
deployment: diagramNode.deploymentRef
|
|
508
|
+
});
|
|
509
|
+
else if (diagramNode.modelRef) enqueue.raise({
|
|
510
|
+
type: "open.source",
|
|
511
|
+
element: diagramNode.modelRef
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
/**
|
|
515
|
+
* Ensure that the overlays actor is running or stopped based on the current feature flags
|
|
516
|
+
*/
|
|
517
|
+
var ensureOverlaysActor = () => machine.enqueueActions(({ enqueue, check, system }) => {
|
|
518
|
+
const enabled = check("enabled: Overlays");
|
|
519
|
+
const running = typedSystem(system).overlaysActorRef;
|
|
520
|
+
if (enabled && !running) {
|
|
521
|
+
enqueue.spawnChild("overlaysActorLogic", {
|
|
522
|
+
id: "overlays",
|
|
523
|
+
systemId: "overlays",
|
|
524
|
+
syncSnapshot: true
|
|
525
|
+
});
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
if (!enabled && running) {
|
|
529
|
+
enqueue.sendTo(running, { type: "close.all" });
|
|
530
|
+
enqueue.stopChild(running);
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
/**
|
|
534
|
+
* Ensure that the search actor is running or stopped based on the current feature flags
|
|
535
|
+
*/
|
|
536
|
+
var ensureSearchActor = () => machine.enqueueActions(({ enqueue, check, system }) => {
|
|
537
|
+
const enabled = check("enabled: Search");
|
|
538
|
+
const running = typedSystem(system).searchActorRef;
|
|
539
|
+
if (enabled && !running) {
|
|
540
|
+
enqueue.spawnChild("searchActorLogic", {
|
|
541
|
+
id: "search",
|
|
542
|
+
systemId: "search",
|
|
543
|
+
syncSnapshot: true
|
|
544
|
+
});
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
if (!enabled && running) {
|
|
548
|
+
enqueue.sendTo(running, { type: "close" });
|
|
549
|
+
enqueue.stopChild(running);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
var onEdgeMouseEnter = () => machine.enqueueActions(({ enqueue, context, event }) => {
|
|
553
|
+
assertEvent(event, "xyflow.edgeMouseEnter");
|
|
554
|
+
let edge = event.edge;
|
|
555
|
+
enqueue.assign({ xyedges: context.xyedges.map((e) => {
|
|
556
|
+
if (e.id === event.edge.id) {
|
|
557
|
+
edge = Base.setHovered(e, true);
|
|
558
|
+
return edge;
|
|
559
|
+
}
|
|
560
|
+
return e;
|
|
561
|
+
}) });
|
|
562
|
+
enqueue.emit({
|
|
563
|
+
type: "edgeMouseEnter",
|
|
564
|
+
edge,
|
|
565
|
+
event: event.event
|
|
566
|
+
});
|
|
567
|
+
});
|
|
568
|
+
var onEdgeMouseLeave = () => machine.enqueueActions(({ enqueue, context, event }) => {
|
|
569
|
+
assertEvent(event, "xyflow.edgeMouseLeave");
|
|
570
|
+
let edge = event.edge;
|
|
571
|
+
enqueue.assign({ xyedges: context.xyedges.map((e) => {
|
|
572
|
+
if (e.id === event.edge.id) {
|
|
573
|
+
edge = Base.setHovered(e, false);
|
|
574
|
+
return edge;
|
|
575
|
+
}
|
|
576
|
+
return e;
|
|
577
|
+
}) });
|
|
578
|
+
enqueue.emit({
|
|
579
|
+
type: "edgeMouseLeave",
|
|
580
|
+
edge,
|
|
581
|
+
event: event.event
|
|
582
|
+
});
|
|
583
|
+
});
|
|
584
|
+
var startHotKeyActor = () => machine.spawnChild("hotkeyActorLogic", { id: "hotkey" });
|
|
585
|
+
var stopHotKeyActor = () => machine.stopChild("hotkey");
|
|
586
|
+
/**
|
|
587
|
+
* Auto-unfocus timer duration in milliseconds.
|
|
588
|
+
* Set to 0 to disable auto-unfocus (focus remains until user clicks elsewhere).
|
|
589
|
+
* Used for focusing nodes from search results.
|
|
590
|
+
*/
|
|
591
|
+
var AUTO_UNFOCUS_DELAY = 3e3;
|
|
592
|
+
var startAutoUnfocusTimer = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
593
|
+
if (context.autoUnfocusTimer && true) enqueue.raise({ type: "focus.autoUnfocus" }, {
|
|
594
|
+
delay: AUTO_UNFOCUS_DELAY,
|
|
595
|
+
id: "autoUnfocusTimer"
|
|
596
|
+
});
|
|
597
|
+
});
|
|
598
|
+
var cancelAutoUnfocusTimer = () => machine.cancel("autoUnfocusTimer");
|
|
599
|
+
var handleNavigate = () => machine.enqueueActions(({ enqueue, context, event }) => {
|
|
600
|
+
assertEvent(event, [
|
|
601
|
+
"navigate.to",
|
|
602
|
+
"navigate.back",
|
|
603
|
+
"navigate.forward"
|
|
604
|
+
]);
|
|
605
|
+
const { view, focusedNode, activeWalkthrough, dynamicViewVariant, viewport, viewportChangedManually, viewportBefore, navigationHistory } = context;
|
|
606
|
+
let { currentIndex, history: _history } = navigationHistory;
|
|
607
|
+
let history = _history;
|
|
608
|
+
if (currentIndex < _history.length) {
|
|
609
|
+
const updatedEntry = produce(_history.at(currentIndex) ?? {}, (draft) => {
|
|
610
|
+
draft.viewport = { ...viewport };
|
|
611
|
+
draft.viewportChangedManually = viewportChangedManually;
|
|
612
|
+
draft.focusedNode = focusedNode;
|
|
613
|
+
if (view._type === "dynamic") {
|
|
614
|
+
draft.activeWalkthrough = activeWalkthrough?.stepId ?? null;
|
|
615
|
+
draft.dynamicViewVariant = dynamicViewVariant;
|
|
616
|
+
} else {
|
|
617
|
+
draft.activeWalkthrough = null;
|
|
618
|
+
draft.dynamicViewVariant = null;
|
|
619
|
+
}
|
|
620
|
+
if (viewportBefore) draft.viewportBefore = structuredClone(viewportBefore);
|
|
621
|
+
else delete draft.viewportBefore;
|
|
622
|
+
});
|
|
623
|
+
history = [..._history];
|
|
624
|
+
history[currentIndex] = updatedEntry;
|
|
625
|
+
}
|
|
626
|
+
switch (event.type) {
|
|
627
|
+
case "navigate.to":
|
|
628
|
+
enqueue.assign({
|
|
629
|
+
navigationHistory: {
|
|
630
|
+
currentIndex,
|
|
631
|
+
history
|
|
632
|
+
},
|
|
633
|
+
lastOnNavigate: {
|
|
634
|
+
fromView: context.view.id,
|
|
635
|
+
toView: event.viewId,
|
|
636
|
+
fromNode: event.fromNode ?? null,
|
|
637
|
+
focusOnElement: event.focusOnElement ?? null
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
enqueue(emitNavigateTo());
|
|
641
|
+
break;
|
|
642
|
+
case "navigate.back": {
|
|
643
|
+
invariant(currentIndex > 0, "Cannot navigate back");
|
|
644
|
+
const stepBack = history[currentIndex - 1];
|
|
645
|
+
enqueue.assign({
|
|
646
|
+
navigationHistory: {
|
|
647
|
+
currentIndex: currentIndex - 1,
|
|
648
|
+
history
|
|
649
|
+
},
|
|
650
|
+
lastOnNavigate: null
|
|
651
|
+
});
|
|
652
|
+
enqueue(emitNavigateTo({ viewId: stepBack.viewId }));
|
|
653
|
+
break;
|
|
654
|
+
}
|
|
655
|
+
case "navigate.forward": {
|
|
656
|
+
invariant(currentIndex < history.length - 1, "Cannot navigate forward");
|
|
657
|
+
const stepForward = history[currentIndex + 1];
|
|
658
|
+
enqueue.assign({
|
|
659
|
+
navigationHistory: {
|
|
660
|
+
currentIndex: currentIndex + 1,
|
|
661
|
+
history
|
|
662
|
+
},
|
|
663
|
+
lastOnNavigate: null
|
|
664
|
+
});
|
|
665
|
+
enqueue(emitNavigateTo({ viewId: stepForward.viewId }));
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
default: nonexhaustive(event);
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
var updateView = () => machine.enqueueActions(({ enqueue, event, context }) => {
|
|
672
|
+
if (event.type !== "update.view") {
|
|
673
|
+
console.warn(`Ignoring unexpected event type: ${event.type} in action 'update.view'`);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const nextView = event.view;
|
|
677
|
+
if (nextView.id !== context.view.id) {
|
|
678
|
+
console.warn("updateView called for another view - ignoring", { event });
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
enqueue(assignXYDataFromView());
|
|
682
|
+
if (event.source === "editor") return;
|
|
683
|
+
enqueue(sendSynced());
|
|
684
|
+
if (context.toggledFeatures.enableCompareWithLatest === true && context.view._layout !== nextView._layout) {
|
|
685
|
+
if (nextView._layout === "auto" && context.viewportOnAutoLayout) {
|
|
686
|
+
enqueue(setViewport({
|
|
687
|
+
viewport: context.viewportOnAutoLayout,
|
|
688
|
+
duration: 0
|
|
689
|
+
}));
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
if (nextView._layout === "manual" && context.viewportOnManualLayout) {
|
|
693
|
+
enqueue(setViewport({
|
|
694
|
+
viewport: context.viewportOnManualLayout,
|
|
695
|
+
duration: 0
|
|
696
|
+
}));
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
let recenter = !context.viewportChangedManually && !context.focusedNode && !context.activeWalkthrough;
|
|
701
|
+
recenter = recenter || context.toggledFeatures.enableCompareWithLatest === true && !!nextView._layout && context.view._layout !== nextView._layout;
|
|
702
|
+
if (nextView._type === "dynamic" && context.view._type === "dynamic") {
|
|
703
|
+
if (nextView.variant === context.view.variant && nextView.variant !== context.dynamicViewVariant) enqueue(setViewportCenter(BBox$1.center(viewBounds(context, nextView))));
|
|
704
|
+
}
|
|
705
|
+
if (recenter) {
|
|
706
|
+
enqueue(cancelFitDiagram());
|
|
707
|
+
enqueue(raiseFitDiagram());
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
//#endregion
|
|
711
|
+
export { assignDynamicViewVariant, assignFocusedNode, assignLastClickedNode, assignToggledFeatures, assignXYDataFromView, cancelAutoUnfocusTimer, cancelEditing, closeAllOverlays, closeSearch, disableCompareWithLatest, emitEdgeClick, emitInitialized, emitNodeClick, emitOnLayoutTypeChange, emitOpenSource, emitOpenSourceOfView, emitPaneClick, ensureEditorActor, ensureOverlaysActor, ensureSearchActor, focusOnNodesAndEdges, handleNavigate, highlightNodeOrEdge, layoutAlign, notationsHighlight, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseLeave, onNodeMouseEnter, onNodeMouseLeave, openElementDetails, openOverlay, openSourceOfFocusedOrLastClickedNode, resetEdgesControlPoints, resetLastClickedNode, startAutoUnfocusTimer, startEditing, startHotKeyActor, stopEditing, stopEditorActor, stopHotKeyActor, tagHighlight, triggerChange, undimEverything, updateFeatures, updateInputs, updateView };
|