@likec4/diagram 1.42.1 → 1.44.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 (309) hide show
  1. package/bundle/index.js +6198 -4860
  2. package/dist/LikeC4Diagram.d.ts +1 -1
  3. package/dist/LikeC4Diagram.js +15 -12
  4. package/dist/LikeC4Diagram.props.d.ts +28 -14
  5. package/dist/LikeC4ProjectsProvider.js +1 -1
  6. package/dist/LikeC4View.d.ts +28 -4
  7. package/dist/LikeC4View.js +28 -17
  8. package/dist/ReactLikeC4.d.ts +1 -1
  9. package/dist/ReactLikeC4.js +5 -7
  10. package/dist/StaticLikeC4Diagram.js +2 -2
  11. package/dist/_virtual/_commonjsHelpers.js +3 -0
  12. package/dist/_virtual/assign-dea9f7c8.cjs.js +3 -0
  13. package/dist/_virtual/log-ec8d4df4.cjs.js +3 -0
  14. package/dist/_virtual/raise-da5b247f.cjs.js +3 -0
  15. package/dist/_virtual/xstate-actions.cjs.js +5 -0
  16. package/dist/_virtual/xstate-actions.cjs2.js +3 -0
  17. package/dist/_virtual/xstate-dev.cjs.js +3 -0
  18. package/dist/_virtual/xstate-guards.cjs.js +5 -0
  19. package/dist/_virtual/xstate-guards.cjs2.js +3 -0
  20. package/dist/base/Background.d.ts +2 -1
  21. package/dist/base/Background.js +11 -2
  22. package/dist/base/Base.d.ts +28 -0
  23. package/dist/base/BaseXYFlow.d.ts +5 -5
  24. package/dist/base/BaseXYFlow.js +38 -44
  25. package/dist/base/const.d.ts +1 -1
  26. package/dist/base/const.js +1 -1
  27. package/dist/base/index.d.ts +6 -2
  28. package/dist/base/types.d.ts +1 -28
  29. package/dist/base/updateEdges.js +4 -3
  30. package/dist/base/updateNodes.js +3 -2
  31. package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
  32. package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
  33. package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
  34. package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
  35. package/dist/base-primitives/edge/EdgeContainer.js +4 -0
  36. package/dist/base-primitives/edge/EdgeLabel.d.ts +1 -0
  37. package/dist/base-primitives/edge/EdgeLabel.js +2 -0
  38. package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
  39. package/dist/base-primitives/edge/EdgeLabelContainer.js +4 -0
  40. package/dist/base-primitives/edge/EdgePath.d.ts +4 -0
  41. package/dist/base-primitives/edge/EdgePath.js +9 -5
  42. package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
  43. package/dist/base-primitives/element/ElementActionButtons.js +1 -1
  44. package/dist/base-primitives/element/ElementDetailsButton.js +2 -5
  45. package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
  46. package/dist/base-primitives/element/ElementTags.js +2 -1
  47. package/dist/base-primitives/memoEdge.js +4 -2
  48. package/dist/base-primitives/memoNode.d.ts +1 -1
  49. package/dist/base-primitives/memoNode.js +3 -3
  50. package/dist/components/ErrorFallback.js +52 -35
  51. package/dist/components/Link.js +2 -2
  52. package/dist/context/DiagramEventHandlers.js +2 -1
  53. package/dist/context/DiagramFeatures.d.ts +24 -6
  54. package/dist/context/DiagramFeatures.js +28 -56
  55. package/dist/context/IconRenderer.js +6 -6
  56. package/dist/context/LikeC4ModelContext.js +3 -10
  57. package/dist/context/TagStylesContext.js +2 -18
  58. package/dist/context/index.d.ts +1 -1
  59. package/dist/custom/customNodes.js +3 -2
  60. package/dist/custom/hooks.d.ts +1 -1
  61. package/dist/custom/index.d.ts +1 -1
  62. package/dist/custom/index.js +4 -4
  63. package/dist/editor/LikeC4EditorContext.d.ts +21 -0
  64. package/dist/editor/index.d.ts +2 -0
  65. package/dist/hooks/index.d.ts +2 -1
  66. package/dist/hooks/safeContext.d.ts +6 -3
  67. package/dist/hooks/safeContext.js +10 -3
  68. package/dist/hooks/useCallbackRef.d.ts +1 -0
  69. package/dist/hooks/useCallbackRef.js +13 -0
  70. package/dist/hooks/useCurrentView.d.ts +11 -0
  71. package/dist/hooks/{useCurrentViewId.js → useCurrentView.js} +7 -3
  72. package/dist/hooks/useCurrentViewModel.js +4 -1
  73. package/dist/hooks/useDiagram.d.ts +7 -113
  74. package/dist/hooks/useDiagram.js +7 -127
  75. package/dist/hooks/useDiagramCompareLayout.d.ts +35 -0
  76. package/dist/hooks/useDiagramCompareLayout.js +60 -0
  77. package/dist/hooks/useUpdateEffect.js +2 -4
  78. package/dist/hooks/useXYFlow.d.ts +1 -0
  79. package/dist/hooks/useXYFlow.js +4 -7
  80. package/dist/index.d.ts +2 -2
  81. package/dist/index.js +4 -3
  82. package/dist/likec4diagram/DiagramUI.js +14 -7
  83. package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -2
  84. package/dist/likec4diagram/DiagramXYFlow.js +54 -51
  85. package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
  86. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +249 -220
  87. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +7 -2
  88. package/dist/likec4diagram/custom/edges/edges.css.js +3 -4
  89. package/dist/likec4diagram/custom/edges/useControlPoints.d.ts +8 -0
  90. package/dist/likec4diagram/custom/edges/useControlPoints.js +58 -0
  91. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +7 -0
  92. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +60 -0
  93. package/dist/likec4diagram/custom/edges/utils.d.ts +0 -12
  94. package/dist/likec4diagram/custom/nodes/CompoundActions.js +4 -1
  95. package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -1
  96. package/dist/likec4diagram/custom/nodes/ElementActions.js +15 -10
  97. package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.d.ts +4 -0
  98. package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.js +46 -0
  99. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -1
  100. package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
  101. package/dist/likec4diagram/custom/nodes/nodes.js +13 -9
  102. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +1 -1
  103. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
  104. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -1
  105. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +4 -3
  106. package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +1 -11
  107. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +7 -51
  108. package/dist/likec4diagram/custom/nodes/toolbar/types.d.ts +5 -0
  109. package/dist/likec4diagram/custom/nodes/toolbar/types.js +7 -0
  110. package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.d.ts +8 -0
  111. package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +44 -0
  112. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +5 -7
  113. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +3 -2
  114. package/dist/likec4diagram/state/DiagramActorProvider.js +96 -70
  115. package/dist/likec4diagram/state/assign.d.ts +4 -2
  116. package/dist/likec4diagram/state/assign.js +39 -103
  117. package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
  118. package/dist/likec4diagram/state/createViewChange.js +90 -0
  119. package/dist/likec4diagram/state/diagram-api.d.ts +113 -0
  120. package/dist/likec4diagram/state/diagram-api.js +134 -0
  121. package/dist/likec4diagram/state/hotkeyActor.d.ts +7 -0
  122. package/dist/likec4diagram/state/hotkeyActor.js +17 -1
  123. package/dist/likec4diagram/state/machine.actions.d.ts +2099 -0
  124. package/dist/likec4diagram/state/machine.actions.js +735 -0
  125. package/dist/likec4diagram/state/machine.d.ts +3717 -0
  126. package/dist/likec4diagram/state/machine.js +141 -0
  127. package/dist/likec4diagram/state/machine.setup.d.ts +284 -0
  128. package/dist/likec4diagram/state/machine.setup.js +71 -0
  129. package/dist/likec4diagram/state/machine.state.initializing.d.ts +183 -0
  130. package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
  131. package/dist/likec4diagram/state/machine.state.navigating.d.ts +117 -0
  132. package/dist/likec4diagram/state/machine.state.navigating.js +45 -0
  133. package/dist/likec4diagram/state/machine.state.ready.d.ts +3666 -0
  134. package/dist/likec4diagram/state/machine.state.ready.js +437 -0
  135. package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +220 -63
  136. package/dist/likec4diagram/state/syncManualLayoutActor.js +218 -143
  137. package/dist/likec4diagram/state/types.d.ts +4 -7
  138. package/dist/likec4diagram/state/utils.d.ts +4 -2
  139. package/dist/likec4diagram/state/utils.js +4 -1
  140. package/dist/likec4diagram/types.d.ts +6 -1
  141. package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +2 -0
  142. package/dist/likec4diagram/ui/LayoutDriftFrame.js +66 -0
  143. package/dist/likec4diagram/ui/index.d.ts +1 -0
  144. package/dist/likec4diagram/ui/notation/NotationPanel.js +10 -12
  145. package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
  146. package/dist/likec4diagram/useLayoutConstraints.js +225 -54
  147. package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
  148. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +15 -15
  149. package/dist/navigationpanel/NavigationPanel.js +11 -7
  150. package/dist/navigationpanel/NavigationPanelControls.d.ts +2 -1
  151. package/dist/navigationpanel/NavigationPanelControls.js +23 -17
  152. package/dist/navigationpanel/NavigationPanelDropdown.d.ts +2 -1
  153. package/dist/navigationpanel/NavigationPanelDropdown.js +62 -42
  154. package/dist/navigationpanel/_common.d.ts +1 -1
  155. package/dist/navigationpanel/_common.js +4 -2
  156. package/dist/navigationpanel/actor.d.ts +11 -7
  157. package/dist/navigationpanel/actor.js +5 -4
  158. package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -0
  159. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +59 -0
  160. package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +2 -0
  161. package/dist/navigationpanel/comparepanel/ComparePanel.js +42 -0
  162. package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -0
  163. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +60 -0
  164. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +5 -0
  165. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +38 -0
  166. package/dist/navigationpanel/comparepanel/index.d.ts +1 -0
  167. package/dist/navigationpanel/controls/{ViewDetailsCard.d.ts → DetailsControls.d.ts} +1 -1
  168. package/dist/navigationpanel/controls/{ViewDetailsCard.js → DetailsControls.js} +18 -14
  169. package/dist/navigationpanel/controls/LayoutWarning.d.ts +2 -0
  170. package/dist/navigationpanel/controls/LayoutWarning.js +102 -0
  171. package/dist/navigationpanel/controls/NavigationButtons.js +4 -3
  172. package/dist/navigationpanel/controls/OpenSource.js +2 -2
  173. package/dist/navigationpanel/controls/SearchControl.d.ts +2 -1
  174. package/dist/navigationpanel/controls/SearchControl.js +15 -17
  175. package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
  176. package/dist/navigationpanel/controls/ToggleReadonly.js +19 -16
  177. package/dist/navigationpanel/controls/index.d.ts +2 -1
  178. package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -2
  179. package/dist/navigationpanel/dropdown/ProjectsMenu.js +5 -5
  180. package/dist/navigationpanel/editorpanel/CenterCamera.js +5 -2
  181. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
  182. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +21 -20
  183. package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
  184. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -2
  185. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +16 -13
  186. package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -0
  187. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +15 -0
  188. package/dist/navigationpanel/styles.css.d.ts +2 -2
  189. package/dist/navigationpanel/styles.css.js +4 -4
  190. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +14 -8
  191. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +10 -10
  192. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
  193. package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
  194. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +66 -49
  195. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js +37 -0
  196. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dev/dist/xstate-dev.cjs.js +59 -0
  197. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/assign-dea9f7c8.cjs.js +140 -0
  198. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/log-ec8d4df4.cjs.js +401 -0
  199. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/raise-da5b247f.cjs.js +2716 -0
  200. package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js +26 -0
  201. package/dist/overlays/element-details/ElementDetails.js +7 -7
  202. package/dist/overlays/element-details/ElementDetailsCard.js +18 -88
  203. package/dist/overlays/element-details/MetadataValue.d.ts +9 -0
  204. package/dist/overlays/element-details/MetadataValue.js +261 -0
  205. package/dist/overlays/element-details/TabPanelDeployments.js +6 -4
  206. package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
  207. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  208. package/dist/overlays/element-details/actor.d.ts +3 -2
  209. package/dist/overlays/overlaysActor.d.ts +304 -62
  210. package/dist/overlays/overlaysActor.js +132 -131
  211. package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
  212. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  213. package/dist/overlays/relationship-details/actor.d.ts +14 -2
  214. package/dist/overlays/relationship-details/actor.js +23 -5
  215. package/dist/overlays/relationship-details/custom/ElementActions.js +8 -5
  216. package/dist/overlays/relationship-details/custom/edgeTypes.js +4 -1
  217. package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -1
  218. package/dist/overlays/relationship-details/hooks.js +1 -1
  219. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -4
  220. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  221. package/dist/overlays/relationships-browser/actor.d.ts +239 -173
  222. package/dist/overlays/relationships-browser/actor.js +132 -110
  223. package/dist/overlays/relationships-browser/const.d.ts +3 -3
  224. package/dist/overlays/relationships-browser/const.js +3 -3
  225. package/dist/overlays/relationships-browser/custom/ElementActions.js +44 -37
  226. package/dist/overlays/relationships-browser/custom/edgeTypes.js +4 -1
  227. package/dist/overlays/relationships-browser/custom/nodeTypes.js +4 -1
  228. package/dist/overlays/relationships-browser/hooks.js +7 -6
  229. package/dist/search/Search.js +2 -1
  230. package/dist/search/components/ElementsColumn.js +5 -3
  231. package/dist/search/components/PickView.js +1 -1
  232. package/dist/search/components/SearchByTags.js +21 -44
  233. package/dist/search/components/SearchInput.js +1 -1
  234. package/dist/search/components/ViewsColum.js +6 -4
  235. package/dist/shadowroot/ShadowRoot.js +53 -12
  236. package/dist/shadowroot/styles.css.d.ts +0 -4
  237. package/dist/shadowroot/styles.css.js +1 -41
  238. package/dist/styles.css2.js +1 -1
  239. package/dist/utils/index.d.ts +4 -4
  240. package/dist/utils/vector.d.ts +78 -21
  241. package/dist/utils/vector.js +91 -24
  242. package/dist/utils/view-bounds.d.ts +8 -0
  243. package/dist/utils/view-bounds.js +57 -0
  244. package/dist/utils/xyflow.d.ts +49 -7
  245. package/dist/utils/xyflow.js +63 -11
  246. package/package.json +28 -27
  247. package/panda.buildinfo.json +140 -83
  248. package/styles-min.css +1 -1
  249. package/styles.css +1 -1
  250. package/dist/hooks/useCurrentViewId.d.ts +0 -6
  251. package/dist/likec4diagram/custom/edges/utils.js +0 -23
  252. package/dist/likec4diagram/state/diagram-machine.d.ts +0 -2590
  253. package/dist/likec4diagram/state/diagram-machine.js +0 -1180
  254. package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +0 -1
  255. package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +0 -56
  256. package/dist/utils/get-view-bounds.d.ts +0 -3
  257. package/dist/utils/get-view-bounds.js +0 -14
  258. /package/dist/base/{types.js → Base.js} +0 -0
  259. /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
  260. /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
  261. /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
  262. /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
  263. /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
  264. /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
  265. /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
  266. /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
  267. /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
  268. /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
  269. /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
  270. /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
  271. /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
  272. /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
  273. /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
  274. /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
  275. /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
  276. /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
  277. /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
  278. /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
  279. /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
  280. /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
  281. /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
  282. /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
  283. /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
  284. /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
  285. /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
  286. /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
  287. /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
  288. /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
  289. /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
  290. /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
  291. /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
  292. /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
  293. /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
  294. /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
  295. /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
  296. /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
  297. /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
  298. /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
  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/icons/IconReorder.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/icons/IconRouteOff.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/IconSearch.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/IconSelector.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/IconStack2.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/IconStarFilled.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/IconTarget.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/IconTransform.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/IconUser.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/IconX.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/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, showNotations, 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;
@@ -1,7 +1,6 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { useCustomCompareMemo } from '@react-hookz/web';
3
3
  import { ReactFlowProvider } from '@xyflow/react';
4
- import { deepEqual } from 'fast-equals';
5
4
  import { useRef } from 'react';
6
5
  import { isPlainObject, mapValues } from 'remeda';
7
6
  import { RootContainer } from './components/RootContainer.js';
@@ -11,7 +10,7 @@ import { LikeC4DiagramUI } from './likec4diagram/DiagramUI.js';
11
10
  import { LikeC4DiagramXYFlow } from './likec4diagram/DiagramXYFlow.js';
12
11
  import { DiagramActorProvider } from './likec4diagram/state/DiagramActorProvider.js';
13
12
  import { LikeC4Styles } from './LikeC4Styles.js';
14
- import { getViewBounds } from './utils/get-view-bounds.js';
13
+ import { pickViewBounds } from './utils/view-bounds.js';
15
14
  import { MinZoom, MaxZoom, FitViewPaddings } from './base/const.js';
16
15
  import { EnsureMantine } from './context/EnsureMantine.js';
17
16
  import { FramerMotionConfig } from './context/FramerMotionConfig.js';
@@ -31,6 +30,7 @@ function LikeC4Diagram({
31
30
  onNodeContextMenu,
32
31
  onOpenSource,
33
32
  onBurgerMenuClick,
33
+ onLayoutTypeChange,
34
34
  onInitialized,
35
35
  view,
36
36
  className,
@@ -46,16 +46,16 @@ function LikeC4Diagram({
46
46
  enableElementDetails = false,
47
47
  enableRelationshipDetails = false,
48
48
  enableRelationshipBrowser = false,
49
+ enableCompareWithLatest = !!onLayoutTypeChange,
49
50
  nodesDraggable = !readonly,
50
51
  nodesSelectable = !readonly || enableFocusMode || !!onNavigateTo || !!onNodeClick,
51
- showNotations = true,
52
+ enableNotations = false,
52
53
  showNavigationButtons = !!onNavigateTo,
53
54
  enableDynamicViewWalkthrough = false,
54
55
  dynamicViewVariant,
55
56
  enableSearch = false,
56
57
  initialWidth,
57
58
  initialHeight,
58
- experimentalEdgeEditing = !readonly,
59
59
  reduceGraphics = "auto",
60
60
  renderIcon,
61
61
  where,
@@ -65,7 +65,7 @@ function LikeC4Diagram({
65
65
  }) {
66
66
  const id = useId();
67
67
  const initialRef = useRef(null);
68
- const bounds = getViewBounds(view, dynamicViewVariant);
68
+ const bounds = pickViewBounds(view, dynamicViewVariant);
69
69
  const fitViewPadding = useNormalizedViewPadding(_fitViewPadding);
70
70
  if (initialRef.current == null) {
71
71
  initialRef.current = {
@@ -101,11 +101,11 @@ function LikeC4Diagram({
101
101
  enableSearch,
102
102
  enableNavigationButtons: showNavigationButtons && !!onNavigateTo,
103
103
  enableDynamicViewWalkthrough: view._type === "dynamic" && enableDynamicViewWalkthrough,
104
- enableEdgeEditing: experimentalEdgeEditing,
105
- enableNotations: showNotations,
104
+ enableNotations,
106
105
  enableVscode: !!onOpenSource,
107
106
  enableControls: controls,
108
- enableElementTags
107
+ enableElementTags,
108
+ enableCompareWithLatest: enableCompareWithLatest && !!onLayoutTypeChange
109
109
  },
110
110
  children: /* @__PURE__ */ jsxs(
111
111
  DiagramEventHandlers,
@@ -122,7 +122,8 @@ function LikeC4Diagram({
122
122
  onNodeContextMenu,
123
123
  onOpenSource,
124
124
  onBurgerMenuClick,
125
- onInitialized
125
+ onInitialized,
126
+ onLayoutTypeChange
126
127
  },
127
128
  children: [
128
129
  /* @__PURE__ */ jsx(LikeC4Styles, { id }),
@@ -138,6 +139,7 @@ function LikeC4Diagram({
138
139
  zoomable,
139
140
  pannable,
140
141
  fitViewPadding,
142
+ nodesDraggable,
141
143
  nodesSelectable,
142
144
  where: where ?? null,
143
145
  dynamicViewVariant,
@@ -145,8 +147,6 @@ function LikeC4Diagram({
145
147
  /* @__PURE__ */ jsx(
146
148
  LikeC4DiagramXYFlow,
147
149
  {
148
- nodesDraggable,
149
- nodesSelectable,
150
150
  background,
151
151
  reactFlowProps,
152
152
  renderNodes,
@@ -182,8 +182,11 @@ function useNormalizedViewPadding(raw) {
182
182
  return toLiteralPaddingWithUnit(raw);
183
183
  },
184
184
  [raw],
185
- deepEqual
185
+ compareViewPaddingObject
186
186
  );
187
187
  }
188
+ const compareViewPaddingObject = ([a], [b]) => {
189
+ return a === b || isPlainObject(a) && isPlainObject(b) && a.bottom == b.bottom && a.left == b.left && a.right == b.right && a.top == b.top;
190
+ };
188
191
 
189
192
  export { LikeC4Diagram };
@@ -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';
@@ -39,6 +39,11 @@ export type PaddingWithUnit = `${number}${PaddingUnit}` | number;
39
39
  * bottom: '8px',
40
40
  * left: '8px',
41
41
  * }
42
+ *
43
+ * {
44
+ * x: '16px',
45
+ * y: '16px',
46
+ * }
42
47
  */
43
48
  export type ViewPadding = PaddingWithUnit | {
44
49
  top?: PaddingWithUnit;
@@ -78,8 +83,8 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
78
83
  */
79
84
  fitView?: boolean | undefined;
80
85
  /**
81
- * Padding around the diagram
82
- * @default '8px'
86
+ * Padding around the diagram (number - pixels)
87
+ * @default 16 - 16px
83
88
  *
84
89
  * @see {@link ViewPadding}
85
90
  *
@@ -88,15 +93,15 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
88
93
  * <LikeC4Diagram
89
94
  * fitViewPadding={{
90
95
  * x: '16px',
91
- * y: '16px',
96
+ * y: 16,
92
97
  * }}
93
98
  * />
94
99
  *
95
100
  * <LikeC4Diagram
96
101
  * fitViewPadding={{
97
- * top: '8px',
102
+ * top: 8,
98
103
  * right: '8px',
99
- * bottom: '8px',
104
+ * bottom: '1px',
100
105
  * left: '8px',
101
106
  * }}
102
107
  * />
@@ -135,9 +140,9 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
135
140
  * Display notations in the bottom right corner
136
141
  * (Active if only notations are present)
137
142
  *
138
- * @default true
143
+ * @default false
139
144
  */
140
- showNotations?: boolean | undefined;
145
+ enableNotations?: boolean | undefined;
141
146
  /**
142
147
  * Display dropdown with details on relationship's label click
143
148
  * @default false
@@ -169,6 +174,11 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
169
174
  * @default false
170
175
  */
171
176
  enableDynamicViewWalkthrough?: boolean | undefined;
177
+ /**
178
+ * Enable "Compare with auto layout" action when view was manually modified and out of sync with latest model
179
+ * @default true if `onLayoutTypeChange` is set, false otherwise
180
+ */
181
+ enableCompareWithLatest?: boolean | undefined;
172
182
  /**
173
183
  * Default dynamic view display variant
174
184
  * @default 'diagram'
@@ -179,11 +189,6 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
179
189
  * @default false
180
190
  */
181
191
  enableElementTags?: boolean | undefined;
182
- /**
183
- * Experimental feature to enable edge editing
184
- * @default false
185
- */
186
- experimentalEdgeEditing?: boolean | undefined;
187
192
  /**
188
193
  * Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
189
194
  * Enable it if you have a large or static view
@@ -235,6 +240,7 @@ export type OnEdgeClick<A extends Any = Unknown> = (edge: DiagramEdge<A>, event:
235
240
  * On pane/canvas click (not on any node or edge)
236
241
  */
237
242
  export type OnCanvasClick = (event: ReactMouseEvent) => void;
243
+ export type OnCanvasContextMenu = (event: ReactMouseEvent | MouseEvent) => void;
238
244
  export type ChangeEvent = {
239
245
  change: ViewChange;
240
246
  };
@@ -243,12 +249,13 @@ export type OnInitialized = (params: {
243
249
  diagram: DiagramApi;
244
250
  xyflow: XYFlowInstance;
245
251
  }) => void;
252
+ export type OnLayoutTypeChange = (layoutType: LayoutType) => void;
246
253
  export interface LikeC4DiagramEventHandlers<A extends Any = Unknown> {
247
254
  onChange?: OnChange | null | undefined;
248
255
  onNavigateTo?: OnNavigateTo<A> | null | undefined;
249
256
  onNodeClick?: OnNodeClick<A> | null | undefined;
250
257
  onNodeContextMenu?: OnNodeClick<A> | null | undefined;
251
- onCanvasContextMenu?: OnCanvasClick | null | undefined;
258
+ onCanvasContextMenu?: OnCanvasContextMenu | null | undefined;
252
259
  onEdgeClick?: OnEdgeClick<A> | null | undefined;
253
260
  onEdgeContextMenu?: OnEdgeClick<A> | null | undefined;
254
261
  onCanvasClick?: OnCanvasClick | null | undefined;
@@ -256,4 +263,11 @@ export interface LikeC4DiagramEventHandlers<A extends Any = Unknown> {
256
263
  onBurgerMenuClick?: null | undefined | (() => void);
257
264
  onOpenSource?: OnOpenSource<A> | null | undefined;
258
265
  onInitialized?: OnInitialized | null | undefined;
266
+ /**
267
+ * Triggered when user changes layout type (e.g. from 'manual' to 'auto')
268
+ * Expected another `view` to be passed to the diagram
269
+ *
270
+ * @param layoutType new layout type
271
+ */
272
+ onLayoutTypeChange?: OnLayoutTypeChange | null | undefined;
259
273
  }
@@ -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,
@@ -56,9 +56,28 @@ export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
56
56
  fitView?: boolean | undefined;
57
57
  /**
58
58
  * Padding around the diagram
59
- * @default '8px'
59
+ * @default '16px'
60
60
  *
61
61
  * @see {@link ViewPadding}
62
+ *
63
+ * @example
64
+ * ```tsx
65
+ * <LikeC4View
66
+ * fitViewPadding={{
67
+ * x: '16px',
68
+ * y: 16,
69
+ * }}
70
+ * />
71
+ *
72
+ * <LikeC4View
73
+ * fitViewPadding={{
74
+ * top: 8,
75
+ * right: '8px',
76
+ * bottom: '1px',
77
+ * left: '8px',
78
+ * }}
79
+ * />
80
+ * ```
62
81
  */
63
82
  fitViewPadding?: ViewPadding | undefined;
64
83
  /**
@@ -70,7 +89,7 @@ export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
70
89
  * Display notations of the view
71
90
  * @default false
72
91
  */
73
- showNotations?: boolean | undefined;
92
+ enableNotations?: boolean | undefined;
74
93
  /**
75
94
  * If double click on a node should enable focus mode, i.e. highlight incoming/outgoing edges
76
95
  * Conflicts with `browser` prop
@@ -210,7 +229,12 @@ export interface LikeC4BrowserProps {
210
229
  * Display notations of the view
211
230
  * @default true
212
231
  */
213
- showNotations?: boolean | undefined;
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;
214
238
  /**
215
239
  * Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
216
240
  *
@@ -236,4 +260,4 @@ export interface LikeC4BrowserProps {
236
260
  *
237
261
  * Component is wrapped in ShadowRoot to isolate styles.
238
262
  */
239
- export declare function LikeC4View<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, pannable, zoomable, keepAspectRatio, colorScheme, injectFontCss, controls, background, browser, showNavigationButtons, showNotations, enableFocusMode, enableDynamicViewWalkthrough, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, reduceGraphics, mantineTheme, styleNonce, style, reactFlowProps, renderNodes, children, ...props }: LikeC4ViewProps<A>): import("react/jsx-runtime").JSX.Element;
263
+ export declare function LikeC4View<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, pannable, zoomable, keepAspectRatio, colorScheme, injectFontCss, controls, background, browser, showNavigationButtons, enableNotations, enableFocusMode, enableDynamicViewWalkthrough, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, reduceGraphics, mantineTheme, styleNonce, style, reactFlowProps, renderNodes, children, ...props }: LikeC4ViewProps<A>): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,19 @@
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';
3
+ import { Box } from '@likec4/styles/jsx';
4
+ import { ActionIcon } from '@mantine/core';
5
5
  import { useState } from 'react';
6
6
  import { isBoolean } from 'remeda';
7
7
  import { FitViewPaddings } from './base/const.js';
8
8
  import { ErrorMessage, ViewNotFound } from './components/ViewNotFound.js';
9
9
  import { FramerMotionConfig } from './context/FramerMotionConfig.js';
10
+ import { useCallbackRef } from './hooks/useCallbackRef.js';
10
11
  import { useOptionalLikeC4Model } from './hooks/useLikeC4Model.js';
11
12
  import { LikeC4Diagram } from './LikeC4Diagram.js';
12
13
  import { Overlay } from './overlays/overlay/Overlay.js';
13
14
  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';
15
+ import { pickViewBounds } from './utils/view-bounds.js';
16
+ 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
17
 
17
18
  const cssInteractive = css({
18
19
  cursor: "pointer",
@@ -33,7 +34,7 @@ function LikeC4View({
33
34
  background = "transparent",
34
35
  browser = true,
35
36
  showNavigationButtons = false,
36
- showNotations,
37
+ enableNotations,
37
38
  enableFocusMode = false,
38
39
  enableDynamicViewWalkthrough = false,
39
40
  enableElementDetails = false,
@@ -49,14 +50,21 @@ function LikeC4View({
49
50
  ...props
50
51
  }) {
51
52
  const likec4model = useOptionalLikeC4Model();
52
- const [browserViewId, onNavigateTo] = useState(null);
53
+ const [layoutType, setLayoutType] = useState("manual");
54
+ const [browserViewId, _onNavigateTo] = useState(null);
55
+ const onNavigateTo = useCallbackRef((viewId2) => {
56
+ if (viewId2 && viewId2 !== browserViewId) {
57
+ setLayoutType("manual");
58
+ }
59
+ _onNavigateTo(viewId2);
60
+ });
53
61
  const onNavigateToThisView = useCallbackRef(() => {
54
62
  onNavigateTo(viewId);
55
63
  });
56
64
  if (!likec4model) {
57
65
  return /* @__PURE__ */ jsx(ErrorMessage, { children: "LikeC4Model not found. Make sure you provided LikeC4ModelProvider." });
58
66
  }
59
- const view = likec4model.findView(viewId)?.$view;
67
+ const view = likec4model.findView(viewId)?.$layouted;
60
68
  if (!view) {
61
69
  return /* @__PURE__ */ jsx(ViewNotFound, { viewId });
62
70
  }
@@ -67,13 +75,13 @@ function LikeC4View({
67
75
  '" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.'
68
76
  ] });
69
77
  }
70
- const browserView = browserViewId ? likec4model.findView(browserViewId)?.$view : null;
71
- const notations = view.notation?.nodes ?? [];
72
- const hasNotations = notations.length > 0;
73
- showNotations ??= hasNotations;
78
+ const browserViewModel = browserViewId ? likec4model.findView(browserViewId) : null;
79
+ const browserView = layoutType === "manual" ? browserViewModel?.$layouted : browserViewModel?.$view;
80
+ const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
81
+ const browserViewHasNotations = (browserView?.notation?.nodes?.length ?? 0) > 0;
74
82
  const isBrowserEnabled = browser !== false;
75
83
  const browserProps = isBoolean(browser) ? {} : browser;
76
- const bounds = getViewBounds(view, props.dynamicViewVariant);
84
+ const bounds = pickViewBounds(view, props.dynamicViewVariant);
77
85
  return /* @__PURE__ */ jsx(
78
86
  ShadowRoot,
79
87
  {
@@ -98,10 +106,10 @@ function LikeC4View({
98
106
  background,
99
107
  fitView: true,
100
108
  fitViewPadding: FitViewPaddings.default,
101
- showNotations,
109
+ enableNotations: hasNotations,
102
110
  enableDynamicViewWalkthrough,
103
111
  showNavigationButtons,
104
- experimentalEdgeEditing: false,
112
+ enableCompareWithLatest: false,
105
113
  enableFocusMode,
106
114
  enableRelationshipDetails,
107
115
  enableElementDetails,
@@ -142,17 +150,20 @@ function LikeC4View({
142
150
  enableRelationshipDetails: true,
143
151
  enableSearch: true,
144
152
  enableElementTags: true,
153
+ enableCompareWithLatest: true,
145
154
  controls: true,
146
155
  readonly: true,
156
+ nodesDraggable: false,
147
157
  fitView: true,
148
158
  ...props,
149
159
  fitViewPadding: FitViewPaddings.withControls,
150
160
  ...browserProps,
151
- showNotations: browserProps.showNotations ?? showNotations,
152
- renderNodes
161
+ enableNotations: browserViewHasNotations && (browserProps.enableNotations ?? true),
162
+ renderNodes,
163
+ onLayoutTypeChange: setLayoutType
153
164
  }
154
165
  ),
155
- /* @__PURE__ */ jsx(Box, { pos: "absolute", top: "1rem", right: "1rem", children: /* @__PURE__ */ jsx(
166
+ /* @__PURE__ */ jsx(Box, { pos: "absolute", top: "4", right: "4", zIndex: "999", children: /* @__PURE__ */ jsx(
156
167
  ActionIcon,
157
168
  {
158
169
  variant: "default",
@@ -36,4 +36,4 @@ export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
36
36
  *
37
37
  * Component is wrapped in ShadowRoot to isolate styles.
38
38
  */
39
- export declare function ReactLikeC4<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, colorScheme, injectFontCss, keepAspectRatio, showNotations, style, mantineTheme, styleNonce, ...props }: ReactLikeC4Props<A>): import("react/jsx-runtime").JSX.Element;
39
+ export declare function ReactLikeC4<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, colorScheme, injectFontCss, enableNotations, keepAspectRatio, style, mantineTheme, styleNonce, ...props }: ReactLikeC4Props<A>): import("react/jsx-runtime").JSX.Element;
@@ -4,15 +4,15 @@ 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,
11
11
  className,
12
12
  colorScheme,
13
13
  injectFontCss = true,
14
+ enableNotations,
14
15
  keepAspectRatio,
15
- showNotations,
16
16
  style,
17
17
  mantineTheme,
18
18
  styleNonce,
@@ -33,10 +33,8 @@ function ReactLikeC4({
33
33
  '" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.'
34
34
  ] });
35
35
  }
36
- const notations = view.notation?.nodes ?? [];
37
- const hasNotations = notations.length > 0;
38
- showNotations ??= hasNotations;
39
- const bounds = getViewBounds(view, props.dynamicViewVariant);
36
+ const bounds = pickViewBounds(view, props.dynamicViewVariant);
37
+ const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
40
38
  return /* @__PURE__ */ jsx(
41
39
  ShadowRoot,
42
40
  {
@@ -54,7 +52,7 @@ function ReactLikeC4({
54
52
  LikeC4Diagram,
55
53
  {
56
54
  view,
57
- showNotations,
55
+ enableNotations: hasNotations,
58
56
  ...props
59
57
  }
60
58
  )
@@ -24,13 +24,13 @@ function StaticLikeC4Diagram({
24
24
  zoomable: false,
25
25
  controls: false,
26
26
  background,
27
- showNotations: false,
27
+ enableNotations: false,
28
28
  enableElementDetails: false,
29
29
  enableRelationshipDetails,
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<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;