@likec4/diagram 1.48.0 → 1.50.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 (307) hide show
  1. package/README.md +7 -9
  2. package/adhoc-editor/package.json +4 -0
  3. package/dist/LikeC4Diagram.d.ts +2 -1
  4. package/dist/LikeC4Diagram.js +77 -79
  5. package/dist/LikeC4Diagram.props.d.ts +9 -1
  6. package/dist/LikeC4ModelProvider.d.ts +4 -4
  7. package/dist/LikeC4ModelProvider.js +2 -2
  8. package/dist/LikeC4ProjectsOverview.d.ts +3 -2
  9. package/dist/LikeC4ProjectsProvider.d.ts +2 -1
  10. package/dist/LikeC4ProjectsProvider.js +4 -4
  11. package/dist/LikeC4Styles.d.ts +2 -1
  12. package/dist/LikeC4View.d.ts +14 -1
  13. package/dist/LikeC4View.js +31 -18
  14. package/dist/ReactLikeC4.d.ts +2 -1
  15. package/dist/ReactLikeC4.js +3 -1
  16. package/dist/StaticLikeC4Diagram.d.ts +2 -1
  17. package/dist/StaticLikeC4Diagram.js +1 -0
  18. package/dist/_virtual/store-1b2fbb72.cjs.js +3 -0
  19. package/dist/_virtual/xstate-store-react.cjs.js +5 -0
  20. package/dist/_virtual/xstate-store-react.cjs2.js +3 -0
  21. package/dist/adhoc-editor/EditorPanel.d.ts +1 -0
  22. package/dist/adhoc-editor/EditorPanel.js +105 -0
  23. package/dist/adhoc-editor/ElementsTree.d.ts +2 -0
  24. package/dist/adhoc-editor/ElementsTree.js +142 -0
  25. package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +1 -1
  26. package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +46 -43
  27. package/dist/adhoc-editor/components/Tree.d.ts +48 -0
  28. package/dist/adhoc-editor/components/Tree.js +296 -0
  29. package/dist/adhoc-editor/hooks.d.ts +3 -3
  30. package/dist/adhoc-editor/hooks.js +5 -23
  31. package/dist/adhoc-editor/index.d.ts +1 -1
  32. package/dist/adhoc-editor/index.js +1 -0
  33. package/dist/adhoc-editor/{ActorProvider.d.ts → state/ActorProvider.d.ts} +1 -3
  34. package/dist/adhoc-editor/{ActorProvider.js → state/ActorProvider.js} +10 -11
  35. package/dist/adhoc-editor/state/actor.d.ts +13 -0
  36. package/dist/adhoc-editor/{actor.editor.d.ts → state/actor.editor.d.ts} +6 -4
  37. package/dist/adhoc-editor/state/actor.editor.js +205 -0
  38. package/dist/adhoc-editor/{actor.js → state/actor.js} +2 -6
  39. package/dist/adhoc-editor/{actor.layouter.d.ts → state/actor.layouter.d.ts} +7 -4
  40. package/dist/adhoc-editor/{actor.layouter.js → state/actor.layouter.js} +17 -13
  41. package/dist/adhoc-editor/{actor.types.d.ts → state/actor.types.d.ts} +12 -6
  42. package/dist/adhoc-editor/{actor.types.js → state/actor.types.js} +8 -1
  43. package/dist/adhoc-editor/state/panel.d.ts +95 -0
  44. package/dist/adhoc-editor/state/panel.js +139 -0
  45. package/dist/adhoc-editor/state/utils.d.ts +17 -0
  46. package/dist/adhoc-editor/state/utils.js +32 -0
  47. package/dist/adhoc-editor/useElementsTree.d.ts +18 -0
  48. package/dist/adhoc-editor/useElementsTree.js +130 -0
  49. package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +1 -1
  50. package/dist/base/const.d.ts +1 -0
  51. package/dist/base-primitives/compound/CompoundActionButton.js +26 -12
  52. package/dist/base-primitives/compound/CompoundDetailsButton.js +22 -9
  53. package/dist/base-primitives/compound/CompoundNodeContainer.js +5 -4
  54. package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
  55. package/dist/base-primitives/edge/EdgeLabel.js +3 -4
  56. package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +2 -1
  57. package/dist/base-primitives/edge/EdgeLabelContainer.js +12 -19
  58. package/dist/base-primitives/edge/EdgeMarkers.js +3 -3
  59. package/dist/base-primitives/element/ElementActionButtons.js +35 -10
  60. package/dist/base-primitives/element/ElementDetailsButton.js +47 -18
  61. package/dist/base-primitives/element/ElementNodeContainer.d.ts +3 -3
  62. package/dist/base-primitives/element/ElementNodeContainer.js +23 -10
  63. package/dist/base-primitives/element/ElementShape.d.ts +4 -4
  64. package/dist/base-primitives/element/ElementShape.js +71 -8
  65. package/dist/components/ErrorFallback.js +1 -1
  66. package/dist/components/Link.js +3 -3
  67. package/dist/components/Logo.js +1 -1
  68. package/dist/components/NavigationPanel.js +2 -4
  69. package/dist/components/PortalToContainer.js +3 -4
  70. package/dist/components/RootContainer.js +9 -16
  71. package/dist/components/ViewNotFound.d.ts +3 -3
  72. package/dist/components/ViewNotFound.js +30 -26
  73. package/dist/context/CurrentViewModelProvider.d.ts +2 -0
  74. package/dist/context/CurrentViewModelProvider.js +12 -0
  75. package/dist/context/DefaultMantineProvider.d.ts +1 -1
  76. package/dist/context/DefaultMantineProvider.js +10 -1
  77. package/dist/context/DiagramEventHandlers.d.ts +5 -5
  78. package/dist/context/DiagramEventHandlers.js +10 -4
  79. package/dist/context/DiagramFeatures.d.ts +8 -7
  80. package/dist/context/DiagramFeatures.js +5 -3
  81. package/dist/context/FramerMotionConfig.d.ts +1 -3
  82. package/dist/context/IconRenderer.d.ts +5 -4
  83. package/dist/context/IconRenderer.js +51 -24
  84. package/dist/context/LikeC4ModelContext.d.ts +10 -5
  85. package/dist/context/LikeC4ModelContext.js +11 -3
  86. package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
  87. package/dist/context/LikeC4ProjectsContext.js +6 -2
  88. package/dist/context/RootContainerContext.d.ts +10 -3
  89. package/dist/context/RootContainerContext.js +8 -3
  90. package/dist/context/TagStylesContext.js +1 -1
  91. package/dist/custom/index.js +16 -15
  92. package/dist/editor/LikeC4EditorProvider.js +1 -1
  93. package/dist/editor/applyChangesToManualLayout.js +7 -7
  94. package/dist/editor/editorActor.actions.js +20 -20
  95. package/dist/editor/editorActor.setup.js +1 -1
  96. package/dist/editor/editorActor.states.js +0 -9
  97. package/dist/editor/useEditorActorLogic.d.ts +1 -2
  98. package/dist/editor/useEditorActorLogic.js +8 -11
  99. package/dist/hooks/index.d.ts +2 -2
  100. package/dist/hooks/safeContext.d.ts +4 -5
  101. package/dist/hooks/useCallbackRef.js +7 -6
  102. package/dist/hooks/useCurrentView.js +5 -10
  103. package/dist/hooks/useCurrentViewModel.d.ts +2 -6
  104. package/dist/hooks/useCurrentViewModel.js +3 -7
  105. package/dist/hooks/useDiagram.d.ts +9 -1
  106. package/dist/hooks/useDiagram.js +8 -2
  107. package/dist/hooks/useDiagramCompareLayout.d.ts +5 -5
  108. package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
  109. package/dist/hooks/useLikeC4ElementsTree.js +1 -1
  110. package/dist/hooks/useLikeC4Model.d.ts +6 -2
  111. package/dist/hooks/useLikeC4Model.js +7 -9
  112. package/dist/hooks/useLikeC4Project.d.ts +4 -6
  113. package/dist/hooks/useLikeC4Project.js +19 -31
  114. package/dist/hooks/useLikeC4Styles.js +3 -9
  115. package/dist/hooks/useMantinePortalProps.d.ts +1 -1
  116. package/dist/hooks/useMediaPrint.d.ts +0 -2
  117. package/dist/hooks/useOverlaysActor.js +4 -4
  118. package/dist/hooks/useSearchActor.js +4 -4
  119. package/dist/index.d.ts +1 -3
  120. package/dist/index.js +2 -2
  121. package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
  122. package/dist/likec4diagram/DiagramXYFlow.js +5 -7
  123. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +22 -24
  124. package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
  125. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +40 -55
  126. package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
  127. package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -2
  128. package/dist/likec4diagram/custom/nodes/NodeDrifts.js +3 -20
  129. package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +6 -0
  130. package/dist/likec4diagram/custom/nodes/NodeNotes.js +286 -0
  131. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
  132. package/dist/likec4diagram/custom/nodes/nodes.js +5 -2
  133. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +12 -8
  134. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +3 -3
  135. package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
  136. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -28
  137. package/dist/likec4diagram/state/DiagramActorProvider.js +30 -56
  138. package/dist/likec4diagram/state/diagram-api.d.ts +11 -0
  139. package/dist/likec4diagram/state/diagram-api.js +15 -0
  140. package/dist/likec4diagram/state/machine.actions.d.ts +27 -0
  141. package/dist/likec4diagram/state/machine.actions.js +78 -21
  142. package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
  143. package/dist/likec4diagram/state/machine.actions.layout.js +38 -3
  144. package/dist/likec4diagram/state/machine.js +4 -1
  145. package/dist/likec4diagram/state/machine.setup.d.ts +19 -2
  146. package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
  147. package/dist/likec4diagram/state/machine.state.ready.d.ts +61 -1
  148. package/dist/likec4diagram/state/machine.state.ready.js +11 -3
  149. package/dist/likec4diagram/state/utils.d.ts +2 -1
  150. package/dist/likec4diagram/state/utils.js +1 -1
  151. package/dist/likec4diagram/types.d.ts +2 -2
  152. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
  153. package/dist/likec4diagram/ui/notation/NotationPanel.d.ts +1 -1
  154. package/dist/likec4diagram/ui/notation/NotationPanel.js +6 -29
  155. package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
  156. package/dist/likec4diagram/useLayoutConstraints.js +125 -86
  157. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +2 -0
  158. package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +7 -2
  159. package/dist/navigationpanel/NavigationPanel.js +2 -2
  160. package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
  161. package/dist/navigationpanel/_common.js +2 -2
  162. package/dist/navigationpanel/actor.js +1 -1
  163. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
  164. package/dist/navigationpanel/comparepanel/ComparePanel.js +155 -29
  165. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
  166. package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -0
  167. package/dist/navigationpanel/comparepanel/DriftsSummary.js +264 -0
  168. package/dist/navigationpanel/controls/DetailsControls.js +4 -4
  169. package/dist/navigationpanel/controls/LayoutWarning.js +1 -1
  170. package/dist/navigationpanel/controls/LogoButton.js +1 -1
  171. package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
  172. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  173. package/dist/navigationpanel/controls/SearchControl.js +1 -1
  174. package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
  175. package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
  176. package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
  177. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
  178. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
  179. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
  180. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
  181. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +16 -16
  182. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
  183. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +1 -1
  184. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
  185. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
  186. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +2 -2
  187. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
  188. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
  189. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
  190. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
  191. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +2 -2
  192. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
  193. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
  194. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
  195. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
  196. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
  197. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +2 -2
  198. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +2 -2
  199. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
  200. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
  201. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
  202. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +2 -2
  203. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
  204. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
  205. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
  206. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
  207. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
  208. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +2 -2
  209. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +2 -2
  210. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +2 -2
  211. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +2 -2
  212. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +2 -2
  213. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +2 -2
  214. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +2 -2
  215. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +2 -2
  216. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
  217. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
  218. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +2 -2
  219. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +2 -2
  220. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
  221. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
  222. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
  223. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
  224. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +2 -2
  225. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +2 -2
  226. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
  227. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
  228. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
  229. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
  230. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
  231. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +2 -2
  232. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
  233. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +1 -1
  234. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
  235. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
  236. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
  237. package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/dist/store-1b2fbb72.cjs.js +742 -0
  238. package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +175 -0
  239. package/dist/overlays/element-details/ElementDetailsCard.css.js +11 -11
  240. package/dist/overlays/element-details/ElementDetailsCard.js +44 -45
  241. package/dist/overlays/element-details/MetadataValue.js +7 -7
  242. package/dist/overlays/element-details/TabPanelDeployments.js +4 -4
  243. package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -5
  244. package/dist/overlays/element-details/TabPanelRelationships.js +4 -5
  245. package/dist/overlays/element-details/TabPanelStructure.css.js +3 -3
  246. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  247. package/dist/overlays/element-details/actorContext.d.ts +1 -1
  248. package/dist/overlays/overlaysActor.js +1 -1
  249. package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
  250. package/dist/overlays/relationship-details/SelectEdge.css.js +4 -4
  251. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  252. package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
  253. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -6
  254. package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
  255. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  256. package/dist/overlays/relationships-browser/actor.js +1 -1
  257. package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
  258. package/dist/overlays/relationships-browser/custom/EmptyNode.js +1 -1
  259. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -1
  260. package/dist/projects-overview/ProjectsOverview.js +2 -2
  261. package/dist/projects-overview/ProjectsOverviewXY.d.ts +1 -5
  262. package/dist/projects-overview/ProjectsOverviewXY.js +1 -1
  263. package/dist/projects-overview/actor.d.ts +1 -1
  264. package/dist/projects-overview/context.d.ts +2 -2
  265. package/dist/projects-overview/context.js +2 -1
  266. package/dist/projects-overview/custom/nodeTypes.js +1 -1
  267. package/dist/search/Search.d.ts +2 -1
  268. package/dist/search/Search.js +108 -87
  269. package/dist/search/components/ElementsColumn.css.js +3 -3
  270. package/dist/search/components/ElementsColumn.js +93 -59
  271. package/dist/search/components/PickView.js +8 -4
  272. package/dist/search/components/SearchByTags.js +1 -1
  273. package/dist/search/components/SearchInput.js +2 -2
  274. package/dist/search/components/ViewsColum.d.ts +2 -1
  275. package/dist/search/components/ViewsColum.js +39 -35
  276. package/dist/search/components/ViewsColumn.css.js +1 -1
  277. package/dist/search/components/_shared.css.js +11 -11
  278. package/dist/search/components/utils.js +1 -4
  279. package/dist/search/hooks.js +4 -1
  280. package/dist/search/searchActor.d.ts +12 -2
  281. package/dist/search/searchActor.js +60 -4
  282. package/dist/shadowroot/ShadowRoot.d.ts +5 -2
  283. package/dist/shadowroot/ShadowRoot.js +7 -5
  284. package/dist/shadowroot/styles.css.js +3 -2
  285. package/dist/styles.css2.js +1 -1
  286. package/dist/utils/view-bounds.d.ts +3 -2
  287. package/dist/utils/view-bounds.js +1 -1
  288. package/dist/utils/xyflow.d.ts +10 -5
  289. package/dist/utils/xyflow.js +24 -22
  290. package/package.json +33 -32
  291. package/panda.buildinfo.json +176 -87
  292. package/styles-min.css +1 -1
  293. package/styles.css +1 -1
  294. package/bundle/index.js +0 -52554
  295. package/bundle/package.json +0 -4
  296. package/dist/adhoc-editor/EditorNavigationPanel.d.ts +0 -1
  297. package/dist/adhoc-editor/EditorNavigationPanel.js +0 -32
  298. package/dist/adhoc-editor/SelectElementOverlay.d.ts +0 -1
  299. package/dist/adhoc-editor/SelectElementOverlay.js +0 -124
  300. package/dist/adhoc-editor/actor.d.ts +0 -131
  301. package/dist/adhoc-editor/actor.editor.js +0 -96
  302. package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +0 -104
  303. 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 +0 -14
  304. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
  305. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
  306. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
  307. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
@@ -9,6 +9,7 @@ import { useCallbackRef } from '../../../hooks/useCallbackRef.js';
9
9
  import { CompoundActions } from './CompoundActions.js';
10
10
  import { DeploymentElementActions, ElementActions } from './ElementActions.js';
11
11
  import { NodeDrifts } from './NodeDrifts.js';
12
+ import { NodeNotes } from './NodeNotes.js';
12
13
  import { CompoundDeploymentToolbar, CompoundElementToolbar } from './toolbar/CompoundToolbar.js';
13
14
  import { DeploymentElementToolbar, ElementToolbar } from './toolbar/ElementToolbar.js';
14
15
  import { CompoundNodeContainer } from '../../../base-primitives/compound/CompoundNodeContainer.js';
@@ -70,7 +71,7 @@ function CompoundDetailsButtonWithHandler(props) {
70
71
  );
71
72
  }
72
73
  function ElementNode(props) {
73
- const { enableElementTags, enableElementDetails, enableReadOnly, enableCompareWithLatest } = useEnabledFeatures();
74
+ const { enableElementTags, enableElementDetails, enableReadOnly, enableCompareWithLatest, enableNotes } = useEnabledFeatures();
74
75
  return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
75
76
  enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
76
77
  /* @__PURE__ */ jsx(ElementShape, { ...props }),
@@ -79,11 +80,12 @@ function ElementNode(props) {
79
80
  /* @__PURE__ */ jsx(ElementActions, { ...props }),
80
81
  enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
81
82
  !enableReadOnly && /* @__PURE__ */ jsx(ElementToolbar, { ...props }),
83
+ enableNotes && /* @__PURE__ */ jsx(NodeNotes, { ...props }),
82
84
  /* @__PURE__ */ jsx(DefaultHandles, { direction: props.data.viewLayoutDir })
83
85
  ] });
84
86
  }
85
87
  function DeploymentNode(props) {
86
- const { enableElementTags, enableElementDetails, enableReadOnly, enableCompareWithLatest } = useEnabledFeatures();
88
+ const { enableElementTags, enableElementDetails, enableReadOnly, enableCompareWithLatest, enableNotes } = useEnabledFeatures();
87
89
  return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
88
90
  enableCompareWithLatest && /* @__PURE__ */ jsx(NodeDrifts, { nodeProps: props }),
89
91
  /* @__PURE__ */ jsx(ElementShape, { ...props }),
@@ -92,6 +94,7 @@ function DeploymentNode(props) {
92
94
  /* @__PURE__ */ jsx(DeploymentElementActions, { ...props }),
93
95
  enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
94
96
  !enableReadOnly && /* @__PURE__ */ jsx(DeploymentElementToolbar, { ...props }),
97
+ enableNotes && /* @__PURE__ */ jsx(NodeNotes, { ...props }),
95
98
  /* @__PURE__ */ jsx(DefaultHandles, { direction: props.data.viewLayoutDir })
96
99
  ] });
97
100
  }
@@ -7,11 +7,13 @@ import { BorderStyleOption, GoToSourceButton, BrowseRelationshipsButton } from '
7
7
  import { ColorButton } from './ColorButton.js';
8
8
  import { Toolbar } from './Toolbar.js';
9
9
  import { useHandlers } from './useHandlers.js';
10
- import IconSelector from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
11
- 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';
10
+ import IconSelector from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
11
+ import IconCheck from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
12
12
 
13
+ const SortedElementShapes = [...ElementShapes].sort();
13
14
  function ElementToolbar(props) {
14
- const { enableVscode, enableRelationshipBrowser } = useEnabledFeatures();
15
+ const { enableVscode, enableRelationshipBrowser, enableNotes } = useEnabledFeatures();
16
+ const increaseOffset = !!(enableNotes && props.data.notes);
15
17
  const {
16
18
  data: {
17
19
  shape,
@@ -25,6 +27,7 @@ function ElementToolbar(props) {
25
27
  {
26
28
  nodeProps: props,
27
29
  title: modelFqn,
30
+ offset: increaseOffset ? 20 : 10,
28
31
  align: "start",
29
32
  children: [
30
33
  /* @__PURE__ */ jsx(
@@ -129,9 +132,11 @@ function ElementShapeButton({
129
132
  {
130
133
  variant: "light",
131
134
  color: "gray",
132
- size: "xs",
135
+ size: "compact-sm",
133
136
  fz: "xxs",
134
- px: "xs",
137
+ px: 4,
138
+ pl: 8,
139
+ py: 2,
135
140
  rightSection: /* @__PURE__ */ jsx(IconSelector, { size: 12 }),
136
141
  children: elementShape
137
142
  }
@@ -141,11 +146,10 @@ function ElementShapeButton({
141
146
  {
142
147
  onDoubleClick: stopPropagation,
143
148
  onClick: stopPropagation,
144
- children: ElementShapes.map((shape) => /* @__PURE__ */ jsx(
149
+ children: SortedElementShapes.map((shape) => /* @__PURE__ */ jsx(
145
150
  MenuItem,
146
151
  {
147
- fz: "xs",
148
- fw: "500",
152
+ fz: "sm",
149
153
  value: shape,
150
154
  rightSection: elementShape === shape ? /* @__PURE__ */ jsx(IconCheck, { size: 12 }) : void 0,
151
155
  onClick: (e) => {
@@ -1,12 +1,12 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { SegmentedControl, Tooltip as Tooltip$1, ActionIcon } from '@mantine/core';
2
+ import { SegmentedControl, ActionIcon, Tooltip as Tooltip$1 } from '@mantine/core';
3
3
  import { useState, useEffect } from 'react';
4
4
  import '@xstate/react';
5
5
  import 'fast-equals';
6
6
  import { useDiagram } from '../../../../hooks/safeContext.js';
7
7
  import { useDiagramEventHandlers } from '../../../../context/DiagramEventHandlers.js';
8
- import IconFileSymlink from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
9
- import IconTransform from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
8
+ import IconFileSymlink from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
9
+ import IconTransform from '../../../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
10
10
 
11
11
  const Tooltip = Tooltip$1.withProps({
12
12
  color: "dark",
@@ -1,7 +1,7 @@
1
1
  import { css } from '@likec4/styles/css';
2
2
 
3
3
  const toolbarTitle = css({
4
- color: "mantine.colors.dimmed",
4
+ color: "text.dimmed",
5
5
  fontSize: "xxs",
6
6
  fontWeight: "bold",
7
7
  maxWidth: "220px",
@@ -2,9 +2,9 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
2
  import { autoUpdate, computePosition, offset, autoPlacement, size, hide } from '@floating-ui/dom';
3
3
  import { nameFromFqn } from '@likec4/core';
4
4
  import { cx, css } from '@likec4/styles/css';
5
- import { VStack, styled, HStack, Box, Txt } from '@likec4/styles/jsx';
5
+ import { VStack, HStack, Box, styled } from '@likec4/styles/jsx';
6
6
  import { bleed } from '@likec4/styles/patterns';
7
- import { Divider, ScrollAreaAutosize, Button, TooltipGroup, Tooltip as Tooltip$1, ActionIcon, Text, Notification } from '@mantine/core';
7
+ import { Divider, ScrollAreaAutosize, Button, TooltipGroup, ActionIcon, Text, Tooltip as Tooltip$1 } from '@mantine/core';
8
8
  import { useActorRef, useSelector } from '@xstate/react';
9
9
  import { shallowEqual } from 'fast-equals';
10
10
  import { memo, useEffect, useCallback, useRef, useState, useLayoutEffect, Fragment, forwardRef } from 'react';
@@ -21,10 +21,10 @@ import { Endpoint, RelationshipTitle } from './components.js';
21
21
  import { useDiagram } from '../../hooks/safeContext.js';
22
22
  import { useRootContainerRef } from '../../context/RootContainerContext.js';
23
23
  import { roundDpr } from '../../utils/roundDpr.js';
24
- import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
25
- import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
26
- import IconFileSymlink from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
27
- import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
24
+ import IconArrowRight from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
25
+ import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
26
+ import IconFileSymlink from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
27
+ import IconInfoCircle from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
28
28
  import { Markdown } from '../../base-primitives/Markdown.js';
29
29
 
30
30
  function selectDiagramContext(c) {
@@ -158,7 +158,7 @@ const RelationshipPopoverInternal = ({
158
158
  onMouseLeave
159
159
  }) => {
160
160
  const ref = useRef(null);
161
- const { enableNavigateTo, enableVscode, enableCompareWithLatest } = useEnabledFeatures();
161
+ const { enableNavigateTo, enableVscode } = useEnabledFeatures();
162
162
  const { onOpenSource } = useDiagramEventHandlers();
163
163
  const containerRef = useRootContainerRef();
164
164
  const [referenceEl, setReferenceEl] = useState(null);
@@ -285,7 +285,6 @@ const RelationshipPopoverInternal = ({
285
285
  paddingTop: "2"
286
286
  },
287
287
  children: [
288
- enableCompareWithLatest && /* @__PURE__ */ jsx(EdgeDrifts, { diagramEdge }),
289
288
  /* @__PURE__ */ jsx(
290
289
  Button,
291
290
  {
@@ -326,25 +325,6 @@ const RelationshipPopoverInternal = ({
326
325
  }
327
326
  );
328
327
  };
329
- const EdgeDrifts = ({ diagramEdge }) => {
330
- const drifts = diagramEdge.drifts;
331
- if (!drifts || drifts.length === 0) {
332
- return null;
333
- }
334
- return /* @__PURE__ */ jsx(
335
- Notification,
336
- {
337
- color: "orange",
338
- withBorder: false,
339
- withCloseButton: false,
340
- title: "Changes:",
341
- children: drifts.map((drift) => /* @__PURE__ */ jsxs(Txt, { mt: "1", size: "xs", children: [
342
- "- ",
343
- drift
344
- ] }, drift))
345
- }
346
- );
347
- };
348
328
  const Relationship = forwardRef(({
349
329
  viewId,
350
330
  relationship: r,
@@ -543,7 +523,7 @@ const Label = styled("div", {
543
523
  fontWeight: "medium",
544
524
  userSelect: "none",
545
525
  lineHeight: "sm",
546
- color: "mantine.colors.dimmed"
526
+ color: "text.dimmed"
547
527
  }
548
528
  });
549
529
  const Tooltip = Tooltip$1.withProps({
@@ -1,17 +1,14 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { useActorRef, useSelector } from '@xstate/react';
2
+ import { useActorRef } from '@xstate/react';
3
3
  import { useStoreApi } from '@xyflow/react';
4
- import { shallowEqual } from 'fast-equals';
5
4
  import { useRef, useState, useEffect, memo } from 'react';
6
5
  import { isNullish } from 'remeda';
7
6
  import { ErrorBoundary } from '../../components/ErrorFallback.js';
8
- import { useDiagramEventHandlers } from '../../context/DiagramEventHandlers.js';
7
+ import { useDiagramEventHandlersRef } from '../../context/DiagramEventHandlers.js';
9
8
  import { useEnabledFeatures, DiagramFeatures } from '../../context/DiagramFeatures.js';
10
- import { CurrentViewModelContext } from '../../context/LikeC4ModelContext.js';
11
9
  import { useEditorActorLogic } from '../../editor/useEditorActorLogic.js';
12
10
  import { DiagramActorContextProvider, DiagramApiContextProvider, useDiagram } from '../../hooks/safeContext.js';
13
- import { useOnDiagramEvent, useDiagramContext } from '../../hooks/useDiagram.js';
14
- import { useOptionalLikeC4Model } from '../../hooks/useLikeC4Model.js';
11
+ import { useDiagramSnapshot, useOnDiagramEvent, selectDiagramActorContext } from '../../hooks/useDiagram.js';
15
12
  import { useUpdateEffect } from '../../hooks/useUpdateEffect.js';
16
13
  import { makeDiagramApi } from './diagram-api.js';
17
14
  import { diagramMachine } from './machine.js';
@@ -30,7 +27,8 @@ function DiagramActorProvider({
30
27
  dynamicViewVariant: _defaultVariant
31
28
  }) {
32
29
  const xystore = useStoreApi();
33
- const editorActor = useEditorActorLogic(view.id);
30
+ const editorActor = useEditorActorLogic();
31
+ const features = useEnabledFeatures();
34
32
  const actor = useActorRef(
35
33
  diagramMachine.provide({
36
34
  actors: {
@@ -50,6 +48,7 @@ function DiagramActorProvider({
50
48
  nodesDraggable,
51
49
  nodesSelectable,
52
50
  where,
51
+ features,
53
52
  dynamicViewVariant: _defaultVariant
54
53
  }
55
54
  }
@@ -60,7 +59,6 @@ function DiagramActorProvider({
60
59
  previous: actorRef.current.getSnapshot().context,
61
60
  current: actor.getSnapshot().context
62
61
  });
63
- actorRef.current.send({ type: "destroy" });
64
62
  actorRef.current = actor;
65
63
  }
66
64
  const [api, setApi] = useState(() => makeDiagramApi(actorRef));
@@ -69,38 +67,36 @@ function DiagramActorProvider({
69
67
  if (api2.ref === actorRef) {
70
68
  return api2;
71
69
  }
72
- console.warn(
70
+ console.error(
73
71
  "DiagramMachine actorRef changed, creating new DiagramApi instance, this should not happen during the lifetime of the actor"
74
72
  );
75
73
  return makeDiagramApi(actorRef);
76
74
  });
77
75
  }, [actorRef]);
78
- const features = useEnabledFeatures();
79
- useEffect(
80
- () => actor.send({ type: "update.features", features }),
81
- [features, actor]
82
- );
83
- useEffect(
76
+ useEffect(() => {
77
+ actor.send({ type: "update.features", features });
78
+ }, [actor, features]);
79
+ useUpdateEffect(
84
80
  () => actor.send({
85
81
  type: "update.inputs",
86
82
  inputs: { zoomable, where, pannable, fitViewPadding, nodesDraggable, nodesSelectable }
87
83
  }),
88
- [zoomable, where, pannable, fitViewPadding, actor, nodesDraggable, nodesSelectable]
84
+ [actor, zoomable, where, pannable, fitViewPadding, nodesDraggable, nodesSelectable]
89
85
  );
90
86
  useUpdateEffect(() => {
91
87
  if (!_defaultVariant) return;
92
88
  actor.send({ type: "switch.dynamicViewVariant", variant: _defaultVariant });
93
- }, [_defaultVariant, actor]);
89
+ }, [actor, _defaultVariant]);
94
90
  useEffect(
95
91
  () => actor.send({ type: "update.view", view, source: "external" }),
96
92
  [actor, view]
97
93
  );
98
94
  return /* @__PURE__ */ jsx(DiagramActorContextProvider, { value: actor, children: /* @__PURE__ */ jsxs(DiagramApiContextProvider, { value: api, children: [
99
- /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(CurrentViewModelProvider, { actorRef: actor, children }) }),
100
- /* @__PURE__ */ jsx(DiagramActorEventListener, {})
95
+ /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(ToggledFeatures, { children }) }),
96
+ /* @__PURE__ */ jsx(PropagateDiagramActorEvents, {})
101
97
  ] }) });
102
98
  }
103
- const selectFromActor = ({ context }) => {
99
+ const selectToggledFeatures = selectDiagramActorContext((context) => {
104
100
  let toggledFeatures = context.toggledFeatures;
105
101
  const hasDrifts = context.view.drifts != null && context.view.drifts.length > 0;
106
102
  const enableCompareWithLatest = hasDrifts && context.features.enableCompareWithLatest && (toggledFeatures.enableCompareWithLatest ?? false) && isNullish(context.activeWalkthrough);
@@ -112,56 +108,34 @@ const selectFromActor = ({ context }) => {
112
108
  enableReadOnly
113
109
  };
114
110
  }
115
- return {
116
- toggledFeatures,
117
- viewId: context.view.id
118
- };
119
- };
120
- const compareSelected = (a, b) => {
121
- return a.viewId === b.viewId && shallowEqual(a.toggledFeatures, b.toggledFeatures);
122
- };
123
- function CurrentViewModelProvider({ children, actorRef }) {
124
- const { viewId, toggledFeatures } = useSelector(
125
- actorRef,
126
- selectFromActor,
127
- compareSelected
128
- );
129
- const likec4model = useOptionalLikeC4Model();
130
- const viewmodel = likec4model?.findView(viewId) ?? null;
131
- return /* @__PURE__ */ jsx(CurrentViewModelContext.Provider, { value: viewmodel, children: /* @__PURE__ */ jsx(DiagramFeatures, { overrides: toggledFeatures, children }) });
111
+ return toggledFeatures;
112
+ });
113
+ function ToggledFeatures({ children }) {
114
+ const toggledFeatures = useDiagramSnapshot(selectToggledFeatures);
115
+ useUpdateEffect(() => {
116
+ DiagramToggledFeaturesPersistence.write(toggledFeatures);
117
+ }, [toggledFeatures]);
118
+ return /* @__PURE__ */ jsx(DiagramFeatures, { overrides: toggledFeatures, children });
132
119
  }
133
- const DiagramActorEventListener = memo(() => {
120
+ const PropagateDiagramActorEvents = memo(() => {
134
121
  const diagram = useDiagram();
135
- const {
136
- onNavigateTo,
137
- onOpenSource,
138
- // onChange,
139
- onLayoutTypeChange,
140
- handlersRef
141
- } = useDiagramEventHandlers();
142
- useOnDiagramEvent("openSource", ({ params }) => onOpenSource?.(params));
143
- useOnDiagramEvent("navigateTo", ({ viewId }) => onNavigateTo?.(viewId));
122
+ const handlers = useDiagramEventHandlersRef();
123
+ useOnDiagramEvent("openSource", ({ params }) => handlers.current.onOpenSource?.(params));
124
+ useOnDiagramEvent("navigateTo", ({ viewId }) => handlers.current.onNavigateTo?.(viewId));
144
125
  useOnDiagramEvent("onLayoutTypeChange", ({ layoutType }) => {
145
- onLayoutTypeChange?.(layoutType);
126
+ handlers.current.onLayoutTypeChange?.(layoutType);
146
127
  });
147
128
  useOnDiagramEvent(
148
129
  "initialized",
149
130
  ({ instance: xyflow }) => {
150
131
  try {
151
- handlersRef.current.onInitialized?.({ diagram, xyflow });
132
+ handlers.current.onInitialized?.({ diagram, xyflow });
152
133
  } catch (error) {
153
134
  console.error(error);
154
135
  }
155
136
  },
156
137
  { once: true }
157
138
  );
158
- const toggledFeatures = useDiagramContext(
159
- (ctx) => ctx.toggledFeatures,
160
- shallowEqual
161
- );
162
- useUpdateEffect(() => {
163
- DiagramToggledFeaturesPersistence.write(toggledFeatures);
164
- }, [toggledFeatures]);
165
139
  return null;
166
140
  });
167
141
 
@@ -62,6 +62,17 @@ export interface DiagramApi<A extends Any = Unknown> {
62
62
  openRelationshipDetails(...params: [edgeId: EdgeId] | [source: Fqn<A>, target: Fqn<A>]): void;
63
63
  updateNodeData(nodeId: NodeId, data: PartialDeep<Types.NodeData>): void;
64
64
  updateEdgeData(edgeId: EdgeId, data: PartialDeep<Types.EdgeData>): void;
65
+ highlightNode(nodeId: NodeId): void;
66
+ highlightEdge(edgeId: EdgeId): void;
67
+ unhighlightAll(): void;
68
+ /**
69
+ * Center viewport on a given node
70
+ */
71
+ centerViewportOnNode(target: NodeId): void;
72
+ /**
73
+ * Center viewport on a given edge (centering on edge means including both source and target nodes in view)
74
+ */
75
+ centerViewportOnEdge(target: EdgeId): void;
65
76
  /**
66
77
  * Start editing, either node or edge
67
78
  */
@@ -133,6 +133,21 @@ function makeDiagramApi(actorRef) {
133
133
  },
134
134
  switchDynamicViewVariant: (variant) => {
135
135
  actorRef.current.send({ type: "switch.dynamicViewVariant", variant });
136
+ },
137
+ highlightNode: (nodeId) => {
138
+ actorRef.current.send({ type: "highlight.node", nodeId });
139
+ },
140
+ highlightEdge: (edgeId) => {
141
+ actorRef.current.send({ type: "highlight.edge", edgeId });
142
+ },
143
+ unhighlightAll: () => {
144
+ actorRef.current.send({ type: "unhighlight.all" });
145
+ },
146
+ centerViewportOnNode: (nodeId) => {
147
+ actorRef.current.send({ type: "xyflow.centerViewport", nodeId });
148
+ },
149
+ centerViewportOnEdge: (edgeId) => {
150
+ actorRef.current.send({ type: "xyflow.centerViewport", edgeId });
136
151
  }
137
152
  };
138
153
  }
@@ -910,6 +910,33 @@ export declare const tagHighlight: () => ActionFunction<Context, Events, Events,
910
910
  id: "editor";
911
911
  };
912
912
  }>, never, never, never, never>;
913
+ export declare const highlightNodeOrEdge: () => ActionFunction<Context, Events, Events, undefined, Values<{
914
+ hotkeyActorLogic: {
915
+ src: "hotkeyActorLogic";
916
+ logic: HotkeyActorLogic;
917
+ id: "hotkey";
918
+ };
919
+ overlaysActorLogic: {
920
+ src: "overlaysActorLogic";
921
+ logic: OverlaysActorLogic;
922
+ id: "overlays";
923
+ };
924
+ searchActorLogic: {
925
+ src: "searchActorLogic";
926
+ logic: SearchActorLogic;
927
+ id: "search";
928
+ };
929
+ mediaPrintActorLogic: {
930
+ src: "mediaPrintActorLogic";
931
+ logic: MediaPrintActorLogic;
932
+ id: "mediaPrint";
933
+ };
934
+ editorActor: {
935
+ src: "editorActor";
936
+ logic: EditorActorLogic;
937
+ id: "editor";
938
+ };
939
+ }>, never, never, never, never>;
913
940
  export declare const assignToggledFeatures: () => ActionFunction<Context, Events, Events, undefined, Values<{
914
941
  hotkeyActorLogic: {
915
942
  src: "hotkeyActorLogic";
@@ -1,4 +1,6 @@
1
- import { nonNullable, BBox, nonexhaustive, invariant } from '@likec4/core';
1
+ import { exact, nonNullable, nonexhaustive, invariant } from '@likec4/core';
2
+ import { BBox } from '@likec4/core/geometry';
3
+ import { difference } from '@likec4/core/utils';
2
4
  import { nodeToRect } from '@xyflow/system';
3
5
  import { produce } from 'immer';
4
6
  import { hasAtLeast, isTruthy } from 'remeda';
@@ -8,7 +10,7 @@ import { createLayoutConstraints } from '../useLayoutConstraints.js';
8
10
  import { getAligner, toNodeRect } from './aligners.js';
9
11
  import { resetEdgeControlPoints, mergeXYNodesEdges, focusNodesEdges } from './assign.js';
10
12
  import { setViewport, setViewportCenter, cancelFitDiagram, raiseFitDiagram } from './machine.actions.layout.js';
11
- export { assignViewportBefore, fitDiagram, fitFocusedBounds, raiseSetViewport, raiseUpdateView, returnViewportBefore } from './machine.actions.layout.js';
13
+ export { assignViewportBefore, centerOnNodeOrEdge, fitDiagram, fitFocusedBounds, raiseSetViewport, raiseUpdateView, returnViewportBefore } from './machine.actions.layout.js';
12
14
  import { machine } from './machine.setup.js';
13
15
  import { typedSystem, findDiagramNode, findDiagramEdge, viewBounds } from './utils.js';
14
16
  import { Base } from '../../base/Base.js';
@@ -91,15 +93,18 @@ const assignFocusedNode = () => machine.assign(({ event }) => {
91
93
  const resetLastClickedNode = () => machine.assign(() => ({
92
94
  lastClickedNode: null
93
95
  }));
94
- const updateFeatures = () => machine.assign(({ event }) => {
96
+ const updateFeatures = () => machine.assign(({ context, event }) => {
95
97
  assertEvent(event, "update.features");
96
98
  return {
97
- features: { ...event.features }
99
+ features: {
100
+ ...context.features,
101
+ ...event.features
102
+ }
98
103
  };
99
104
  });
100
105
  const updateInputs = () => machine.assign(({ event }) => {
101
106
  assertEvent(event, "update.inputs");
102
- return { ...event.inputs };
107
+ return exact({ ...event.inputs });
103
108
  });
104
109
  const assignXYDataFromView = (view) => machine.assign(({ context, event }) => {
105
110
  let xydata;
@@ -294,7 +299,7 @@ const layoutAlign = (params) => machine.createAction(({ context, event }) => {
294
299
  const xystore = nonNullable(context.xystore, "xystore is not initialized");
295
300
  const { nodeLookup, parentLookup } = xystore.getState();
296
301
  const selectedNodes = new Set(nodeLookup.values().filter((n) => n.selected).map((n) => n.id));
297
- const nodesToAlign = [...selectedNodes.difference(new Set(parentLookup.keys()))];
302
+ const nodesToAlign = [...difference(selectedNodes, new Set(parentLookup.keys()))];
298
303
  if (!hasAtLeast(nodesToAlign, 2)) {
299
304
  console.warn("At least 2 nodes must be selected to align");
300
305
  return;
@@ -361,6 +366,49 @@ const tagHighlight = () => machine.assign(({ context, event }) => {
361
366
  })
362
367
  };
363
368
  });
369
+ const highlightNodeOrEdge = () => machine.assign(({ context, event }) => {
370
+ assertEvent(event, ["highlight.edge", "highlight.node"]);
371
+ switch (event.type) {
372
+ case "highlight.node": {
373
+ const nodeId = event.nodeId;
374
+ const node = context.xynodes.find((n) => n.id === nodeId);
375
+ if (!node) {
376
+ console.warn(`Node with id ${nodeId} not found for highlighting`);
377
+ return {};
378
+ }
379
+ return {
380
+ xynodes: context.xynodes.map((n) => {
381
+ return Base.setDimmed(n, n.id === nodeId ? false : true);
382
+ }),
383
+ xyedges: context.xyedges.map(Base.setData({
384
+ dimmed: true,
385
+ active: false
386
+ }))
387
+ };
388
+ }
389
+ case "highlight.edge": {
390
+ const edgeId = event.edgeId;
391
+ let edge = context.xyedges.find((e) => e.id === edgeId);
392
+ if (!edge) {
393
+ console.warn(`Edge with id ${edgeId} not found for highlighting`);
394
+ return {};
395
+ }
396
+ return {
397
+ xynodes: context.xynodes.map((n) => {
398
+ return Base.setDimmed(n, edge.source !== n.id && edge.target !== n.id);
399
+ }),
400
+ xyedges: context.xyedges.map((e) => {
401
+ return Base.setData(e, {
402
+ dimmed: e.id !== edgeId,
403
+ active: e.id === edgeId
404
+ });
405
+ })
406
+ };
407
+ }
408
+ default:
409
+ nonexhaustive(event);
410
+ }
411
+ });
364
412
  const assignToggledFeatures = () => machine.assign(({ context, event }) => {
365
413
  assertEvent(event, "toggle.feature");
366
414
  const feature = `enable${event.feature}`;
@@ -559,30 +607,39 @@ const openSourceOfFocusedOrLastClickedNode = () => machine.enqueueActions(({ con
559
607
  }
560
608
  });
561
609
  const ensureOverlaysActor = () => machine.enqueueActions(({ enqueue, check, system }) => {
562
- const enableOverlays = check("enabled: Overlays");
563
- const hasRunning = typedSystem(system).overlaysActorRef;
564
- if (enableOverlays && !hasRunning) {
565
- enqueue.spawnChild("overlaysActorLogic", { id: "overlays", systemId: "overlays" });
610
+ const enabled = check("enabled: Overlays");
611
+ const running = typedSystem(system).overlaysActorRef;
612
+ if (enabled && !running) {
613
+ enqueue.spawnChild("overlaysActorLogic", {
614
+ id: "overlays",
615
+ systemId: "overlays",
616
+ syncSnapshot: true
617
+ });
566
618
  return;
567
619
  }
568
- if (!enableOverlays && hasRunning) {
569
- enqueue.sendTo(hasRunning, {
620
+ if (!enabled && running) {
621
+ enqueue.sendTo(running, {
570
622
  type: "close.all"
571
623
  });
572
- enqueue.stopChild("overlays");
624
+ enqueue.stopChild(running);
573
625
  }
574
626
  });
575
- const ensureSearchActor = () => machine.enqueueActions(({ enqueue, context: { features: { enableSearch } }, system }) => {
576
- const hasRunning = typedSystem(system).searchActorRef;
577
- if (enableSearch && !hasRunning) {
578
- enqueue.spawnChild("searchActorLogic", { id: "search", systemId: "search" });
627
+ const ensureSearchActor = () => machine.enqueueActions(({ enqueue, check, system }) => {
628
+ const enabled = check("enabled: Search");
629
+ const running = typedSystem(system).searchActorRef;
630
+ if (enabled && !running) {
631
+ enqueue.spawnChild("searchActorLogic", {
632
+ id: "search",
633
+ systemId: "search",
634
+ syncSnapshot: true
635
+ });
579
636
  return;
580
637
  }
581
- if (!enableSearch && hasRunning) {
582
- enqueue.sendTo(hasRunning, {
638
+ if (!enabled && running) {
639
+ enqueue.sendTo(running, {
583
640
  type: "close"
584
641
  });
585
- enqueue.stopChild("search");
642
+ enqueue.stopChild(running);
586
643
  }
587
644
  });
588
645
  const onEdgeMouseEnter = () => machine.enqueueActions(({ enqueue, context, event }) => {
@@ -764,4 +821,4 @@ const updateView = () => machine.enqueueActions(
764
821
  }
765
822
  );
766
823
 
767
- export { assignDynamicViewVariant, assignFocusedNode, assignLastClickedNode, assignToggledFeatures, assignXYDataFromView, cancelAutoUnfocusTimer, cancelEditing, cancelFitDiagram, closeAllOverlays, closeSearch, disableCompareWithLatest, emitEdgeClick, emitInitialized, emitNavigateTo, emitNodeClick, emitOnLayoutTypeChange, emitOpenSource, emitOpenSourceOfView, emitPaneClick, ensureEditorActor, ensureOverlaysActor, ensureSearchActor, focusOnNodesAndEdges, handleNavigate, layoutAlign, notationsHighlight, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseLeave, onNodeMouseEnter, onNodeMouseLeave, openElementDetails, openOverlay, openSourceOfFocusedOrLastClickedNode, raiseFitDiagram, resetEdgesControlPoints, resetLastClickedNode, sendSynced, setViewport, setViewportCenter, startAutoUnfocusTimer, startEditing, startHotKeyActor, stopEditing, stopEditorActor, stopHotKeyActor, tagHighlight, triggerChange, undimEverything, updateFeatures, updateInputs, updateView };
824
+ export { assignDynamicViewVariant, assignFocusedNode, assignLastClickedNode, assignToggledFeatures, assignXYDataFromView, cancelAutoUnfocusTimer, cancelEditing, cancelFitDiagram, closeAllOverlays, closeSearch, disableCompareWithLatest, emitEdgeClick, emitInitialized, emitNavigateTo, emitNodeClick, emitOnLayoutTypeChange, emitOpenSource, emitOpenSourceOfView, emitPaneClick, ensureEditorActor, ensureOverlaysActor, ensureSearchActor, focusOnNodesAndEdges, handleNavigate, highlightNodeOrEdge, layoutAlign, notationsHighlight, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseLeave, onNodeMouseEnter, onNodeMouseLeave, openElementDetails, openOverlay, openSourceOfFocusedOrLastClickedNode, raiseFitDiagram, resetEdgesControlPoints, resetLastClickedNode, sendSynced, setViewport, setViewportCenter, startAutoUnfocusTimer, startEditing, startHotKeyActor, stopEditing, stopEditorActor, stopHotKeyActor, tagHighlight, triggerChange, undimEverything, updateFeatures, updateInputs, updateView };
@@ -254,6 +254,7 @@ export declare const setViewportCenter: (params?: {
254
254
  params: unknown;
255
255
  };
256
256
  }>, never, EmittedEvents>;
257
+ export declare const centerOnNodeOrEdge: () => ActionFunction<Context, Events, Events, undefined, never, never, never, never, never>;
257
258
  export declare const fitDiagram: (params?: {
258
259
  duration?: number;
259
260
  bounds?: BBox;