@likec4/diagram 1.46.4 → 1.48.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 (337) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/bundle/index.js +7332 -5799
  4. package/dist/LikeC4Diagram.d.ts +1 -1
  5. package/dist/LikeC4Diagram.js +20 -14
  6. package/dist/LikeC4Diagram.props.d.ts +2 -6
  7. package/dist/LikeC4ProjectsOverview.d.ts +7 -0
  8. package/dist/LikeC4ProjectsOverview.js +32 -0
  9. package/dist/LikeC4ProjectsProvider.js +7 -5
  10. package/dist/LikeC4Styles.d.ts +2 -6
  11. package/dist/LikeC4Styles.js +44 -43
  12. package/dist/LikeC4View.d.ts +9 -1
  13. package/dist/LikeC4View.js +10 -8
  14. package/dist/ReactLikeC4.d.ts +12 -2
  15. package/dist/ReactLikeC4.js +5 -3
  16. package/dist/adhoc-editor/ActorProvider.d.ts +7 -0
  17. package/dist/adhoc-editor/ActorProvider.js +41 -0
  18. package/dist/adhoc-editor/EditorNavigationPanel.d.ts +1 -0
  19. package/dist/adhoc-editor/EditorNavigationPanel.js +32 -0
  20. package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +4 -0
  21. package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +71 -0
  22. package/dist/adhoc-editor/SelectElementOverlay.d.ts +1 -0
  23. package/dist/adhoc-editor/SelectElementOverlay.js +124 -0
  24. package/dist/adhoc-editor/actor.d.ts +131 -0
  25. package/dist/adhoc-editor/actor.editor.d.ts +54 -0
  26. package/dist/adhoc-editor/actor.editor.js +96 -0
  27. package/dist/adhoc-editor/actor.js +20 -0
  28. package/dist/adhoc-editor/actor.layouter.d.ts +48 -0
  29. package/dist/adhoc-editor/actor.layouter.js +66 -0
  30. package/dist/adhoc-editor/actor.types.d.ts +57 -0
  31. package/dist/adhoc-editor/actor.types.js +22 -0
  32. package/dist/adhoc-editor/hooks.d.ts +14 -0
  33. package/dist/adhoc-editor/hooks.js +47 -0
  34. package/dist/adhoc-editor/index.d.ts +2 -0
  35. package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +6 -0
  36. package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +104 -0
  37. package/dist/base/const.d.ts +1 -0
  38. package/dist/base/const.js +2 -1
  39. package/dist/base/updateEdges.js +26 -3
  40. package/dist/base/updateNodes.js +8 -5
  41. package/dist/base-primitives/Markdown.js +1 -1
  42. package/dist/base-primitives/NodeHandles.d.ts +4 -2
  43. package/dist/base-primitives/NodeHandles.js +46 -19
  44. package/dist/base-primitives/compound/CompoundActionButton.js +3 -1
  45. package/dist/base-primitives/compound/CompoundDetailsButton.js +3 -1
  46. package/dist/base-primitives/compound/CompoundNodeContainer.d.ts +4 -3
  47. package/dist/base-primitives/compound/CompoundNodeContainer.js +6 -4
  48. package/dist/base-primitives/compound/CompoundTitle.js +1 -2
  49. package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
  50. package/dist/base-primitives/edge/EdgeContainer.js +5 -2
  51. package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -1
  52. package/dist/base-primitives/element/ElementActionButtons.js +31 -58
  53. package/dist/base-primitives/element/ElementData.d.ts +7 -7
  54. package/dist/base-primitives/element/ElementData.js +61 -48
  55. package/dist/base-primitives/element/ElementDetailsButton.js +2 -1
  56. package/dist/base-primitives/element/ElementNodeContainer.d.ts +2 -2
  57. package/dist/base-primitives/element/ElementNodeContainer.js +3 -3
  58. package/dist/base-primitives/element/ElementShape.js +109 -20
  59. package/dist/base-primitives/element/ElementTags.d.ts +6 -2
  60. package/dist/base-primitives/element/ElementTags.js +55 -32
  61. package/dist/base-primitives/index.d.ts +1 -1
  62. package/dist/base-primitives/memoEdge.js +1 -1
  63. package/dist/base-primitives/memoNode.js +1 -1
  64. package/dist/components/ErrorFallback.js +1 -1
  65. package/dist/components/Link.js +2 -2
  66. package/dist/components/Logo.js +1 -1
  67. package/dist/components/NavigationPanel.d.ts +11 -0
  68. package/dist/components/NavigationPanel.js +50 -0
  69. package/dist/components/RootContainer.js +5 -8
  70. package/dist/context/DefaultMantineProvider.d.ts +2 -0
  71. package/dist/context/DefaultMantineProvider.js +66 -0
  72. package/dist/context/DiagramEventHandlers.js +1 -1
  73. package/dist/context/DiagramFeatures.js +12 -11
  74. package/dist/context/EnsureMantine.d.ts +0 -3
  75. package/dist/context/EnsureMantine.js +3 -4
  76. package/dist/context/IconRenderer.d.ts +14 -0
  77. package/dist/context/IconRenderer.js +11 -8
  78. package/dist/context/TagStylesContext.js +12 -4
  79. package/dist/custom/hooks.d.ts +2 -2
  80. package/dist/custom/index.d.ts +1 -1
  81. package/dist/custom/index.js +2 -2
  82. package/dist/editor/LikeC4EditorCallbacks.d.ts +18 -0
  83. package/dist/editor/LikeC4EditorCallbacks.js +5 -0
  84. package/dist/editor/LikeC4EditorProvider.d.ts +30 -18
  85. package/dist/editor/LikeC4EditorProvider.js +2 -2
  86. package/dist/editor/applyChangesToManualLayout.js +1 -0
  87. package/dist/editor/editorActor.actions.d.ts +25 -25
  88. package/dist/editor/editorActor.actions.js +2 -2
  89. package/dist/editor/editorActor.setup.d.ts +84 -0
  90. package/dist/editor/editorActor.setup.js +38 -0
  91. package/dist/editor/editorActor.states.d.ts +9 -0
  92. package/dist/editor/{editorActor.js → editorActor.states.js} +22 -64
  93. package/dist/editor/index.d.ts +4 -3
  94. package/dist/editor/useEditorActorLogic.d.ts +2 -564
  95. package/dist/editor/useEditorActorLogic.js +8 -12
  96. package/dist/hooks/index.d.ts +1 -1
  97. package/dist/hooks/useCallbackRef.d.ts +6 -0
  98. package/dist/hooks/useCurrentViewModel.d.ts +10 -0
  99. package/dist/hooks/useDiagram.js +2 -2
  100. package/dist/hooks/useDiagramCompareLayout.d.ts +1 -1
  101. package/dist/hooks/useDiagramCompareLayout.js +1 -1
  102. package/dist/hooks/useLikeC4ElementsTree.js +1 -1
  103. package/dist/hooks/useLikeC4Model.js +2 -2
  104. package/dist/hooks/useLikeC4Project.js +10 -2
  105. package/dist/hooks/useLikeC4Styles.js +0 -3
  106. package/dist/hooks/useSetState.d.ts +6 -1
  107. package/dist/hooks/useSetState.js +7 -4
  108. package/dist/hooks/useXYFlow.d.ts +7 -1
  109. package/dist/hooks/useXYFlow.js +4 -4
  110. package/dist/index.d.ts +9 -5
  111. package/dist/index.js +6 -3
  112. package/dist/likec4diagram/DiagramUI.js +1 -3
  113. package/dist/likec4diagram/DiagramXYFlow.js +26 -12
  114. package/dist/likec4diagram/convert-to-xyflow.d.ts +2 -1
  115. package/dist/likec4diagram/convert-to-xyflow.js +2 -6
  116. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +13 -14
  117. package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
  118. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +3 -0
  119. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +68 -35
  120. package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +1 -2
  121. package/dist/likec4diagram/custom/nodes/ElementActions.js +7 -10
  122. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +7 -5
  123. package/dist/likec4diagram/custom/nodes/nodes.js +25 -6
  124. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +8 -7
  125. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +1 -38
  126. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
  127. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +35 -19
  128. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +9 -5
  129. package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +6 -1
  130. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +46 -10
  131. package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +2 -2
  132. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -15
  133. package/dist/likec4diagram/relationship-popover/components.d.ts +7 -0
  134. package/dist/likec4diagram/relationship-popover/components.js +39 -0
  135. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
  136. package/dist/likec4diagram/state/DiagramActorProvider.js +14 -15
  137. package/dist/likec4diagram/state/assign.d.ts +1 -1
  138. package/dist/likec4diagram/state/createViewChange.js +16 -4
  139. package/dist/likec4diagram/state/machine.actions.d.ts +65 -0
  140. package/dist/likec4diagram/state/machine.actions.js +51 -39
  141. package/dist/likec4diagram/state/machine.actions.layout.d.ts +22 -2
  142. package/dist/likec4diagram/state/machine.actions.layout.js +32 -14
  143. package/dist/likec4diagram/state/machine.d.ts +1 -1
  144. package/dist/likec4diagram/state/machine.js +31 -30
  145. package/dist/likec4diagram/state/machine.setup.d.ts +21 -5
  146. package/dist/likec4diagram/state/machine.setup.js +13 -4
  147. package/dist/likec4diagram/state/machine.state.initializing.d.ts +32 -2
  148. package/dist/likec4diagram/state/machine.state.navigating.d.ts +1 -1
  149. package/dist/likec4diagram/state/machine.state.navigating.js +81 -49
  150. package/dist/likec4diagram/state/machine.state.ready.d.ts +508 -582
  151. package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +17 -148
  152. package/dist/likec4diagram/state/machine.state.ready.focused.js +6 -14
  153. package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +11 -96
  154. package/dist/likec4diagram/state/machine.state.ready.idle.js +7 -12
  155. package/dist/likec4diagram/state/machine.state.ready.js +80 -69
  156. package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +4 -0
  157. package/dist/likec4diagram/state/machine.state.ready.printing.js +4 -3
  158. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +145 -2
  159. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +29 -21
  160. package/dist/likec4diagram/state/types.d.ts +1 -1
  161. package/dist/likec4diagram/state/utils.d.ts +13 -14
  162. package/dist/likec4diagram/state/utils.js +11 -3
  163. package/dist/likec4diagram/types.d.ts +9 -1
  164. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
  165. package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
  166. package/dist/likec4diagram/useLayoutConstraints.js +4 -1
  167. package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +11 -3
  168. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +5 -3
  169. package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -3
  170. package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +10 -8
  171. package/dist/likec4diagram/xyflow-sequence/utils.d.ts +1 -1
  172. package/dist/navigationpanel/NavigationPanel.js +2 -1
  173. package/dist/navigationpanel/NavigationPanelControls.js +6 -4
  174. package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
  175. package/dist/navigationpanel/_common.js +1 -2
  176. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
  177. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
  178. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +4 -5
  179. package/dist/navigationpanel/controls/DetailsControls.js +5 -5
  180. package/dist/navigationpanel/controls/LayoutWarning.js +2 -2
  181. package/dist/navigationpanel/controls/LogoButton.d.ts +1 -0
  182. package/dist/navigationpanel/controls/{BurgerButton.js → LogoButton.js} +5 -5
  183. package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
  184. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  185. package/dist/navigationpanel/controls/SearchControl.d.ts +1 -2
  186. package/dist/navigationpanel/controls/SearchControl.js +8 -12
  187. package/dist/navigationpanel/controls/ToggleReadonly.js +4 -5
  188. package/dist/navigationpanel/controls/index.d.ts +1 -1
  189. package/dist/navigationpanel/dropdown/ProjectsMenu.js +12 -6
  190. package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
  191. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
  192. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
  193. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
  194. package/dist/navigationpanel/editorpanel/styles.js +4 -4
  195. package/dist/navigationpanel/styles.css.js +1 -1
  196. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
  197. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +67 -67
  198. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
  199. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +1 -1
  200. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.js +14 -0
  201. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +14 -0
  202. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +14 -0
  203. package/dist/overlays/element-details/ElementDetailsCard.css.js +4 -4
  204. package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
  205. package/dist/overlays/element-details/MetadataValue.js +6 -7
  206. package/dist/overlays/element-details/TabPanelDeployments.js +7 -5
  207. package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -25
  208. package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
  209. package/dist/overlays/element-details/TabPanelStructure.js +3 -2
  210. package/dist/overlays/overlaysActor.js +18 -0
  211. package/dist/overlays/relationship-details/RelationshipDetails.d.ts +0 -5
  212. package/dist/overlays/relationship-details/RelationshipDetails.js +4 -4
  213. package/dist/overlays/relationship-details/SelectEdge.css.js +2 -2
  214. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  215. package/dist/overlays/relationship-details/compute.js +1 -1
  216. package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
  217. package/dist/overlays/relationship-details/custom/nodeTypes.js +14 -1
  218. package/dist/overlays/relationship-details/layout.js +1 -1
  219. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +0 -5
  220. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +116 -21
  221. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  222. package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
  223. package/dist/overlays/relationships-browser/custom/EmptyNode.js +21 -6
  224. package/dist/overlays/relationships-browser/custom/edgeTypes.js +0 -1
  225. package/dist/overlays/relationships-browser/custom/nodeTypes.js +14 -1
  226. package/dist/overlays/relationships-browser/layout.d.ts +1 -1
  227. package/dist/overlays/relationships-browser/layout.js +1 -1
  228. package/dist/projects-overview/ProjectsOverview.d.ts +13 -0
  229. package/dist/projects-overview/ProjectsOverview.js +57 -0
  230. package/dist/projects-overview/ProjectsOverviewXY.d.ts +17 -0
  231. package/dist/projects-overview/ProjectsOverviewXY.js +98 -0
  232. package/dist/projects-overview/_types.d.ts +34 -0
  233. package/dist/projects-overview/actor.d.ts +121 -0
  234. package/dist/projects-overview/actor.js +359 -0
  235. package/dist/projects-overview/context.d.ts +4 -0
  236. package/dist/projects-overview/context.js +9 -0
  237. package/dist/projects-overview/custom/edgeTypes.d.ts +3 -0
  238. package/dist/projects-overview/custom/edgeTypes.js +23 -0
  239. package/dist/projects-overview/custom/index.d.ts +2 -0
  240. package/dist/projects-overview/custom/nodeTypes.d.ts +2 -0
  241. package/dist/projects-overview/custom/nodeTypes.js +45 -0
  242. package/dist/projects-overview/hooks.d.ts +5 -0
  243. package/dist/projects-overview/hooks.js +14 -0
  244. package/dist/projects-overview/index.d.ts +1 -0
  245. package/dist/projects-overview/layouted-to-xyflow.d.ts +6 -0
  246. package/dist/projects-overview/layouted-to-xyflow.js +49 -0
  247. package/dist/projects-overview/panel/ProjectsOverviewPanel.d.ts +1 -0
  248. package/dist/projects-overview/panel/ProjectsOverviewPanel.js +11 -0
  249. package/dist/projects-overview/persistence.d.ts +5 -0
  250. package/dist/projects-overview/persistence.js +24 -0
  251. package/dist/search/Search.d.ts +1 -4
  252. package/dist/search/Search.js +89 -87
  253. package/dist/search/components/ElementsColumn.css.js +3 -3
  254. package/dist/search/components/ElementsColumn.js +3 -4
  255. package/dist/search/components/PickView.d.ts +3 -1
  256. package/dist/search/components/PickView.js +5 -4
  257. package/dist/search/components/SearchByTags.js +1 -1
  258. package/dist/search/components/SearchInput.js +1 -1
  259. package/dist/search/components/ViewsColum.js +2 -2
  260. package/dist/search/components/_shared.css.js +1 -1
  261. package/dist/search/components/utils.js +1 -1
  262. package/dist/search/hooks.d.ts +1 -6
  263. package/dist/search/hooks.js +12 -9
  264. package/dist/search/searchActor.d.ts +1 -1
  265. package/dist/shadowroot/ShadowRoot.js +20 -19
  266. package/dist/shadowroot/styles.css.d.ts +0 -2
  267. package/dist/shadowroot/styles.css.js +1 -34
  268. package/dist/styles-font.css2.js +1 -1
  269. package/dist/styles.css2.js +1 -1
  270. package/dist/utils/view-bounds.js +9 -5
  271. package/dist/utils/xyflow.d.ts +19 -3
  272. package/dist/utils/xyflow.js +52 -9
  273. package/package.json +23 -22
  274. package/panda.buildinfo.json +93 -84
  275. package/styles-font.css +1 -1
  276. package/styles-min.css +1 -1
  277. package/styles.css +1 -1
  278. package/dist/base-primitives/element/ElementNodeContainer.css.d.ts +0 -1
  279. package/dist/base-primitives/element/ElementNodeContainer.css.js +0 -39
  280. package/dist/editor/__tests__/fixture.d.ts +0 -205
  281. package/dist/editor/editorActor.d.ts +0 -653
  282. package/dist/likec4diagram/relationship-popover/styles.css.d.ts +0 -2
  283. package/dist/likec4diagram/relationship-popover/styles.css.js +0 -28
  284. package/dist/navigationpanel/controls/BurgerButton.d.ts +0 -1
  285. package/dist/overlays/relationships-browser/custom/styles.css.js +0 -14
  286. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
  287. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
  288. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
  289. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
  290. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
  291. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
  292. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
  293. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
  294. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
  295. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
  296. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
  297. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
  298. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
  299. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
  300. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
  301. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
  302. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
  303. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
  304. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
  305. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
  306. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
  307. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
  308. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
  309. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
  310. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
  311. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
  312. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
  313. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
  314. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
  315. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
  316. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
  317. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
  318. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
  319. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
  320. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
  321. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
  322. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
  323. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
  324. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
  325. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
  326. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
  327. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
  328. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
  329. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
  330. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
  331. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
  332. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
  333. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
  334. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
  335. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
  336. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
  337. /package/dist/{overlays/relationships-browser → projects-overview}/custom/styles.css.d.ts +0 -0
@@ -1,28 +1,12 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { cx } from '@likec4/styles/css';
3
- import { Box } from '@likec4/styles/jsx';
4
- import { hstack } from '@likec4/styles/patterns';
5
- import { actionBtn } from '@likec4/styles/recipes';
3
+ import { actionButtons, actionBtn } from '@likec4/styles/recipes';
6
4
  import { ActionIcon } from '@mantine/core';
7
5
  import { useId } from '@mantine/hooks';
8
6
  import * as m from 'motion/react-m';
9
7
  import { stopPropagation } from '../../utils/xyflow.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';
8
+ import IconBolt from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js';
11
9
 
12
- const container = hstack({
13
- position: "absolute",
14
- zIndex: 1,
15
- justifyContent: "center",
16
- alignItems: "center",
17
- _smallZoom: {
18
- display: "none"
19
- }
20
- });
21
- const actionButtons = hstack({
22
- gap: "1.5",
23
- justifyContent: "center",
24
- alignItems: "center"
25
- });
26
10
  function ElementActionButtons({
27
11
  selected = false,
28
12
  data: {
@@ -34,53 +18,42 @@ function ElementActionButtons({
34
18
  if (!buttons.length) {
35
19
  return null;
36
20
  }
37
- return /* @__PURE__ */ jsx(
38
- Box,
21
+ return /* @__PURE__ */ jsx("div", { className: actionButtons(), children: /* @__PURE__ */ jsx(
22
+ m.div,
39
23
  {
40
- className: container,
24
+ layoutRoot: true,
25
+ initial: false,
41
26
  style: {
42
- top: `calc(100% - 30px)`,
43
- transform: "translateX(-50%)",
44
- left: `50%`,
45
- width: "auto",
46
- minHeight: 30
27
+ originY: 0
28
+ },
29
+ animate: {
30
+ opacity: isHovered || selected ? 1 : 0.75,
31
+ scale: isHovered ? 1.1 : selected ? 0.9 : 0.8,
32
+ y: isHovered || selected ? 6 : 0
47
33
  },
48
- children: /* @__PURE__ */ jsx(
49
- m.div,
34
+ layoutDependency: `${isHovered}-${selected}`,
35
+ "data-likec4-hovered": isHovered,
36
+ className: cx("nodrag nopan"),
37
+ onClick: stopPropagation,
38
+ children: buttons.map((button, index) => /* @__PURE__ */ jsx(
39
+ ActionIcon,
50
40
  {
51
- layoutRoot: true,
41
+ component: m.button,
42
+ className: actionBtn({}),
52
43
  initial: false,
53
- style: {
54
- originY: 0
55
- },
56
- animate: {
57
- opacity: isHovered || selected ? 1 : 0.75,
58
- scale: isHovered ? 1.1 : selected ? 0.9 : 0.8,
59
- y: isHovered || selected ? 6 : 0
44
+ whileTap: { scale: 1 },
45
+ whileHover: {
46
+ scale: 1.3
60
47
  },
61
- layoutDependency: `${isHovered}-${selected}`,
62
- "data-likec4-hovered": isHovered,
63
- className: cx("nodrag nopan", actionButtons),
64
- children: buttons.map((button, index) => /* @__PURE__ */ jsx(
65
- ActionIcon,
66
- {
67
- component: m.button,
68
- className: actionBtn({}),
69
- initial: false,
70
- whileTap: { scale: 1 },
71
- whileHover: {
72
- scale: 1.3
73
- },
74
- onClick: button.onClick,
75
- onDoubleClick: stopPropagation,
76
- children: button.icon || /* @__PURE__ */ jsx(IconBolt, {})
77
- },
78
- `${id}-${button.key ?? index}`
79
- ))
80
- }
81
- )
48
+ tabIndex: -1,
49
+ onClick: button.onClick,
50
+ onDoubleClick: stopPropagation,
51
+ children: button.icon || /* @__PURE__ */ jsx(IconBolt, {})
52
+ },
53
+ `${id}-${button.key ?? index}`
54
+ ))
82
55
  }
83
- );
56
+ ) });
84
57
  }
85
58
 
86
59
  export { ElementActionButtons };
@@ -10,9 +10,8 @@ type RequiredData = {
10
10
  description?: MarkdownOrString | null | undefined;
11
11
  icon?: string | null;
12
12
  };
13
- type ElementDataProps = {
13
+ export type ElementDataProps = {
14
14
  data: RequiredData;
15
- iconSize?: number;
16
15
  };
17
16
  type IconProps = {
18
17
  data: {
@@ -27,6 +26,7 @@ type SlotProps = {
27
26
  data: RequiredData;
28
27
  className?: string;
29
28
  style?: CSSProperties;
29
+ [key: `data-${string}`]: string;
30
30
  };
31
31
  /**
32
32
  * Renders an element title, technology, description, and icon.
@@ -37,19 +37,19 @@ type SlotProps = {
37
37
  * ```
38
38
  * or
39
39
  * ```tsx
40
- * <ElementData.Root>
40
+ * <ElementData.Root {...nodeProps} >
41
41
  * <ElementData.Icon {...nodeProps} />
42
- * <ElementData.Root>
42
+ * <ElementData.Content>
43
43
  * <ElementData.Title {...nodeProps} />
44
44
  * <ElementData.Technology {...nodeProps} />
45
45
  * <ElementData.Description {...nodeProps} />
46
- * </ElementData.Root>
46
+ * </ElementData.Content>
47
47
  * </ElementData.Root>
48
48
  * ```
49
49
  */
50
- export declare function ElementData({ iconSize, data }: ElementDataProps): import("react/jsx-runtime").JSX.Element;
50
+ export declare function ElementData({ data }: ElementDataProps): import("react/jsx-runtime").JSX.Element;
51
51
  export declare namespace ElementData {
52
- var Root: import("react").ForwardRefExoticComponent<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
52
+ var Root: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & ElementDataProps & import("react").RefAttributes<HTMLDivElement>>;
53
53
  var Icon: ({ data, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
54
54
  var Content: import("react").ForwardRefExoticComponent<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
55
55
  var Title: import("react").ForwardRefExoticComponent<SlotProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,25 +1,57 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { ensureSizes, RichText } from '@likec4/core/types';
3
- import { cx, css } from '@likec4/styles/css';
2
+ import { RichText } from '@likec4/core/types';
3
+ import { cx } from '@likec4/styles/css';
4
4
  import { elementNodeData } from '@likec4/styles/recipes';
5
- import { Text } from '@mantine/core';
6
5
  import { forwardRef } from 'react';
7
- import { isNumber, isTruthy } from 'remeda';
6
+ import { isTruthy } from 'remeda';
8
7
  import { IconRenderer } from '../../context/IconRenderer.js';
8
+ import { useLikeC4Styles } from '../../hooks/useLikeC4Styles.js';
9
9
  import { Markdown } from '../Markdown.js';
10
10
 
11
- const Root = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
12
- "div",
13
- {
14
- ...props,
15
- ref,
16
- className: cx(
17
- className,
18
- elementNodeData(),
19
- "likec4-element"
20
- )
11
+ const resolveIconColor = (styles, data) => {
12
+ const iconColor = data.style.iconColor;
13
+ if (!iconColor) {
14
+ return void 0;
21
15
  }
22
- ));
16
+ const colors = styles.colors(iconColor).elements;
17
+ return iconColor === data.color ? colors.stroke : colors.fill;
18
+ };
19
+ const Root = forwardRef(({
20
+ className,
21
+ style,
22
+ data,
23
+ ...props
24
+ }, ref) => {
25
+ const styles = useLikeC4Styles();
26
+ const iconSize = data.style.iconSize ? styles.nodeSizes(data.style).values.iconSize : void 0;
27
+ const resolvedIconColor = resolveIconColor(styles, data);
28
+ return /* @__PURE__ */ jsx(
29
+ "div",
30
+ {
31
+ ...props,
32
+ ref,
33
+ className: cx(
34
+ className,
35
+ elementNodeData({
36
+ iconPosition: data.style.iconPosition,
37
+ withIconColor: !!resolvedIconColor
38
+ }),
39
+ "likec4-element"
40
+ ),
41
+ style: {
42
+ ...style,
43
+ ...iconSize && {
44
+ // @ts-ignore
45
+ "--likec4-icon-size": `${iconSize}px`
46
+ },
47
+ ...resolvedIconColor && {
48
+ // @ts-ignore
49
+ "--likec4-icon-color": resolvedIconColor
50
+ }
51
+ }
52
+ }
53
+ );
54
+ });
23
55
  const Icon = ({ data, ...props }) => /* @__PURE__ */ jsx(IconRenderer, { element: data, ...props });
24
56
  const Content = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
25
57
  "div",
@@ -32,20 +64,16 @@ const Content = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx
32
64
  ref
33
65
  }
34
66
  ));
35
- const Title = forwardRef(({ data: { title, style }, className, ...props }, ref) => {
36
- const { size } = ensureSizes(style);
37
- const isSm = size === "sm" || size === "xs";
67
+ const Title = forwardRef(({ data: { title }, className, ...props }, ref) => {
38
68
  return /* @__PURE__ */ jsx(
39
- Text,
69
+ "div",
40
70
  {
41
- component: "div",
42
71
  ...props,
43
72
  className: cx(
44
73
  className,
45
74
  "likec4-element-title"
46
75
  ),
47
76
  "data-likec4-node-title": "",
48
- lineClamp: isSm ? 2 : 3,
49
77
  ref,
50
78
  children: title
51
79
  }
@@ -54,9 +82,8 @@ const Title = forwardRef(({ data: { title, style }, className, ...props }, ref)
54
82
  const Technology = forwardRef(({ data, children, className, ...props }, ref) => {
55
83
  const text = data?.technology ?? children;
56
84
  return isTruthy(text) ? /* @__PURE__ */ jsx(
57
- Text,
85
+ "div",
58
86
  {
59
- component: "div",
60
87
  ...props,
61
88
  className: cx(
62
89
  className,
@@ -68,23 +95,18 @@ const Technology = forwardRef(({ data, children, className, ...props }, ref) =>
68
95
  }
69
96
  ) : null;
70
97
  });
71
- const Description = forwardRef(({ data: { description, style }, className, ...props }, ref) => {
98
+ const Description = forwardRef(({ data: { description }, className, ...props }, ref) => {
72
99
  if (!description) {
73
100
  return null;
74
101
  }
75
102
  const desc = RichText.from(description);
76
- const { size } = ensureSizes(style);
77
- const isSm = size === "sm" || size === "xs";
78
103
  return /* @__PURE__ */ jsx(
79
104
  Markdown,
80
105
  {
81
106
  ...props,
82
107
  className: cx(
83
108
  className,
84
- "likec4-element-description",
85
- css({
86
- lineClamp: isSm ? 3 : 5
87
- })
109
+ "likec4-element-description"
88
110
  ),
89
111
  "data-likec4-node-description": "",
90
112
  value: desc,
@@ -98,24 +120,15 @@ const Description = forwardRef(({ data: { description, style }, className, ...pr
98
120
  }
99
121
  );
100
122
  });
101
- function ElementData({ iconSize, data }) {
102
- return /* @__PURE__ */ jsxs(
103
- Root,
104
- {
105
- style: isNumber(iconSize) ? {
106
- // @ts-ignore
107
- ["--likec4-icon-size"]: `${iconSize}px`
108
- } : void 0,
109
- children: [
110
- /* @__PURE__ */ jsx(Icon, { data }),
111
- /* @__PURE__ */ jsxs(Content, { children: [
112
- /* @__PURE__ */ jsx(Title, { data }),
113
- /* @__PURE__ */ jsx(Technology, { data }),
114
- /* @__PURE__ */ jsx(Description, { data })
115
- ] })
116
- ]
117
- }
118
- );
123
+ function ElementData({ data }) {
124
+ return /* @__PURE__ */ jsxs(Root, { data, children: [
125
+ /* @__PURE__ */ jsx(Icon, { data }),
126
+ /* @__PURE__ */ jsxs(Content, { children: [
127
+ /* @__PURE__ */ jsx(Title, { data }),
128
+ /* @__PURE__ */ jsx(Technology, { data }),
129
+ /* @__PURE__ */ jsx(Description, { data })
130
+ ] })
131
+ ] });
119
132
  }
120
133
  ElementData.Root = Root;
121
134
  ElementData.Icon = Icon;
@@ -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.36.0_react@19.2.3/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.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
9
9
 
10
10
  const container = css({
11
11
  position: "absolute",
@@ -64,6 +64,7 @@ function ElementDetailsButton({
64
64
  whileTap: { scale: 1.15 },
65
65
  onClick,
66
66
  onDoubleClick: stopPropagation,
67
+ tabIndex: -1,
67
68
  children: icon ?? /* @__PURE__ */ jsx(IconId, { stroke: 1.8, style: { width: "75%" } })
68
69
  }
69
70
  ) });
@@ -1,11 +1,11 @@
1
- import { Color, ElementShape, ElementStyle } from '@likec4/core/types';
1
+ import { Color, ComputedNodeStyle, ElementShape } from '@likec4/core/types';
2
2
  import { MotionNodeLayoutOptions } from 'motion/react';
3
3
  import { CSSProperties, ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
4
4
  import { BaseNodePropsWithData } from '../../base/types';
5
5
  type RequiredData = {
6
6
  color: Color;
7
7
  shape: ElementShape;
8
- style?: ElementStyle;
8
+ style?: ComputedNodeStyle;
9
9
  };
10
10
  /**
11
11
  * Top-level primitive to compose leaf nodes renderers.
@@ -1,9 +1,9 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { ensureSizes } from '@likec4/core/types';
3
3
  import { cx } from '@likec4/styles/css';
4
+ import { elementNode } from '@likec4/styles/recipes';
4
5
  import * as m from 'motion/react-m';
5
6
  import { forwardRef } from 'react';
6
- import { container } from './ElementNodeContainer.css.js';
7
7
 
8
8
  const ElementNodeContainer = forwardRef(({
9
9
  nodeProps: {
@@ -39,9 +39,8 @@ const ElementNodeContainer = forwardRef(({
39
39
  {
40
40
  ref,
41
41
  className: cx(
42
- container,
42
+ elementNode(),
43
43
  "group",
44
- "likec4-element-node",
45
44
  className
46
45
  ),
47
46
  initial: false,
@@ -63,6 +62,7 @@ const ElementNodeContainer = forwardRef(({
63
62
  style: {
64
63
  ...style
65
64
  },
65
+ tabIndex: -1,
66
66
  ...rest,
67
67
  children
68
68
  }
@@ -1,9 +1,9 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { nonexhaustive } from '@likec4/core';
3
3
  import { elementShapeRecipe } from '@likec4/styles/recipes';
4
4
  import { roundDpr } from '../../utils/roundDpr.js';
5
5
 
6
- function cylinderSVGPath(diameter, height, tilt = 0.065) {
6
+ function cylinderSVGPath(diameter, height, tilt = 0.07) {
7
7
  const radius = Math.round(diameter / 2);
8
8
  const rx = radius;
9
9
  const ry = roundDpr(tilt * radius);
@@ -21,6 +21,48 @@ function cylinderSVGPath(diameter, height, tilt = 0.065) {
21
21
  rx
22
22
  };
23
23
  }
24
+ function docSVGPath(width, height) {
25
+ const waveHeight = height / 8;
26
+ const baseY = roundDpr(height - waveHeight / 2);
27
+ const amplitude = roundDpr(height / 6);
28
+ const radius = 6;
29
+ const path = `
30
+ M 0 ${baseY}
31
+ V ${radius}
32
+ Q 0 0 ${radius} 0
33
+ H ${width - radius}
34
+ Q ${width} 0 ${width} ${radius}
35
+ V ${baseY}
36
+ C ${roundDpr(width * 0.75)} ${baseY + amplitude}, ${roundDpr(width * 0.5)} ${baseY - amplitude}, 0 ${baseY}
37
+ `.replace(/\s+/g, " ").trim();
38
+ return {
39
+ path
40
+ };
41
+ }
42
+ function bucketSVGPath(width, height) {
43
+ const cx = width / 2;
44
+ const topRx = roundDpr(cx);
45
+ const topRy = roundDpr(Math.min(height / 8, topRx * 0.08));
46
+ const bottomRx = roundDpr(topRx * 0.8);
47
+ const bottomRy = roundDpr(topRy * 1.05);
48
+ const topY = topRy;
49
+ const bottomY = height - bottomRy;
50
+ const leftBottomX = cx - bottomRx;
51
+ const path = `
52
+ M ${width},${topY}
53
+ a ${topRx},${topRy} 0,0,0 ${-width} 0
54
+ L ${leftBottomX},${bottomY}
55
+ a ${bottomRx},${bottomRy} 0,0,0 ${bottomRx * 2} 0
56
+ Z
57
+ `.replace(/\s+/g, " ").trim();
58
+ return {
59
+ path,
60
+ topRx,
61
+ topRy,
62
+ bottomRx,
63
+ bottomRy
64
+ };
65
+ }
24
66
  function queueSVGPath(width, height, tilt = 0.185) {
25
67
  const diameter = height;
26
68
  const radius = Math.round(diameter / 2);
@@ -64,6 +106,17 @@ function ShapeSvg({ shape, w, h }) {
64
106
  ] })
65
107
  ] });
66
108
  }
109
+ case "document": {
110
+ const { path } = docSVGPath(w, h);
111
+ return /* @__PURE__ */ jsx(
112
+ "path",
113
+ {
114
+ d: path,
115
+ "data-likec4-fill": "fill",
116
+ strokeWidth: 2
117
+ }
118
+ );
119
+ }
67
120
  case "browser": {
68
121
  return /* @__PURE__ */ jsxs(Fragment, { children: [
69
122
  /* @__PURE__ */ jsx(
@@ -123,12 +176,39 @@ function ShapeSvg({ shape, w, h }) {
123
176
  /* @__PURE__ */ jsx("ellipse", { cx: rx, cy: ry, ry: ry - 0.75, rx, "data-likec4-fill": "mix-stroke", strokeWidth: 2 })
124
177
  ] });
125
178
  }
179
+ case "bucket": {
180
+ const { path, topRx, topRy } = bucketSVGPath(w, h);
181
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
182
+ /* @__PURE__ */ jsx("path", { d: path, strokeWidth: 2 }),
183
+ /* @__PURE__ */ jsx(
184
+ "ellipse",
185
+ {
186
+ cx: w / 2,
187
+ cy: topRy,
188
+ rx: topRx,
189
+ ry: topRy,
190
+ "data-likec4-fill": "mix-stroke",
191
+ strokeWidth: 2
192
+ }
193
+ )
194
+ ] });
195
+ }
126
196
  case "storage":
127
197
  case "cylinder": {
128
198
  const { path, rx, ry } = cylinderSVGPath(w, h);
129
199
  return /* @__PURE__ */ jsxs(Fragment, { children: [
130
200
  /* @__PURE__ */ jsx("path", { d: path, strokeWidth: 2 }),
131
- /* @__PURE__ */ jsx("ellipse", { cx: rx, cy: ry, ry, rx: rx - 0.75, "data-likec4-fill": "mix-stroke", strokeWidth: 2 })
201
+ /* @__PURE__ */ jsx(
202
+ "ellipse",
203
+ {
204
+ cx: rx,
205
+ cy: ry,
206
+ ry,
207
+ rx: rx - 0.75,
208
+ "data-likec4-fill": "mix-stroke",
209
+ strokeWidth: 2
210
+ }
211
+ )
132
212
  ] });
133
213
  }
134
214
  default: {
@@ -139,12 +219,18 @@ function ShapeSvg({ shape, w, h }) {
139
219
  function ShapeSvgOutline({ shape, w, h }) {
140
220
  let svg;
141
221
  switch (shape) {
222
+ case "bucket":
223
+ svg = /* @__PURE__ */ jsx("g", { transform: "translate(-3 -3)", children: /* @__PURE__ */ jsx("path", { d: bucketSVGPath(w + 6, h + 6).path }) });
224
+ break;
142
225
  case "queue":
143
- svg = /* @__PURE__ */ jsx("path", { d: queueSVGPath(w, h).path });
226
+ svg = /* @__PURE__ */ jsx("g", { transform: "translate(-3 -3)", children: /* @__PURE__ */ jsx("path", { d: queueSVGPath(w + 6, h + 6).path }) });
227
+ break;
228
+ case "document":
229
+ svg = /* @__PURE__ */ jsx("g", { transform: "translate(-3 -3)", children: /* @__PURE__ */ jsx("path", { d: docSVGPath(w + 6, h + 6).path }) });
144
230
  break;
145
231
  case "storage":
146
232
  case "cylinder": {
147
- svg = /* @__PURE__ */ jsx("path", { d: cylinderSVGPath(w, h).path });
233
+ svg = /* @__PURE__ */ jsx("g", { transform: "translate(-3 -3)", children: /* @__PURE__ */ jsx("path", { d: cylinderSVGPath(w + 6, h + 6).path }) });
148
234
  break;
149
235
  }
150
236
  default: {
@@ -163,26 +249,29 @@ function ShapeSvgOutline({ shape, w, h }) {
163
249
  }
164
250
  return /* @__PURE__ */ jsx("g", { className: "likec4-shape-outline", children: svg });
165
251
  }
166
- function ShapeHtml({ multiple, withOutLine }) {
167
- return /* @__PURE__ */ jsxs(
168
- "div",
169
- {
170
- className: elementShapeRecipe({
171
- shapetype: "html"
172
- }),
173
- children: [
174
- multiple && /* @__PURE__ */ jsx("div", { className: "likec4-shape-multiple" }),
175
- withOutLine && /* @__PURE__ */ jsx("div", { className: "likec4-shape-outline" })
176
- ]
177
- }
178
- );
179
- }
180
252
  function ElementShape({ data, width, height, showSeletionOutline = true }) {
181
253
  let w = !!width && width > 10 ? width : data.width;
182
254
  let h = !!height && height > 10 ? height : data.height;
183
255
  const isMultiple = data.style?.multiple ?? false;
256
+ const borderStyle = data.style?.border ?? "none";
257
+ const withBorder = borderStyle !== "none";
184
258
  if (data.shape === "rectangle") {
185
- return /* @__PURE__ */ jsx(ShapeHtml, { multiple: isMultiple, withOutLine: showSeletionOutline });
259
+ return /* @__PURE__ */ jsxs(
260
+ "div",
261
+ {
262
+ style: {
263
+ borderStyle
264
+ },
265
+ className: elementShapeRecipe({
266
+ shapetype: "html",
267
+ withBorder
268
+ }),
269
+ children: [
270
+ isMultiple && /* @__PURE__ */ jsx("div", { className: "likec4-shape-multiple" }),
271
+ showSeletionOutline && /* @__PURE__ */ jsx("div", { className: "likec4-shape-outline" })
272
+ ]
273
+ }
274
+ );
186
275
  }
187
276
  const className = elementShapeRecipe({
188
277
  shapetype: "svg"
@@ -12,6 +12,10 @@ type Data = {
12
12
  tags: readonly string[] | null | undefined;
13
13
  width: number;
14
14
  };
15
- type ElementTagsProps = BaseNodePropsWithData<Data>;
16
- export declare const ElementTags: MemoExoticComponent<({ id, data: { tags, width, hovered } }: ElementTagsProps) => import("react/jsx-runtime").JSX.Element | null>;
15
+ export type ElementTagsProps = BaseNodePropsWithData<Data> & {
16
+ onTagClick?: (tag: `#${string}`) => void;
17
+ onTagMouseEnter?: (tag: `#${string}`) => void;
18
+ onTagMouseLeave?: (tag: `#${string}`) => void;
19
+ };
20
+ export declare const ElementTags: MemoExoticComponent<({ id, data: { tags, width, hovered }, onTagClick, onTagMouseEnter, onTagMouseLeave }: ElementTagsProps) => import("react/jsx-runtime").JSX.Element | null>;
17
21
  export {};