@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
@@ -0,0 +1,121 @@
1
+ import { NodeId, ProjectId, BBox } from '@likec4/core';
2
+ import { LayoutedProjectsView } from '@likec4/core/compute-view';
3
+ import { EdgeChange, NodeChange } from '@xyflow/system';
4
+ import { MouseEvent } from 'react';
5
+ import { Simplify } from 'type-fest';
6
+ import { ActorRef, SnapshotFrom, StateMachine, ActionFunction, Values } from 'xstate';
7
+ import { ViewPadding } from '../custom';
8
+ import { ProjectsOverviewTypes, ProjectsOverviewXYFLowInstance, ProjectsOverviewXYStoreApi } from './_types';
9
+ export type Input = {
10
+ view: LayoutedProjectsView;
11
+ fitViewPadding: ViewPadding;
12
+ };
13
+ export interface Context {
14
+ initialized: {
15
+ xydata: boolean;
16
+ xyflow: boolean;
17
+ };
18
+ xystore: ProjectsOverviewXYStoreApi | null;
19
+ xyflow: ProjectsOverviewXYFLowInstance | null;
20
+ view: LayoutedProjectsView;
21
+ fitViewPadding: ViewPadding;
22
+ xynodes: ProjectsOverviewTypes.Node[];
23
+ xyedges: ProjectsOverviewTypes.Edge[];
24
+ navigateTo?: ProjectsOverviewTypes.Node;
25
+ }
26
+ export type EmittedEvents = {
27
+ type: 'navigate.to';
28
+ projectId: ProjectId;
29
+ };
30
+ /**
31
+ * Converts a union of events to a union of events with a prefix.
32
+ */
33
+ type EmitEach<T extends {
34
+ type: string;
35
+ }> = {
36
+ [Key in T['type']]: Simplify<{
37
+ type: `emit.${Key}`;
38
+ } & Omit<Extract<T, {
39
+ type: Key;
40
+ }>, 'type'>>;
41
+ }[T['type']];
42
+ export type Events = {
43
+ type: 'navigate.to';
44
+ projectId: ProjectId;
45
+ fromNode: NodeId;
46
+ } | {
47
+ type: 'xyflow.init';
48
+ xyflow: ProjectsOverviewXYFLowInstance;
49
+ xystore: ProjectsOverviewXYStoreApi;
50
+ } | {
51
+ type: 'xyflow.click.node';
52
+ node: ProjectsOverviewTypes.Node;
53
+ } | {
54
+ type: 'xyflow.click.edge';
55
+ edge: ProjectsOverviewTypes.Edge;
56
+ } | {
57
+ type: 'xyflow.click.pane';
58
+ } | {
59
+ type: 'xyflow.click.double';
60
+ } | {
61
+ type: 'xyflow.mouse.enter.node';
62
+ node: ProjectsOverviewTypes.Node;
63
+ } | {
64
+ type: 'xyflow.mouse.leave.node';
65
+ node: ProjectsOverviewTypes.Node;
66
+ } | {
67
+ type: 'xyflow.mouse.enter.edge';
68
+ edge: ProjectsOverviewTypes.Edge;
69
+ event: MouseEvent;
70
+ } | {
71
+ type: 'xyflow.mouse.leave.edge';
72
+ edge: ProjectsOverviewTypes.Edge;
73
+ event: MouseEvent;
74
+ } | {
75
+ type: 'xyflow.applyNodeChanges';
76
+ changes: NodeChange<ProjectsOverviewTypes.Node>[];
77
+ } | {
78
+ type: 'xyflow.applyEdgeChanges';
79
+ changes: EdgeChange<ProjectsOverviewTypes.Edge>[];
80
+ } | {
81
+ type: 'xyflow.fitDiagram';
82
+ bounds?: BBox;
83
+ duration?: number;
84
+ } | {
85
+ type: 'update.view';
86
+ view: LayoutedProjectsView;
87
+ } | EmitEach<EmittedEvents> | {
88
+ type: 'close';
89
+ };
90
+ type Tags = 'active';
91
+ export declare const onMouseEnterOrLeave: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
92
+ export declare const fitDiagram: (params?: {
93
+ duration?: number;
94
+ bounds?: BBox;
95
+ }) => ActionFunction<Context, Events, Events, undefined, never, never, Values<{
96
+ isReady: {
97
+ type: "isReady";
98
+ params: unknown;
99
+ };
100
+ "click: selected node": {
101
+ type: "click: selected node";
102
+ params: unknown;
103
+ };
104
+ }>, never, EmittedEvents>;
105
+ export declare const restoreViewport: () => ActionFunction<Context, Events, Events, undefined, never, never, Values<{
106
+ isReady: {
107
+ type: "isReady";
108
+ params: unknown;
109
+ };
110
+ "click: selected node": {
111
+ type: "click: selected node";
112
+ params: unknown;
113
+ };
114
+ }>, never, EmittedEvents>;
115
+ export interface ProjectsOverviewLogic extends StateMachine<Context, Events, {}, any, any, any, any, any, Tags, Input, any, EmittedEvents, any, any> {
116
+ }
117
+ export declare const projectOverviewLogic: ProjectsOverviewLogic;
118
+ export type ProjectsOverviewSnapshot = SnapshotFrom<ProjectsOverviewLogic>;
119
+ export interface ProjectsOverviewActorRef extends ActorRef<ProjectsOverviewSnapshot, Events, EmittedEvents> {
120
+ }
121
+ export type { Input as ProjectsOverviewInput, };
@@ -0,0 +1,359 @@
1
+ import { invariant, nonNullable, nonexhaustive } from '@likec4/core';
2
+ import { getViewportForBounds, applyEdgeChanges, applyNodeChanges } from '@xyflow/react';
3
+ import { animate, stagger, motionValue, mapValue, styleEffect } from 'motion';
4
+ import { clamp } from 'remeda';
5
+ import { setup, assertEvent } from 'xstate';
6
+ import { Base } from '../base/Base.js';
7
+ import { layoutedProjectsViewToXYFlow } from './layouted-to-xyflow.js';
8
+ import { ProjectsOverviewViewportPersistence } from './persistence.js';
9
+ import { x as xstateActions_cjsExports } from '../_virtual/xstate-actions.cjs.js';
10
+ import { MinZoom } from '../base/const.js';
11
+
12
+ const machine = setup({
13
+ types: {
14
+ context: {},
15
+ tags: "",
16
+ input: {},
17
+ events: {},
18
+ emitted: {}
19
+ },
20
+ guards: {
21
+ isReady: ({ context }) => context.initialized.xydata && context.initialized.xyflow && !!context.xystore && !!context.xyflow,
22
+ "click: selected node": ({ event }) => {
23
+ return event.type === "xyflow.click.node" && event.node.selected === true;
24
+ }
25
+ }
26
+ });
27
+ const updateView = () => machine.assign(({ event }) => {
28
+ assertEvent(event, "update.view");
29
+ const { xynodes, xyedges } = layoutedProjectsViewToXYFlow(event.view);
30
+ return {
31
+ view: event.view,
32
+ xynodes,
33
+ xyedges
34
+ };
35
+ });
36
+ const xyflowApplyNodeChanges = () => machine.assign(({ context, event }) => {
37
+ assertEvent(event, "xyflow.applyNodeChanges");
38
+ return {
39
+ xynodes: applyNodeChanges(event.changes, context.xynodes)
40
+ };
41
+ });
42
+ const xyflowApplyEdgeChanges = () => machine.assign(({ context, event }) => {
43
+ assertEvent(event, "xyflow.applyEdgeChanges");
44
+ return {
45
+ xyedges: applyEdgeChanges(event.changes, context.xyedges)
46
+ };
47
+ });
48
+ const onMouseEnterOrLeave = () => machine.assign(({ context, event }) => {
49
+ assertEvent(event, [
50
+ "xyflow.mouse.enter.edge",
51
+ "xyflow.mouse.leave.edge",
52
+ "xyflow.mouse.enter.node",
53
+ "xyflow.mouse.leave.node"
54
+ ]);
55
+ const isEnter = event.type.startsWith("xyflow.mouse.enter");
56
+ switch (event.type) {
57
+ case "xyflow.mouse.enter.edge":
58
+ case "xyflow.mouse.leave.edge": {
59
+ const edgeId = event.edge.id;
60
+ return {
61
+ xyedges: context.xyedges.map((e) => {
62
+ if (e.id === edgeId) {
63
+ return Base.setHovered(e, isEnter);
64
+ }
65
+ return e;
66
+ })
67
+ };
68
+ }
69
+ case "xyflow.mouse.enter.node":
70
+ case "xyflow.mouse.leave.node": {
71
+ const nodeId = event.node.id;
72
+ return {
73
+ xynodes: context.xynodes.map((n) => {
74
+ if (n.id === nodeId) {
75
+ return Base.setHovered(n, isEnter);
76
+ }
77
+ return n;
78
+ })
79
+ };
80
+ }
81
+ default:
82
+ nonexhaustive(event);
83
+ }
84
+ });
85
+ const saveViewport = () => machine.createAction(({ context }) => {
86
+ const xyflow = context.xyflow;
87
+ if (xyflow) {
88
+ ProjectsOverviewViewportPersistence.write(xyflow.getViewport());
89
+ }
90
+ });
91
+ const handleClick = () => machine.enqueueActions(({ event, enqueue }) => {
92
+ if (event.type === "xyflow.click.double") {
93
+ enqueue(fitDiagram());
94
+ return;
95
+ }
96
+ });
97
+ const fitDiagram = (params) => machine.enqueueActions(({ context, event }) => {
98
+ let bounds = context.view.bounds, duration;
99
+ if (params) {
100
+ bounds = params.bounds ?? context.view.bounds;
101
+ duration = params.duration;
102
+ } else if (event.type === "xyflow.fitDiagram") {
103
+ bounds = event.bounds ?? context.view.bounds;
104
+ duration = event.duration;
105
+ }
106
+ duration ??= 450;
107
+ const { width, height, panZoom, transform } = nonNullable(context.xystore).getState();
108
+ const maxZoom = Math.max(1, transform[2]);
109
+ const viewport = getViewportForBounds(
110
+ bounds,
111
+ width,
112
+ height,
113
+ MinZoom,
114
+ maxZoom,
115
+ context.fitViewPadding
116
+ );
117
+ viewport.x = Math.round(viewport.x);
118
+ viewport.y = Math.round(viewport.y);
119
+ const animationProps = duration > 0 ? { duration, interpolate: "smooth" } : void 0;
120
+ panZoom?.setViewport(viewport, animationProps).catch((err) => {
121
+ console.error("Error during fitDiagram panZoom setViewport", { err });
122
+ });
123
+ ProjectsOverviewViewportPersistence.write(null);
124
+ });
125
+ const restoreViewport = () => machine.enqueueActions(({ context, enqueue }) => {
126
+ const viewport = ProjectsOverviewViewportPersistence.read();
127
+ if (viewport) {
128
+ const xyflow = nonNullable(context.xyflow);
129
+ xyflow.setViewport(viewport, {
130
+ duration: 0
131
+ });
132
+ return;
133
+ }
134
+ enqueue(fitDiagram({ duration: 0 }));
135
+ });
136
+ const dispose = () => machine.assign({
137
+ xyflow: null,
138
+ xystore: null,
139
+ initialized: {
140
+ xyflow: false,
141
+ xydata: false
142
+ },
143
+ xyedges: [],
144
+ xynodes: []
145
+ });
146
+ const assignNavigateTo = () => machine.assign(({ event, context }) => {
147
+ let navigateTo;
148
+ switch (event.type) {
149
+ case "xyflow.click.node": {
150
+ navigateTo = event.node;
151
+ break;
152
+ }
153
+ case "navigate.to": {
154
+ navigateTo = nonNullable(context.xynodes.find((n) => n.id === event.fromNode), `Node ${event.fromNode} not found`);
155
+ break;
156
+ }
157
+ default: {
158
+ console.warn(`Unexpected event ${event.type} in assignNavigateTo`);
159
+ return {};
160
+ }
161
+ }
162
+ return {
163
+ navigateTo
164
+ };
165
+ });
166
+ const _projectOverviewLogic = machine.createMachine({
167
+ id: "projects-overview",
168
+ context: ({ input }) => ({
169
+ ...input,
170
+ initialized: {
171
+ xydata: false,
172
+ xyflow: false
173
+ },
174
+ xyflow: null,
175
+ xystore: null,
176
+ xynodes: [],
177
+ xyedges: []
178
+ }),
179
+ initial: "init",
180
+ on: {
181
+ "close": {
182
+ target: ".closed"
183
+ }
184
+ },
185
+ states: {
186
+ init: {
187
+ on: {
188
+ "update.view": {
189
+ actions: [
190
+ updateView(),
191
+ xstateActions_cjsExports.assign(({ context }) => ({
192
+ initialized: {
193
+ ...context.initialized,
194
+ xydata: true
195
+ }
196
+ }))
197
+ ],
198
+ target: "isReady"
199
+ },
200
+ "xyflow.init": {
201
+ actions: [
202
+ xstateActions_cjsExports.assign(({ context, event }) => ({
203
+ initialized: {
204
+ ...context.initialized,
205
+ xyflow: true
206
+ },
207
+ xyflow: event.xyflow,
208
+ xystore: event.xystore
209
+ }))
210
+ ],
211
+ target: "isReady"
212
+ }
213
+ }
214
+ },
215
+ isReady: {
216
+ always: [{
217
+ guard: "isReady",
218
+ target: "active"
219
+ }, {
220
+ target: "init"
221
+ }]
222
+ },
223
+ active: {
224
+ tags: "active",
225
+ entry: [
226
+ restoreViewport()
227
+ ],
228
+ on: {
229
+ "navigate.to": {
230
+ actions: assignNavigateTo(),
231
+ target: "navigate"
232
+ },
233
+ "xyflow.applyNodeChanges": {
234
+ actions: xyflowApplyNodeChanges()
235
+ },
236
+ "xyflow.applyEdgeChanges": {
237
+ actions: xyflowApplyEdgeChanges()
238
+ },
239
+ "xyflow.mouse.*": {
240
+ actions: onMouseEnterOrLeave()
241
+ },
242
+ "xyflow.click.*": [
243
+ {
244
+ guard: "click: selected node",
245
+ actions: assignNavigateTo(),
246
+ target: "navigate"
247
+ },
248
+ {
249
+ actions: handleClick()
250
+ }
251
+ ],
252
+ "xyflow.fitDiagram": {
253
+ actions: fitDiagram()
254
+ },
255
+ "update.view": {
256
+ actions: updateView()
257
+ }
258
+ }
259
+ },
260
+ navigate: {
261
+ tags: "active",
262
+ entry: [
263
+ saveViewport(),
264
+ xstateActions_cjsExports.assign({
265
+ xyedges: []
266
+ }),
267
+ ({ context: { navigateTo, xyflow, xystore }, self }) => {
268
+ invariant(xyflow && navigateTo, "Invalid state, xyflow is undefined");
269
+ const { width, domNode } = nonNullable(xystore).getState();
270
+ const nextZoom = clamp(
271
+ Math.min(
272
+ width * 7 / 9 / navigateTo.data.width
273
+ // (height - 200) / (navigateTo.data.height),
274
+ ),
275
+ { min: MinZoom, max: 2.5 }
276
+ );
277
+ const next = {
278
+ x: Math.round(
279
+ -nextZoom * navigateTo.position.x + (width - nextZoom * navigateTo.data.width) / 2
280
+ ),
281
+ y: Math.round(-nextZoom * navigateTo.position.y) + 50
282
+ };
283
+ const current = xyflow.getViewport();
284
+ const otherNodes = domNode.querySelectorAll(
285
+ `.react-flow__node-project:not([data-id="${navigateTo.id}"]) > *`
286
+ );
287
+ const otherNodesAnimation = animate(otherNodes, {
288
+ opacity: 0,
289
+ scale: 0.9
290
+ }, {
291
+ visualDuration: 0.25,
292
+ delay: stagger(0.08, { from: "center" })
293
+ });
294
+ const v = motionValue(1);
295
+ const transform = mapValue(
296
+ v,
297
+ [1, 0],
298
+ [
299
+ `translate(${current.x}px, ${current.y}px) scale(${current.zoom})`,
300
+ `translate(${next.x}px, ${next.y}px) scale(${nextZoom})`
301
+ ]
302
+ );
303
+ const cancelViewportAnimation = styleEffect(
304
+ domNode.querySelector(".xyflow__viewport"),
305
+ { transform }
306
+ );
307
+ const cancelOpacityAnimation = styleEffect(
308
+ domNode.querySelector(`.react-flow__node-project:is([data-id="${navigateTo.id}"]) > *`),
309
+ { opacity: v }
310
+ );
311
+ const targetAnimation = animate(
312
+ v,
313
+ 0,
314
+ {
315
+ delay: otherNodes.length > 3 ? 0.25 : 0,
316
+ type: "spring",
317
+ stiffness: 350,
318
+ damping: 40,
319
+ mass: 1.5,
320
+ visualDuration: 0.55
321
+ }
322
+ );
323
+ Promise.race([
324
+ targetAnimation.finished,
325
+ sleep(750)
326
+ ]).then(() => {
327
+ cancelViewportAnimation();
328
+ cancelOpacityAnimation();
329
+ targetAnimation.stop();
330
+ otherNodesAnimation.stop();
331
+ self.send({
332
+ type: "emit.navigate.to",
333
+ projectId: navigateTo.data.projectId
334
+ });
335
+ });
336
+ }
337
+ ],
338
+ on: {
339
+ "emit.navigate.to": {
340
+ actions: xstateActions_cjsExports.emit(({ event }) => ({
341
+ ...event,
342
+ type: "navigate.to"
343
+ }))
344
+ }
345
+ }
346
+ },
347
+ closed: {
348
+ id: "closed",
349
+ type: "final",
350
+ entry: dispose()
351
+ }
352
+ }
353
+ });
354
+ const projectOverviewLogic = _projectOverviewLogic;
355
+ function sleep(ms) {
356
+ return new Promise((resolve) => setTimeout(resolve, ms));
357
+ }
358
+
359
+ export { fitDiagram, onMouseEnterOrLeave, projectOverviewLogic, restoreViewport };
@@ -0,0 +1,4 @@
1
+ import { ProjectsOverviewActorRef } from './actor';
2
+ import { Context } from 'react';
3
+ export declare const ProjectsOverviewActorContext: Context<ProjectsOverviewActorRef | null>;
4
+ export declare function useProjectsOverviewActor(): ProjectsOverviewActorRef;
@@ -0,0 +1,9 @@
1
+ import { nonNullable } from '@likec4/core';
2
+ import { createContext, useContext } from 'react';
3
+
4
+ const ProjectsOverviewActorContext = createContext(null);
5
+ function useProjectsOverviewActor() {
6
+ return nonNullable(useContext(ProjectsOverviewActorContext), "No ProjectsOverviewActorContext");
7
+ }
8
+
9
+ export { ProjectsOverviewActorContext, useProjectsOverviewActor };
@@ -0,0 +1,3 @@
1
+ import { ProjectsOverviewTypes } from '../_types';
2
+ import { FunctionComponent } from 'react';
3
+ export declare const RelationshipEdge: FunctionComponent<ProjectsOverviewTypes.EdgeProps>;
@@ -0,0 +1,23 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { bezierPath } from '../../utils/xyflow.js';
3
+ import { memoEdge } from '../../base-primitives/memoEdge.js';
4
+ import { EdgeContainer } from '../../base-primitives/edge/EdgeContainer.js';
5
+ import { EdgePath } from '../../base-primitives/edge/EdgePath.js';
6
+ import { EdgeLabelContainer } from '../../base-primitives/edge/EdgeLabelContainer.js';
7
+ import { EdgeLabel } from '../../base-primitives/edge/EdgeLabel.js';
8
+
9
+ const RelationshipEdge = memoEdge((edgeProps) => {
10
+ const path = bezierPath(edgeProps.data.points);
11
+ return /* @__PURE__ */ jsxs(EdgeContainer, { ...edgeProps, children: [
12
+ /* @__PURE__ */ jsx(
13
+ EdgePath,
14
+ {
15
+ edgeProps,
16
+ svgPath: path
17
+ }
18
+ ),
19
+ /* @__PURE__ */ jsx(EdgeLabelContainer, { edgeProps, children: /* @__PURE__ */ jsx(EdgeLabel, { edgeProps }) })
20
+ ] });
21
+ });
22
+
23
+ export { RelationshipEdge };
@@ -0,0 +1,2 @@
1
+ export { RelationshipEdge } from './edgeTypes';
2
+ export { ProjectNode } from './nodeTypes';
@@ -0,0 +1,2 @@
1
+ import { ProjectsOverviewTypes } from '../_types';
2
+ export declare function ProjectNode(props: ProjectsOverviewTypes.NodeProps<'project'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useCallbackRef } from '@mantine/hooks';
3
+ import { useProjectsOverviewActor } from '../context.js';
4
+ import { ElementNodeContainer } from '../../base-primitives/element/ElementNodeContainer.js';
5
+ import { ElementShape } from '../../base-primitives/element/ElementShape.js';
6
+ import { ElementData } from '../../base-primitives/element/ElementData.js';
7
+ import { ElementActionButtons } from '../../base-primitives/element/ElementActionButtons.js';
8
+ import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
9
+ import { DefaultHandles } from '../../base-primitives/NodeHandles.js';
10
+
11
+ function ProjectNode(props) {
12
+ const actor = useProjectsOverviewActor();
13
+ const navigateTo = useCallbackRef((e) => {
14
+ e.stopPropagation();
15
+ actor.send({ type: "navigate.to", fromNode: props.data.id, projectId: props.data.projectId });
16
+ });
17
+ return /* @__PURE__ */ jsxs(
18
+ ElementNodeContainer,
19
+ {
20
+ layout: true,
21
+ nodeProps: props,
22
+ children: [
23
+ /* @__PURE__ */ jsx(ElementShape, { ...props }),
24
+ /* @__PURE__ */ jsx(ElementData, { ...props }),
25
+ /* @__PURE__ */ jsx(
26
+ ElementActionButtons,
27
+ {
28
+ ...props,
29
+ buttons: [
30
+ {
31
+ key: "navigate",
32
+ icon: /* @__PURE__ */ jsx(IconZoomScan, {}),
33
+ onClick: navigateTo
34
+ }
35
+ ]
36
+ }
37
+ ),
38
+ /* @__PURE__ */ jsx(DefaultHandles, {})
39
+ ]
40
+ },
41
+ props.id
42
+ );
43
+ }
44
+
45
+ export { ProjectNode };
@@ -0,0 +1,5 @@
1
+ import { ProjectsOverviewXYFLowInstance, ProjectsOverviewXYStoreApi } from './_types';
2
+ import { ProjectsOverviewSnapshot } from './actor';
3
+ export declare function useProjectsOverviewState<T>(selector: (state: ProjectsOverviewSnapshot) => T, compare?: (a: T, b: T) => boolean): T;
4
+ export declare function useProjectsOverviewXYFlow(): ProjectsOverviewXYFLowInstance;
5
+ export declare function useProjectsOverviewXYStoreApi(): ProjectsOverviewXYStoreApi;
@@ -0,0 +1,14 @@
1
+ import { useSelector } from '@xstate/react';
2
+ import { useStoreApi } from '@xyflow/react';
3
+ import { shallowEqual } from 'fast-equals';
4
+ import { useProjectsOverviewActor } from './context.js';
5
+
6
+ function useProjectsOverviewState(selector, compare = shallowEqual) {
7
+ const actor = useProjectsOverviewActor();
8
+ return useSelector(actor, selector, compare);
9
+ }
10
+ function useProjectsOverviewXYStoreApi() {
11
+ return useStoreApi();
12
+ }
13
+
14
+ export { useProjectsOverviewState, useProjectsOverviewXYStoreApi };
@@ -0,0 +1 @@
1
+ export { ProjectsOverview, type ProjectsOverviewProps, } from './ProjectsOverview';
@@ -0,0 +1,6 @@
1
+ import { LayoutedProjectsView } from '@likec4/core/compute-view';
2
+ import { ProjectsOverviewTypes } from './_types';
3
+ export declare function layoutedProjectsViewToXYFlow(view: LayoutedProjectsView): {
4
+ xynodes: ProjectsOverviewTypes.Node[];
5
+ xyedges: ProjectsOverviewTypes.Edge[];
6
+ };
@@ -0,0 +1,49 @@
1
+ import { map } from 'remeda';
2
+ import { ZIndexes } from '../base/const.js';
3
+
4
+ function layoutedProjectsViewToXYFlow(view) {
5
+ return {
6
+ xynodes: map(view.nodes, projectNodeToXY),
7
+ xyedges: map(view.edges, projectEdgeToXY)
8
+ };
9
+ }
10
+ function projectNodeToXY({ id, x, y, width, height, ...node }) {
11
+ return {
12
+ id,
13
+ position: { x, y },
14
+ type: "project",
15
+ initialWidth: width,
16
+ initialHeight: height,
17
+ draggable: false,
18
+ deletable: false,
19
+ zIndex: ZIndexes.Element,
20
+ style: {
21
+ width,
22
+ height
23
+ },
24
+ data: {
25
+ id,
26
+ width,
27
+ height,
28
+ ...node
29
+ }
30
+ };
31
+ }
32
+ function projectEdgeToXY({ id, source, target, ...edge }) {
33
+ return {
34
+ id,
35
+ source,
36
+ target,
37
+ type: "relationship",
38
+ zIndex: ZIndexes.Edge,
39
+ deletable: false,
40
+ data: {
41
+ id,
42
+ technology: null,
43
+ labelBBox: null,
44
+ ...edge
45
+ }
46
+ };
47
+ }
48
+
49
+ export { layoutedProjectsViewToXYFlow };
@@ -0,0 +1 @@
1
+ export declare const ProjectsOverviewPanel: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { NavigationPanel } from '../../components/NavigationPanel.js';
3
+
4
+ const ProjectsOverviewPanel = () => {
5
+ return /* @__PURE__ */ jsx(NavigationPanel.Root, { children: /* @__PURE__ */ jsxs(NavigationPanel.Body, { children: [
6
+ /* @__PURE__ */ jsx(NavigationPanel.Logo, {}),
7
+ /* @__PURE__ */ jsx(NavigationPanel.Label, { children: "Projects Overview" })
8
+ ] }) });
9
+ };
10
+
11
+ export { ProjectsOverviewPanel };
@@ -0,0 +1,5 @@
1
+ import { Viewport } from '@xyflow/react';
2
+ export declare const ProjectsOverviewViewportPersistence: {
3
+ read(): Viewport | null;
4
+ write(viewport: Viewport | null): void;
5
+ };