@likec4/diagram 1.44.0 → 1.46.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 (270) hide show
  1. package/bundle/index.js +18847 -17876
  2. package/dist/LikeC4Diagram.d.ts +1 -1
  3. package/dist/LikeC4Diagram.js +15 -12
  4. package/dist/LikeC4Diagram.props.d.ts +13 -20
  5. package/dist/LikeC4ProjectsProvider.js +8 -4
  6. package/dist/LikeC4Styles.js +0 -3
  7. package/dist/LikeC4View.d.ts +3 -3
  8. package/dist/LikeC4View.js +8 -8
  9. package/dist/ReactLikeC4.d.ts +3 -6
  10. package/dist/StaticLikeC4Diagram.js +0 -2
  11. package/dist/base/Base.d.ts +1 -1
  12. package/dist/base/updateEdges.js +25 -15
  13. package/dist/base/updateNodes.d.ts +14 -0
  14. package/dist/base/updateNodes.js +51 -18
  15. package/dist/base-primitives/Markdown.d.ts +30 -4
  16. package/dist/base-primitives/Markdown.js +3 -2
  17. package/dist/base-primitives/NodeHandles.d.ts +2 -1
  18. package/dist/base-primitives/NodeHandles.js +22 -18
  19. package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
  20. package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
  21. package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
  22. package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
  23. package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
  24. package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
  25. package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
  26. package/dist/base-primitives/edge/EdgeContainer.js +6 -4
  27. package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -2
  28. package/dist/base-primitives/edge/EdgeLabel.js +16 -16
  29. package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
  30. package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -4
  31. package/dist/base-primitives/edge/EdgePath.js +27 -12
  32. package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
  33. package/dist/base-primitives/element/ElementActionButtons.js +3 -3
  34. package/dist/base-primitives/element/ElementData.d.ts +3 -3
  35. package/dist/base-primitives/element/ElementData.js +13 -7
  36. package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
  37. package/dist/base-primitives/element/ElementDetailsButton.js +4 -1
  38. package/dist/base-primitives/element/ElementShape.js +5 -5
  39. package/dist/base-primitives/element/ElementTags.d.ts +6 -4
  40. package/dist/components/ErrorFallback.js +1 -1
  41. package/dist/components/Link.js +2 -2
  42. package/dist/context/DiagramEventHandlers.js +0 -1
  43. package/dist/context/DiagramFeatures.d.ts +2 -1
  44. package/dist/context/DiagramFeatures.js +1 -0
  45. package/dist/context/EnsureMantine.js +2 -1
  46. package/dist/context/IconRenderer.js +6 -6
  47. package/dist/context/TagStylesContext.js +1 -1
  48. package/dist/custom/hooks.d.ts +2 -2
  49. package/dist/custom/index.js +1 -1
  50. package/dist/editor/LikeC4EditorProvider.d.ts +22 -0
  51. package/dist/editor/LikeC4EditorProvider.js +12 -0
  52. package/dist/editor/__tests__/fixture.d.ts +205 -0
  53. package/dist/editor/applyChangesToManualLayout.d.ts +8 -0
  54. package/dist/editor/applyChangesToManualLayout.js +182 -0
  55. package/dist/editor/editorActor.actions.d.ts +201 -0
  56. package/dist/editor/editorActor.actions.js +149 -0
  57. package/dist/editor/editorActor.d.ts +653 -0
  58. package/dist/editor/editorActor.js +324 -0
  59. package/dist/editor/hotkeyActor.d.ts +7 -0
  60. package/dist/editor/hotkeyActor.js +19 -0
  61. package/dist/editor/index.d.ts +3 -2
  62. package/dist/editor/useEditorActorLogic.d.ts +565 -0
  63. package/dist/editor/useEditorActorLogic.js +54 -0
  64. package/dist/hooks/index.d.ts +2 -1
  65. package/dist/hooks/safeContext.d.ts +3 -2
  66. package/dist/hooks/safeContext.js +7 -4
  67. package/dist/hooks/useDiagram.d.ts +4 -2
  68. package/dist/hooks/useDiagram.js +19 -8
  69. package/dist/hooks/useDiagramCompareLayout.d.ts +8 -0
  70. package/dist/hooks/useDiagramCompareLayout.js +29 -4
  71. package/dist/hooks/useLikeC4Project.d.ts +6 -1
  72. package/dist/hooks/useLikeC4Project.js +14 -2
  73. package/dist/hooks/useMediaPrint.d.ts +6 -0
  74. package/dist/index.d.ts +1 -0
  75. package/dist/index.js +1 -0
  76. package/dist/likec4diagram/DiagramXYFlow.js +11 -7
  77. package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
  78. package/dist/likec4diagram/custom/edges/EdgeDrifts.js +34 -0
  79. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +90 -54
  80. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +3 -1
  81. package/dist/likec4diagram/custom/edges/edges.css.d.ts +0 -1
  82. package/dist/likec4diagram/custom/edges/edges.css.js +30 -24
  83. package/dist/likec4diagram/custom/edges/useControlPoints.js +5 -5
  84. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +5 -5
  85. package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
  86. package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
  87. package/dist/likec4diagram/custom/nodes/{ElementNodeDrifts.js → NodeDrifts.js} +12 -13
  88. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
  89. package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
  90. package/dist/likec4diagram/custom/nodes/nodes.js +61 -23
  91. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
  92. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
  93. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +128 -15
  94. package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
  95. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +2 -2
  96. package/dist/likec4diagram/state/DiagramActorProvider.js +63 -72
  97. package/dist/likec4diagram/state/assign.d.ts +14 -7
  98. package/dist/likec4diagram/state/assign.js +28 -200
  99. package/dist/likec4diagram/state/createViewChange.js +23 -30
  100. package/dist/likec4diagram/state/diagram-api.d.ts +20 -6
  101. package/dist/likec4diagram/state/diagram-api.js +58 -52
  102. package/dist/likec4diagram/state/hotkeyActor.d.ts +1 -8
  103. package/dist/likec4diagram/state/hotkeyActor.js +13 -17
  104. package/dist/likec4diagram/state/machine.actions.d.ts +1127 -864
  105. package/dist/likec4diagram/state/machine.actions.js +316 -296
  106. package/dist/likec4diagram/state/machine.actions.layout.d.ts +641 -0
  107. package/dist/likec4diagram/state/machine.actions.layout.js +141 -0
  108. package/dist/likec4diagram/state/machine.d.ts +18 -3712
  109. package/dist/likec4diagram/state/machine.js +64 -73
  110. package/dist/likec4diagram/state/machine.setup.d.ts +80 -26
  111. package/dist/likec4diagram/state/machine.setup.js +44 -7
  112. package/dist/likec4diagram/state/machine.state.initializing.d.ts +58 -17
  113. package/dist/likec4diagram/state/machine.state.initializing.js +14 -14
  114. package/dist/likec4diagram/state/machine.state.navigating.d.ts +5 -108
  115. package/dist/likec4diagram/state/machine.state.navigating.js +187 -35
  116. package/dist/likec4diagram/state/machine.state.ready.d.ts +2997 -2598
  117. package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +710 -0
  118. package/dist/likec4diagram/state/machine.state.ready.focused.js +98 -0
  119. package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +540 -0
  120. package/dist/likec4diagram/state/machine.state.ready.idle.js +105 -0
  121. package/dist/likec4diagram/state/machine.state.ready.js +95 -347
  122. package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +140 -0
  123. package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
  124. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +684 -0
  125. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +190 -0
  126. package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
  127. package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
  128. package/dist/likec4diagram/state/types.d.ts +11 -9
  129. package/dist/likec4diagram/state/utils.d.ts +44 -5
  130. package/dist/likec4diagram/state/utils.js +62 -6
  131. package/dist/likec4diagram/types.d.ts +8 -13
  132. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
  133. package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
  134. package/dist/likec4diagram/useLayoutConstraints.js +104 -103
  135. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +12 -15
  136. package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
  137. package/dist/navigationpanel/NavigationPanel.js +11 -10
  138. package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
  139. package/dist/navigationpanel/_common.js +1 -1
  140. package/dist/navigationpanel/actor.d.ts +4 -204
  141. package/dist/navigationpanel/actor.js +1 -1
  142. package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -1
  143. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +40 -14
  144. package/dist/navigationpanel/comparepanel/ComparePanelControls.js +6 -4
  145. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +2 -2
  146. package/dist/navigationpanel/controls/DetailsControls.js +2 -2
  147. package/dist/navigationpanel/controls/LayoutWarning.js +2 -1
  148. package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
  149. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  150. package/dist/navigationpanel/controls/SearchControl.js +2 -2
  151. package/dist/navigationpanel/controls/ToggleReadonly.js +32 -19
  152. package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
  153. package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
  154. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
  155. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
  156. package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
  157. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
  158. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +9 -9
  159. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
  160. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +4 -3
  161. package/dist/overlays/Overlays.js +24 -12
  162. package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
  163. package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
  164. package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
  165. package/dist/overlays/element-details/MetadataValue.js +4 -6
  166. package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
  167. package/dist/overlays/element-details/TabPanelRelationships.js +12 -7
  168. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  169. package/dist/overlays/element-details/actor.d.ts +8 -83
  170. package/dist/overlays/element-details/actor.js +0 -8
  171. package/dist/overlays/overlay/Overlay.js +10 -10
  172. package/dist/overlays/overlaysActor.d.ts +7 -392
  173. package/dist/overlays/overlaysActor.js +73 -49
  174. package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
  175. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  176. package/dist/overlays/relationship-details/_types.d.ts +3 -4
  177. package/dist/overlays/relationship-details/actor.d.ts +6 -562
  178. package/dist/overlays/relationship-details/actor.js +1 -0
  179. package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
  180. package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
  181. package/dist/overlays/relationship-details/layout.d.ts +3 -3
  182. package/dist/overlays/relationship-details/layout.js +4 -4
  183. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
  184. package/dist/overlays/relationships-browser/SelectElement.js +2 -2
  185. package/dist/overlays/relationships-browser/_types.d.ts +2 -3
  186. package/dist/overlays/relationships-browser/actor.d.ts +7 -739
  187. package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
  188. package/dist/overlays/relationships-browser/layout.d.ts +2 -2
  189. package/dist/overlays/relationships-browser/layout.js +3 -3
  190. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
  191. package/dist/overlays/types.d.ts +12 -13
  192. package/dist/search/components/ElementsColumn.js +7 -3
  193. package/dist/search/components/PickView.js +3 -1
  194. package/dist/search/components/SearchByTags.js +1 -1
  195. package/dist/search/components/SearchInput.js +1 -1
  196. package/dist/search/components/ViewsColum.d.ts +3 -1
  197. package/dist/search/components/ViewsColum.js +13 -7
  198. package/dist/search/components/_shared.css.d.ts +1 -1
  199. package/dist/search/searchActor.d.ts +3 -66
  200. package/dist/shadowroot/ShadowRoot.d.ts +5 -7
  201. package/dist/shadowroot/ShadowRoot.js +7 -5
  202. package/dist/shadowroot/styles.css.js +6 -1
  203. package/dist/styles.css2.js +1 -1
  204. package/dist/utils/index.d.ts +2 -2
  205. package/dist/utils/view-bounds.js +7 -6
  206. package/dist/utils/xyflow.d.ts +6 -5
  207. package/dist/utils/xyflow.js +26 -57
  208. package/package.json +24 -23
  209. package/panda.buildinfo.json +65 -71
  210. package/styles-min.css +1 -1
  211. package/styles.css +1 -1
  212. package/dist/base-primitives/edge/edge.css.d.ts +0 -4
  213. package/dist/base-primitives/edge/edge.css.js +0 -71
  214. package/dist/editor/LikeC4EditorContext.d.ts +0 -21
  215. package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.d.ts +0 -4
  216. package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +0 -280
  217. package/dist/likec4diagram/state/syncManualLayoutActor.js +0 -248
  218. package/dist/utils/vector.d.ts +0 -81
  219. package/dist/utils/vector.js +0 -120
  220. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
  221. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
  222. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
  223. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
  224. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
  225. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
  226. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
  227. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
  228. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
  229. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
  230. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
  231. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
  232. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
  233. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
  234. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
  235. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
  236. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
  237. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
  238. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
  239. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
  240. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
  241. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
  242. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
  243. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
  244. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
  245. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
  246. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
  247. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
  248. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
  249. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
  250. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
  251. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
  252. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
  253. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
  254. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
  255. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
  256. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
  257. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
  258. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
  259. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
  260. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
  261. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
  262. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
  263. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
  264. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
  265. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
  266. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
  267. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
  268. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
  269. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
  270. /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.35.0_react@19.2.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
@@ -1,4 +0,0 @@
1
- export declare const edgeContainer: string;
2
- export declare const edgePathBg: string;
3
- export declare const markerContext: string;
4
- export declare const cssEdgePath: string;
@@ -1,71 +0,0 @@
1
- import { css } from '@likec4/styles/css';
2
-
3
- const isSelected = ".react-flow__edge.selected";
4
- const edgeContainer = css({
5
- _reduceGraphics: {
6
- transition: "none"
7
- }
8
- });
9
- const edgePathBg = css({
10
- pointerEvents: "none",
11
- fill: "none",
12
- strokeWidth: "calc(var(--xy-edge-stroke-width) + 2)",
13
- strokeOpacity: 0.08,
14
- _noReduceGraphics: {
15
- transitionProperty: "stroke-width, stroke-opacity",
16
- transitionDuration: "fast",
17
- transitionTimingFunction: "inOut"
18
- },
19
- _whenHovered: {
20
- transitionTimingFunction: "out",
21
- strokeWidth: "calc(var(--xy-edge-stroke-width) + 4)",
22
- strokeOpacity: 0.2
23
- },
24
- _whenSelected: {
25
- strokeWidth: "calc(var(--xy-edge-stroke-width) + 6)",
26
- strokeOpacity: 0.25,
27
- _whenHovered: {
28
- strokeOpacity: 0.4
29
- }
30
- }
31
- });
32
- const markerContext = css({
33
- fill: "[var(--xy-edge-stroke)]",
34
- stroke: "[var(--xy-edge-stroke)]"
35
- });
36
- const cssEdgePath = css({
37
- fill: "none",
38
- strokeDashoffset: 0,
39
- _noReduceGraphics: {
40
- animationStyle: "xyedgeAnimated",
41
- animationPlayState: "paused",
42
- transition: "stroke 130ms ease-out,stroke-width 130ms ease-out"
43
- },
44
- [`:where([data-edge-dir='back']) &`]: {
45
- animationDirection: "reverse"
46
- },
47
- _whenHovered: {
48
- _noReduceGraphics: {
49
- animationPlayState: "running",
50
- animationDelay: "450ms"
51
- }
52
- },
53
- [`:where(${isSelected}, [data-edge-active='true'], [data-edge-animated='true']) &`]: {
54
- _noReduceGraphics: {
55
- animationPlayState: "running",
56
- animationDelay: "0ms"
57
- }
58
- },
59
- _whenDimmed: {
60
- animationPlayState: "paused"
61
- },
62
- _smallZoom: {
63
- animationName: "none"
64
- },
65
- _whenPanning: {
66
- strokeDasharray: "none !important",
67
- animationPlayState: "paused"
68
- }
69
- });
70
-
71
- export { cssEdgePath, edgeContainer, edgePathBg, markerContext };
@@ -1,21 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { OnChange } from '../LikeC4Diagram.props';
3
- import type * as t from '@likec4/core/types';
4
- export type LikeC4EditorContextType = {
5
- /**
6
- * Fetch a view by its ID and layout type.
7
- *
8
- * @param viewId - The ID of the view to fetch.
9
- * @param layout - The layout type to use when fetching the view.
10
- */
11
- fetchView(viewId: t.ViewId, layout?: t.LayoutType): Promise<t.LayoutedView>;
12
- syncManualLayout(viewId: t.ViewId): Promise<void>;
13
- /**
14
- * Callback invoked when the view changes.
15
- */
16
- onChange: OnChange;
17
- };
18
- export declare function LikeC4EditorContext({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
19
- export declare function EnsureEditorContext({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element | null;
20
- export declare function useOptionalLikeC4Editor(): LikeC4EditorContextType | null;
21
- export declare function useLikeC4Editor(): LikeC4EditorContextType;
@@ -1,4 +0,0 @@
1
- import { Types } from '../../types';
2
- type ElementNodeDrifts = Types.NodeProps<'element' | 'deployment'>;
3
- export declare function ElementNodeDrifts({ data }: ElementNodeDrifts): import("react/jsx-runtime").JSX.Element | null;
4
- export {};
@@ -1,280 +0,0 @@
1
- import { LayoutedView, ViewChange, ViewId } from '@likec4/core/types';
2
- import { ActorLogicFrom, ActorRef, ActorRefFromLogic, MachineSnapshot, SnapshotFrom, StateMachine, NonReducibleUnknown, EventObject, MetaObject, ConditionalRequired, InputFrom, RequiredActorOptions, IsNotNever, GetConcreteByKey, AnyActorLogic, RequiredLogicInput, AnyActorRef, StateValue, AnyEventObject, ActionFunction } from 'xstate';
3
- import { Types } from '../types';
4
- import { UndoHotKeyActorLogic } from './hotkeyActor';
5
- export type Input = {
6
- viewId: ViewId;
7
- };
8
- type HistorySnapshot = {
9
- view: LayoutedView;
10
- change: ViewChange.SaveViewSnapshot;
11
- xynodes: Types.Node[];
12
- xyedges: Types.Edge[];
13
- synched: boolean;
14
- };
15
- export type Context = Readonly<Input & {
16
- history: ReadonlyArray<HistorySnapshot>;
17
- beforeEditing: HistorySnapshot | null;
18
- editing: 'node' | 'edge' | null;
19
- }>;
20
- export type Events = {
21
- type: 'sync';
22
- } | {
23
- type: 'synced';
24
- } | {
25
- type: 'editing.start';
26
- subject: 'node' | 'edge';
27
- } | {
28
- type: 'editing.stop';
29
- wasChanged?: boolean;
30
- } | {
31
- type: 'cancel';
32
- } | {
33
- type: 'undo';
34
- } | {
35
- type: 'stop';
36
- };
37
- declare const _syncManualLayoutActorLogic: StateMachine<Readonly<Input & {
38
- history: ReadonlyArray<HistorySnapshot>;
39
- beforeEditing: HistorySnapshot | null;
40
- editing: "node" | "edge" | null;
41
- }>, Events, {
42
- undoHotKey?: ActorRefFromLogic< UndoHotKeyActorLogic>;
43
- }, {
44
- src: "undoHotKeyActorLogic";
45
- logic: UndoHotKeyActorLogic;
46
- id: "undoHotKey";
47
- }, never, {
48
- type: "can undo";
49
- params: unknown;
50
- }, "timeout", "stopped" | "editing" | "pending" | "idle" | "paused", "pending" | "ready", Input, NonReducibleUnknown, EventObject, MetaObject, {
51
- readonly initial: "idle";
52
- readonly context: ({ input }: {
53
- spawn: {
54
- <TSrc extends "undoHotKeyActorLogic">(logic: TSrc, ...[options]: {
55
- src: "undoHotKeyActorLogic";
56
- logic: UndoHotKeyActorLogic;
57
- id: "undoHotKey";
58
- } extends infer T ? T extends {
59
- src: "undoHotKeyActorLogic";
60
- logic: UndoHotKeyActorLogic;
61
- id: "undoHotKey";
62
- } ? T extends {
63
- src: TSrc;
64
- } ? ConditionalRequired<[options?: {
65
- id?: T["id"];
66
- systemId?: string;
67
- input?: InputFrom<T["logic"]>;
68
- syncSnapshot?: boolean;
69
- } & { [K in RequiredActorOptions<T>]: unknown; }], IsNotNever<RequiredActorOptions<T>>> : never : never : never): ActorRefFromLogic< GetConcreteByKey<{
70
- src: "undoHotKeyActorLogic";
71
- logic: UndoHotKeyActorLogic;
72
- id: "undoHotKey";
73
- }, "src", TSrc>["logic"]>;
74
- <TLogic extends AnyActorLogic>(src: TLogic, ...[options]: ConditionalRequired<[options?: {
75
- id?: never;
76
- systemId?: string;
77
- input?: InputFrom<TLogic>;
78
- syncSnapshot?: boolean;
79
- } & { [K in RequiredLogicInput<TLogic>]: unknown; }], IsNotNever<RequiredLogicInput<TLogic>>>): ActorRefFromLogic<TLogic>;
80
- };
81
- input: Input;
82
- self: ActorRef<MachineSnapshot<Readonly<Input & {
83
- history: ReadonlyArray<HistorySnapshot>;
84
- beforeEditing: HistorySnapshot | null;
85
- editing: "node" | "edge" | null;
86
- }>, Events, Record<string, AnyActorRef | undefined>, StateValue, string, unknown, any, any>, Events, AnyEventObject>;
87
- }) => {
88
- history: never[];
89
- beforeEditing: null;
90
- editing: null;
91
- viewId: ViewId;
92
- };
93
- readonly states: {
94
- readonly idle: {
95
- tags: "ready";
96
- entry: ActionFunction<Readonly<Input & {
97
- history: ReadonlyArray<HistorySnapshot>;
98
- beforeEditing: HistorySnapshot | null;
99
- editing: "node" | "edge" | null;
100
- }>, Events, Events, undefined, {
101
- src: "undoHotKeyActorLogic";
102
- logic: UndoHotKeyActorLogic;
103
- id: "undoHotKey";
104
- }, never, never, never, never>[];
105
- on: {
106
- sync: {
107
- target: string;
108
- };
109
- 'editing.start': {
110
- actions: ActionFunction<Readonly<Input & {
111
- history: ReadonlyArray<HistorySnapshot>;
112
- beforeEditing: HistorySnapshot | null;
113
- editing: "node" | "edge" | null;
114
- }>, Events, Events, undefined, {
115
- src: "undoHotKeyActorLogic";
116
- logic: UndoHotKeyActorLogic;
117
- id: "undoHotKey";
118
- }, never, never, never, never>;
119
- target: string;
120
- };
121
- undo: {
122
- guard: "can undo";
123
- actions: ActionFunction<Readonly<Input & {
124
- history: ReadonlyArray<HistorySnapshot>;
125
- beforeEditing: HistorySnapshot | null;
126
- editing: "node" | "edge" | null;
127
- }>, Events, Events, undefined, {
128
- src: "undoHotKeyActorLogic";
129
- logic: UndoHotKeyActorLogic;
130
- id: "undoHotKey";
131
- }, never, {
132
- type: "can undo";
133
- params: unknown;
134
- }, "timeout", EventObject>;
135
- };
136
- };
137
- };
138
- readonly editing: {
139
- on: {
140
- 'editing.stop': {
141
- actions: ActionFunction<Readonly<Input & {
142
- history: ReadonlyArray<HistorySnapshot>;
143
- beforeEditing: HistorySnapshot | null;
144
- editing: "node" | "edge" | null;
145
- }>, Events, Events, undefined, {
146
- src: "undoHotKeyActorLogic";
147
- logic: UndoHotKeyActorLogic;
148
- id: "undoHotKey";
149
- }, never, {
150
- type: "can undo";
151
- params: unknown;
152
- }, "timeout", EventObject>[];
153
- target: string;
154
- };
155
- undo: {};
156
- };
157
- };
158
- readonly pending: {
159
- tags: "pending";
160
- on: {
161
- sync: {
162
- target: string;
163
- reenter: true;
164
- };
165
- 'editing.start': {
166
- target: string;
167
- actions: ActionFunction<Readonly<Input & {
168
- history: ReadonlyArray<HistorySnapshot>;
169
- beforeEditing: HistorySnapshot | null;
170
- editing: "node" | "edge" | null;
171
- }>, Events, Events, undefined, {
172
- src: "undoHotKeyActorLogic";
173
- logic: UndoHotKeyActorLogic;
174
- id: "undoHotKey";
175
- }, never, never, never, never>;
176
- };
177
- undo: {
178
- guard: "can undo";
179
- actions: ActionFunction<Readonly<Input & {
180
- history: ReadonlyArray<HistorySnapshot>;
181
- beforeEditing: HistorySnapshot | null;
182
- editing: "node" | "edge" | null;
183
- }>, Events, Events, undefined, {
184
- src: "undoHotKeyActorLogic";
185
- logic: UndoHotKeyActorLogic;
186
- id: "undoHotKey";
187
- }, never, {
188
- type: "can undo";
189
- params: unknown;
190
- }, "timeout", EventObject>;
191
- target: string;
192
- };
193
- };
194
- after: {
195
- timeout: {
196
- target: string;
197
- actions: ActionFunction<Readonly<Input & {
198
- history: ReadonlyArray<HistorySnapshot>;
199
- beforeEditing: HistorySnapshot | null;
200
- editing: "node" | "edge" | null;
201
- }>, Events, Events, undefined, never, never, never, "timeout", never>;
202
- };
203
- };
204
- };
205
- readonly paused: {
206
- tags: "pending";
207
- on: {
208
- 'editing.stop': {
209
- actions: ActionFunction<Readonly<Input & {
210
- history: ReadonlyArray<HistorySnapshot>;
211
- beforeEditing: HistorySnapshot | null;
212
- editing: "node" | "edge" | null;
213
- }>, Events, Events, undefined, {
214
- src: "undoHotKeyActorLogic";
215
- logic: UndoHotKeyActorLogic;
216
- id: "undoHotKey";
217
- }, never, {
218
- type: "can undo";
219
- params: unknown;
220
- }, "timeout", EventObject>[];
221
- target: string;
222
- };
223
- undo: {};
224
- };
225
- };
226
- readonly stopped: {
227
- readonly entry: readonly [ ActionFunction<Readonly<Input & {
228
- history: ReadonlyArray<HistorySnapshot>;
229
- beforeEditing: HistorySnapshot | null;
230
- editing: "node" | "edge" | null;
231
- }>, Events, Events, undefined, {
232
- src: "undoHotKeyActorLogic";
233
- logic: UndoHotKeyActorLogic;
234
- id: "undoHotKey";
235
- }, never, never, never, never>, ActionFunction<Readonly<Input & {
236
- history: ReadonlyArray<HistorySnapshot>;
237
- beforeEditing: HistorySnapshot | null;
238
- editing: "node" | "edge" | null;
239
- }>, Events, Events, undefined, {
240
- src: "undoHotKeyActorLogic";
241
- logic: UndoHotKeyActorLogic;
242
- id: "undoHotKey";
243
- }, never, {
244
- type: "can undo";
245
- params: unknown;
246
- }, "timeout", EventObject>];
247
- readonly type: "final";
248
- };
249
- };
250
- readonly on: {
251
- readonly cancel: {
252
- readonly target: ".idle";
253
- };
254
- readonly synced: {
255
- readonly actions: ActionFunction<Readonly<Input & {
256
- history: ReadonlyArray<HistorySnapshot>;
257
- beforeEditing: HistorySnapshot | null;
258
- editing: "node" | "edge" | null;
259
- }>, Events, Events, undefined, {
260
- src: "undoHotKeyActorLogic";
261
- logic: UndoHotKeyActorLogic;
262
- id: "undoHotKey";
263
- }, never, never, never, never>;
264
- readonly target: ".idle";
265
- };
266
- readonly stop: {
267
- readonly target: ".stopped";
268
- };
269
- };
270
- }>;
271
- /**
272
- * Here is a trick to reduce inference types
273
- */
274
- type InferredMachine = ActorLogicFrom<typeof _syncManualLayoutActorLogic>;
275
- export interface SyncLayoutActorLogic extends InferredMachine {
276
- }
277
- export type SyncLayoutActorRef = ActorRefFromLogic<SyncLayoutActorLogic>;
278
- export type SyncLayoutActorSnapshot = SnapshotFrom<SyncLayoutActorLogic>;
279
- export declare const syncManualLayoutActorLogic: SyncLayoutActorLogic;
280
- export {};
@@ -1,248 +0,0 @@
1
- import { deepEqual } from 'fast-equals';
2
- import { last, map } from 'remeda';
3
- import { setup, assign, assertEvent } from 'xstate';
4
- import { createViewChange } from './createViewChange.js';
5
- import { undoHotKeyActorLogic } from './hotkeyActor.js';
6
-
7
- const diagramActorRef = function(system) {
8
- return system.get("diagram");
9
- };
10
- const syncManualLayout = setup({
11
- types: {
12
- context: {},
13
- input: {},
14
- events: {},
15
- tags: "",
16
- children: {}
17
- },
18
- delays: {
19
- "timeout": 2e3
20
- },
21
- guards: {
22
- "can undo": ({ context }) => context.history.length > 0
23
- },
24
- actors: {
25
- undoHotKeyActorLogic
26
- }
27
- });
28
- const pushHistory = syncManualLayout.assign(({ context }) => {
29
- const snapshot = context.beforeEditing;
30
- if (!snapshot) {
31
- return {};
32
- }
33
- const prevHistoryItem = last(context.history);
34
- if (deepEqual(prevHistoryItem?.xyedges, snapshot.xyedges) && deepEqual(prevHistoryItem?.xynodes, snapshot.xynodes)) {
35
- return {
36
- beforeEditing: null
37
- };
38
- }
39
- return {
40
- beforeEditing: null,
41
- history: [
42
- ...context.history,
43
- snapshot
44
- ]
45
- };
46
- });
47
- const popHistory = syncManualLayout.assign(({ context }) => {
48
- if (context.history.length === 0) {
49
- return {};
50
- }
51
- return {
52
- history: context.history.slice(0, -1)
53
- };
54
- });
55
- const startEditing = syncManualLayout.assign(({ system, event }) => {
56
- assertEvent(event, "editing.start");
57
- const parentContext = diagramActorRef(system).getSnapshot().context;
58
- return {
59
- editing: event.subject,
60
- beforeEditing: {
61
- xynodes: map(parentContext.xynodes, (n) => ({ ...n })),
62
- xyedges: map(parentContext.xyedges, (e) => ({ ...e })),
63
- change: createViewChange(parentContext),
64
- view: parentContext.view,
65
- synched: false
66
- }
67
- };
68
- });
69
- const ensureHotKey = syncManualLayout.enqueueActions(({ check, enqueue, self }) => {
70
- const hasUndo = check("can undo");
71
- const undoHotKey = self.getSnapshot().children["undoHotKey"];
72
- if (undoHotKey && !hasUndo) {
73
- enqueue.stopChild(undoHotKey);
74
- return;
75
- }
76
- if (!undoHotKey && hasUndo) {
77
- enqueue.spawnChild("undoHotKeyActorLogic", {
78
- id: "undoHotKey"
79
- });
80
- }
81
- });
82
- const stopEditing = syncManualLayout.enqueueActions(({ event, enqueue }) => {
83
- assertEvent(event, "editing.stop");
84
- if (event.wasChanged) {
85
- enqueue.cancel("sync");
86
- enqueue(pushHistory);
87
- enqueue.raise({ type: "sync" }, { id: "sync", delay: 50 });
88
- }
89
- enqueue.assign({
90
- beforeEditing: null,
91
- editing: null
92
- });
93
- });
94
- const emitOnChange = syncManualLayout.sendTo(
95
- ({ system }) => diagramActorRef(system),
96
- ({ system }) => {
97
- const parentContext = diagramActorRef(system).getSnapshot().context;
98
- return {
99
- type: "emit.onChange",
100
- change: createViewChange(parentContext)
101
- };
102
- }
103
- );
104
- const markHistoryAsSynched = syncManualLayout.assign(({ context, event }) => {
105
- assertEvent(event, "synced");
106
- return {
107
- history: context.history.map((i) => ({
108
- ...i,
109
- synched: true
110
- })),
111
- beforeEditing: context.beforeEditing ? {
112
- ...context.beforeEditing,
113
- synched: true
114
- } : null
115
- };
116
- });
117
- const undo = syncManualLayout.enqueueActions(({ context, enqueue, system }) => {
118
- const lastHistoryItem = last(context.history);
119
- if (!lastHistoryItem) {
120
- return;
121
- }
122
- enqueue(popHistory);
123
- enqueue(ensureHotKey);
124
- const diagramActor = diagramActorRef(system);
125
- enqueue.sendTo(diagramActor, {
126
- type: "update.view",
127
- view: lastHistoryItem.view,
128
- xyedges: lastHistoryItem.xyedges,
129
- xynodes: lastHistoryItem.xynodes
130
- });
131
- if (lastHistoryItem.synched) {
132
- enqueue.sendTo(diagramActor, {
133
- type: "emit.onChange",
134
- change: lastHistoryItem.change
135
- });
136
- }
137
- });
138
- const idle = syncManualLayout.createStateConfig({
139
- tags: "ready",
140
- entry: [
141
- assign({
142
- beforeEditing: null,
143
- editing: null
144
- })
145
- ],
146
- on: {
147
- sync: {
148
- target: "pending"
149
- },
150
- "editing.start": {
151
- actions: startEditing,
152
- target: "editing"
153
- },
154
- undo: {
155
- guard: "can undo",
156
- actions: undo
157
- }
158
- }
159
- });
160
- const editing = syncManualLayout.createStateConfig({
161
- on: {
162
- "editing.stop": {
163
- actions: [
164
- stopEditing,
165
- ensureHotKey
166
- ],
167
- target: "idle"
168
- },
169
- undo: {}
170
- }
171
- });
172
- const pending = syncManualLayout.createStateConfig({
173
- tags: "pending",
174
- on: {
175
- sync: {
176
- target: "pending",
177
- reenter: true
178
- },
179
- "editing.start": {
180
- target: "paused",
181
- actions: startEditing
182
- },
183
- undo: {
184
- guard: "can undo",
185
- actions: undo,
186
- target: "idle"
187
- }
188
- },
189
- after: {
190
- "timeout": {
191
- target: "idle",
192
- actions: emitOnChange
193
- }
194
- }
195
- });
196
- const paused = syncManualLayout.createStateConfig({
197
- tags: "pending",
198
- on: {
199
- "editing.stop": {
200
- actions: [
201
- stopEditing,
202
- ensureHotKey
203
- ],
204
- target: "pending"
205
- },
206
- undo: {}
207
- }
208
- });
209
- const _syncManualLayoutActorLogic = syncManualLayout.createMachine({
210
- initial: "idle",
211
- context: ({ input }) => ({
212
- ...input,
213
- history: [],
214
- beforeEditing: null,
215
- editing: null
216
- }),
217
- states: {
218
- idle,
219
- editing,
220
- pending,
221
- paused,
222
- stopped: {
223
- entry: [
224
- assign({
225
- beforeEditing: null,
226
- history: []
227
- }),
228
- ensureHotKey
229
- ],
230
- type: "final"
231
- }
232
- },
233
- on: {
234
- cancel: {
235
- target: ".idle"
236
- },
237
- synced: {
238
- actions: markHistoryAsSynched,
239
- target: ".idle"
240
- },
241
- stop: {
242
- target: ".stopped"
243
- }
244
- }
245
- });
246
- const syncManualLayoutActorLogic = _syncManualLayoutActorLogic;
247
-
248
- export { syncManualLayoutActorLogic };