@likec4/diagram 1.47.0 → 1.49.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 (389) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +8 -10
  3. package/adhoc-editor/package.json +4 -0
  4. package/dist/LikeC4Diagram.d.ts +2 -1
  5. package/dist/LikeC4Diagram.js +85 -81
  6. package/dist/LikeC4Diagram.props.d.ts +10 -6
  7. package/dist/LikeC4ModelProvider.d.ts +4 -4
  8. package/dist/LikeC4ModelProvider.js +2 -2
  9. package/dist/LikeC4ProjectsOverview.d.ts +3 -2
  10. package/dist/LikeC4ProjectsProvider.d.ts +2 -1
  11. package/dist/LikeC4ProjectsProvider.js +10 -8
  12. package/dist/LikeC4Styles.d.ts +3 -6
  13. package/dist/LikeC4Styles.js +44 -43
  14. package/dist/LikeC4View.d.ts +22 -1
  15. package/dist/LikeC4View.js +40 -25
  16. package/dist/ReactLikeC4.d.ts +13 -2
  17. package/dist/ReactLikeC4.js +8 -4
  18. package/dist/StaticLikeC4Diagram.d.ts +2 -1
  19. package/dist/StaticLikeC4Diagram.js +1 -0
  20. package/dist/_virtual/store-1b2fbb72.cjs.js +3 -0
  21. package/dist/_virtual/xstate-store-react.cjs.js +5 -0
  22. package/dist/_virtual/xstate-store-react.cjs2.js +3 -0
  23. package/dist/adhoc-editor/EditorPanel.d.ts +1 -0
  24. package/dist/adhoc-editor/EditorPanel.js +105 -0
  25. package/dist/adhoc-editor/ElementsTree.d.ts +2 -0
  26. package/dist/adhoc-editor/ElementsTree.js +142 -0
  27. package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +4 -0
  28. package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +74 -0
  29. package/dist/adhoc-editor/components/Tree.d.ts +48 -0
  30. package/dist/adhoc-editor/components/Tree.js +296 -0
  31. package/dist/adhoc-editor/hooks.d.ts +14 -0
  32. package/dist/adhoc-editor/hooks.js +29 -0
  33. package/dist/adhoc-editor/index.d.ts +2 -0
  34. package/dist/adhoc-editor/index.js +1 -0
  35. package/dist/adhoc-editor/state/ActorProvider.d.ts +5 -0
  36. package/dist/adhoc-editor/state/ActorProvider.js +40 -0
  37. package/dist/adhoc-editor/state/actor.d.ts +13 -0
  38. package/dist/adhoc-editor/state/actor.editor.d.ts +56 -0
  39. package/dist/adhoc-editor/state/actor.editor.js +205 -0
  40. package/dist/adhoc-editor/state/actor.js +16 -0
  41. package/dist/adhoc-editor/state/actor.layouter.d.ts +51 -0
  42. package/dist/adhoc-editor/state/actor.layouter.js +70 -0
  43. package/dist/adhoc-editor/state/actor.types.d.ts +63 -0
  44. package/dist/adhoc-editor/state/actor.types.js +29 -0
  45. package/dist/adhoc-editor/state/panel.d.ts +95 -0
  46. package/dist/adhoc-editor/state/panel.js +139 -0
  47. package/dist/adhoc-editor/state/utils.d.ts +17 -0
  48. package/dist/adhoc-editor/state/utils.js +32 -0
  49. package/dist/adhoc-editor/useElementsTree.d.ts +18 -0
  50. package/dist/adhoc-editor/useElementsTree.js +130 -0
  51. package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +6 -0
  52. package/dist/base/const.d.ts +2 -0
  53. package/dist/base/const.js +2 -1
  54. package/dist/base/updateEdges.js +26 -3
  55. package/dist/base/updateNodes.js +8 -5
  56. package/dist/base-primitives/Markdown.d.ts +1 -1
  57. package/dist/base-primitives/Markdown.js +1 -1
  58. package/dist/base-primitives/NodeHandles.d.ts +4 -2
  59. package/dist/base-primitives/NodeHandles.js +46 -19
  60. package/dist/base-primitives/compound/CompoundActionButton.js +28 -12
  61. package/dist/base-primitives/compound/CompoundDetailsButton.js +24 -9
  62. package/dist/base-primitives/compound/CompoundNodeContainer.js +11 -8
  63. package/dist/base-primitives/compound/CompoundTitle.js +1 -2
  64. package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
  65. package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
  66. package/dist/base-primitives/edge/EdgeContainer.js +5 -2
  67. package/dist/base-primitives/edge/EdgeLabel.js +3 -4
  68. package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +2 -1
  69. package/dist/base-primitives/edge/EdgeLabelContainer.js +17 -20
  70. package/dist/base-primitives/element/ElementActionButtons.js +57 -59
  71. package/dist/base-primitives/element/ElementData.d.ts +7 -7
  72. package/dist/base-primitives/element/ElementData.js +61 -48
  73. package/dist/base-primitives/element/ElementDetailsButton.js +48 -18
  74. package/dist/base-primitives/element/ElementNodeContainer.d.ts +5 -5
  75. package/dist/base-primitives/element/ElementNodeContainer.js +24 -10
  76. package/dist/base-primitives/element/ElementShape.d.ts +2 -2
  77. package/dist/base-primitives/element/ElementShape.js +70 -7
  78. package/dist/base-primitives/element/ElementTags.d.ts +6 -2
  79. package/dist/base-primitives/element/ElementTags.js +55 -32
  80. package/dist/base-primitives/index.d.ts +1 -1
  81. package/dist/base-primitives/memoEdge.js +1 -1
  82. package/dist/base-primitives/memoNode.js +1 -1
  83. package/dist/components/ErrorFallback.js +1 -1
  84. package/dist/components/Link.js +3 -3
  85. package/dist/components/NavigationPanel.d.ts +2 -2
  86. package/dist/components/NavigationPanel.js +5 -26
  87. package/dist/components/PortalToContainer.js +3 -4
  88. package/dist/components/RootContainer.js +9 -19
  89. package/dist/components/ViewNotFound.d.ts +3 -3
  90. package/dist/components/ViewNotFound.js +30 -26
  91. package/dist/context/CurrentViewModelProvider.d.ts +2 -0
  92. package/dist/context/CurrentViewModelProvider.js +12 -0
  93. package/dist/context/DefaultMantineProvider.d.ts +2 -0
  94. package/dist/context/DefaultMantineProvider.js +75 -0
  95. package/dist/context/DiagramEventHandlers.d.ts +5 -5
  96. package/dist/context/DiagramEventHandlers.js +10 -4
  97. package/dist/context/DiagramFeatures.d.ts +8 -7
  98. package/dist/context/DiagramFeatures.js +16 -13
  99. package/dist/context/EnsureMantine.d.ts +0 -3
  100. package/dist/context/EnsureMantine.js +3 -4
  101. package/dist/context/FramerMotionConfig.d.ts +1 -3
  102. package/dist/context/IconRenderer.d.ts +19 -4
  103. package/dist/context/IconRenderer.js +52 -25
  104. package/dist/context/LikeC4ModelContext.d.ts +10 -5
  105. package/dist/context/LikeC4ModelContext.js +11 -3
  106. package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
  107. package/dist/context/LikeC4ProjectsContext.js +6 -2
  108. package/dist/context/RootContainerContext.d.ts +10 -3
  109. package/dist/context/RootContainerContext.js +8 -3
  110. package/dist/context/TagStylesContext.js +13 -5
  111. package/dist/custom/hooks.d.ts +2 -2
  112. package/dist/custom/index.d.ts +1 -1
  113. package/dist/custom/index.js +16 -15
  114. package/dist/editor/LikeC4EditorCallbacks.d.ts +18 -0
  115. package/dist/editor/LikeC4EditorCallbacks.js +5 -0
  116. package/dist/editor/LikeC4EditorProvider.d.ts +30 -18
  117. package/dist/editor/LikeC4EditorProvider.js +3 -3
  118. package/dist/editor/applyChangesToManualLayout.js +7 -6
  119. package/dist/editor/editorActor.actions.d.ts +25 -25
  120. package/dist/editor/editorActor.actions.js +22 -22
  121. package/dist/editor/editorActor.setup.d.ts +84 -0
  122. package/dist/editor/editorActor.setup.js +38 -0
  123. package/dist/editor/editorActor.states.d.ts +9 -0
  124. package/dist/editor/{editorActor.js → editorActor.states.js} +21 -72
  125. package/dist/editor/index.d.ts +4 -3
  126. package/dist/editor/useEditorActorLogic.d.ts +2 -565
  127. package/dist/editor/useEditorActorLogic.js +14 -21
  128. package/dist/hooks/index.d.ts +3 -3
  129. package/dist/hooks/safeContext.d.ts +4 -5
  130. package/dist/hooks/useCallbackRef.d.ts +6 -0
  131. package/dist/hooks/useCallbackRef.js +7 -6
  132. package/dist/hooks/useCurrentView.js +5 -10
  133. package/dist/hooks/useCurrentViewModel.d.ts +8 -2
  134. package/dist/hooks/useCurrentViewModel.js +3 -7
  135. package/dist/hooks/useDiagram.d.ts +9 -1
  136. package/dist/hooks/useDiagram.js +10 -4
  137. package/dist/hooks/useDiagramCompareLayout.d.ts +6 -6
  138. package/dist/hooks/useDiagramCompareLayout.js +1 -1
  139. package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
  140. package/dist/hooks/useLikeC4ElementsTree.js +2 -2
  141. package/dist/hooks/useLikeC4Model.d.ts +6 -2
  142. package/dist/hooks/useLikeC4Model.js +7 -9
  143. package/dist/hooks/useLikeC4Project.d.ts +4 -6
  144. package/dist/hooks/useLikeC4Project.js +19 -31
  145. package/dist/hooks/useLikeC4Styles.js +3 -9
  146. package/dist/hooks/useMantinePortalProps.d.ts +1 -1
  147. package/dist/hooks/useMediaPrint.d.ts +0 -2
  148. package/dist/hooks/useOverlaysActor.js +4 -4
  149. package/dist/hooks/useSearchActor.js +4 -4
  150. package/dist/hooks/useSetState.d.ts +6 -1
  151. package/dist/hooks/useSetState.js +7 -4
  152. package/dist/hooks/useXYFlow.d.ts +7 -1
  153. package/dist/hooks/useXYFlow.js +4 -4
  154. package/dist/index.d.ts +5 -4
  155. package/dist/index.js +3 -1
  156. package/dist/likec4diagram/DiagramUI.js +1 -3
  157. package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
  158. package/dist/likec4diagram/DiagramXYFlow.js +29 -18
  159. package/dist/likec4diagram/convert-to-xyflow.d.ts +2 -1
  160. package/dist/likec4diagram/convert-to-xyflow.js +2 -6
  161. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +34 -37
  162. package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
  163. package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
  164. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +3 -0
  165. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +52 -34
  166. package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +1 -2
  167. package/dist/likec4diagram/custom/nodes/ElementActions.js +7 -10
  168. package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -2
  169. package/dist/likec4diagram/custom/nodes/NodeDrifts.js +3 -20
  170. package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +6 -0
  171. package/dist/likec4diagram/custom/nodes/NodeNotes.js +286 -0
  172. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +10 -6
  173. package/dist/likec4diagram/custom/nodes/nodes.js +30 -8
  174. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +5 -4
  175. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
  176. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +14 -9
  177. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +4 -4
  178. package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +3 -3
  179. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +16 -36
  180. package/dist/likec4diagram/relationship-popover/components.d.ts +7 -0
  181. package/dist/likec4diagram/relationship-popover/components.js +39 -0
  182. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
  183. package/dist/likec4diagram/state/DiagramActorProvider.js +39 -66
  184. package/dist/likec4diagram/state/assign.d.ts +1 -1
  185. package/dist/likec4diagram/state/createViewChange.js +16 -4
  186. package/dist/likec4diagram/state/diagram-api.d.ts +11 -0
  187. package/dist/likec4diagram/state/diagram-api.js +15 -0
  188. package/dist/likec4diagram/state/machine.actions.d.ts +92 -0
  189. package/dist/likec4diagram/state/machine.actions.js +127 -58
  190. package/dist/likec4diagram/state/machine.actions.layout.d.ts +23 -2
  191. package/dist/likec4diagram/state/machine.actions.layout.js +68 -15
  192. package/dist/likec4diagram/state/machine.d.ts +1 -1
  193. package/dist/likec4diagram/state/machine.js +35 -31
  194. package/dist/likec4diagram/state/machine.setup.d.ts +40 -7
  195. package/dist/likec4diagram/state/machine.setup.js +13 -4
  196. package/dist/likec4diagram/state/machine.state.initializing.d.ts +32 -2
  197. package/dist/likec4diagram/state/machine.state.navigating.d.ts +1 -1
  198. package/dist/likec4diagram/state/machine.state.navigating.js +82 -50
  199. package/dist/likec4diagram/state/machine.state.ready.d.ts +565 -579
  200. package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +17 -148
  201. package/dist/likec4diagram/state/machine.state.ready.focused.js +6 -14
  202. package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +11 -96
  203. package/dist/likec4diagram/state/machine.state.ready.idle.js +7 -12
  204. package/dist/likec4diagram/state/machine.state.ready.js +89 -70
  205. package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +4 -0
  206. package/dist/likec4diagram/state/machine.state.ready.printing.js +4 -3
  207. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +145 -2
  208. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +29 -21
  209. package/dist/likec4diagram/state/types.d.ts +1 -1
  210. package/dist/likec4diagram/state/utils.d.ts +14 -14
  211. package/dist/likec4diagram/state/utils.js +12 -4
  212. package/dist/likec4diagram/types.d.ts +11 -3
  213. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +2 -2
  214. package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
  215. package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
  216. package/dist/likec4diagram/useLayoutConstraints.js +126 -84
  217. package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +11 -3
  218. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +7 -3
  219. package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -3
  220. package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +15 -8
  221. package/dist/navigationpanel/NavigationPanel.js +4 -3
  222. package/dist/navigationpanel/NavigationPanelControls.js +4 -2
  223. package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
  224. package/dist/navigationpanel/_common.d.ts +1 -1
  225. package/dist/navigationpanel/_common.js +2 -3
  226. package/dist/navigationpanel/actor.js +1 -1
  227. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
  228. package/dist/navigationpanel/comparepanel/ComparePanel.js +155 -29
  229. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
  230. package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -0
  231. package/dist/navigationpanel/comparepanel/DriftsSummary.js +264 -0
  232. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +4 -5
  233. package/dist/navigationpanel/controls/DetailsControls.js +7 -7
  234. package/dist/navigationpanel/controls/LayoutWarning.js +2 -2
  235. package/dist/navigationpanel/controls/LogoButton.js +1 -1
  236. package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
  237. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  238. package/dist/navigationpanel/controls/SearchControl.d.ts +1 -2
  239. package/dist/navigationpanel/controls/SearchControl.js +8 -12
  240. package/dist/navigationpanel/controls/ToggleReadonly.js +5 -6
  241. package/dist/navigationpanel/dropdown/ProjectsMenu.js +12 -6
  242. package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
  243. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
  244. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
  245. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
  246. package/dist/navigationpanel/editorpanel/styles.js +4 -4
  247. package/dist/navigationpanel/styles.css.d.ts +1 -1
  248. package/dist/navigationpanel/styles.css.js +1 -1
  249. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
  250. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +77 -77
  251. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
  252. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +2 -2
  253. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
  254. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
  255. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +2 -2
  256. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
  257. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
  258. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
  259. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
  260. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +2 -2
  261. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
  262. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
  263. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
  264. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
  265. 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
  266. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +2 -2
  267. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +2 -2
  268. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
  269. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
  270. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
  271. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +2 -2
  272. 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
  273. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
  274. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
  275. 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
  276. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
  277. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +2 -2
  278. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +2 -2
  279. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +2 -2
  280. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +2 -2
  281. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +2 -2
  282. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +2 -2
  283. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +2 -2
  284. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +2 -2
  285. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
  286. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
  287. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +2 -2
  288. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +2 -2
  289. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
  290. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
  291. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
  292. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
  293. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +2 -2
  294. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +2 -2
  295. 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
  296. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
  297. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
  298. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
  299. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
  300. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +2 -2
  301. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
  302. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +14 -0
  303. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
  304. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
  305. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
  306. 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
  307. 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
  308. package/dist/overlays/element-details/ElementDetailsCard.css.js +15 -15
  309. package/dist/overlays/element-details/ElementDetailsCard.js +39 -40
  310. package/dist/overlays/element-details/MetadataValue.js +11 -12
  311. package/dist/overlays/element-details/TabPanelDeployments.js +8 -6
  312. package/dist/overlays/element-details/TabPanelRelationships.css.js +10 -30
  313. package/dist/overlays/element-details/TabPanelRelationships.js +4 -5
  314. package/dist/overlays/element-details/TabPanelStructure.css.js +3 -3
  315. package/dist/overlays/element-details/TabPanelStructure.js +3 -2
  316. package/dist/overlays/overlaysActor.js +19 -1
  317. package/dist/overlays/relationship-details/RelationshipDetails.d.ts +0 -5
  318. package/dist/overlays/relationship-details/RelationshipDetails.js +4 -4
  319. package/dist/overlays/relationship-details/SelectEdge.css.js +6 -6
  320. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  321. package/dist/overlays/relationship-details/compute.js +1 -1
  322. package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
  323. package/dist/overlays/relationship-details/custom/nodeTypes.js +14 -1
  324. package/dist/overlays/relationship-details/layout.js +1 -1
  325. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +0 -5
  326. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +116 -21
  327. package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
  328. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  329. package/dist/overlays/relationships-browser/actor.js +1 -1
  330. package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
  331. package/dist/overlays/relationships-browser/custom/EmptyNode.js +21 -6
  332. package/dist/overlays/relationships-browser/custom/nodeTypes.js +14 -1
  333. package/dist/overlays/relationships-browser/layout.d.ts +1 -1
  334. package/dist/overlays/relationships-browser/layout.js +1 -1
  335. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -1
  336. package/dist/projects-overview/ProjectsOverview.js +2 -2
  337. package/dist/projects-overview/ProjectsOverviewXY.d.ts +1 -5
  338. package/dist/projects-overview/ProjectsOverviewXY.js +1 -1
  339. package/dist/projects-overview/actor.d.ts +1 -1
  340. package/dist/projects-overview/actor.js +8 -31
  341. package/dist/projects-overview/context.d.ts +2 -2
  342. package/dist/projects-overview/context.js +2 -1
  343. package/dist/projects-overview/custom/nodeTypes.js +1 -1
  344. package/dist/projects-overview/panel/ProjectsOverviewPanel.js +1 -1
  345. package/dist/search/Search.d.ts +2 -4
  346. package/dist/search/Search.js +67 -44
  347. package/dist/search/components/ElementsColumn.css.js +6 -6
  348. package/dist/search/components/ElementsColumn.js +93 -60
  349. package/dist/search/components/PickView.d.ts +3 -1
  350. package/dist/search/components/PickView.js +12 -7
  351. package/dist/search/components/SearchByTags.js +1 -1
  352. package/dist/search/components/SearchInput.js +2 -2
  353. package/dist/search/components/ViewsColum.d.ts +2 -1
  354. package/dist/search/components/ViewsColum.js +39 -35
  355. package/dist/search/components/ViewsColumn.css.js +1 -1
  356. package/dist/search/components/_shared.css.d.ts +1 -1
  357. package/dist/search/components/_shared.css.js +12 -12
  358. package/dist/search/components/utils.js +1 -4
  359. package/dist/search/hooks.d.ts +1 -6
  360. package/dist/search/hooks.js +15 -9
  361. package/dist/search/searchActor.d.ts +12 -2
  362. package/dist/search/searchActor.js +60 -4
  363. package/dist/shadowroot/ShadowRoot.d.ts +5 -2
  364. package/dist/shadowroot/ShadowRoot.js +25 -22
  365. package/dist/shadowroot/styles.css.d.ts +0 -2
  366. package/dist/shadowroot/styles.css.js +4 -36
  367. package/dist/styles-font.css2.js +1 -1
  368. package/dist/styles.css2.js +1 -1
  369. package/dist/utils/view-bounds.d.ts +3 -2
  370. package/dist/utils/view-bounds.js +10 -6
  371. package/dist/utils/xyflow.d.ts +27 -6
  372. package/dist/utils/xyflow.js +68 -23
  373. package/package.json +39 -37
  374. package/panda.buildinfo.json +226 -161
  375. package/styles-font.css +1 -1
  376. package/styles-min.css +1 -1
  377. package/styles.css +1 -1
  378. package/bundle/index.js +0 -51974
  379. package/bundle/package.json +0 -4
  380. package/dist/editor/__tests__/fixture.d.ts +0 -205
  381. package/dist/editor/editorActor.d.ts +0 -653
  382. package/dist/likec4diagram/relationship-popover/styles.css.d.ts +0 -2
  383. package/dist/likec4diagram/relationship-popover/styles.css.js +0 -28
  384. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
  385. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
  386. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
  387. package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
  388. package/dist/overlays/relationships-browser/custom/styles.css.d.ts +0 -1
  389. package/dist/overlays/relationships-browser/custom/styles.css.js +0 -14
@@ -1,10 +1,10 @@
1
1
  import { ViewChange } from '@likec4/core/types';
2
2
  import { ActionFunction, CancelAction, Values, PromiseActorLogic, EventObject, NonReducibleUnknown, StopAction } from 'xstate';
3
- import { EditorActorContext, EditorActorEvent, EditorActorEmitedEvent } from './editorActor';
3
+ import { EditorActorContext, EditorActorEvent, EditorActorEmitedEvent } from './editorActor.setup';
4
4
  import { HotkeyActorLogic } from './hotkeyActor';
5
- export declare const raiseSync: () => ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, never, never, never, "350ms" | "waitBeforeSync", never>;
5
+ export declare const raiseSync: () => ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, never, never, never, "500ms" | "waitBeforeSync", never>;
6
6
  export declare const cancelSync: () => CancelAction<EditorActorContext, EditorActorEvent, undefined, EditorActorEvent>;
7
- export declare const reschedule: (delay?: number) => ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, never, never, never, "350ms" | "waitBeforeSync", never>;
7
+ export declare const reschedule: (delay?: number) => ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, never, never, never, "500ms" | "waitBeforeSync", never>;
8
8
  type LayoutChanges = ViewChange.ResetManualLayout | ViewChange.SaveViewSnapshot;
9
9
  export declare const isLayoutChange: (change: ViewChange) => change is LayoutChanges;
10
10
  export declare const withoutSnapshotChanges: (data: ViewChange[]) => (ViewChange.ChangeElementStyle | ViewChange.ChangeAutoLayout)[];
@@ -16,12 +16,12 @@ export declare const saveStateBeforeEdit: () => ActionFunction<EditorActorContex
16
16
  };
17
17
  applyLatest: {
18
18
  src: "applyLatest";
19
- logic: PromiseActorLogic<import("./editorActor").EditorCalls.ApplyLatestToManual.Output, import("./editorActor").EditorCalls.ApplyLatestToManual.Input, EventObject>;
19
+ logic: PromiseActorLogic<import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Output, import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Input, EventObject>;
20
20
  id: string | undefined;
21
21
  };
22
22
  executeChange: {
23
23
  src: "executeChange";
24
- logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor").EditorCalls.ExecuteChange.Input, EventObject>;
24
+ logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor.setup").EditorCalls.ExecuteChange.Input, EventObject>;
25
25
  id: string | undefined;
26
26
  };
27
27
  }>, never, never, never, never>;
@@ -33,12 +33,12 @@ export declare const startEditing: () => ActionFunction<EditorActorContext, Edit
33
33
  };
34
34
  applyLatest: {
35
35
  src: "applyLatest";
36
- logic: PromiseActorLogic<import("./editorActor").EditorCalls.ApplyLatestToManual.Output, import("./editorActor").EditorCalls.ApplyLatestToManual.Input, EventObject>;
36
+ logic: PromiseActorLogic<import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Output, import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Input, EventObject>;
37
37
  id: string | undefined;
38
38
  };
39
39
  executeChange: {
40
40
  src: "executeChange";
41
- logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor").EditorCalls.ExecuteChange.Input, EventObject>;
41
+ logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor.setup").EditorCalls.ExecuteChange.Input, EventObject>;
42
42
  id: string | undefined;
43
43
  };
44
44
  }>, never, Values<{
@@ -50,7 +50,7 @@ export declare const startEditing: () => ActionFunction<EditorActorContext, Edit
50
50
  type: "can undo";
51
51
  params: unknown;
52
52
  };
53
- }>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
53
+ }>, "500ms" | "waitBeforeSync", EditorActorEmitedEvent>;
54
54
  export declare const stopHotkey: () => StopAction<EditorActorContext, EditorActorEvent, undefined, EditorActorEvent>;
55
55
  export declare const ensureHotKey: () => ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
56
56
  hotkey: {
@@ -60,12 +60,12 @@ export declare const ensureHotKey: () => ActionFunction<EditorActorContext, Edit
60
60
  };
61
61
  applyLatest: {
62
62
  src: "applyLatest";
63
- logic: PromiseActorLogic<import("./editorActor").EditorCalls.ApplyLatestToManual.Output, import("./editorActor").EditorCalls.ApplyLatestToManual.Input, EventObject>;
63
+ logic: PromiseActorLogic<import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Output, import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Input, EventObject>;
64
64
  id: string | undefined;
65
65
  };
66
66
  executeChange: {
67
67
  src: "executeChange";
68
- logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor").EditorCalls.ExecuteChange.Input, EventObject>;
68
+ logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor.setup").EditorCalls.ExecuteChange.Input, EventObject>;
69
69
  id: string | undefined;
70
70
  };
71
71
  }>, never, Values<{
@@ -77,7 +77,7 @@ export declare const ensureHotKey: () => ActionFunction<EditorActorContext, Edit
77
77
  type: "can undo";
78
78
  params: unknown;
79
79
  };
80
- }>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
80
+ }>, "500ms" | "waitBeforeSync", EditorActorEmitedEvent>;
81
81
  export declare const pushHistory: () => ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
82
82
  hotkey: {
83
83
  src: "hotkey";
@@ -86,12 +86,12 @@ export declare const pushHistory: () => ActionFunction<EditorActorContext, Edito
86
86
  };
87
87
  applyLatest: {
88
88
  src: "applyLatest";
89
- logic: PromiseActorLogic<import("./editorActor").EditorCalls.ApplyLatestToManual.Output, import("./editorActor").EditorCalls.ApplyLatestToManual.Input, EventObject>;
89
+ logic: PromiseActorLogic<import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Output, import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Input, EventObject>;
90
90
  id: string | undefined;
91
91
  };
92
92
  executeChange: {
93
93
  src: "executeChange";
94
- logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor").EditorCalls.ExecuteChange.Input, EventObject>;
94
+ logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor.setup").EditorCalls.ExecuteChange.Input, EventObject>;
95
95
  id: string | undefined;
96
96
  };
97
97
  }>, never, never, never, never>;
@@ -103,12 +103,12 @@ export declare const stopEditing: () => ActionFunction<EditorActorContext, Edito
103
103
  };
104
104
  applyLatest: {
105
105
  src: "applyLatest";
106
- logic: PromiseActorLogic<import("./editorActor").EditorCalls.ApplyLatestToManual.Output, import("./editorActor").EditorCalls.ApplyLatestToManual.Input, EventObject>;
106
+ logic: PromiseActorLogic<import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Output, import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Input, EventObject>;
107
107
  id: string | undefined;
108
108
  };
109
109
  executeChange: {
110
110
  src: "executeChange";
111
- logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor").EditorCalls.ExecuteChange.Input, EventObject>;
111
+ logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor.setup").EditorCalls.ExecuteChange.Input, EventObject>;
112
112
  id: string | undefined;
113
113
  };
114
114
  }>, never, Values<{
@@ -120,7 +120,7 @@ export declare const stopEditing: () => ActionFunction<EditorActorContext, Edito
120
120
  type: "can undo";
121
121
  params: unknown;
122
122
  };
123
- }>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
123
+ }>, "500ms" | "waitBeforeSync", EditorActorEmitedEvent>;
124
124
  export declare const markHistoryAsSynched: () => ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
125
125
  hotkey: {
126
126
  src: "hotkey";
@@ -129,12 +129,12 @@ export declare const markHistoryAsSynched: () => ActionFunction<EditorActorConte
129
129
  };
130
130
  applyLatest: {
131
131
  src: "applyLatest";
132
- logic: PromiseActorLogic<import("./editorActor").EditorCalls.ApplyLatestToManual.Output, import("./editorActor").EditorCalls.ApplyLatestToManual.Input, EventObject>;
132
+ logic: PromiseActorLogic<import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Output, import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Input, EventObject>;
133
133
  id: string | undefined;
134
134
  };
135
135
  executeChange: {
136
136
  src: "executeChange";
137
- logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor").EditorCalls.ExecuteChange.Input, EventObject>;
137
+ logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor.setup").EditorCalls.ExecuteChange.Input, EventObject>;
138
138
  id: string | undefined;
139
139
  };
140
140
  }>, never, never, never, never>;
@@ -146,12 +146,12 @@ export declare const popHistory: () => ActionFunction<EditorActorContext, Editor
146
146
  };
147
147
  applyLatest: {
148
148
  src: "applyLatest";
149
- logic: PromiseActorLogic<import("./editorActor").EditorCalls.ApplyLatestToManual.Output, import("./editorActor").EditorCalls.ApplyLatestToManual.Input, EventObject>;
149
+ logic: PromiseActorLogic<import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Output, import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Input, EventObject>;
150
150
  id: string | undefined;
151
151
  };
152
152
  executeChange: {
153
153
  src: "executeChange";
154
- logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor").EditorCalls.ExecuteChange.Input, EventObject>;
154
+ logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor.setup").EditorCalls.ExecuteChange.Input, EventObject>;
155
155
  id: string | undefined;
156
156
  };
157
157
  }>, never, never, never, never>;
@@ -163,12 +163,12 @@ export declare const undo: () => ActionFunction<EditorActorContext, EditorActorE
163
163
  };
164
164
  applyLatest: {
165
165
  src: "applyLatest";
166
- logic: PromiseActorLogic<import("./editorActor").EditorCalls.ApplyLatestToManual.Output, import("./editorActor").EditorCalls.ApplyLatestToManual.Input, EventObject>;
166
+ logic: PromiseActorLogic<import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Output, import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Input, EventObject>;
167
167
  id: string | undefined;
168
168
  };
169
169
  executeChange: {
170
170
  src: "executeChange";
171
- logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor").EditorCalls.ExecuteChange.Input, EventObject>;
171
+ logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor.setup").EditorCalls.ExecuteChange.Input, EventObject>;
172
172
  id: string | undefined;
173
173
  };
174
174
  }>, never, Values<{
@@ -180,7 +180,7 @@ export declare const undo: () => ActionFunction<EditorActorContext, EditorActorE
180
180
  type: "can undo";
181
181
  params: unknown;
182
182
  };
183
- }>, "350ms" | "waitBeforeSync", EditorActorEmitedEvent>;
183
+ }>, "500ms" | "waitBeforeSync", EditorActorEmitedEvent>;
184
184
  export declare const addSnapshotToPendingChanges: () => ActionFunction<EditorActorContext, EditorActorEvent, EditorActorEvent, undefined, Values<{
185
185
  hotkey: {
186
186
  src: "hotkey";
@@ -189,12 +189,12 @@ export declare const addSnapshotToPendingChanges: () => ActionFunction<EditorAct
189
189
  };
190
190
  applyLatest: {
191
191
  src: "applyLatest";
192
- logic: PromiseActorLogic<import("./editorActor").EditorCalls.ApplyLatestToManual.Output, import("./editorActor").EditorCalls.ApplyLatestToManual.Input, EventObject>;
192
+ logic: PromiseActorLogic<import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Output, import("./editorActor.setup").EditorCalls.ApplyLatestToManual.Input, EventObject>;
193
193
  id: string | undefined;
194
194
  };
195
195
  executeChange: {
196
196
  src: "executeChange";
197
- logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor").EditorCalls.ExecuteChange.Input, EventObject>;
197
+ logic: PromiseActorLogic<NonReducibleUnknown, import("./editorActor.setup").EditorCalls.ExecuteChange.Input, EventObject>;
198
198
  id: string | undefined;
199
199
  };
200
200
  }>, never, never, never, never>;
@@ -1,8 +1,8 @@
1
1
  import { last, filter, isNot, omit } from 'remeda';
2
2
  import { createViewChange } from '../likec4diagram/state/createViewChange.js';
3
- import { machine } from './editorActor.js';
3
+ import { machine } from './editorActor.setup.js';
4
4
 
5
- const diagramActorRef = function(system) {
5
+ const diagramActorRef = (system) => {
6
6
  return system.get("diagram");
7
7
  };
8
8
  const getDiagramContext = function(system) {
@@ -10,28 +10,24 @@ const getDiagramContext = function(system) {
10
10
  };
11
11
  const raiseSync = () => machine.raise({ type: "sync" }, { delay: 200, id: "sync" });
12
12
  const cancelSync = () => machine.cancel("sync");
13
- const reschedule = (delay = 50) => machine.raise(({ event }) => event, { delay });
13
+ const reschedule = (delay = 350) => machine.raise(({ event }) => event, { delay });
14
14
  const isLayoutChange = (change) => change.op === "reset-manual-layout" || change.op === "save-view-snapshot";
15
15
  const withoutSnapshotChanges = filter(isNot(isLayoutChange));
16
16
  const saveStateBeforeEdit = () => machine.assign(({ system }) => {
17
17
  const parentContext = getDiagramContext(system);
18
18
  return {
19
19
  beforeEditing: {
20
- xynodes: parentContext.xynodes.map(
21
- ({ measured, ...n }) => ({
22
- ...omit(n, ["selected", "dragging", "resizing"]),
23
- data: omit(n.data, ["dimmed", "hovered"]),
24
- measured,
25
- initialWidth: measured?.width ?? n.width ?? n.initialWidth,
26
- initialHeight: measured?.height ?? n.height ?? n.initialHeight
27
- })
28
- ),
29
- xyedges: parentContext.xyedges.map(
30
- (e) => ({
31
- ...omit(e, ["selected"]),
32
- data: omit(e.data, ["active", "dimmed", "hovered"])
33
- })
34
- ),
20
+ xynodes: parentContext.xynodes.map(({ measured, data, ...n }) => ({
21
+ ...omit(n, ["selected", "dragging", "resizing"]),
22
+ data: omit(data, ["dimmed", "hovered"]),
23
+ measured,
24
+ initialWidth: measured?.width ?? n.width ?? n.initialWidth,
25
+ initialHeight: measured?.height ?? n.height ?? n.initialHeight
26
+ })),
27
+ xyedges: parentContext.xyedges.map(({ data, ...e }) => ({
28
+ ...omit(e, ["selected"]),
29
+ data: omit(data, ["active", "dimmed", "hovered"])
30
+ })),
35
31
  change: createViewChange(parentContext),
36
32
  view: parentContext.view,
37
33
  synched: false
@@ -67,13 +63,17 @@ const pushHistory = () => machine.assign(({ context }) => {
67
63
  editing: null
68
64
  };
69
65
  }
66
+ const history = [
67
+ ...context.history,
68
+ snapshot
69
+ ];
70
+ if (history.length > 50) {
71
+ history.shift();
72
+ }
70
73
  return {
71
74
  beforeEditing: null,
72
75
  editing: null,
73
- history: [
74
- ...context.history,
75
- snapshot
76
- ]
76
+ history
77
77
  };
78
78
  });
79
79
  const stopEditing = () => machine.enqueueActions(({ event, enqueue }) => {
@@ -0,0 +1,84 @@
1
+ import { NonReducibleUnknown, SetupReturn, PromiseActorLogic, EventObject, MetaObject } from 'xstate';
2
+ import { Types } from '../likec4diagram/types';
3
+ import { HotKeyEvent, HotkeyActorLogic } from './hotkeyActor';
4
+ import type * as t from '@likec4/core/types';
5
+ export declare namespace EditorCalls {
6
+ type ApplyLatestToManual = (params: {
7
+ input: ApplyLatestToManual.Input;
8
+ }) => Promise<ApplyLatestToManual.Output>;
9
+ namespace ApplyLatestToManual {
10
+ type Input = {
11
+ viewId: t.ViewId;
12
+ current: t.LayoutedView | undefined;
13
+ };
14
+ type Output = {
15
+ updated: t.LayoutedView;
16
+ };
17
+ }
18
+ type ExecuteChange = (params: {
19
+ input: ExecuteChange.Input;
20
+ }) => Promise<ExecuteChange.Output>;
21
+ namespace ExecuteChange {
22
+ type Input = {
23
+ viewId: t.ViewId;
24
+ changes: t.ViewChange[];
25
+ };
26
+ type Output = NonReducibleUnknown;
27
+ }
28
+ }
29
+ export type EditorActorEvent = {
30
+ type: 'sync';
31
+ } | {
32
+ type: 'change';
33
+ change: t.ViewChange;
34
+ } | {
35
+ type: 'edit.start';
36
+ subject: 'node' | 'edge';
37
+ } | {
38
+ type: 'edit.finish';
39
+ wasChanged?: boolean;
40
+ } | {
41
+ type: 'applyLatestToManual';
42
+ } | {
43
+ type: 'synced';
44
+ } | {
45
+ type: 'cancel';
46
+ } | {
47
+ type: 'reset';
48
+ } | HotKeyEvent;
49
+ export type HistorySnapshot = {
50
+ view: t.LayoutedView;
51
+ change: t.ViewChange.SaveViewSnapshot;
52
+ xynodes: Types.Node[];
53
+ xyedges: Types.Edge[];
54
+ synched: boolean;
55
+ };
56
+ export interface EditorActorInput {
57
+ viewId: t.ViewId;
58
+ }
59
+ export interface EditorActorContext {
60
+ viewId: t.ViewId;
61
+ pendingChanges: t.ViewChange[];
62
+ history: ReadonlyArray<HistorySnapshot>;
63
+ /**
64
+ * The state before editing started
65
+ */
66
+ beforeEditing: HistorySnapshot | null;
67
+ /**
68
+ * The subject of the edit
69
+ */
70
+ editing: 'node' | 'edge' | null;
71
+ }
72
+ export type EditorActorEmitedEvent = {
73
+ type: 'idle';
74
+ };
75
+ export declare const machine: SetupReturn<EditorActorContext, EditorActorEvent, {
76
+ applyLatest: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
77
+ executeChange: PromiseActorLogic<NonReducibleUnknown, EditorCalls.ExecuteChange.Input, EventObject>;
78
+ hotkey: HotkeyActorLogic;
79
+ }, {
80
+ hotkey: "hotkey";
81
+ }, {}, {
82
+ 'has pending': unknown;
83
+ 'can undo': unknown;
84
+ }, "500ms" | "waitBeforeSync", "pending", EditorActorInput, NonReducibleUnknown, EditorActorEmitedEvent, MetaObject>;
@@ -0,0 +1,38 @@
1
+ import { setup, fromPromise } from 'xstate';
2
+ import { hotkeyActorLogic } from './hotkeyActor.js';
3
+
4
+ const applyLatest = fromPromise(
5
+ () => {
6
+ throw new Error("Not implemented");
7
+ }
8
+ );
9
+ const executeChange = fromPromise(
10
+ () => {
11
+ throw new Error("Not implemented");
12
+ }
13
+ );
14
+ const machine = setup({
15
+ types: {
16
+ context: {},
17
+ events: {},
18
+ emitted: {},
19
+ input: {},
20
+ children: {},
21
+ tags: {}
22
+ },
23
+ delays: {
24
+ "500ms": 500,
25
+ "waitBeforeSync": 2e3
26
+ },
27
+ actors: {
28
+ applyLatest,
29
+ executeChange,
30
+ hotkey: hotkeyActorLogic
31
+ },
32
+ guards: {
33
+ "has pending": ({ context }) => context.pendingChanges.length > 0,
34
+ "can undo": ({ context }) => context.history.length > 0
35
+ }
36
+ });
37
+
38
+ export { machine };
@@ -0,0 +1,9 @@
1
+ import { ActorRef, SnapshotFrom, StateMachine } from 'xstate';
2
+ import { EditorActorContext, EditorActorEmitedEvent, EditorActorEvent, EditorActorInput } from './editorActor.setup';
3
+ export type { EditorActorContext, EditorActorEmitedEvent, EditorActorEvent, EditorActorInput, } from './editorActor.setup';
4
+ export interface EditorActorLogic extends StateMachine<EditorActorContext, EditorActorEvent, any, any, any, any, any, 'idle' | 'editing' | 'pending' | 'afterEdit' | 'applyLatestToManual' | 'executeChanges', any, EditorActorInput, any, EditorActorEmitedEvent, any, any> {
5
+ }
6
+ export declare const editorActorLogic: EditorActorLogic;
7
+ export type EditorActorSnapshot = SnapshotFrom<EditorActorLogic>;
8
+ export interface EditorActorRef extends ActorRef<EditorActorSnapshot, EditorActorEvent, EditorActorEmitedEvent> {
9
+ }
@@ -1,44 +1,11 @@
1
1
  import { find } from 'remeda';
2
- import { setup, assign, fromPromise, enqueueActions, sendTo, log } from 'xstate';
3
- import { cancelSync, stopHotkey, undo, markHistoryAsSynched, reschedule, isLayoutChange, withoutSnapshotChanges, addSnapshotToPendingChanges, ensureHotKey, pushHistory, saveStateBeforeEdit, stopEditing, startEditing } from './editorActor.actions.js';
4
- import { hotkeyActorLogic } from './hotkeyActor.js';
2
+ import { assign, enqueueActions, log, sendTo } from 'xstate';
3
+ import { cancelSync, stopHotkey, undo, markHistoryAsSynched, isLayoutChange, withoutSnapshotChanges, addSnapshotToPendingChanges, ensureHotKey, reschedule, pushHistory, saveStateBeforeEdit, stopEditing, startEditing } from './editorActor.actions.js';
4
+ import { machine } from './editorActor.setup.js';
5
5
 
6
- const applyLatest = fromPromise(
7
- () => {
8
- throw new Error("Not implemented");
9
- }
10
- );
11
- const executeChange = fromPromise(
12
- () => {
13
- throw new Error("Not implemented");
14
- }
15
- );
16
6
  const diagramActorRef = function(params) {
17
7
  return params.system.get("diagram");
18
8
  };
19
- const machine = setup({
20
- types: {
21
- context: {},
22
- events: {},
23
- emitted: {},
24
- input: {},
25
- children: {},
26
- tags: {}
27
- },
28
- delays: {
29
- "350ms": 350,
30
- "waitBeforeSync": 2e3
31
- },
32
- actors: {
33
- applyLatest,
34
- executeChange,
35
- hotkey: hotkeyActorLogic
36
- },
37
- guards: {
38
- "has pending": ({ context }) => context.pendingChanges.length > 0,
39
- "can undo": ({ context }) => context.history.length > 0
40
- }
41
- });
42
9
  const to = {
43
10
  idle: { target: "#idle" },
44
11
  editing: { target: "#editing" },
@@ -120,15 +87,6 @@ const applyLatestToManual = machine.createStateConfig({
120
87
  saveStateBeforeEdit()
121
88
  ],
122
89
  initial: "call",
123
- on: {
124
- // catch all events
125
- "*": {
126
- actions: [
127
- log(({ event }) => `applyLatestToManual received unexpected event: ${event.type}`),
128
- reschedule(350)
129
- ]
130
- }
131
- },
132
90
  states: {
133
91
  // Fetch latest and manual layouts
134
92
  // Apply changes, send update to diagram
@@ -170,8 +128,16 @@ const applyLatestToManual = machine.createStateConfig({
170
128
  // Now we wait 350ms, take new snapshot and send save-view-snapshot
171
129
  wait: {
172
130
  entry: pushHistory(),
131
+ on: {
132
+ "*": {
133
+ actions: [
134
+ log(({ event }) => `wait received unexpected event: ${event.type}`),
135
+ reschedule(500)
136
+ ]
137
+ }
138
+ },
173
139
  after: {
174
- "350ms": {
140
+ "500ms": {
175
141
  actions: [
176
142
  addSnapshotToPendingChanges(),
177
143
  ensureHotKey()
@@ -215,7 +181,7 @@ const executeChanges = machine.createStateConfig({
215
181
  viewId: context.viewId
216
182
  }),
217
183
  onDone: {
218
- actions: enqueueActions(({ context, enqueue }) => {
184
+ actions: enqueueActions(({ context, event, enqueue }) => {
219
185
  const snapshot = find(context.pendingChanges, (c) => c.op === "save-view-snapshot");
220
186
  if (snapshot) {
221
187
  enqueue.sendTo(
@@ -233,15 +199,13 @@ const executeChanges = machine.createStateConfig({
233
199
  ...to.idle
234
200
  },
235
201
  onError: {
236
- actions: ({ event }) => {
237
- console.error(event.error);
238
- },
239
- ...to.afterEdit
240
- }
241
- },
242
- on: {
243
- "*": {
244
- actions: reschedule()
202
+ actions: assign(({ event }) => {
203
+ console.error("executeChanges onError", { error: event.error });
204
+ return {
205
+ pendingChanges: []
206
+ };
207
+ }),
208
+ ...to.idle
245
209
  }
246
210
  }
247
211
  });
@@ -255,21 +219,6 @@ const _editorActorLogic = machine.createMachine({
255
219
  history: []
256
220
  }),
257
221
  initial: "idle",
258
- // TODO: listen to diagram actor, if switches to "sequence" dynamic view, cancel editing
259
- // entry: ({ self, system }) => {
260
- // // let previous = ''
261
- // // const a = (self._parent as DiagramMachineRef).subscribe({
262
- // // next({ context }) {
263
- // // const current = context.view._type === 'dynamic' ? context.dynamicViewVariant
264
- // // },
265
- // // })
266
- // const s = self.subscribe({
267
- // complete: () => {
268
- // console.log('editor actor completed')
269
- // s.unsubscribe()
270
- // },
271
- // })
272
- // },
273
222
  states: {
274
223
  idle,
275
224
  editing,
@@ -321,4 +270,4 @@ const _editorActorLogic = machine.createMachine({
321
270
  });
322
271
  const editorActorLogic = _editorActorLogic;
323
272
 
324
- export { editorActorLogic, machine };
273
+ export { editorActorLogic };
@@ -1,3 +1,4 @@
1
- export { EnsureEditorContext, LikeC4EditorProvider, useOptionalLikeC4EditorPort, } from './LikeC4EditorProvider';
2
- export type { LikeC4EditorPort } from './LikeC4EditorProvider';
3
- export type * from './editorActor';
1
+ export type * from './editorActor.states';
2
+ export { createLikeC4Editor } from './LikeC4EditorCallbacks';
3
+ export type { LikeC4EditorCallbacks } from './LikeC4EditorCallbacks';
4
+ export { EnsureEditorContext, LikeC4EditorProvider, useOptionalLikeC4Editor, } from './LikeC4EditorProvider';