@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
@@ -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, onLayoutTypeChange, onInitialized, view, className, readonly, controls, fitView, fitViewPadding: _fitViewPadding, pannable, zoomable, background, enableElementTags, enableFocusMode, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, enableCompareWithLatest, nodesDraggable, nodesSelectable, enableNotations, showNavigationButtons, enableDynamicViewWalkthrough, dynamicViewVariant, enableSearch, initialWidth, initialHeight, reduceGraphics, renderIcon, where, reactFlowProps, renderNodes, children, }: LikeC4DiagramProps<A>): import("react/jsx-runtime").JSX.Element;
11
+ export declare function LikeC4Diagram<A extends Any = Any>({ onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu, onOpenSource, onBurgerMenuClick, onLayoutTypeChange, onInitialized, view, className, controls, fitView, fitViewPadding: _fitViewPadding, pannable, zoomable, background, enableElementTags, enableFocusMode, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, enableCompareWithLatest, nodesSelectable, enableNotations, showNavigationButtons, enableDynamicViewWalkthrough, dynamicViewVariant, enableSearch, initialWidth, initialHeight, reduceGraphics, renderIcon, where, reactFlowProps, renderNodes, children, }: LikeC4DiagramProps<A>): import("react/jsx-runtime").JSX.Element;
@@ -12,6 +12,7 @@ import { LikeC4DiagramXYFlow } from './likec4diagram/DiagramXYFlow.js';
12
12
  import { DiagramActorProvider } from './likec4diagram/state/DiagramActorProvider.js';
13
13
  import { LikeC4Styles } from './LikeC4Styles.js';
14
14
  import { pickViewBounds } from './utils/view-bounds.js';
15
+ import { useOptionalLikeC4EditorPort } from './editor/LikeC4EditorProvider.js';
15
16
  import { MinZoom, MaxZoom, FitViewPaddings } from './base/const.js';
16
17
  import { EnsureMantine } from './context/EnsureMantine.js';
17
18
  import { FramerMotionConfig } from './context/FramerMotionConfig.js';
@@ -24,7 +25,6 @@ function LikeC4Diagram({
24
25
  onCanvasContextMenu,
25
26
  onCanvasDblClick,
26
27
  onEdgeClick,
27
- onChange,
28
28
  onEdgeContextMenu,
29
29
  onNavigateTo,
30
30
  onNodeClick,
@@ -35,8 +35,7 @@ function LikeC4Diagram({
35
35
  onInitialized,
36
36
  view,
37
37
  className,
38
- readonly = true,
39
- controls = !readonly,
38
+ controls = true,
40
39
  fitView = true,
41
40
  fitViewPadding: _fitViewPadding = controls ? FitViewPaddings.withControls : FitViewPaddings.default,
42
41
  pannable = true,
@@ -48,8 +47,7 @@ function LikeC4Diagram({
48
47
  enableRelationshipDetails = false,
49
48
  enableRelationshipBrowser = false,
50
49
  enableCompareWithLatest = !!onLayoutTypeChange,
51
- nodesDraggable = !readonly,
52
- nodesSelectable = !readonly || enableFocusMode || !!onNavigateTo || !!onNodeClick,
50
+ nodesSelectable,
53
51
  enableNotations = false,
54
52
  showNavigationButtons = !!onNavigateTo,
55
53
  enableDynamicViewWalkthrough = false,
@@ -66,6 +64,9 @@ function LikeC4Diagram({
66
64
  }) {
67
65
  const id = useId();
68
66
  const initialRef = useRef(null);
67
+ const hasEditor = !!useOptionalLikeC4EditorPort();
68
+ const readonly = !hasEditor;
69
+ nodesSelectable ??= hasEditor || enableFocusMode || !!onNavigateTo || !!onNodeClick;
69
70
  const bounds = pickViewBounds(view, dynamicViewVariant);
70
71
  const fitViewPadding = useNormalizedViewPadding(_fitViewPadding);
71
72
  if (initialRef.current == null) {
@@ -93,6 +94,7 @@ function LikeC4Diagram({
93
94
  {
94
95
  features: {
95
96
  enableFitView: fitView,
97
+ enableEditor: hasEditor,
96
98
  enableReadOnly: readonly,
97
99
  enableFocusMode,
98
100
  enableNavigateTo: !!onNavigateTo,
@@ -116,7 +118,6 @@ function LikeC4Diagram({
116
118
  onCanvasContextMenu,
117
119
  onCanvasDblClick,
118
120
  onEdgeClick,
119
- onChange,
120
121
  onEdgeContextMenu,
121
122
  onNavigateTo,
122
123
  onNodeClick,
@@ -140,7 +141,7 @@ function LikeC4Diagram({
140
141
  zoomable,
141
142
  pannable,
142
143
  fitViewPadding,
143
- nodesDraggable,
144
+ nodesDraggable: hasEditor,
144
145
  nodesSelectable,
145
146
  where: where ?? null,
146
147
  dynamicViewVariant,
@@ -67,15 +67,10 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
67
67
  * @default true
68
68
  */
69
69
  zoomable?: boolean | undefined;
70
- /**
71
- * Disable any editing (dragging still can be enabled with `nodesDraggable`)
72
- * @default true
73
- */
74
- readonly?: boolean | undefined;
75
70
  /**
76
71
  * Show/hide panel with top left controls
77
72
  *
78
- * @default true if not readonly
73
+ * @default true
79
74
  */
80
75
  controls?: boolean | undefined;
81
76
  /**
@@ -110,13 +105,11 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
110
105
  */
111
106
  fitViewPadding?: ViewPadding | undefined;
112
107
  /**
113
- * @default false if readonly
108
+ * If not readonly, or `enableFocusMode`, `onNavigateTo` or `onNodeClick` are set - nodes will be selectable
109
+ *
110
+ * @default false
114
111
  */
115
112
  nodesSelectable?: boolean | undefined;
116
- /**
117
- * @default false if readonly
118
- */
119
- nodesDraggable?: boolean | undefined;
120
113
  /**
121
114
  * Initial width of the diagram
122
115
  * (supposed to be used during SSR)
@@ -252,7 +245,6 @@ export type OnInitialized = (params: {
252
245
  }) => void;
253
246
  export type OnLayoutTypeChange = (layoutType: LayoutType) => void;
254
247
  export interface LikeC4DiagramEventHandlers<A extends Any = Unknown> {
255
- onChange?: OnChange | null | undefined;
256
248
  onNavigateTo?: OnNavigateTo<A> | null | undefined;
257
249
  onNodeClick?: OnNodeClick<A> | null | undefined;
258
250
  onNodeContextMenu?: OnNodeClick<A> | null | undefined;
@@ -1,7 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { useCustomCompareMemo } from '@react-hookz/web';
3
- import { shallowEqual } from 'fast-equals';
4
- import { useContext } from 'react';
2
+ import { deepEqual } from 'fast-equals';
3
+ import { useContext, useState, useEffect } from 'react';
5
4
  import { LikeC4ProjectsContext } from './context/LikeC4ProjectsContext.js';
6
5
  import { useCallbackRef } from './hooks/useCallbackRef.js';
7
6
 
@@ -15,7 +14,12 @@ function LikeC4ProjectsProvider({
15
14
  console.warn("LikeC4ProjectsProvider should not be nested inside another one");
16
15
  }
17
16
  const onProjectChange = useCallbackRef(_onProjectChange);
18
- const value = useCustomCompareMemo(() => ({ projects, onProjectChange }), [projects, onProjectChange], shallowEqual);
17
+ const [value, setValue] = useState(() => ({ projects, onProjectChange }));
18
+ useEffect(() => {
19
+ setValue((current) => {
20
+ return deepEqual(current.projects, projects) ? current : { projects, onProjectChange };
21
+ });
22
+ }, [projects]);
19
23
  return /* @__PURE__ */ jsx(LikeC4ProjectsContext.Provider, { value, children });
20
24
  }
21
25
 
@@ -14,7 +14,7 @@ import { LikeC4Diagram } from './LikeC4Diagram.js';
14
14
  import { Overlay } from './overlays/overlay/Overlay.js';
15
15
  import { ShadowRoot } from './shadowroot/ShadowRoot.js';
16
16
  import { pickViewBounds } from './utils/view-bounds.js';
17
- import IconX from './node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
17
+ 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';
18
18
 
19
19
  const cssInteractive = css({
20
20
  cursor: "pointer",
@@ -104,7 +104,6 @@ function LikeC4View({
104
104
  LikeC4Diagram,
105
105
  {
106
106
  view,
107
- readonly: true,
108
107
  pannable,
109
108
  zoomable,
110
109
  background,
@@ -120,7 +119,6 @@ function LikeC4View({
120
119
  enableRelationshipBrowser,
121
120
  enableElementTags: false,
122
121
  controls,
123
- nodesDraggable: false,
124
122
  reduceGraphics,
125
123
  className: cx(
126
124
  "likec4-static-view",
@@ -156,8 +154,6 @@ function LikeC4View({
156
154
  enableElementTags: true,
157
155
  enableCompareWithLatest: true,
158
156
  controls: true,
159
- readonly: true,
160
- nodesDraggable: false,
161
157
  fitView: true,
162
158
  ...props,
163
159
  fitViewPadding: FitViewPaddings.withControls,
@@ -1,5 +1,4 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
- import { Except } from 'type-fest';
3
2
  import { LikeC4DiagramEventHandlers, LikeC4DiagramProperties } from './LikeC4Diagram.props';
4
3
  import type * as t from '@likec4/core/types';
5
4
  export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
@@ -27,9 +26,7 @@ export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
27
26
  /** Function to generate nonce attribute added to all generated `<style />` tags */
28
27
  styleNonce?: string | (() => string) | undefined;
29
28
  children?: ReactNode | undefined;
30
- } & Except<LikeC4DiagramProperties<A>, 'view', {
31
- requireExactProps: true;
32
- }> & LikeC4DiagramEventHandlers<A>;
29
+ } & Omit<LikeC4DiagramProperties<A>, 'view'> & LikeC4DiagramEventHandlers<A>;
33
30
  /**
34
31
  * Ready-to-use component to display embedded LikeC4 view, same as {@link LikeC4View}
35
32
  * But provides more control over the diagram
@@ -16,7 +16,6 @@ function StaticLikeC4Diagram({
16
16
  LikeC4Diagram,
17
17
  {
18
18
  view,
19
- readonly: true,
20
19
  className: cx(className, "likec4-static-view"),
21
20
  fitView,
22
21
  fitViewPadding,
@@ -34,7 +33,6 @@ function StaticLikeC4Diagram({
34
33
  enableFocusMode: false,
35
34
  enableSearch: false,
36
35
  nodesSelectable: false,
37
- nodesDraggable: false,
38
36
  enableElementTags: false,
39
37
  ...rest
40
38
  }
@@ -1,4 +1,5 @@
1
+ import { MemoExoticComponent } from 'react';
1
2
  /**
2
3
  * XYFlow requires handles to be defined on nodes.
3
4
  */
4
- export declare const DefaultHandles: () => import("react/jsx-runtime").JSX.Element;
5
+ export declare const DefaultHandles: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
@@ -1,21 +1,25 @@
1
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { Handle, Position } from '@xyflow/react';
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
+ import { Position, Handle } from '@xyflow/react';
3
+ import { memo, Fragment as Fragment$1 } from 'react';
3
4
 
4
- const style = {
5
- top: "50%",
6
- left: "50%",
7
- right: "unset",
8
- bottom: "unset",
9
- visibility: "hidden",
10
- width: 5,
11
- height: 5,
12
- transform: "translate(-50%, -50%)"
13
- };
14
- const DefaultHandles = () => /* @__PURE__ */ jsxs(Fragment, { children: [
15
- /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, style }),
16
- /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Left, style }),
17
- /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Right, style }),
18
- /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, style })
19
- ] });
5
+ const positions = [Position.Top, Position.Right, Position.Bottom, Position.Left];
6
+ const DefaultHandles = memo(() => /* @__PURE__ */ jsx(Fragment, { children: positions.map((position) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
7
+ /* @__PURE__ */ jsx(
8
+ Handle,
9
+ {
10
+ type: "source",
11
+ position,
12
+ className: "likec4-node-handle-center"
13
+ }
14
+ ),
15
+ /* @__PURE__ */ jsx(
16
+ Handle,
17
+ {
18
+ type: "target",
19
+ position,
20
+ className: "likec4-node-handle-center"
21
+ }
22
+ )
23
+ ] }, position)) }));
20
24
 
21
25
  export { DefaultHandles };
@@ -6,7 +6,7 @@ import { useDebouncedValue } from '@mantine/hooks';
6
6
  import * as m from 'motion/react-m';
7
7
  import { stopPropagation } from '../../utils/xyflow.js';
8
8
  import { compoundActionBtn } from './actionbtns.css.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';
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
10
 
11
11
  function CompoundActionButton({
12
12
  data: {
@@ -6,7 +6,7 @@ import { useDebouncedValue } from '@mantine/hooks';
6
6
  import * as m from 'motion/react-m';
7
7
  import { stopPropagation } from '../../utils/xyflow.js';
8
8
  import { compoundActionBtn } from './actionbtns.css.js';
9
- import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
9
+ import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
10
10
 
11
11
  function CompoundDetailsButton({
12
12
  data: {
@@ -3,7 +3,7 @@ import { cx } from '@likec4/styles/css';
3
3
  import { edgeActionBtn } from '@likec4/styles/recipes';
4
4
  import { ActionIcon } from '@mantine/core';
5
5
  import { stopPropagation } from '../../utils/xyflow.js';
6
- 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';
6
+ 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';
7
7
 
8
8
  function EdgeActionButton({ icon, onClick }) {
9
9
  return /* @__PURE__ */ jsx(
@@ -7,5 +7,5 @@ type EdgeContainerProps = PropsWithChildren<BaseEdgePropsWithData<Data> & {
7
7
  component?: 'g' | 'svg' | undefined;
8
8
  className?: string | undefined;
9
9
  }>;
10
- export declare function EdgeContainer({ className, component, selectable, selected, data: { color, hovered: isHovered, active: isActive, dimmed: isDimmed, ...data }, children, style, }: EdgeContainerProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function EdgeContainer({ className, component, selectable, selected, data: { color, hovered: isHovered, active: isActive, dimmed: isDimmed, ...data }, animated, children, style, }: EdgeContainerProps): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -1,7 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { invariant } from '@likec4/core';
3
3
  import { cx } from '@likec4/styles/css';
4
- import { edgeContainer } from './edge.css.js';
5
4
 
6
5
  function EdgeContainer({
7
6
  className,
@@ -15,13 +14,13 @@ function EdgeContainer({
15
14
  dimmed: isDimmed = false,
16
15
  ...data
17
16
  },
17
+ animated,
18
18
  children,
19
19
  style
20
20
  }) {
21
21
  const props = {
22
22
  className: cx(
23
23
  className,
24
- edgeContainer,
25
24
  "likec4-edge-container",
26
25
  selected && "selected",
27
26
  selectable && "selectable"
@@ -29,7 +28,7 @@ function EdgeContainer({
29
28
  "data-likec4-color": color,
30
29
  "data-edge-dir": data.dir ?? "forward",
31
30
  "data-edge-active": isActive,
32
- "data-edge-animated": isActive,
31
+ "data-edge-animated": animated || isActive,
33
32
  "data-likec4-hovered": isHovered,
34
33
  ...selected && {
35
34
  "data-likec4-selected": selected
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { isStepEdgeId, extractStep } from '@likec4/core';
3
- import { cx, css } from '@likec4/styles/css';
3
+ import { cx } from '@likec4/styles/css';
4
4
  import { Box } from '@likec4/styles/jsx';
5
5
  import { edgeLabel } from '@likec4/styles/recipes';
6
6
  import * as m from 'motion/react-m';
@@ -26,38 +26,38 @@ const EdgeLabel = forwardRef(({
26
26
  ...rest
27
27
  }, ref) => {
28
28
  const stepNum = isStepEdgeId(id) ? extractStep(id) : null;
29
- const classes = edgeLabel({
30
- pointerEvents,
31
- isStepEdge: stepNum !== null,
32
- cursor: selectable || stepNum !== null ? "pointer" : "default"
33
- });
34
29
  const hasLabel = isTruthy(label) || isTruthy(technology);
35
30
  return /* @__PURE__ */ jsxs(
36
31
  m.div,
37
32
  {
38
33
  ref,
39
- className: cx(classes.root, "likec4-edge-label", className),
34
+ className: cx(
35
+ // This class is queried by RelationshipPopover to position near the edge label
36
+ "likec4-edge-label",
37
+ edgeLabel({
38
+ pointerEvents,
39
+ isStepEdge: stepNum !== null,
40
+ cursor: selectable || stepNum !== null ? "pointer" : "default"
41
+ }),
42
+ className
43
+ ),
40
44
  "data-edge-id": id,
41
45
  animate: {
42
46
  scale: isHovered && !selected ? 1.06 : 1
43
47
  },
44
48
  ...rest,
45
49
  children: [
46
- stepNum !== null && /* @__PURE__ */ jsx(Box, { className: classes.stepNumber, children: stepNum }),
47
- hasLabel && /* @__PURE__ */ jsxs(Box, { className: classes.labelContents, children: [
50
+ stepNum !== null && /* @__PURE__ */ jsx(Box, { className: "likec4-edge-label__step-number", children: stepNum }),
51
+ hasLabel && /* @__PURE__ */ jsxs(Box, { className: "likec4-edge-label__contents", children: [
48
52
  isTruthy(label) && /* @__PURE__ */ jsx(
49
53
  Box,
50
54
  {
51
- className: cx(
52
- classes.labelText,
53
- css({
54
- lineClamp: 5
55
- })
56
- ),
55
+ lineClamp: 5,
56
+ className: "likec4-edge-label__text",
57
57
  children: label
58
58
  }
59
59
  ),
60
- isTruthy(technology) && /* @__PURE__ */ jsx(Box, { className: classes.labelTechnology, children: "[ " + technology + " ]" }),
60
+ isTruthy(technology) && /* @__PURE__ */ jsx(Box, { className: "likec4-edge-label__technology", children: "[ " + technology + " ]" }),
61
61
  children
62
62
  ] })
63
63
  ]
@@ -14,5 +14,5 @@ type EdgeLabelContainerProps = HTMLAttributes<HTMLDivElement> & {
14
14
  } | undefined;
15
15
  edgeProps: BaseEdgePropsWithData<Data>;
16
16
  };
17
- export declare function EdgeLabelContainer({ edgeProps: { id, selected, data: { hovered: isHovered, active: isActive, dimmed: isDimmed, labelBBox, color, }, }, labelPosition: labelXY, className, style, children, ...rest }: EdgeLabelContainerProps): import("react/jsx-runtime").JSX.Element | null;
17
+ export declare function EdgeLabelContainer({ edgeProps: { id, selected, data: { hovered: isHovered, active: isActive, dimmed: isDimmed, labelBBox, color, }, animated, }, labelPosition: labelXY, className, style, children, ...rest }: EdgeLabelContainerProps): import("react/jsx-runtime").JSX.Element | null;
18
18
  export {};
@@ -20,7 +20,8 @@ function EdgeLabelContainer({
20
20
  dimmed: isDimmed = false,
21
21
  labelBBox,
22
22
  color = "gray"
23
- }
23
+ },
24
+ animated
24
25
  },
25
26
  labelPosition: labelXY,
26
27
  className,
@@ -40,7 +41,7 @@ function EdgeLabelContainer({
40
41
  if (labelX === void 0 || labelY === void 0) {
41
42
  return null;
42
43
  }
43
- const translate = labelXY?.translate;
44
+ const translate = labelXY?.translate ?? "";
44
45
  return /* @__PURE__ */ jsx(EdgeLabelRenderer, { children: /* @__PURE__ */ jsx(
45
46
  "div",
46
47
  {
@@ -53,7 +54,7 @@ function EdgeLabelContainer({
53
54
  "data-likec4-hovered": isHovered,
54
55
  "data-likec4-color": color,
55
56
  "data-edge-active": isActive,
56
- "data-edge-animated": isActive,
57
+ "data-edge-animated": animated || isActive,
57
58
  ...selected !== false && {
58
59
  "data-likec4-selected": selected
59
60
  },
@@ -66,7 +67,7 @@ function EdgeLabelContainer({
66
67
  },
67
68
  zIndex,
68
69
  ...style,
69
- transform: `translate(${toCssVarValue(labelX)}, ${toCssVarValue(labelY)}) ${translate || ""}`
70
+ transform: `translate(${toCssVarValue(labelX)}, ${toCssVarValue(labelY)}) ${translate}`
70
71
  },
71
72
  children
72
73
  },
@@ -1,7 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { cx, css } from '@likec4/styles/css';
3
+ import { edgePath } from '@likec4/styles/recipes';
3
4
  import { forwardRef } from 'react';
4
- import { markerContext, edgePathBg, cssEdgePath } from './edge.css.js';
5
5
  import { arrowTypeToMarker, EdgeMarkers } from './EdgeMarkers.js';
6
6
 
7
7
  const EdgePath = forwardRef(({
@@ -38,6 +38,7 @@ const EdgePath = forwardRef(({
38
38
  } else if (isDashed) {
39
39
  strokeDasharray = "8,10";
40
40
  }
41
+ const classes = edgePath();
41
42
  return /* @__PURE__ */ jsxs(Fragment, { children: [
42
43
  selectable && /* @__PURE__ */ jsx(
43
44
  "path",
@@ -62,21 +63,17 @@ const EdgePath = forwardRef(({
62
63
  "circle",
63
64
  {
64
65
  className: cx(
65
- "edge-center-point",
66
- css({
67
- visibility: "hidden",
68
- offsetDistance: "50%"
69
- })
66
+ // This class is queried by RelationshipPopover to position in the middle of the edge
67
+ "likec4-edge-middle-point",
68
+ classes.middlePoint
70
69
  ),
70
+ "data-edge-id": id,
71
71
  style: {
72
72
  offsetPath: `path("${svgPath}")`
73
- },
74
- cx: 0,
75
- cy: 0,
76
- r: 2
73
+ }
77
74
  }
78
75
  ),
79
- /* @__PURE__ */ jsxs("g", { className: markerContext, onPointerDown: onEdgePointerDown, children: [
76
+ /* @__PURE__ */ jsxs("g", { className: classes.markersCtx, onPointerDown: onEdgePointerDown, children: [
80
77
  /* @__PURE__ */ jsxs("defs", { children: [
81
78
  MarkerStart && /* @__PURE__ */ jsx(MarkerStart, { id: "start" + id }),
82
79
  MarkerEnd && /* @__PURE__ */ jsx(MarkerEnd, { id: "end" + id })
@@ -87,14 +84,13 @@ const EdgePath = forwardRef(({
87
84
  className: cx(
88
85
  "react-flow__edge-path",
89
86
  "hide-on-reduced-graphics",
90
- edgePathBg,
87
+ classes.pathBg,
91
88
  isDragging && css({ display: "none" })
92
89
  ),
93
90
  d: svgPath,
94
91
  style,
95
92
  strokeLinecap: "round"
96
- },
97
- "edge-path-bg"
93
+ }
98
94
  ),
99
95
  /* @__PURE__ */ jsx(
100
96
  "path",
@@ -102,8 +98,8 @@ const EdgePath = forwardRef(({
102
98
  ref: svgPathRef,
103
99
  className: cx(
104
100
  "react-flow__edge-path",
105
- selectable && "react-flow__edge-interaction",
106
- cssEdgePath
101
+ classes.path,
102
+ selectable && "react-flow__edge-interaction"
107
103
  ),
108
104
  d: svgPath,
109
105
  style,
@@ -112,8 +108,7 @@ const EdgePath = forwardRef(({
112
108
  strokeDasharray,
113
109
  markerStart: MarkerStart ? `url(#start${id})` : void 0,
114
110
  markerEnd: MarkerEnd ? `url(#end${id})` : void 0
115
- },
116
- "edge-path"
111
+ }
117
112
  )
118
113
  ] })
119
114
  ] });
@@ -7,7 +7,7 @@ import { ActionIcon } from '@mantine/core';
7
7
  import { useId } from '@mantine/hooks';
8
8
  import * as m from 'motion/react-m';
9
9
  import { stopPropagation } from '../../utils/xyflow.js';
10
- import IconBolt from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js';
10
+ import IconBolt from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js';
11
11
 
12
12
  const container = hstack({
13
13
  position: "absolute",
@@ -5,7 +5,7 @@ import { actionBtn } from '@likec4/styles/recipes';
5
5
  import { ActionIcon } from '@mantine/core';
6
6
  import * as m from 'motion/react-m';
7
7
  import { stopPropagation } from '../../utils/xyflow.js';
8
- import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
8
+ import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
9
9
 
10
10
  const container = css({
11
11
  position: "absolute",
@@ -4,7 +4,7 @@ import { memo } from 'react';
4
4
  function nodePropsEqual(prev, next) {
5
5
  return prev.id === next.id && deepEqual(prev.type, next.type) && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.dragging ?? false, next.dragging ?? false) && deepEqual(prev.width ?? 0, next.width ?? 0) && deepEqual(prev.height ?? 0, next.height ?? 0) && deepEqual(prev.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(prev.data, next.data);
6
6
  }
7
- const isMemoized = Symbol.for("isMemoized");
7
+ const isMemoized = /* @__PURE__ */ Symbol.for("isMemoized");
8
8
  function memoNode(Node, displayName = "Node") {
9
9
  if (Node.hasOwnProperty(isMemoized)) {
10
10
  return Node;
@@ -4,7 +4,7 @@ import { HStack, VStack } from '@likec4/styles/jsx';
4
4
  import { ThemeIcon, Text, ScrollAreaAutosize, Button } from '@mantine/core';
5
5
  import { useRef, useEffect } from 'react';
6
6
  import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
7
- 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';
7
+ 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';
8
8
 
9
9
  function ErrorFallback({ error, resetErrorBoundary }) {
10
10
  const errorString = error instanceof Error ? error.message : "Unknown error";
@@ -4,8 +4,8 @@ import { styled } from '@likec4/styles/jsx';
4
4
  import { Badge, CopyButton, ActionIcon } from '@mantine/core';
5
5
  import { forwardRef } from 'react';
6
6
  import { GithubIcon } from './GithubIcon.js';
7
- import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
8
- import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js';
7
+ import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
8
+ import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js';
9
9
 
10
10
  const GITHUB_PREFIX = "https://github.com/";
11
11
  const Link = forwardRef(
@@ -4,7 +4,6 @@ import { useContext, createContext, useMemo } from 'react';
4
4
  import { keys, isFunction, mapToObj } from 'remeda';
5
5
 
6
6
  const defaultHandlers = {
7
- onChange: null,
8
7
  onNavigateTo: null,
9
8
  onNodeClick: null,
10
9
  onNodeContextMenu: null,
@@ -1,6 +1,6 @@
1
1
  import { ExclusiveUnion } from '@likec4/core/types';
2
2
  import { PropsWithChildren } from 'react';
3
- declare const FeatureNames: readonly ["Controls", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "FitView", "CompareWithLatest", "Vscode", "ElementTags"];
3
+ declare const FeatureNames: readonly ["Controls", "Editor", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "FitView", "CompareWithLatest", "Vscode", "ElementTags"];
4
4
  export type FeatureName = typeof FeatureNames[number];
5
5
  export type TogglableFeature = ('ReadOnly' | 'CompareWithLatest') & FeatureName;
6
6
  export type EnabledFeatures = {
@@ -3,6 +3,7 @@ import { shallowEqual } from 'fast-equals';
3
3
  import { useContext, createContext, useState, useEffect } from 'react';
4
4
 
5
5
  const DefaultFeatures = {
6
+ enableEditor: false,
6
7
  enableReadOnly: true,
7
8
  enableCompareWithLatest: false,
8
9
  enableControls: false,
@@ -1,6 +1,7 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { MantineContext, MantineProvider } from '@mantine/core';
3
3
  import { useContext, useEffect } from 'react';
4
+ import { DefaultTheme } from '../shadowroot/styles.css.js';
4
5
 
5
6
  function EnsureMantine({ children }) {
6
7
  const mantineCtx = useContext(MantineContext);
@@ -10,7 +11,7 @@ function EnsureMantine({ children }) {
10
11
  }
11
12
  }, []);
12
13
  if (!mantineCtx) {
13
- return /* @__PURE__ */ jsx(MantineProvider, { defaultColorScheme: "auto", children });
14
+ return /* @__PURE__ */ jsx(MantineProvider, { defaultColorScheme: "auto", theme: DefaultTheme, children });
14
15
  }
15
16
  return /* @__PURE__ */ jsx(Fragment, { children });
16
17
  }