@likec4/diagram 1.26.2 → 1.27.1

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.
Files changed (487) hide show
  1. package/README.md +1 -1
  2. package/bundle/index.js +48937 -0
  3. package/dist/LikeC4CustomColors.js +27 -23
  4. package/dist/LikeC4Diagram.d.ts +1 -1
  5. package/dist/LikeC4Diagram.js +38 -43
  6. package/dist/LikeC4Diagram.props.d.ts +6 -0
  7. package/dist/LikeC4ModelProvider.js +6 -6
  8. package/dist/StaticLikeC4Diagram.js +5 -5
  9. package/dist/_virtual/_commonjsHelpers.js +5 -0
  10. package/dist/_virtual/default-map.js +7 -0
  11. package/dist/base/Background.js +6 -6
  12. package/dist/base/BaseXYFlow.d.ts +1 -1
  13. package/dist/base/BaseXYFlow.js +75 -46
  14. package/dist/base/const.js +2 -5
  15. package/dist/base/primitives/NodeHandles.js +5 -5
  16. package/dist/base/primitives/compound/CompoundActionButton.js +60 -33
  17. package/dist/base/primitives/compound/CompoundDetailsButton.js +66 -35
  18. package/dist/base/primitives/compound/CompoundNodeContainer.css.d.ts +35 -7
  19. package/dist/base/primitives/compound/CompoundNodeContainer.css.js +131 -12
  20. package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +4 -20
  21. package/dist/base/primitives/compound/CompoundNodeContainer.js +99 -97
  22. package/dist/base/primitives/compound/CompoundTitle.d.ts +1 -1
  23. package/dist/base/primitives/compound/CompoundTitle.js +74 -12
  24. package/dist/base/primitives/compound/actionbtns.css.d.ts +11 -0
  25. package/dist/base/primitives/compound/actionbtns.css.js +32 -0
  26. package/dist/base/primitives/customEdge.d.ts +5 -5
  27. package/dist/base/primitives/customEdge.js +6 -7
  28. package/dist/base/primitives/customNode.js +5 -6
  29. package/dist/base/primitives/edge/EdgeActionButton.js +10 -12
  30. package/dist/base/primitives/edge/EdgeContainer.d.ts +1 -1
  31. package/dist/base/primitives/edge/EdgeContainer.js +21 -15
  32. package/dist/base/primitives/edge/EdgeLabel.css.d.ts +24 -10
  33. package/dist/base/primitives/edge/EdgeLabel.css.js +130 -20
  34. package/dist/base/primitives/edge/EdgeLabel.d.ts +4 -44
  35. package/dist/base/primitives/edge/EdgeLabel.js +35 -88
  36. package/dist/base/primitives/edge/EdgeLabelContainer.d.ts +18 -0
  37. package/dist/base/primitives/edge/EdgeLabelContainer.js +91 -0
  38. package/dist/base/primitives/edge/EdgeMarkers.js +5 -6
  39. package/dist/base/primitives/edge/EdgePath.d.ts +7 -7
  40. package/dist/base/primitives/edge/EdgePath.js +14 -29
  41. package/dist/base/primitives/edge/edge.css.d.ts +2 -2
  42. package/dist/base/primitives/edge/edge.css.js +125 -12
  43. package/dist/base/primitives/edge/xyvars.d.ts +24 -0
  44. package/dist/base/primitives/element/ElementActionButtons.js +35 -17
  45. package/dist/base/primitives/element/ElementDetailsButton.js +34 -16
  46. package/dist/base/primitives/element/ElementNodeContainer.css.d.ts +0 -1
  47. package/dist/base/primitives/element/ElementNodeContainer.css.js +51 -5
  48. package/dist/base/primitives/element/ElementNodeContainer.d.ts +1 -1
  49. package/dist/base/primitives/element/ElementNodeContainer.js +28 -19
  50. package/dist/base/primitives/element/ElementShape.css.js +107 -16
  51. package/dist/base/primitives/element/ElementShape.js +8 -10
  52. package/dist/base/primitives/element/ElementTitle.css.d.ts +33 -8
  53. package/dist/base/primitives/element/ElementTitle.css.js +196 -19
  54. package/dist/base/primitives/element/ElementTitle.js +25 -24
  55. package/dist/base/primitives/index.d.ts +1 -0
  56. package/dist/base/types.js +6 -6
  57. package/dist/base/updateEdges.js +5 -5
  58. package/dist/base/updateNodes.js +6 -6
  59. package/dist/bundle/LikeC4ModelProvider.d.ts +9 -0
  60. package/dist/bundle/LikeC4ModelProvider.js +5 -0
  61. package/dist/bundle/LikeC4View.d.ts +2 -0
  62. package/dist/bundle/LikeC4View.js +176 -0
  63. package/dist/bundle/LikeC4View.props.d.ts +207 -0
  64. package/dist/bundle/ReactLikeC4.d.ts +36 -0
  65. package/dist/bundle/ReactLikeC4.js +90 -0
  66. package/dist/bundle/ShadowRoot.d.ts +12 -0
  67. package/dist/bundle/ShadowRoot.js +52 -0
  68. package/dist/bundle/ViewNotFound.d.ts +5 -0
  69. package/dist/bundle/ViewNotFound.js +30 -0
  70. package/dist/bundle/font.css.js +3 -0
  71. package/dist/bundle/index.d.ts +5 -0
  72. package/dist/bundle/index.js +4 -0
  73. package/dist/bundle/styles.css.d.ts +10 -0
  74. package/dist/bundle/styles.css.js +145 -0
  75. package/dist/components/Link.js +62 -13
  76. package/dist/components/SearchControl.css.js +72 -9
  77. package/dist/components/SearchControl.js +11 -11
  78. package/dist/context/ControlsCustomLayout.js +5 -6
  79. package/dist/context/DiagramEventHandlers.js +8 -13
  80. package/dist/context/DiagramFeatures.js +7 -12
  81. package/dist/context/EnsureMantine.js +6 -6
  82. package/dist/context/FramerMotionConfig.js +8 -9
  83. package/dist/context/IconRenderer.js +7 -9
  84. package/dist/context/ReduceGraphics.d.ts +4 -5
  85. package/dist/context/ReduceGraphics.js +11 -43
  86. package/dist/context/RootContainer.js +23 -10
  87. package/dist/hooks/safeContext.js +5 -7
  88. package/dist/hooks/useCurrentViewId.js +6 -6
  89. package/dist/hooks/useDiagram.d.ts +5763 -5286
  90. package/dist/hooks/useDiagram.js +13 -17
  91. package/dist/hooks/useMantinePortalProps.js +5 -5
  92. package/dist/hooks/useOverlaysActor.d.ts +2 -0
  93. package/dist/hooks/useOverlaysActor.js +10 -0
  94. package/dist/hooks/useReducedGraphics.d.ts +1 -1
  95. package/dist/hooks/useSetState.js +5 -5
  96. package/dist/hooks/useUpdateEffect.js +6 -7
  97. package/dist/hooks/useXYFlow.d.ts +28 -28
  98. package/dist/hooks/useXYFlow.js +7 -11
  99. package/dist/index.d.ts +0 -1
  100. package/dist/index.js +10 -26
  101. package/dist/likec4diagram/DiagramUI.js +13 -13
  102. package/dist/likec4diagram/DiagramXYFlow.d.ts +1 -4
  103. package/dist/likec4diagram/DiagramXYFlow.js +83 -37
  104. package/dist/likec4diagram/custom/edges/NotePopover.css.js +21 -7
  105. package/dist/likec4diagram/custom/edges/NotePopover.js +18 -27
  106. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +9 -9
  107. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +127 -122
  108. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.d.ts +1 -0
  109. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.js +38 -11
  110. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.d.ts +3 -3
  111. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +28 -30
  112. package/dist/likec4diagram/custom/edges/edges.css.js +44 -9
  113. package/dist/likec4diagram/custom/edges/utils.js +6 -7
  114. package/dist/likec4diagram/custom/index.d.ts +9 -9
  115. package/dist/likec4diagram/custom/index.js +5 -6
  116. package/dist/likec4diagram/custom/nodes/CompoundActions.js +7 -7
  117. package/dist/likec4diagram/custom/nodes/ElementActions.js +8 -9
  118. package/dist/likec4diagram/custom/nodes/nodeTypes.js +22 -26
  119. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +10 -13
  120. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +15 -16
  121. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +12 -13
  122. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +1 -1
  123. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +17 -14
  124. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +15 -20
  125. package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +15 -5
  126. package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +15 -15
  127. package/dist/likec4diagram/ui/controls/Controls.js +24 -24
  128. package/dist/likec4diagram/ui/controls/LayoutDriftNotification.js +19 -12
  129. package/dist/likec4diagram/ui/controls/ManualLayoutToolsButton.js +8 -8
  130. package/dist/likec4diagram/ui/controls/NavigationButtons.js +8 -8
  131. package/dist/likec4diagram/ui/controls/ToggleReadonly.js +7 -7
  132. package/dist/likec4diagram/ui/controls/_shared.js +4 -5
  133. package/dist/likec4diagram/ui/controls/styles.css.js +79 -17
  134. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.js +49 -9
  135. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +12 -12
  136. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +85 -15
  137. package/dist/likec4diagram/ui/notation/NotationPanel.js +32 -32
  138. package/dist/likec4diagram/ui/search/ElementsColumn.css.d.ts +0 -5
  139. package/dist/likec4diagram/ui/search/ElementsColumn.css.js +70 -30
  140. package/dist/likec4diagram/ui/search/ElementsColumn.js +40 -33
  141. package/dist/likec4diagram/ui/search/LikeC4Search.css.js +87 -20
  142. package/dist/likec4diagram/ui/search/LikeC4Search.js +18 -17
  143. package/dist/likec4diagram/ui/search/SearchInput.js +22 -24
  144. package/dist/likec4diagram/ui/search/ViewsColum.js +22 -22
  145. package/dist/likec4diagram/ui/search/ViewsColumn.css.d.ts +0 -2
  146. package/dist/likec4diagram/ui/search/ViewsColumn.css.js +29 -14
  147. package/dist/likec4diagram/ui/search/_shared.css.d.ts +3 -17
  148. package/dist/likec4diagram/ui/search/_shared.css.js +171 -0
  149. package/dist/likec4diagram/ui/search/state.js +12 -22
  150. package/dist/likec4diagram/ui/search/utils.js +2 -5
  151. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +66 -10
  152. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +18 -27
  153. package/dist/likec4diagram/useLayoutConstraints.d.ts +11 -10
  154. package/dist/likec4diagram/useLayoutConstraints.js +100 -104
  155. package/dist/likec4diagram/useViewToNodesEdges.js +12 -13
  156. package/dist/likec4model/LikeC4ModelContext.js +4 -4
  157. package/dist/likec4model/useLikeC4ElementsTree.js +6 -7
  158. package/dist/likec4model/useLikeC4Model.js +6 -6
  159. package/dist/node_modules/.pnpm/mnemonist@0.40.3_patch_hash_5c12abb43fcff6fd81e53021b89075d53249640d165a2556cc1e58d71201a13a/node_modules/mnemonist/default-map.js +172 -0
  160. package/dist/overlays/Overlays.js +22 -22
  161. package/dist/overlays/element-details/ElementDetails.js +9 -9
  162. package/dist/overlays/element-details/ElementDetailsCard.css.d.ts +2 -3
  163. package/dist/overlays/element-details/ElementDetailsCard.css.js +237 -35
  164. package/dist/overlays/element-details/ElementDetailsCard.js +44 -46
  165. package/dist/overlays/element-details/TabPanelDeployments.css.js +62 -11
  166. package/dist/overlays/element-details/TabPanelDeployments.js +11 -11
  167. package/dist/overlays/element-details/TabPanelRelationships.css.js +99 -9
  168. package/dist/overlays/element-details/TabPanelRelationships.js +41 -14
  169. package/dist/overlays/element-details/TabPanelStructure.css.js +36 -7
  170. package/dist/overlays/element-details/TabPanelStructure.js +8 -9
  171. package/dist/overlays/element-details/actor.d.ts +21892 -22686
  172. package/dist/overlays/element-details/actor.js +18 -19
  173. package/dist/overlays/element-details/actorContext.js +4 -5
  174. package/dist/overlays/overlay/Overlay.css.d.ts +2 -2
  175. package/dist/overlays/overlay/Overlay.css.js +76 -98
  176. package/dist/overlays/overlay/Overlay.d.ts +2 -2
  177. package/dist/overlays/overlay/Overlay.js +99 -94
  178. package/dist/overlays/overlaysActor.d.ts +6 -6
  179. package/dist/overlays/overlaysActor.js +17 -18
  180. package/dist/overlays/relationship-details/RelationshipDetails.d.ts +49 -0
  181. package/dist/overlays/relationship-details/RelationshipDetails.js +24 -17
  182. package/dist/overlays/relationship-details/SelectEdge.css.js +82 -17
  183. package/dist/overlays/relationship-details/SelectEdge.js +15 -17
  184. package/dist/overlays/relationship-details/actor.js +9 -9
  185. package/dist/overlays/relationship-details/custom/ElementActions.js +8 -8
  186. package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +44 -46
  187. package/dist/overlays/relationship-details/custom/edgeTypes.js +49 -50
  188. package/dist/overlays/relationship-details/custom/index.d.ts +2 -2
  189. package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +28 -30
  190. package/dist/overlays/relationship-details/custom/nodeTypes.js +31 -35
  191. package/dist/overlays/relationship-details/hooks.js +9 -13
  192. package/dist/overlays/relationship-details/useLayoutedDetails.js +17 -19
  193. package/dist/overlays/relationships-browser/-useRelationshipsView.d.ts +8 -24
  194. package/dist/overlays/relationships-browser/-useRelationshipsView.js +50 -85
  195. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +48 -0
  196. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +101 -101
  197. package/dist/overlays/relationships-browser/SelectElement.css.js +22 -9
  198. package/dist/overlays/relationships-browser/SelectElement.d.ts +2 -7
  199. package/dist/overlays/relationships-browser/SelectElement.js +196 -112
  200. package/dist/overlays/relationships-browser/_types.d.ts +4 -1
  201. package/dist/overlays/relationships-browser/actor.d.ts +478 -351
  202. package/dist/overlays/relationships-browser/actor.js +108 -94
  203. package/dist/overlays/relationships-browser/const.d.ts +1 -1
  204. package/dist/overlays/relationships-browser/const.js +3 -4
  205. package/dist/overlays/relationships-browser/custom/ElementActions.js +9 -9
  206. package/dist/overlays/relationships-browser/custom/EmptyNode.js +6 -6
  207. package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +43 -44
  208. package/dist/overlays/relationships-browser/custom/edgeTypes.js +97 -65
  209. package/dist/overlays/relationships-browser/custom/index.d.ts +2 -2
  210. package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +37 -37
  211. package/dist/overlays/relationships-browser/custom/nodeTypes.js +36 -40
  212. package/dist/overlays/relationships-browser/custom/styles.css.js +14 -5
  213. package/dist/overlays/relationships-browser/hooks.d.ts +14 -6
  214. package/dist/overlays/relationships-browser/hooks.js +25 -16
  215. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +13 -18
  216. package/dist/packages/core/src/compute-view/relationships-view/compute.js +123 -0
  217. package/dist/packages/core/src/compute-view/relationships-view/utils.js +68 -0
  218. package/dist/packages/core/src/errors/index.js +15 -0
  219. package/dist/packages/core/src/utils/fqn.js +43 -0
  220. package/dist/packages/core/src/utils/guards.js +7 -0
  221. package/dist/packages/core/src/utils/iterable/filter.js +21 -0
  222. package/dist/packages/core/src/utils/iterable/map.js +18 -0
  223. package/dist/packages/core/src/utils/iterable/to.js +14 -0
  224. package/dist/src/index.ts.d.ts +2 -0
  225. package/dist/state/DiagramActorProvider.d.ts +4 -2
  226. package/dist/state/DiagramActorProvider.js +44 -52
  227. package/dist/state/aligners.js +22 -31
  228. package/dist/state/assign.js +13 -23
  229. package/dist/state/diagram-machine.d.ts +5988 -5461
  230. package/dist/state/diagram-machine.js +476 -376
  231. package/dist/state/hotkeyActor.js +5 -5
  232. package/dist/state/inspector.d.ts +1 -1
  233. package/dist/state/persistence.js +4 -4
  234. package/dist/state/syncManualLayoutActor.d.ts +1 -1
  235. package/dist/state/syncManualLayoutActor.js +10 -10
  236. package/dist/state/utils.js +4 -9
  237. package/dist/styles.css.js +3 -0
  238. package/dist/utils/vector.js +2 -4
  239. package/dist/utils/xyflow.js +7 -12
  240. package/package.json +43 -42
  241. package/src/LikeC4CustomColors.tsx +44 -20
  242. package/src/LikeC4Diagram.props.ts +32 -0
  243. package/src/LikeC4Diagram.tsx +17 -21
  244. package/src/base/BaseXYFlow.tsx +67 -43
  245. package/src/base/primitives/compound/CompoundActionButton.tsx +41 -20
  246. package/src/base/primitives/compound/CompoundDetailsButton.tsx +48 -25
  247. package/src/base/primitives/compound/CompoundNodeContainer.css.ts +111 -111
  248. package/src/base/primitives/compound/CompoundNodeContainer.tsx +92 -92
  249. package/src/base/primitives/compound/CompoundTitle.tsx +73 -7
  250. package/src/base/primitives/compound/actionbtns.css.ts +30 -0
  251. package/src/base/primitives/customEdge.ts +2 -3
  252. package/src/base/primitives/edge/EdgeActionButton.tsx +3 -5
  253. package/src/base/primitives/edge/EdgeContainer.tsx +17 -9
  254. package/src/base/primitives/edge/EdgeLabel.css.ts +110 -177
  255. package/src/base/primitives/edge/EdgeLabel.tsx +43 -114
  256. package/src/base/primitives/edge/EdgeLabelContainer.tsx +118 -0
  257. package/src/base/primitives/edge/EdgePath.tsx +28 -37
  258. package/src/base/primitives/edge/edge.css.ts +107 -132
  259. package/src/base/primitives/edge/xyvars.ts +31 -0
  260. package/src/base/primitives/element/ElementActionButtons.tsx +30 -10
  261. package/src/base/primitives/element/ElementDetailsButton.tsx +27 -8
  262. package/src/base/primitives/element/ElementNodeContainer.css.ts +44 -70
  263. package/src/base/primitives/element/ElementNodeContainer.tsx +18 -8
  264. package/src/base/primitives/element/ElementShape.css.ts +70 -114
  265. package/src/base/primitives/element/ElementShape.tsx +0 -1
  266. package/src/base/primitives/element/ElementTitle.css.ts +169 -124
  267. package/src/base/primitives/element/ElementTitle.tsx +16 -16
  268. package/src/base/primitives/index.ts +1 -0
  269. package/src/base/types.ts +2 -2
  270. package/src/bundle/LikeC4ModelProvider.tsx +12 -0
  271. package/src/bundle/LikeC4View.props.ts +249 -0
  272. package/src/bundle/LikeC4View.tsx +196 -0
  273. package/src/bundle/ReactLikeC4.tsx +148 -0
  274. package/src/bundle/ShadowRoot.tsx +60 -0
  275. package/src/bundle/ViewNotFound.tsx +25 -0
  276. package/src/bundle/font.css +251 -0
  277. package/src/bundle/index.ts +7 -0
  278. package/src/bundle/react-dom-server-mock.ts +3 -0
  279. package/src/bundle/styles.css.ts +168 -0
  280. package/src/components/Link.tsx +59 -6
  281. package/src/components/SearchControl.css.ts +52 -59
  282. package/src/components/SearchControl.tsx +2 -5
  283. package/src/context/ReduceGraphics.tsx +9 -47
  284. package/src/context/RootContainer.tsx +21 -5
  285. package/src/hooks/safeContext.tsx +2 -3
  286. package/src/hooks/useCurrentViewId.ts +4 -4
  287. package/src/hooks/useDiagram.ts +4 -3
  288. package/src/hooks/useOverlaysActor.ts +11 -0
  289. package/src/hooks/useReducedGraphics.ts +8 -1
  290. package/src/hooks/useXYFlow.ts +2 -2
  291. package/src/index.ts +1 -3
  292. package/src/likec4diagram/DiagramUI.tsx +2 -2
  293. package/src/likec4diagram/DiagramXYFlow.tsx +83 -27
  294. package/src/likec4diagram/custom/edges/NotePopover.css.ts +7 -13
  295. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +108 -90
  296. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +23 -44
  297. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +26 -24
  298. package/src/likec4diagram/custom/edges/edges.css.ts +25 -32
  299. package/src/likec4diagram/custom/nodes/nodeTypes.tsx +2 -2
  300. package/src/likec4diagram/custom/nodes/toolbar/Toolbar.tsx +10 -6
  301. package/src/likec4diagram/custom/nodes/toolbar/styles.css.ts +8 -4
  302. package/src/likec4diagram/ui/controls/LayoutDriftNotification.tsx +8 -4
  303. package/src/likec4diagram/ui/controls/styles.css.ts +46 -57
  304. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.ts +38 -34
  305. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +4 -4
  306. package/src/likec4diagram/ui/notation/NotationPanel.css.ts +44 -56
  307. package/src/likec4diagram/ui/notation/NotationPanel.tsx +17 -14
  308. package/src/likec4diagram/ui/search/ElementsColumn.css.ts +80 -85
  309. package/src/likec4diagram/ui/search/ElementsColumn.tsx +21 -14
  310. package/src/likec4diagram/ui/search/LikeC4Search.css.ts +50 -67
  311. package/src/likec4diagram/ui/search/LikeC4Search.tsx +1 -2
  312. package/src/likec4diagram/ui/search/SearchInput.tsx +2 -2
  313. package/src/likec4diagram/ui/search/ViewsColum.tsx +10 -7
  314. package/src/likec4diagram/ui/search/ViewsColumn.css.ts +29 -28
  315. package/src/likec4diagram/ui/search/_shared.css.ts +158 -74
  316. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +31 -34
  317. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +6 -6
  318. package/src/likec4diagram/useLayoutConstraints.ts +84 -89
  319. package/src/likec4diagram/useViewToNodesEdges.ts +2 -1
  320. package/src/overlays/Overlays.tsx +7 -5
  321. package/src/overlays/element-details/ElementDetailsCard.css.ts +143 -177
  322. package/src/overlays/element-details/ElementDetailsCard.tsx +29 -29
  323. package/src/overlays/element-details/TabPanelDeployments.css.ts +49 -54
  324. package/src/overlays/element-details/TabPanelRelationships.css.ts +62 -66
  325. package/src/overlays/element-details/TabPanelRelationships.tsx +32 -3
  326. package/src/overlays/element-details/TabPanelStructure.css.ts +26 -26
  327. package/src/overlays/element-details/actor.ts +4 -2
  328. package/src/overlays/overlay/Overlay.css.ts +53 -47
  329. package/src/overlays/overlay/Overlay.tsx +102 -98
  330. package/src/overlays/overlaysActor.ts +1 -0
  331. package/src/overlays/relationship-details/RelationshipDetails.tsx +15 -3
  332. package/src/overlays/relationship-details/SelectEdge.css.ts +52 -71
  333. package/src/overlays/relationship-details/SelectEdge.tsx +1 -2
  334. package/src/overlays/relationship-details/custom/edgeTypes.tsx +35 -30
  335. package/src/overlays/relationship-details/custom/index.ts +2 -0
  336. package/src/overlays/relationship-details/custom/nodeTypes.tsx +20 -24
  337. package/src/overlays/relationship-details/custom/styles.css.ts +8 -8
  338. package/src/overlays/relationship-details/useLayoutedDetails.ts +1 -1
  339. package/src/overlays/relationships-browser/-useRelationshipsView.ts +55 -82
  340. package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +39 -36
  341. package/src/overlays/relationships-browser/SelectElement.css.ts +9 -12
  342. package/src/overlays/relationships-browser/SelectElement.tsx +192 -105
  343. package/src/overlays/relationships-browser/_types.ts +4 -9
  344. package/src/overlays/relationships-browser/actor.ts +144 -123
  345. package/src/overlays/relationships-browser/const.ts +1 -1
  346. package/src/overlays/relationships-browser/custom/EmptyNode.tsx +2 -2
  347. package/src/overlays/relationships-browser/custom/edgeTypes.tsx +95 -59
  348. package/src/overlays/relationships-browser/custom/index.ts +2 -0
  349. package/src/overlays/relationships-browser/custom/nodeTypes.tsx +25 -26
  350. package/src/overlays/relationships-browser/custom/styles.css.ts +5 -6
  351. package/src/overlays/relationships-browser/hooks.ts +17 -3
  352. package/src/overlays/relationships-browser/useViewToNodesEdges.ts +4 -10
  353. package/src/state/DiagramActorProvider.tsx +37 -46
  354. package/src/state/assign.ts +2 -2
  355. package/src/state/diagram-machine.ts +477 -366
  356. package/src/state/inspector.ts +1 -1
  357. package/src/styles.css +3 -0
  358. package/dist/LikeC4Diagram.css.d.ts +0 -8
  359. package/dist/LikeC4Diagram.css.js +0 -11
  360. package/dist/base/example/RelationshipsBrowser.d.ts +0 -6
  361. package/dist/base/example/_types.d.ts +0 -20
  362. package/dist/base/example/custom.d.ts +0 -72
  363. package/dist/base/example/useViewToNodesEdges.d.ts +0 -6
  364. package/dist/base/primitives/compound/CompoundActionButton.css.d.ts +0 -2
  365. package/dist/base/primitives/compound/CompoundActionButton.css.js +0 -8
  366. package/dist/base/primitives/compound/CompoundDetailsButton.css.d.ts +0 -3
  367. package/dist/base/primitives/compound/CompoundDetailsButton.css.js +0 -8
  368. package/dist/base/primitives/compound/CompoundTitle.css.d.ts +0 -3
  369. package/dist/base/primitives/compound/CompoundTitle.css.js +0 -10
  370. package/dist/base/primitives/element/ElementActionButtons.css.d.ts +0 -3
  371. package/dist/base/primitives/element/ElementActionButtons.css.js +0 -10
  372. package/dist/base/primitives/element/ElementDetailsButton.css.d.ts +0 -3
  373. package/dist/base/primitives/element/ElementDetailsButton.css.js +0 -8
  374. package/dist/base/primitives/element/vars.css.d.ts +0 -3
  375. package/dist/base/primitives/element/vars.css.ts.vanilla.css.js +0 -1
  376. package/dist/components/Link.css.d.ts +0 -3
  377. package/dist/components/Link.css.js +0 -9
  378. package/dist/diagram.css +0 -1
  379. 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
  380. 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
  381. 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
  382. 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
  383. 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
  384. 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
  385. 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
  386. 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
  387. 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
  388. 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
  389. 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
  390. 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
  391. 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
  392. 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
  393. 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
  394. 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
  395. 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
  396. 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
  397. 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
  398. 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
  399. 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
  400. 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
  401. 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
  402. 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
  403. 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
  404. 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
  405. 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
  406. 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
  407. 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
  408. 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
  409. 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
  410. 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
  411. 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
  412. 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
  413. 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
  414. 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
  415. 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
  416. 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
  417. 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
  418. 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
  419. 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
  420. 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
  421. 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
  422. 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
  423. 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
  424. 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
  425. 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
  426. 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
  427. 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
  428. 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
  429. 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
  430. 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
  431. 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
  432. 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
  433. 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
  434. 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
  435. 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
  436. 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
  437. 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
  438. 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
  439. 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
  440. 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
  441. 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
  442. 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
  443. 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
  444. 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
  445. 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
  446. 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
  447. 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
  448. 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
  449. 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
  450. 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
  451. 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
  452. 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
  453. 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
  454. 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
  455. 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
  456. 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
  457. 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
  458. 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
  459. 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
  460. 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
  461. 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
  462. 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
  463. 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
  464. 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
  465. 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
  466. package/dist/theme-vars.css.d.ts +0 -63
  467. package/dist/theme-vars.css.js +0 -7
  468. package/dist/theme-vars.css.ts.vanilla.css.js +0 -1
  469. package/dist/theme-vars.d.ts +0 -16
  470. package/dist/theme-vars.js +0 -7
  471. package/dist/utils/css.js +0 -10
  472. package/src/LikeC4Diagram.css.ts +0 -198
  473. package/src/base/example/RelationshipsBrowser.tsx +0 -62
  474. package/src/base/example/_types.ts +0 -72
  475. package/src/base/example/custom.tsx +0 -58
  476. package/src/base/example/useViewToNodesEdges.ts +0 -194
  477. package/src/base/primitives/compound/CompoundActionButton.css.ts +0 -52
  478. package/src/base/primitives/compound/CompoundDetailsButton.css.ts +0 -58
  479. package/src/base/primitives/compound/CompoundTitle.css.ts +0 -65
  480. package/src/base/primitives/element/ElementActionButtons.css.ts +0 -52
  481. package/src/base/primitives/element/ElementDetailsButton.css.ts +0 -50
  482. package/src/base/primitives/element/vars.css.ts +0 -5
  483. package/src/components/Link.css.ts +0 -49
  484. package/src/overlays/relationship-details/custom/index.tsx +0 -2
  485. package/src/overlays/relationships-browser/custom/index.tsx +0 -2
  486. package/src/theme-vars.css.ts +0 -69
  487. package/src/theme-vars.ts +0 -25
@@ -1,18 +1,20 @@
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, enqueueActions, assign, assertEvent, stopChild, sendTo, cancel, raise, spawnChild, and, or } from "xstate";
6
- import { MinZoom } from "../base/const.js";
7
- import { AllDisabled } from "../context/DiagramFeatures.js";
8
- import { createLayoutConstraints } from "../likec4diagram/useLayoutConstraints.js";
9
- import { overlaysActorLogic } from "../overlays/overlaysActor.js";
10
- import { getAligner, toNodeRect } from "./aligners.js";
11
- import { lastClickedNode, resetEdgeControlPoints, updateEdgeData, updateNodeData, updateNavigationHistory, mergeXYNodesEdges, navigateForward, navigateBack, unfocusNodesEdges, updateActiveWalkthrough, focusNodesEdges } from "./assign.js";
12
- import { hotkeyActorLogic } from "./hotkeyActor.js";
13
- import { DiagramToggledFeaturesPersistence } from "./persistence.js";
14
- import { syncManualLayoutActorLogic } from "./syncManualLayoutActor.js";
15
- import { typedSystem, focusedBounds, findDiagramNode } from "./utils.js";
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: {},
@@ -26,6 +28,7 @@ const diagramMachine = setup({
26
28
  overlaysActorLogic
27
29
  },
28
30
  guards: {
31
+ "isReady": ({ context }) => context.initialized.xydata && context.initialized.xyflow,
29
32
  "enabled: FitView": ({ context }) => context.features.enableFitView,
30
33
  "enabled: FocusMode": ({ context }) => context.features.enableFocusMode,
31
34
  "enabled: Readonly": ({ context }) => context.features.enableReadOnly,
@@ -46,9 +49,8 @@ const diagramMachine = setup({
46
49
  return event.node.selected === true;
47
50
  },
48
51
  "click: same node": ({ context, event }) => {
49
- var _a;
50
52
  assertEvent(event, "xyflow.nodeClick");
51
- return ((_a = context.lastClickedNode) == null ? void 0 : _a.id) === event.node.id;
53
+ return context.lastClickedNode?.id === event.node.id;
52
54
  },
53
55
  "click: focused node": ({ context, event }) => {
54
56
  assertEvent(event, "xyflow.nodeClick");
@@ -73,8 +75,7 @@ const diagramMachine = setup({
73
75
  };
74
76
  }),
75
77
  "open source of focused or last clicked node": enqueueActions(({ context, enqueue }) => {
76
- var _a;
77
- const nodeId = context.focusedNode ?? ((_a = context.lastClickedNode) == null ? void 0 : _a.id);
78
+ const nodeId = context.focusedNode ?? context.lastClickedNode?.id;
78
79
  if (!nodeId || !context.features.enableVscode) return;
79
80
  const diagramNode = findDiagramNode(context, nodeId);
80
81
  if (!diagramNode) return;
@@ -101,7 +102,7 @@ const diagramMachine = setup({
101
102
  );
102
103
  viewport.x = Math.round(viewport.x);
103
104
  viewport.y = Math.round(viewport.y);
104
- panZoom == null ? void 0 : panZoom.setViewport(viewport, duration > 0 ? { duration } : void 0);
105
+ panZoom?.setViewport(viewport, duration > 0 ? { duration } : void 0);
105
106
  },
106
107
  "xyflow:fitFocusedBounds": ({ context }) => {
107
108
  const { bounds, duration = 450 } = focusedBounds({ context });
@@ -117,7 +118,7 @@ const diagramMachine = setup({
117
118
  );
118
119
  viewport.x = Math.round(viewport.x);
119
120
  viewport.y = Math.round(viewport.y);
120
- panZoom == null ? void 0 : panZoom.setViewport(viewport, duration > 0 ? { duration } : void 0);
121
+ panZoom?.setViewport(viewport, duration > 0 ? { duration } : void 0);
121
122
  },
122
123
  "xyflow:setViewportCenter": ({ context }, params) => {
123
124
  const { x, y } = params;
@@ -131,7 +132,7 @@ const diagramMachine = setup({
131
132
  duration = 350
132
133
  } = params;
133
134
  const { panZoom } = context.xystore.getState();
134
- panZoom == null ? void 0 : panZoom.setViewport(viewport, duration > 0 ? { duration } : void 0);
135
+ panZoom?.setViewport(viewport, duration > 0 ? { duration } : void 0);
135
136
  },
136
137
  "xyflow:alignNodeFromToAfterNavigate": ({ context }, params) => {
137
138
  const xyflow = nonNullable(context.xyflow, "xyflow is not initialized");
@@ -160,15 +161,18 @@ const diagramMachine = setup({
160
161
  }
161
162
  const constraints = createLayoutConstraints(xystore, nodesToAlign);
162
163
  const aligner = getAligner(mode);
163
- constraints.onMove((nodes) => {
164
- aligner.computeLayout(nodes.map(({ node }) => toNodeRect(node)));
165
- nodes.forEach(({ rect, node }) => {
166
- rect.positionAbsolute = {
167
- ...rect.positionAbsolute,
168
- ...aligner.applyPosition(toNodeRect(node))
169
- };
170
- });
171
- });
164
+ const nodes = nodesToAlign.map((id) => ({
165
+ node: nonNullable(nodeLookup.get(id)),
166
+ rect: nonNullable(constraints.rects.get(id))
167
+ }));
168
+ aligner.computeLayout(nodes.map(({ node }) => toNodeRect(node)));
169
+ for (const { rect, node } of nodes) {
170
+ rect.positionAbsolute = {
171
+ ...rect.positionAbsolute,
172
+ ...aligner.applyPosition(toNodeRect(node))
173
+ };
174
+ }
175
+ constraints.updateXYFlowNodes();
172
176
  },
173
177
  "updateFeatures": enqueueActions(({ enqueue, system, event }) => {
174
178
  assertEvent(event, "update.features");
@@ -183,32 +187,86 @@ const diagramMachine = setup({
183
187
  return;
184
188
  }
185
189
  if (!enableOverlays && hasRunning) {
190
+ enqueue.sendTo(hasRunning, {
191
+ type: "close.all"
192
+ });
186
193
  enqueue.stopChild("overlays");
187
194
  }
188
195
  }),
189
- "closeAllOverlays": enqueueActions(({ system, enqueue }) => {
190
- const overlays = typedSystem(system).overlaysActorRef;
191
- if (overlays) {
192
- enqueue.sendTo(overlays, { type: "close.all" });
196
+ "closeAllOverlays": sendTo(
197
+ ({ system }) => typedSystem(system).overlaysActorRef,
198
+ {
199
+ type: "close.all"
193
200
  }
194
- }),
201
+ ),
202
+ "startSyncLayout": assign(({ context, spawn, self }) => ({
203
+ syncLayoutActorRef: spawn("syncManualLayoutActorLogic", {
204
+ id: "syncLayout",
205
+ input: { parent: self, viewId: context.view.id }
206
+ })
207
+ })),
195
208
  "stopSyncLayout": enqueueActions(({ context, enqueue }) => {
196
209
  enqueue.sendTo(context.syncLayoutActorRef, { type: "stop" });
197
210
  enqueue.stopChild(context.syncLayoutActorRef);
198
211
  enqueue.assign({
199
212
  syncLayoutActorRef: null
200
213
  });
214
+ }),
215
+ "onNodeMouseEnter": assign(({ context }, params) => {
216
+ return {
217
+ xynodes: context.xynodes.map((n) => {
218
+ if (n.id === params.node.id) {
219
+ return Base.setHovered(n, true);
220
+ }
221
+ return n;
222
+ })
223
+ };
224
+ }),
225
+ "onNodeMouseLeave": assign(({ context }, params) => {
226
+ return {
227
+ xynodes: context.xynodes.map((n) => {
228
+ if (n.id === params.node.id) {
229
+ return Base.setHovered(n, false);
230
+ }
231
+ return n;
232
+ })
233
+ };
234
+ }),
235
+ "onEdgeMouseEnter": assign(({ context }, params) => {
236
+ return {
237
+ xyedges: context.xyedges.map((e) => {
238
+ if (e.id === params.edge.id) {
239
+ return Base.setHovered(e, true);
240
+ }
241
+ return e;
242
+ })
243
+ };
244
+ }),
245
+ "onEdgeMouseLeave": assign(({ context }, params) => {
246
+ return {
247
+ xyedges: context.xyedges.map((e) => {
248
+ if (e.id === params.edge.id) {
249
+ return Base.setHovered(e, false);
250
+ }
251
+ return e;
252
+ })
253
+ };
201
254
  })
202
255
  }
203
256
  }).createMachine({
204
257
  initial: "initializing",
205
258
  context: ({ input, self, spawn }) => ({
206
259
  ...input,
260
+ xyedges: [],
261
+ xynodes: [],
207
262
  features: { ...AllDisabled },
208
263
  toggledFeatures: DiagramToggledFeaturesPersistence.read() ?? {
209
264
  enableReadOnly: true
210
265
  },
211
- initialized: false,
266
+ initialized: {
267
+ xydata: false,
268
+ xyflow: false
269
+ },
212
270
  viewportChangedManually: false,
213
271
  lastOnNavigate: null,
214
272
  lastClickedNode: null,
@@ -221,10 +279,7 @@ const diagramMachine = setup({
221
279
  },
222
280
  viewport: { x: 0, y: 0, zoom: 1 },
223
281
  xyflow: null,
224
- syncLayoutActorRef: spawn("syncManualLayoutActorLogic", {
225
- id: "syncLayout",
226
- input: { parent: self, viewId: input.view.id }
227
- }),
282
+ syncLayoutActorRef: null,
228
283
  activeWalkthrough: null
229
284
  }),
230
285
  // entry: ({ spawn }) => spawn(layoutActor, { id: 'layout', input: { parent: self } }),
@@ -232,72 +287,190 @@ const diagramMachine = setup({
232
287
  initializing: {
233
288
  on: {
234
289
  "xyflow.init": {
235
- actions: enqueueActions(({ enqueue, check }) => {
236
- enqueue.assign({
237
- initialized: true,
238
- xyflow: ({ event }) => event.instance,
239
- navigationHistory: ({ context, event }) => ({
240
- currentIndex: 0,
241
- history: [{
242
- viewId: context.view.id,
243
- fromNode: null,
244
- viewport: { ...event.instance.getViewport() }
245
- }]
246
- })
247
- });
248
- if (check("enabled: FitView")) {
249
- enqueue({
250
- type: "xyflow:fitDiagram",
251
- params: { duration: 0 }
252
- });
253
- }
254
- }),
255
- target: "idle"
290
+ actions: assign(({ context, event }) => ({
291
+ initialized: {
292
+ ...context.initialized,
293
+ xyflow: true
294
+ },
295
+ xyflow: event.instance
296
+ })),
297
+ target: "isReady"
298
+ },
299
+ "update.view": {
300
+ actions: assign(({ context, event, spawn, self }) => ({
301
+ initialized: {
302
+ ...context.initialized,
303
+ xydata: true
304
+ },
305
+ view: event.view,
306
+ xynodes: event.xynodes,
307
+ xyedges: event.xyedges
308
+ })),
309
+ target: "isReady"
256
310
  }
257
311
  }
258
312
  },
259
- idle: {
260
- id: "idle",
261
- on: {
262
- "xyflow.nodeClick": [
313
+ "isReady": {
314
+ always: [{
315
+ guard: "isReady",
316
+ actions: [
263
317
  {
264
- // TODO: xstate fails to infer the type of the guard
265
- guard: and([
266
- "enabled: FocusMode",
267
- "click: node has connections",
268
- or([
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"
318
+ type: "xyflow:fitDiagram",
319
+ params: { duration: 0 }
280
320
  },
281
- {
282
- actions: [
283
- "assign lastClickedNode",
284
- "open source of focused or last clicked node"
285
- ]
286
- }
321
+ "startSyncLayout",
322
+ assign(({ context }) => ({
323
+ navigationHistory: {
324
+ currentIndex: 0,
325
+ history: [{
326
+ viewId: context.view.id,
327
+ fromNode: null,
328
+ viewport: { ...context.xyflow.getViewport() }
329
+ }]
330
+ }
331
+ }))
287
332
  ],
288
- "xyflow.paneClick": {
289
- actions: [
290
- assign({
291
- lastClickedNode: null
333
+ target: "ready"
334
+ }, {
335
+ target: "initializing"
336
+ }]
337
+ },
338
+ ready: {
339
+ initial: "idle",
340
+ on: {
341
+ "navigate.to": {
342
+ guard: "is another view",
343
+ actions: assign({
344
+ lastOnNavigate: ({ context, event }) => ({
345
+ fromView: context.view.id,
346
+ toView: event.viewId,
347
+ fromNode: event.fromNode ?? null
292
348
  })
349
+ }),
350
+ target: "#navigating"
351
+ },
352
+ "navigate.back": {
353
+ guard: ({ context }) => context.navigationHistory.currentIndex > 0,
354
+ actions: assign(navigateBack),
355
+ target: "#navigating"
356
+ },
357
+ "navigate.forward": {
358
+ guard: ({ context }) => context.navigationHistory.currentIndex < context.navigationHistory.history.length - 1,
359
+ actions: assign(navigateForward),
360
+ target: "#navigating"
361
+ },
362
+ "layout.align": {
363
+ guard: "not readonly",
364
+ actions: [
365
+ {
366
+ type: "layout.align",
367
+ params: ({ event }) => ({ mode: event.mode })
368
+ },
369
+ raise({ type: "saveManualLayout.schedule" })
370
+ ]
371
+ },
372
+ "layout.resetEdgeControlPoints": {
373
+ guard: "not readonly",
374
+ actions: [
375
+ assign(resetEdgeControlPoints),
376
+ raise({ type: "saveManualLayout.schedule" })
293
377
  ]
294
378
  },
295
- "xyflow.paneDblClick": {
379
+ "xyflow.resized": {
380
+ guard: ({ context }) => context.features.enableFitView && !context.viewportChangedManually,
296
381
  actions: [
297
- { type: "xyflow:fitDiagram" },
298
- { type: "trigger:OpenSource", params: ({ context }) => ({ view: context.view.id }) }
382
+ cancel("fitDiagram"),
383
+ raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 200 })
299
384
  ]
300
385
  },
386
+ "open.elementDetails": {
387
+ actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => {
388
+ let initiatedFrom = null;
389
+ const fromNodeId = event.fromNode ?? context.view.nodes.find((n) => DiagramNode.modelRef(n) === event.fqn)?.id;
390
+ const internalNode = fromNodeId ? context.xystore.getState().nodeLookup.get(fromNodeId) : null;
391
+ if (fromNodeId && internalNode) {
392
+ const nodeRect = nodeToRect(internalNode);
393
+ const zoom = context.xyflow.getZoom();
394
+ const clientRect = {
395
+ ...context.xyflow.flowToScreenPosition(nodeRect),
396
+ width: nodeRect.width * zoom,
397
+ height: nodeRect.height * zoom
398
+ };
399
+ initiatedFrom = {
400
+ node: fromNodeId,
401
+ clientRect
402
+ };
403
+ }
404
+ return {
405
+ type: "open.elementDetails",
406
+ subject: event.fqn,
407
+ currentView: context.view,
408
+ ...initiatedFrom && { initiatedFrom }
409
+ };
410
+ })
411
+ },
412
+ "open.relationshipsBrowser": {
413
+ actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => ({
414
+ type: "open.relationshipsBrowser",
415
+ subject: event.fqn,
416
+ viewId: context.view.id,
417
+ scope: "view",
418
+ closeable: true,
419
+ enableChangeScope: true,
420
+ enableSelectSubject: true
421
+ }))
422
+ },
423
+ "open.relationshipDetails": {
424
+ actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => ({
425
+ type: "open.relationshipDetails",
426
+ view: context.view,
427
+ edgeId: event.edgeId
428
+ }))
429
+ },
430
+ "open.source": {
431
+ actions: {
432
+ type: "trigger:OpenSource",
433
+ params: prop("event")
434
+ }
435
+ },
436
+ "walkthrough.start": {
437
+ guard: "is dynamic view",
438
+ target: ".walkthrough"
439
+ },
440
+ "toggle.feature": {
441
+ actions: assign({
442
+ toggledFeatures: ({ context, event }) => {
443
+ return DiagramToggledFeaturesPersistence.write({
444
+ ...context.toggledFeatures,
445
+ [`enable${event.feature}`]: event.forceValue ?? !(context.toggledFeatures[`enable${event.feature}`] ?? context.features[`enable${event.feature}`])
446
+ });
447
+ }
448
+ })
449
+ },
450
+ "xyflow.nodeMouseEnter": {
451
+ actions: {
452
+ type: "onNodeMouseEnter",
453
+ params: prop("event")
454
+ }
455
+ },
456
+ "xyflow.nodeMouseLeave": {
457
+ actions: {
458
+ type: "onNodeMouseLeave",
459
+ params: prop("event")
460
+ }
461
+ },
462
+ "xyflow.edgeMouseEnter": {
463
+ actions: {
464
+ type: "onEdgeMouseEnter",
465
+ params: prop("event")
466
+ }
467
+ },
468
+ "xyflow.edgeMouseLeave": {
469
+ actions: {
470
+ type: "onEdgeMouseLeave",
471
+ params: prop("event")
472
+ }
473
+ },
301
474
  "saveManualLayout.*": {
302
475
  guard: "not readonly",
303
476
  actions: sendTo((c) => c.context.syncLayoutActorRef, ({ event }) => {
@@ -309,92 +482,206 @@ const diagramMachine = setup({
309
482
  }
310
483
  nonexhaustive(event);
311
484
  })
312
- },
313
- "focus.node": {
314
- guard: "enabled: FocusMode",
315
- actions: assign({
316
- focusedNode: ({ event }) => event.nodeId
317
- }),
318
- target: "focused"
319
485
  }
320
- }
321
- },
322
- focused: {
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"
486
+ },
487
+ exit: [
488
+ cancel("fitDiagram")
331
489
  ],
332
- exit: enqueueActions(({ enqueue, context }) => {
333
- enqueue.stopChild("hotkey");
334
- if (context.viewportBeforeFocus) {
335
- enqueue({ type: "xyflow:setViewport", params: { viewport: context.viewportBeforeFocus } });
336
- } else {
337
- enqueue({ type: "xyflow:fitDiagram" });
338
- }
339
- enqueue.assign((s) => ({
340
- ...unfocusNodesEdges(s),
341
- viewportBeforeFocus: null,
342
- focusedNode: null
343
- }));
344
- }),
345
- on: {
346
- "xyflow.nodeClick": [
347
- {
348
- guard: "click: focused node",
349
- target: "#idle"
350
- },
351
- {
352
- actions: [
353
- assign({
354
- lastClickedNode
490
+ states: {
491
+ idle: {
492
+ id: "idle",
493
+ on: {
494
+ "xyflow.nodeClick": [
495
+ {
496
+ // TODO: xstate fails to infer the type of the guard
497
+ guard: and([
498
+ "enabled: FocusMode",
499
+ "click: node has connections",
500
+ or([
501
+ "click: same node",
502
+ "click: selected node"
503
+ ])
504
+ ]),
505
+ actions: [
506
+ assign({
507
+ lastClickedNode,
508
+ focusedNode: ({ event }) => event.node.id
509
+ })
510
+ ],
511
+ target: "focused"
512
+ },
513
+ {
514
+ actions: [
515
+ "assign lastClickedNode",
516
+ "open source of focused or last clicked node"
517
+ ]
518
+ }
519
+ ],
520
+ "xyflow.paneClick": {
521
+ actions: [
522
+ assign({
523
+ lastClickedNode: null
524
+ })
525
+ ]
526
+ },
527
+ "xyflow.paneDblClick": {
528
+ actions: [
529
+ { type: "xyflow:fitDiagram" },
530
+ { type: "trigger:OpenSource", params: ({ context }) => ({ view: context.view.id }) }
531
+ ]
532
+ },
533
+ "focus.node": {
534
+ guard: "enabled: FocusMode",
535
+ actions: assign({
536
+ focusedNode: ({ event }) => event.nodeId
355
537
  }),
356
- raise(({ event }) => ({
357
- type: "focus.node",
358
- nodeId: event.node.id
359
- }))
360
- ]
538
+ target: "focused"
539
+ }
361
540
  }
362
- ],
363
- "focus.node": {
364
- actions: [
365
- assign({
366
- focusedNode: ({ event }) => event.nodeId
367
- }),
368
- assign(focusNodesEdges),
541
+ },
542
+ focused: {
543
+ entry: [
544
+ assign((s) => ({
545
+ ...focusNodesEdges(s),
546
+ viewportBeforeFocus: { ...s.context.viewport }
547
+ })),
369
548
  "open source of focused or last clicked node",
549
+ spawnChild("hotkeyActorLogic", { id: "hotkey" }),
370
550
  "xyflow:fitFocusedBounds"
371
- ]
372
- },
373
- "key.esc": {
374
- target: "idle"
375
- },
376
- "xyflow.paneClick": {
377
- actions: assign({
378
- lastClickedNode: null
551
+ ],
552
+ exit: enqueueActions(({ enqueue, context }) => {
553
+ enqueue.stopChild("hotkey");
554
+ if (context.viewportBeforeFocus) {
555
+ enqueue({ type: "xyflow:setViewport", params: { viewport: context.viewportBeforeFocus } });
556
+ } else {
557
+ enqueue({ type: "xyflow:fitDiagram" });
558
+ }
559
+ enqueue.assign((s) => ({
560
+ ...unfocusNodesEdges(s),
561
+ viewportBeforeFocus: null,
562
+ focusedNode: null
563
+ }));
379
564
  }),
380
- target: "idle"
565
+ on: {
566
+ "xyflow.nodeClick": [
567
+ {
568
+ guard: "click: focused node",
569
+ target: "#idle"
570
+ },
571
+ {
572
+ actions: [
573
+ assign({
574
+ lastClickedNode
575
+ }),
576
+ raise(({ event }) => ({
577
+ type: "focus.node",
578
+ nodeId: event.node.id
579
+ }))
580
+ ]
581
+ }
582
+ ],
583
+ "focus.node": {
584
+ actions: [
585
+ assign({
586
+ focusedNode: ({ event }) => event.nodeId
587
+ }),
588
+ assign(focusNodesEdges),
589
+ "open source of focused or last clicked node",
590
+ "xyflow:fitFocusedBounds"
591
+ ]
592
+ },
593
+ "key.esc": {
594
+ target: "idle"
595
+ },
596
+ "xyflow.paneClick": {
597
+ actions: assign({
598
+ lastClickedNode: null
599
+ }),
600
+ target: "idle"
601
+ }
602
+ }
381
603
  },
382
- "saveManualLayout.*": {
383
- guard: "not readonly",
384
- actions: sendTo((c) => c.context.syncLayoutActorRef, ({ event }) => {
385
- if (event.type === "saveManualLayout.schedule") {
386
- return { type: "sync" };
604
+ walkthrough: {
605
+ entry: [
606
+ spawnChild("hotkeyActorLogic", { id: "hotkey" }),
607
+ assign({
608
+ viewportBeforeFocus: ({ context }) => context.viewport,
609
+ activeWalkthrough: ({ context, event }) => {
610
+ assertEvent(event, "walkthrough.start");
611
+ const stepId = event.stepId ?? first(context.xyedges).id;
612
+ return {
613
+ stepId,
614
+ parallelPrefix: getParallelStepsPrefix(stepId)
615
+ };
616
+ }
617
+ }),
618
+ assign(updateActiveWalkthrough),
619
+ "xyflow:fitFocusedBounds"
620
+ ],
621
+ on: {
622
+ "key.esc": {
623
+ target: "idle"
624
+ },
625
+ "key.arrow.left": {
626
+ actions: raise({ type: "walkthrough.step", direction: "previous" })
627
+ },
628
+ "key.arrow.right": {
629
+ actions: raise({ type: "walkthrough.step", direction: "next" })
630
+ },
631
+ "walkthrough.step": {
632
+ actions: enqueueActions(({ enqueue, context, event }) => {
633
+ const { stepId } = context.activeWalkthrough;
634
+ const stepIndex = context.xyedges.findIndex((e) => e.id === stepId);
635
+ const nextStepIndex = clamp(event.direction === "next" ? stepIndex + 1 : stepIndex - 1, {
636
+ min: 0,
637
+ max: context.xyedges.length - 1
638
+ });
639
+ if (nextStepIndex === stepIndex) {
640
+ return;
641
+ }
642
+ const nextStepId = context.xyedges[nextStepIndex].id;
643
+ enqueue.assign({
644
+ activeWalkthrough: {
645
+ stepId: nextStepId,
646
+ parallelPrefix: getParallelStepsPrefix(nextStepId)
647
+ }
648
+ });
649
+ enqueue.assign(updateActiveWalkthrough);
650
+ enqueue("xyflow:fitFocusedBounds");
651
+ })
652
+ },
653
+ "walkthrough.end": {
654
+ target: "idle"
655
+ },
656
+ "xyflow.paneDblClick": {
657
+ target: "idle"
658
+ },
659
+ // We received another view, close overlay and process event again
660
+ "update.view": {
661
+ guard: "is another view",
662
+ actions: raise(({ event }) => event, { delay: 50 }),
663
+ target: "idle"
387
664
  }
388
- if (event.type === "saveManualLayout.cancel") {
389
- return { type: "cancel" };
665
+ },
666
+ exit: enqueueActions(({ enqueue, context, event }) => {
667
+ enqueue.stopChild("hotkey");
668
+ if (context.viewportBeforeFocus) {
669
+ enqueue({ type: "xyflow:setViewport", params: { viewport: context.viewportBeforeFocus } });
670
+ } else {
671
+ enqueue({ type: "xyflow:fitDiagram" });
390
672
  }
391
- nonexhaustive(event);
673
+ enqueue.assign({
674
+ activeWalkthrough: null,
675
+ ...unfocusNodesEdges({ context}),
676
+ viewportBeforeFocus: null
677
+ });
392
678
  })
393
679
  }
394
680
  }
395
681
  },
396
682
  // Navigating to another view (after `navigateTo` event)
397
683
  navigating: {
684
+ id: "navigating",
398
685
  entry: [
399
686
  "closeAllOverlays",
400
687
  "stopSyncLayout",
@@ -405,14 +692,6 @@ const diagramMachine = setup({
405
692
  })
406
693
  }
407
694
  ],
408
- exit: assign({
409
- syncLayoutActorRef: ({ self, context, spawn }) => spawn("syncManualLayoutActorLogic", {
410
- id: "syncLayout",
411
- systemId: "syncLayout",
412
- input: { parent: self, viewId: context.view.id }
413
- })
414
- // lastOnNavigate: null,
415
- }),
416
695
  on: {
417
696
  "update.view": {
418
697
  actions: enqueueActions(({ enqueue, context, event }) => {
@@ -437,90 +716,15 @@ const diagramMachine = setup({
437
716
  enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 25 });
438
717
  }
439
718
  enqueue.assign(updateNavigationHistory);
440
- enqueue.assign(mergeXYNodesEdges);
441
719
  enqueue.assign({
720
+ ...mergeXYNodesEdges({ context, event }),
442
721
  lastOnNavigate: null
443
722
  });
723
+ enqueue("startSyncLayout");
444
724
  }),
445
725
  target: "#idle"
446
726
  }
447
727
  }
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
728
  }
525
729
  },
526
730
  on: {
@@ -547,26 +751,11 @@ const diagramMachine = setup({
547
751
  params: prop("event")
548
752
  }
549
753
  },
550
- "navigate.to": {
551
- guard: "is another view",
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"
754
+ "update.nodeData": {
755
+ actions: assign(updateNodeData)
565
756
  },
566
- "navigate.forward": {
567
- guard: ({ context }) => context.navigationHistory.currentIndex < context.navigationHistory.history.length - 1,
568
- actions: assign(navigateForward),
569
- target: ".navigating"
757
+ "update.edgeData": {
758
+ actions: assign(updateEdgeData)
570
759
  },
571
760
  "update.view": {
572
761
  actions: [
@@ -574,15 +763,10 @@ const diagramMachine = setup({
574
763
  enqueueActions(({ enqueue, event, check, context }) => {
575
764
  const isAnotherView = check("is another view");
576
765
  if (isAnotherView) {
577
- const viewId = event.view.id;
578
766
  enqueue("closeAllOverlays");
579
767
  enqueue("stopSyncLayout");
580
768
  enqueue.assign({
581
- focusedNode: null,
582
- syncLayoutActorRef: ({ self, spawn }) => spawn("syncManualLayoutActorLogic", {
583
- id: "syncLayout",
584
- input: { parent: self, viewId }
585
- })
769
+ focusedNode: null
586
770
  });
587
771
  const { fromNode, toNode } = findCorrespondingNode(context, event);
588
772
  if (fromNode && toNode) {
@@ -604,16 +788,19 @@ const diagramMachine = setup({
604
788
  });
605
789
  enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 25 });
606
790
  }
791
+ }
792
+ enqueue.assign({
793
+ ...mergeXYNodesEdges({ context, event }),
794
+ lastOnNavigate: null
795
+ });
796
+ if (isAnotherView) {
797
+ enqueue("startSyncLayout");
607
798
  } else {
608
799
  enqueue.sendTo((c) => c.context.syncLayoutActorRef, { type: "synced" });
609
800
  if (!context.viewportChangedManually) {
610
801
  enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 50 });
611
802
  }
612
803
  }
613
- enqueue.assign(mergeXYNodesEdges);
614
- enqueue.assign({
615
- lastOnNavigate: null
616
- });
617
804
  })
618
805
  ]
619
806
  },
@@ -622,119 +809,32 @@ const diagramMachine = setup({
622
809
  },
623
810
  "update.features": {
624
811
  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
812
  }
717
813
  },
718
814
  exit: [
719
815
  "stopSyncLayout",
816
+ cancel("fitDiagram"),
720
817
  stopChild("hotkey"),
721
818
  assign({
722
819
  xyflow: null,
723
820
  xystore: null,
724
- initialized: false,
821
+ xyedges: [],
822
+ xynodes: [],
823
+ initialized: {
824
+ xydata: false,
825
+ xyflow: false
826
+ },
725
827
  syncLayoutActorRef: null
726
828
  })
727
829
  ]
728
830
  });
729
831
  const nodeRef = (node) => DiagramNode.modelRef(node) ?? DiagramNode.deploymentRef(node);
730
832
  function findCorrespondingNode(context, event) {
731
- var _a;
732
- const fromNodeId = (_a = context.lastOnNavigate) == null ? void 0 : _a.fromNode;
833
+ const fromNodeId = context.lastOnNavigate?.fromNode;
733
834
  const fromNode = fromNodeId && context.view.nodes.find((n) => n.id === fromNodeId);
734
835
  const fromRef = fromNode && nodeRef(fromNode);
735
836
  const toNode = fromRef && event.view.nodes.find((n) => nodeRef(n) === fromRef);
736
837
  return { fromNode, toNode };
737
838
  }
738
- export {
739
- diagramMachine
740
- };
839
+
840
+ export { diagramMachine };