@likec4/diagram 1.26.1 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundle/index.js +48891 -0
- package/dist/LikeC4CustomColors.js +27 -23
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +37 -36
- package/dist/LikeC4Diagram.props.d.ts +6 -0
- package/dist/LikeC4ModelProvider.js +6 -6
- package/dist/StaticLikeC4Diagram.js +5 -5
- package/dist/_virtual/_commonjsHelpers.js +5 -0
- package/dist/_virtual/default-map.js +7 -0
- package/dist/base/Background.js +6 -6
- package/dist/base/BaseXYFlow.d.ts +1 -1
- package/dist/base/BaseXYFlow.js +75 -46
- package/dist/base/const.js +2 -5
- package/dist/base/primitives/NodeHandles.js +5 -5
- package/dist/base/primitives/compound/CompoundActionButton.js +60 -33
- package/dist/base/primitives/compound/CompoundDetailsButton.js +66 -35
- package/dist/base/primitives/compound/CompoundNodeContainer.css.d.ts +35 -7
- package/dist/base/primitives/compound/CompoundNodeContainer.css.js +131 -12
- package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +4 -20
- package/dist/base/primitives/compound/CompoundNodeContainer.js +99 -97
- package/dist/base/primitives/compound/CompoundTitle.d.ts +1 -1
- package/dist/base/primitives/compound/CompoundTitle.js +74 -12
- package/dist/base/primitives/compound/actionbtns.css.d.ts +11 -0
- package/dist/base/primitives/compound/actionbtns.css.js +32 -0
- package/dist/base/primitives/customEdge.d.ts +5 -5
- package/dist/base/primitives/customEdge.js +6 -7
- package/dist/base/primitives/customNode.js +5 -6
- package/dist/base/primitives/edge/EdgeActionButton.js +10 -12
- package/dist/base/primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base/primitives/edge/EdgeContainer.js +21 -15
- package/dist/base/primitives/edge/EdgeLabel.css.d.ts +24 -10
- package/dist/base/primitives/edge/EdgeLabel.css.js +133 -20
- package/dist/base/primitives/edge/EdgeLabel.d.ts +4 -44
- package/dist/base/primitives/edge/EdgeLabel.js +35 -88
- package/dist/base/primitives/edge/EdgeLabelContainer.d.ts +18 -0
- package/dist/base/primitives/edge/EdgeLabelContainer.js +91 -0
- package/dist/base/primitives/edge/EdgeMarkers.js +5 -6
- package/dist/base/primitives/edge/EdgePath.d.ts +7 -7
- package/dist/base/primitives/edge/EdgePath.js +17 -29
- package/dist/base/primitives/edge/edge.css.d.ts +2 -2
- package/dist/base/primitives/edge/edge.css.js +123 -12
- package/dist/base/primitives/edge/xyvars.d.ts +24 -0
- package/dist/base/primitives/element/ElementActionButtons.js +35 -17
- package/dist/base/primitives/element/ElementDetailsButton.js +34 -16
- package/dist/base/primitives/element/ElementNodeContainer.css.d.ts +0 -1
- package/dist/base/primitives/element/ElementNodeContainer.css.js +50 -5
- package/dist/base/primitives/element/ElementNodeContainer.d.ts +1 -1
- package/dist/base/primitives/element/ElementNodeContainer.js +28 -19
- package/dist/base/primitives/element/ElementShape.css.js +118 -15
- package/dist/base/primitives/element/ElementShape.js +8 -10
- package/dist/base/primitives/element/ElementTitle.css.d.ts +33 -8
- package/dist/base/primitives/element/ElementTitle.css.js +195 -20
- package/dist/base/primitives/element/ElementTitle.js +25 -24
- package/dist/base/primitives/index.d.ts +1 -0
- package/dist/base/types.js +4 -4
- package/dist/base/updateEdges.js +5 -5
- package/dist/base/updateNodes.js +6 -6
- package/dist/bundle/LikeC4ModelProvider.d.ts +9 -0
- package/dist/bundle/LikeC4ModelProvider.js +5 -0
- package/dist/bundle/LikeC4View.d.ts +2 -0
- package/dist/bundle/LikeC4View.js +176 -0
- package/dist/bundle/LikeC4View.props.d.ts +207 -0
- package/dist/bundle/ReactLikeC4.d.ts +36 -0
- package/dist/bundle/ReactLikeC4.js +90 -0
- package/dist/bundle/ShadowRoot.d.ts +12 -0
- package/dist/bundle/ShadowRoot.js +52 -0
- package/dist/bundle/ViewNotFound.d.ts +5 -0
- package/dist/bundle/ViewNotFound.js +30 -0
- package/dist/bundle/font.css.js +3 -0
- package/dist/bundle/index.d.ts +5 -0
- package/dist/bundle/index.js +4 -0
- package/dist/bundle/styles.css.d.ts +10 -0
- package/dist/bundle/styles.css.js +145 -0
- package/dist/components/Link.js +61 -12
- package/dist/components/SearchControl.css.js +72 -9
- package/dist/components/SearchControl.js +11 -11
- package/dist/context/ControlsCustomLayout.js +5 -6
- package/dist/context/DiagramEventHandlers.js +8 -13
- package/dist/context/DiagramFeatures.js +7 -12
- package/dist/context/EnsureMantine.js +6 -6
- package/dist/context/FramerMotionConfig.js +8 -9
- package/dist/context/IconRenderer.js +7 -9
- package/dist/context/ReduceGraphics.d.ts +4 -5
- package/dist/context/ReduceGraphics.js +11 -43
- package/dist/context/RootContainer.js +23 -10
- package/dist/hooks/safeContext.js +5 -7
- package/dist/hooks/useCurrentViewId.js +6 -6
- package/dist/hooks/useDiagram.d.ts +5020 -4373
- package/dist/hooks/useDiagram.js +13 -17
- package/dist/hooks/useMantinePortalProps.js +5 -5
- package/dist/hooks/useOverlaysActor.d.ts +2 -0
- package/dist/hooks/useOverlaysActor.js +10 -0
- package/dist/hooks/useReducedGraphics.d.ts +1 -1
- package/dist/hooks/useSetState.js +5 -5
- package/dist/hooks/useUpdateEffect.js +6 -7
- package/dist/hooks/useXYFlow.d.ts +28 -28
- package/dist/hooks/useXYFlow.js +7 -11
- package/dist/index.d.ts +0 -1
- package/dist/index.js +10 -26
- package/dist/likec4diagram/DiagramUI.js +13 -13
- package/dist/likec4diagram/DiagramXYFlow.d.ts +1 -4
- package/dist/likec4diagram/DiagramXYFlow.js +81 -36
- package/dist/likec4diagram/custom/edges/NotePopover.css.js +21 -7
- package/dist/likec4diagram/custom/edges/NotePopover.js +18 -27
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +9 -9
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +99 -83
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.d.ts +1 -0
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.js +38 -11
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.d.ts +3 -3
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +28 -30
- package/dist/likec4diagram/custom/edges/edges.css.js +44 -9
- package/dist/likec4diagram/custom/edges/utils.js +6 -7
- package/dist/likec4diagram/custom/index.d.ts +9 -9
- package/dist/likec4diagram/custom/index.js +5 -6
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +7 -7
- package/dist/likec4diagram/custom/nodes/ElementActions.js +8 -9
- package/dist/likec4diagram/custom/nodes/nodeTypes.js +22 -26
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +10 -13
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +15 -16
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +12 -13
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +17 -14
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +15 -20
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +10 -5
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +15 -15
- package/dist/likec4diagram/ui/controls/Controls.js +24 -24
- package/dist/likec4diagram/ui/controls/LayoutDriftNotification.js +8 -9
- package/dist/likec4diagram/ui/controls/ManualLayoutToolsButton.js +8 -8
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +8 -8
- package/dist/likec4diagram/ui/controls/ToggleReadonly.js +7 -7
- package/dist/likec4diagram/ui/controls/_shared.js +4 -5
- package/dist/likec4diagram/ui/controls/styles.css.js +79 -17
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.js +49 -9
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +12 -12
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +85 -15
- package/dist/likec4diagram/ui/notation/NotationPanel.js +32 -32
- package/dist/likec4diagram/ui/search/ElementsColumn.css.d.ts +0 -5
- package/dist/likec4diagram/ui/search/ElementsColumn.css.js +70 -30
- package/dist/likec4diagram/ui/search/ElementsColumn.js +40 -33
- package/dist/likec4diagram/ui/search/LikeC4Search.css.js +87 -20
- package/dist/likec4diagram/ui/search/LikeC4Search.js +18 -17
- package/dist/likec4diagram/ui/search/SearchInput.js +22 -24
- package/dist/likec4diagram/ui/search/ViewsColum.js +22 -22
- package/dist/likec4diagram/ui/search/ViewsColumn.css.d.ts +0 -2
- package/dist/likec4diagram/ui/search/ViewsColumn.css.js +29 -14
- package/dist/likec4diagram/ui/search/_shared.css.d.ts +3 -17
- package/dist/likec4diagram/ui/search/_shared.css.js +171 -0
- package/dist/likec4diagram/ui/search/state.js +12 -22
- package/dist/likec4diagram/ui/search/utils.js +2 -5
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +66 -10
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +18 -27
- package/dist/likec4diagram/useLayoutConstraints.js +39 -46
- package/dist/likec4diagram/useViewToNodesEdges.js +12 -13
- package/dist/likec4model/LikeC4ModelContext.js +4 -4
- package/dist/likec4model/useLikeC4ElementsTree.js +6 -7
- package/dist/likec4model/useLikeC4Model.js +6 -6
- package/dist/node_modules/.pnpm/mnemonist@0.40.3_patch_hash_5c12abb43fcff6fd81e53021b89075d53249640d165a2556cc1e58d71201a13a/node_modules/mnemonist/default-map.js +172 -0
- package/dist/overlays/Overlays.js +21 -21
- package/dist/overlays/element-details/ElementDetails.js +9 -9
- package/dist/overlays/element-details/ElementDetailsCard.css.d.ts +2 -3
- package/dist/overlays/element-details/ElementDetailsCard.css.js +237 -35
- package/dist/overlays/element-details/ElementDetailsCard.js +44 -46
- package/dist/overlays/element-details/TabPanelDeployments.css.js +62 -11
- package/dist/overlays/element-details/TabPanelDeployments.js +11 -11
- package/dist/overlays/element-details/TabPanelRelationships.css.js +99 -9
- package/dist/overlays/element-details/TabPanelRelationships.js +41 -14
- package/dist/overlays/element-details/TabPanelStructure.css.js +36 -7
- package/dist/overlays/element-details/TabPanelStructure.js +8 -9
- package/dist/overlays/element-details/actor.d.ts +21892 -22686
- package/dist/overlays/element-details/actor.js +18 -19
- package/dist/overlays/element-details/actorContext.js +4 -5
- package/dist/overlays/overlay/Overlay.css.d.ts +2 -2
- package/dist/overlays/overlay/Overlay.css.js +57 -98
- package/dist/overlays/overlay/Overlay.d.ts +2 -2
- package/dist/overlays/overlay/Overlay.js +96 -94
- package/dist/overlays/overlaysActor.d.ts +6 -6
- package/dist/overlays/overlaysActor.js +17 -18
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +49 -0
- package/dist/overlays/relationship-details/RelationshipDetails.js +24 -17
- package/dist/overlays/relationship-details/SelectEdge.css.js +82 -17
- package/dist/overlays/relationship-details/SelectEdge.js +15 -17
- package/dist/overlays/relationship-details/actor.js +9 -9
- package/dist/overlays/relationship-details/custom/ElementActions.js +8 -8
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +44 -46
- package/dist/overlays/relationship-details/custom/edgeTypes.js +49 -50
- package/dist/overlays/relationship-details/custom/index.d.ts +2 -2
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +28 -30
- package/dist/overlays/relationship-details/custom/nodeTypes.js +31 -35
- package/dist/overlays/relationship-details/hooks.js +9 -13
- package/dist/overlays/relationship-details/useLayoutedDetails.js +16 -18
- package/dist/overlays/relationships-browser/-useRelationshipsView.d.ts +8 -24
- package/dist/overlays/relationships-browser/-useRelationshipsView.js +50 -85
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +48 -0
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +101 -101
- package/dist/overlays/relationships-browser/SelectElement.css.js +22 -9
- package/dist/overlays/relationships-browser/SelectElement.d.ts +2 -7
- package/dist/overlays/relationships-browser/SelectElement.js +196 -112
- package/dist/overlays/relationships-browser/_types.d.ts +4 -1
- package/dist/overlays/relationships-browser/actor.d.ts +478 -351
- package/dist/overlays/relationships-browser/actor.js +108 -94
- package/dist/overlays/relationships-browser/const.d.ts +1 -1
- package/dist/overlays/relationships-browser/const.js +3 -4
- package/dist/overlays/relationships-browser/custom/ElementActions.js +9 -9
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +6 -6
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +43 -44
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +97 -65
- package/dist/overlays/relationships-browser/custom/index.d.ts +2 -2
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +37 -37
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +36 -40
- package/dist/overlays/relationships-browser/custom/styles.css.js +14 -5
- package/dist/overlays/relationships-browser/hooks.d.ts +14 -6
- package/dist/overlays/relationships-browser/hooks.js +25 -16
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +13 -18
- package/dist/packages/core/src/compute-view/relationships-view/compute.js +123 -0
- package/dist/packages/core/src/compute-view/relationships-view/utils.js +68 -0
- package/dist/packages/core/src/errors/index.js +15 -0
- package/dist/packages/core/src/utils/fqn.js +43 -0
- package/dist/packages/core/src/utils/guards.js +7 -0
- package/dist/packages/core/src/utils/iterable/filter.js +21 -0
- package/dist/packages/core/src/utils/iterable/map.js +18 -0
- package/dist/packages/core/src/utils/iterable/to.js +14 -0
- package/dist/src/index.ts.d.ts +2 -0
- package/dist/state/DiagramActorProvider.js +26 -27
- package/dist/state/aligners.js +22 -31
- package/dist/state/assign.js +11 -21
- package/dist/state/diagram-machine.d.ts +5155 -4470
- package/dist/state/diagram-machine.js +407 -337
- package/dist/state/hotkeyActor.js +5 -5
- package/dist/state/inspector.d.ts +1 -1
- package/dist/state/persistence.js +4 -4
- package/dist/state/syncManualLayoutActor.d.ts +1 -1
- package/dist/state/syncManualLayoutActor.js +10 -10
- package/dist/state/utils.js +4 -9
- package/dist/styles.css.js +3 -0
- package/dist/utils/vector.js +2 -4
- package/dist/utils/xyflow.js +7 -12
- package/package.json +43 -42
- package/src/LikeC4CustomColors.tsx +44 -20
- package/src/LikeC4Diagram.props.ts +32 -0
- package/src/LikeC4Diagram.tsx +16 -14
- package/src/base/BaseXYFlow.tsx +67 -43
- package/src/base/primitives/compound/CompoundActionButton.tsx +41 -20
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +48 -25
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +111 -111
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +92 -92
- package/src/base/primitives/compound/CompoundTitle.tsx +73 -7
- package/src/base/primitives/compound/actionbtns.css.ts +30 -0
- package/src/base/primitives/customEdge.ts +2 -3
- package/src/base/primitives/edge/EdgeActionButton.tsx +3 -5
- package/src/base/primitives/edge/EdgeContainer.tsx +17 -9
- package/src/base/primitives/edge/EdgeLabel.css.ts +113 -177
- package/src/base/primitives/edge/EdgeLabel.tsx +43 -114
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +118 -0
- package/src/base/primitives/edge/EdgePath.tsx +31 -37
- package/src/base/primitives/edge/edge.css.ts +105 -132
- package/src/base/primitives/edge/xyvars.ts +31 -0
- package/src/base/primitives/element/ElementActionButtons.tsx +30 -10
- package/src/base/primitives/element/ElementDetailsButton.tsx +27 -8
- package/src/base/primitives/element/ElementNodeContainer.css.ts +43 -70
- package/src/base/primitives/element/ElementNodeContainer.tsx +18 -8
- package/src/base/primitives/element/ElementShape.css.ts +80 -113
- package/src/base/primitives/element/ElementShape.tsx +0 -1
- package/src/base/primitives/element/ElementTitle.css.ts +168 -124
- package/src/base/primitives/element/ElementTitle.tsx +16 -16
- package/src/base/primitives/index.ts +1 -0
- package/src/base/types.ts +5 -0
- package/src/bundle/LikeC4ModelProvider.tsx +12 -0
- package/src/bundle/LikeC4View.props.ts +249 -0
- package/src/bundle/LikeC4View.tsx +196 -0
- package/src/bundle/ReactLikeC4.tsx +148 -0
- package/src/bundle/ShadowRoot.tsx +60 -0
- package/src/bundle/ViewNotFound.tsx +25 -0
- package/src/bundle/font.css +251 -0
- package/src/bundle/index.ts +7 -0
- package/src/bundle/react-dom-server-mock.ts +3 -0
- package/src/bundle/styles.css.ts +168 -0
- package/src/components/Link.tsx +56 -5
- package/src/components/SearchControl.css.ts +52 -59
- package/src/components/SearchControl.tsx +2 -5
- package/src/context/ReduceGraphics.tsx +9 -47
- package/src/context/RootContainer.tsx +21 -5
- package/src/hooks/safeContext.tsx +2 -3
- package/src/hooks/useCurrentViewId.ts +4 -4
- package/src/hooks/useDiagram.ts +4 -3
- package/src/hooks/useOverlaysActor.ts +11 -0
- package/src/hooks/useReducedGraphics.ts +8 -1
- package/src/hooks/useXYFlow.ts +2 -2
- package/src/index.ts +1 -3
- package/src/likec4diagram/DiagramUI.tsx +2 -2
- package/src/likec4diagram/DiagramXYFlow.tsx +80 -26
- package/src/likec4diagram/custom/edges/NotePopover.css.ts +7 -13
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +69 -42
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +23 -44
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +26 -24
- package/src/likec4diagram/custom/edges/edges.css.ts +25 -32
- package/src/likec4diagram/custom/nodes/nodeTypes.tsx +2 -2
- package/src/likec4diagram/custom/nodes/toolbar/Toolbar.tsx +9 -5
- package/src/likec4diagram/custom/nodes/toolbar/styles.css.ts +3 -4
- package/src/likec4diagram/ui/controls/LayoutDriftNotification.tsx +2 -2
- package/src/likec4diagram/ui/controls/styles.css.ts +46 -57
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.ts +38 -34
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +4 -4
- package/src/likec4diagram/ui/notation/NotationPanel.css.ts +44 -56
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +17 -14
- package/src/likec4diagram/ui/search/ElementsColumn.css.ts +80 -85
- package/src/likec4diagram/ui/search/ElementsColumn.tsx +21 -14
- package/src/likec4diagram/ui/search/LikeC4Search.css.ts +50 -67
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +1 -2
- package/src/likec4diagram/ui/search/SearchInput.tsx +2 -2
- package/src/likec4diagram/ui/search/ViewsColum.tsx +10 -7
- package/src/likec4diagram/ui/search/ViewsColumn.css.ts +29 -28
- package/src/likec4diagram/ui/search/_shared.css.ts +158 -74
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +31 -34
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +6 -6
- package/src/likec4diagram/useViewToNodesEdges.ts +2 -1
- package/src/overlays/Overlays.tsx +6 -4
- package/src/overlays/element-details/ElementDetailsCard.css.ts +143 -177
- package/src/overlays/element-details/ElementDetailsCard.tsx +29 -29
- package/src/overlays/element-details/TabPanelDeployments.css.ts +49 -54
- package/src/overlays/element-details/TabPanelRelationships.css.ts +62 -66
- package/src/overlays/element-details/TabPanelRelationships.tsx +32 -3
- package/src/overlays/element-details/TabPanelStructure.css.ts +26 -26
- package/src/overlays/element-details/actor.ts +4 -2
- package/src/overlays/overlay/Overlay.css.ts +34 -46
- package/src/overlays/overlay/Overlay.tsx +95 -97
- package/src/overlays/overlaysActor.ts +1 -0
- package/src/overlays/relationship-details/RelationshipDetails.tsx +15 -3
- package/src/overlays/relationship-details/SelectEdge.css.ts +52 -71
- package/src/overlays/relationship-details/SelectEdge.tsx +1 -2
- package/src/overlays/relationship-details/custom/edgeTypes.tsx +35 -30
- package/src/overlays/relationship-details/custom/index.ts +2 -0
- package/src/overlays/relationship-details/custom/nodeTypes.tsx +20 -24
- package/src/overlays/relationship-details/custom/styles.css.ts +8 -8
- package/src/overlays/relationships-browser/-useRelationshipsView.ts +55 -82
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +39 -36
- package/src/overlays/relationships-browser/SelectElement.css.ts +9 -12
- package/src/overlays/relationships-browser/SelectElement.tsx +192 -105
- package/src/overlays/relationships-browser/_types.ts +4 -9
- package/src/overlays/relationships-browser/actor.ts +144 -123
- package/src/overlays/relationships-browser/const.ts +1 -1
- package/src/overlays/relationships-browser/custom/EmptyNode.tsx +2 -2
- package/src/overlays/relationships-browser/custom/edgeTypes.tsx +95 -59
- package/src/overlays/relationships-browser/custom/index.ts +2 -0
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +25 -26
- package/src/overlays/relationships-browser/custom/styles.css.ts +5 -6
- package/src/overlays/relationships-browser/hooks.ts +17 -3
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +4 -10
- package/src/state/DiagramActorProvider.tsx +17 -16
- package/src/state/diagram-machine.ts +395 -315
- package/src/state/inspector.ts +1 -1
- package/src/styles.css +3 -0
- package/dist/LikeC4Diagram.css.d.ts +0 -8
- package/dist/LikeC4Diagram.css.js +0 -11
- package/dist/base/example/RelationshipsBrowser.d.ts +0 -6
- package/dist/base/example/_types.d.ts +0 -20
- package/dist/base/example/custom.d.ts +0 -72
- package/dist/base/example/useViewToNodesEdges.d.ts +0 -6
- package/dist/base/primitives/compound/CompoundActionButton.css.d.ts +0 -2
- package/dist/base/primitives/compound/CompoundActionButton.css.js +0 -8
- package/dist/base/primitives/compound/CompoundDetailsButton.css.d.ts +0 -3
- package/dist/base/primitives/compound/CompoundDetailsButton.css.js +0 -8
- package/dist/base/primitives/compound/CompoundTitle.css.d.ts +0 -3
- package/dist/base/primitives/compound/CompoundTitle.css.js +0 -10
- package/dist/base/primitives/element/ElementActionButtons.css.d.ts +0 -3
- package/dist/base/primitives/element/ElementActionButtons.css.js +0 -10
- package/dist/base/primitives/element/ElementDetailsButton.css.d.ts +0 -3
- package/dist/base/primitives/element/ElementDetailsButton.css.js +0 -8
- package/dist/base/primitives/element/vars.css.d.ts +0 -3
- package/dist/base/primitives/element/vars.css.ts.vanilla.css.js +0 -1
- package/dist/components/Link.css.d.ts +0 -3
- package/dist/components/Link.css.js +0 -9
- package/dist/diagram.css +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Accordion/Accordion.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ActionIcon/ActionIcon.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Affix/Affix.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Alert/Alert.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Anchor/Anchor.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/AngleSlider/AngleSlider.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/AppShell/AppShell.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/AspectRatio/AspectRatio.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Avatar/Avatar.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/BackgroundImage/BackgroundImage.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Badge/Badge.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Blockquote/Blockquote.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Breadcrumbs/Breadcrumbs.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Burger/Burger.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Button/Button.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Card/Card.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Center/Center.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Checkbox/Checkbox.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Checkbox/CheckboxCard/CheckboxCard.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Chip/Chip.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/CloseButton/CloseButton.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Code/Code.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ColorInput/ColorInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ColorPicker/ColorPicker.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ColorSwatch/ColorSwatch.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Combobox/Combobox.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Container/Container.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Dialog/Dialog.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Divider/Divider.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Drawer/Drawer.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Fieldset/Fieldset.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Flex/Flex.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/FloatingIndicator/FloatingIndicator.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Grid/Grid.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Group/Group.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Image/Image.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Indicator/Indicator.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/InlineInput/InlineInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Input/Input.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Kbd/Kbd.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/List/List.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Loader/Loader.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/LoadingOverlay/LoadingOverlay.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Mark/Mark.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Menu/Menu.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Modal/Modal.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ModalBase/ModalBase.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/NavLink/NavLink.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Notification/Notification.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/NumberInput/NumberInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Overlay/Overlay.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Pagination/Pagination.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Paper/Paper.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/PasswordInput/PasswordInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Pill/Pill.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/PillsInput/PillsInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/PinInput/PinInput.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Popover/Popover.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Progress/Progress.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Radio/Radio.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Radio/RadioCard/RadioCard.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Radio/RadioIndicator/RadioIndicator.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Rating/Rating.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/RingProgress/RingProgress.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ScrollArea/ScrollArea.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/SegmentedControl/SegmentedControl.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/SemiCircleProgress/SemiCircleProgress.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/SimpleGrid/SimpleGrid.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Skeleton/Skeleton.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Slider/Slider.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Spoiler/Spoiler.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Stack/Stack.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Stepper/Stepper.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Switch/Switch.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Table/Table.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/TableOfContents/TableOfContents.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Tabs/Tabs.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Timeline/Timeline.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Title/Title.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Tooltip/Tooltip.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/Tree/Tree.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/TypographyStylesProvider/TypographyStylesProvider.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/UnstyledButton/UnstyledButton.module.css.mjs.vanilla.css.js +0 -1
- package/dist/node_modules/.pnpm/@mantine_core@7.17.1_@mantine_hooks@7.17.1_react@19.0.0__@types_react@19.0.10_react-dom_fbfa2b80048a2180882527b4a447e1ea/node_modules/@mantine/core/esm/components/VisuallyHidden/VisuallyHidden.module.css.mjs.vanilla.css.js +0 -1
- package/dist/theme-vars.css.d.ts +0 -63
- package/dist/theme-vars.css.js +0 -7
- package/dist/theme-vars.css.ts.vanilla.css.js +0 -1
- package/dist/theme-vars.d.ts +0 -16
- package/dist/theme-vars.js +0 -7
- package/dist/utils/css.js +0 -10
- package/src/LikeC4Diagram.css.ts +0 -198
- package/src/base/example/RelationshipsBrowser.tsx +0 -62
- package/src/base/example/_types.ts +0 -72
- package/src/base/example/custom.tsx +0 -58
- package/src/base/example/useViewToNodesEdges.ts +0 -194
- package/src/base/primitives/compound/CompoundActionButton.css.ts +0 -52
- package/src/base/primitives/compound/CompoundDetailsButton.css.ts +0 -58
- package/src/base/primitives/compound/CompoundTitle.css.ts +0 -65
- package/src/base/primitives/element/ElementActionButtons.css.ts +0 -52
- package/src/base/primitives/element/ElementDetailsButton.css.ts +0 -50
- package/src/base/primitives/element/vars.css.ts +0 -5
- package/src/components/Link.css.ts +0 -49
- package/src/overlays/relationship-details/custom/index.tsx +0 -2
- package/src/overlays/relationships-browser/custom/index.tsx +0 -2
- package/src/theme-vars.css.ts +0 -69
- package/src/theme-vars.ts +0 -25
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { nonNullable, invariant, DiagramNode, nonexhaustive, getBBoxCenter, getParallelStepsPrefix } from
|
|
2
|
-
import { getViewportForBounds, applyEdgeChanges, applyNodeChanges } from
|
|
3
|
-
import { nodeToRect } from
|
|
4
|
-
import { hasAtLeast, prop, clamp, first } from
|
|
5
|
-
import { setup, enqueueActions,
|
|
6
|
-
import { MinZoom } from
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import { nonNullable, invariant, DiagramNode, nonexhaustive, getBBoxCenter, getParallelStepsPrefix } from '@likec4/core';
|
|
2
|
+
import { getViewportForBounds, applyEdgeChanges, applyNodeChanges } from '@xyflow/react';
|
|
3
|
+
import { nodeToRect } from '@xyflow/system';
|
|
4
|
+
import { hasAtLeast, prop, clamp, first } from 'remeda';
|
|
5
|
+
import { setup, assign, enqueueActions, sendTo, assertEvent, cancel, stopChild, raise, spawnChild, and, or } from 'xstate';
|
|
6
|
+
import { MinZoom } from '../base/const.js';
|
|
7
|
+
import { Base } from '../base/types.js';
|
|
8
|
+
import { AllDisabled } from '../context/DiagramFeatures.js';
|
|
9
|
+
import { createLayoutConstraints } from '../likec4diagram/useLayoutConstraints.js';
|
|
10
|
+
import { overlaysActorLogic } from '../overlays/overlaysActor.js';
|
|
11
|
+
import { getAligner, toNodeRect } from './aligners.js';
|
|
12
|
+
import { lastClickedNode, updateNavigationHistory, mergeXYNodesEdges, updateEdgeData, updateNodeData, unfocusNodesEdges, updateActiveWalkthrough, focusNodesEdges, resetEdgeControlPoints, navigateForward, navigateBack } from './assign.js';
|
|
13
|
+
import { hotkeyActorLogic } from './hotkeyActor.js';
|
|
14
|
+
import { DiagramToggledFeaturesPersistence } from './persistence.js';
|
|
15
|
+
import { syncManualLayoutActorLogic } from './syncManualLayoutActor.js';
|
|
16
|
+
import { typedSystem, focusedBounds, findDiagramNode } from './utils.js';
|
|
17
|
+
|
|
16
18
|
const diagramMachine = setup({
|
|
17
19
|
types: {
|
|
18
20
|
context: {},
|
|
@@ -46,9 +48,8 @@ const diagramMachine = setup({
|
|
|
46
48
|
return event.node.selected === true;
|
|
47
49
|
},
|
|
48
50
|
"click: same node": ({ context, event }) => {
|
|
49
|
-
var _a;
|
|
50
51
|
assertEvent(event, "xyflow.nodeClick");
|
|
51
|
-
return
|
|
52
|
+
return context.lastClickedNode?.id === event.node.id;
|
|
52
53
|
},
|
|
53
54
|
"click: focused node": ({ context, event }) => {
|
|
54
55
|
assertEvent(event, "xyflow.nodeClick");
|
|
@@ -73,8 +74,7 @@ const diagramMachine = setup({
|
|
|
73
74
|
};
|
|
74
75
|
}),
|
|
75
76
|
"open source of focused or last clicked node": enqueueActions(({ context, enqueue }) => {
|
|
76
|
-
|
|
77
|
-
const nodeId = context.focusedNode ?? ((_a = context.lastClickedNode) == null ? void 0 : _a.id);
|
|
77
|
+
const nodeId = context.focusedNode ?? context.lastClickedNode?.id;
|
|
78
78
|
if (!nodeId || !context.features.enableVscode) return;
|
|
79
79
|
const diagramNode = findDiagramNode(context, nodeId);
|
|
80
80
|
if (!diagramNode) return;
|
|
@@ -101,7 +101,7 @@ const diagramMachine = setup({
|
|
|
101
101
|
);
|
|
102
102
|
viewport.x = Math.round(viewport.x);
|
|
103
103
|
viewport.y = Math.round(viewport.y);
|
|
104
|
-
panZoom
|
|
104
|
+
panZoom?.setViewport(viewport, duration > 0 ? { duration } : void 0);
|
|
105
105
|
},
|
|
106
106
|
"xyflow:fitFocusedBounds": ({ context }) => {
|
|
107
107
|
const { bounds, duration = 450 } = focusedBounds({ context });
|
|
@@ -117,7 +117,7 @@ const diagramMachine = setup({
|
|
|
117
117
|
);
|
|
118
118
|
viewport.x = Math.round(viewport.x);
|
|
119
119
|
viewport.y = Math.round(viewport.y);
|
|
120
|
-
panZoom
|
|
120
|
+
panZoom?.setViewport(viewport, duration > 0 ? { duration } : void 0);
|
|
121
121
|
},
|
|
122
122
|
"xyflow:setViewportCenter": ({ context }, params) => {
|
|
123
123
|
const { x, y } = params;
|
|
@@ -131,7 +131,7 @@ const diagramMachine = setup({
|
|
|
131
131
|
duration = 350
|
|
132
132
|
} = params;
|
|
133
133
|
const { panZoom } = context.xystore.getState();
|
|
134
|
-
panZoom
|
|
134
|
+
panZoom?.setViewport(viewport, duration > 0 ? { duration } : void 0);
|
|
135
135
|
},
|
|
136
136
|
"xyflow:alignNodeFromToAfterNavigate": ({ context }, params) => {
|
|
137
137
|
const xyflow = nonNullable(context.xyflow, "xyflow is not initialized");
|
|
@@ -183,21 +183,64 @@ const diagramMachine = setup({
|
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
if (!enableOverlays && hasRunning) {
|
|
186
|
+
enqueue.sendTo(hasRunning, {
|
|
187
|
+
type: "close.all"
|
|
188
|
+
});
|
|
186
189
|
enqueue.stopChild("overlays");
|
|
187
190
|
}
|
|
188
191
|
}),
|
|
189
|
-
"closeAllOverlays":
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
"closeAllOverlays": sendTo(
|
|
193
|
+
({ system }) => typedSystem(system).overlaysActorRef,
|
|
194
|
+
{
|
|
195
|
+
type: "close.all"
|
|
193
196
|
}
|
|
194
|
-
|
|
197
|
+
),
|
|
195
198
|
"stopSyncLayout": enqueueActions(({ context, enqueue }) => {
|
|
196
199
|
enqueue.sendTo(context.syncLayoutActorRef, { type: "stop" });
|
|
197
200
|
enqueue.stopChild(context.syncLayoutActorRef);
|
|
198
201
|
enqueue.assign({
|
|
199
202
|
syncLayoutActorRef: null
|
|
200
203
|
});
|
|
204
|
+
}),
|
|
205
|
+
"onNodeMouseEnter": assign(({ context }, params) => {
|
|
206
|
+
return {
|
|
207
|
+
xynodes: context.xynodes.map((n) => {
|
|
208
|
+
if (n.id === params.node.id) {
|
|
209
|
+
return Base.setHovered(n, true);
|
|
210
|
+
}
|
|
211
|
+
return n;
|
|
212
|
+
})
|
|
213
|
+
};
|
|
214
|
+
}),
|
|
215
|
+
"onNodeMouseLeave": assign(({ context }, params) => {
|
|
216
|
+
return {
|
|
217
|
+
xynodes: context.xynodes.map((n) => {
|
|
218
|
+
if (n.id === params.node.id) {
|
|
219
|
+
return Base.setHovered(n, false);
|
|
220
|
+
}
|
|
221
|
+
return n;
|
|
222
|
+
})
|
|
223
|
+
};
|
|
224
|
+
}),
|
|
225
|
+
"onEdgeMouseEnter": assign(({ context }, params) => {
|
|
226
|
+
return {
|
|
227
|
+
xyedges: context.xyedges.map((e) => {
|
|
228
|
+
if (e.id === params.edge.id) {
|
|
229
|
+
return Base.setHovered(e, true);
|
|
230
|
+
}
|
|
231
|
+
return e;
|
|
232
|
+
})
|
|
233
|
+
};
|
|
234
|
+
}),
|
|
235
|
+
"onEdgeMouseLeave": assign(({ context }, params) => {
|
|
236
|
+
return {
|
|
237
|
+
xyedges: context.xyedges.map((e) => {
|
|
238
|
+
if (e.id === params.edge.id) {
|
|
239
|
+
return Base.setHovered(e, false);
|
|
240
|
+
}
|
|
241
|
+
return e;
|
|
242
|
+
})
|
|
243
|
+
};
|
|
201
244
|
})
|
|
202
245
|
}
|
|
203
246
|
}).createMachine({
|
|
@@ -232,72 +275,168 @@ const diagramMachine = setup({
|
|
|
232
275
|
initializing: {
|
|
233
276
|
on: {
|
|
234
277
|
"xyflow.init": {
|
|
235
|
-
actions:
|
|
236
|
-
|
|
278
|
+
actions: [
|
|
279
|
+
assign(({ context, event }) => ({
|
|
237
280
|
initialized: true,
|
|
238
|
-
xyflow:
|
|
239
|
-
navigationHistory:
|
|
281
|
+
xyflow: event.instance,
|
|
282
|
+
navigationHistory: {
|
|
240
283
|
currentIndex: 0,
|
|
241
284
|
history: [{
|
|
242
285
|
viewId: context.view.id,
|
|
243
286
|
fromNode: null,
|
|
244
287
|
viewport: { ...event.instance.getViewport() }
|
|
245
288
|
}]
|
|
246
|
-
}
|
|
247
|
-
})
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
289
|
+
}
|
|
290
|
+
})),
|
|
291
|
+
enqueueActions(({ enqueue, check }) => {
|
|
292
|
+
if (check("enabled: FitView")) {
|
|
293
|
+
enqueue({
|
|
294
|
+
type: "xyflow:fitDiagram",
|
|
295
|
+
params: { duration: 0 }
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
})
|
|
299
|
+
],
|
|
300
|
+
target: "ready"
|
|
256
301
|
}
|
|
257
302
|
}
|
|
258
303
|
},
|
|
259
|
-
|
|
260
|
-
|
|
304
|
+
ready: {
|
|
305
|
+
initial: "idle",
|
|
261
306
|
on: {
|
|
262
|
-
"
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
"click: same node",
|
|
270
|
-
"click: selected node"
|
|
271
|
-
])
|
|
272
|
-
]),
|
|
273
|
-
actions: [
|
|
274
|
-
assign({
|
|
275
|
-
lastClickedNode,
|
|
276
|
-
focusedNode: ({ event }) => event.node.id
|
|
277
|
-
})
|
|
278
|
-
],
|
|
279
|
-
target: "focused"
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
actions: [
|
|
283
|
-
"assign lastClickedNode",
|
|
284
|
-
"open source of focused or last clicked node"
|
|
285
|
-
]
|
|
286
|
-
}
|
|
287
|
-
],
|
|
288
|
-
"xyflow.paneClick": {
|
|
289
|
-
actions: [
|
|
290
|
-
assign({
|
|
291
|
-
lastClickedNode: null
|
|
307
|
+
"navigate.to": {
|
|
308
|
+
guard: "is another view",
|
|
309
|
+
actions: assign({
|
|
310
|
+
lastOnNavigate: ({ context, event }) => ({
|
|
311
|
+
fromView: context.view.id,
|
|
312
|
+
toView: event.viewId,
|
|
313
|
+
fromNode: event.fromNode ?? null
|
|
292
314
|
})
|
|
315
|
+
}),
|
|
316
|
+
target: "#navigating"
|
|
317
|
+
},
|
|
318
|
+
"navigate.back": {
|
|
319
|
+
guard: ({ context }) => context.navigationHistory.currentIndex > 0,
|
|
320
|
+
actions: assign(navigateBack),
|
|
321
|
+
target: "#navigating"
|
|
322
|
+
},
|
|
323
|
+
"navigate.forward": {
|
|
324
|
+
guard: ({ context }) => context.navigationHistory.currentIndex < context.navigationHistory.history.length - 1,
|
|
325
|
+
actions: assign(navigateForward),
|
|
326
|
+
target: "#navigating"
|
|
327
|
+
},
|
|
328
|
+
"layout.align": {
|
|
329
|
+
guard: "not readonly",
|
|
330
|
+
actions: [
|
|
331
|
+
{
|
|
332
|
+
type: "layout.align",
|
|
333
|
+
params: ({ event }) => ({ mode: event.mode })
|
|
334
|
+
},
|
|
335
|
+
raise({ type: "saveManualLayout.schedule" })
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
"layout.resetEdgeControlPoints": {
|
|
339
|
+
guard: "not readonly",
|
|
340
|
+
actions: [
|
|
341
|
+
assign(resetEdgeControlPoints),
|
|
342
|
+
raise({ type: "saveManualLayout.schedule" })
|
|
293
343
|
]
|
|
294
344
|
},
|
|
295
|
-
"xyflow.
|
|
345
|
+
"xyflow.resized": {
|
|
346
|
+
guard: ({ context }) => context.features.enableFitView && !context.viewportChangedManually,
|
|
296
347
|
actions: [
|
|
297
|
-
|
|
298
|
-
{ type: "
|
|
348
|
+
cancel("fitDiagram"),
|
|
349
|
+
raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 200 })
|
|
299
350
|
]
|
|
300
351
|
},
|
|
352
|
+
"open.elementDetails": {
|
|
353
|
+
actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => {
|
|
354
|
+
let initiatedFrom = null;
|
|
355
|
+
const fromNodeId = event.fromNode ?? context.view.nodes.find((n) => DiagramNode.modelRef(n) === event.fqn)?.id;
|
|
356
|
+
const internalNode = fromNodeId ? context.xystore.getState().nodeLookup.get(fromNodeId) : null;
|
|
357
|
+
if (fromNodeId && internalNode) {
|
|
358
|
+
const nodeRect = nodeToRect(internalNode);
|
|
359
|
+
const zoom = context.xyflow.getZoom();
|
|
360
|
+
const clientRect = {
|
|
361
|
+
...context.xyflow.flowToScreenPosition(nodeRect),
|
|
362
|
+
width: nodeRect.width * zoom,
|
|
363
|
+
height: nodeRect.height * zoom
|
|
364
|
+
};
|
|
365
|
+
initiatedFrom = {
|
|
366
|
+
node: fromNodeId,
|
|
367
|
+
clientRect
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
return {
|
|
371
|
+
type: "open.elementDetails",
|
|
372
|
+
subject: event.fqn,
|
|
373
|
+
currentView: context.view,
|
|
374
|
+
...initiatedFrom && { initiatedFrom }
|
|
375
|
+
};
|
|
376
|
+
})
|
|
377
|
+
},
|
|
378
|
+
"open.relationshipsBrowser": {
|
|
379
|
+
actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => ({
|
|
380
|
+
type: "open.relationshipsBrowser",
|
|
381
|
+
subject: event.fqn,
|
|
382
|
+
viewId: context.view.id,
|
|
383
|
+
scope: "view",
|
|
384
|
+
closeable: true,
|
|
385
|
+
enableChangeScope: true,
|
|
386
|
+
enableSelectSubject: true
|
|
387
|
+
}))
|
|
388
|
+
},
|
|
389
|
+
"open.relationshipDetails": {
|
|
390
|
+
actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => ({
|
|
391
|
+
type: "open.relationshipDetails",
|
|
392
|
+
view: context.view,
|
|
393
|
+
edgeId: event.edgeId
|
|
394
|
+
}))
|
|
395
|
+
},
|
|
396
|
+
"open.source": {
|
|
397
|
+
actions: {
|
|
398
|
+
type: "trigger:OpenSource",
|
|
399
|
+
params: prop("event")
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
"walkthrough.start": {
|
|
403
|
+
guard: "is dynamic view",
|
|
404
|
+
target: ".walkthrough"
|
|
405
|
+
},
|
|
406
|
+
"toggle.feature": {
|
|
407
|
+
actions: assign({
|
|
408
|
+
toggledFeatures: ({ context, event }) => {
|
|
409
|
+
return DiagramToggledFeaturesPersistence.write({
|
|
410
|
+
...context.toggledFeatures,
|
|
411
|
+
[`enable${event.feature}`]: event.forceValue ?? !(context.toggledFeatures[`enable${event.feature}`] ?? context.features[`enable${event.feature}`])
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
})
|
|
415
|
+
},
|
|
416
|
+
"xyflow.nodeMouseEnter": {
|
|
417
|
+
actions: {
|
|
418
|
+
type: "onNodeMouseEnter",
|
|
419
|
+
params: prop("event")
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"xyflow.nodeMouseLeave": {
|
|
423
|
+
actions: {
|
|
424
|
+
type: "onNodeMouseLeave",
|
|
425
|
+
params: prop("event")
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
"xyflow.edgeMouseEnter": {
|
|
429
|
+
actions: {
|
|
430
|
+
type: "onEdgeMouseEnter",
|
|
431
|
+
params: prop("event")
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
"xyflow.edgeMouseLeave": {
|
|
435
|
+
actions: {
|
|
436
|
+
type: "onEdgeMouseLeave",
|
|
437
|
+
params: prop("event")
|
|
438
|
+
}
|
|
439
|
+
},
|
|
301
440
|
"saveManualLayout.*": {
|
|
302
441
|
guard: "not readonly",
|
|
303
442
|
actions: sendTo((c) => c.context.syncLayoutActorRef, ({ event }) => {
|
|
@@ -309,92 +448,206 @@ const diagramMachine = setup({
|
|
|
309
448
|
}
|
|
310
449
|
nonexhaustive(event);
|
|
311
450
|
})
|
|
312
|
-
},
|
|
313
|
-
"focus.node": {
|
|
314
|
-
guard: "enabled: FocusMode",
|
|
315
|
-
actions: assign({
|
|
316
|
-
focusedNode: ({ event }) => event.nodeId
|
|
317
|
-
}),
|
|
318
|
-
target: "focused"
|
|
319
451
|
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
entry: [
|
|
324
|
-
assign((s) => ({
|
|
325
|
-
...focusNodesEdges(s),
|
|
326
|
-
viewportBeforeFocus: { ...s.context.viewport }
|
|
327
|
-
})),
|
|
328
|
-
"open source of focused or last clicked node",
|
|
329
|
-
spawnChild("hotkeyActorLogic", { id: "hotkey" }),
|
|
330
|
-
"xyflow:fitFocusedBounds"
|
|
452
|
+
},
|
|
453
|
+
exit: [
|
|
454
|
+
cancel("fitDiagram")
|
|
331
455
|
],
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
456
|
+
states: {
|
|
457
|
+
idle: {
|
|
458
|
+
id: "idle",
|
|
459
|
+
on: {
|
|
460
|
+
"xyflow.nodeClick": [
|
|
461
|
+
{
|
|
462
|
+
// TODO: xstate fails to infer the type of the guard
|
|
463
|
+
guard: and([
|
|
464
|
+
"enabled: FocusMode",
|
|
465
|
+
"click: node has connections",
|
|
466
|
+
or([
|
|
467
|
+
"click: same node",
|
|
468
|
+
"click: selected node"
|
|
469
|
+
])
|
|
470
|
+
]),
|
|
471
|
+
actions: [
|
|
472
|
+
assign({
|
|
473
|
+
lastClickedNode,
|
|
474
|
+
focusedNode: ({ event }) => event.node.id
|
|
475
|
+
})
|
|
476
|
+
],
|
|
477
|
+
target: "focused"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
actions: [
|
|
481
|
+
"assign lastClickedNode",
|
|
482
|
+
"open source of focused or last clicked node"
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
],
|
|
486
|
+
"xyflow.paneClick": {
|
|
487
|
+
actions: [
|
|
488
|
+
assign({
|
|
489
|
+
lastClickedNode: null
|
|
490
|
+
})
|
|
491
|
+
]
|
|
492
|
+
},
|
|
493
|
+
"xyflow.paneDblClick": {
|
|
494
|
+
actions: [
|
|
495
|
+
{ type: "xyflow:fitDiagram" },
|
|
496
|
+
{ type: "trigger:OpenSource", params: ({ context }) => ({ view: context.view.id }) }
|
|
497
|
+
]
|
|
498
|
+
},
|
|
499
|
+
"focus.node": {
|
|
500
|
+
guard: "enabled: FocusMode",
|
|
501
|
+
actions: assign({
|
|
502
|
+
focusedNode: ({ event }) => event.nodeId
|
|
355
503
|
}),
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
nodeId: event.node.id
|
|
359
|
-
}))
|
|
360
|
-
]
|
|
504
|
+
target: "focused"
|
|
505
|
+
}
|
|
361
506
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
assign({
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
507
|
+
},
|
|
508
|
+
focused: {
|
|
509
|
+
entry: [
|
|
510
|
+
assign((s) => ({
|
|
511
|
+
...focusNodesEdges(s),
|
|
512
|
+
viewportBeforeFocus: { ...s.context.viewport }
|
|
513
|
+
})),
|
|
369
514
|
"open source of focused or last clicked node",
|
|
515
|
+
spawnChild("hotkeyActorLogic", { id: "hotkey" }),
|
|
370
516
|
"xyflow:fitFocusedBounds"
|
|
371
|
-
]
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
517
|
+
],
|
|
518
|
+
exit: enqueueActions(({ enqueue, context }) => {
|
|
519
|
+
enqueue.stopChild("hotkey");
|
|
520
|
+
if (context.viewportBeforeFocus) {
|
|
521
|
+
enqueue({ type: "xyflow:setViewport", params: { viewport: context.viewportBeforeFocus } });
|
|
522
|
+
} else {
|
|
523
|
+
enqueue({ type: "xyflow:fitDiagram" });
|
|
524
|
+
}
|
|
525
|
+
enqueue.assign((s) => ({
|
|
526
|
+
...unfocusNodesEdges(s),
|
|
527
|
+
viewportBeforeFocus: null,
|
|
528
|
+
focusedNode: null
|
|
529
|
+
}));
|
|
379
530
|
}),
|
|
380
|
-
|
|
531
|
+
on: {
|
|
532
|
+
"xyflow.nodeClick": [
|
|
533
|
+
{
|
|
534
|
+
guard: "click: focused node",
|
|
535
|
+
target: "#idle"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
actions: [
|
|
539
|
+
assign({
|
|
540
|
+
lastClickedNode
|
|
541
|
+
}),
|
|
542
|
+
raise(({ event }) => ({
|
|
543
|
+
type: "focus.node",
|
|
544
|
+
nodeId: event.node.id
|
|
545
|
+
}))
|
|
546
|
+
]
|
|
547
|
+
}
|
|
548
|
+
],
|
|
549
|
+
"focus.node": {
|
|
550
|
+
actions: [
|
|
551
|
+
assign({
|
|
552
|
+
focusedNode: ({ event }) => event.nodeId
|
|
553
|
+
}),
|
|
554
|
+
assign(focusNodesEdges),
|
|
555
|
+
"open source of focused or last clicked node",
|
|
556
|
+
"xyflow:fitFocusedBounds"
|
|
557
|
+
]
|
|
558
|
+
},
|
|
559
|
+
"key.esc": {
|
|
560
|
+
target: "idle"
|
|
561
|
+
},
|
|
562
|
+
"xyflow.paneClick": {
|
|
563
|
+
actions: assign({
|
|
564
|
+
lastClickedNode: null
|
|
565
|
+
}),
|
|
566
|
+
target: "idle"
|
|
567
|
+
}
|
|
568
|
+
}
|
|
381
569
|
},
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
570
|
+
walkthrough: {
|
|
571
|
+
entry: [
|
|
572
|
+
spawnChild("hotkeyActorLogic", { id: "hotkey" }),
|
|
573
|
+
assign({
|
|
574
|
+
viewportBeforeFocus: ({ context }) => context.viewport,
|
|
575
|
+
activeWalkthrough: ({ context, event }) => {
|
|
576
|
+
assertEvent(event, "walkthrough.start");
|
|
577
|
+
const stepId = event.stepId ?? first(context.xyedges).id;
|
|
578
|
+
return {
|
|
579
|
+
stepId,
|
|
580
|
+
parallelPrefix: getParallelStepsPrefix(stepId)
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
}),
|
|
584
|
+
assign(updateActiveWalkthrough),
|
|
585
|
+
"xyflow:fitFocusedBounds"
|
|
586
|
+
],
|
|
587
|
+
on: {
|
|
588
|
+
"key.esc": {
|
|
589
|
+
target: "idle"
|
|
590
|
+
},
|
|
591
|
+
"key.arrow.left": {
|
|
592
|
+
actions: raise({ type: "walkthrough.step", direction: "previous" })
|
|
593
|
+
},
|
|
594
|
+
"key.arrow.right": {
|
|
595
|
+
actions: raise({ type: "walkthrough.step", direction: "next" })
|
|
596
|
+
},
|
|
597
|
+
"walkthrough.step": {
|
|
598
|
+
actions: enqueueActions(({ enqueue, context, event }) => {
|
|
599
|
+
const { stepId } = context.activeWalkthrough;
|
|
600
|
+
const stepIndex = context.xyedges.findIndex((e) => e.id === stepId);
|
|
601
|
+
const nextStepIndex = clamp(event.direction === "next" ? stepIndex + 1 : stepIndex - 1, {
|
|
602
|
+
min: 0,
|
|
603
|
+
max: context.xyedges.length - 1
|
|
604
|
+
});
|
|
605
|
+
if (nextStepIndex === stepIndex) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const nextStepId = context.xyedges[nextStepIndex].id;
|
|
609
|
+
enqueue.assign({
|
|
610
|
+
activeWalkthrough: {
|
|
611
|
+
stepId: nextStepId,
|
|
612
|
+
parallelPrefix: getParallelStepsPrefix(nextStepId)
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
enqueue.assign(updateActiveWalkthrough);
|
|
616
|
+
enqueue("xyflow:fitFocusedBounds");
|
|
617
|
+
})
|
|
618
|
+
},
|
|
619
|
+
"walkthrough.end": {
|
|
620
|
+
target: "idle"
|
|
621
|
+
},
|
|
622
|
+
"xyflow.paneDblClick": {
|
|
623
|
+
target: "idle"
|
|
624
|
+
},
|
|
625
|
+
// We received another view, close overlay and process event again
|
|
626
|
+
"update.view": {
|
|
627
|
+
guard: "is another view",
|
|
628
|
+
actions: raise(({ event }) => event, { delay: 50 }),
|
|
629
|
+
target: "idle"
|
|
387
630
|
}
|
|
388
|
-
|
|
389
|
-
|
|
631
|
+
},
|
|
632
|
+
exit: enqueueActions(({ enqueue, context, event }) => {
|
|
633
|
+
enqueue.stopChild("hotkey");
|
|
634
|
+
if (context.viewportBeforeFocus) {
|
|
635
|
+
enqueue({ type: "xyflow:setViewport", params: { viewport: context.viewportBeforeFocus } });
|
|
636
|
+
} else {
|
|
637
|
+
enqueue({ type: "xyflow:fitDiagram" });
|
|
390
638
|
}
|
|
391
|
-
|
|
639
|
+
enqueue.assign({
|
|
640
|
+
activeWalkthrough: null,
|
|
641
|
+
...unfocusNodesEdges({ context}),
|
|
642
|
+
viewportBeforeFocus: null
|
|
643
|
+
});
|
|
392
644
|
})
|
|
393
645
|
}
|
|
394
646
|
}
|
|
395
647
|
},
|
|
396
648
|
// Navigating to another view (after `navigateTo` event)
|
|
397
649
|
navigating: {
|
|
650
|
+
id: "navigating",
|
|
398
651
|
entry: [
|
|
399
652
|
"closeAllOverlays",
|
|
400
653
|
"stopSyncLayout",
|
|
@@ -445,82 +698,6 @@ const diagramMachine = setup({
|
|
|
445
698
|
target: "#idle"
|
|
446
699
|
}
|
|
447
700
|
}
|
|
448
|
-
},
|
|
449
|
-
walkthrough: {
|
|
450
|
-
entry: [
|
|
451
|
-
spawnChild("hotkeyActorLogic", { id: "hotkey" }),
|
|
452
|
-
assign({
|
|
453
|
-
viewportBeforeFocus: ({ context }) => context.viewport,
|
|
454
|
-
activeWalkthrough: ({ context, event }) => {
|
|
455
|
-
assertEvent(event, "walkthrough.start");
|
|
456
|
-
const stepId = event.stepId ?? first(context.xyedges).id;
|
|
457
|
-
return {
|
|
458
|
-
stepId,
|
|
459
|
-
parallelPrefix: getParallelStepsPrefix(stepId)
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
}),
|
|
463
|
-
assign(updateActiveWalkthrough),
|
|
464
|
-
"xyflow:fitFocusedBounds"
|
|
465
|
-
],
|
|
466
|
-
on: {
|
|
467
|
-
"key.esc": {
|
|
468
|
-
target: "idle"
|
|
469
|
-
},
|
|
470
|
-
"key.arrow.left": {
|
|
471
|
-
actions: raise({ type: "walkthrough.step", direction: "previous" })
|
|
472
|
-
},
|
|
473
|
-
"key.arrow.right": {
|
|
474
|
-
actions: raise({ type: "walkthrough.step", direction: "next" })
|
|
475
|
-
},
|
|
476
|
-
"walkthrough.step": {
|
|
477
|
-
actions: enqueueActions(({ enqueue, context, event }) => {
|
|
478
|
-
const { stepId } = context.activeWalkthrough;
|
|
479
|
-
const stepIndex = context.xyedges.findIndex((e) => e.id === stepId);
|
|
480
|
-
const nextStepIndex = clamp(event.direction === "next" ? stepIndex + 1 : stepIndex - 1, {
|
|
481
|
-
min: 0,
|
|
482
|
-
max: context.xyedges.length - 1
|
|
483
|
-
});
|
|
484
|
-
if (nextStepIndex === stepIndex) {
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
const nextStepId = context.xyedges[nextStepIndex].id;
|
|
488
|
-
enqueue.assign({
|
|
489
|
-
activeWalkthrough: {
|
|
490
|
-
stepId: nextStepId,
|
|
491
|
-
parallelPrefix: getParallelStepsPrefix(nextStepId)
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
enqueue.assign(updateActiveWalkthrough);
|
|
495
|
-
enqueue("xyflow:fitFocusedBounds");
|
|
496
|
-
})
|
|
497
|
-
},
|
|
498
|
-
"walkthrough.end": {
|
|
499
|
-
target: "idle"
|
|
500
|
-
},
|
|
501
|
-
"xyflow.paneDblClick": {
|
|
502
|
-
target: "idle"
|
|
503
|
-
},
|
|
504
|
-
// We received another view, close overlay and process event again
|
|
505
|
-
"update.view": {
|
|
506
|
-
guard: "is another view",
|
|
507
|
-
actions: raise(({ event }) => event, { delay: 50 }),
|
|
508
|
-
target: "idle"
|
|
509
|
-
}
|
|
510
|
-
},
|
|
511
|
-
exit: enqueueActions(({ enqueue, context, event }) => {
|
|
512
|
-
enqueue.stopChild("hotkey");
|
|
513
|
-
if (context.viewportBeforeFocus) {
|
|
514
|
-
enqueue({ type: "xyflow:setViewport", params: { viewport: context.viewportBeforeFocus } });
|
|
515
|
-
} else {
|
|
516
|
-
enqueue({ type: "xyflow:fitDiagram" });
|
|
517
|
-
}
|
|
518
|
-
enqueue.assign({
|
|
519
|
-
activeWalkthrough: null,
|
|
520
|
-
...unfocusNodesEdges({ context }),
|
|
521
|
-
viewportBeforeFocus: null
|
|
522
|
-
});
|
|
523
|
-
})
|
|
524
701
|
}
|
|
525
702
|
},
|
|
526
703
|
on: {
|
|
@@ -547,26 +724,11 @@ const diagramMachine = setup({
|
|
|
547
724
|
params: prop("event")
|
|
548
725
|
}
|
|
549
726
|
},
|
|
550
|
-
"
|
|
551
|
-
|
|
552
|
-
actions: assign({
|
|
553
|
-
lastOnNavigate: ({ context, event }) => ({
|
|
554
|
-
fromView: context.view.id,
|
|
555
|
-
toView: event.viewId,
|
|
556
|
-
fromNode: event.fromNode ?? null
|
|
557
|
-
})
|
|
558
|
-
}),
|
|
559
|
-
target: ".navigating"
|
|
560
|
-
},
|
|
561
|
-
"navigate.back": {
|
|
562
|
-
guard: ({ context }) => context.navigationHistory.currentIndex > 0,
|
|
563
|
-
actions: assign(navigateBack),
|
|
564
|
-
target: ".navigating"
|
|
727
|
+
"update.nodeData": {
|
|
728
|
+
actions: assign(updateNodeData)
|
|
565
729
|
},
|
|
566
|
-
"
|
|
567
|
-
|
|
568
|
-
actions: assign(navigateForward),
|
|
569
|
-
target: ".navigating"
|
|
730
|
+
"update.edgeData": {
|
|
731
|
+
actions: assign(updateEdgeData)
|
|
570
732
|
},
|
|
571
733
|
"update.view": {
|
|
572
734
|
actions: [
|
|
@@ -622,101 +784,11 @@ const diagramMachine = setup({
|
|
|
622
784
|
},
|
|
623
785
|
"update.features": {
|
|
624
786
|
actions: "updateFeatures"
|
|
625
|
-
},
|
|
626
|
-
"update.nodeData": {
|
|
627
|
-
actions: assign(updateNodeData)
|
|
628
|
-
},
|
|
629
|
-
"update.edgeData": {
|
|
630
|
-
actions: assign(updateEdgeData)
|
|
631
|
-
},
|
|
632
|
-
"layout.align": {
|
|
633
|
-
guard: "not readonly",
|
|
634
|
-
actions: [
|
|
635
|
-
{
|
|
636
|
-
type: "layout.align",
|
|
637
|
-
params: ({ event }) => ({ mode: event.mode })
|
|
638
|
-
},
|
|
639
|
-
raise({ type: "saveManualLayout.schedule" })
|
|
640
|
-
]
|
|
641
|
-
},
|
|
642
|
-
"layout.resetEdgeControlPoints": {
|
|
643
|
-
guard: "not readonly",
|
|
644
|
-
actions: [
|
|
645
|
-
assign(resetEdgeControlPoints),
|
|
646
|
-
raise({ type: "saveManualLayout.schedule" })
|
|
647
|
-
]
|
|
648
|
-
},
|
|
649
|
-
"xyflow.resized": {
|
|
650
|
-
guard: ({ context }) => context.features.enableFitView && !context.viewportChangedManually,
|
|
651
|
-
actions: [
|
|
652
|
-
cancel("fitDiagram"),
|
|
653
|
-
raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 200 })
|
|
654
|
-
]
|
|
655
|
-
},
|
|
656
|
-
"open.elementDetails": {
|
|
657
|
-
actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => {
|
|
658
|
-
var _a;
|
|
659
|
-
let initiatedFrom = null;
|
|
660
|
-
const fromNodeId = event.fromNode ?? ((_a = context.view.nodes.find((n) => DiagramNode.modelRef(n) === event.fqn)) == null ? void 0 : _a.id);
|
|
661
|
-
const internalNode = fromNodeId ? context.xystore.getState().nodeLookup.get(fromNodeId) : null;
|
|
662
|
-
if (fromNodeId && internalNode) {
|
|
663
|
-
const nodeRect = nodeToRect(internalNode);
|
|
664
|
-
const zoom = context.xyflow.getZoom();
|
|
665
|
-
const clientRect = {
|
|
666
|
-
...context.xyflow.flowToScreenPosition(nodeRect),
|
|
667
|
-
width: nodeRect.width * zoom,
|
|
668
|
-
height: nodeRect.height * zoom
|
|
669
|
-
};
|
|
670
|
-
initiatedFrom = {
|
|
671
|
-
node: fromNodeId,
|
|
672
|
-
clientRect
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
return {
|
|
676
|
-
type: "open.elementDetails",
|
|
677
|
-
subject: event.fqn,
|
|
678
|
-
currentView: context.view,
|
|
679
|
-
...initiatedFrom && { initiatedFrom }
|
|
680
|
-
};
|
|
681
|
-
})
|
|
682
|
-
},
|
|
683
|
-
"open.relationshipsBrowser": {
|
|
684
|
-
actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => ({
|
|
685
|
-
type: "open.relationshipsBrowser",
|
|
686
|
-
subject: event.fqn,
|
|
687
|
-
scope: context.view
|
|
688
|
-
}))
|
|
689
|
-
},
|
|
690
|
-
"open.relationshipDetails": {
|
|
691
|
-
actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => ({
|
|
692
|
-
type: "open.relationshipDetails",
|
|
693
|
-
view: context.view,
|
|
694
|
-
edgeId: event.edgeId
|
|
695
|
-
}))
|
|
696
|
-
},
|
|
697
|
-
"open.source": {
|
|
698
|
-
actions: {
|
|
699
|
-
type: "trigger:OpenSource",
|
|
700
|
-
params: prop("event")
|
|
701
|
-
}
|
|
702
|
-
},
|
|
703
|
-
"walkthrough.start": {
|
|
704
|
-
guard: "is dynamic view",
|
|
705
|
-
target: ".walkthrough"
|
|
706
|
-
},
|
|
707
|
-
"toggle.feature": {
|
|
708
|
-
actions: assign({
|
|
709
|
-
toggledFeatures: ({ context, event }) => {
|
|
710
|
-
return DiagramToggledFeaturesPersistence.write({
|
|
711
|
-
...context.toggledFeatures,
|
|
712
|
-
[`enable${event.feature}`]: event.forceValue ?? !(context.toggledFeatures[`enable${event.feature}`] ?? context.features[`enable${event.feature}`])
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
})
|
|
716
787
|
}
|
|
717
788
|
},
|
|
718
789
|
exit: [
|
|
719
790
|
"stopSyncLayout",
|
|
791
|
+
cancel("fitDiagram"),
|
|
720
792
|
stopChild("hotkey"),
|
|
721
793
|
assign({
|
|
722
794
|
xyflow: null,
|
|
@@ -728,13 +800,11 @@ const diagramMachine = setup({
|
|
|
728
800
|
});
|
|
729
801
|
const nodeRef = (node) => DiagramNode.modelRef(node) ?? DiagramNode.deploymentRef(node);
|
|
730
802
|
function findCorrespondingNode(context, event) {
|
|
731
|
-
|
|
732
|
-
const fromNodeId = (_a = context.lastOnNavigate) == null ? void 0 : _a.fromNode;
|
|
803
|
+
const fromNodeId = context.lastOnNavigate?.fromNode;
|
|
733
804
|
const fromNode = fromNodeId && context.view.nodes.find((n) => n.id === fromNodeId);
|
|
734
805
|
const fromRef = fromNode && nodeRef(fromNode);
|
|
735
806
|
const toNode = fromRef && event.view.nodes.find((n) => nodeRef(n) === fromRef);
|
|
736
807
|
return { fromNode, toNode };
|
|
737
808
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
};
|
|
809
|
+
|
|
810
|
+
export { diagramMachine };
|