@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,10 +1,11 @@
1
- import "@likec4/core";
2
- import { useCallbackRef } from "@mantine/hooks";
3
- import { useSelector } from "@xstate/react";
4
- import { shallowEqual } from "fast-equals";
5
- import { useTransition, useMemo } from "react";
6
- import { findDiagramEdge, findDiagramNode } from "../state/utils.js";
7
- import { useDiagramActorRef } from "./safeContext.js";
1
+ import '@likec4/core';
2
+ import { useCallbackRef } from '@mantine/hooks';
3
+ import { useSelector } from '@xstate/react';
4
+ import { shallowEqual } from 'fast-equals';
5
+ import { useTransition, useMemo } from 'react';
6
+ import { findDiagramEdge, findDiagramNode } from '../state/utils.js';
7
+ import { useDiagramActorRef } from './safeContext.js';
8
+
8
9
  function useDiagram() {
9
10
  const actor = useDiagramActorRef();
10
11
  const [, startTransition] = useTransition();
@@ -66,8 +67,7 @@ function useDiagram() {
66
67
  * @returns true if there was pending request to save layout
67
68
  */
68
69
  cancelSaveManualLayout: () => {
69
- var _a;
70
- const syncState = (_a = actor.getSnapshot().children.syncLayout) == null ? void 0 : _a.getSnapshot().value;
70
+ const syncState = actor.getSnapshot().children.syncLayout?.getSnapshot().value;
71
71
  actor.send({ type: "saveManualLayout.cancel" });
72
72
  return syncState === "pending" || syncState === "paused";
73
73
  },
@@ -129,12 +129,8 @@ function useDiagramSyncLayoutState(selector, compare = shallowEqual) {
129
129
  return useSelector(syncLayoutActorRef, useCallbackRef(selector), compare);
130
130
  }
131
131
  function useDiagramContext(selector, compare = shallowEqual) {
132
- return useDiagramActorSnapshot(useCallbackRef((s) => selector(s.context)), compare);
132
+ const actorRef = useDiagramActorRef();
133
+ return useSelector(actorRef, useCallbackRef((s) => selector(s.context)), compare);
133
134
  }
134
- export {
135
- useDiagram,
136
- useDiagramActorRef,
137
- useDiagramActorSnapshot,
138
- useDiagramContext,
139
- useDiagramSyncLayoutState
140
- };
135
+
136
+ export { useDiagram, useDiagramActorRef, useDiagramActorSnapshot, useDiagramContext, useDiagramSyncLayoutState };
@@ -1,9 +1,9 @@
1
- import { useMemo } from "react";
2
- import { useRootContainer } from "../context/RootContainer.js";
1
+ import { useMemo } from 'react';
2
+ import { useRootContainer } from '../context/RootContainer.js';
3
+
3
4
  function useMantinePortalProps() {
4
5
  const target = useRootContainer();
5
6
  return useMemo(() => target ? { portalProps: { target }, withinPortal: true } : { withinPortal: false }, [target]);
6
7
  }
7
- export {
8
- useMantinePortalProps
9
- };
8
+
9
+ export { useMantinePortalProps };
@@ -0,0 +1,2 @@
1
+ import { OverlaysActorRef } from '../overlays/overlaysActor';
2
+ export declare function useOverlaysActorRef(): OverlaysActorRef;
@@ -0,0 +1,10 @@
1
+ import { useDiagramActorSnapshot } from './useDiagram.js';
2
+
3
+ const select = (s) => {
4
+ return s.children.overlays;
5
+ };
6
+ function useOverlaysActorRef() {
7
+ return useDiagramActorSnapshot(select, Object.is);
8
+ }
9
+
10
+ export { useOverlaysActorRef };
@@ -1 +1 @@
1
- export { useIsReducedGraphics, useLooseReducedGraphics } from '../context/ReduceGraphics';
1
+ export { useIsPanning, useIsReducedGraphics } from '../context/ReduceGraphics';
@@ -1,5 +1,6 @@
1
- import { shallowEqual } from "fast-equals";
2
- import { useState, useCallback } from "react";
1
+ import { shallowEqual } from 'fast-equals';
2
+ import { useState, useCallback } from 'react';
3
+
3
4
  function useSetState(initialState) {
4
5
  const [state, _setState] = useState(initialState);
5
6
  const setState = useCallback(
@@ -14,6 +15,5 @@ function useSetState(initialState) {
14
15
  );
15
16
  return [state, setState];
16
17
  }
17
- export {
18
- useSetState
19
- };
18
+
19
+ export { useSetState };
@@ -1,6 +1,7 @@
1
- import { useFirstMountState, useCustomCompareEffect } from "@react-hookz/web";
2
- import { shallowEqual } from "fast-equals";
3
- import "react";
1
+ import { useFirstMountState, useCustomCompareEffect } from '@react-hookz/web';
2
+ import { shallowEqual } from 'fast-equals';
3
+ import 'react';
4
+
4
5
  const noop = () => {
5
6
  };
6
7
  const depsShallowEqual = (d1, d2) => {
@@ -26,7 +27,5 @@ function useUpdateEffect(callback, deps, equalityFn, effectHook) {
26
27
  effectHook
27
28
  );
28
29
  }
29
- export {
30
- depsShallowEqual,
31
- useUpdateEffect
32
- };
30
+
31
+ export { depsShallowEqual, useUpdateEffect };
@@ -2,7 +2,7 @@ import { ReactFlowState, ReactFlowInstance, InternalNode } from '@xyflow/react';
2
2
  import { Types } from '../likec4diagram/types';
3
3
  import { EdgeMarkerType, HandleType, XYPosition } from '@xyflow/system';
4
4
  import { ReactNode, CSSProperties } from 'react';
5
- import { EdgeId, NonEmptyArray, Point, Color, ViewId, RelationshipArrowType, RelationshipLineType, BBox } from '@likec4/core';
5
+ import { EdgeId, NonEmptyArray, Point, Color, BBox, RelationshipLineType, RelationshipArrowType, ViewId } from '@likec4/core';
6
6
  export declare const useXYFlow: () => ReactFlowInstance<Types.Node, {
7
7
  id: string;
8
8
  source: string;
@@ -36,13 +36,13 @@ export declare const useXYFlow: () => ReactFlowInstance<Types.Node, {
36
36
  points: NonEmptyArray<Point>;
37
37
  technology: string | undefined;
38
38
  color: Color | undefined;
39
- navigateTo: ViewId<string> | undefined;
39
+ labelBBox: BBox | null | undefined;
40
40
  dir: "forward" | "back" | "both" | undefined;
41
+ line: RelationshipLineType | undefined;
41
42
  head: RelationshipArrowType | undefined;
42
43
  tail: RelationshipArrowType | undefined;
43
- line: RelationshipLineType | undefined;
44
+ navigateTo: ViewId<string> | undefined;
44
45
  notes: string | undefined;
45
- labelBBox: BBox | null | undefined;
46
46
  labelXY: XYPosition | null;
47
47
  controlPoints: XYPosition[] | undefined | null;
48
48
  hovered?: boolean;
@@ -85,13 +85,13 @@ export declare const useXYStoreApi: () => {
85
85
  points: NonEmptyArray<Point>;
86
86
  technology: string | undefined;
87
87
  color: Color | undefined;
88
- navigateTo: ViewId<string> | undefined;
88
+ labelBBox: BBox | null | undefined;
89
89
  dir: "forward" | "back" | "both" | undefined;
90
+ line: RelationshipLineType | undefined;
90
91
  head: RelationshipArrowType | undefined;
91
92
  tail: RelationshipArrowType | undefined;
92
- line: RelationshipLineType | undefined;
93
+ navigateTo: ViewId<string> | undefined;
93
94
  notes: string | undefined;
94
- labelBBox: BBox | null | undefined;
95
95
  labelXY: XYPosition | null;
96
96
  controlPoints: XYPosition[] | undefined | null;
97
97
  hovered?: boolean;
@@ -132,13 +132,13 @@ export declare const useXYStoreApi: () => {
132
132
  points: NonEmptyArray<Point>;
133
133
  technology: string | undefined;
134
134
  color: Color | undefined;
135
- navigateTo: ViewId<string> | undefined;
135
+ labelBBox: BBox | null | undefined;
136
136
  dir: "forward" | "back" | "both" | undefined;
137
+ line: RelationshipLineType | undefined;
137
138
  head: RelationshipArrowType | undefined;
138
139
  tail: RelationshipArrowType | undefined;
139
- line: RelationshipLineType | undefined;
140
+ navigateTo: ViewId<string> | undefined;
140
141
  notes: string | undefined;
141
- labelBBox: BBox | null | undefined;
142
142
  labelXY: XYPosition | null;
143
143
  controlPoints: XYPosition[] | undefined | null;
144
144
  hovered?: boolean;
@@ -178,13 +178,13 @@ export declare const useXYStoreApi: () => {
178
178
  points: NonEmptyArray<Point>;
179
179
  technology: string | undefined;
180
180
  color: Color | undefined;
181
- navigateTo: ViewId<string> | undefined;
181
+ labelBBox: BBox | null | undefined;
182
182
  dir: "forward" | "back" | "both" | undefined;
183
+ line: RelationshipLineType | undefined;
183
184
  head: RelationshipArrowType | undefined;
184
185
  tail: RelationshipArrowType | undefined;
185
- line: RelationshipLineType | undefined;
186
+ navigateTo: ViewId<string> | undefined;
186
187
  notes: string | undefined;
187
- labelBBox: BBox | null | undefined;
188
188
  labelXY: XYPosition | null;
189
189
  controlPoints: XYPosition[] | undefined | null;
190
190
  hovered?: boolean;
@@ -224,13 +224,13 @@ export declare const useXYStoreApi: () => {
224
224
  points: NonEmptyArray<Point>;
225
225
  technology: string | undefined;
226
226
  color: Color | undefined;
227
- navigateTo: ViewId<string> | undefined;
227
+ labelBBox: BBox | null | undefined;
228
228
  dir: "forward" | "back" | "both" | undefined;
229
+ line: RelationshipLineType | undefined;
229
230
  head: RelationshipArrowType | undefined;
230
231
  tail: RelationshipArrowType | undefined;
231
- line: RelationshipLineType | undefined;
232
+ navigateTo: ViewId<string> | undefined;
232
233
  notes: string | undefined;
233
- labelBBox: BBox | null | undefined;
234
234
  labelXY: XYPosition | null;
235
235
  controlPoints: XYPosition[] | undefined | null;
236
236
  hovered?: boolean;
@@ -270,13 +270,13 @@ export declare const useXYStoreApi: () => {
270
270
  points: NonEmptyArray<Point>;
271
271
  technology: string | undefined;
272
272
  color: Color | undefined;
273
- navigateTo: ViewId<string> | undefined;
273
+ labelBBox: BBox | null | undefined;
274
274
  dir: "forward" | "back" | "both" | undefined;
275
+ line: RelationshipLineType | undefined;
275
276
  head: RelationshipArrowType | undefined;
276
277
  tail: RelationshipArrowType | undefined;
277
- line: RelationshipLineType | undefined;
278
+ navigateTo: ViewId<string> | undefined;
278
279
  notes: string | undefined;
279
- labelBBox: BBox | null | undefined;
280
280
  labelXY: XYPosition | null;
281
281
  controlPoints: XYPosition[] | undefined | null;
282
282
  hovered?: boolean;
@@ -316,13 +316,13 @@ export declare const useXYStoreApi: () => {
316
316
  points: NonEmptyArray<Point>;
317
317
  technology: string | undefined;
318
318
  color: Color | undefined;
319
- navigateTo: ViewId<string> | undefined;
319
+ labelBBox: BBox | null | undefined;
320
320
  dir: "forward" | "back" | "both" | undefined;
321
+ line: RelationshipLineType | undefined;
321
322
  head: RelationshipArrowType | undefined;
322
323
  tail: RelationshipArrowType | undefined;
323
- line: RelationshipLineType | undefined;
324
+ navigateTo: ViewId<string> | undefined;
324
325
  notes: string | undefined;
325
- labelBBox: BBox | null | undefined;
326
326
  labelXY: XYPosition | null;
327
327
  controlPoints: XYPosition[] | undefined | null;
328
328
  hovered?: boolean;
@@ -363,13 +363,13 @@ export declare const useXYStoreApi: () => {
363
363
  points: NonEmptyArray<Point>;
364
364
  technology: string | undefined;
365
365
  color: Color | undefined;
366
- navigateTo: ViewId<string> | undefined;
366
+ labelBBox: BBox | null | undefined;
367
367
  dir: "forward" | "back" | "both" | undefined;
368
+ line: RelationshipLineType | undefined;
368
369
  head: RelationshipArrowType | undefined;
369
370
  tail: RelationshipArrowType | undefined;
370
- line: RelationshipLineType | undefined;
371
+ navigateTo: ViewId<string> | undefined;
371
372
  notes: string | undefined;
372
- labelBBox: BBox | null | undefined;
373
373
  labelXY: XYPosition | null;
374
374
  controlPoints: XYPosition[] | undefined | null;
375
375
  hovered?: boolean;
@@ -409,13 +409,13 @@ export declare const useXYStoreApi: () => {
409
409
  points: NonEmptyArray<Point>;
410
410
  technology: string | undefined;
411
411
  color: Color | undefined;
412
- navigateTo: ViewId<string> | undefined;
412
+ labelBBox: BBox | null | undefined;
413
413
  dir: "forward" | "back" | "both" | undefined;
414
+ line: RelationshipLineType | undefined;
414
415
  head: RelationshipArrowType | undefined;
415
416
  tail: RelationshipArrowType | undefined;
416
- line: RelationshipLineType | undefined;
417
+ navigateTo: ViewId<string> | undefined;
417
418
  notes: string | undefined;
418
- labelBBox: BBox | null | undefined;
419
419
  labelXY: XYPosition | null;
420
420
  controlPoints: XYPosition[] | undefined | null;
421
421
  hovered?: boolean;
@@ -1,6 +1,7 @@
1
- import { useCallbackRef } from "@mantine/hooks";
2
- import { useStoreApi, useStore, useReactFlow, useInternalNode } from "@xyflow/react";
3
- import { shallowEqual } from "fast-equals";
1
+ import { useCallbackRef } from '@mantine/hooks';
2
+ import { useStoreApi, useStore, useReactFlow, useInternalNode } from '@xyflow/react';
3
+ import { shallowEqual } from 'fast-equals';
4
+
4
5
  const useXYFlow = useReactFlow;
5
6
  function useXYStore(selector, equalityFn) {
6
7
  return useStore(
@@ -10,14 +11,9 @@ function useXYStore(selector, equalityFn) {
10
11
  }
11
12
  const useXYStoreApi = useStoreApi;
12
13
  const useXYInternalNode = useInternalNode;
13
- const selectZoom = (state) => state.transform[2] < 0.25;
14
+ const selectZoom = (state) => state.transform[2] < 0.2;
14
15
  function useIsZoomTooSmall() {
15
16
  return useStore(selectZoom);
16
17
  }
17
- export {
18
- useIsZoomTooSmall,
19
- useXYFlow,
20
- useXYInternalNode,
21
- useXYStore,
22
- useXYStoreApi
23
- };
18
+
19
+ export { useIsZoomTooSmall, useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi };
package/dist/index.d.ts CHANGED
@@ -8,7 +8,6 @@ export { useLikeC4ElementsTree, useLikeC4Model, } from './likec4model';
8
8
  export { LikeC4ModelProvider } from './LikeC4ModelProvider';
9
9
  export { useSetState } from './hooks/useSetState';
10
10
  export { useUpdateEffect } from './hooks/useUpdateEffect';
11
- export { vars, xyvars } from './theme-vars';
12
11
  export type { ChangeEvent, DiagramNodeWithNavigate, ElementIconRenderer, LikeC4ColorScheme, LikeC4DiagramEventHandlers, LikeC4DiagramProperties, OnCanvasClick, OnChange, OnEdgeClick, OnNavigateTo, OnNodeClick, OpenSourceParams, WhereOperator, } from './LikeC4Diagram.props';
13
12
  export { StaticLikeC4Diagram } from './StaticLikeC4Diagram';
14
13
  export type { StaticLikeC4DiagramProps } from './StaticLikeC4Diagram';
package/dist/index.js CHANGED
@@ -1,26 +1,10 @@
1
- /* empty css */
2
- import { FramerMotionConfig } from "./context/FramerMotionConfig.js";
3
- import { IconRendererProvider } from "./context/IconRenderer.js";
4
- import { LikeC4Diagram } from "./LikeC4Diagram.js";
5
- import { Overlay } from "./overlays/overlay/Overlay.js";
6
- import { LikeC4ModelProvider } from "./LikeC4ModelProvider.js";
7
- import { useSetState } from "./hooks/useSetState.js";
8
- import { useUpdateEffect } from "./hooks/useUpdateEffect.js";
9
- import { StaticLikeC4Diagram } from "./StaticLikeC4Diagram.js";
10
- import { useLikeC4ElementsTree } from "./likec4model/useLikeC4ElementsTree.js";
11
- import { useLikeC4Model } from "./likec4model/useLikeC4Model.js";
12
- import { vars, xyvars } from "./theme-vars.css.js";
13
- export {
14
- FramerMotionConfig,
15
- IconRendererProvider,
16
- LikeC4Diagram,
17
- LikeC4ModelProvider,
18
- Overlay,
19
- StaticLikeC4Diagram,
20
- useLikeC4ElementsTree,
21
- useLikeC4Model,
22
- useSetState,
23
- useUpdateEffect,
24
- vars,
25
- xyvars
26
- };
1
+ export { FramerMotionConfig } from './context/FramerMotionConfig.js';
2
+ export { IconRendererProvider } from './context/IconRenderer.js';
3
+ export { LikeC4Diagram } from './LikeC4Diagram.js';
4
+ export { Overlay } from './overlays/overlay/Overlay.js';
5
+ export { LikeC4ModelProvider } from './LikeC4ModelProvider.js';
6
+ export { useSetState } from './hooks/useSetState.js';
7
+ export { useUpdateEffect } from './hooks/useUpdateEffect.js';
8
+ export { StaticLikeC4Diagram } from './StaticLikeC4Diagram.js';
9
+ export { useLikeC4ElementsTree } from './likec4model/useLikeC4ElementsTree.js';
10
+ export { useLikeC4Model } from './likec4model/useLikeC4Model.js';
@@ -1,19 +1,20 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { memo } from "react";
3
- import { useDiagramActorSnapshot } from "../hooks/useDiagram.js";
4
- import { Overlays } from "../overlays/Overlays.js";
5
- import { useEnabledFeatures } from "../context/DiagramFeatures.js";
6
- import { Controls } from "./ui/controls/Controls.js";
7
- import { DiagramTitlePanel } from "./ui/diagram-title/DiagramTitlePanel.js";
8
- import { NotationPanel } from "./ui/notation/NotationPanel.js";
9
- import { DynamicViewWalkthrough } from "./ui/walkthrough/DynamicViewWalkthrough.js";
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import { memo } from 'react';
3
+ import { useOverlaysActorRef } from '../hooks/useOverlaysActor.js';
4
+ import { Overlays } from '../overlays/Overlays.js';
5
+ import { useEnabledFeatures } from '../context/DiagramFeatures.js';
6
+ import { Controls } from './ui/controls/Controls.js';
7
+ import { DiagramTitlePanel } from './ui/diagram-title/DiagramTitlePanel.js';
8
+ import { NotationPanel } from './ui/notation/NotationPanel.js';
9
+ import { DynamicViewWalkthrough } from './ui/walkthrough/DynamicViewWalkthrough.js';
10
+
10
11
  const DiagramUI = memo(() => {
11
12
  const {
12
13
  enableViewTitle,
13
14
  enableNotations,
14
15
  enableDynamicViewWalkthrough
15
16
  } = useEnabledFeatures();
16
- const overlaysActorRef = useDiagramActorSnapshot((s) => s.children.overlays, Object.is);
17
+ const overlaysActorRef = useOverlaysActorRef();
17
18
  return /* @__PURE__ */ jsxs(Fragment, { children: [
18
19
  /* @__PURE__ */ jsx(Controls, {}),
19
20
  overlaysActorRef && /* @__PURE__ */ jsx(Overlays, { overlaysActorRef }),
@@ -23,6 +24,5 @@ const DiagramUI = memo(() => {
23
24
  ] });
24
25
  });
25
26
  DiagramUI.displayName = "DiagramUI";
26
- export {
27
- DiagramUI
28
- };
27
+
28
+ export { DiagramUI };
@@ -1,7 +1,4 @@
1
1
  import { PropsWithChildren, NamedExoticComponent } from 'react';
2
- import { EnforceOptional } from 'type-fest/source/enforce-optional';
3
2
  import { LikeC4DiagramProperties } from '../LikeC4Diagram.props';
4
- type Picked = EnforceOptional<Pick<LikeC4DiagramProperties, 'background' | 'nodesDraggable' | 'nodesSelectable'>>;
5
- export type LikeC4DiagramXYFlowProps = PropsWithChildren<Required<Picked>>;
3
+ export type LikeC4DiagramXYFlowProps = PropsWithChildren<Pick<LikeC4DiagramProperties, 'background' | 'nodesDraggable' | 'nodesSelectable' | 'reactFlowProps'>>;
6
4
  export declare const LikeC4DiagramXYFlow: NamedExoticComponent<LikeC4DiagramXYFlowProps>;
7
- export {};
@@ -1,18 +1,19 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { nonNullable } from "@likec4/core";
3
- import { useCallbackRef } from "@mantine/hooks";
4
- import clsx from "clsx";
5
- import { shallowEqual } from "fast-equals";
6
- import { memo } from "react";
7
- import { BaseXYFlow } from "../base/BaseXYFlow.js";
8
- import { ReduceGraphicsViewportListener } from "../context/ReduceGraphics.js";
9
- import { useDiagram, useDiagramContext } from "../hooks/useDiagram.js";
10
- import { edgeTypes, nodeTypes } from "./custom/index.js";
11
- import { DiagramUI } from "./DiagramUI.js";
12
- import { useLayoutConstraints } from "./useLayoutConstraints.js";
13
- import { useDiagramEventHandlers } from "../context/DiagramEventHandlers.js";
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { nonNullable } from '@likec4/core';
3
+ import { cx } from '@likec4/styles/css';
4
+ import { useTimeout, useDebouncedCallback, useCallbackRef } from '@mantine/hooks';
5
+ import { deepEqual, shallowEqual } from 'fast-equals';
6
+ import { memo } from 'react';
7
+ import { BaseXYFlow } from '../base/BaseXYFlow.js';
8
+ import { useIsReducedGraphics, usePanningAtom } from '../context/ReduceGraphics.js';
9
+ import { useDiagram, useDiagramContext } from '../hooks/useDiagram.js';
10
+ import { edgeTypes, nodeTypes } from './custom/index.js';
11
+ import { DiagramUI } from './DiagramUI.js';
12
+ import { useLayoutConstraints } from './useLayoutConstraints.js';
13
+ import { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
14
+
14
15
  const selectXYProps = (ctx) => ({
15
- initialized: ctx.initialized,
16
+ initialized: ctx.initialized.xydata && ctx.initialized.xyflow,
16
17
  nodes: ctx.xynodes,
17
18
  edges: ctx.xyedges,
18
19
  pannable: ctx.pannable,
@@ -28,11 +29,13 @@ const selectXYProps = (ctx) => ({
28
29
  }
29
30
  }
30
31
  });
31
- const equalsXYProps = (a, b) => a.initialized === b.initialized && a.pannable === b.pannable && a.zoomable === b.zoomable && a.fitViewPadding === b.fitViewPadding && a.enableFitView === b.enableFitView && a.enableReadOnly === b.enableReadOnly && shallowEqual(a.nodes, b.nodes) && shallowEqual(a.edges, b.edges) && shallowEqual(a.viewport, b.viewport);
32
+ const equalsXYProps = (a, b) => a.initialized === b.initialized && a.pannable === b.pannable && a.zoomable === b.zoomable && a.fitViewPadding === b.fitViewPadding && a.enableFitView === b.enableFitView && a.enableReadOnly === b.enableReadOnly && shallowEqual(a.nodes, b.nodes) && shallowEqual(a.edges, b.edges) && shallowEqual(a.viewport ?? null, b.viewport ?? null);
33
+ const compareProps = (a, b) => a.nodesDraggable === b.nodesDraggable && a.nodesSelectable === b.nodesSelectable && deepEqual(a.background, b.background) && deepEqual(a.reactFlowProps ?? {}, b.reactFlowProps ?? {});
32
34
  const LikeC4DiagramXYFlow = memo(({
33
- background,
34
- nodesDraggable,
35
- nodesSelectable,
35
+ background = "dots",
36
+ nodesDraggable = false,
37
+ nodesSelectable = false,
38
+ reactFlowProps = {},
36
39
  children
37
40
  }) => {
38
41
  const diagram = useDiagram();
@@ -53,9 +56,27 @@ const LikeC4DiagramXYFlow = memo(({
53
56
  onCanvasClick,
54
57
  onCanvasDblClick
55
58
  } = useDiagramEventHandlers();
56
- const notReadOnly = !enableReadOnly;
57
- const layoutConstraints = useLayoutConstraints();
58
- const onViewportResize = useCallbackRef(() => {
59
+ const notReadOnly = !enableReadOnly, isReducedGraphics = useIsReducedGraphics(), layoutConstraints = useLayoutConstraints(), $isPanning = usePanningAtom(), isPanning = useTimeout(() => {
60
+ if (!$isPanning.get()) {
61
+ $isPanning.set(true);
62
+ }
63
+ }, isReducedGraphics ? 150 : 350), notPanning = useDebouncedCallback(() => {
64
+ isPanning.clear();
65
+ if ($isPanning.get()) {
66
+ $isPanning.set(false);
67
+ }
68
+ }, 120), onMove = useCallbackRef((event) => {
69
+ if (!event) {
70
+ return;
71
+ }
72
+ if (!$isPanning.get()) {
73
+ isPanning.start();
74
+ }
75
+ notPanning();
76
+ }), onMoveEnd = useCallbackRef((event, viewport) => {
77
+ notPanning.flush();
78
+ diagram.send({ type: "xyflow.viewportMoved", viewport, manually: !!event });
79
+ }), onViewportResize = useCallbackRef(() => {
59
80
  diagram.send({ type: "xyflow.resized" });
60
81
  });
61
82
  return /* @__PURE__ */ jsxs(
@@ -63,7 +84,7 @@ const LikeC4DiagramXYFlow = memo(({
63
84
  {
64
85
  nodes,
65
86
  edges,
66
- className: clsx(initialized ? "initialized" : "not-initialized"),
87
+ className: cx(initialized ? "initialized" : "not-initialized"),
67
88
  nodeTypes,
68
89
  edgeTypes,
69
90
  onNodesChange: useCallbackRef((changes) => {
@@ -77,27 +98,52 @@ const LikeC4DiagramXYFlow = memo(({
77
98
  onNodeClick: useCallbackRef((e, node) => {
78
99
  e.stopPropagation();
79
100
  diagram.send({ type: "xyflow.nodeClick", node });
80
- onNodeClick == null ? void 0 : onNodeClick(diagram.findDiagramNode(node.id), e);
101
+ onNodeClick?.(diagram.findDiagramNode(node.id), e);
81
102
  }),
82
103
  onEdgeClick: useCallbackRef((e, edge) => {
83
104
  e.stopPropagation();
84
105
  diagram.send({ type: "xyflow.edgeClick", edge });
85
- onEdgeClick == null ? void 0 : onEdgeClick(diagram.findDiagramEdge(edge.id), e);
106
+ onEdgeClick?.(diagram.findDiagramEdge(edge.id), e);
86
107
  }),
87
108
  onPaneClick: useCallbackRef((e) => {
88
109
  e.stopPropagation();
89
110
  diagram.send({ type: "xyflow.paneClick" });
90
- onCanvasClick == null ? void 0 : onCanvasClick(e);
111
+ onCanvasClick?.(e);
91
112
  }),
92
113
  onDoubleClick: useCallbackRef((e) => {
93
114
  e.stopPropagation();
94
115
  e.preventDefault();
95
116
  diagram.send({ type: "xyflow.paneDblClick" });
96
- onCanvasDblClick == null ? void 0 : onCanvasDblClick(e);
117
+ onCanvasDblClick?.(e);
97
118
  }),
98
- onMoveEnd: useCallbackRef((event, viewport) => {
99
- diagram.send({ type: "xyflow.viewportMoved", viewport, manually: !!event });
119
+ onNodeMouseEnter: useCallbackRef((_event, node) => {
120
+ _event.stopPropagation();
121
+ if (!node.data.hovered) {
122
+ diagram.send({ type: "xyflow.nodeMouseEnter", node });
123
+ }
100
124
  }),
125
+ onNodeMouseLeave: useCallbackRef((_event, node) => {
126
+ _event.stopPropagation();
127
+ if (node.data.hovered) {
128
+ diagram.send({ type: "xyflow.nodeMouseLeave", node });
129
+ }
130
+ }),
131
+ onEdgeMouseEnter: useCallbackRef((_event, edge) => {
132
+ _event.stopPropagation();
133
+ if (!edge.data.hovered) {
134
+ diagram.send({ type: "xyflow.edgeMouseEnter", edge });
135
+ }
136
+ }),
137
+ onEdgeMouseLeave: useCallbackRef((_event, edge) => {
138
+ _event.stopPropagation();
139
+ if (edge.data.hovered) {
140
+ diagram.send({ type: "xyflow.edgeMouseLeave", edge });
141
+ }
142
+ }),
143
+ ...props.pannable && {
144
+ onMove
145
+ },
146
+ onMoveEnd,
101
147
  onInit: useCallbackRef((instance) => {
102
148
  diagram.send({ type: "xyflow.init", instance });
103
149
  }),
@@ -106,17 +152,17 @@ const LikeC4DiagramXYFlow = memo(({
106
152
  diagram.findDiagramNode(node.id),
107
153
  `diagramNode ${node.id} not found`
108
154
  );
109
- onNodeContextMenu == null ? void 0 : onNodeContextMenu(diagramNode, event);
155
+ onNodeContextMenu?.(diagramNode, event);
110
156
  }),
111
157
  onEdgeContextMenu: useCallbackRef((event, edge) => {
112
158
  const diagramEdge = nonNullable(
113
159
  diagram.findDiagramEdge(edge.id),
114
160
  `diagramEdge ${edge.id} not found`
115
161
  );
116
- onEdgeContextMenu == null ? void 0 : onEdgeContextMenu(diagramEdge, event);
162
+ onEdgeContextMenu?.(diagramEdge, event);
117
163
  }),
118
164
  onPaneContextMenu: useCallbackRef((event) => {
119
- onCanvasContextMenu == null ? void 0 : onCanvasContextMenu(event);
165
+ onCanvasContextMenu?.(event);
120
166
  }),
121
167
  ...enableFitView && {
122
168
  onViewportResize
@@ -125,14 +171,14 @@ const LikeC4DiagramXYFlow = memo(({
125
171
  nodesSelectable,
126
172
  ...notReadOnly && nodesDraggable && layoutConstraints,
127
173
  ...props,
174
+ ...reactFlowProps,
128
175
  children: [
129
- /* @__PURE__ */ jsx(ReduceGraphicsViewportListener, {}),
130
- /* @__PURE__ */ jsx(DiagramUI, {}),
176
+ /* @__PURE__ */ jsx(DiagramUI, {}, "DiagramUI"),
131
177
  children
132
178
  ]
133
179
  }
134
180
  );
135
- }, shallowEqual);
136
- export {
137
- LikeC4DiagramXYFlow
138
- };
181
+ }, compareProps);
182
+ LikeC4DiagramXYFlow.displayName = "LikeC4DiagramXYFlow";
183
+
184
+ export { LikeC4DiagramXYFlow };
@@ -1,7 +1,21 @@
1
- /* empty css */
2
- var edgeNoteCloseButton = "_1xfux2o0";
3
- var edgeNoteText = "_1xfux2o1";
4
- export {
5
- edgeNoteCloseButton,
6
- edgeNoteText
7
- };
1
+ import { css } from '@likec4/styles/css';
2
+
3
+ const edgeNoteCloseButton = css({
4
+ position: "absolute",
5
+ top: 1,
6
+ right: 1,
7
+ zIndex: 9
8
+ });
9
+ const edgeNoteText = css({
10
+ userSelect: "all",
11
+ textAlign: "left",
12
+ whiteSpaceCollapse: "preserve-breaks",
13
+ textWrap: "pretty",
14
+ lineHeight: 1.25,
15
+ "--text-fz": "{fontSizes.sm}",
16
+ md: {
17
+ "--text-fz": "{fontSizes.md}"
18
+ }
19
+ });
20
+
21
+ export { edgeNoteCloseButton, edgeNoteText };