@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
@@ -3,12 +3,11 @@ import { nonNullable } from '@likec4/core';
3
3
  import { cx } from '@likec4/styles/css';
4
4
  import { useTimeout, useDebouncedCallback } from '@mantine/hooks';
5
5
  import { useCustomCompareMemo } from '@react-hookz/web';
6
- import { shallowEqual } from 'fast-equals';
7
6
  import { isEmpty } from 'remeda';
8
7
  import { memoNode } from '../base-primitives/memoNode.js';
9
8
  import { BaseXYFlow } from '../base/BaseXYFlow.js';
10
9
  import { useIsReducedGraphics, usePanningAtom } from '../context/RootContainerContext.js';
11
- import { useDiagramActorSnapshot } from '../hooks/useDiagram.js';
10
+ import { useDiagramSnapshot, selectDiagramActor } from '../hooks/useDiagram.js';
12
11
  import { depsShallowEqual, useUpdateEffect } from '../hooks/useUpdateEffect.js';
13
12
  import { BuiltinEdges, BuiltinNodes } from './custom/index.js';
14
13
  import { deriveToggledFeatures } from './state/machine.setup.js';
@@ -53,7 +52,7 @@ const viewportToTopLeft = (ctx) => {
53
52
  zoom: 1
54
53
  };
55
54
  };
56
- const selectXYProps = ({ context: ctx, children }) => {
55
+ const selectXYProps = selectDiagramActor(({ context: ctx, children }) => {
57
56
  const { enableReadOnly } = deriveToggledFeatures(ctx);
58
57
  const isNotEditingEdge = enableReadOnly || children.editor?.getSnapshot().context.editing !== "edge";
59
58
  let nodesDraggable = !enableReadOnly && ctx.nodesDraggable;
@@ -75,8 +74,7 @@ const selectXYProps = ({ context: ctx, children }) => {
75
74
  viewport: viewportToTopLeft(ctx)
76
75
  }
77
76
  };
78
- };
79
- const equalsXYProps = (a, b) => a.enableReadOnly === b.enableReadOnly && a.initialized === b.initialized && a.pannable === b.pannable && a.zoomable === b.zoomable && a.nodesDraggable === b.nodesDraggable && a.nodesSelectable === b.nodesSelectable && a.enableFitView === b.enableFitView && shallowEqual(a.fitViewPadding, b.fitViewPadding) && shallowEqual(a.nodes, b.nodes) && shallowEqual(a.edges, b.edges) && shallowEqual(a.viewport ?? null, b.viewport ?? null);
77
+ });
80
78
  function LikeC4DiagramXYFlow({
81
79
  background = "dots",
82
80
  reactFlowProps = {},
@@ -93,7 +91,7 @@ function LikeC4DiagramXYFlow({
93
91
  nodesDraggable,
94
92
  nodesSelectable,
95
93
  ...props
96
- } = useDiagramActorSnapshot(selectXYProps, equalsXYProps);
94
+ } = useDiagramSnapshot(selectXYProps);
97
95
  const {
98
96
  onNodeContextMenu,
99
97
  onCanvasContextMenu,
@@ -108,7 +106,7 @@ function LikeC4DiagramXYFlow({
108
106
  }, isReducedGraphics ? 200 : 800), notPanning = useDebouncedCallback(() => {
109
107
  isPanning.clear();
110
108
  $isPanning.set(false);
111
- }, { delay: 200 }), onMove = useCallbackRef((event) => {
109
+ }, 200), onMove = useCallbackRef((event) => {
112
110
  if (!event) {
113
111
  isPanning.clear();
114
112
  return;
@@ -217,8 +217,7 @@ const RelationshipEdge = memoEdge((props) => {
217
217
  onStartMove: onControlPointerStartMove,
218
218
  onCancelMove: onControlPointerCancelMove,
219
219
  onFinishMove: onControlPointerFinishMove,
220
- onDelete: onControlPointerDelete,
221
- zIndex: 9999
220
+ onDelete: onControlPointerDelete
222
221
  }
223
222
  )
224
223
  ] });
@@ -232,35 +231,35 @@ function ControlPoints({
232
231
  onStartMove,
233
232
  onCancelMove,
234
233
  onFinishMove,
235
- onDelete,
236
- zIndex
234
+ onDelete
237
235
  }) {
238
236
  const xyflowStore = useXYStoreApi();
239
237
  const xyflow = useXYFlow();
240
238
  const edgeId = edgeProps.data.id;
239
+ const controlPointsRef = useRef(controlPoints);
240
+ controlPointsRef.current = controlPoints;
241
241
  const onLmbControlPointerDown = (index, e, domNode) => {
242
242
  let hasMoved = false;
243
- let pointer = { x: e.clientX, y: e.clientY };
243
+ let initialPoint = { x: e.clientX, y: e.clientY };
244
+ let clientPoint = { ...initialPoint };
244
245
  let animationFrameId = null;
245
- let cp = controlPoints;
246
+ let cp = [...controlPointsRef.current];
246
247
  const onPointerMove = (e2) => {
247
- const clientPoint = {
248
- x: e2.clientX,
249
- y: e2.clientY
250
- };
251
- if (!isSamePoint(pointer, clientPoint)) {
248
+ clientPoint.x = e2.clientX;
249
+ clientPoint.y = e2.clientY;
250
+ const isDragging = !isSamePoint(initialPoint, clientPoint);
251
+ if (isDragging) {
252
252
  if (!hasMoved) {
253
253
  hasMoved = true;
254
254
  onStartMove();
255
255
  }
256
- pointer = clientPoint;
257
256
  animationFrameId ??= requestAnimationFrame(() => {
258
257
  animationFrameId = null;
259
- cp = cp.slice();
260
- const { x, y } = xyflow.screenToFlowPosition(pointer, { snapToGrid: false });
258
+ const { x, y } = xyflow.screenToFlowPosition(clientPoint, { snapToGrid: false });
259
+ cp = [...cp];
261
260
  cp[index] = {
262
- x: Math.round(x),
263
- y: Math.round(y)
261
+ x: Math.trunc(x),
262
+ y: Math.trunc(y)
264
263
  };
265
264
  onMove(cp);
266
265
  });
@@ -275,6 +274,9 @@ function ControlPoints({
275
274
  domNode.removeEventListener("click", stopAndPrevent, {
276
275
  capture: true
277
276
  });
277
+ if (animationFrameId !== null) {
278
+ cancelAnimationFrame(animationFrameId);
279
+ }
278
280
  if (hasMoved) {
279
281
  onFinishMove(cp);
280
282
  } else {
@@ -294,11 +296,11 @@ function ControlPoints({
294
296
  });
295
297
  };
296
298
  const onRmbControlPointerDown = (index, e) => {
297
- if (controlPoints.length <= 1 || index >= controlPoints.length) {
299
+ const newControlPoints = [...controlPointsRef.current];
300
+ if (newControlPoints.length <= 1 || index >= newControlPoints.length) {
298
301
  return;
299
302
  }
300
303
  stopAndPrevent(e);
301
- const newControlPoints = controlPoints.slice();
302
304
  newControlPoints.splice(index, 1);
303
305
  setTimeout(() => {
304
306
  onDelete(newControlPoints);
@@ -329,12 +331,12 @@ function ControlPoints({
329
331
  }
330
332
  });
331
333
  const onControlPointerDblClick = useCallbackRef((e) => {
332
- const { domNode } = xyflowStore.getState();
333
- if (!domNode || e.pointerType !== "mouse") {
334
+ if (e.pointerType !== "mouse") {
334
335
  return;
335
336
  }
336
337
  const index = parseFloat(e.currentTarget.getAttribute("data-control-point-index") || "");
337
338
  if (isNaN(index)) {
339
+ console.error(e.currentTarget);
338
340
  throw new Error("data-control-point-index is not a number");
339
341
  }
340
342
  onRmbControlPointerDown(index, e);
@@ -345,10 +347,6 @@ function ControlPoints({
345
347
  component: "svg",
346
348
  className: controlPointsContainer,
347
349
  ...edgeProps,
348
- style: {
349
- ...edgeProps.style,
350
- zIndex
351
- },
352
350
  children: /* @__PURE__ */ jsx(
353
351
  "g",
354
352
  {
@@ -9,7 +9,8 @@ const controlPointsContainer = css({
9
9
  mixBlendMode: {
10
10
  _dark: "screen",
11
11
  _light: "multiply"
12
- }
12
+ },
13
+ zIndex: "[100]"
13
14
  });
14
15
  const controlPoint = css({
15
16
  fill: `[var(--xy-edge-stroke)]`,
@@ -1,13 +1,14 @@
1
- import { nonNullable, vector } from '@likec4/core';
1
+ import { vector } from '@likec4/core/geometry';
2
+ import { nonNullable } from '@likec4/core/utils';
2
3
  import { getNodeDimensions } from '@xyflow/system';
3
4
  import { line, curveCatmullRomOpen } from 'd3-shape';
4
5
  import { shallowEqual } from 'fast-equals';
5
- import { useCallback, useMemo } from 'react';
6
+ import { useCallback } from 'react';
6
7
  import { isTruthy, first, last } from 'remeda';
7
8
  import { useXYStore } from '../../../hooks/useXYFlow.js';
8
9
  import { bezierPath, getNodeIntersectionFromCenterToPoint } from '../../../utils/xyflow.js';
9
10
 
10
- const curve = line().curve(curveCatmullRomOpen.alpha(0.7)).x((d) => Math.round(d.x)).y((d) => Math.round(d.y));
11
+ const curve = line().curve(curveCatmullRomOpen.alpha(0.7)).x((d) => Math.trunc(d.x)).y((d) => Math.trunc(d.y));
11
12
  function useRelationshipEdgePath({
12
13
  props: {
13
14
  sourceX,
@@ -31,63 +32,47 @@ function useRelationshipEdgePath({
31
32
  const sourceNode = getNodeDimensions(nonNullable(nodeLookup.get(source), `source node ${source} not found`));
32
33
  const targetNode = getNodeDimensions(nonNullable(nodeLookup.get(target), `target node ${target} not found`));
33
34
  return [
34
- Math.round(sourceNode.width),
35
- Math.round(sourceNode.height),
36
- Math.round(targetNode.width),
37
- Math.round(targetNode.height)
35
+ Math.ceil(sourceNode.width),
36
+ Math.ceil(sourceNode.height),
37
+ Math.ceil(targetNode.width),
38
+ Math.ceil(targetNode.height)
38
39
  ];
39
40
  }, [source, target]),
40
41
  shallowEqual
41
42
  );
42
43
  const isModified = isTruthy(data.controlPoints) || isControlPointDragging;
43
- return useMemo(
44
- () => {
45
- if (!isModified) {
46
- return bezierPath(data.points);
47
- }
48
- const sourceCenterPos = { x: sourceX, y: sourceY };
49
- const targetCenterPos = { x: targetX, y: targetY };
50
- const sourceNd = {
51
- ...vector(sourceX, sourceY).subtract(vector(sourceNodeWidth, sourceNodeHeight).divide(2)).round().toObject(),
52
- width: sourceNodeWidth,
53
- height: sourceNodeHeight
54
- };
55
- const targetNd = {
56
- ...vector(targetX, targetY).subtract(vector(targetNodeWidth, targetNodeHeight).divide(2)).round().toObject(),
57
- width: targetNodeWidth,
58
- height: targetNodeHeight
59
- };
60
- const nodeMargin = 6;
61
- const points = data.dir === "back" ? [
62
- targetCenterPos,
63
- getNodeIntersectionFromCenterToPoint(targetNd, first(controlPoints) ?? sourceCenterPos, nodeMargin),
64
- ...controlPoints,
65
- getNodeIntersectionFromCenterToPoint(sourceNd, last(controlPoints) ?? targetCenterPos, nodeMargin),
66
- sourceCenterPos
67
- ] : [
68
- sourceCenterPos,
69
- getNodeIntersectionFromCenterToPoint(sourceNd, first(controlPoints) ?? targetCenterPos, nodeMargin),
70
- ...controlPoints,
71
- getNodeIntersectionFromCenterToPoint(targetNd, last(controlPoints) ?? sourceCenterPos, nodeMargin),
72
- targetCenterPos
73
- ];
74
- return nonNullable(curve(points));
75
- },
76
- [
77
- data.points,
78
- isModified,
79
- isModified ? sourceX : void 0,
80
- isModified ? sourceY : void 0,
81
- isModified ? targetX : void 0,
82
- isModified ? targetY : void 0,
83
- isModified ? sourceNodeWidth : void 0,
84
- isModified ? sourceNodeHeight : void 0,
85
- isModified ? targetNodeWidth : void 0,
86
- isModified ? targetNodeHeight : void 0,
87
- isModified ? data.dir : void 0,
88
- isModified ? controlPoints : void 0
89
- ]
90
- );
44
+ if (!isModified) {
45
+ return bezierPath(data.points);
46
+ }
47
+ const sourceCenterPos = vector(sourceX, sourceY).trunc();
48
+ const targetCenterPos = vector(targetX, targetY).trunc();
49
+ const sourceNd = {
50
+ // Calculate node top-left from center position
51
+ ...sourceCenterPos.subtract(vector(sourceNodeWidth, sourceNodeHeight).divide(2)).trunc().toObject(),
52
+ width: sourceNodeWidth,
53
+ height: sourceNodeHeight
54
+ };
55
+ const targetNd = {
56
+ // Calculate node top-left from center position
57
+ ...targetCenterPos.subtract(vector(targetNodeWidth, targetNodeHeight).divide(2)).trunc().toObject(),
58
+ width: targetNodeWidth,
59
+ height: targetNodeHeight
60
+ };
61
+ const nodeMargin = 6;
62
+ const points = data.dir === "back" ? [
63
+ targetCenterPos,
64
+ getNodeIntersectionFromCenterToPoint(targetNd, first(controlPoints) ?? sourceCenterPos, nodeMargin),
65
+ ...controlPoints,
66
+ getNodeIntersectionFromCenterToPoint(sourceNd, last(controlPoints) ?? targetCenterPos, nodeMargin),
67
+ sourceCenterPos
68
+ ] : [
69
+ sourceCenterPos,
70
+ getNodeIntersectionFromCenterToPoint(sourceNd, first(controlPoints) ?? targetCenterPos, nodeMargin),
71
+ ...controlPoints,
72
+ getNodeIntersectionFromCenterToPoint(targetNd, last(controlPoints) ?? sourceCenterPos, nodeMargin),
73
+ targetCenterPos
74
+ ];
75
+ return nonNullable(curve(points));
91
76
  }
92
77
 
93
78
  export { useRelationshipEdgePath };
@@ -5,8 +5,8 @@ import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
5
5
  import '@xstate/react';
6
6
  import 'fast-equals';
7
7
  import { useDiagram } from '../../../hooks/safeContext.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 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 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';
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
  import { ElementActionButtons } from '../../../base-primitives/element/ElementActionButtons.js';
11
11
 
12
12
  function ElementActions({
@@ -1,6 +1,5 @@
1
1
  import { Types } from '../../types';
2
2
  export type NodeDriftsProps = {
3
3
  nodeProps: Types.NodeProps;
4
- position?: 'top' | 'bottom';
5
4
  };
6
- export declare function NodeDrifts({ nodeProps: { data }, position, }: NodeDriftsProps): import("react/jsx-runtime").JSX.Element | null;
5
+ export declare function NodeDrifts({ nodeProps: { data }, }: NodeDriftsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,17 +1,13 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import { Box } from '@likec4/styles/jsx';
3
- import { Notification, Text } from '@mantine/core';
4
- import { Position, NodeToolbar } from '@xyflow/react';
5
3
 
6
4
  function NodeDrifts({
7
- nodeProps: { data },
8
- position = "bottom"
5
+ nodeProps: { data }
9
6
  }) {
10
7
  const drifts = data.drifts;
11
8
  if (!drifts || drifts.length === 0) {
12
9
  return null;
13
10
  }
14
- const toolbarPosition = position === "top" ? Position.Top : Position.Bottom;
15
11
  return /* @__PURE__ */ jsx(
16
12
  Box,
17
13
  {
@@ -24,20 +20,7 @@ function NodeDrifts({
24
20
  outlineStyle: "dashed",
25
21
  outlineOffset: "1.5"
26
22
  }
27
- },
28
- children: /* @__PURE__ */ jsx(NodeToolbar, { isVisible: data.hovered === true, align: "start", position: toolbarPosition, children: /* @__PURE__ */ jsx(
29
- Notification,
30
- {
31
- color: "orange",
32
- withBorder: false,
33
- withCloseButton: false,
34
- title: "Changes:",
35
- children: drifts.map((drift) => /* @__PURE__ */ jsxs(Text, { mt: 2, size: "sm", lh: "xs", children: [
36
- "- ",
37
- drift
38
- ] }, drift))
39
- }
40
- ) })
23
+ }
41
24
  }
42
25
  );
43
26
  }
@@ -0,0 +1,6 @@
1
+ import { BaseNodePropsWithData } from '../../../base/types';
2
+ import { Types } from '../../types';
3
+ type RequiredData = Pick<Types.NodeData, 'id' | 'notes' | 'width' | 'height' | 'x' | 'y'>;
4
+ export type NodeNotesProps = BaseNodePropsWithData<RequiredData>;
5
+ export declare function NodeNotes({ data }: NodeNotesProps): import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,286 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { hasProp, RichText } from '@likec4/core';
3
+ import { stringHash } from '@likec4/core/utils';
4
+ import { cx, css } from '@likec4/styles/css';
5
+ import { Box } from '@likec4/styles/jsx';
6
+ import { nodeNotes } from '@likec4/styles/recipes';
7
+ import { ScrollAreaAutosize } from '@mantine/core';
8
+ import { useDisclosure } from '@mantine/hooks';
9
+ import { ViewportPortal } from '@xyflow/react';
10
+ import { AnimatePresence, m } from 'motion/react';
11
+ import { isEmptyish, clamp } from 'remeda';
12
+ import { useCallbackRef } from '../../../hooks/useCallbackRef.js';
13
+ import { Markdown } from '../../../base-primitives/Markdown.js';
14
+ import { useOnDiagramEvent } from '../../../hooks/useDiagram.js';
15
+
16
+ function NodeNotes({ data }) {
17
+ if (!hasProp(data, "notes") || isEmptyish(data.notes.md || data.notes.txt)) {
18
+ return null;
19
+ }
20
+ return /* @__PURE__ */ jsx(NodeNotesInternal2, { data });
21
+ }
22
+ function stopPropagation(e) {
23
+ e.nativeEvent.stopImmediatePropagation();
24
+ e.stopPropagation();
25
+ }
26
+ function NodeNotesInternal2({ data }) {
27
+ return /* @__PURE__ */ jsx(NodeNotesInternal, { data });
28
+ }
29
+ function NodeNotesInternal({ data }) {
30
+ const markdown = data.notes;
31
+ const width = clamp(data.width ?? 0, {
32
+ min: 250,
33
+ max: 500
34
+ });
35
+ clamp(data.height ?? 0, {
36
+ min: 200,
37
+ max: 600
38
+ });
39
+ const [expanded, handlers] = useDisclosure(false, {});
40
+ const id = stringHash(data.id + (markdown.md ?? markdown.txt));
41
+ const onClickCapture = useCallbackRef((e) => {
42
+ if (e) {
43
+ e.preventDefault();
44
+ if ("nativeEvent" in e) {
45
+ e.nativeEvent.stopImmediatePropagation();
46
+ }
47
+ e.stopPropagation();
48
+ }
49
+ handlers.toggle();
50
+ });
51
+ const hovered = data.hovered ?? false;
52
+ const layoutDependency = expanded;
53
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
54
+ /* @__PURE__ */ jsxs(AnimatePresence, { children: [
55
+ /* @__PURE__ */ jsxs(
56
+ m.div,
57
+ {
58
+ className: cx(
59
+ "nopan nodrag",
60
+ nodeNotes({ opened: expanded })
61
+ ),
62
+ variants: variants.root,
63
+ initial: "initial",
64
+ animate: expanded ? "expanded" : hovered ? "hovered" : "initial",
65
+ whileHover: "whileHover",
66
+ exit: "exit",
67
+ ...!expanded && { onPointerDownCapture: onClickCapture },
68
+ onMouseDownCapture: onClickCapture,
69
+ onClickCapture,
70
+ onClick: stopPropagation,
71
+ "data-state": expanded ? "expanded" : "collapsed",
72
+ children: [
73
+ /* @__PURE__ */ jsx(
74
+ m.div,
75
+ {
76
+ variants: variants.paper1,
77
+ className: "__paper __paper-back"
78
+ },
79
+ "paper-back"
80
+ ),
81
+ !expanded && /* @__PURE__ */ jsx(
82
+ m.div,
83
+ {
84
+ layout: true,
85
+ layoutId: id,
86
+ variants: variants.paper2,
87
+ "data-state": expanded ? "expanded" : "collapsed",
88
+ className: "__paper __paper-front"
89
+ },
90
+ id
91
+ )
92
+ ]
93
+ },
94
+ `node-notes-${id}`
95
+ ),
96
+ expanded && /* @__PURE__ */ jsx(ViewportPortal, { children: /* @__PURE__ */ jsx(
97
+ m.div,
98
+ {
99
+ layout: true,
100
+ layoutDependency,
101
+ layoutId: id,
102
+ className: css({
103
+ position: "absolute",
104
+ zIndex: 300,
105
+ top: "0",
106
+ left: "0",
107
+ display: "flex",
108
+ pointerEvents: "all",
109
+ rounded: "sm",
110
+ backgroundColor: "likec4.overlay.body",
111
+ padding: "0",
112
+ alignItems: "stretch",
113
+ justifyContent: "stretch",
114
+ overflow: "hidden",
115
+ width: "fit-content",
116
+ height: "fit-content",
117
+ maxHeight: "70cqh",
118
+ maxWidth: "50cqw"
119
+ // minHeight: '60cqh',
120
+ }),
121
+ "data-likec4-notes": id,
122
+ style: {
123
+ top: data.y + 20,
124
+ left: data.x + 10,
125
+ maxWidth: `min(calc(${width}px * 2), 50cqw)`
126
+ // minHeight: `max(${height}px, 60cqh)`,
127
+ // maxHeight: height,
128
+ },
129
+ onMouseDownCapture: stopPropagation,
130
+ onClickCapture: stopPropagation,
131
+ onClick: stopPropagation,
132
+ children: /* @__PURE__ */ jsx(
133
+ ScrollAreaAutosize,
134
+ {
135
+ component: m.div,
136
+ className: cx(
137
+ "nowheel",
138
+ css({
139
+ flex: "1",
140
+ padding: "xs",
141
+ paddingRight: "xxs"
142
+ })
143
+ ),
144
+ children: /* @__PURE__ */ jsx(
145
+ Markdown,
146
+ {
147
+ className: css({
148
+ paddingRight: "xxs"
149
+ }),
150
+ value: RichText.from(markdown)
151
+ }
152
+ )
153
+ }
154
+ )
155
+ },
156
+ id
157
+ ) }, "portal")
158
+ ] }),
159
+ expanded && /* @__PURE__ */ jsx(
160
+ Catch,
161
+ {
162
+ data,
163
+ onCatchClick: onClickCapture
164
+ }
165
+ )
166
+ ] });
167
+ }
168
+ const base_paper1 = {
169
+ rotateZ: "-5deg",
170
+ y: 0,
171
+ x: 1,
172
+ scale: 1,
173
+ originX: "55%",
174
+ originY: "80%"
175
+ };
176
+ const base_paper2 = {
177
+ rotateZ: "3deg",
178
+ y: -2,
179
+ scale: 1,
180
+ backgroundColor: "color-mix(in oklab, var(--likec4-palette-fill) 8%, #FFF)",
181
+ originX: "45%",
182
+ originY: "80%"
183
+ };
184
+ const variants = {
185
+ root: {
186
+ initial: {
187
+ ["--paper-bg"]: "color-mix(in oklab, var(--likec4-palette-fill) 50%, #EEE)"
188
+ },
189
+ hovered: {},
190
+ whileHover: {
191
+ ["--paper-bg"]: "color-mix(in oklab, var(--likec4-palette-fill) 3%, #FFF)"
192
+ },
193
+ exit: {
194
+ ["--paper-bg"]: "color-mix(in oklab, var(--likec4-palette-fill) 50%, #EEE)"
195
+ }
196
+ },
197
+ // PAPER BACK
198
+ paper1: {
199
+ initial: {
200
+ ...base_paper1,
201
+ rotateZ: "-3.5deg",
202
+ y: 1,
203
+ scale: 0.95
204
+ },
205
+ hovered: {
206
+ ...base_paper1
207
+ },
208
+ whileHover: {
209
+ ...base_paper1,
210
+ ["--paper-bg"]: "color-mix(in oklab, var(--likec4-palette-fill) 3%, #FFF)",
211
+ scale: 1.04
212
+ },
213
+ expanded: {
214
+ ...base_paper1,
215
+ y: [0, 1, 20],
216
+ scale: 0.95
217
+ },
218
+ exit: {
219
+ ...base_paper1,
220
+ rotateZ: "-3.5deg",
221
+ y: 1,
222
+ scale: 0.95
223
+ }
224
+ },
225
+ // PAPER FRONT
226
+ paper2: {
227
+ initial: {
228
+ ...base_paper2,
229
+ rotateZ: "2deg",
230
+ y: 2,
231
+ scale: 0.95,
232
+ backgroundColor: "color-mix(in oklab, var(--likec4-palette-fill) 50%, #EEE)"
233
+ },
234
+ hovered: {
235
+ ...base_paper2
236
+ },
237
+ whileHover: {
238
+ ...base_paper2,
239
+ scale: 1.08
240
+ },
241
+ expanded: {
242
+ ...base_paper2,
243
+ y: [0, 1, 20],
244
+ scale: 0.95
245
+ },
246
+ exit: {
247
+ ...base_paper2,
248
+ rotateZ: "2deg",
249
+ y: 2,
250
+ scale: 0.95,
251
+ backgroundColor: "color-mix(in oklab, var(--likec4-palette-fill) 50%, #EEE)"
252
+ }
253
+ }
254
+ };
255
+ function Catch({
256
+ data,
257
+ onCatchClick
258
+ }) {
259
+ useOnDiagramEvent("paneClick", () => {
260
+ onCatchClick();
261
+ });
262
+ return /* @__PURE__ */ jsx(ViewportPortal, { children: /* @__PURE__ */ jsx(
263
+ Box,
264
+ {
265
+ css: {
266
+ display: "block",
267
+ position: "absolute",
268
+ zIndex: 200,
269
+ pointerEvents: "all",
270
+ left: "0",
271
+ top: "0",
272
+ cursor: "zoom-out"
273
+ },
274
+ style: {
275
+ transform: `translate(${data.x - 40}px, ${data.y - 40}px)`,
276
+ width: (data.width ?? 250) + 80,
277
+ height: (data.height ?? 200) + 80
278
+ },
279
+ onMouseDownCapture: onCatchClick,
280
+ onClickCapture: onCatchClick,
281
+ onClick: stopPropagation
282
+ }
283
+ ) }, "catch-all");
284
+ }
285
+
286
+ export { NodeNotes };
@@ -6,6 +6,7 @@ import { isTruthy } from 'remeda';
6
6
  import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
7
7
  import { ElementActions } from './ElementActions.js';
8
8
  import { NodeDrifts } from './NodeDrifts.js';
9
+ import { NodeNotes } from './NodeNotes.js';
9
10
  import { ElementDetailsButtonWithHandler } from './nodes.js';
10
11
  import { ElementToolbar } from './toolbar/ElementToolbar.js';
11
12
  import { ElementNodeContainer } from '../../../base-primitives/element/ElementNodeContainer.js';
@@ -70,7 +71,7 @@ const ActorStepPort = ({
70
71
  };
71
72
  const hasModelFqn = (node) => "modelFqn" in node.data && isTruthy(node.data.modelFqn);
72
73
  function SequenceActorNode(props) {
73
- const { enableElementDetails, enableReadOnly, enableCompareWithLatest } = useEnabledFeatures();
74
+ const { enableElementDetails, enableReadOnly, enableCompareWithLatest, enableNotes } = useEnabledFeatures();
74
75
  const data = props.data;
75
76
  const {
76
77
  id,
@@ -114,7 +115,8 @@ function SequenceActorNode(props) {
114
115
  /* @__PURE__ */ jsx(ElementActions, { ...props }),
115
116
  enableElementDetails && /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { id, data }),
116
117
  !enableReadOnly && /* @__PURE__ */ jsx(ElementToolbar, { ...props })
117
- ] })
118
+ ] }),
119
+ enableNotes && /* @__PURE__ */ jsx(NodeNotes, { ...props })
118
120
  ] }),
119
121
  ports.map((p) => /* @__PURE__ */ jsx(ActorStepPort, { port: p, data: props.data }, p.id))
120
122
  ] });