@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
@@ -5,13 +5,12 @@ import { Box, HStack } from '@likec4/styles/jsx';
5
5
  import { hstack } from '@likec4/styles/patterns';
6
6
  import { likec4tag } from '@likec4/styles/recipes';
7
7
  import { useHover, useDebouncedState } from '@mantine/hooks';
8
- import { NodeToolbar, Position } from '@xyflow/react';
8
+ import { useStore, NodeToolbar, Position } from '@xyflow/react';
9
9
  import { deepEqual } from 'fast-equals';
10
10
  import { forwardRef, memo, useEffect, useCallback } from 'react';
11
+ import { hasAtLeast } from 'remeda';
11
12
  import { useTagSpecification } from '../../context/TagStylesContext.js';
12
- import '@xstate/react';
13
- import { useDiagram } from '../../hooks/safeContext.js';
14
- import { useCurrentZoom } from '../../hooks/useXYFlow.js';
13
+ import { useCurrentZoomAtLeast } from '../../hooks/useXYFlow.js';
15
14
  import { stopPropagation } from '../../utils/xyflow.js';
16
15
 
17
16
  const ElementTag = forwardRef(
@@ -42,9 +41,38 @@ const ElementTag = forwardRef(
42
41
  }
43
42
  );
44
43
  const propsAreEqual = (prev, next) => {
45
- return prev.data.width === next.data.width && deepEqual(prev.data.tags, next.data.tags) && (prev.data.hovered ?? false) === (next.data.hovered ?? false);
44
+ return prev.id === next.id && prev.data.width === next.data.width && (prev.data.hovered ?? false) === (next.data.hovered ?? false) && deepEqual(prev.data.tags, next.data.tags);
46
45
  };
47
- const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
46
+ const ElementTags = memo(
47
+ ({ id, data: { tags, width, hovered = false }, onTagClick, onTagMouseEnter, onTagMouseLeave }) => {
48
+ if (!tags || !hasAtLeast(tags, 1)) {
49
+ return null;
50
+ }
51
+ return /* @__PURE__ */ jsx(
52
+ WithElementTags,
53
+ {
54
+ id,
55
+ tags,
56
+ width,
57
+ hovered,
58
+ onTagClick,
59
+ onTagMouseEnter,
60
+ onTagMouseLeave
61
+ }
62
+ );
63
+ },
64
+ propsAreEqual
65
+ );
66
+ ElementTags.displayName = "ElementTags";
67
+ function WithElementTags({
68
+ id,
69
+ tags,
70
+ width,
71
+ hovered,
72
+ onTagClick,
73
+ onTagMouseEnter,
74
+ onTagMouseLeave
75
+ }) {
48
76
  const {
49
77
  hovered: isTagsBarHovered,
50
78
  ref: tagsBarRef
@@ -62,19 +90,13 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
62
90
  return hovered || isTagsBarHovered || isTagsToolbarHovered;
63
91
  });
64
92
  }, [isTagsBarHovered, isTagsToolbarHovered, hovered]);
65
- const zoom = useCurrentZoom();
66
- const zoomIsLargeEnough = zoom > 1.2;
67
- const diagram = useDiagram();
68
- const onHover = (tag) => {
69
- diagram.send({ type: "tag.highlight", tag });
70
- };
71
- const onLeave = useCallback(() => {
72
- diagram.send({ type: "tag.unhighlight" });
73
- }, []);
74
- if (!tags || tags.length === 0) {
75
- return null;
76
- }
77
- const maxWidth = Math.max(Math.round(width * zoom) - 10, 200);
93
+ const zoomIsLargeEnough = useCurrentZoomAtLeast(1.2);
94
+ const maxWidth = useStore(
95
+ useCallback(
96
+ (state) => Math.max(Math.round(width * state.transform[2]) - 10, 200),
97
+ [Math.round(width)]
98
+ )
99
+ );
78
100
  return /* @__PURE__ */ jsxs(Fragment, { children: [
79
101
  /* @__PURE__ */ jsx(
80
102
  "div",
@@ -115,11 +137,11 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
115
137
  display: "flex",
116
138
  alignItems: "center",
117
139
  justifyContent: "center",
118
- maxWidth: 50,
119
- height: 5,
140
+ maxWidth: "50px",
141
+ height: "5px",
120
142
  _whenHovered: {
121
- height: 12,
122
- borderRadius: 4,
143
+ height: "12px",
144
+ borderRadius: "sm",
123
145
  transitionDelay: ".08s"
124
146
  },
125
147
  transition: "fast"
@@ -139,7 +161,9 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
139
161
  flexWrap: "wrap",
140
162
  pb: "sm",
141
163
  translate: "auto",
142
- x: "[-8px]",
164
+ x: "[-8px]"
165
+ },
166
+ style: {
143
167
  maxWidth
144
168
  },
145
169
  children: tags.map((tag) => /* @__PURE__ */ jsx(
@@ -151,24 +175,23 @@ const ElementTags = memo(({ id, data: { tags, width, hovered = false } }) => {
151
175
  userSelect: "none",
152
176
  ...zoomIsLargeEnough && {
153
177
  fontSize: "lg",
154
- borderRadius: "[4px]",
178
+ borderRadius: "sm",
155
179
  px: "1.5"
156
180
  // 6px
157
181
  }
158
182
  }),
159
- onClick: (e) => {
183
+ onClick: onTagClick ? ((e) => {
160
184
  e.stopPropagation();
161
- diagram.openSearch(`#${tag}`);
162
- },
163
- onMouseEnter: () => onHover(tag),
164
- onMouseLeave: onLeave
185
+ onTagClick(`#${tag}`);
186
+ }) : void 0,
187
+ onMouseEnter: onTagMouseEnter ? () => onTagMouseEnter(`#${tag}`) : void 0,
188
+ onMouseLeave: onTagMouseLeave ? () => onTagMouseLeave(`#${tag}`) : void 0
165
189
  },
166
190
  tag
167
191
  ))
168
192
  }
169
193
  ) })
170
194
  ] });
171
- }, propsAreEqual);
172
- ElementTags.displayName = "ElementTags";
195
+ }
173
196
 
174
197
  export { ElementTag, ElementTags };
@@ -13,7 +13,7 @@ export { ElementData } from './element/ElementData';
13
13
  export { ElementDetailsButton } from './element/ElementDetailsButton';
14
14
  export { ElementNodeContainer } from './element/ElementNodeContainer';
15
15
  export { ElementShape } from './element/ElementShape';
16
- export { ElementTag, ElementTags } from './element/ElementTags';
16
+ export { ElementTag, type ElementTagProps, ElementTags, type ElementTagsProps } from './element/ElementTags';
17
17
  export { Markdown } from './Markdown';
18
18
  export { memoEdge } from './memoEdge';
19
19
  export { memoNode } from './memoNode';
@@ -4,7 +4,7 @@ import { memo } from 'react';
4
4
  const isSame = (a, b) => {
5
5
  return Math.abs(a - b) < 2.5;
6
6
  };
7
- const edgePropsEqual = (prev, next) => prev.id === next.id && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.animated ?? false, next.animated ?? false) && deepEqual(prev.source, next.source) && isSame(prev.sourceX, next.sourceX) && isSame(prev.sourceY, next.sourceY) && deepEqual(prev.sourceHandleId ?? null, next.sourceHandleId ?? null) && deepEqual(prev.sourcePosition, next.sourcePosition) && deepEqual(prev.target, next.target) && isSame(prev.targetY, next.targetY) && isSame(prev.targetX, next.targetX) && deepEqual(prev.targetHandleId ?? null, next.targetHandleId ?? null) && deepEqual(prev.targetPosition, next.targetPosition) && deepEqual(prev.data, next.data);
7
+ const edgePropsEqual = (prev, next) => prev.id === next.id && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.animated ?? false, next.animated ?? false) && deepEqual(prev.source, next.source) && deepEqual(prev.target, next.target) && isSame(prev.sourceX, next.sourceX) && isSame(prev.sourceY, next.sourceY) && isSame(prev.targetX, next.targetX) && isSame(prev.targetY, next.targetY) && deepEqual(prev.sourceHandleId ?? null, next.sourceHandleId ?? null) && deepEqual(prev.targetHandleId ?? null, next.targetHandleId ?? null) && deepEqual(prev.sourcePosition, next.sourcePosition) && deepEqual(prev.targetPosition, next.targetPosition) && deepEqual(prev.data, next.data);
8
8
  function memoEdge(Edge) {
9
9
  const Memo = memo(Edge, edgePropsEqual);
10
10
  Memo.displayName = `MemoEdge(${Edge.displayName || Edge.name})`;
@@ -2,7 +2,7 @@ import { deepEqual } from 'fast-equals';
2
2
  import { memo } from 'react';
3
3
 
4
4
  function nodePropsEqual(prev, next) {
5
- return prev.id === next.id && deepEqual(prev.type, next.type) && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.dragging ?? false, next.dragging ?? false) && deepEqual(prev.width ?? 0, next.width ?? 0) && deepEqual(prev.height ?? 0, next.height ?? 0) && deepEqual(prev.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(prev.data, next.data);
5
+ return prev.id === next.id && deepEqual(prev.type, next.type) && deepEqual(prev.parentId ?? "", next.parentId ?? "") && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.dragging ?? false, next.dragging ?? false) && deepEqual(prev.width ?? 0, next.width ?? 0) && deepEqual(prev.height ?? 0, next.height ?? 0) && deepEqual(prev.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(prev.data, next.data);
6
6
  }
7
7
  const isMemoized = /* @__PURE__ */ Symbol.for("isMemoized");
8
8
  function memoNode(Node, displayName = "Node") {
@@ -4,7 +4,7 @@ import { HStack, VStack } from '@likec4/styles/jsx';
4
4
  import { ThemeIcon, Text, ScrollAreaAutosize, Button } from '@mantine/core';
5
5
  import { useRef, useEffect } from 'react';
6
6
  import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
7
- import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
7
+ import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
8
8
 
9
9
  function ErrorFallback({ error, resetErrorBoundary }) {
10
10
  const errorString = error instanceof Error ? error.message : "Unknown error";
@@ -4,8 +4,8 @@ import { styled } from '@likec4/styles/jsx';
4
4
  import { Badge, CopyButton, ActionIcon } from '@mantine/core';
5
5
  import { forwardRef } from 'react';
6
6
  import { GithubIcon } from './GithubIcon.js';
7
- import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
8
- import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js';
7
+ import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
8
+ import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js';
9
9
 
10
10
  const GITHUB_PREFIX = "https://github.com/";
11
11
  const Link = forwardRef(
@@ -1,4 +1,4 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { css } from '@likec4/styles/css';
3
3
  import { forwardRef } from 'react';
4
4
 
@@ -0,0 +1,11 @@
1
+ import { ForwardRefComponent, HTMLMotionProps } from 'motion/react';
2
+ import { HTMLAttributes, ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ import { StyleContextProvider, StyleContextConsumer } from '@likec4/styles/jsx';
4
+ import { NavigationPanelRecipe } from '@likec4/styles/recipes';
5
+ export declare const NavigationPanel: {
6
+ Root: StyleContextProvider<ForwardRefComponent<"div", HTMLMotionProps<"div">>, NavigationPanelRecipe>;
7
+ Body: StyleContextConsumer<ForwardRefComponent<"div", HTMLMotionProps<"div">>>;
8
+ Logo: StyleContextConsumer<ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & RefAttributes<HTMLButtonElement>>>;
9
+ Label: StyleContextConsumer<ForwardRefComponent<"div", HTMLMotionProps<"div">>>;
10
+ Dropdown: StyleContextConsumer<ForwardRefComponent<"div", HTMLMotionProps<"div">>>;
11
+ };
@@ -0,0 +1,50 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { cx } from '@likec4/styles/css';
3
+ import { createStyleContext, isCssProperty } from '@likec4/styles/jsx';
4
+ import { navigationPanel } from '@likec4/styles/recipes';
5
+ import { isValidMotionProp } from 'motion/react';
6
+ import * as m from 'motion/react-m';
7
+ import { forwardRef } from 'react';
8
+ import { LogoIcon, Logo as Logo$1 } from './Logo.js';
9
+
10
+ const { withProvider, withContext } = createStyleContext(navigationPanel);
11
+ const shouldForwardProp = (prop, variantKeys) => !variantKeys.includes(prop) && (isValidMotionProp(prop) || !isCssProperty(prop));
12
+ const LogoButton = forwardRef(({ className, ...props }, ref) => {
13
+ return /* @__PURE__ */ jsxs(
14
+ "button",
15
+ {
16
+ ...props,
17
+ ref,
18
+ className: cx(
19
+ "mantine-active",
20
+ className
21
+ ),
22
+ children: [
23
+ /* @__PURE__ */ jsx(LogoIcon, { "data-logo-icon": true }),
24
+ /* @__PURE__ */ jsx(Logo$1, { "data-logo-full": true })
25
+ ]
26
+ }
27
+ );
28
+ });
29
+ const Root = withProvider(m.div, "root", {
30
+ shouldForwardProp
31
+ });
32
+ const Body = withContext(m.div, "body", {
33
+ shouldForwardProp
34
+ });
35
+ const Logo = withContext(LogoButton, "logo");
36
+ const Label = withContext(m.div, "label", {
37
+ shouldForwardProp
38
+ });
39
+ const Dropdown = withContext(m.div, "dropdown", {
40
+ shouldForwardProp
41
+ });
42
+ const NavigationPanel = {
43
+ Root,
44
+ Body,
45
+ Logo,
46
+ Label,
47
+ Dropdown
48
+ };
49
+
50
+ export { NavigationPanel };
@@ -13,20 +13,17 @@ function RootContainer({
13
13
  }) {
14
14
  const [mounted, setMounted] = useState(false);
15
15
  const ref = useRef(null);
16
- const $isPanningRef = useRef(null);
17
- if (!$isPanningRef.current) {
18
- $isPanningRef.current = atom(false);
19
- }
16
+ const $isPanning = useRef(atom(false)).current;
20
17
  useIsomorphicLayoutEffect(() => {
21
18
  setMounted(true);
22
19
  }, []);
23
20
  useEffect(() => {
24
- return $isPanningRef.current?.subscribe((isPanning) => {
21
+ return $isPanning.listen((isPanning) => {
25
22
  ref.current?.setAttribute("data-likec4-diagram-panning", isPanning ? "true" : "false");
26
23
  });
27
- }, []);
24
+ }, [$isPanning]);
28
25
  const ctx = useMemo(() => ({ id, ref }), [id, ref]);
29
- return /* @__PURE__ */ jsx(PanningAtomSafeCtx, { value: $isPanningRef.current, children: /* @__PURE__ */ jsx(ReduceGraphicsModeCtx.Provider, { value: reduceGraphics, children: /* @__PURE__ */ jsx(
26
+ return /* @__PURE__ */ jsx(PanningAtomSafeCtx, { value: $isPanning, children: /* @__PURE__ */ jsx(ReduceGraphicsModeCtx.Provider, { value: reduceGraphics, children: /* @__PURE__ */ jsx(
30
27
  "div",
31
28
  {
32
29
  id,
@@ -35,7 +32,7 @@ function RootContainer({
35
32
  ...reduceGraphics && {
36
33
  ["data-likec4-reduced-graphics"]: true
37
34
  },
38
- children: mounted && !!ctx.ref.current && /* @__PURE__ */ jsx(RootContainerContext.Provider, { value: ctx, children })
35
+ children: mounted && /* @__PURE__ */ jsx(RootContainerContext.Provider, { value: ctx, children })
39
36
  }
40
37
  ) }) });
41
38
  }
@@ -0,0 +1,2 @@
1
+ import { MantineProviderProps } from '@mantine/core';
2
+ export declare function DefaultMantineProvider({ children, ...props }: MantineProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,66 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { MantineProvider, createTheme, Tooltip, Portal, SegmentedControl } from '@mantine/core';
3
+
4
+ const DefaultTheme = createTheme({
5
+ autoContrast: true,
6
+ primaryColor: "indigo",
7
+ cursorType: "pointer",
8
+ defaultRadius: "sm",
9
+ fontFamily: "var(--likec4-app-font, var(--likec4-app-font-default))",
10
+ headings: {
11
+ fontWeight: "medium",
12
+ sizes: {
13
+ h1: {
14
+ // fontSize: '2rem',
15
+ fontWeight: "bold"
16
+ },
17
+ h2: {
18
+ fontWeight: "medium"
19
+ // fontSize: '1.85rem',
20
+ }
21
+ }
22
+ },
23
+ fontSizes: {
24
+ xxs: "var(--font-sizes-xxs)",
25
+ xs: "var(--font-sizes-xs)",
26
+ sm: "var(--font-sizes-sm)",
27
+ md: "var(--font-sizes-md)",
28
+ lg: "var(--font-sizes-lg)",
29
+ xl: "var(--font-sizes-xl)"
30
+ },
31
+ spacing: {
32
+ xs: "var(--spacing-xs)",
33
+ sm: "var(--spacing-sm)",
34
+ md: "var(--spacing-md)",
35
+ lg: "var(--spacing-lg)",
36
+ xl: "var(--spacing-xl)"
37
+ },
38
+ components: {
39
+ SegmentedControl: SegmentedControl.extend({
40
+ vars: (theme, props) => ({
41
+ root: {
42
+ // @ts-expect-error
43
+ "--sc-font-size": theme.fontSizes[props.fz ?? props.size]
44
+ }
45
+ })
46
+ }),
47
+ Portal: Portal.extend({
48
+ defaultProps: {
49
+ reuseTargetNode: true
50
+ }
51
+ }),
52
+ Tooltip: Tooltip.extend({
53
+ defaultProps: {
54
+ color: "dark"
55
+ }
56
+ })
57
+ }
58
+ });
59
+ function DefaultMantineProvider({
60
+ children,
61
+ ...props
62
+ }) {
63
+ return /* @__PURE__ */ jsx(MantineProvider, { defaultColorScheme: "auto", theme: DefaultTheme, ...props, children });
64
+ }
65
+
66
+ export { DefaultMantineProvider };
@@ -12,7 +12,7 @@ const defaultHandlers = {
12
12
  onEdgeContextMenu: null,
13
13
  onCanvasClick: null,
14
14
  onCanvasDblClick: null,
15
- onBurgerMenuClick: null,
15
+ onLogoClick: null,
16
16
  onOpenSource: null,
17
17
  onInitialized: null,
18
18
  onLayoutTypeChange: null
@@ -1,6 +1,6 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
- import { shallowEqual } from 'fast-equals';
3
- import { useContext, createContext, useState, useEffect } from 'react';
2
+ import { useContext, createContext, useEffect } from 'react';
3
+ import { useSetState } from '../hooks/useSetState.js';
4
4
 
5
5
  const DefaultFeatures = {
6
6
  enableEditor: false,
@@ -27,19 +27,20 @@ function DiagramFeatures({
27
27
  overrides
28
28
  }) {
29
29
  const outerScope = useContext(DiagramFeaturesContext);
30
- const [scope, setScope] = useState(outerScope);
30
+ const [scope, setScope] = useSetState(() => ({
31
+ ...outerScope,
32
+ ...features,
33
+ ...overrides
34
+ }));
31
35
  useEffect(
32
36
  () => {
33
- setScope((current) => {
34
- const next = {
35
- ...outerScope,
36
- ...features,
37
- ...overrides
38
- };
39
- return shallowEqual(current, next) ? current : next;
37
+ setScope({
38
+ ...outerScope,
39
+ ...features,
40
+ ...overrides
40
41
  });
41
42
  },
42
- [outerScope, features, overrides]
43
+ [outerScope, features, overrides, setScope]
43
44
  );
44
45
  return /* @__PURE__ */ jsx(DiagramFeaturesContext.Provider, { value: scope, children });
45
46
  }
@@ -1,7 +1,4 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  type EnsureMantineProps = PropsWithChildren<{}>;
3
3
  export declare function EnsureMantine({ children }: EnsureMantineProps): import("react/jsx-runtime").JSX.Element;
4
- export declare namespace EnsureMantine {
5
- var displayName: string;
6
- }
7
4
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
- import { MantineContext, MantineProvider } from '@mantine/core';
2
+ import { MantineContext } from '@mantine/core';
3
3
  import { useContext, useEffect } from 'react';
4
- import { DefaultTheme } from '../shadowroot/styles.css.js';
4
+ import { DefaultMantineProvider } from './DefaultMantineProvider.js';
5
5
 
6
6
  function EnsureMantine({ children }) {
7
7
  const mantineCtx = useContext(MantineContext);
@@ -11,10 +11,9 @@ function EnsureMantine({ children }) {
11
11
  }
12
12
  }, []);
13
13
  if (!mantineCtx) {
14
- return /* @__PURE__ */ jsx(MantineProvider, { defaultColorScheme: "auto", theme: DefaultTheme, children });
14
+ return /* @__PURE__ */ jsx(DefaultMantineProvider, { children });
15
15
  }
16
16
  return /* @__PURE__ */ jsx(Fragment, { children });
17
17
  }
18
- EnsureMantine.displayName = "EnsureMantine";
19
18
 
20
19
  export { EnsureMantine };
@@ -1,6 +1,20 @@
1
1
  import { ElementShape } from '@likec4/core';
2
2
  import { CSSProperties, PropsWithChildren } from 'react';
3
3
  import { ElementIconRenderer } from '../LikeC4Diagram.props';
4
+ /**
5
+ * Provider for custom element icon renderers
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * const MyIconRenderer: ElementIconRenderer = ({ node }) => {
10
+ * return <div>{node.title}</div>
11
+ * }
12
+ *
13
+ * <IconRendererProvider value={MyIconRenderer}>
14
+ * <LikeC4Diagram />
15
+ * </IconRendererProvider>
16
+ * ```
17
+ */
4
18
  export declare function IconRendererProvider({ value, children, }: PropsWithChildren<{
5
19
  value: ElementIconRenderer | null;
6
20
  }>): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,13 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { cx } from '@likec4/styles/css';
3
3
  import { createContext, useContext } from 'react';
4
- import IconCylinder from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js';
5
- import IconRectangularPrism from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js';
6
- import IconReorder from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js';
7
- import IconUser from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js';
8
- import IconDeviceMobile from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js';
9
- import IconBrowser from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js';
4
+ import IconFileText from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js';
5
+ import IconCylinder from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js';
6
+ import IconRectangularPrism from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js';
7
+ import IconReorder from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js';
8
+ import IconUser from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js';
9
+ import IconDeviceMobile from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js';
10
+ import IconBrowser from '../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js';
10
11
 
11
12
  const IconRendererContext = createContext(null);
12
13
  function IconRendererProvider({
@@ -29,7 +30,7 @@ function IconRenderer({
29
30
  return null;
30
31
  }
31
32
  let icon;
32
- if (element.icon.startsWith("http://") || element.icon.startsWith("https://")) {
33
+ if (element.icon.startsWith("http://") || element.icon.startsWith("https://") || element.icon.startsWith("data:image")) {
33
34
  icon = /* @__PURE__ */ jsx("img", { src: element.icon, alt: element.title });
34
35
  } else if (RenderIcon) {
35
36
  icon = /* @__PURE__ */ jsx(RenderIcon, { node: element });
@@ -57,7 +58,9 @@ const ShapeIcons = {
57
58
  person: IconUser,
58
59
  queue: IconReorder,
59
60
  rectangle: IconRectangularPrism,
60
- storage: IconCylinder
61
+ storage: IconCylinder,
62
+ bucket: IconCylinder,
63
+ document: IconFileText
61
64
  };
62
65
  function IconOrShapeRenderer({
63
66
  element,
@@ -46,15 +46,23 @@ function generateStylesheet(tags, rootSelector) {
46
46
  }
47
47
  function TagStylesProvider({ children, rootSelector }) {
48
48
  const tags = useLikeC4Specification().tags;
49
+ const nonce = useMantineStyleNonce()?.();
49
50
  const stylesheet = generateStylesheet(tags, rootSelector);
50
51
  return /* @__PURE__ */ jsxs(TagStylesContext.Provider, { value: tags, children: [
51
- stylesheet !== "" && /* @__PURE__ */ jsx(TagStylesheet, { stylesheet }),
52
+ stylesheet !== "" && /* @__PURE__ */ jsx(TagStylesheet, { nonce, stylesheet }),
52
53
  children
53
54
  ] });
54
55
  }
55
- const TagStylesheet = memo(({ stylesheet }) => {
56
- const nonce = useMantineStyleNonce()?.();
57
- return /* @__PURE__ */ jsx("style", { "data-likec4-tags": true, type: "text/css", dangerouslySetInnerHTML: { __html: stylesheet }, nonce });
56
+ const TagStylesheet = memo(({ stylesheet, nonce }) => {
57
+ return /* @__PURE__ */ jsx(
58
+ "style",
59
+ {
60
+ "data-likec4-tags": true,
61
+ type: "text/css",
62
+ dangerouslySetInnerHTML: { __html: stylesheet },
63
+ nonce
64
+ }
65
+ );
58
66
  });
59
67
  function useTagSpecification(tag) {
60
68
  const specs = useContext(TagStylesContext);
@@ -3,8 +3,8 @@ export { useDiagramEventHandlers, } from '../context/DiagramEventHandlers';
3
3
  export { type EnabledFeatures, type FeatureName, useEnabledFeatures, } from '../context/DiagramFeatures';
4
4
  export { useCurrentView, useCurrentViewId, } from '../hooks/useCurrentView';
5
5
  export { type DiagramApi, useDiagram, useDiagramActorRef, useDiagramContext, useOnDiagramEvent, } from '../hooks/useDiagram';
6
- export { useCurrentViewModel, } from '../hooks/useCurrentViewModel';
7
- export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, } from '../hooks/useLikeC4Model';
6
+ export { type CurrentViewModel, useCurrentViewModel, useOptionalCurrentViewModel, } from '../hooks/useCurrentViewModel';
7
+ export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, useOptionalLikeC4Model, } from '../hooks/useLikeC4Model';
8
8
  export { useHasProjects, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext, } from '../hooks/useLikeC4Project';
9
9
  export { useLikeC4Styles, } from '../hooks/useLikeC4Styles';
10
10
  export { useSetState } from '../hooks/useSetState';
@@ -3,7 +3,7 @@ export * from './customNodes';
3
3
  export * from './hooks';
4
4
  export * from './primitives';
5
5
  export type { BaseEdge, BaseEdgeData, BaseEdgeProps, BaseEdgePropsWithData, BaseNode, BaseNodeData, BaseNodeProps, BaseNodePropsWithData, } from '../base/types';
6
- export type { ChangeEvent, DiagramNodeWithNavigate, ElementIconRenderer, ElementIconRendererProps, LikeC4ColorScheme, LikeC4DiagramEventHandlers, LikeC4DiagramProperties, NodeRenderers, OnCanvasClick, OnChange, OnEdgeClick, OnNavigateTo, OnNodeClick, OpenSourceParams, PaddingUnit, PaddingWithUnit, ViewPadding, WhereOperator, } from '../LikeC4Diagram.props';
6
+ export type { DiagramNodeWithNavigate, ElementIconRenderer, ElementIconRendererProps, LikeC4ColorScheme, LikeC4DiagramEventHandlers, LikeC4DiagramProperties, NodeRenderers, OnCanvasClick, OnEdgeClick, OnNavigateTo, OnNodeClick, OpenSourceParams, PaddingUnit, PaddingWithUnit, ViewPadding, WhereOperator, } from '../LikeC4Diagram.props';
7
7
  export { Base } from '../base/Base';
8
8
  export type { Types } from '../likec4diagram/types';
9
9
  export { type EnabledFeatures, IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, useEnabledFeatures, } from '../context/DiagramFeatures';
@@ -16,8 +16,8 @@ export { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
16
16
  export { useCurrentView, useCurrentViewId } from '../hooks/useCurrentView.js';
17
17
  export { useDiagram, useDiagramActorRef } from '../hooks/safeContext.js';
18
18
  export { useDiagramContext, useOnDiagramEvent } from '../hooks/useDiagram.js';
19
- export { useCurrentViewModel } from '../hooks/useCurrentViewModel.js';
20
- export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from '../hooks/useLikeC4Model.js';
19
+ export { useCurrentViewModel, useOptionalCurrentViewModel } from '../hooks/useCurrentViewModel.js';
20
+ export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, useOptionalLikeC4Model } from '../hooks/useLikeC4Model.js';
21
21
  export { useHasProjects, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext } from '../hooks/useLikeC4Project.js';
22
22
  export { useLikeC4Styles } from '../hooks/useLikeC4Styles.js';
23
23
  export { useSetState } from '../hooks/useSetState.js';
@@ -0,0 +1,18 @@
1
+ import type * as t from '@likec4/core/types';
2
+ /**
3
+ * Callbacks from LikeC4 Editor.
4
+ */
5
+ export interface LikeC4EditorCallbacks {
6
+ /**
7
+ * Fetch a view by its ID and layout type.
8
+ *
9
+ * @param viewId - The ID of the view to fetch.
10
+ * @param layout - The layout type to use when fetching the view.
11
+ */
12
+ fetchView(viewId: t.ViewId, layout?: t.LayoutType): t.LayoutedView | Promise<t.LayoutedView>;
13
+ /**
14
+ * Callback invoked when the view changes.
15
+ */
16
+ handleChange(viewId: t.ViewId, change: t.ViewChange): void | Promise<void>;
17
+ }
18
+ export declare function createLikeC4Editor(callbacks: LikeC4EditorCallbacks): LikeC4EditorCallbacks;
@@ -0,0 +1,5 @@
1
+ function createLikeC4Editor(callbacks) {
2
+ return callbacks;
3
+ }
4
+
5
+ export { createLikeC4Editor };