@likec4/diagram 1.45.0 → 1.46.2

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 (206) hide show
  1. package/bundle/index.js +2488 -1959
  2. package/dist/LikeC4Diagram.d.ts +1 -1
  3. package/dist/LikeC4Diagram.js +8 -7
  4. package/dist/LikeC4Diagram.props.d.ts +4 -12
  5. package/dist/LikeC4ProjectsProvider.js +8 -4
  6. package/dist/LikeC4View.js +1 -5
  7. package/dist/ReactLikeC4.d.ts +1 -4
  8. package/dist/StaticLikeC4Diagram.js +0 -2
  9. package/dist/base-primitives/NodeHandles.d.ts +2 -1
  10. package/dist/base-primitives/NodeHandles.js +22 -18
  11. package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
  12. package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
  13. package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
  14. package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
  15. package/dist/base-primitives/edge/EdgeContainer.js +2 -3
  16. package/dist/base-primitives/edge/EdgeLabel.js +16 -16
  17. package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
  18. package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -4
  19. package/dist/base-primitives/edge/EdgePath.js +13 -18
  20. package/dist/base-primitives/element/ElementActionButtons.js +1 -1
  21. package/dist/base-primitives/element/ElementDetailsButton.js +1 -1
  22. package/dist/base-primitives/memoNode.js +1 -1
  23. package/dist/components/ErrorFallback.js +1 -1
  24. package/dist/components/Link.js +2 -2
  25. package/dist/context/DiagramEventHandlers.js +0 -1
  26. package/dist/context/DiagramFeatures.d.ts +1 -1
  27. package/dist/context/DiagramFeatures.js +1 -0
  28. package/dist/context/EnsureMantine.js +2 -1
  29. package/dist/context/IconRenderer.js +6 -6
  30. package/dist/editor/LikeC4EditorProvider.d.ts +22 -0
  31. package/dist/editor/LikeC4EditorProvider.js +12 -0
  32. package/dist/editor/__tests__/fixture.d.ts +205 -0
  33. package/dist/editor/applyChangesToManualLayout.d.ts +8 -0
  34. package/dist/editor/applyChangesToManualLayout.js +182 -0
  35. package/dist/editor/editorActor.actions.d.ts +201 -0
  36. package/dist/editor/editorActor.actions.js +149 -0
  37. package/dist/editor/editorActor.d.ts +653 -0
  38. package/dist/editor/editorActor.js +324 -0
  39. package/dist/editor/hotkeyActor.d.ts +7 -0
  40. package/dist/editor/hotkeyActor.js +19 -0
  41. package/dist/editor/index.d.ts +3 -2
  42. package/dist/editor/useEditorActorLogic.d.ts +565 -0
  43. package/dist/editor/useEditorActorLogic.js +54 -0
  44. package/dist/hooks/safeContext.d.ts +3 -2
  45. package/dist/hooks/safeContext.js +7 -4
  46. package/dist/hooks/useDiagram.d.ts +4 -2
  47. package/dist/hooks/useDiagram.js +19 -8
  48. package/dist/hooks/useDiagramCompareLayout.d.ts +8 -0
  49. package/dist/hooks/useDiagramCompareLayout.js +22 -2
  50. package/dist/index.d.ts +1 -0
  51. package/dist/index.js +1 -0
  52. package/dist/likec4diagram/DiagramXYFlow.js +1 -2
  53. package/dist/likec4diagram/custom/edges/EdgeDrifts.js +1 -5
  54. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +74 -48
  55. package/dist/likec4diagram/custom/edges/edges.css.d.ts +0 -1
  56. package/dist/likec4diagram/custom/edges/edges.css.js +30 -24
  57. package/dist/likec4diagram/custom/edges/useControlPoints.js +2 -2
  58. package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
  59. package/dist/likec4diagram/custom/nodes/NodeDrifts.js +4 -9
  60. package/dist/likec4diagram/custom/nodes/nodes.js +3 -6
  61. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
  62. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
  63. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +127 -14
  64. package/dist/likec4diagram/state/DiagramActorProvider.js +63 -71
  65. package/dist/likec4diagram/state/assign.d.ts +4 -1
  66. package/dist/likec4diagram/state/assign.js +11 -8
  67. package/dist/likec4diagram/state/createViewChange.js +13 -9
  68. package/dist/likec4diagram/state/diagram-api.d.ts +20 -2
  69. package/dist/likec4diagram/state/diagram-api.js +58 -44
  70. package/dist/likec4diagram/state/hotkeyActor.d.ts +1 -1
  71. package/dist/likec4diagram/state/hotkeyActor.js +12 -0
  72. package/dist/likec4diagram/state/machine.actions.d.ts +774 -195
  73. package/dist/likec4diagram/state/machine.actions.js +185 -74
  74. package/dist/likec4diagram/state/machine.actions.layout.d.ts +93 -31
  75. package/dist/likec4diagram/state/machine.actions.layout.js +16 -4
  76. package/dist/likec4diagram/state/machine.d.ts +5 -4
  77. package/dist/likec4diagram/state/machine.js +11 -6
  78. package/dist/likec4diagram/state/machine.setup.d.ts +20 -9
  79. package/dist/likec4diagram/state/machine.setup.js +18 -3
  80. package/dist/likec4diagram/state/machine.state.initializing.d.ts +34 -18
  81. package/dist/likec4diagram/state/machine.state.initializing.js +10 -10
  82. package/dist/likec4diagram/state/machine.state.navigating.js +28 -9
  83. package/dist/likec4diagram/state/machine.state.ready.d.ts +1368 -434
  84. package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +363 -39
  85. package/dist/likec4diagram/state/machine.state.ready.focused.js +17 -4
  86. package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +104 -38
  87. package/dist/likec4diagram/state/machine.state.ready.idle.js +14 -5
  88. package/dist/likec4diagram/state/machine.state.ready.js +13 -90
  89. package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +18 -6
  90. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +204 -31
  91. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +14 -1
  92. package/dist/likec4diagram/state/types.d.ts +6 -2
  93. package/dist/likec4diagram/state/utils.d.ts +33 -7
  94. package/dist/likec4diagram/state/utils.js +23 -7
  95. package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
  96. package/dist/likec4diagram/useLayoutConstraints.js +5 -9
  97. package/dist/navigationpanel/NavigationPanel.js +6 -9
  98. package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
  99. package/dist/navigationpanel/_common.js +1 -1
  100. package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -1
  101. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +40 -14
  102. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +6 -4
  103. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +2 -2
  104. package/dist/navigationpanel/controls/DetailsControls.js +2 -2
  105. package/dist/navigationpanel/controls/LayoutWarning.js +2 -1
  106. package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
  107. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  108. package/dist/navigationpanel/controls/SearchControl.js +2 -2
  109. package/dist/navigationpanel/controls/ToggleReadonly.js +25 -17
  110. package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
  111. package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
  112. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
  113. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
  114. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
  115. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
  116. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
  117. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
  118. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
  119. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
  120. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +1 -1
  121. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
  122. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
  123. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
  124. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
  125. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +1 -1
  126. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
  127. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
  128. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
  129. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
  130. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +1 -1
  131. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +1 -1
  132. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +1 -1
  133. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
  134. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
  135. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
  136. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +1 -1
  137. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
  138. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
  139. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +1 -1
  140. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
  141. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +1 -1
  142. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +1 -1
  143. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +1 -1
  144. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +1 -1
  145. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +1 -1
  146. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +1 -1
  147. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +1 -1
  148. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +1 -1
  149. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
  150. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
  151. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +1 -1
  152. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +1 -1
  153. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
  154. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
  155. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
  156. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
  157. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +1 -1
  158. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +1 -1
  159. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +1 -1
  160. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +1 -1
  161. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
  162. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
  163. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
  164. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +1 -1
  165. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
  166. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
  167. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
  168. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
  169. package/dist/overlays/Overlays.js +23 -11
  170. package/dist/overlays/element-details/ElementDetailsCard.css.js +8 -11
  171. package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
  172. package/dist/overlays/element-details/MetadataValue.js +4 -6
  173. package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
  174. package/dist/overlays/element-details/TabPanelRelationships.js +12 -7
  175. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  176. package/dist/overlays/overlaysActor.js +6 -5
  177. package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
  178. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  179. package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
  180. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
  181. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  182. package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
  183. package/dist/search/components/ElementsColumn.js +16 -11
  184. package/dist/search/components/PickView.js +3 -1
  185. package/dist/search/components/SearchByTags.js +1 -1
  186. package/dist/search/components/SearchInput.js +1 -1
  187. package/dist/search/components/ViewsColum.d.ts +3 -1
  188. package/dist/search/components/ViewsColum.js +14 -9
  189. package/dist/search/components/utils.d.ts +6 -0
  190. package/dist/search/components/utils.js +4 -1
  191. package/dist/shadowroot/styles.css.js +6 -1
  192. package/dist/styles.css2.js +1 -1
  193. package/dist/utils/index.d.ts +2 -2
  194. package/dist/utils/xyflow.d.ts +2 -3
  195. package/dist/utils/xyflow.js +9 -8
  196. package/package.json +22 -22
  197. package/panda.buildinfo.json +61 -80
  198. package/styles-min.css +1 -1
  199. package/styles.css +1 -1
  200. package/dist/base-primitives/edge/edge.css.d.ts +0 -4
  201. package/dist/base-primitives/edge/edge.css.js +0 -71
  202. package/dist/editor/LikeC4EditorContext.d.ts +0 -21
  203. package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +0 -46
  204. package/dist/likec4diagram/state/syncManualLayoutActor.js +0 -309
  205. package/dist/utils/vector.d.ts +0 -86
  206. package/dist/utils/vector.js +0 -127
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import createReactComponent from '../createReactComponent.js';
2
2
 
3
3
  /**
4
- * @license @tabler/icons-react v3.35.0 - MIT
4
+ * @license @tabler/icons-react v3.36.0 - MIT
5
5
  *
6
6
  * This source code is licensed under the MIT license.
7
7
  * See the LICENSE file in the root directory of this source tree.
@@ -3,16 +3,15 @@ import { nonexhaustive } from '@likec4/core';
3
3
  import { useSelector } from '@xstate/react';
4
4
  import { animate } from 'motion';
5
5
  import { useReducedMotionConfig, LayoutGroup, AnimatePresence } from 'motion/react';
6
- import { useMemo, useEffect } from 'react';
7
- import { ErrorBoundary } from 'react-error-boundary';
6
+ import { useEffect } from 'react';
8
7
  import { isNonNullish } from 'remeda';
9
- import { ErrorFallback } from '../components/ErrorFallback.js';
8
+ import { ErrorBoundary } from '../components/ErrorFallback.js';
10
9
  import { ElementDetails } from './element-details/ElementDetails.js';
11
10
  import { Overlay } from './overlay/Overlay.js';
12
11
  import { RelationshipDetails } from './relationship-details/RelationshipDetails.js';
13
12
  import { RelationshipsBrowser } from './relationships-browser/RelationshipsBrowser.js';
14
- import { useXYStore } from '../hooks/useXYFlow.js';
15
13
  import { DiagramFeatures } from '../context/DiagramFeatures.js';
14
+ import { useDiagram } from '../hooks/safeContext.js';
16
15
 
17
16
  const selectOverlays = (s) => {
18
17
  return s.context.overlays.map((overlay) => {
@@ -43,23 +42,36 @@ const compareSelectOverlays = (a, b) => {
43
42
  });
44
43
  };
45
44
  function Overlays({ overlaysActorRef }) {
46
- const xyflowDomNode = useXYStore((s) => s.domNode);
47
- const xyflowRendererDom = useMemo(() => xyflowDomNode?.querySelector(".react-flow__renderer") ?? null, [
48
- xyflowDomNode
49
- ]);
45
+ const diagram = useDiagram();
50
46
  const overlays = useSelector(overlaysActorRef, selectOverlays, compareSelectOverlays);
51
47
  const isMotionReduced = useReducedMotionConfig() ?? false;
52
48
  const isActiveOverlay = overlays.some((overlay) => overlay.type === "elementDetails");
53
49
  useEffect(() => {
50
+ const xyflowDomNode = diagram.getContext().xystore.getState().domNode;
51
+ const xyflowRendererDom = xyflowDomNode?.querySelector(".react-flow__renderer");
54
52
  if (!xyflowRendererDom || isMotionReduced) return;
55
- animate(xyflowRendererDom, {
53
+ const current = animate(xyflowRendererDom, {
56
54
  opacity: isActiveOverlay ? 0.7 : 1,
57
55
  filter: isActiveOverlay ? "grayscale(1)" : "grayscale(0)",
58
56
  transform: isActiveOverlay ? `perspective(400px) translateZ(-12px) translateY(3px)` : `translateY(0)`
59
57
  }, {
60
58
  duration: isActiveOverlay ? 0.35 : 0.17
61
59
  });
62
- }, [isActiveOverlay, xyflowRendererDom]);
60
+ let cleanupTm = null;
61
+ if (!isActiveOverlay) {
62
+ cleanupTm = setTimeout(() => {
63
+ xyflowRendererDom.style.transform = "";
64
+ xyflowRendererDom.style.filter = "";
65
+ cleanupTm = null;
66
+ }, 450);
67
+ }
68
+ return () => {
69
+ if (cleanupTm) {
70
+ clearTimeout(cleanupTm);
71
+ }
72
+ current.stop();
73
+ };
74
+ }, [isActiveOverlay]);
63
75
  const close = (actorRef) => {
64
76
  overlaysActorRef.send({ type: "close", actorId: actorRef.id });
65
77
  };
@@ -98,7 +110,7 @@ function Overlays({ overlaysActorRef }) {
98
110
  nonexhaustive(overlay);
99
111
  }
100
112
  });
101
- return /* @__PURE__ */ jsx(DiagramFeatures.Overlays, { children: /* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent: ErrorFallback, onReset: () => overlaysActorRef.send({ type: "close.all" }), children: /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(AnimatePresence, { children: overlaysReact }) }) }) });
113
+ return /* @__PURE__ */ jsx(DiagramFeatures.Overlays, { children: /* @__PURE__ */ jsx(ErrorBoundary, { onReset: () => overlaysActorRef.send({ type: "close.all" }), children: /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: overlaysReact }) }) }) });
102
114
  }
103
115
 
104
116
  export { Overlays };
@@ -30,22 +30,19 @@ const card = css({
30
30
  gap: "lg",
31
31
  justifyContent: "stretch",
32
32
  color: "mantine.colors.text",
33
- backgroundColor: {
34
- base: "mantine.colors.body",
35
- _dark: "mantine.colors.dark[6]"
36
- },
37
33
  boxShadow: "md",
38
34
  overflow: "hidden",
39
35
  border: "none",
40
- backgroundImage: `
36
+ background: `[
41
37
  linear-gradient(180deg,
42
- color-mix(in oklab, var(--likec4-palette-fill) 60%, transparent),
43
- color-mix(in oklab, var(--likec4-palette-fill) 20%, transparent) 8px,
44
- color-mix(in oklab, var(--likec4-palette-fill) 14%, transparent) 20px,
45
- transparent 80px
38
+ color-mix(in oklab, var(--likec4-palette-fill) 60%, transparent),
39
+ color-mix(in oklab, var(--likec4-palette-fill) 20%, transparent) 8px,
40
+ color-mix(in oklab, var(--likec4-palette-fill) 14%, transparent) 20px,
41
+ transparent 80px
46
42
  ),
47
- linear-gradient(180deg, var(--likec4-palette-fill), var(--likec4-palette-fill) 4px, transparent 4px)
48
- `,
43
+ linear-gradient(180deg, var(--likec4-palette-fill), var(--likec4-palette-fill) 4px, transparent 4px),
44
+ {colors.likec4.overlay.body}
45
+ ]`,
49
46
  "& .react-flow__attribution": {
50
47
  display: "none"
51
48
  }
@@ -21,12 +21,12 @@ import { TabPanelStructure } from './TabPanelStructure.js';
21
21
  import { useUpdateEffect } from '../../hooks/useUpdateEffect.js';
22
22
  import { IconRenderer } from '../../context/IconRenderer.js';
23
23
  import { stopPropagation } from '../../utils/xyflow.js';
24
- import IconExternalLink from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js';
24
+ import IconExternalLink from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js';
25
25
  import { IfEnabled, DiagramFeatures } from '../../context/DiagramFeatures.js';
26
- import IconFileSymlink from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
27
- import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
26
+ import IconFileSymlink from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
27
+ import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
28
28
  import { Markdown } from '../../base-primitives/Markdown.js';
29
- import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
29
+ import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
30
30
 
31
31
  const Divider = Divider$1.withProps({
32
32
  mb: 8,
@@ -2,8 +2,8 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { css } from '@likec4/styles/css';
3
3
  import { UnstyledButton, Flex, Text, Box, Stack, Tooltip } from '@mantine/core';
4
4
  import { useState, useRef, useEffect } from 'react';
5
- import IconChevronDown from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js';
6
- import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
5
+ import IconChevronDown from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js';
6
+ import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
7
7
 
8
8
  function MetadataProvider({ children }) {
9
9
  return /* @__PURE__ */ jsx(Fragment, { children });
@@ -49,8 +49,7 @@ function TruncatedValue({ value, isExpanded }) {
49
49
  }
50
50
  function MultiValueDisplay({
51
51
  values,
52
- isExpanded,
53
- onToggle
52
+ isExpanded
54
53
  }) {
55
54
  if (isExpanded) {
56
55
  return /* @__PURE__ */ jsx(Stack, { gap: "xs", children: values.map((value, index) => /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "xs", children: [
@@ -239,8 +238,7 @@ function MetadataValue({ label, value }) {
239
238
  MultiValueDisplay,
240
239
  {
241
240
  values: elements,
242
- isExpanded,
243
- onToggle: handleToggle
241
+ isExpanded
244
242
  }
245
243
  ) : /* @__PURE__ */ jsx(
246
244
  Box,
@@ -6,10 +6,10 @@ import 'fast-equals';
6
6
  import { useDiagram } from '../../hooks/safeContext.js';
7
7
  import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
8
8
  import { treeNodeLabel, treeNode, nodeLabel, instanceLabel } from './TabPanelDeployments.css.js';
9
- import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
10
- import IconTarget from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js';
9
+ import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
10
+ import IconTarget from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js';
11
11
  import { stopPropagation } from '../../utils/xyflow.js';
12
- import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
12
+ import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
13
13
 
14
14
  const DeploymentNodeRenderer = ({
15
15
  node
@@ -2,14 +2,16 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { nameFromFqn } from '@likec4/core';
3
3
  import { Stack, Group, Box, ThemeIcon, Text, Tooltip as Tooltip$1, ActionIcon, Paper } from '@mantine/core';
4
4
  import { useSelector } from '@xstate/react';
5
+ import { useCallback } from 'react';
5
6
  import { unique } from 'remeda';
6
- import { useOverlaysActorRef } from '../../hooks/useOverlaysActor.js';
7
7
  import { RelationshipsBrowser } from '../relationships-browser/RelationshipsBrowser.js';
8
8
  import { useElementDetailsActorRef } from './actorContext.js';
9
9
  import { fqn, xyflow, relationshipStat } from './TabPanelRelationships.css.js';
10
- import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
11
- import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
12
- import IconExternalLink from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js';
10
+ import { useDiagram } from '../../hooks/safeContext.js';
11
+ import 'fast-equals';
12
+ import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
13
+ import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
14
+ import IconExternalLink from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js';
13
15
 
14
16
  const Tooltip = Tooltip$1.withProps({
15
17
  color: "dark",
@@ -25,9 +27,12 @@ function TabPanelRelationships({
25
27
  node,
26
28
  element
27
29
  }) {
28
- const overlaysActor = useOverlaysActorRef();
30
+ const diagram = useDiagram();
29
31
  const delailsActor = useElementDetailsActorRef();
30
- const relationshipsBrowserActor = useSelector(delailsActor, (s) => s.children[`${delailsActor.id}-relationships`]);
32
+ const relationshipsBrowserActor = useSelector(
33
+ delailsActor,
34
+ useCallback((s) => s.children[`${delailsActor.id}-relationships`], [delailsActor.id])
35
+ );
31
36
  const incoming = [...element.incoming()].map((r) => r.id);
32
37
  const outgoing = [...element.outgoing()].map((r) => r.id);
33
38
  const incomingInView = node ? unique([...node.incoming()].flatMap((e) => e.$edge.relations)) : [];
@@ -93,7 +98,7 @@ function TabPanelRelationships({
93
98
  scope,
94
99
  viewId
95
100
  } = relationshipsBrowserActor.getSnapshot().context;
96
- overlaysActor.send({
101
+ diagram.overlays().send({
97
102
  type: "open.relationshipsBrowser",
98
103
  subject,
99
104
  scope,
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useTree, Alert, Anchor, Tree, Box, Text, Pill } from '@mantine/core';
3
3
  import { useMemo, useEffect } from 'react';
4
4
  import { treeNodeLabel, elementLabel } from './TabPanelStructure.css.js';
5
- import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
5
+ import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
6
6
 
7
7
  const ElementLabel = ({
8
8
  element
@@ -93,7 +93,8 @@ const openElementDetails = () => machine.enqueueActions(({ context, enqueue, eve
93
93
  const id = `elementDetails-${context.seq}`;
94
94
  enqueue.spawnChild("elementDetails", {
95
95
  id,
96
- input: event
96
+ input: event,
97
+ syncSnapshot: true
97
98
  });
98
99
  enqueue.assign({
99
100
  seq: context.seq + 1,
@@ -120,7 +121,8 @@ const openRelationshipDetails = () => machine.enqueueActions(({ context, enqueue
120
121
  const id = `relationshipDetails-${context.seq}`;
121
122
  enqueue.spawnChild("relationshipDetails", {
122
123
  id,
123
- input: event
124
+ input: event,
125
+ syncSnapshot: true
124
126
  });
125
127
  enqueue.assign({
126
128
  seq: context.seq + 1,
@@ -147,7 +149,8 @@ const openRelationshipsBrowser = () => machine.enqueueActions(({ context, enqueu
147
149
  const id = `relationshipsBrowser-${context.seq}`;
148
150
  enqueue.spawnChild("relationshipsBrowser", {
149
151
  id,
150
- input: event
152
+ input: event,
153
+ syncSnapshot: true
151
154
  });
152
155
  enqueue.assign({
153
156
  seq: context.seq + 1,
@@ -162,7 +165,6 @@ const openRelationshipsBrowser = () => machine.enqueueActions(({ context, enqueu
162
165
  });
163
166
  });
164
167
  const openOverlay = () => machine.enqueueActions(({ enqueue, event }) => {
165
- console.log("openOverlay event", event);
166
168
  assertEvent(event, [
167
169
  "open.elementDetails",
168
170
  "open.relationshipDetails",
@@ -186,7 +188,6 @@ const listenToEsc = () => machine.spawnChild("hotkey", {
186
188
  const stopListeningToEsc = () => machine.stopChild("hotkey");
187
189
  const checkState = () => machine.enqueueActions(({ enqueue, context }) => {
188
190
  if (context.overlays.length === 0) {
189
- console.log("No overlays left, raising close event");
190
191
  enqueue.raise({ type: "close" });
191
192
  }
192
193
  });
@@ -17,9 +17,9 @@ import { layoutRelationshipDetails } from './layout.js';
17
17
  import { SelectEdge } from './SelectEdge.js';
18
18
  import { RelationshipEdge } from './custom/edgeTypes.js';
19
19
  import { CompoundNode, ElementNode } from './custom/nodeTypes.js';
20
- 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';
21
- import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js';
22
- import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
20
+ import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
21
+ import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js';
22
+ import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
23
23
 
24
24
  const nodeTypes = {
25
25
  element: ElementNode,
@@ -3,8 +3,8 @@ import { Popover, PopoverTarget, Button, Box, Text, ThemeIcon, PopoverDropdown,
3
3
  import { useRef } from 'react';
4
4
  import { useRelationshipDetails } from './hooks.js';
5
5
  import { edgeSource, edgeTarget, scrollArea, edgeGrid, edgeRow, edgeArrow, edgeLabel } from './SelectEdge.css.js';
6
- import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
7
- import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
6
+ import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
7
+ import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
8
8
 
9
9
  const SelectEdge = ({
10
10
  edge,
@@ -6,9 +6,9 @@ import 'fast-equals';
6
6
  import 'react';
7
7
  import { useDiagram } from '../../../hooks/safeContext.js';
8
8
  import { ElementActionButtons } from '../../../base-primitives/element/ElementActionButtons.js';
9
- import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
10
- import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
11
- import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
9
+ import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
10
+ import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
11
+ import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
12
12
 
13
13
  const ElementActions = (props) => {
14
14
  const { enableNavigateTo, enableVscode } = useEnabledFeatures();
@@ -15,9 +15,9 @@ import { SelectElement } from './SelectElement.js';
15
15
  import { RelationshipEdge } from './custom/edgeTypes.js';
16
16
  import { EmptyNode } from './custom/EmptyNode.js';
17
17
  import { CompoundNode, ElementNode } from './custom/nodeTypes.js';
18
- 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';
19
- import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js';
20
- import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
18
+ import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
19
+ import IconChevronLeft from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js';
20
+ import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
21
21
 
22
22
  const nodeTypes = {
23
23
  element: ElementNode,
@@ -7,8 +7,8 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
7
7
  import { useRelationshipsBrowser, useRelationshipsBrowserState } from './hooks.js';
8
8
  import * as SelectElement_css from './SelectElement.css.js';
9
9
  import { scrollArea } from './SelectElement.css.js';
10
- import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
11
- import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
10
+ import IconSelector from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
11
+ import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
12
12
 
13
13
  const selector2 = (state) => {
14
14
  const subjectExistsInScope = state.context.layouted?.subjectExistsInScope ?? false;
@@ -6,9 +6,9 @@ import '@xstate/react';
6
6
  import 'fast-equals';
7
7
  import { useDiagram } from '../../../hooks/safeContext.js';
8
8
  import { useRelationshipsBrowser, useRelationshipsBrowserState } from '../hooks.js';
9
- import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
10
- import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
11
- import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
9
+ import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
10
+ import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
11
+ import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
12
12
  import { ElementActionButtons } from '../../../base-primitives/element/ElementActionButtons.js';
13
13
 
14
14
  const selectSubject = (state) => state.context.subject;
@@ -15,9 +15,9 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
15
15
  import { useNormalizedSearch, useSearchActor } from '../hooks.js';
16
16
  import { focusable, buttonsva } from './_shared.css.js';
17
17
  import { treeSubtree, treeLabel, treeRoot, treeNode, elementIcon, elementExpandIcon, elementTitleAndId, elementId, elementViewsCount } from './ElementsColumn.css.js';
18
- import { stopAndPrevent, moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
18
+ import { whenSearchAnimationEnds, stopAndPrevent, moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
19
19
  import { NothingFound } from './ViewsColum.js';
20
- import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
20
+ import IconChevronRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
21
21
 
22
22
  const btn = buttonsva();
23
23
  const ElementsColumn = memo(() => {
@@ -247,17 +247,22 @@ function useHandleElementSelection() {
247
247
  if (views.length === 0) {
248
248
  return;
249
249
  }
250
- const singleView = only(views);
251
- if (singleView) {
252
- searchActorRef.send({ type: "close" });
253
- if (singleView.id !== diagram.currentView.id) {
254
- setTimeout(() => {
255
- diagram.navigateTo(singleView.id);
256
- }, 100);
257
- }
250
+ const elementFqn = element.id;
251
+ const onlyOneViewId = only(views)?.id;
252
+ if (!onlyOneViewId) {
253
+ searchActorRef.send({ type: "pickview.open", elementFqn });
258
254
  return;
259
255
  }
260
- searchActorRef.send({ type: "pickview.open", elementFqn: element.id });
256
+ const isSameView = onlyOneViewId === diagram.currentView.id;
257
+ searchActorRef.send({ type: "close" });
258
+ whenSearchAnimationEnds(() => {
259
+ if (isSameView) {
260
+ diagram.focusOnElement(elementFqn);
261
+ return;
262
+ }
263
+ diagram.navigateTo(onlyOneViewId, void 0, elementFqn);
264
+ });
265
+ return;
261
266
  });
262
267
  }
263
268
 
@@ -6,7 +6,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
6
6
  import { useSearchActor } from '../hooks.js';
7
7
  import { pickviewBackdrop, pickview, pickviewGroup } from './styles.css.js';
8
8
  import { ViewButton } from './ViewsColum.js';
9
- 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';
9
+ import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
10
10
 
11
11
  function PickView({ elementFqn }) {
12
12
  const searchActorRef = useSearchActor();
@@ -102,6 +102,7 @@ function PickView({ elementFqn }) {
102
102
  view,
103
103
  search: "",
104
104
  loop: true,
105
+ focusOnElement: elementFqn,
105
106
  mod: {
106
107
  autofocus: i === 0
107
108
  }
@@ -117,6 +118,7 @@ function PickView({ elementFqn }) {
117
118
  view,
118
119
  search: "",
119
120
  loop: true,
121
+ focusOnElement: elementFqn,
120
122
  mod: {
121
123
  autofocus: i === 0 && scoped.length === 0
122
124
  }
@@ -7,7 +7,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
7
7
  import { useUpdateSearch, useNormalizedSearch } from '../hooks.js';
8
8
  import { focusToFirstFoundElement, moveFocusToSearchInput } from './utils.js';
9
9
  import { ElementTag } from '../../base-primitives/element/ElementTags.js';
10
- 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';
10
+ import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
11
11
 
12
12
  function SearchByTags() {
13
13
  const ref = useRef(null);
@@ -7,7 +7,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
7
7
  import { useSearchActor, useSearch } from '../hooks.js';
8
8
  import { input } from './styles.css.js';
9
9
  import { moveFocusToSearchInput, stopAndPrevent, focusToFirstFoundElement } from './utils.js';
10
- import IconSearch from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
10
+ import IconSearch from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
11
11
 
12
12
  function startingWithKind(search) {
13
13
  return search.match(/^(k|ki|kin|kind|kind:)$/) != null;
@@ -1,10 +1,12 @@
1
1
  import { LikeC4Model } from '@likec4/core/model';
2
+ import { Fqn } from '@likec4/core/types';
2
3
  import { ElementProps, UnstyledButtonProps } from '@mantine/core';
3
4
  import { MemoExoticComponent } from 'react';
4
5
  export declare const NothingFound: () => import("react/jsx-runtime").JSX.Element;
5
6
  export declare const ViewsColumn: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
6
- export declare function ViewButton({ className, view, loop, search, ...props }: {
7
+ export declare function ViewButton({ className, view, loop, search, focusOnElement, ...props }: {
7
8
  view: LikeC4Model.View;
8
9
  search: string;
9
10
  loop?: boolean;
11
+ focusOnElement?: Fqn;
10
12
  } & UnstyledButtonProps & ElementProps<'button'>): import("react/jsx-runtime").JSX.Element;
@@ -12,10 +12,10 @@ import { useDiagram } from '../../hooks/safeContext.js';
12
12
  import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
13
13
  import { useNormalizedSearch, useSearchActor } from '../hooks.js';
14
14
  import { emptyBoX, buttonsva, focusable } from './_shared.css.js';
15
- import { moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
15
+ import { moveFocusToSearchInput, queryAllFocusable, centerY, whenSearchAnimationEnds } from './utils.js';
16
16
  import { viewButton } from './ViewsColumn.css.js';
17
- import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
18
- import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
17
+ import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
18
+ import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
19
19
 
20
20
  const NothingFound = () => /* @__PURE__ */ jsx(Box, { className: emptyBoX, children: "Nothing found" });
21
21
  const ViewsColumn = memo(() => {
@@ -80,16 +80,21 @@ const ViewsColumn = memo(() => {
80
80
  );
81
81
  });
82
82
  const btn = buttonsva();
83
- function ViewButton({ className, view, loop = false, search, ...props }) {
83
+ function ViewButton({ className, view, loop = false, search, focusOnElement, ...props }) {
84
84
  const searchActorRef = useSearchActor();
85
85
  const diagram = useDiagram();
86
+ const nextViewId = view.id;
86
87
  const currentViewId = useCurrentViewId();
87
- const isCurrentView = view.id === currentViewId;
88
+ const isCurrentView = nextViewId === currentViewId;
88
89
  const navigate = () => {
89
90
  searchActorRef.send({ type: "close" });
90
- setTimeout(() => {
91
- diagram.navigateTo(view.id);
92
- }, 100);
91
+ whenSearchAnimationEnds(() => {
92
+ if (isCurrentView && focusOnElement) {
93
+ diagram.focusOnElement(focusOnElement);
94
+ return;
95
+ }
96
+ diagram.navigateTo(nextViewId, void 0, focusOnElement);
97
+ });
93
98
  };
94
99
  return /* @__PURE__ */ jsxs(
95
100
  UnstyledButton,
@@ -97,7 +102,7 @@ function ViewButton({ className, view, loop = false, search, ...props }) {
97
102
  ...props,
98
103
  className: cx(btn.root, "group", focusable, viewButton, className),
99
104
  "data-likec4-view": view.id,
100
- ...isCurrentView && { "data-disabled": true },
105
+ ...isCurrentView && !focusOnElement && { "data-disabled": true },
101
106
  onClick: (e) => {
102
107
  e.stopPropagation();
103
108
  navigate();