@likec4/diagram 1.55.1 → 1.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/dist/LikeC4Diagram.js +150 -194
  2. package/dist/LikeC4ModelProvider.js +13 -9
  3. package/dist/LikeC4ProjectsOverview.js +24 -30
  4. package/dist/LikeC4ProjectsProvider.js +33 -26
  5. package/dist/LikeC4Styles.js +40 -57
  6. package/dist/LikeC4View.js +148 -196
  7. package/dist/ReactLikeC4.js +43 -65
  8. package/dist/StaticLikeC4Diagram.js +36 -41
  9. package/dist/_virtual/_rolldown/runtime.js +17 -0
  10. package/dist/adhoc-editor/EditorPanel.js +102 -101
  11. package/dist/adhoc-editor/ElementsTree.js +109 -139
  12. package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +77 -70
  13. package/dist/adhoc-editor/components/Tree.d.ts +2 -2
  14. package/dist/adhoc-editor/components/Tree.js +205 -288
  15. package/dist/adhoc-editor/hooks.js +28 -23
  16. package/dist/adhoc-editor/index.js +2 -1
  17. package/dist/adhoc-editor/state/ActorProvider.js +33 -36
  18. package/dist/adhoc-editor/state/actor.editor.js +148 -186
  19. package/dist/adhoc-editor/state/actor.js +12 -14
  20. package/dist/adhoc-editor/state/actor.layouter.js +49 -65
  21. package/dist/adhoc-editor/state/actor.types.js +19 -23
  22. package/dist/adhoc-editor/state/panel.js +112 -127
  23. package/dist/adhoc-editor/state/utils.js +22 -29
  24. package/dist/adhoc-editor/useElementsTree.js +89 -121
  25. package/dist/base/Background.js +26 -29
  26. package/dist/base/Base.js +34 -41
  27. package/dist/base/BaseXYFlow.js +135 -165
  28. package/dist/base/const.js +18 -19
  29. package/dist/base/updateEdges.js +38 -57
  30. package/dist/base/updateNodes.js +46 -65
  31. package/dist/base-primitives/Markdown.d.ts +1 -1
  32. package/dist/base-primitives/Markdown.js +32 -47
  33. package/dist/base-primitives/NodeHandles.js +39 -49
  34. package/dist/base-primitives/compound/CompoundActionButton.js +49 -69
  35. package/dist/base-primitives/compound/CompoundDetailsButton.js +39 -64
  36. package/dist/base-primitives/compound/CompoundNodeContainer.js +46 -66
  37. package/dist/base-primitives/compound/CompoundTitle.js +15 -12
  38. package/dist/base-primitives/compound/actionbtns.css.js +9 -18
  39. package/dist/base-primitives/edge/EdgeActionButton.js +17 -19
  40. package/dist/base-primitives/edge/EdgeContainer.js +29 -48
  41. package/dist/base-primitives/edge/EdgeLabel.js +44 -65
  42. package/dist/base-primitives/edge/EdgeLabelContainer.js +35 -73
  43. package/dist/base-primitives/edge/EdgeMarkers.js +157 -215
  44. package/dist/base-primitives/edge/EdgePath.js +62 -115
  45. package/dist/base-primitives/element/ElementActionButtons.js +92 -81
  46. package/dist/base-primitives/element/ElementData.js +107 -126
  47. package/dist/base-primitives/element/ElementDetailsButton.js +78 -98
  48. package/dist/base-primitives/element/ElementNodeContainer.js +51 -82
  49. package/dist/base-primitives/element/ElementShape.js +331 -317
  50. package/dist/base-primitives/element/ElementTags.d.ts +1 -1
  51. package/dist/base-primitives/element/ElementTags.js +133 -193
  52. package/dist/base-primitives/memoEdge.js +11 -10
  53. package/dist/base-primitives/memoNode.js +16 -20
  54. package/dist/components/ErrorFallback.js +111 -75
  55. package/dist/components/GithubIcon.js +14 -16
  56. package/dist/components/Link.js +99 -113
  57. package/dist/components/Logo.js +38 -41
  58. package/dist/components/NavigationLink.js +15 -23
  59. package/dist/components/NavigationPanel.js +26 -47
  60. package/dist/components/PortalToContainer.js +16 -10
  61. package/dist/components/RootContainer.js +36 -31
  62. package/dist/components/SearchControl.css.js +65 -75
  63. package/dist/components/SearchControl.js +36 -14
  64. package/dist/components/ViewNotFound.js +22 -29
  65. package/dist/context/CurrentViewModelProvider.js +11 -9
  66. package/dist/context/DefaultMantineProvider.js +45 -72
  67. package/dist/context/DiagramEventHandlers.js +43 -48
  68. package/dist/context/DiagramFeatures.d.ts +1 -1
  69. package/dist/context/DiagramFeatures.js +78 -69
  70. package/dist/context/EnsureMantine.js +13 -16
  71. package/dist/context/FramerMotionConfig.js +17 -11
  72. package/dist/context/IconRenderer.js +90 -106
  73. package/dist/context/LikeC4ModelContext.js +14 -10
  74. package/dist/context/LikeC4ProjectsContext.js +7 -6
  75. package/dist/context/RootContainerContext.d.ts +9 -19
  76. package/dist/context/RootContainerContext.js +14 -28
  77. package/dist/context/TagStylesContext.js +49 -57
  78. package/dist/custom/customNodes.js +224 -28
  79. package/dist/custom/index.d.ts +1 -1
  80. package/dist/custom/index.js +40 -40
  81. package/dist/editor/LikeC4EditorCallbacks.d.ts +5 -0
  82. package/dist/editor/LikeC4EditorCallbacks.js +4 -2
  83. package/dist/editor/LikeC4EditorProvider.js +32 -7
  84. package/dist/editor/actor/actions.d.ts +115 -0
  85. package/dist/editor/actor/actions.js +122 -0
  86. package/dist/editor/{hotkeyActor.d.ts → actor/hotkey.d.ts} +1 -1
  87. package/dist/editor/actor/hotkey.js +20 -0
  88. package/dist/editor/actor/machine.d.ts +11 -0
  89. package/dist/editor/actor/machine.js +22 -0
  90. package/dist/editor/{editorActor.setup.d.ts → actor/setup.d.ts} +13 -49
  91. package/dist/editor/actor/setup.js +35 -0
  92. package/dist/editor/actor/state.editor.d.ts +97 -0
  93. package/dist/editor/actor/state.editor.js +55 -0
  94. package/dist/editor/actor/state.sync-queue.d.ts +420 -0
  95. package/dist/editor/actor/state.sync-queue.js +235 -0
  96. package/dist/editor/actor/types.d.ts +59 -0
  97. package/dist/editor/actor/types.js +5 -0
  98. package/dist/editor/applyChangesToManualLayout.js +144 -163
  99. package/dist/editor/index.d.ts +2 -1
  100. package/dist/editor/useEditorActorLogic.d.ts +8 -2
  101. package/dist/editor/useEditorActorLogic.js +51 -43
  102. package/dist/hooks/safeContext.js +17 -17
  103. package/dist/hooks/useCallbackRef.js +18 -11
  104. package/dist/hooks/useCurrentView.js +16 -7
  105. package/dist/hooks/useCurrentViewModel.js +14 -9
  106. package/dist/hooks/useDiagram.js +60 -37
  107. package/dist/hooks/useDiagramCompareLayout.js +77 -81
  108. package/dist/hooks/useEditorActor.d.ts +4 -0
  109. package/dist/hooks/useEditorActor.js +26 -0
  110. package/dist/hooks/useId.js +8 -6
  111. package/dist/hooks/useLikeC4ElementsTree.d.ts +3 -2
  112. package/dist/hooks/useLikeC4ElementsTree.js +24 -21
  113. package/dist/hooks/useLikeC4Model.js +21 -20
  114. package/dist/hooks/useLikeC4Project.js +40 -29
  115. package/dist/hooks/useLikeC4Styles.js +6 -6
  116. package/dist/hooks/useMantinePortalProps.js +10 -6
  117. package/dist/hooks/useSetState.js +21 -19
  118. package/dist/hooks/useUpdateEffect.js +18 -29
  119. package/dist/hooks/useXYFlow.js +13 -15
  120. package/dist/index.js +24 -23
  121. package/dist/likec4diagram/DiagramUI.js +37 -37
  122. package/dist/likec4diagram/DiagramXYFlow.js +215 -224
  123. package/dist/likec4diagram/convert-to-xyflow.js +21 -22
  124. package/dist/likec4diagram/custom/edges/EdgeDrifts.js +22 -32
  125. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +275 -372
  126. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +71 -75
  127. package/dist/likec4diagram/custom/edges/edges.css.js +41 -47
  128. package/dist/likec4diagram/custom/edges/useControlPoints.js +52 -56
  129. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +54 -76
  130. package/dist/likec4diagram/custom/index.js +17 -17
  131. package/dist/likec4diagram/custom/nodes/CompoundActions.js +19 -26
  132. package/dist/likec4diagram/custom/nodes/ElementActions.js +131 -82
  133. package/dist/likec4diagram/custom/nodes/NodeDrifts.js +20 -26
  134. package/dist/likec4diagram/custom/nodes/NodeNotes.js +215 -273
  135. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +131 -147
  136. package/dist/likec4diagram/custom/nodes/nodes.js +135 -146
  137. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +155 -159
  138. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +58 -86
  139. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +108 -164
  140. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +56 -68
  141. package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +3 -6
  142. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +97 -102
  143. package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +13 -13
  144. package/dist/likec4diagram/custom/nodes/toolbar/types.js +6 -5
  145. package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +36 -41
  146. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +510 -541
  147. package/dist/likec4diagram/relationship-popover/actor.js +113 -152
  148. package/dist/likec4diagram/relationship-popover/components.js +39 -43
  149. package/dist/likec4diagram/state/DiagramActorProvider.js +135 -136
  150. package/dist/likec4diagram/state/aligners.js +286 -360
  151. package/dist/likec4diagram/state/assign.js +84 -108
  152. package/dist/likec4diagram/state/createViewChange.js +72 -92
  153. package/dist/likec4diagram/state/diagram-api.d.ts +16 -0
  154. package/dist/likec4diagram/state/diagram-api.js +230 -152
  155. package/dist/likec4diagram/state/hotkeyActor.js +54 -45
  156. package/dist/likec4diagram/state/machine.actions.js +708 -821
  157. package/dist/likec4diagram/state/machine.actions.layout.js +154 -183
  158. package/dist/likec4diagram/state/machine.d.ts +1 -1
  159. package/dist/likec4diagram/state/machine.js +113 -134
  160. package/dist/likec4diagram/state/machine.setup.js +104 -113
  161. package/dist/likec4diagram/state/machine.state.initializing.js +54 -54
  162. package/dist/likec4diagram/state/machine.state.navigating.js +192 -227
  163. package/dist/likec4diagram/state/machine.state.ready.focused.js +72 -88
  164. package/dist/likec4diagram/state/machine.state.ready.idle.js +79 -98
  165. package/dist/likec4diagram/state/machine.state.ready.js +126 -202
  166. package/dist/likec4diagram/state/machine.state.ready.printing.js +38 -39
  167. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +153 -193
  168. package/dist/likec4diagram/state/mediaPrintActor.js +20 -16
  169. package/dist/likec4diagram/state/persistence.js +20 -21
  170. package/dist/likec4diagram/state/types.d.ts +1 -1
  171. package/dist/likec4diagram/state/utils.d.ts +1 -1
  172. package/dist/likec4diagram/state/utils.js +131 -162
  173. package/dist/likec4diagram/ui/LayoutDriftFrame.js +53 -64
  174. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +58 -80
  175. package/dist/likec4diagram/ui/notation/NotationPanel.js +183 -214
  176. package/dist/likec4diagram/useLayoutConstraints.js +388 -433
  177. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +216 -227
  178. package/dist/likec4diagram/xyflow-sequence/const.js +11 -7
  179. package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +177 -180
  180. package/dist/navigationpanel/NavigationPanel.js +113 -123
  181. package/dist/navigationpanel/NavigationPanelControls.js +124 -150
  182. package/dist/navigationpanel/NavigationPanelDropdown.js +365 -477
  183. package/dist/navigationpanel/_common.d.ts +4 -10
  184. package/dist/navigationpanel/_common.js +57 -70
  185. package/dist/navigationpanel/actor.js +153 -236
  186. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +66 -83
  187. package/dist/navigationpanel/comparepanel/ComparePanel.js +135 -164
  188. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +50 -58
  189. package/dist/navigationpanel/comparepanel/DriftsSummary.js +207 -254
  190. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +33 -35
  191. package/dist/navigationpanel/controls/DetailsControls.js +219 -246
  192. package/dist/navigationpanel/controls/LayoutWarning.js +89 -100
  193. package/dist/navigationpanel/controls/LogoButton.js +46 -70
  194. package/dist/navigationpanel/controls/NavigationButtons.js +35 -52
  195. package/dist/navigationpanel/controls/OpenSource.js +27 -25
  196. package/dist/navigationpanel/controls/SearchControl.js +50 -61
  197. package/dist/navigationpanel/controls/ToggleReadonly.js +86 -81
  198. package/dist/navigationpanel/dropdown/ProjectsMenu.js +69 -87
  199. package/dist/navigationpanel/editorpanel/ApplySemanticLayout.d.ts +4 -0
  200. package/dist/navigationpanel/editorpanel/ApplySemanticLayout.js +36 -0
  201. package/dist/navigationpanel/editorpanel/CenterCamera.js +17 -13
  202. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +182 -154
  203. package/dist/navigationpanel/editorpanel/EditorPanel.js +59 -45
  204. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +122 -173
  205. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +20 -13
  206. package/dist/navigationpanel/editorpanel/_common.d.ts +3 -6
  207. package/dist/navigationpanel/editorpanel/_common.js +13 -13
  208. package/dist/navigationpanel/editorpanel/styles.js +58 -75
  209. package/dist/navigationpanel/hooks.js +35 -29
  210. package/dist/navigationpanel/styles.css.js +20 -28
  211. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +107 -134
  212. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +65 -65
  213. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +105 -120
  214. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +75 -83
  215. package/dist/overlays/Overlays.js +94 -112
  216. package/dist/overlays/element-details/ElementDetails.js +22 -28
  217. package/dist/overlays/element-details/ElementDetailsCard.css.js +198 -221
  218. package/dist/overlays/element-details/ElementDetailsCard.js +517 -499
  219. package/dist/overlays/element-details/MetadataValue.js +210 -250
  220. package/dist/overlays/element-details/TabPanelDeployments.css.js +40 -60
  221. package/dist/overlays/element-details/TabPanelDeployments.js +185 -178
  222. package/dist/overlays/element-details/TabPanelRelationships.css.js +63 -71
  223. package/dist/overlays/element-details/TabPanelRelationships.js +155 -140
  224. package/dist/overlays/element-details/TabPanelStructure.css.js +29 -33
  225. package/dist/overlays/element-details/TabPanelStructure.js +93 -93
  226. package/dist/overlays/element-details/actor.js +45 -55
  227. package/dist/overlays/element-details/actorContext.js +12 -10
  228. package/dist/overlays/overlay/Overlay.d.ts +16 -0
  229. package/dist/overlays/overlay/Overlay.js +102 -151
  230. package/dist/overlays/overlaysActor.js +215 -265
  231. package/dist/overlays/relationship-details/RelationshipDetails.js +270 -253
  232. package/dist/overlays/relationship-details/SelectEdge.css.js +62 -74
  233. package/dist/overlays/relationship-details/SelectEdge.js +146 -126
  234. package/dist/overlays/relationship-details/actor.js +242 -303
  235. package/dist/overlays/relationship-details/compute.js +109 -135
  236. package/dist/overlays/relationship-details/custom/ElementActions.js +43 -56
  237. package/dist/overlays/relationship-details/custom/edgeTypes.js +43 -49
  238. package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +4 -5
  239. package/dist/overlays/relationship-details/custom/nodeTypes.js +96 -121
  240. package/dist/overlays/relationship-details/hooks.js +44 -38
  241. package/dist/overlays/relationship-details/layout-to-xyflow.js +119 -141
  242. package/dist/overlays/relationship-details/layout.js +275 -304
  243. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +319 -321
  244. package/dist/overlays/relationships-browser/SelectElement.css.js +18 -21
  245. package/dist/overlays/relationships-browser/SelectElement.js +192 -218
  246. package/dist/overlays/relationships-browser/actor.js +364 -462
  247. package/dist/overlays/relationships-browser/const.js +7 -6
  248. package/dist/overlays/relationships-browser/custom/ElementActions.js +60 -63
  249. package/dist/overlays/relationships-browser/custom/EmptyNode.js +25 -29
  250. package/dist/overlays/relationships-browser/custom/edgeTypes.js +66 -99
  251. package/dist/overlays/relationships-browser/custom/nodeTypes.js +98 -123
  252. package/dist/overlays/relationships-browser/hooks.js +49 -51
  253. package/dist/overlays/relationships-browser/layout.js +413 -465
  254. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +141 -157
  255. package/dist/projects-overview/ProjectsOverview.js +56 -55
  256. package/dist/projects-overview/ProjectsOverviewXY.js +105 -94
  257. package/dist/projects-overview/actor.js +252 -345
  258. package/dist/projects-overview/context.js +8 -7
  259. package/dist/projects-overview/custom/edgeTypes.js +22 -21
  260. package/dist/projects-overview/custom/nodeTypes.js +38 -42
  261. package/dist/projects-overview/hooks.js +9 -9
  262. package/dist/projects-overview/layouted-to-xyflow.js +46 -42
  263. package/dist/projects-overview/panel/ProjectsOverviewPanel.js +7 -9
  264. package/dist/projects-overview/persistence.js +22 -22
  265. package/dist/search/Search.d.ts +6 -3
  266. package/dist/search/Search.js +189 -182
  267. package/dist/search/SearchContext.js +16 -15
  268. package/dist/search/XStateSearchAdapter.js +68 -62
  269. package/dist/search/components/ElementsColumn.css.js +50 -68
  270. package/dist/search/components/ElementsColumn.js +253 -291
  271. package/dist/search/components/PickView.js +116 -140
  272. package/dist/search/components/SearchByTags.js +76 -94
  273. package/dist/search/components/SearchInput.js +187 -209
  274. package/dist/search/components/ViewsColum.js +151 -141
  275. package/dist/search/components/ViewsColumn.css.js +12 -26
  276. package/dist/search/components/_shared.css.js +127 -153
  277. package/dist/search/components/styles.css.js +47 -53
  278. package/dist/search/components/utils.js +44 -47
  279. package/dist/search/hooks.js +10 -10
  280. package/dist/search/searchActor.js +97 -128
  281. package/dist/shadowroot/ShadowRoot.d.ts +7 -6
  282. package/dist/shadowroot/ShadowRoot.js +106 -79
  283. package/dist/shadowroot/styles.css.d.ts +10 -2
  284. package/dist/shadowroot/styles.css.js +56 -69
  285. package/dist/styles-font2.js +4 -0
  286. package/dist/styles2.js +4 -0
  287. package/dist/utils/index.js +5 -0
  288. package/dist/utils/roundDpr.js +19 -15
  289. package/dist/utils/view-bounds.js +48 -55
  290. package/dist/utils/xyflow.js +143 -113
  291. package/package.json +18 -25
  292. package/panda.buildinfo.json +15 -15
  293. package/src/styles-font.css +114 -0
  294. package/src/styles-min.css +2 -0
  295. package/src/styles-xyflow.css +1 -0
  296. package/src/styles.css +3 -0
  297. package/styles-font.css +1 -1
  298. package/styles-min.css +1 -1
  299. package/styles-xyflow.css +1 -1
  300. package/styles.css +1 -1
  301. package/dist/_virtual/_commonjsHelpers.js +0 -3
  302. package/dist/_virtual/assign-f10db67b.cjs.js +0 -3
  303. package/dist/_virtual/log-30abbb83.cjs.js +0 -3
  304. package/dist/_virtual/raise-f051f097.cjs.js +0 -3
  305. package/dist/_virtual/store-cfe7da62.cjs.js +0 -3
  306. package/dist/_virtual/xstate-actions.cjs.js +0 -5
  307. package/dist/_virtual/xstate-actions.cjs2.js +0 -3
  308. package/dist/_virtual/xstate-dev.cjs.js +0 -3
  309. package/dist/_virtual/xstate-guards.cjs.js +0 -5
  310. package/dist/_virtual/xstate-guards.cjs2.js +0 -3
  311. package/dist/_virtual/xstate-store-react.cjs.js +0 -5
  312. package/dist/_virtual/xstate-store-react.cjs2.js +0 -3
  313. package/dist/bundle/index.d.ts +0 -1
  314. package/dist/editor/editorActor.actions.d.ts +0 -153
  315. package/dist/editor/editorActor.actions.js +0 -149
  316. package/dist/editor/editorActor.setup.js +0 -38
  317. package/dist/editor/editorActor.states.d.ts +0 -9
  318. package/dist/editor/editorActor.states.js +0 -273
  319. package/dist/editor/hotkeyActor.js +0 -19
  320. package/dist/hooks/useOverlaysActor.js +0 -10
  321. package/dist/hooks/useSearchActor.js +0 -10
  322. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -41
  323. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -30
  324. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -14
  325. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -14
  326. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -14
  327. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -14
  328. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -14
  329. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -14
  330. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -14
  331. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -14
  332. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -14
  333. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -14
  334. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
  335. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -14
  336. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -14
  337. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -14
  338. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -14
  339. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -14
  340. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +0 -14
  341. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
  342. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -14
  343. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -14
  344. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
  345. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -14
  346. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -14
  347. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -14
  348. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -14
  349. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -14
  350. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -14
  351. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -14
  352. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -14
  353. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -14
  354. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -14
  355. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -14
  356. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -14
  357. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -14
  358. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -14
  359. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -14
  360. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -14
  361. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -14
  362. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -14
  363. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -14
  364. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
  365. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -14
  366. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -14
  367. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -14
  368. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -14
  369. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -14
  370. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -14
  371. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +0 -14
  372. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -14
  373. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -14
  374. package/dist/node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -14
  375. package/dist/node_modules/.pnpm/@xstate_store@3.17.1_react@19.2.4/node_modules/@xstate/store/dist/store-cfe7da62.cjs.js +0 -761
  376. package/dist/node_modules/.pnpm/@xstate_store@3.17.1_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +0 -180
  377. package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/actions/dist/xstate-actions.cjs.js +0 -37
  378. package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/dev/dist/xstate-dev.cjs.js +0 -59
  379. package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/dist/assign-f10db67b.cjs.js +0 -140
  380. package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/dist/log-30abbb83.cjs.js +0 -401
  381. package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/dist/raise-f051f097.cjs.js +0 -2830
  382. package/dist/node_modules/.pnpm/xstate@5.30.0/node_modules/xstate/guards/dist/xstate-guards.cjs.js +0 -26
  383. package/dist/styles-font.css2.js +0 -3
  384. package/dist/styles.css2.js +0 -3
@@ -1,551 +1,520 @@
1
- import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
- import { autoUpdate, computePosition, offset, autoPlacement, size, hide } from '@floating-ui/dom';
3
- import { nameFromFqn } from '@likec4/core';
4
- import { cx, css } from '@likec4/styles/css';
5
- import { VStack, HStack, Box, styled } from '@likec4/styles/jsx';
6
- import { bleed } from '@likec4/styles/patterns';
7
- import { Divider, ScrollAreaAutosize, Button, TooltipGroup, ActionIcon, Text, Tooltip as Tooltip$1 } from '@mantine/core';
8
- import { useActorRef, useSelector } from '@xstate/react';
9
- import { shallowEqual } from 'fast-equals';
10
- import { memo, useEffect, useCallback, useRef, useState, useLayoutEffect, Fragment, forwardRef } from 'react';
11
- import { isEmpty, pipe, map, filter, isTruthy, partition, clamp, entries } from 'remeda';
12
- import { Link } from '../../components/Link.js';
13
- import { PortalToContainer } from '../../components/PortalToContainer.js';
14
- import { useDiagramEventHandlers } from '../../context/DiagramEventHandlers.js';
15
- import { useEnabledFeatures } from '../../context/DiagramFeatures.js';
16
- import { useDiagramContext, useOnDiagramEvent } from '../../hooks/useDiagram.js';
17
- import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
18
- import { findDiagramEdge, findDiagramNode } from '../state/utils.js';
19
- import { RelationshipPopoverActorLogic } from './actor.js';
20
- import { Endpoint, RelationshipTitle } from './components.js';
21
- import { useDiagram } from '../../hooks/safeContext.js';
22
- import { useRootContainerRef } from '../../context/RootContainerContext.js';
23
- import { roundDpr } from '../../utils/roundDpr.js';
24
- import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
25
- import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
26
- import IconFileSymlink from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
27
- import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.40.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
28
- import { Markdown } from '../../base-primitives/Markdown.js';
29
-
1
+ import "../../_virtual/_rolldown/runtime.js";
2
+ import { roundDpr } from "../../utils/roundDpr.js";
3
+ import { useRootContainerRef } from "../../context/RootContainerContext.js";
4
+ import { useDiagramEventHandlers } from "../../context/DiagramEventHandlers.js";
5
+ import { useEnabledFeatures } from "../../context/DiagramFeatures.js";
6
+ import { useDiagram } from "../../hooks/safeContext.js";
7
+ import { useDiagramContext, useOnDiagramEvent } from "../../hooks/useDiagram.js";
8
+ import { useLikeC4Model } from "../../hooks/useLikeC4Model.js";
9
+ import { findDiagramEdge, findDiagramNode } from "../state/utils.js";
10
+ import { Markdown } from "../../base-primitives/Markdown.js";
11
+ import { Link } from "../../components/Link.js";
12
+ import { PortalToContainer } from "../../components/PortalToContainer.js";
13
+ import { RelationshipPopoverActorLogic } from "./actor.js";
14
+ import { Endpoint, RelationshipTitle } from "./components.js";
15
+ import { css, cx } from "@likec4/styles/css";
16
+ import { IconArrowRight, IconFileSymlink, IconInfoCircle, IconZoomScan } from "@tabler/icons-react";
17
+ import { Fragment, forwardRef, memo, useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
18
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
19
+ import { shallowEqual } from "fast-equals";
20
+ import { clamp, entries, filter, isEmpty, isTruthy, map, partition, pipe } from "remeda";
21
+ import { nameFromFqn } from "@likec4/core";
22
+ import { ActionIcon, Button, Divider, ScrollAreaAutosize, Text, Tooltip, TooltipGroup } from "@mantine/core";
23
+ import { useActorRef, useSelector } from "@xstate/react";
24
+ import { Box as Box$1, HStack, VStack, styled } from "@likec4/styles/jsx";
25
+ import { bleed } from "@likec4/styles/patterns";
26
+ import { autoPlacement, autoUpdate, computePosition, hide, offset, size } from "@floating-ui/dom";
27
+ //#region src/likec4diagram/relationship-popover/RelationshipPopover.tsx
30
28
  function selectDiagramContext(c) {
31
- let selected = null;
32
- for (const edge of c.xyedges) {
33
- if (edge.selected) {
34
- if (selected) {
35
- selected = null;
36
- break;
37
- }
38
- selected = edge.data.id;
39
- }
40
- }
41
- return {
42
- viewId: c.view.id,
43
- selected
44
- };
29
+ let selected = null;
30
+ for (const edge of c.xyedges) if (edge.selected) {
31
+ if (selected) {
32
+ selected = null;
33
+ break;
34
+ }
35
+ selected = edge.data.id;
36
+ }
37
+ return {
38
+ viewId: c.view.id,
39
+ selected
40
+ };
45
41
  }
46
- const RelationshipPopover = memo(() => {
47
- const likec4model = useLikeC4Model();
48
- const actorRef = useActorRef(RelationshipPopoverActorLogic);
49
- const diagram = useDiagram();
50
- const { viewId, selected } = useDiagramContext(selectDiagramContext);
51
- const openedEdgeId = useSelector(actorRef, (s) => s.hasTag("opened") ? s.context.edgeId : null);
52
- useOnDiagramEvent("navigateTo", () => {
53
- actorRef.send({ type: "close" });
54
- });
55
- useOnDiagramEvent("edgeMouseEnter", ({ edge }) => {
56
- actorRef.send({ type: "xyedge.mouseEnter", edgeId: edge.data.id });
57
- });
58
- useOnDiagramEvent("edgeMouseLeave", () => {
59
- actorRef.send({ type: "xyedge.mouseLeave" });
60
- });
61
- useOnDiagramEvent("walkthroughStarted", () => {
62
- actorRef.send({ type: "close" });
63
- });
64
- useEffect(() => {
65
- if (selected) {
66
- actorRef.send({ type: "xyedge.select", edgeId: selected });
67
- } else {
68
- actorRef.send({ type: "xyedge.unselect" });
69
- }
70
- }, [selected]);
71
- const onMouseEnter = useCallback((event) => {
72
- if (!openedEdgeId) {
73
- return;
74
- }
75
- actorRef.send({ type: "dropdown.mouseEnter" });
76
- const edge = diagram.findEdge(openedEdgeId);
77
- if (edge && !edge.data.hovered) {
78
- diagram.send({ type: "xyflow.edgeMouseEnter", edge, event });
79
- }
80
- }, [actorRef, diagram, openedEdgeId]);
81
- const onMouseLeave = useCallback((event) => {
82
- if (!openedEdgeId) {
83
- return;
84
- }
85
- actorRef.send({ type: "dropdown.mouseLeave" });
86
- const edge = diagram.findEdge(openedEdgeId);
87
- if (edge?.data.hovered) {
88
- diagram.send({ type: "xyflow.edgeMouseLeave", edge, event });
89
- }
90
- }, [actorRef, diagram, openedEdgeId]);
91
- const { diagramEdge, sourceNode, targetNode } = useDiagramContext(
92
- (ctx) => {
93
- const diagramEdge2 = openedEdgeId ? findDiagramEdge(ctx, openedEdgeId) : null;
94
- const sourceNode2 = diagramEdge2 ? findDiagramNode(ctx, diagramEdge2.source) : null;
95
- const targetNode2 = diagramEdge2 ? findDiagramNode(ctx, diagramEdge2.target) : null;
96
- return {
97
- diagramEdge: diagramEdge2,
98
- sourceNode: sourceNode2,
99
- targetNode: targetNode2
100
- };
101
- },
102
- shallowEqual,
103
- [openedEdgeId]
104
- );
105
- if (!diagramEdge || !sourceNode || !targetNode || isEmpty(diagramEdge.relations)) {
106
- return null;
107
- }
108
- const [direct, nested] = pipe(
109
- diagramEdge.relations,
110
- map((id) => {
111
- try {
112
- return likec4model.relationship(id);
113
- } catch (e) {
114
- console.error(
115
- `View is cached and likec4model missing relationship ${id} from ${sourceNode.id} -> ${targetNode.id}`,
116
- e
117
- );
118
- return null;
119
- }
120
- }),
121
- filter(isTruthy),
122
- partition((r) => r.source.id === sourceNode.id && r.target.id === targetNode.id)
123
- );
124
- if (direct.length === 0 && nested.length === 0) {
125
- console.warn("No relationships found diagram edge", {
126
- diagramEdge,
127
- sourceNode,
128
- targetNode
129
- });
130
- return null;
131
- }
132
- return /* @__PURE__ */ jsx(PortalToContainer, { children: /* @__PURE__ */ jsx(
133
- RelationshipPopoverInternal,
134
- {
135
- viewId,
136
- direct,
137
- nested,
138
- diagramEdge,
139
- sourceNode,
140
- targetNode,
141
- onMouseEnter,
142
- onMouseLeave
143
- }
144
- ) });
42
+ var RelationshipPopover = memo(() => {
43
+ const likec4model = useLikeC4Model();
44
+ const actorRef = useActorRef(RelationshipPopoverActorLogic);
45
+ const diagram = useDiagram();
46
+ const { viewId, selected } = useDiagramContext(selectDiagramContext);
47
+ const openedEdgeId = useSelector(actorRef, (s) => s.hasTag("opened") ? s.context.edgeId : null);
48
+ useOnDiagramEvent("navigateTo", () => {
49
+ actorRef.send({ type: "close" });
50
+ });
51
+ useOnDiagramEvent("edgeMouseEnter", ({ edge }) => {
52
+ actorRef.send({
53
+ type: "xyedge.mouseEnter",
54
+ edgeId: edge.data.id
55
+ });
56
+ });
57
+ useOnDiagramEvent("edgeMouseLeave", () => {
58
+ actorRef.send({ type: "xyedge.mouseLeave" });
59
+ });
60
+ useOnDiagramEvent("walkthroughStarted", () => {
61
+ actorRef.send({ type: "close" });
62
+ });
63
+ useEffect(() => {
64
+ if (selected) actorRef.send({
65
+ type: "xyedge.select",
66
+ edgeId: selected
67
+ });
68
+ else actorRef.send({ type: "xyedge.unselect" });
69
+ }, [selected]);
70
+ const onMouseEnter = useCallback((event) => {
71
+ if (!openedEdgeId) return;
72
+ actorRef.send({ type: "dropdown.mouseEnter" });
73
+ const edge = diagram.findEdge(openedEdgeId);
74
+ if (edge && !edge.data.hovered) diagram.send({
75
+ type: "xyflow.edgeMouseEnter",
76
+ edge,
77
+ event
78
+ });
79
+ }, [
80
+ actorRef,
81
+ diagram,
82
+ openedEdgeId
83
+ ]);
84
+ const onMouseLeave = useCallback((event) => {
85
+ if (!openedEdgeId) return;
86
+ actorRef.send({ type: "dropdown.mouseLeave" });
87
+ const edge = diagram.findEdge(openedEdgeId);
88
+ if (edge?.data.hovered) diagram.send({
89
+ type: "xyflow.edgeMouseLeave",
90
+ edge,
91
+ event
92
+ });
93
+ }, [
94
+ actorRef,
95
+ diagram,
96
+ openedEdgeId
97
+ ]);
98
+ const { diagramEdge, sourceNode, targetNode } = useDiagramContext((ctx) => {
99
+ const diagramEdge = openedEdgeId ? findDiagramEdge(ctx, openedEdgeId) : null;
100
+ return {
101
+ diagramEdge,
102
+ sourceNode: diagramEdge ? findDiagramNode(ctx, diagramEdge.source) : null,
103
+ targetNode: diagramEdge ? findDiagramNode(ctx, diagramEdge.target) : null
104
+ };
105
+ }, shallowEqual, [openedEdgeId]);
106
+ if (!diagramEdge || !sourceNode || !targetNode || isEmpty(diagramEdge.relations)) return null;
107
+ const [direct, nested] = pipe(diagramEdge.relations, map((id) => {
108
+ try {
109
+ return likec4model.relationship(id);
110
+ } catch (e) {
111
+ console.error(`View is cached and likec4model missing relationship ${id} from ${sourceNode.id} -> ${targetNode.id}`, e);
112
+ return null;
113
+ }
114
+ }), filter(isTruthy), partition((r) => r.source.id === sourceNode.id && r.target.id === targetNode.id));
115
+ if (direct.length === 0 && nested.length === 0) {
116
+ console.warn("No relationships found diagram edge", {
117
+ diagramEdge,
118
+ sourceNode,
119
+ targetNode
120
+ });
121
+ return null;
122
+ }
123
+ return /* @__PURE__ */ jsx(PortalToContainer, { children: /* @__PURE__ */ jsx(RelationshipPopoverInternal, {
124
+ viewId,
125
+ direct,
126
+ nested,
127
+ diagramEdge,
128
+ sourceNode,
129
+ targetNode,
130
+ onMouseEnter,
131
+ onMouseLeave
132
+ }) });
145
133
  });
146
- const getEdgeLabelElement = (edgeId, container) => {
147
- return container?.querySelector(`.likec4-edge-label[data-edge-id="${edgeId}"]`) ?? container?.querySelector(`.likec4-edge-middle-point[data-edge-id="${edgeId}"]`) ?? null;
134
+ var getEdgeLabelElement = (edgeId, container) => {
135
+ return container?.querySelector(`.likec4-edge-label[data-edge-id="${edgeId}"]`) ?? container?.querySelector(`.likec4-edge-middle-point[data-edge-id="${edgeId}"]`) ?? null;
148
136
  };
149
- const POPOVER_PADDING = 8;
150
- const RelationshipPopoverInternal = ({
151
- viewId,
152
- diagramEdge,
153
- direct,
154
- nested,
155
- sourceNode,
156
- targetNode,
157
- onMouseEnter,
158
- onMouseLeave
159
- }) => {
160
- const ref = useRef(null);
161
- const { enableNavigateTo, enableVscode } = useEnabledFeatures();
162
- const { onOpenSource } = useDiagramEventHandlers();
163
- const containerRef = useRootContainerRef();
164
- const [referenceEl, setReferenceEl] = useState(null);
165
- useLayoutEffect(() => {
166
- setReferenceEl(getEdgeLabelElement(diagramEdge.id, containerRef.current));
167
- }, [diagramEdge]);
168
- useEffect(() => {
169
- const reference = referenceEl;
170
- const popper = ref.current;
171
- if (!reference || !popper) {
172
- return;
173
- }
174
- let wasCanceled = false;
175
- const update = () => {
176
- void computePosition(reference, popper, {
177
- placement: "bottom-start",
178
- middleware: [
179
- offset(4),
180
- autoPlacement({
181
- crossAxis: true,
182
- // padding: POPOVER_PADDING,
183
- allowedPlacements: [
184
- "bottom-start",
185
- "bottom-end",
186
- "left-start",
187
- "top-start",
188
- "top-end",
189
- "right-start",
190
- "right-end",
191
- "left-end"
192
- ]
193
- }),
194
- size({
195
- apply({ availableHeight, availableWidth, elements }) {
196
- if (wasCanceled) {
197
- return;
198
- }
199
- Object.assign(elements.floating.style, {
200
- maxWidth: `${clamp(roundDpr(availableWidth), { min: 220, max: 400 })}px`,
201
- maxHeight: `${clamp(roundDpr(availableHeight), { min: 100, max: 500 })}px`
202
- });
203
- }
204
- }),
205
- hide({
206
- padding: POPOVER_PADDING * 2
207
- })
208
- ]
209
- }).then(({ x, y, middlewareData }) => {
210
- if (wasCanceled) {
211
- return;
212
- }
213
- popper.style.transform = `translate(${roundDpr(x)}px, ${roundDpr(y)}px)`;
214
- popper.style.visibility = middlewareData.hide?.referenceHidden ? "hidden" : "visible";
215
- });
216
- };
217
- const cleanup = autoUpdate(reference, popper, update, {
218
- ancestorResize: false,
219
- animationFrame: true
220
- });
221
- return () => {
222
- wasCanceled = true;
223
- cleanup();
224
- };
225
- }, [referenceEl]);
226
- const diagram = useDiagram();
227
- const renderRelationship = useCallback(
228
- (relationship, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
229
- index > 0 && /* @__PURE__ */ jsx(Divider, {}),
230
- /* @__PURE__ */ jsx(
231
- Relationship,
232
- {
233
- viewId,
234
- relationship,
235
- sourceNode,
236
- targetNode,
237
- onNavigateTo: enableNavigateTo ? (viewId2) => {
238
- diagram.navigateTo(viewId2);
239
- } : void 0,
240
- ...onOpenSource && enableVscode && {
241
- onOpenSource: () => onOpenSource({ relation: relationship.id })
242
- }
243
- }
244
- )
245
- ] }, relationship.id),
246
- [viewId, sourceNode, targetNode, diagram, enableNavigateTo, onOpenSource, enableVscode]
247
- );
248
- return /* @__PURE__ */ jsx(
249
- ScrollAreaAutosize,
250
- {
251
- ref,
252
- onMouseEnter,
253
- onMouseLeave,
254
- type: "auto",
255
- scrollbars: "y",
256
- scrollbarSize: 6,
257
- styles: {
258
- viewport: {
259
- overscrollBehavior: "contain",
260
- minWidth: 200,
261
- minHeight: 40
262
- }
263
- },
264
- className: cx(
265
- css({
266
- layerStyle: "likec4.dropdown",
267
- p: "0",
268
- pointerEvents: {
269
- base: "all",
270
- _whenPanning: "none"
271
- },
272
- position: "absolute",
273
- top: "0",
274
- left: "0",
275
- width: "max-content",
276
- cursor: "default"
277
- })
278
- ),
279
- children: /* @__PURE__ */ jsxs(
280
- VStack,
281
- {
282
- css: {
283
- gap: "3",
284
- padding: "4",
285
- paddingTop: "2"
286
- },
287
- children: [
288
- /* @__PURE__ */ jsx(
289
- Button,
290
- {
291
- variant: "default",
292
- color: "gray",
293
- size: "compact-xs",
294
- style: {
295
- alignSelf: "flex-start",
296
- fontWeight: "medium",
297
- ["--button-fz"]: "var(--font-sizes-xxs)"
298
- },
299
- onClick: (e) => {
300
- e.stopPropagation();
301
- diagram.openRelationshipDetails(diagramEdge.id);
302
- },
303
- children: "browse relationships"
304
- }
305
- ),
306
- direct.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
307
- /* @__PURE__ */ jsx(Label, { children: "DIRECT RELATIONSHIPS" }),
308
- direct.map(renderRelationship)
309
- ] }),
310
- nested.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
311
- /* @__PURE__ */ jsx(
312
- Label,
313
- {
314
- css: {
315
- mt: direct.length > 0 ? "2" : "0"
316
- },
317
- children: "RESOLVED FROM NESTED"
318
- }
319
- ),
320
- nested.map(renderRelationship)
321
- ] })
322
- ]
323
- }
324
- )
325
- }
326
- );
137
+ var POPOVER_PADDING = 8;
138
+ var RelationshipPopoverInternal = ({ viewId, diagramEdge, direct, nested, sourceNode, targetNode, onMouseEnter, onMouseLeave }) => {
139
+ const ref = useRef(null);
140
+ const { enableNavigateTo, enableVscode } = useEnabledFeatures();
141
+ const { onOpenSource } = useDiagramEventHandlers();
142
+ const containerRef = useRootContainerRef();
143
+ const [referenceEl, setReferenceEl] = useState(null);
144
+ useLayoutEffect(() => {
145
+ setReferenceEl(getEdgeLabelElement(diagramEdge.id, containerRef.current));
146
+ }, [diagramEdge]);
147
+ useEffect(() => {
148
+ const reference = referenceEl;
149
+ const popper = ref.current;
150
+ if (!reference || !popper) return;
151
+ let wasCanceled = false;
152
+ const update = () => {
153
+ computePosition(reference, popper, {
154
+ placement: "bottom-start",
155
+ middleware: [
156
+ offset(4),
157
+ autoPlacement({
158
+ crossAxis: true,
159
+ allowedPlacements: [
160
+ "bottom-start",
161
+ "bottom-end",
162
+ "left-start",
163
+ "top-start",
164
+ "top-end",
165
+ "right-start",
166
+ "right-end",
167
+ "left-end"
168
+ ]
169
+ }),
170
+ size({ apply({ availableHeight, availableWidth, elements }) {
171
+ if (wasCanceled) return;
172
+ Object.assign(elements.floating.style, {
173
+ maxWidth: `${clamp(roundDpr(availableWidth), {
174
+ min: 220,
175
+ max: 400
176
+ })}px`,
177
+ maxHeight: `${clamp(roundDpr(availableHeight), {
178
+ min: 100,
179
+ max: 500
180
+ })}px`
181
+ });
182
+ } }),
183
+ hide({ padding: POPOVER_PADDING * 2 })
184
+ ]
185
+ }).then(({ x, y, middlewareData }) => {
186
+ if (wasCanceled) return;
187
+ popper.style.transform = `translate(${roundDpr(x)}px, ${roundDpr(y)}px)`;
188
+ popper.style.visibility = middlewareData.hide?.referenceHidden ? "hidden" : "visible";
189
+ });
190
+ };
191
+ const cleanup = autoUpdate(reference, popper, update, {
192
+ ancestorResize: false,
193
+ animationFrame: true
194
+ });
195
+ return () => {
196
+ wasCanceled = true;
197
+ cleanup();
198
+ };
199
+ }, [referenceEl]);
200
+ const diagram = useDiagram();
201
+ const renderRelationship = useCallback((relationship, index) => /* @__PURE__ */ jsxs(Fragment, { children: [index > 0 && /* @__PURE__ */ jsx(Divider, {}), /* @__PURE__ */ jsx(Relationship, {
202
+ viewId,
203
+ relationship,
204
+ sourceNode,
205
+ targetNode,
206
+ onNavigateTo: enableNavigateTo ? (viewId) => {
207
+ diagram.navigateTo(viewId);
208
+ } : void 0,
209
+ ...onOpenSource && enableVscode && { onOpenSource: () => onOpenSource({ relation: relationship.id }) }
210
+ })] }, relationship.id), [
211
+ viewId,
212
+ sourceNode,
213
+ targetNode,
214
+ diagram,
215
+ enableNavigateTo,
216
+ onOpenSource,
217
+ enableVscode
218
+ ]);
219
+ return /* @__PURE__ */ jsx(ScrollAreaAutosize, {
220
+ ref,
221
+ onMouseEnter,
222
+ onMouseLeave,
223
+ type: "auto",
224
+ scrollbars: "y",
225
+ scrollbarSize: 6,
226
+ styles: { viewport: {
227
+ overscrollBehavior: "contain",
228
+ minWidth: 200,
229
+ minHeight: 40
230
+ } },
231
+ className: cx(css({
232
+ layerStyle: "likec4.dropdown",
233
+ p: "0",
234
+ pointerEvents: {
235
+ base: "all",
236
+ _whenPanning: "none"
237
+ },
238
+ position: "absolute",
239
+ top: "0",
240
+ left: "0",
241
+ width: "max-content",
242
+ cursor: "default"
243
+ })),
244
+ children: /* @__PURE__ */ jsxs(VStack, {
245
+ css: {
246
+ gap: "3",
247
+ padding: "4",
248
+ paddingTop: "2"
249
+ },
250
+ children: [
251
+ /* @__PURE__ */ jsx(Button, {
252
+ variant: "default",
253
+ color: "gray",
254
+ size: "compact-xs",
255
+ style: {
256
+ alignSelf: "flex-start",
257
+ fontWeight: "medium",
258
+ ["--button-fz"]: "var(--font-sizes-xxs)"
259
+ },
260
+ onClick: (e) => {
261
+ e.stopPropagation();
262
+ diagram.openRelationshipDetails(diagramEdge.id);
263
+ },
264
+ children: "browse relationships"
265
+ }),
266
+ direct.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Label, { children: "DIRECT RELATIONSHIPS" }), direct.map(renderRelationship)] }),
267
+ nested.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Label, {
268
+ css: { mt: direct.length > 0 ? "2" : "0" },
269
+ children: "RESOLVED FROM NESTED"
270
+ }), nested.map(renderRelationship)] })
271
+ ]
272
+ })
273
+ });
327
274
  };
328
- const Relationship = forwardRef(({
329
- viewId,
330
- relationship: r,
331
- sourceNode,
332
- targetNode,
333
- onNavigateTo,
334
- onOpenSource
335
- }, ref) => {
336
- const sourceId = getEndpointId(r, "source", sourceNode);
337
- const targetId = getEndpointId(r, "target", targetNode);
338
- const navigateTo = onNavigateTo && r.navigateTo?.id !== viewId ? r.navigateTo?.id : void 0;
339
- const links = r.links;
340
- const metadataEntries = r.hasMetadata() ? entries(r.getMetadata()).sort(([a], [b]) => a.localeCompare(b)) : null;
341
- const metadataTooltipLabel = metadataEntries && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
342
- /* @__PURE__ */ jsx(
343
- "div",
344
- {
345
- style: {
346
- fontWeight: "bold",
347
- fontSize: "10px",
348
- color: "#868e96",
349
- marginBottom: "2px",
350
- letterSpacing: "0.5px",
351
- textTransform: "uppercase"
352
- },
353
- children: "Metadata"
354
- }
355
- ),
356
- /* @__PURE__ */ jsx(
357
- "div",
358
- {
359
- style: {
360
- borderTop: "1px solid rgba(0, 0, 0, 0.1)",
361
- paddingTop: "6px",
362
- display: "flex",
363
- flexDirection: "column",
364
- gap: "6px"
365
- },
366
- children: metadataEntries.map(([key, value]) => {
367
- const displayValue = Array.isArray(value) ? value.join(", ") : value;
368
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "12px", fontSize: "12px", lineHeight: "1.4" }, children: [
369
- /* @__PURE__ */ jsxs(
370
- "span",
371
- {
372
- style: {
373
- fontWeight: "bold",
374
- minWidth: "110px",
375
- color: "#495057"
376
- },
377
- children: [
378
- key,
379
- ":"
380
- ]
381
- }
382
- ),
383
- /* @__PURE__ */ jsx(
384
- "span",
385
- {
386
- style: {
387
- color: "#212529",
388
- wordBreak: "break-word",
389
- flex: 1
390
- },
391
- children: displayValue
392
- }
393
- )
394
- ] }, key);
395
- })
396
- }
397
- )
398
- ] });
399
- return /* @__PURE__ */ jsxs(
400
- VStack,
401
- {
402
- ref,
403
- className: bleed({
404
- block: "2",
405
- inline: "2",
406
- paddingY: "2.5",
407
- paddingX: "2",
408
- gap: "1",
409
- rounded: "sm",
410
- backgroundColor: {
411
- _hover: {
412
- base: "mantine.colors.gray[1]",
413
- _dark: "mantine.colors.dark[5]/70"
414
- }
415
- }
416
- }),
417
- children: [
418
- /* @__PURE__ */ jsx(HStack, { gap: "0.5", children: /* @__PURE__ */ jsxs(TooltipGroup, { openDelay: 200, children: [
419
- /* @__PURE__ */ jsx(Tooltip, { label: sourceId.full, offset: 2, position: "top-start", children: /* @__PURE__ */ jsx(Endpoint, { likec4color: sourceNode.color, children: sourceId.short }) }),
420
- /* @__PURE__ */ jsx(IconArrowRight, { stroke: 2.5, size: "11px", opacity: 0.65 }),
421
- /* @__PURE__ */ jsx(Tooltip, { label: targetId.full, offset: 2, position: "top-start", children: /* @__PURE__ */ jsx(Endpoint, { likec4color: targetNode.color, children: targetId.short }) }),
422
- navigateTo && /* @__PURE__ */ jsx(Tooltip, { label: "Open dynamic view", children: /* @__PURE__ */ jsx(
423
- ActionIcon,
424
- {
425
- size: "sm",
426
- radius: "sm",
427
- variant: "default",
428
- onClick: (event) => {
429
- event.stopPropagation();
430
- onNavigateTo?.(navigateTo);
431
- },
432
- style: {
433
- alignSelf: "flex-end"
434
- },
435
- role: "button",
436
- children: /* @__PURE__ */ jsx(IconZoomScan, { size: "80%", stroke: 2 })
437
- }
438
- ) }),
439
- onOpenSource && /* @__PURE__ */ jsx(Tooltip, { label: "Open source", children: /* @__PURE__ */ jsx(
440
- ActionIcon,
441
- {
442
- size: "sm",
443
- radius: "sm",
444
- variant: "default",
445
- onClick: (event) => {
446
- event.stopPropagation();
447
- onOpenSource();
448
- },
449
- role: "button",
450
- children: /* @__PURE__ */ jsx(IconFileSymlink, { size: "80%", stroke: 2 })
451
- }
452
- ) })
453
- ] }) }),
454
- /* @__PURE__ */ jsxs(HStack, { gap: "xs", alignItems: "center", children: [
455
- /* @__PURE__ */ jsx(RelationshipTitle, { children: r.title || "untitled" }),
456
- metadataTooltipLabel && /* @__PURE__ */ jsx(
457
- Tooltip,
458
- {
459
- label: metadataTooltipLabel,
460
- w: 350,
461
- position: "right",
462
- offset: 10,
463
- openDelay: 300,
464
- withArrow: true,
465
- bg: "white",
466
- c: "dark",
467
- withinPortal: true,
468
- styles: {
469
- tooltip: {
470
- boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
471
- border: "1px solid #dee2e6"
472
- }
473
- },
474
- children: /* @__PURE__ */ jsx(Box, { display: "inline-flex", children: /* @__PURE__ */ jsx(
475
- IconInfoCircle,
476
- {
477
- size: 14,
478
- opacity: 0.5,
479
- style: { flexShrink: 0, cursor: "help" }
480
- }
481
- ) })
482
- }
483
- )
484
- ] }),
485
- r.kind && /* @__PURE__ */ jsxs(HStack, { gap: "2", children: [
486
- /* @__PURE__ */ jsx(Label, { children: "kind" }),
487
- /* @__PURE__ */ jsx(Text, { size: "xs", className: css({ userSelect: "all", wordBreak: "break-word", minWidth: 0 }), children: r.kind })
488
- ] }),
489
- r.technology && /* @__PURE__ */ jsxs(HStack, { gap: "2", children: [
490
- /* @__PURE__ */ jsx(Label, { children: "technology" }),
491
- /* @__PURE__ */ jsx(
492
- Text,
493
- {
494
- size: "xs",
495
- className: css({ userSelect: "all", wordBreak: "break-word", minWidth: 0 }),
496
- children: r.technology
497
- }
498
- )
499
- ] }),
500
- r.summary.nonEmpty && /* @__PURE__ */ jsxs(Fragment$1, { children: [
501
- /* @__PURE__ */ jsx(Label, { children: "description" }),
502
- /* @__PURE__ */ jsx(
503
- Box,
504
- {
505
- css: {
506
- paddingLeft: "2.5",
507
- py: "1.5",
508
- borderLeft: "2px dotted",
509
- borderLeftColor: {
510
- base: "mantine.colors.gray[3]",
511
- _dark: "mantine.colors.dark[4]"
512
- }
513
- },
514
- children: /* @__PURE__ */ jsx(Markdown, { value: r.summary, fontSize: "sm", textScale: 0.875 })
515
- }
516
- )
517
- ] }),
518
- links.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
519
- /* @__PURE__ */ jsx(Label, { children: "links" }),
520
- /* @__PURE__ */ jsx(HStack, { gap: "1", flexWrap: "wrap", children: links.map((link) => /* @__PURE__ */ jsx(Link, { size: "sm", value: link }, link.url)) })
521
- ] })
522
- ]
523
- }
524
- );
275
+ var Relationship = forwardRef(({ viewId, relationship: r, sourceNode, targetNode, onNavigateTo, onOpenSource }, ref) => {
276
+ const sourceId = getEndpointId(r, "source", sourceNode);
277
+ const targetId = getEndpointId(r, "target", targetNode);
278
+ const navigateTo = onNavigateTo && r.navigateTo?.id !== viewId ? r.navigateTo?.id : void 0;
279
+ const links = r.links;
280
+ const metadataEntries = r.hasMetadata() ? entries(r.getMetadata()).sort(([a], [b]) => a.localeCompare(b)) : null;
281
+ const metadataTooltipLabel = metadataEntries && /* @__PURE__ */ jsxs("div", {
282
+ style: {
283
+ display: "flex",
284
+ flexDirection: "column",
285
+ gap: "6px"
286
+ },
287
+ children: [/* @__PURE__ */ jsx("div", {
288
+ style: {
289
+ fontWeight: "bold",
290
+ fontSize: "10px",
291
+ color: "#868e96",
292
+ marginBottom: "2px",
293
+ letterSpacing: "0.5px",
294
+ textTransform: "uppercase"
295
+ },
296
+ children: "Metadata"
297
+ }), /* @__PURE__ */ jsx("div", {
298
+ style: {
299
+ borderTop: "1px solid rgba(0, 0, 0, 0.1)",
300
+ paddingTop: "6px",
301
+ display: "flex",
302
+ flexDirection: "column",
303
+ gap: "6px"
304
+ },
305
+ children: metadataEntries.map(([key, value]) => {
306
+ const displayValue = Array.isArray(value) ? value.join(", ") : value;
307
+ return /* @__PURE__ */ jsxs("div", {
308
+ style: {
309
+ display: "flex",
310
+ gap: "12px",
311
+ fontSize: "12px",
312
+ lineHeight: "1.4"
313
+ },
314
+ children: [/* @__PURE__ */ jsxs("span", {
315
+ style: {
316
+ fontWeight: "bold",
317
+ minWidth: "110px",
318
+ color: "#495057"
319
+ },
320
+ children: [key, ":"]
321
+ }), /* @__PURE__ */ jsx("span", {
322
+ style: {
323
+ color: "#212529",
324
+ wordBreak: "break-word",
325
+ flex: 1
326
+ },
327
+ children: displayValue
328
+ })]
329
+ }, key);
330
+ })
331
+ })]
332
+ });
333
+ return /* @__PURE__ */ jsxs(VStack, {
334
+ ref,
335
+ className: bleed({
336
+ block: "2",
337
+ inline: "2",
338
+ paddingY: "2.5",
339
+ paddingX: "2",
340
+ gap: "1",
341
+ rounded: "sm",
342
+ backgroundColor: { _hover: {
343
+ base: "mantine.colors.gray[1]",
344
+ _dark: "mantine.colors.dark[5]/70"
345
+ } }
346
+ }),
347
+ children: [
348
+ /* @__PURE__ */ jsx(HStack, {
349
+ gap: "0.5",
350
+ children: /* @__PURE__ */ jsxs(TooltipGroup, {
351
+ openDelay: 200,
352
+ children: [
353
+ /* @__PURE__ */ jsx(Tooltip$1, {
354
+ label: sourceId.full,
355
+ offset: 2,
356
+ position: "top-start",
357
+ children: /* @__PURE__ */ jsx(Endpoint, {
358
+ likec4color: sourceNode.color,
359
+ children: sourceId.short
360
+ })
361
+ }),
362
+ /* @__PURE__ */ jsx(IconArrowRight, {
363
+ stroke: 2.5,
364
+ size: "11px",
365
+ opacity: .65
366
+ }),
367
+ /* @__PURE__ */ jsx(Tooltip$1, {
368
+ label: targetId.full,
369
+ offset: 2,
370
+ position: "top-start",
371
+ children: /* @__PURE__ */ jsx(Endpoint, {
372
+ likec4color: targetNode.color,
373
+ children: targetId.short
374
+ })
375
+ }),
376
+ navigateTo && /* @__PURE__ */ jsx(Tooltip$1, {
377
+ label: "Open dynamic view",
378
+ children: /* @__PURE__ */ jsx(ActionIcon, {
379
+ size: "sm",
380
+ radius: "sm",
381
+ variant: "default",
382
+ onClick: (event) => {
383
+ event.stopPropagation();
384
+ onNavigateTo?.(navigateTo);
385
+ },
386
+ style: { alignSelf: "flex-end" },
387
+ role: "button",
388
+ children: /* @__PURE__ */ jsx(IconZoomScan, {
389
+ size: "80%",
390
+ stroke: 2
391
+ })
392
+ })
393
+ }),
394
+ onOpenSource && /* @__PURE__ */ jsx(Tooltip$1, {
395
+ label: "Open source",
396
+ children: /* @__PURE__ */ jsx(ActionIcon, {
397
+ size: "sm",
398
+ radius: "sm",
399
+ variant: "default",
400
+ onClick: (event) => {
401
+ event.stopPropagation();
402
+ onOpenSource();
403
+ },
404
+ role: "button",
405
+ children: /* @__PURE__ */ jsx(IconFileSymlink, {
406
+ size: "80%",
407
+ stroke: 2
408
+ })
409
+ })
410
+ })
411
+ ]
412
+ })
413
+ }),
414
+ /* @__PURE__ */ jsxs(HStack, {
415
+ gap: "xs",
416
+ alignItems: "center",
417
+ children: [/* @__PURE__ */ jsx(RelationshipTitle, { children: r.title || "untitled" }), metadataTooltipLabel && /* @__PURE__ */ jsx(Tooltip$1, {
418
+ label: metadataTooltipLabel,
419
+ w: 350,
420
+ position: "right",
421
+ offset: 10,
422
+ openDelay: 300,
423
+ withArrow: true,
424
+ bg: "white",
425
+ c: "dark",
426
+ withinPortal: true,
427
+ styles: { tooltip: {
428
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
429
+ border: "1px solid #dee2e6"
430
+ } },
431
+ children: /* @__PURE__ */ jsx(Box$1, {
432
+ display: "inline-flex",
433
+ children: /* @__PURE__ */ jsx(IconInfoCircle, {
434
+ size: 14,
435
+ opacity: .5,
436
+ style: {
437
+ flexShrink: 0,
438
+ cursor: "help"
439
+ }
440
+ })
441
+ })
442
+ })]
443
+ }),
444
+ r.kind && /* @__PURE__ */ jsxs(HStack, {
445
+ gap: "2",
446
+ children: [/* @__PURE__ */ jsx(Label, { children: "kind" }), /* @__PURE__ */ jsx(Text, {
447
+ size: "xs",
448
+ className: css({
449
+ userSelect: "all",
450
+ wordBreak: "break-word",
451
+ minWidth: 0
452
+ }),
453
+ children: r.kind
454
+ })]
455
+ }),
456
+ r.technology && /* @__PURE__ */ jsxs(HStack, {
457
+ gap: "2",
458
+ children: [/* @__PURE__ */ jsx(Label, { children: "technology" }), /* @__PURE__ */ jsx(Text, {
459
+ size: "xs",
460
+ className: css({
461
+ userSelect: "all",
462
+ wordBreak: "break-word",
463
+ minWidth: 0
464
+ }),
465
+ children: r.technology
466
+ })]
467
+ }),
468
+ r.summary.nonEmpty && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Label, { children: "description" }), /* @__PURE__ */ jsx(Box$1, {
469
+ css: {
470
+ paddingLeft: "2.5",
471
+ py: "1.5",
472
+ borderLeft: "2px dotted",
473
+ borderLeftColor: {
474
+ base: "mantine.colors.gray[3]",
475
+ _dark: "mantine.colors.dark[4]"
476
+ }
477
+ },
478
+ children: /* @__PURE__ */ jsx(Markdown, {
479
+ value: r.summary,
480
+ fontSize: "sm",
481
+ textScale: .875
482
+ })
483
+ })] }),
484
+ links.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Label, { children: "links" }), /* @__PURE__ */ jsx(HStack, {
485
+ gap: "1",
486
+ flexWrap: "wrap",
487
+ children: links.map((link) => /* @__PURE__ */ jsx(Link, {
488
+ size: "sm",
489
+ value: link
490
+ }, link.url))
491
+ })] })
492
+ ]
493
+ });
525
494
  });
526
- const Label = styled("div", {
527
- base: {
528
- display: "block",
529
- fontSize: "xxs",
530
- fontWeight: "medium",
531
- userSelect: "none",
532
- lineHeight: "sm",
533
- color: "text.dimmed"
534
- }
535
- });
536
- const Tooltip = Tooltip$1.withProps({
537
- color: "dark",
538
- fz: "xs",
539
- label: "",
540
- children: null,
541
- offset: 8,
542
- withinPortal: false
495
+ var Label = styled("div", { base: {
496
+ display: "block",
497
+ fontSize: "xxs",
498
+ fontWeight: "medium",
499
+ userSelect: "none",
500
+ lineHeight: "sm",
501
+ color: "text.dimmed"
502
+ } });
503
+ var Tooltip$1 = Tooltip.withProps({
504
+ color: "dark",
505
+ fz: "xs",
506
+ label: "",
507
+ children: null,
508
+ offset: 8,
509
+ withinPortal: false
543
510
  });
544
511
  function getEndpointId(r, endpoint, diagramNode) {
545
- const diagramNodeId = r.isDeploymentRelation() ? diagramNode.id : diagramNode.modelRef || "";
546
- const full = r[endpoint].id;
547
- const short = nameFromFqn(diagramNodeId) + full.slice(diagramNodeId.length);
548
- return { full, short };
512
+ const diagramNodeId = r.isDeploymentRelation() ? diagramNode.id : diagramNode.modelRef || "";
513
+ const full = r[endpoint].id;
514
+ return {
515
+ full,
516
+ short: nameFromFqn(diagramNodeId) + full.slice(diagramNodeId.length)
517
+ };
549
518
  }
550
-
519
+ //#endregion
551
520
  export { RelationshipPopover };