@likec4/diagram 1.57.0 → 1.59.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 (329) hide show
  1. package/dist/LikeC4Diagram.js +1 -1
  2. package/dist/LikeC4Diagram.props.d.ts +1 -1
  3. package/dist/LikeC4Styles.js +1 -1
  4. package/dist/LikeC4View.js +2 -2
  5. package/dist/ReactLikeC4.d.ts +1 -1
  6. package/dist/base/Base.d.ts +3 -2
  7. package/dist/base/Base.js +14 -26
  8. package/dist/base/BaseXYFlow.d.ts +2 -1
  9. package/dist/base/BaseXYFlow.js +63 -4
  10. package/dist/base/keyboardZoom.d.ts +3 -0
  11. package/dist/base/keyboardZoom.js +20 -0
  12. package/dist/base/updateEdges.js +7 -16
  13. package/dist/base/updateNodes.js +3 -9
  14. package/dist/base-primitives/Markdown.d.ts +1 -1
  15. package/dist/base-primitives/NodeHandles.d.ts +1 -1
  16. package/dist/base-primitives/compound/CompoundActionButton.d.ts +2 -1
  17. package/dist/base-primitives/compound/CompoundActionButton.js +5 -2
  18. package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +2 -1
  19. package/dist/base-primitives/compound/CompoundDetailsButton.js +5 -2
  20. package/dist/base-primitives/compound/CompoundNodeContainer.d.ts +1 -1
  21. package/dist/base-primitives/compound/CompoundTitle.d.ts +7 -1
  22. package/dist/base-primitives/compound/CompoundTitle.js +2 -1
  23. package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
  24. package/dist/base-primitives/edge/EdgeActionButton.d.ts +2 -1
  25. package/dist/base-primitives/edge/EdgeActionButton.js +2 -1
  26. package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
  27. package/dist/base-primitives/edge/EdgeContainer.js +4 -2
  28. package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -0
  29. package/dist/base-primitives/edge/EdgeLabel.js +2 -5
  30. package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
  31. package/dist/base-primitives/edge/EdgeMarkers.d.ts +8 -8
  32. package/dist/base-primitives/element/ElementActionButtons.d.ts +2 -1
  33. package/dist/base-primitives/element/ElementActionButtons.js +4 -1
  34. package/dist/base-primitives/element/ElementData.d.ts +4 -2
  35. package/dist/base-primitives/element/ElementData.js +2 -1
  36. package/dist/base-primitives/element/ElementDetailsButton.d.ts +2 -1
  37. package/dist/base-primitives/element/ElementDetailsButton.js +5 -2
  38. package/dist/base-primitives/element/ElementNodeContainer.js +1 -1
  39. package/dist/base-primitives/element/ElementShape.d.ts +1 -1
  40. package/dist/base-primitives/element/ElementShape.js +3 -0
  41. package/dist/base-primitives/element/ElementTags.d.ts +1 -1
  42. package/dist/base-primitives/element/ElementTags.js +1 -3
  43. package/dist/components/ErrorFallback.d.ts +2 -2
  44. package/dist/components/ErrorFallback.js +3 -5
  45. package/dist/components/Link.js +6 -6
  46. package/dist/components/NavigationPanel.d.ts +2 -2
  47. package/dist/components/NavigationPanel.js +1 -1
  48. package/dist/components/PortalToContainer.d.ts +1 -1
  49. package/dist/components/RootContainer.d.ts +1 -1
  50. package/dist/components/SearchControl.css.js +11 -11
  51. package/dist/components/SearchControl.d.ts +2 -2
  52. package/dist/components/ViewNotFound.d.ts +2 -2
  53. package/dist/context/CurrentViewModelProvider.d.ts +1 -1
  54. package/dist/context/DefaultMantineProvider.d.ts +1 -1
  55. package/dist/context/DiagramEventHandlers.d.ts +1 -1
  56. package/dist/context/EnsureMantine.d.ts +1 -1
  57. package/dist/context/FramerMotionConfig.d.ts +3 -3
  58. package/dist/context/FramerMotionConfig.js +2 -2
  59. package/dist/context/IconRenderer.d.ts +2 -2
  60. package/dist/context/IconRenderer.js +32 -12
  61. package/dist/context/LikeC4ModelContext.d.ts +1 -1
  62. package/dist/context/TagStylesContext.d.ts +4 -3
  63. package/dist/context/TagStylesContext.js +20 -22
  64. package/dist/custom/index.d.ts +1 -0
  65. package/dist/custom/index.js +3 -2
  66. package/dist/editor/LikeC4EditorProvider.d.ts +2 -2
  67. package/dist/editor/actor/actions.d.ts +74 -15
  68. package/dist/editor/actor/actions.js +91 -25
  69. package/dist/editor/actor/hotkey.d.ts +1 -1
  70. package/dist/editor/actor/hotkey.js +7 -0
  71. package/dist/editor/actor/machine.d.ts +4 -6
  72. package/dist/editor/actor/machine.js +1 -0
  73. package/dist/editor/actor/setup.d.ts +25 -4
  74. package/dist/editor/actor/setup.js +8 -6
  75. package/dist/editor/actor/state.editor.d.ts +64 -14
  76. package/dist/editor/actor/state.editor.js +12 -11
  77. package/dist/editor/actor/state.sync-queue.d.ts +283 -91
  78. package/dist/editor/actor/state.sync-queue.js +93 -56
  79. package/dist/editor/actor/types.d.ts +6 -1
  80. package/dist/editor/actor/types.js +1 -1
  81. package/dist/editor/useEditorActorLogic.js +14 -2
  82. package/dist/hooks/index.d.ts +1 -1
  83. package/dist/hooks/safeContext.d.ts +156 -3
  84. package/dist/hooks/safeContext.js +60 -12
  85. package/dist/hooks/useCurrentViewModel.js +1 -1
  86. package/dist/hooks/useDiagram.d.ts +8 -0
  87. package/dist/hooks/useDiagram.js +9 -2
  88. package/dist/hooks/useEditorActor.d.ts +5 -0
  89. package/dist/hooks/useEditorActor.js +4 -3
  90. package/dist/hooks/useLikeC4ElementsTree.js +1 -1
  91. package/dist/hooks/useLikeC4Model.js +1 -1
  92. package/dist/hooks/useXYFlow.d.ts +1 -0
  93. package/dist/hooks/useXYFlow.js +5 -3
  94. package/dist/index.d.ts +3 -1
  95. package/dist/index.js +4 -2
  96. package/dist/likec4diagram/DiagramUI.d.ts +1 -1
  97. package/dist/likec4diagram/DiagramUI.js +19 -6
  98. package/dist/likec4diagram/DiagramXYFlow.js +54 -17
  99. package/dist/likec4diagram/convert-to-xyflow.d.ts +3 -5
  100. package/dist/likec4diagram/convert-to-xyflow.js +29 -10
  101. package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +1 -1
  102. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +140 -18
  103. package/dist/likec4diagram/custom/edges/SequenceStepEdge.d.ts +1 -1
  104. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +11 -4
  105. package/dist/likec4diagram/custom/edges/edges.css.d.ts +1 -0
  106. package/dist/likec4diagram/custom/edges/edges.css.js +6 -2
  107. package/dist/likec4diagram/custom/index.d.ts +2 -1
  108. package/dist/likec4diagram/custom/index.js +5 -3
  109. package/dist/likec4diagram/custom/nodes/CompoundActions.d.ts +1 -1
  110. package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -0
  111. package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +4 -4
  112. package/dist/likec4diagram/custom/nodes/ElementActions.js +13 -3
  113. package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -1
  114. package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +1 -1
  115. package/dist/likec4diagram/custom/nodes/NodeNotes.js +0 -4
  116. package/dist/likec4diagram/custom/nodes/SequenceActorNode.d.ts +2 -2
  117. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +32 -19
  118. package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.ts +2 -0
  119. package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +234 -0
  120. package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
  121. package/dist/likec4diagram/custom/nodes/nodes.d.ts +7 -7
  122. package/dist/likec4diagram/custom/nodes/nodes.js +20 -5
  123. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +3 -3
  124. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
  125. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.d.ts +2 -2
  126. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +2 -2
  127. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +1 -1
  128. package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +3 -3
  129. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +1 -1
  130. package/dist/likec4diagram/relationship-popover/RelationshipPopover.d.ts +1 -1
  131. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -14
  132. package/dist/likec4diagram/relationship-popover/components.d.ts +2 -2
  133. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +1 -1
  134. package/dist/likec4diagram/state/DiagramActorProvider.js +11 -20
  135. package/dist/likec4diagram/state/aligners.js +1 -1
  136. package/dist/likec4diagram/state/assign.d.ts +1 -1
  137. package/dist/likec4diagram/state/assign.js +1 -1
  138. package/dist/likec4diagram/state/createViewChange.js +2 -1
  139. package/dist/likec4diagram/state/diagram-api.d.ts +18 -10
  140. package/dist/likec4diagram/state/diagram-api.js +333 -229
  141. package/dist/likec4diagram/state/machine.actions.d.ts +1026 -332
  142. package/dist/likec4diagram/state/machine.actions.js +118 -46
  143. package/dist/likec4diagram/state/machine.actions.layout.d.ts +123 -51
  144. package/dist/likec4diagram/state/machine.actions.layout.js +40 -33
  145. package/dist/likec4diagram/state/machine.d.ts +154 -16
  146. package/dist/likec4diagram/state/machine.js +5 -41
  147. package/dist/likec4diagram/state/machine.setup.d.ts +84 -19
  148. package/dist/likec4diagram/state/machine.setup.js +65 -12
  149. package/dist/likec4diagram/state/machine.state.initializing.d.ts +59 -33
  150. package/dist/likec4diagram/state/machine.state.navigating.js +7 -3
  151. package/dist/likec4diagram/state/machine.state.ready.d.ts +1540 -476
  152. package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +294 -53
  153. package/dist/likec4diagram/state/machine.state.ready.focused.js +3 -3
  154. package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +264 -73
  155. package/dist/likec4diagram/state/machine.state.ready.idle.js +31 -6
  156. package/dist/likec4diagram/state/machine.state.ready.js +22 -16
  157. package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +23 -9
  158. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +288 -84
  159. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +135 -66
  160. package/dist/likec4diagram/state/types.d.ts +4 -2
  161. package/dist/likec4diagram/state/utils.d.ts +7 -0
  162. package/dist/likec4diagram/state/utils.js +36 -34
  163. package/dist/likec4diagram/types.d.ts +49 -3
  164. package/dist/likec4diagram/ui/FloatingSequenceActors.d.ts +6 -0
  165. package/dist/likec4diagram/ui/FloatingSequenceActors.js +155 -0
  166. package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +1 -1
  167. package/dist/likec4diagram/ui/LayoutDriftFrame.js +2 -2
  168. package/dist/likec4diagram/ui/index.d.ts +2 -0
  169. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -5
  170. package/dist/likec4diagram/ui/notation/NotationPanel.d.ts +1 -1
  171. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +2 -0
  172. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +519 -0
  173. package/dist/likec4diagram/ui/sequence-outline/state.d.ts +36 -0
  174. package/dist/likec4diagram/ui/sequence-outline/state.js +55 -0
  175. package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +1 -1
  176. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +116 -62
  177. package/dist/likec4diagram/xyflow-sequence/_types.d.ts +55 -5
  178. package/dist/likec4diagram/xyflow-sequence/const.d.ts +5 -5
  179. package/dist/likec4diagram/xyflow-sequence/const.js +4 -4
  180. package/dist/likec4diagram/xyflow-sequence/layouter.d.ts +30 -6
  181. package/dist/likec4diagram/xyflow-sequence/layouter.js +561 -0
  182. package/dist/likec4diagram/xyflow-sequence/{sequence-layout.d.ts → sequence-view-to-xy.d.ts} +8 -2
  183. package/dist/likec4diagram/xyflow-sequence/{sequence-layout.js → sequence-view-to-xy.js} +112 -14
  184. package/dist/likec4diagram/xyflow-sequence/sequence-view.d.ts +2 -7
  185. package/dist/likec4diagram/xyflow-sequence/sequence-view.js +144 -0
  186. package/dist/likec4diagram/xyflow-sequence/utils.d.ts +9 -1
  187. package/dist/likec4diagram/xyflow-sequence/utils.js +96 -0
  188. package/dist/navigationpanel/NavigationPanel.d.ts +5 -2
  189. package/dist/navigationpanel/NavigationPanel.js +58 -59
  190. package/dist/navigationpanel/NavigationPanelControls.d.ts +1 -1
  191. package/dist/navigationpanel/NavigationPanelDropdown.d.ts +1 -1
  192. package/dist/navigationpanel/NavigationPanelDropdown.js +47 -40
  193. package/dist/navigationpanel/_common.d.ts +2 -2
  194. package/dist/navigationpanel/_common.js +2 -2
  195. package/dist/navigationpanel/actor.actions.d.ts +19 -0
  196. package/dist/navigationpanel/actor.actions.js +45 -0
  197. package/dist/navigationpanel/actor.d.ts +34 -96
  198. package/dist/navigationpanel/actor.js +21 -84
  199. package/dist/navigationpanel/actor.setup.d.ts +98 -0
  200. package/dist/navigationpanel/actor.setup.js +31 -0
  201. package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +1 -1
  202. package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +1 -1
  203. package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -1
  204. package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
  205. package/dist/navigationpanel/comparepanel/DriftsSummary.js +4 -5
  206. package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +1 -1
  207. package/dist/navigationpanel/controls/DetailsControls.d.ts +1 -1
  208. package/dist/navigationpanel/controls/DetailsControls.js +7 -8
  209. package/dist/navigationpanel/controls/LayoutWarning.d.ts +1 -1
  210. package/dist/navigationpanel/controls/LogoButton.d.ts +1 -1
  211. package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
  212. package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
  213. package/dist/navigationpanel/controls/SearchControl.d.ts +1 -1
  214. package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
  215. package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
  216. package/dist/navigationpanel/editorpanel/CenterCamera.d.ts +1 -1
  217. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
  218. package/dist/navigationpanel/editorpanel/EditorPanel.d.ts +1 -1
  219. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +1 -1
  220. package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -1
  221. package/dist/navigationpanel/editorpanel/styles.js +8 -8
  222. package/dist/navigationpanel/hooks.d.ts +20 -5
  223. package/dist/navigationpanel/hooks.js +4 -18
  224. package/dist/navigationpanel/styles.css.d.ts +1 -1
  225. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.d.ts +1 -1
  226. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +2 -2
  227. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -5
  228. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +23 -25
  229. package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +1 -1
  230. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +5 -5
  231. package/dist/overlays/Overlays.d.ts +4 -2
  232. package/dist/overlays/Overlays.js +10 -10
  233. package/dist/overlays/element-details/ElementDetails.d.ts +1 -1
  234. package/dist/overlays/element-details/ElementDetailsCard.css.js +17 -17
  235. package/dist/overlays/element-details/ElementDetailsCard.d.ts +1 -1
  236. package/dist/overlays/element-details/MetadataValue.d.ts +2 -2
  237. package/dist/overlays/element-details/MetadataValue.js +15 -15
  238. package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -5
  239. package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -11
  240. package/dist/overlays/element-details/TabPanelRelationships.d.ts +1 -1
  241. package/dist/overlays/element-details/TabPanelRelationships.js +1 -1
  242. package/dist/overlays/element-details/TabPanelStructure.css.js +2 -2
  243. package/dist/overlays/element-details/TabPanelStructure.d.ts +2 -2
  244. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  245. package/dist/overlays/element-details/actor.d.ts +2 -3
  246. package/dist/overlays/hooks.d.ts +28 -0
  247. package/dist/overlays/hooks.js +5 -0
  248. package/dist/overlays/overlay/Overlay.js +34 -25
  249. package/dist/overlays/overlaysActor.js +0 -1
  250. package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
  251. package/dist/overlays/relationship-details/SelectEdge.d.ts +1 -1
  252. package/dist/overlays/relationship-details/custom/ElementActions.d.ts +1 -1
  253. package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +4 -4
  254. package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
  255. package/dist/overlays/relationship-details/layout.js +1 -1
  256. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
  257. package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
  258. package/dist/overlays/relationships-browser/SelectElement.d.ts +1 -1
  259. package/dist/overlays/relationships-browser/actor.js +79 -78
  260. package/dist/overlays/relationships-browser/custom/ElementActions.d.ts +1 -1
  261. package/dist/overlays/relationships-browser/custom/EmptyNode.d.ts +1 -1
  262. package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +4 -4
  263. package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
  264. package/dist/overlays/relationships-browser/hooks.js +1 -1
  265. package/dist/overlays/relationships-browser/layout.js +2 -2
  266. package/dist/projects-overview/ProjectsOverview.d.ts +1 -1
  267. package/dist/projects-overview/actor.js +4 -4
  268. package/dist/projects-overview/custom/nodeTypes.d.ts +1 -1
  269. package/dist/projects-overview/panel/ProjectsOverviewPanel.d.ts +1 -1
  270. package/dist/search/Search.d.ts +1 -1
  271. package/dist/search/Search.js +1 -1
  272. package/dist/search/XStateSearchAdapter.d.ts +1 -1
  273. package/dist/search/components/ElementsColumn.css.js +2 -2
  274. package/dist/search/components/ElementsColumn.d.ts +1 -1
  275. package/dist/search/components/PickView.d.ts +1 -1
  276. package/dist/search/components/SearchByTags.d.ts +1 -1
  277. package/dist/search/components/SearchInput.d.ts +1 -1
  278. package/dist/search/components/ViewsColum.d.ts +3 -3
  279. package/dist/search/components/ViewsColum.js +1 -1
  280. package/dist/search/components/_shared.css.d.ts +1 -1
  281. package/dist/search/components/_shared.css.js +23 -23
  282. package/dist/search/components/styles.css.js +4 -4
  283. package/dist/shadowroot/ShadowRoot.d.ts +2 -3
  284. package/dist/shadowroot/ShadowRoot.js +95 -41
  285. package/dist/shadowroot/index.d.ts +1 -0
  286. package/dist/styles2.js +1 -1
  287. package/dist/utils/defineActors.d.ts +21 -0
  288. package/dist/utils/defineActors.js +13 -0
  289. package/dist/utils/index.d.ts +1 -0
  290. package/dist/utils/index.js +5 -4
  291. package/dist/utils/readableText.d.ts +11 -0
  292. package/dist/utils/readableText.js +18 -0
  293. package/package.json +30 -43
  294. package/panda.buildinfo.json +271 -295
  295. package/styles-min.css +1 -1
  296. package/styles-xyflow.css +1 -1
  297. package/styles.css +1 -1
  298. package/adhoc-editor/package.json +0 -4
  299. package/dist/adhoc-editor/EditorPanel.d.ts +0 -1
  300. package/dist/adhoc-editor/EditorPanel.js +0 -106
  301. package/dist/adhoc-editor/ElementsTree.d.ts +0 -2
  302. package/dist/adhoc-editor/ElementsTree.js +0 -112
  303. package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +0 -4
  304. package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +0 -83
  305. package/dist/adhoc-editor/components/Tree.d.ts +0 -48
  306. package/dist/adhoc-editor/components/Tree.js +0 -213
  307. package/dist/adhoc-editor/hooks.d.ts +0 -14
  308. package/dist/adhoc-editor/hooks.js +0 -34
  309. package/dist/adhoc-editor/index.d.ts +0 -2
  310. package/dist/adhoc-editor/index.js +0 -2
  311. package/dist/adhoc-editor/state/ActorProvider.d.ts +0 -5
  312. package/dist/adhoc-editor/state/ActorProvider.js +0 -37
  313. package/dist/adhoc-editor/state/actor.d.ts +0 -13
  314. package/dist/adhoc-editor/state/actor.editor.d.ts +0 -56
  315. package/dist/adhoc-editor/state/actor.editor.js +0 -167
  316. package/dist/adhoc-editor/state/actor.js +0 -14
  317. package/dist/adhoc-editor/state/actor.layouter.d.ts +0 -51
  318. package/dist/adhoc-editor/state/actor.layouter.js +0 -54
  319. package/dist/adhoc-editor/state/actor.types.d.ts +0 -63
  320. package/dist/adhoc-editor/state/actor.types.js +0 -25
  321. package/dist/adhoc-editor/state/panel.d.ts +0 -95
  322. package/dist/adhoc-editor/state/panel.js +0 -124
  323. package/dist/adhoc-editor/state/utils.d.ts +0 -17
  324. package/dist/adhoc-editor/state/utils.js +0 -25
  325. package/dist/adhoc-editor/useElementsTree.d.ts +0 -18
  326. package/dist/adhoc-editor/useElementsTree.js +0 -98
  327. package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +0 -6
  328. package/dist/shadowroot/styles.css.d.ts +0 -12
  329. package/dist/shadowroot/styles.css.js +0 -59
@@ -0,0 +1,31 @@
1
+ import "../_virtual/_rolldown/runtime.js";
2
+ import { isEmpty } from "remeda";
3
+ import { setup } from "xstate";
4
+ //#region src/navigationpanel/actor.setup.ts
5
+ function Context({ input }) {
6
+ return {
7
+ ...input,
8
+ activatedBy: "hover",
9
+ selectedFolder: "",
10
+ searchQuery: ""
11
+ };
12
+ }
13
+ var actor = setup({
14
+ types: {
15
+ context: {},
16
+ events: {},
17
+ tags: "",
18
+ input: {}
19
+ },
20
+ delays: {
21
+ "open timeout": 500,
22
+ "close timeout": 350
23
+ },
24
+ guards: {
25
+ "was opened on hover": ({ context }) => context.activatedBy === "hover",
26
+ "has search query": ({ context }) => !isEmpty(context.searchQuery),
27
+ "search query is empty": ({ context }) => isEmpty(context.searchQuery)
28
+ }
29
+ });
30
+ //#endregion
31
+ export { Context, actor };
@@ -2,4 +2,4 @@ export declare function CompareActionsMenu({ disabled, onApplyLatestToManual, on
2
2
  disabled?: boolean;
3
3
  onApplyLatestToManual?: undefined | (() => void);
4
4
  onResetManualLayout: () => void;
5
- }): import("react/jsx-runtime").JSX.Element;
5
+ }): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { MemoExoticComponent } from 'react';
2
- export declare const ComparePanel: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
2
+ export declare const ComparePanel: MemoExoticComponent<() => import("react").JSX.Element>;
@@ -1 +1 @@
1
- export declare function ComparePanelControls(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function ComparePanelControls(): import("react").JSX.Element;
@@ -1 +1 @@
1
- export declare function DriftsSummary(): import("react/jsx-runtime").JSX.Element | null;
1
+ export declare function DriftsSummary(): import("react").JSX.Element | null;
@@ -1,7 +1,6 @@
1
1
  import "../../_virtual/_rolldown/runtime.js";
2
2
  import { useCallbackRef as useCallbackRef$1 } from "../../hooks/useCallbackRef.js";
3
- import { useDiagram } from "../../hooks/safeContext.js";
4
- import { selectDiagramActorContext, useDiagramSnapshot } from "../../hooks/useDiagram.js";
3
+ import { selectDiagramContext, useDiagram, useDiagramSelector } from "../../hooks/safeContext.js";
5
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
5
  import { deepEqual } from "fast-equals";
7
6
  import { filter, hasAtLeast, map, pipe } from "remeda";
@@ -13,7 +12,7 @@ import { vstack } from "@likec4/styles/patterns";
13
12
  var hasDrifts = (item) => {
14
13
  return !!item.drifts && hasAtLeast(item.drifts, 1);
15
14
  };
16
- var selectDrifts = selectDiagramActorContext((ctx) => ({
15
+ var selectDrifts = selectDiagramContext((ctx) => ({
17
16
  view: ctx.view.drifts ?? [],
18
17
  nodes: pipe(ctx.view.nodes, map((node) => ({
19
18
  id: node.id,
@@ -24,7 +23,7 @@ var selectDrifts = selectDiagramActorContext((ctx) => ({
24
23
  edgeId: edge.id,
25
24
  drifts: edge.drifts
26
25
  })), filter(hasDrifts))
27
- }));
26
+ }), deepEqual);
28
27
  var variants = {
29
28
  initial: {
30
29
  opacity: 0,
@@ -45,7 +44,7 @@ var variants = {
45
44
  }
46
45
  };
47
46
  function DriftsSummary() {
48
- const selected = useDiagramSnapshot(selectDrifts, deepEqual);
47
+ const selected = useDiagramSelector(selectDrifts);
49
48
  const diagram = useDiagram();
50
49
  const onMouseLeaveDebounced = useDebouncedCallback((e) => {
51
50
  e.stopPropagation();
@@ -2,4 +2,4 @@ import { LayoutType } from '@likec4/core';
2
2
  export declare function LayoutTypeSwitcher({ value, onChange, }: {
3
3
  value: LayoutType;
4
4
  onChange: (layout: LayoutType) => void;
5
- }): import("react/jsx-runtime").JSX.Element;
5
+ }): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { PopoverProps } from '@mantine/core';
2
- export declare const DetailsControls: (props: PopoverProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const DetailsControls: (props: PopoverProps) => import("react").JSX.Element;
@@ -2,7 +2,7 @@ import "../../_virtual/_rolldown/runtime.js";
2
2
  import { useDiagram } from "../../hooks/safeContext.js";
3
3
  import { useOnDiagramEvent } from "../../hooks/useDiagram.js";
4
4
  import { useMantinePortalProps } from "../../hooks/useMantinePortalProps.js";
5
- import { useNavigationActorSnapshot } from "../hooks.js";
5
+ import { selectNavigationContext, useNavigationActorSelector } from "../hooks.js";
6
6
  import { Markdown } from "../../base-primitives/Markdown.js";
7
7
  import { ElementTag } from "../../base-primitives/element/ElementTags.js";
8
8
  import { Link } from "../../components/Link.js";
@@ -10,15 +10,14 @@ import { css, cx } from "@likec4/styles/css";
10
10
  import { IconId, IconLink } from "@tabler/icons-react";
11
11
  import { useState } from "react";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
- import { deepEqual } from "fast-equals";
14
13
  import { Badge, Popover, Text, UnstyledButton } from "@mantine/core";
15
14
  import { Box as Box$1, HStack, styled } from "@likec4/styles/jsx";
15
+ import { RichText } from "@likec4/core/types";
16
16
  import { hstack, vstack } from "@likec4/styles/patterns";
17
17
  import * as m from "motion/react-m";
18
- import { RichText } from "@likec4/core/types";
19
18
  import { extractViewTitleFromPath } from "@likec4/core/model";
20
19
  //#region src/navigationpanel/controls/DetailsControls.tsx
21
- var selector = ({ context }) => {
20
+ var selector = selectNavigationContext((context) => {
22
21
  const view = context.view;
23
22
  return {
24
23
  id: view.id,
@@ -27,10 +26,10 @@ var selector = ({ context }) => {
27
26
  tags: view.tags ?? [],
28
27
  links: view.links ?? []
29
28
  };
30
- };
29
+ });
31
30
  var DetailsControls = (props) => {
32
31
  const [opened, setOpened] = useState(false);
33
- const data = useNavigationActorSnapshot(selector, deepEqual);
32
+ const data = useNavigationActorSelector(selector);
34
33
  return /* @__PURE__ */ jsxs(Popover, {
35
34
  position: "bottom-end",
36
35
  shadow: "xl",
@@ -199,8 +198,8 @@ var ViewBadge = ({ label, value }) => {
199
198
  overflow: "visible",
200
199
  px: "1",
201
200
  color: {
202
- _dark: "mantine.colors.gray[4]",
203
- _light: "mantine.colors.gray[8]"
201
+ _dark: "mantine.gray[4]",
202
+ _light: "mantine.gray[8]"
204
203
  }
205
204
  }),
206
205
  label: css({ overflow: "visible" }),
@@ -1,2 +1,2 @@
1
1
  import { MemoExoticComponent } from 'react';
2
- export declare const LayoutWarning: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
2
+ export declare const LayoutWarning: MemoExoticComponent<() => import("react").JSX.Element>;
@@ -1 +1 @@
1
- export declare const LogoButton: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const LogoButton: () => import("react").JSX.Element;
@@ -1 +1 @@
1
- export declare const NavigationButtons: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const NavigationButtons: () => import("react").JSX.Element;
@@ -1 +1 @@
1
- export declare const OpenSource: () => import("react/jsx-runtime").JSX.Element | null;
1
+ export declare const OpenSource: () => import("react").JSX.Element | null;
@@ -1 +1 @@
1
- export declare function SearchControl(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function SearchControl(): import("react").JSX.Element;
@@ -1 +1 @@
1
- export declare const ToggleReadonly: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const ToggleReadonly: () => import("react").JSX.Element;
@@ -45,7 +45,7 @@ function WithProjectsMenu({ projects, onProjectChange }) {
45
45
  fontSize: "xxs",
46
46
  height: "auto",
47
47
  lineHeight: 1.1,
48
- color: { _light: "mantine.colors.gray[9]" }
48
+ color: { _light: "mantine.gray[9]" }
49
49
  }),
50
50
  section: css({ "&:is([data-position=\"right\"])": { marginInlineStart: "1" } })
51
51
  },
@@ -1 +1 @@
1
- export declare const CenterCamera: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const CenterCamera: () => import("react").JSX.Element;
@@ -1 +1 @@
1
- export declare const ChangeAutoLayoutButton: () => import("react/jsx-runtime").JSX.Element | null;
1
+ export declare const ChangeAutoLayoutButton: () => import("react").JSX.Element | null;
@@ -1 +1 @@
1
- export declare function EditorPanel(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function EditorPanel(): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { MemoExoticComponent } from 'react';
2
- export declare const ManualLayoutToolsButton: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
2
+ export declare const ManualLayoutToolsButton: MemoExoticComponent<() => import("react").JSX.Element>;
@@ -1 +1 @@
1
- export declare const ToggleReadonly: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const ToggleReadonly: () => import("react").JSX.Element;
@@ -33,28 +33,28 @@ var autolayoutButton = css({
33
33
  zIndex: 1
34
34
  });
35
35
  var autolayoutIndicator = css({
36
- background: "mantine.colors.gray[2]",
36
+ background: "mantine.gray[2]",
37
37
  borderRadius: "sm",
38
38
  border: `1px solid`,
39
- borderColor: "mantine.colors.gray[4]",
39
+ borderColor: "mantine.gray[4]",
40
40
  _dark: {
41
- background: "mantine.colors.dark[5]",
42
- borderColor: "mantine.colors.dark[4]"
41
+ background: "mantine.dark[5]",
42
+ borderColor: "mantine.dark[4]"
43
43
  }
44
44
  });
45
45
  var spacingSliderBody = css({
46
46
  position: "relative",
47
47
  borderRadius: "sm",
48
- background: "mantine.colors.gray[3]",
49
- boxShadow: "inset 1px 1px 3px 0px #00000024",
50
- _dark: { background: "mantine.colors.dark[7]" }
48
+ background: "mantine.gray[3]",
49
+ boxShadow: "[inset 1px 1px 3px 0px #00000024]",
50
+ _dark: { background: "mantine.dark[7]" }
51
51
  });
52
52
  var spacingSliderThumb = css({
53
53
  position: "absolute",
54
54
  width: "8px",
55
55
  height: "8px",
56
56
  border: `2px solid`,
57
- borderColor: "mantine.colors.gray[5]",
57
+ borderColor: "mantine.gray[5]",
58
58
  borderRadius: "sm",
59
59
  transform: "translate(-50%, -50%)"
60
60
  });
@@ -1,10 +1,25 @@
1
1
  import { ViewId } from '@likec4/core';
2
- import { NavigationPanelActorContext, NavigationPanelActorEvent, NavigationPanelActorRef, NavigationPanelActorSnapshot } from './actor';
2
+ import { NavigationPanelActorEvent, NavigationPanelActorRef } from './actor';
3
3
  import { Provider } from 'react';
4
- export declare const NavigationPanelActorContextProvider: Provider<NavigationPanelActorRef>;
5
- export declare const useNavigationActorRef: () => NavigationPanelActorRef;
6
- export declare function useNavigationActorSnapshot<T = unknown>(selector: (context: NavigationPanelActorSnapshot) => T, compare?: (a: NoInfer<T>, b: NoInfer<T>) => boolean): T;
7
- export declare function useNavigationActorContext<T = unknown>(selector: (context: NavigationPanelActorContext) => T, compare?: (a: NoInfer<T>, b: NoInfer<T>) => boolean): T;
4
+ import { Context } from './actor.setup';
5
+ import { MachineSnapshot } from 'xstate';
6
+ export declare const NavigationPanelActorContextProvider: Provider<NavigationPanelActorRef>, selectNavigationContext: <T>(select: (state: Context) => T, compare?: ((old: NoInfer<T>, next: NoInfer<T>) => boolean) | undefined) => [selector: (snapshot: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
7
+ active?: NonNullable<"search" | "opened" | "decide" | "closing">;
8
+ }, "active", any, any, any>) => T, compare: (a: T, b: T) => boolean], selectNavigationSnapshot: <T>(select: (state: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
9
+ active?: NonNullable<"search" | "opened" | "decide" | "closing">;
10
+ }, "active", any, any, any>) => T, compare?: ((old: NoInfer<T>, next: NoInfer<T>) => boolean) | undefined) => [selector: (snapshot: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
11
+ active?: NonNullable<"search" | "opened" | "decide" | "closing">;
12
+ }, "active", any, any, any>) => T, compare: (a: T, b: T) => boolean], useNavigationActorRef: () => NavigationPanelActorRef, useNavigationActorSelector: {
13
+ <T>(select: (state: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
14
+ active?: NonNullable<"search" | "opened" | "decide" | "closing">;
15
+ }, "active", any, any, any>) => T): T;
16
+ <T>(selectorCompare: [selector: (snapshot: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
17
+ active?: NonNullable<"search" | "opened" | "decide" | "closing">;
18
+ }, "active", any, any, any>) => T, compare: (a: T, b: T) => boolean]): T;
19
+ <T>(selector: (snapshot: MachineSnapshot<Context, NavigationPanelActorEvent, any, "pending" | "idle" | "active" | {
20
+ active?: NonNullable<"search" | "opened" | "decide" | "closing">;
21
+ }, "active", any, any, any>) => T, compare: (a: T, b: T) => boolean): T;
22
+ };
8
23
  export interface NavigationActor {
9
24
  readonly actorRef: NavigationPanelActorRef;
10
25
  send: (event: NavigationPanelActorEvent) => void;
@@ -1,22 +1,8 @@
1
1
  import "../_virtual/_rolldown/runtime.js";
2
- import { createContext, useContext, useMemo } from "react";
3
- import { shallowEqual } from "fast-equals";
4
- import { useSelector } from "@xstate/react";
2
+ import { createSafeContextForActor } from "../hooks/safeContext.js";
3
+ import { useMemo } from "react";
5
4
  //#region src/navigationpanel/hooks.tsx
6
- var NavigationPanelActorSafeContext = createContext(null);
7
- NavigationPanelActorSafeContext.displayName = "NavigationPanelActorSafeContext";
8
- var NavigationPanelActorContextProvider = NavigationPanelActorSafeContext.Provider;
9
- var useNavigationActorRef = () => {
10
- const ctx = useContext(NavigationPanelActorSafeContext);
11
- if (ctx === null) throw new Error("NavigationPanelActorRef is not found in the context");
12
- return ctx;
13
- };
14
- function useNavigationActorSnapshot(selector, compare = shallowEqual) {
15
- return useSelector(useNavigationActorRef(), selector, compare);
16
- }
17
- function useNavigationActorContext(selector, compare = shallowEqual) {
18
- return useNavigationActorSnapshot((snapshot) => selector(snapshot.context), compare);
19
- }
5
+ var { ContextProvider: NavigationPanelActorContextProvider, selectContext: selectNavigationContext, selectSnapshot: selectNavigationSnapshot, useActorRef: useNavigationActorRef, useActorSelector: useNavigationActorSelector } = createSafeContextForActor("NavigationPanel");
20
6
  function useNavigationActor() {
21
7
  const actorRef = useNavigationActorRef();
22
8
  return useMemo(() => ({
@@ -41,4 +27,4 @@ function useNavigationActor() {
41
27
  }), [actorRef]);
42
28
  }
43
29
  //#endregion
44
- export { NavigationPanelActorContextProvider, useNavigationActor, useNavigationActorContext, useNavigationActorRef, useNavigationActorSnapshot };
30
+ export { NavigationPanelActorContextProvider, selectNavigationContext, useNavigationActor, useNavigationActorRef, useNavigationActorSelector };
@@ -1,4 +1,4 @@
1
- import { RecipeRuntimeFn } from '@likec4/styles';
1
+ import { RecipeRuntimeFn } from '../../styled-system/types';
2
2
  export declare const breadcrumbTitle: RecipeRuntimeFn<{
3
3
  truncate: {
4
4
  true: {
@@ -1 +1 @@
1
- export declare function ActiveWalkthroughControls(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function ActiveWalkthroughControls(): import("react").JSX.Element;
@@ -44,7 +44,7 @@ function ActiveWalkthroughControls() {
44
44
  const { isParallel, hasNext, hasPrevious, currentStep, totalSteps } = useDiagramContext((s) => {
45
45
  const currentStepIndex = s.xyedges.findIndex((e) => e.id === s.activeWalkthrough?.stepId);
46
46
  return {
47
- isParallel: isTruthy(s.activeWalkthrough?.parallelPrefix),
47
+ isParallel: isTruthy(s.activeWalkthrough?.activeFlow),
48
48
  hasNext: currentStepIndex < s.xyedges.length - 1,
49
49
  hasPrevious: currentStepIndex > 0,
50
50
  currentStep: currentStepIndex + 1,
@@ -69,7 +69,7 @@ function ActiveWalkthroughControls() {
69
69
  }, "stop-walkthrough"),
70
70
  /* @__PURE__ */ jsx(PrevNextButton, {
71
71
  disabled: !hasPrevious,
72
- onClick: () => diagram.walkthroughStep("previous"),
72
+ onClick: () => diagram.walkthroughStep("prev"),
73
73
  leftSection: /* @__PURE__ */ jsx(IconPlayerSkipBackFilled, { size: 10 }),
74
74
  children: "Previous"
75
75
  }, "prev"),
@@ -2,6 +2,7 @@ import { ButtonProps } from '@mantine/core';
2
2
  import { ForwardRefExoticComponent, Key, AriaRole, ClipboardEventHandler, CompositionEventHandler, FocusEventHandler, ChangeEventHandler, InputEventHandler, ReactEventHandler, SubmitEventHandler, KeyboardEventHandler, MouseEventHandler, DragEventHandler, TouchEventHandler, PointerEventHandler, UIEventHandler, WheelEventHandler, AnimationEventHandler, ToggleEventHandler, TransitionEventHandler, Ref, RefAttributes } from 'react';
3
3
  import { MotionProps } from 'motion/react';
4
4
  export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<ButtonProps & {
5
+ key?: Key | null | undefined;
5
6
  color?: string | undefined;
6
7
  content?: string | undefined;
7
8
  translate?: "yes" | "no" | undefined;
@@ -12,9 +13,7 @@ export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<Bu
12
13
  draggable?: (boolean | "true" | "false") | undefined;
13
14
  className?: string | undefined;
14
15
  title?: string | undefined;
15
- key?: Key | null | undefined;
16
16
  dir?: string | undefined;
17
- property?: string | undefined;
18
17
  role?: AriaRole | undefined;
19
18
  "aria-label"?: string | undefined;
20
19
  defaultValue?: string | number | readonly string[] | undefined;
@@ -193,7 +192,7 @@ export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<Bu
193
192
  autoFocus?: boolean | undefined;
194
193
  contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
195
194
  contextMenu?: string | undefined;
196
- enterKeyHint?: "search" | "next" | "previous" | "done" | "send" | "enter" | "go" | undefined;
195
+ enterKeyHint?: "search" | "done" | "next" | "send" | "enter" | "go" | "previous" | undefined;
197
196
  lang?: string | undefined;
198
197
  nonce?: string | undefined;
199
198
  slot?: string | undefined;
@@ -204,6 +203,7 @@ export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<Bu
204
203
  datatype?: string | undefined;
205
204
  inlist?: any;
206
205
  prefix?: string | undefined;
206
+ property?: string | undefined;
207
207
  rel?: string | undefined;
208
208
  resource?: string | undefined;
209
209
  rev?: string | undefined;
@@ -229,7 +229,7 @@ export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<Bu
229
229
  part?: string | undefined;
230
230
  "aria-activedescendant"?: string | undefined;
231
231
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
232
- "aria-autocomplete"?: "list" | "none" | "both" | "inline" | undefined;
232
+ "aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
233
233
  "aria-braillelabel"?: string | undefined;
234
234
  "aria-brailleroledescription"?: string | undefined;
235
235
  "aria-busy"?: (boolean | "true" | "false") | undefined;
@@ -289,4 +289,4 @@ export declare const TriggerWalkthroughButton: ForwardRefExoticComponent<Omit<Bu
289
289
  formNoValidate?: boolean | undefined;
290
290
  formTarget?: string | undefined;
291
291
  } & MotionProps, "ref"> & RefAttributes<HTMLButtonElement>>;
292
- export declare function DynamicViewControls(): import("react/jsx-runtime").JSX.Element;
292
+ export declare function DynamicViewControls(): import("react").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import "../../_virtual/_rolldown/runtime.js";
2
2
  import { useEnabledFeatures } from "../../context/DiagramFeatures.js";
3
- import { useDiagram } from "../../hooks/safeContext.js";
4
- import { useDiagramContext } from "../../hooks/useDiagram.js";
3
+ import { selectDiagramContext, useDiagram, useDiagramSelector } from "../../hooks/safeContext.js";
5
4
  import { Tooltip as Tooltip$1 } from "../_common.js";
6
5
  import { useNavigationActor } from "../hooks.js";
7
6
  import { css } from "@likec4/styles/css";
@@ -75,30 +74,29 @@ function StartWalkthroughButton() {
75
74
  })
76
75
  });
77
76
  }
78
- var DynamicViewModeSwitcher = forwardRef(({ value, onChange }, ref) => {
79
- return /* @__PURE__ */ jsx(m$1.div, {
80
- ref,
81
- layout: "position",
82
- children: /* @__PURE__ */ jsx(SegmentedControl, {
83
- size: "xs",
84
- value,
85
- onChange: (variant) => {
86
- invariant(variant === "diagram" || variant === "sequence", "Invalid dynamic view variant");
87
- onChange(variant);
88
- },
89
- classNames: { label: css({ fontSize: "xxs" }) },
90
- data: [{
91
- value: "diagram",
92
- label: "Diagram"
93
- }, {
94
- value: "sequence",
95
- label: "Sequence"
96
- }]
97
- })
98
- });
99
- });
77
+ var DynamicViewModeSwitcher = forwardRef(({ value, onChange }, ref) => /* @__PURE__ */ jsx(m$1.div, {
78
+ ref,
79
+ layout: "position",
80
+ children: /* @__PURE__ */ jsx(SegmentedControl, {
81
+ size: "xs",
82
+ value,
83
+ onChange: (variant) => {
84
+ invariant(variant === "diagram" || variant === "sequence", "Invalid dynamic view variant");
85
+ onChange(variant);
86
+ },
87
+ classNames: { label: css({ fontSize: "xxs" }) },
88
+ data: [{
89
+ value: "diagram",
90
+ label: "Diagram"
91
+ }, {
92
+ value: "sequence",
93
+ label: "Sequence"
94
+ }]
95
+ })
96
+ }));
97
+ var selectDynamicViewVariant = selectDiagramContext((c) => c.dynamicViewVariant);
100
98
  function DynamicViewControls() {
101
- const dynamicViewVariant = useDiagramContext((c) => c.dynamicViewVariant);
99
+ const dynamicViewVariant = useDiagramSelector(selectDynamicViewVariant);
102
100
  const diagram = useDiagram();
103
101
  return /* @__PURE__ */ jsxs(AnimatePresence, { children: [/* @__PURE__ */ jsx(DynamicViewModeSwitcher, {
104
102
  value: dynamicViewVariant,
@@ -1,2 +1,2 @@
1
1
  import { MemoExoticComponent } from 'react';
2
- export declare const WalkthroughPanel: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
2
+ export declare const WalkthroughPanel: MemoExoticComponent<() => import("react").JSX.Element>;
@@ -1,5 +1,5 @@
1
1
  import "../../_virtual/_rolldown/runtime.js";
2
- import { useDiagramContext } from "../../hooks/useDiagram.js";
2
+ import { selectDiagramActorContext, useDiagramSnapshot } from "../../hooks/useDiagram.js";
3
3
  import { Markdown } from "../../base-primitives/Markdown.js";
4
4
  import { memo } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -17,19 +17,19 @@ var SectionHeader = styled("div", { base: {
17
17
  userSelect: "none",
18
18
  mb: "xxs"
19
19
  } });
20
- function selectWalkthroughNotes(s) {
20
+ var selectWalkthroughNotes = selectDiagramActorContext((s) => {
21
21
  const isActive = isNonNull(s.activeWalkthrough);
22
22
  const activeStepIndex = isActive ? s.xyedges.findIndex((e) => e.id === s.activeWalkthrough?.stepId) : -1;
23
23
  return {
24
24
  isActive,
25
- isParallel: isActive && isTruthy(s.activeWalkthrough?.parallelPrefix),
25
+ isParallel: isActive && isTruthy(s.activeWalkthrough?.activeFlow),
26
26
  hasNext: isActive && activeStepIndex < s.xyedges.length - 1,
27
27
  hasPrevious: isActive && activeStepIndex > 0,
28
28
  notes: isActive ? s.xyedges[activeStepIndex]?.data?.notes ?? null : null
29
29
  };
30
- }
30
+ });
31
31
  var WalkthroughPanel = memo(() => {
32
- const { isActive, notes: _notes } = useDiagramContext(selectWalkthroughNotes);
32
+ const { isActive, notes: _notes } = useDiagramSnapshot(selectWalkthroughNotes);
33
33
  const notes = _notes ? RichText.from(_notes) : RichText.EMPTY;
34
34
  return /* @__PURE__ */ jsx(AnimatePresence, { children: isActive && !notes.isEmpty && /* @__PURE__ */ jsx(m.div, {
35
35
  layout: "position",
@@ -1,4 +1,6 @@
1
1
  import { OverlaysActorRef } from './overlaysActor';
2
- export declare function Overlays({ overlaysActorRef }: {
2
+ type OverlaysProps = {
3
3
  overlaysActorRef: OverlaysActorRef;
4
- }): import("react/jsx-runtime").JSX.Element;
4
+ };
5
+ export declare const Overlays: ({ overlaysActorRef }: OverlaysProps) => import("react").JSX.Element;
6
+ export {};
@@ -4,6 +4,7 @@ import { useDiagram } from "../hooks/safeContext.js";
4
4
  import { ErrorBoundary } from "../components/ErrorFallback.js";
5
5
  import { RelationshipsBrowser } from "./relationships-browser/RelationshipsBrowser.js";
6
6
  import { ElementDetails } from "./element-details/ElementDetails.js";
7
+ import { OverlaysActorContext, selectOverlaysSnapshot, useSelectOverlaysActor } from "./hooks.js";
7
8
  import { Overlay } from "./overlay/Overlay.js";
8
9
  import { RelationshipDetails } from "./relationship-details/RelationshipDetails.js";
9
10
  import { useEffect } from "react";
@@ -11,10 +12,13 @@ import { jsx } from "react/jsx-runtime";
11
12
  import { isNonNullish } from "remeda";
12
13
  import { nonexhaustive } from "@likec4/core";
13
14
  import { AnimatePresence, LayoutGroup, useReducedMotionConfig } from "motion/react";
14
- import { useSelector } from "@xstate/react";
15
15
  import { animate } from "motion";
16
16
  //#region src/overlays/Overlays.tsx
17
- var selectOverlays = (s) => {
17
+ var Overlays = ({ overlaysActorRef }) => /* @__PURE__ */ jsx(OverlaysActorContext, {
18
+ value: overlaysActorRef,
19
+ children: /* @__PURE__ */ jsx(OverlaysSurface, { overlaysActorRef })
20
+ });
21
+ var selectOverlays = selectOverlaysSnapshot((s) => {
18
22
  return s.context.overlays.map((overlay) => {
19
23
  switch (overlay.type) {
20
24
  case "relationshipsBrowser": return s.children[overlay.id] ? {
@@ -32,15 +36,10 @@ var selectOverlays = (s) => {
32
36
  default: nonexhaustive(overlay);
33
37
  }
34
38
  }).filter(isNonNullish);
35
- };
36
- var compareSelectOverlays = (a, b) => {
37
- return a.length === b.length && a.every((overlay, i) => {
38
- return overlay.actorRef === b[i].actorRef;
39
- });
40
- };
41
- function Overlays({ overlaysActorRef }) {
39
+ }, (a, b) => !!a && !!b && a.length === b.length && a.every((overlay, i) => overlay.actorRef === b[i].actorRef));
40
+ function OverlaysSurface({ overlaysActorRef }) {
42
41
  const diagram = useDiagram();
43
- const overlays = useSelector(overlaysActorRef, selectOverlays, compareSelectOverlays);
42
+ const overlays = useSelectOverlaysActor(selectOverlays);
44
43
  const isMotionReduced = useReducedMotionConfig() ?? false;
45
44
  const isActiveOverlay = overlays.some((overlay) => overlay.type === "elementDetails");
46
45
  useEffect(() => {
@@ -90,6 +89,7 @@ function Overlays({ overlaysActorRef }) {
90
89
  return /* @__PURE__ */ jsx(DiagramFeatures.Overlays, { children: /* @__PURE__ */ jsx(ErrorBoundary, {
91
90
  onReset: () => overlaysActorRef.send({ type: "close.all" }),
92
91
  children: /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(AnimatePresence, {
92
+ propagate: true,
93
93
  mode: "popLayout",
94
94
  children: overlaysReact
95
95
  }) })
@@ -3,4 +3,4 @@ export type ElementDetailsProps = {
3
3
  actorRef: ElementDetailsActorRef;
4
4
  onClose: () => void;
5
5
  };
6
- export declare function ElementDetails({ actorRef, onClose, }: ElementDetailsProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ElementDetails({ actorRef, onClose, }: ElementDetailsProps): import("react").JSX.Element;