@likec4/diagram 1.43.0 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (349) hide show
  1. package/bundle/index.js +14727 -13166
  2. package/dist/LikeC4Diagram.d.ts +1 -1
  3. package/dist/LikeC4Diagram.js +14 -9
  4. package/dist/LikeC4Diagram.props.d.ts +25 -15
  5. package/dist/LikeC4ProjectsProvider.js +1 -1
  6. package/dist/LikeC4Styles.js +0 -3
  7. package/dist/LikeC4View.d.ts +8 -3
  8. package/dist/LikeC4View.js +29 -14
  9. package/dist/ReactLikeC4.d.ts +2 -2
  10. package/dist/ReactLikeC4.js +2 -2
  11. package/dist/StaticLikeC4Diagram.js +1 -1
  12. package/dist/_virtual/_commonjsHelpers.js +3 -0
  13. package/dist/_virtual/assign-dea9f7c8.cjs.js +3 -0
  14. package/dist/_virtual/log-ec8d4df4.cjs.js +3 -0
  15. package/dist/_virtual/raise-da5b247f.cjs.js +3 -0
  16. package/dist/_virtual/xstate-actions.cjs.js +5 -0
  17. package/dist/_virtual/xstate-actions.cjs2.js +3 -0
  18. package/dist/_virtual/xstate-dev.cjs.js +3 -0
  19. package/dist/_virtual/xstate-guards.cjs.js +5 -0
  20. package/dist/_virtual/xstate-guards.cjs2.js +3 -0
  21. package/dist/base/Background.d.ts +2 -1
  22. package/dist/base/Background.js +11 -2
  23. package/dist/base/Base.d.ts +28 -0
  24. package/dist/base/BaseXYFlow.d.ts +5 -5
  25. package/dist/base/BaseXYFlow.js +38 -44
  26. package/dist/base/index.d.ts +6 -2
  27. package/dist/base/types.d.ts +1 -28
  28. package/dist/base/updateEdges.js +25 -14
  29. package/dist/base/updateNodes.d.ts +14 -0
  30. package/dist/base/updateNodes.js +51 -17
  31. package/dist/base-primitives/Markdown.d.ts +30 -4
  32. package/dist/base-primitives/Markdown.js +3 -2
  33. package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
  34. package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
  35. package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
  36. package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
  37. package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
  38. package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
  39. package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
  40. package/dist/base-primitives/edge/EdgeContainer.js +8 -1
  41. package/dist/base-primitives/edge/EdgeLabel.d.ts +3 -2
  42. package/dist/base-primitives/edge/EdgeLabel.js +2 -0
  43. package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
  44. package/dist/base-primitives/edge/EdgeLabelContainer.js +4 -0
  45. package/dist/base-primitives/edge/EdgePath.d.ts +4 -0
  46. package/dist/base-primitives/edge/EdgePath.js +29 -5
  47. package/dist/base-primitives/element/ElementActionButtons.d.ts +6 -4
  48. package/dist/base-primitives/element/ElementActionButtons.js +3 -3
  49. package/dist/base-primitives/element/ElementData.d.ts +3 -3
  50. package/dist/base-primitives/element/ElementData.js +13 -7
  51. package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
  52. package/dist/base-primitives/element/ElementDetailsButton.js +5 -5
  53. package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
  54. package/dist/base-primitives/element/ElementShape.js +5 -5
  55. package/dist/base-primitives/element/ElementTags.d.ts +6 -4
  56. package/dist/base-primitives/element/ElementTags.js +2 -1
  57. package/dist/base-primitives/memoEdge.js +4 -2
  58. package/dist/base-primitives/memoNode.d.ts +1 -1
  59. package/dist/base-primitives/memoNode.js +3 -3
  60. package/dist/components/ErrorFallback.js +52 -35
  61. package/dist/components/Link.js +2 -2
  62. package/dist/context/DiagramEventHandlers.js +2 -1
  63. package/dist/context/DiagramFeatures.d.ts +25 -6
  64. package/dist/context/DiagramFeatures.js +28 -56
  65. package/dist/context/IconRenderer.js +6 -6
  66. package/dist/context/LikeC4ModelContext.js +3 -10
  67. package/dist/context/TagStylesContext.js +3 -19
  68. package/dist/context/index.d.ts +1 -1
  69. package/dist/custom/customNodes.js +3 -2
  70. package/dist/custom/hooks.d.ts +3 -3
  71. package/dist/custom/index.d.ts +1 -1
  72. package/dist/custom/index.js +5 -5
  73. package/dist/editor/LikeC4EditorContext.d.ts +21 -0
  74. package/dist/editor/index.d.ts +2 -0
  75. package/dist/hooks/index.d.ts +4 -2
  76. package/dist/hooks/safeContext.d.ts +6 -3
  77. package/dist/hooks/safeContext.js +10 -3
  78. package/dist/hooks/useCallbackRef.d.ts +1 -0
  79. package/dist/hooks/useCallbackRef.js +13 -0
  80. package/dist/hooks/useCurrentView.d.ts +11 -0
  81. package/dist/hooks/{useCurrentViewId.js → useCurrentView.js} +7 -3
  82. package/dist/hooks/useCurrentViewModel.js +4 -1
  83. package/dist/hooks/useDiagram.d.ts +7 -113
  84. package/dist/hooks/useDiagram.js +7 -127
  85. package/dist/hooks/useDiagramCompareLayout.d.ts +35 -0
  86. package/dist/hooks/useDiagramCompareLayout.js +65 -0
  87. package/dist/hooks/useLikeC4Project.d.ts +6 -1
  88. package/dist/hooks/useLikeC4Project.js +14 -2
  89. package/dist/hooks/useMediaPrint.d.ts +6 -0
  90. package/dist/hooks/useUpdateEffect.js +2 -4
  91. package/dist/hooks/useXYFlow.d.ts +1 -0
  92. package/dist/hooks/useXYFlow.js +4 -7
  93. package/dist/index.d.ts +2 -2
  94. package/dist/index.js +4 -3
  95. package/dist/likec4diagram/DiagramUI.js +14 -7
  96. package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -2
  97. package/dist/likec4diagram/DiagramXYFlow.js +60 -52
  98. package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
  99. package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
  100. package/dist/likec4diagram/custom/edges/EdgeDrifts.js +38 -0
  101. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +256 -217
  102. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +9 -2
  103. package/dist/likec4diagram/custom/edges/edges.css.js +3 -4
  104. package/dist/likec4diagram/custom/edges/useControlPoints.d.ts +8 -0
  105. package/dist/likec4diagram/custom/edges/useControlPoints.js +58 -0
  106. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +7 -0
  107. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +60 -0
  108. package/dist/likec4diagram/custom/edges/utils.d.ts +0 -12
  109. package/dist/likec4diagram/custom/nodes/CompoundActions.js +4 -1
  110. package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -1
  111. package/dist/likec4diagram/custom/nodes/ElementActions.js +15 -10
  112. package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
  113. package/dist/likec4diagram/custom/nodes/NodeDrifts.js +50 -0
  114. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +7 -2
  115. package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
  116. package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
  117. package/dist/likec4diagram/custom/nodes/nodes.js +74 -29
  118. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +1 -1
  119. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
  120. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -1
  121. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +4 -3
  122. package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +1 -11
  123. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +7 -51
  124. package/dist/likec4diagram/custom/nodes/toolbar/types.d.ts +5 -0
  125. package/dist/likec4diagram/custom/nodes/toolbar/types.js +7 -0
  126. package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.d.ts +8 -0
  127. package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +44 -0
  128. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -10
  129. package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
  130. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
  131. package/dist/likec4diagram/state/DiagramActorProvider.js +95 -70
  132. package/dist/likec4diagram/state/assign.d.ts +13 -7
  133. package/dist/likec4diagram/state/assign.js +43 -282
  134. package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
  135. package/dist/likec4diagram/state/createViewChange.js +79 -0
  136. package/dist/likec4diagram/state/diagram-api.d.ts +109 -0
  137. package/dist/likec4diagram/state/diagram-api.js +126 -0
  138. package/dist/likec4diagram/state/machine.actions.d.ts +1783 -0
  139. package/dist/likec4diagram/state/machine.actions.js +644 -0
  140. package/dist/likec4diagram/state/machine.actions.layout.d.ts +579 -0
  141. package/dist/likec4diagram/state/machine.actions.layout.js +129 -0
  142. package/dist/likec4diagram/state/machine.d.ts +22 -0
  143. package/dist/likec4diagram/state/machine.js +127 -0
  144. package/dist/likec4diagram/state/machine.setup.d.ts +327 -0
  145. package/dist/likec4diagram/state/machine.setup.js +93 -0
  146. package/dist/likec4diagram/state/machine.state.initializing.d.ts +208 -0
  147. package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
  148. package/dist/likec4diagram/state/machine.state.navigating.d.ts +14 -0
  149. package/dist/likec4diagram/state/machine.state.navigating.js +178 -0
  150. package/dist/likec4diagram/state/machine.state.ready.d.ts +3131 -0
  151. package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +386 -0
  152. package/dist/likec4diagram/state/machine.state.ready.focused.js +85 -0
  153. package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +474 -0
  154. package/dist/likec4diagram/state/machine.state.ready.idle.js +96 -0
  155. package/dist/likec4diagram/state/machine.state.ready.js +262 -0
  156. package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +128 -0
  157. package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
  158. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +511 -0
  159. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +177 -0
  160. package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
  161. package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
  162. package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +31 -108
  163. package/dist/likec4diagram/state/syncManualLayoutActor.js +278 -142
  164. package/dist/likec4diagram/state/types.d.ts +7 -12
  165. package/dist/likec4diagram/state/utils.d.ts +19 -4
  166. package/dist/likec4diagram/state/utils.js +47 -4
  167. package/dist/likec4diagram/types.d.ts +8 -8
  168. package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +2 -0
  169. package/dist/likec4diagram/ui/LayoutDriftFrame.js +66 -0
  170. package/dist/likec4diagram/ui/index.d.ts +1 -0
  171. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
  172. package/dist/likec4diagram/ui/notation/NotationPanel.js +5 -4
  173. package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
  174. package/dist/likec4diagram/useLayoutConstraints.js +237 -61
  175. package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
  176. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +14 -17
  177. package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
  178. package/dist/navigationpanel/NavigationPanel.js +16 -8
  179. package/dist/navigationpanel/NavigationPanelControls.d.ts +2 -1
  180. package/dist/navigationpanel/NavigationPanelControls.js +23 -17
  181. package/dist/navigationpanel/NavigationPanelDropdown.d.ts +2 -1
  182. package/dist/navigationpanel/NavigationPanelDropdown.js +62 -42
  183. package/dist/navigationpanel/_common.d.ts +1 -1
  184. package/dist/navigationpanel/_common.js +4 -2
  185. package/dist/navigationpanel/actor.d.ts +9 -205
  186. package/dist/navigationpanel/actor.js +6 -5
  187. package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -0
  188. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +59 -0
  189. package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +2 -0
  190. package/dist/navigationpanel/comparepanel/ComparePanel.js +42 -0
  191. package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -0
  192. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +60 -0
  193. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +5 -0
  194. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +38 -0
  195. package/dist/navigationpanel/comparepanel/index.d.ts +1 -0
  196. package/dist/navigationpanel/controls/{ViewDetailsCard.d.ts → DetailsControls.d.ts} +1 -1
  197. package/dist/navigationpanel/controls/{ViewDetailsCard.js → DetailsControls.js} +18 -14
  198. package/dist/navigationpanel/controls/LayoutWarning.d.ts +2 -0
  199. package/dist/navigationpanel/controls/LayoutWarning.js +102 -0
  200. package/dist/navigationpanel/controls/NavigationButtons.js +4 -3
  201. package/dist/navigationpanel/controls/OpenSource.js +2 -2
  202. package/dist/navigationpanel/controls/SearchControl.d.ts +2 -1
  203. package/dist/navigationpanel/controls/SearchControl.js +15 -17
  204. package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
  205. package/dist/navigationpanel/controls/ToggleReadonly.js +26 -18
  206. package/dist/navigationpanel/controls/index.d.ts +2 -1
  207. package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -2
  208. package/dist/navigationpanel/dropdown/ProjectsMenu.js +5 -5
  209. package/dist/navigationpanel/editorpanel/CenterCamera.js +5 -2
  210. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
  211. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +21 -20
  212. package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
  213. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -2
  214. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +16 -13
  215. package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -0
  216. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +15 -0
  217. package/dist/navigationpanel/styles.css.d.ts +2 -2
  218. package/dist/navigationpanel/styles.css.js +4 -4
  219. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +14 -8
  220. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
  221. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
  222. package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
  223. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +68 -50
  224. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js +37 -0
  225. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dev/dist/xstate-dev.cjs.js +59 -0
  226. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/assign-dea9f7c8.cjs.js +140 -0
  227. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/log-ec8d4df4.cjs.js +401 -0
  228. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/raise-da5b247f.cjs.js +2716 -0
  229. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js +26 -0
  230. package/dist/overlays/element-details/ElementDetails.js +7 -7
  231. package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
  232. package/dist/overlays/element-details/ElementDetailsCard.js +7 -5
  233. package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
  234. package/dist/overlays/element-details/MetadataValue.js +2 -2
  235. package/dist/overlays/element-details/TabPanelDeployments.js +6 -4
  236. package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
  237. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  238. package/dist/overlays/element-details/actor.d.ts +8 -82
  239. package/dist/overlays/element-details/actor.js +0 -8
  240. package/dist/overlays/overlay/Overlay.js +10 -10
  241. package/dist/overlays/overlaysActor.d.ts +7 -150
  242. package/dist/overlays/overlaysActor.js +183 -161
  243. package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
  244. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  245. package/dist/overlays/relationship-details/_types.d.ts +3 -4
  246. package/dist/overlays/relationship-details/actor.d.ts +6 -550
  247. package/dist/overlays/relationship-details/actor.js +18 -3
  248. package/dist/overlays/relationship-details/custom/ElementActions.js +8 -5
  249. package/dist/overlays/relationship-details/custom/edgeTypes.js +4 -1
  250. package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -1
  251. package/dist/overlays/relationship-details/hooks.js +1 -1
  252. package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
  253. package/dist/overlays/relationship-details/layout.d.ts +3 -3
  254. package/dist/overlays/relationship-details/layout.js +4 -4
  255. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -4
  256. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  257. package/dist/overlays/relationships-browser/_types.d.ts +2 -3
  258. package/dist/overlays/relationships-browser/actor.d.ts +7 -673
  259. package/dist/overlays/relationships-browser/actor.js +132 -110
  260. package/dist/overlays/relationships-browser/custom/ElementActions.js +44 -37
  261. package/dist/overlays/relationships-browser/custom/edgeTypes.js +4 -1
  262. package/dist/overlays/relationships-browser/custom/nodeTypes.js +4 -1
  263. package/dist/overlays/relationships-browser/hooks.js +7 -6
  264. package/dist/overlays/relationships-browser/layout.d.ts +2 -2
  265. package/dist/overlays/relationships-browser/layout.js +3 -3
  266. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
  267. package/dist/overlays/types.d.ts +12 -13
  268. package/dist/search/Search.js +2 -1
  269. package/dist/search/components/ElementsColumn.js +5 -3
  270. package/dist/search/components/PickView.js +1 -1
  271. package/dist/search/components/SearchByTags.js +21 -44
  272. package/dist/search/components/SearchInput.js +1 -1
  273. package/dist/search/components/ViewsColum.js +6 -4
  274. package/dist/search/components/_shared.css.d.ts +1 -1
  275. package/dist/search/searchActor.d.ts +3 -66
  276. package/dist/shadowroot/ShadowRoot.d.ts +5 -7
  277. package/dist/shadowroot/ShadowRoot.js +8 -6
  278. package/dist/styles.css2.js +1 -1
  279. package/dist/utils/index.d.ts +4 -4
  280. package/dist/utils/vector.d.ts +83 -21
  281. package/dist/utils/vector.js +98 -24
  282. package/dist/utils/view-bounds.d.ts +8 -0
  283. package/dist/utils/view-bounds.js +58 -0
  284. package/dist/utils/xyflow.d.ts +52 -8
  285. package/dist/utils/xyflow.js +31 -11
  286. package/package.json +26 -24
  287. package/panda.buildinfo.json +124 -71
  288. package/styles-min.css +1 -1
  289. package/styles.css +1 -1
  290. package/dist/hooks/useCurrentViewId.d.ts +0 -6
  291. package/dist/likec4diagram/custom/edges/utils.js +0 -23
  292. package/dist/likec4diagram/state/diagram-machine.d.ts +0 -2590
  293. package/dist/likec4diagram/state/diagram-machine.js +0 -1180
  294. package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +0 -1
  295. package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +0 -56
  296. package/dist/utils/get-view-bounds.d.ts +0 -3
  297. package/dist/utils/get-view-bounds.js +0 -14
  298. /package/dist/base/{types.js → Base.js} +0 -0
  299. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
  300. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
  301. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
  302. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
  303. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
  304. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
  305. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
  306. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
  307. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
  308. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
  309. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
  310. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
  311. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
  312. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
  313. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
  314. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
  315. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
  316. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
  317. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
  318. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
  319. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
  320. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
  321. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
  322. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
  323. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
  324. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
  325. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
  326. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
  327. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
  328. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
  329. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
  330. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
  331. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
  332. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
  333. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
  334. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
  335. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
  336. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
  337. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
  338. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
  339. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
  340. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
  341. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
  342. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
  343. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
  344. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
  345. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
  346. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
  347. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
  348. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
  349. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
@@ -8,4 +8,4 @@ export type LikeC4DiagramProps<A extends Any = Any> = PropsWithChildren<LikeC4Di
8
8
  *
9
9
  * Use {@link ReactLikeC4} or {@link LikeC4View} for ready-to-use component
10
10
  */
11
- export declare function LikeC4Diagram<A extends Any = Any>({ onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onChange, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu, onOpenSource, onBurgerMenuClick, onInitialized, view, className, readonly, controls, fitView, fitViewPadding: _fitViewPadding, pannable, zoomable, background, enableElementTags, enableFocusMode, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, nodesDraggable, nodesSelectable, enableNotations, showNavigationButtons, enableDynamicViewWalkthrough, dynamicViewVariant, enableSearch, initialWidth, initialHeight, experimentalEdgeEditing, reduceGraphics, renderIcon, where, reactFlowProps, renderNodes, children, }: LikeC4DiagramProps<A>): import("react/jsx-runtime").JSX.Element;
11
+ export declare function LikeC4Diagram<A extends Any = Any>({ onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onChange, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu, onOpenSource, onBurgerMenuClick, onLayoutTypeChange, onInitialized, view, className, readonly, controls, fitView, fitViewPadding: _fitViewPadding, pannable, zoomable, background, enableElementTags, enableFocusMode, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, enableCompareWithLatest, nodesDraggable, nodesSelectable, enableNotations, showNavigationButtons, enableDynamicViewWalkthrough, dynamicViewVariant, enableSearch, initialWidth, initialHeight, reduceGraphics, renderIcon, where, reactFlowProps, renderNodes, children, }: LikeC4DiagramProps<A>): import("react/jsx-runtime").JSX.Element;
@@ -11,7 +11,7 @@ import { LikeC4DiagramUI } from './likec4diagram/DiagramUI.js';
11
11
  import { LikeC4DiagramXYFlow } from './likec4diagram/DiagramXYFlow.js';
12
12
  import { DiagramActorProvider } from './likec4diagram/state/DiagramActorProvider.js';
13
13
  import { LikeC4Styles } from './LikeC4Styles.js';
14
- import { getViewBounds } from './utils/get-view-bounds.js';
14
+ import { pickViewBounds } from './utils/view-bounds.js';
15
15
  import { MinZoom, MaxZoom, FitViewPaddings } from './base/const.js';
16
16
  import { EnsureMantine } from './context/EnsureMantine.js';
17
17
  import { FramerMotionConfig } from './context/FramerMotionConfig.js';
@@ -31,6 +31,7 @@ function LikeC4Diagram({
31
31
  onNodeContextMenu,
32
32
  onOpenSource,
33
33
  onBurgerMenuClick,
34
+ onLayoutTypeChange,
34
35
  onInitialized,
35
36
  view,
36
37
  className,
@@ -46,6 +47,7 @@ function LikeC4Diagram({
46
47
  enableElementDetails = false,
47
48
  enableRelationshipDetails = false,
48
49
  enableRelationshipBrowser = false,
50
+ enableCompareWithLatest = !!onLayoutTypeChange,
49
51
  nodesDraggable = !readonly,
50
52
  nodesSelectable = !readonly || enableFocusMode || !!onNavigateTo || !!onNodeClick,
51
53
  enableNotations = false,
@@ -55,7 +57,6 @@ function LikeC4Diagram({
55
57
  enableSearch = false,
56
58
  initialWidth,
57
59
  initialHeight,
58
- experimentalEdgeEditing = !readonly,
59
60
  reduceGraphics = "auto",
60
61
  renderIcon,
61
62
  where,
@@ -65,7 +66,7 @@ function LikeC4Diagram({
65
66
  }) {
66
67
  const id = useId();
67
68
  const initialRef = useRef(null);
68
- const bounds = getViewBounds(view, dynamicViewVariant);
69
+ const bounds = pickViewBounds(view, dynamicViewVariant);
69
70
  const fitViewPadding = useNormalizedViewPadding(_fitViewPadding);
70
71
  if (initialRef.current == null) {
71
72
  initialRef.current = {
@@ -101,11 +102,11 @@ function LikeC4Diagram({
101
102
  enableSearch,
102
103
  enableNavigationButtons: showNavigationButtons && !!onNavigateTo,
103
104
  enableDynamicViewWalkthrough: view._type === "dynamic" && enableDynamicViewWalkthrough,
104
- enableEdgeEditing: experimentalEdgeEditing,
105
105
  enableNotations,
106
106
  enableVscode: !!onOpenSource,
107
107
  enableControls: controls,
108
- enableElementTags
108
+ enableElementTags,
109
+ enableCompareWithLatest: enableCompareWithLatest && !!onLayoutTypeChange
109
110
  },
110
111
  children: /* @__PURE__ */ jsxs(
111
112
  DiagramEventHandlers,
@@ -122,7 +123,8 @@ function LikeC4Diagram({
122
123
  onNodeContextMenu,
123
124
  onOpenSource,
124
125
  onBurgerMenuClick,
125
- onInitialized
126
+ onInitialized,
127
+ onLayoutTypeChange
126
128
  },
127
129
  children: [
128
130
  /* @__PURE__ */ jsx(LikeC4Styles, { id }),
@@ -138,6 +140,7 @@ function LikeC4Diagram({
138
140
  zoomable,
139
141
  pannable,
140
142
  fitViewPadding,
143
+ nodesDraggable,
141
144
  nodesSelectable,
142
145
  where: where ?? null,
143
146
  dynamicViewVariant,
@@ -145,8 +148,6 @@ function LikeC4Diagram({
145
148
  /* @__PURE__ */ jsx(
146
149
  LikeC4DiagramXYFlow,
147
150
  {
148
- nodesDraggable,
149
- nodesSelectable,
150
151
  background,
151
152
  reactFlowProps,
152
153
  renderNodes,
@@ -179,7 +180,11 @@ function useNormalizedViewPadding(raw) {
179
180
  if (isPlainObject(raw)) {
180
181
  return mapValues(raw, toLiteralPaddingWithUnit);
181
182
  }
182
- return toLiteralPaddingWithUnit(raw);
183
+ const v = toLiteralPaddingWithUnit(raw);
184
+ return {
185
+ x: v,
186
+ y: v
187
+ };
183
188
  },
184
189
  [raw],
185
190
  deepEqual
@@ -1,4 +1,4 @@
1
- import { DiagramEdge, DiagramNode, DynamicViewDisplayVariant, LayoutedView, ViewChange, WhereOperator } from '@likec4/core/types';
1
+ import { DiagramEdge, DiagramNode, DynamicViewDisplayVariant, LayoutedView, LayoutType, ViewChange, WhereOperator } from '@likec4/core/types';
2
2
  import { ReactFlowProps } from '@xyflow/react';
3
3
  import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
4
4
  import { CamelCasedProperties, SetRequired } from 'type-fest';
@@ -29,6 +29,14 @@ export type LikeC4ColorScheme = 'light' | 'dark';
29
29
  export type OverrideReactFlowProps = Pick<ReactFlowProps<Types.AnyNode, Types.AnyEdge>, 'paneClickDistance' | 'nodeClickDistance' | 'selectionKeyCode' | 'panActivationKeyCode' | 'multiSelectionKeyCode' | 'zoomActivationKeyCode' | 'snapToGrid' | 'snapGrid' | 'onlyRenderVisibleElements' | 'nodesDraggable' | 'nodesFocusable' | 'elementsSelectable' | 'selectNodesOnDrag' | 'panOnDrag' | 'preventScrolling' | 'zoomOnScroll' | 'zoomOnPinch' | 'panOnScroll' | 'panOnScrollSpeed' | 'panOnScrollMode' | 'zoomOnDoubleClick' | 'nodeDragThreshold'>;
30
30
  export type PaddingUnit = 'px' | '%';
31
31
  export type PaddingWithUnit = `${number}${PaddingUnit}` | number;
32
+ export type ViewPaddings = {
33
+ top?: PaddingWithUnit;
34
+ right?: PaddingWithUnit;
35
+ bottom?: PaddingWithUnit;
36
+ left?: PaddingWithUnit;
37
+ x?: PaddingWithUnit;
38
+ y?: PaddingWithUnit;
39
+ };
32
40
  /**
33
41
  * Padding around the diagram
34
42
  *
@@ -45,14 +53,7 @@ export type PaddingWithUnit = `${number}${PaddingUnit}` | number;
45
53
  * y: '16px',
46
54
  * }
47
55
  */
48
- export type ViewPadding = PaddingWithUnit | {
49
- top?: PaddingWithUnit;
50
- right?: PaddingWithUnit;
51
- bottom?: PaddingWithUnit;
52
- left?: PaddingWithUnit;
53
- x?: PaddingWithUnit;
54
- y?: PaddingWithUnit;
55
- };
56
+ export type ViewPadding = PaddingWithUnit | ViewPaddings;
56
57
  export interface LikeC4DiagramProperties<A extends Any = Unknown> {
57
58
  view: LayoutedView<A>;
58
59
  className?: string | undefined;
@@ -174,6 +175,11 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
174
175
  * @default false
175
176
  */
176
177
  enableDynamicViewWalkthrough?: boolean | undefined;
178
+ /**
179
+ * Enable "Compare with auto layout" action when view was manually modified and out of sync with latest model
180
+ * @default true if `onLayoutTypeChange` is set, false otherwise
181
+ */
182
+ enableCompareWithLatest?: boolean | undefined;
177
183
  /**
178
184
  * Default dynamic view display variant
179
185
  * @default 'diagram'
@@ -184,11 +190,6 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
184
190
  * @default false
185
191
  */
186
192
  enableElementTags?: boolean | undefined;
187
- /**
188
- * Experimental feature to enable edge editing
189
- * @default false
190
- */
191
- experimentalEdgeEditing?: boolean | undefined;
192
193
  /**
193
194
  * Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
194
195
  * Enable it if you have a large or static view
@@ -240,6 +241,7 @@ export type OnEdgeClick<A extends Any = Unknown> = (edge: DiagramEdge<A>, event:
240
241
  * On pane/canvas click (not on any node or edge)
241
242
  */
242
243
  export type OnCanvasClick = (event: ReactMouseEvent) => void;
244
+ export type OnCanvasContextMenu = (event: ReactMouseEvent | MouseEvent) => void;
243
245
  export type ChangeEvent = {
244
246
  change: ViewChange;
245
247
  };
@@ -248,12 +250,13 @@ export type OnInitialized = (params: {
248
250
  diagram: DiagramApi;
249
251
  xyflow: XYFlowInstance;
250
252
  }) => void;
253
+ export type OnLayoutTypeChange = (layoutType: LayoutType) => void;
251
254
  export interface LikeC4DiagramEventHandlers<A extends Any = Unknown> {
252
255
  onChange?: OnChange | null | undefined;
253
256
  onNavigateTo?: OnNavigateTo<A> | null | undefined;
254
257
  onNodeClick?: OnNodeClick<A> | null | undefined;
255
258
  onNodeContextMenu?: OnNodeClick<A> | null | undefined;
256
- onCanvasContextMenu?: OnCanvasClick | null | undefined;
259
+ onCanvasContextMenu?: OnCanvasContextMenu | null | undefined;
257
260
  onEdgeClick?: OnEdgeClick<A> | null | undefined;
258
261
  onEdgeContextMenu?: OnEdgeClick<A> | null | undefined;
259
262
  onCanvasClick?: OnCanvasClick | null | undefined;
@@ -261,4 +264,11 @@ export interface LikeC4DiagramEventHandlers<A extends Any = Unknown> {
261
264
  onBurgerMenuClick?: null | undefined | (() => void);
262
265
  onOpenSource?: OnOpenSource<A> | null | undefined;
263
266
  onInitialized?: OnInitialized | null | undefined;
267
+ /**
268
+ * Triggered when user changes layout type (e.g. from 'manual' to 'auto')
269
+ * Expected another `view` to be passed to the diagram
270
+ *
271
+ * @param layoutType new layout type
272
+ */
273
+ onLayoutTypeChange?: OnLayoutTypeChange | null | undefined;
264
274
  }
@@ -1,9 +1,9 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { useCallbackRef } from '@mantine/hooks';
3
2
  import { useCustomCompareMemo } from '@react-hookz/web';
4
3
  import { shallowEqual } from 'fast-equals';
5
4
  import { useContext } from 'react';
6
5
  import { LikeC4ProjectsContext } from './context/LikeC4ProjectsContext.js';
6
+ import { useCallbackRef } from './hooks/useCallbackRef.js';
7
7
 
8
8
  function LikeC4ProjectsProvider({
9
9
  children,
@@ -7,7 +7,6 @@ import { useLikeC4Styles } from './hooks/useLikeC4Styles.js';
7
7
 
8
8
  const scheme = (scheme2) => `[data-mantine-color-scheme="${scheme2}"]`;
9
9
  const whenDark = scheme("dark");
10
- const whenLight = scheme("light");
11
10
  const MAX_DEPTH = 5;
12
11
  const generateCompoundColors = (rootSelector, name, colors, depth) => {
13
12
  const compoundDarkColor = (color) => toHex(
@@ -47,8 +46,6 @@ ${selector} {
47
46
  --likec4-palette-relation-stroke: ${relationships.line};
48
47
  --likec4-palette-relation-label: ${relationships.label};
49
48
  --likec4-palette-relation-label-bg: ${relationships.labelBg};
50
- }
51
- ${whenLight} ${selector} {
52
49
  --likec4-palette-relation-stroke-selected: ${toRgba(mix(relationships.line, "black", 85))};
53
50
  }
54
51
  ${whenDark} ${selector} {
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  import { ElementIconRenderer, NodeRenderers, OverrideReactFlowProps, PaddingWithUnit, ViewPadding } from './LikeC4Diagram.props';
3
3
  import type * as t from '@likec4/core/types';
4
4
  export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
@@ -159,7 +159,7 @@ export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
159
159
  /**
160
160
  * Children to render inside the diagram (not inside the browser overlay)
161
161
  */
162
- children?: React.ReactNode | undefined;
162
+ children?: ReactNode | undefined;
163
163
  }
164
164
  export interface LikeC4BrowserProps {
165
165
  /**
@@ -230,6 +230,11 @@ export interface LikeC4BrowserProps {
230
230
  * @default true
231
231
  */
232
232
  enableNotations?: boolean | undefined;
233
+ /**
234
+ * Enable "Compare with auto layout" action when view was manually modified and out of sync with latest model
235
+ * @default true
236
+ */
237
+ enableCompareWithLatest?: boolean | undefined;
233
238
  /**
234
239
  * Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
235
240
  *
@@ -245,7 +250,7 @@ export interface LikeC4BrowserProps {
245
250
  /**
246
251
  * Children to render inside the browser overlay
247
252
  */
248
- children?: React.ReactNode | undefined;
253
+ children?: ReactNode | undefined;
249
254
  }
250
255
  /**
251
256
  * Ready-to-use component to display embedded LikeC4 view,
@@ -1,18 +1,20 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { cx, css } from '@likec4/styles/css';
3
- import { Box, ActionIcon } from '@mantine/core';
4
- import { useCallbackRef } from '@mantine/hooks';
5
- import { useState } from 'react';
3
+ import { Box } from '@likec4/styles/jsx';
4
+ import { ActionIcon } from '@mantine/core';
5
+ import { AnimatePresence } from 'motion/react';
6
+ import { useRef, useState } from 'react';
6
7
  import { isBoolean } from 'remeda';
7
8
  import { FitViewPaddings } from './base/const.js';
8
9
  import { ErrorMessage, ViewNotFound } from './components/ViewNotFound.js';
9
10
  import { FramerMotionConfig } from './context/FramerMotionConfig.js';
11
+ import { useCallbackRef } from './hooks/useCallbackRef.js';
10
12
  import { useOptionalLikeC4Model } from './hooks/useLikeC4Model.js';
11
13
  import { LikeC4Diagram } from './LikeC4Diagram.js';
12
14
  import { Overlay } from './overlays/overlay/Overlay.js';
13
15
  import { ShadowRoot } from './shadowroot/ShadowRoot.js';
14
- import { getViewBounds } from './utils/get-view-bounds.js';
15
- import IconX from './node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
16
+ import { pickViewBounds } from './utils/view-bounds.js';
17
+ import IconX from './node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
16
18
 
17
19
  const cssInteractive = css({
18
20
  cursor: "pointer",
@@ -48,15 +50,23 @@ function LikeC4View({
48
50
  children,
49
51
  ...props
50
52
  }) {
53
+ const rootRef = useRef(null);
51
54
  const likec4model = useOptionalLikeC4Model();
52
- const [browserViewId, onNavigateTo] = useState(null);
55
+ const [layoutType, setLayoutType] = useState("manual");
56
+ const [browserViewId, _onNavigateTo] = useState(null);
57
+ const onNavigateTo = useCallbackRef((viewId2) => {
58
+ if (viewId2 && viewId2 !== browserViewId) {
59
+ setLayoutType("manual");
60
+ }
61
+ _onNavigateTo(viewId2);
62
+ });
53
63
  const onNavigateToThisView = useCallbackRef(() => {
54
64
  onNavigateTo(viewId);
55
65
  });
56
66
  if (!likec4model) {
57
67
  return /* @__PURE__ */ jsx(ErrorMessage, { children: "LikeC4Model not found. Make sure you provided LikeC4ModelProvider." });
58
68
  }
59
- const view = likec4model.findView(viewId)?.$view;
69
+ const view = likec4model.findView(viewId)?.$layouted;
60
70
  if (!view) {
61
71
  return /* @__PURE__ */ jsx(ViewNotFound, { viewId });
62
72
  }
@@ -67,15 +77,18 @@ function LikeC4View({
67
77
  '" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.'
68
78
  ] });
69
79
  }
70
- const browserView = browserViewId ? likec4model.findView(browserViewId)?.$view : null;
80
+ const browserViewModel = browserViewId ? likec4model.findView(browserViewId) : null;
81
+ const browserView = layoutType === "manual" ? browserViewModel?.$layouted : browserViewModel?.$view;
71
82
  const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
72
83
  const browserViewHasNotations = (browserView?.notation?.nodes?.length ?? 0) > 0;
73
84
  const isBrowserEnabled = browser !== false;
74
85
  const browserProps = isBoolean(browser) ? {} : browser;
75
- const bounds = getViewBounds(view, props.dynamicViewVariant);
86
+ const bounds = pickViewBounds(view, props.dynamicViewVariant);
87
+ const root = rootRef.current ? { root: rootRef.current } : void 0;
76
88
  return /* @__PURE__ */ jsx(
77
89
  ShadowRoot,
78
90
  {
91
+ ref: rootRef,
79
92
  injectFontCss,
80
93
  theme: mantineTheme,
81
94
  colorScheme,
@@ -100,7 +113,7 @@ function LikeC4View({
100
113
  enableNotations: hasNotations,
101
114
  enableDynamicViewWalkthrough,
102
115
  showNavigationButtons,
103
- experimentalEdgeEditing: false,
116
+ enableCompareWithLatest: false,
104
117
  enableFocusMode,
105
118
  enableRelationshipDetails,
106
119
  enableElementDetails,
@@ -124,7 +137,7 @@ function LikeC4View({
124
137
  ...props
125
138
  }
126
139
  ),
127
- browserView && /* @__PURE__ */ jsxs(Overlay, { openDelay: 0, onClose: () => onNavigateTo(null), children: [
140
+ /* @__PURE__ */ jsx(AnimatePresence, { ...root, children: browserView && /* @__PURE__ */ jsxs(Overlay, { openDelay: 0, onClose: () => onNavigateTo(null), children: [
128
141
  /* @__PURE__ */ jsx(
129
142
  LikeC4Diagram,
130
143
  {
@@ -141,6 +154,7 @@ function LikeC4View({
141
154
  enableRelationshipDetails: true,
142
155
  enableSearch: true,
143
156
  enableElementTags: true,
157
+ enableCompareWithLatest: true,
144
158
  controls: true,
145
159
  readonly: true,
146
160
  nodesDraggable: false,
@@ -149,10 +163,11 @@ function LikeC4View({
149
163
  fitViewPadding: FitViewPaddings.withControls,
150
164
  ...browserProps,
151
165
  enableNotations: browserViewHasNotations && (browserProps.enableNotations ?? true),
152
- renderNodes
166
+ renderNodes,
167
+ onLayoutTypeChange: setLayoutType
153
168
  }
154
169
  ),
155
- /* @__PURE__ */ jsx(Box, { pos: "absolute", top: "1rem", right: "1rem", children: /* @__PURE__ */ jsx(
170
+ /* @__PURE__ */ jsx(Box, { pos: "absolute", top: "4", right: "4", zIndex: "999", children: /* @__PURE__ */ jsx(
156
171
  ActionIcon,
157
172
  {
158
173
  variant: "default",
@@ -164,7 +179,7 @@ function LikeC4View({
164
179
  children: /* @__PURE__ */ jsx(IconX, {})
165
180
  }
166
181
  ) })
167
- ] })
182
+ ] }) })
168
183
  ] })
169
184
  }
170
185
  );
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  import { Except } from 'type-fest';
3
3
  import { LikeC4DiagramEventHandlers, LikeC4DiagramProperties } from './LikeC4Diagram.props';
4
4
  import type * as t from '@likec4/core/types';
@@ -26,7 +26,7 @@ export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
26
26
  mantineTheme?: any;
27
27
  /** Function to generate nonce attribute added to all generated `<style />` tags */
28
28
  styleNonce?: string | (() => string) | undefined;
29
- children?: React.ReactNode | undefined;
29
+ children?: ReactNode | undefined;
30
30
  } & Except<LikeC4DiagramProperties<A>, 'view', {
31
31
  requireExactProps: true;
32
32
  }> & LikeC4DiagramEventHandlers<A>;
@@ -4,7 +4,7 @@ import { ErrorMessage, ViewNotFound } from './components/ViewNotFound.js';
4
4
  import { useOptionalLikeC4Model } from './hooks/useLikeC4Model.js';
5
5
  import { LikeC4Diagram } from './LikeC4Diagram.js';
6
6
  import { ShadowRoot } from './shadowroot/ShadowRoot.js';
7
- import { getViewBounds } from './utils/get-view-bounds.js';
7
+ import { pickViewBounds } from './utils/view-bounds.js';
8
8
 
9
9
  function ReactLikeC4({
10
10
  viewId,
@@ -33,7 +33,7 @@ function ReactLikeC4({
33
33
  '" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.'
34
34
  ] });
35
35
  }
36
- const bounds = getViewBounds(view, props.dynamicViewVariant);
36
+ const bounds = pickViewBounds(view, props.dynamicViewVariant);
37
37
  const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
38
38
  return /* @__PURE__ */ jsx(
39
39
  ShadowRoot,
@@ -30,7 +30,7 @@ function StaticLikeC4Diagram({
30
30
  enableRelationshipBrowser,
31
31
  enableDynamicViewWalkthrough: false,
32
32
  showNavigationButtons: false,
33
- experimentalEdgeEditing: false,
33
+ enableCompareWithLatest: false,
34
34
  enableFocusMode: false,
35
35
  enableSearch: false,
36
36
  nodesSelectable: false,
@@ -0,0 +1,3 @@
1
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
+
3
+ export { commonjsGlobal };
@@ -0,0 +1,3 @@
1
+ var assignDea9f7c8_cjs = {};
2
+
3
+ export { assignDea9f7c8_cjs as __exports };
@@ -0,0 +1,3 @@
1
+ var logEc8d4df4_cjs = {};
2
+
3
+ export { logEc8d4df4_cjs as __exports };
@@ -0,0 +1,3 @@
1
+ var raiseDa5b247f_cjs = {};
2
+
3
+ export { raiseDa5b247f_cjs as __exports };
@@ -0,0 +1,5 @@
1
+ import { __require as requireXstateActions_cjs } from '../node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js';
2
+
3
+ var xstateActions_cjsExports = requireXstateActions_cjs();
4
+
5
+ export { xstateActions_cjsExports as x };
@@ -0,0 +1,3 @@
1
+ var xstateActions_cjs = {};
2
+
3
+ export { xstateActions_cjs as __exports };
@@ -0,0 +1,3 @@
1
+ var xstateDev_cjs = {};
2
+
3
+ export { xstateDev_cjs as __exports };
@@ -0,0 +1,5 @@
1
+ import { __require as requireXstateGuards_cjs } from '../node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js';
2
+
3
+ var xstateGuards_cjsExports = requireXstateGuards_cjs();
4
+
5
+ export { xstateGuards_cjsExports as x };
@@ -0,0 +1,3 @@
1
+ var xstateGuards_cjs = {};
2
+
3
+ export { xstateGuards_cjs as __exports };
@@ -1,7 +1,8 @@
1
1
  import { BackgroundProps } from '@xyflow/react';
2
+ import { NamedExoticComponent } from 'react';
2
3
  export type XYBackgroundVariant = 'dots' | 'lines' | 'cross';
3
4
  export type XYBackground = XYBackgroundVariant | BackgroundProps;
4
5
  export type XYBackgroundProps = {
5
6
  background: XYBackground;
6
7
  };
7
- export declare function Background({ background }: XYBackgroundProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare const Background: NamedExoticComponent<XYBackgroundProps>;
@@ -1,6 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { nonexhaustive } from '@likec4/core';
3
3
  import { Background as Background$1, BackgroundVariant } from '@xyflow/react';
4
+ import { deepEqual } from 'fast-equals';
5
+ import { memo } from 'react';
4
6
 
5
7
  function literalToEnum(value) {
6
8
  switch (value) {
@@ -14,11 +16,18 @@ function literalToEnum(value) {
14
16
  nonexhaustive(value);
15
17
  }
16
18
  }
17
- function Background({ background }) {
19
+ const compareProps = (prev, next) => {
20
+ if (typeof prev.background === "string" && typeof next.background === "string") {
21
+ return prev.background === next.background;
22
+ }
23
+ return deepEqual(prev.background, next.background);
24
+ };
25
+ const Background = memo(({ background }) => {
18
26
  if (typeof background === "string") {
19
27
  return /* @__PURE__ */ jsx(Background$1, { variant: literalToEnum(background), size: 2, gap: 20 });
20
28
  }
21
29
  return /* @__PURE__ */ jsx(Background$1, { ...background });
22
- }
30
+ }, compareProps);
31
+ Background.displayName = "Background";
23
32
 
24
33
  export { Background };
@@ -0,0 +1,28 @@
1
+ type WithDimmed = {
2
+ data: {
3
+ dimmed?: Base.Dimmed;
4
+ };
5
+ };
6
+ type WithHovered = {
7
+ data: {
8
+ hovered?: boolean;
9
+ };
10
+ };
11
+ declare function setDimmed<T extends WithDimmed>(value: T, dimmed: 'immediate' | boolean): T;
12
+ declare function setDimmed(dimmed: 'immediate' | boolean): <T extends WithDimmed>(value: T) => T;
13
+ declare function setHovered<T extends WithHovered>(value: T, hovered: boolean): T;
14
+ declare function setHovered(hovered: boolean): <T extends WithHovered>(value: T) => T;
15
+ type WithData<D> = {
16
+ data: D;
17
+ };
18
+ declare function setData<E extends WithData<any>>(value: E, state: Partial<E['data']>): E;
19
+ declare function setData<E extends WithData<any>>(state: Partial<NoInfer<E['data']>>): (value: E) => E;
20
+ export declare const Base: {
21
+ setDimmed: typeof setDimmed;
22
+ setHovered: typeof setHovered;
23
+ setData: typeof setData;
24
+ };
25
+ export declare namespace Base {
26
+ type Dimmed = 'immediate' | boolean;
27
+ }
28
+ export {};
@@ -4,12 +4,12 @@ import { ViewPadding } from '../LikeC4Diagram.props';
4
4
  import { XYBackground } from './Background';
5
5
  import { BaseEdge, BaseNode } from './types';
6
6
  export type BaseXYFlowProps<NodeType extends BaseNode, EdgeType extends BaseEdge> = Simplify<{
7
- pannable?: boolean;
8
- zoomable?: boolean;
9
- nodesSelectable?: boolean;
10
- nodesDraggable?: boolean;
7
+ pannable: boolean;
8
+ zoomable: boolean;
9
+ nodesSelectable: boolean;
10
+ nodesDraggable: boolean;
11
11
  background?: 'transparent' | 'solid' | XYBackground;
12
12
  fitViewPadding?: ViewPadding | undefined;
13
13
  onViewportResize?: undefined | (() => void);
14
- } & SetRequired<Omit<ReactFlowProps<NodeType, EdgeType>, 'defaultNodes' | 'defaultEdges' | 'onNodeDoubleClick' | 'onEdgeDoubleClick' | 'fitViewOptions'>, 'nodes' | 'edges' | 'onNodesChange' | 'onEdgesChange'>>;
14
+ } & SetRequired<Omit<ReactFlowProps<NodeType, EdgeType>, 'defaultNodes' | 'defaultEdges' | 'fitViewOptions' | 'nodesSelectable' | 'nodesDraggable'>, 'nodes' | 'edges' | 'onNodesChange' | 'onEdgesChange'>>;
15
15
  export declare function BaseXYFlow<NodeType extends BaseNode, EdgeType extends BaseEdge>({ nodes, edges, onEdgesChange, onNodesChange, className, pannable, zoomable, nodesSelectable, nodesDraggable, background, children, colorMode, fitViewPadding, fitView, zoomOnDoubleClick, onViewportResize, onMoveEnd, onNodeMouseEnter, onNodeMouseLeave, onEdgeMouseEnter, onEdgeMouseLeave, ...props }: BaseXYFlowProps<NodeType, EdgeType>): import("react/jsx-runtime").JSX.Element;