@likec4/diagram 1.59.2 → 1.59.4

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 (233) hide show
  1. package/README.md +53 -0
  2. package/dist/LikeC4Diagram.d.ts +1 -1
  3. package/dist/LikeC4Diagram.js +36 -21
  4. package/dist/LikeC4Diagram.props.d.ts +23 -0
  5. package/dist/LikeC4MantineProvider.d.ts +24 -0
  6. package/dist/LikeC4MantineProvider.js +156 -0
  7. package/dist/LikeC4ProjectsOverview.js +1 -1
  8. package/dist/LikeC4ProjectsProvider.d.ts +17 -2
  9. package/dist/LikeC4Styles.d.ts +13 -3
  10. package/dist/LikeC4Styles.js +10 -6
  11. package/dist/LikeC4View.js +2 -2
  12. package/dist/StaticLikeC4Diagram.d.ts +1 -1
  13. package/dist/base/BaseXYFlow.d.ts +1 -1
  14. package/dist/base/BaseXYFlow.js +19 -9
  15. package/dist/base/const.d.ts +1 -0
  16. package/dist/base/const.js +3 -1
  17. package/dist/base-primitives/Markdown.d.ts +3 -3
  18. package/dist/base-primitives/compound/CompoundNodeContainer.js +2 -3
  19. package/dist/base-primitives/compound/CompoundTitle.js +5 -4
  20. package/dist/base-primitives/compound/actionbtns.css.d.ts +3 -3
  21. package/dist/base-primitives/compound/actionbtns.css.js +3 -3
  22. package/dist/base-primitives/element/ElementData.js +6 -1
  23. package/dist/base-primitives/element/ElementShape.js +9 -10
  24. package/dist/base-primitives/element/ElementTags.d.ts +2 -2
  25. package/dist/base-primitives/element/ElementTags.js +5 -5
  26. package/dist/components/EmptyBox.d.ts +3 -0
  27. package/dist/components/EmptyBox.js +9 -0
  28. package/dist/components/ErrorFallback.js +7 -6
  29. package/dist/components/FloatingWindow.d.ts +18 -0
  30. package/dist/components/FloatingWindow.js +89 -0
  31. package/dist/components/Link.js +7 -7
  32. package/dist/components/NavigationPanel.d.ts +2 -2
  33. package/dist/components/NavigationPanel.js +5 -6
  34. package/dist/components/SearchControl.css.js +10 -12
  35. package/dist/components/ViewIcon.d.ts +11 -0
  36. package/dist/components/ViewIcon.js +71 -0
  37. package/dist/context/CurrentViewModelProvider.js +2 -1
  38. package/dist/context/DiagramEventHandlers.js +4 -2
  39. package/dist/context/EnsureMantine.js +3 -3
  40. package/dist/context/IconRenderer.d.ts +2 -1
  41. package/dist/context/IconRenderer.js +78 -26
  42. package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
  43. package/dist/context/TagStylesContext.d.ts +11 -4
  44. package/dist/context/TagStylesContext.js +39 -27
  45. package/dist/custom/index.d.ts +3 -0
  46. package/dist/custom/index.js +7 -4
  47. package/dist/editor/LikeC4EditorCallbacks.d.ts +20 -1
  48. package/dist/editor/LikeC4EditorCallbacks.js +4 -1
  49. package/dist/editor/actor/setup.d.ts +1 -0
  50. package/dist/editor/actor/setup.js +17 -12
  51. package/dist/editor/actor/state.sync-queue.js +1 -0
  52. package/dist/editor/applyChangesToManualLayout.js +5 -2
  53. package/dist/editor/index.d.ts +1 -1
  54. package/dist/editor/useEditorActorLogic.js +10 -3
  55. package/dist/hooks/safeContext.d.ts +12 -4
  56. package/dist/hooks/safeContext.js +2 -2
  57. package/dist/hooks/useCurrentView.js +5 -5
  58. package/dist/hooks/useDiagram.js +3 -23
  59. package/dist/hooks/useDiagramCompareLayout.d.ts +16 -6
  60. package/dist/hooks/useDiagramCompareLayout.js +20 -17
  61. package/dist/hooks/useEditorActor.js +3 -5
  62. package/dist/hooks/useLikeC4Model.js +8 -3
  63. package/dist/hooks/useLikeC4Project.d.ts +4 -3
  64. package/dist/hooks/useOverlaysActor.d.ts +1 -1
  65. package/dist/hooks/useUpdateEffect.js +2 -1
  66. package/dist/index.d.ts +6 -4
  67. package/dist/index.js +8 -6
  68. package/dist/likec4diagram/DiagramUI.js +4 -3
  69. package/dist/likec4diagram/DiagramXYFlow.d.ts +6 -0
  70. package/dist/likec4diagram/DiagramXYFlow.js +33 -19
  71. package/dist/likec4diagram/custom/edges/EdgeDrifts.js +4 -4
  72. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +2 -4
  73. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +1 -3
  74. package/dist/likec4diagram/custom/edges/edges.css.js +13 -13
  75. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +3 -2
  76. package/dist/likec4diagram/custom/nodes/NodeDrifts.js +2 -2
  77. package/dist/likec4diagram/custom/nodes/NodeNotes.js +4 -4
  78. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +2 -2
  79. package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +8 -5
  80. package/dist/likec4diagram/custom/nodes/nodes.js +8 -5
  81. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
  82. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +9 -8
  83. package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
  84. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +3 -2
  85. package/dist/likec4diagram/relationship-popover/components.d.ts +1 -1
  86. package/dist/likec4diagram/relationship-popover/components.js +6 -2
  87. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +7 -2
  88. package/dist/likec4diagram/state/DiagramActorProvider.js +20 -4
  89. package/dist/likec4diagram/state/assign.js +1 -1
  90. package/dist/likec4diagram/state/createViewChange.js +1 -6
  91. package/dist/likec4diagram/state/diagram-api.d.ts +2 -2
  92. package/dist/likec4diagram/state/diagram-api.js +3 -2
  93. package/dist/likec4diagram/state/machine.actions.js +15 -8
  94. package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
  95. package/dist/likec4diagram/state/machine.actions.layout.js +7 -5
  96. package/dist/likec4diagram/state/machine.setup.d.ts +10 -1
  97. package/dist/likec4diagram/state/machine.setup.js +15 -9
  98. package/dist/likec4diagram/state/machine.state.initializing.d.ts +2 -26
  99. package/dist/likec4diagram/state/machine.state.initializing.js +9 -6
  100. package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
  101. package/dist/likec4diagram/state/machine.state.ready.d.ts +134 -3
  102. package/dist/likec4diagram/state/machine.state.ready.js +2 -1
  103. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +106 -1
  104. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +40 -7
  105. package/dist/likec4diagram/state/utils.d.ts +1 -1
  106. package/dist/likec4diagram/state/utils.js +7 -4
  107. package/dist/likec4diagram/ui/FloatingSequenceActors.js +2 -1
  108. package/dist/likec4diagram/ui/LayoutDriftFrame.js +16 -10
  109. package/dist/likec4diagram/ui/index.d.ts +1 -1
  110. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +13 -15
  111. package/dist/likec4diagram/ui/notation/NotationPanel.js +9 -9
  112. package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.d.ts +9 -0
  113. package/dist/likec4diagram/ui/sequence-outline/ActiveTrail.js +81 -0
  114. package/dist/likec4diagram/ui/sequence-outline/FlowRow.d.ts +11 -0
  115. package/dist/likec4diagram/ui/sequence-outline/FlowRow.js +70 -0
  116. package/dist/likec4diagram/ui/sequence-outline/OutlineBody.d.ts +2 -0
  117. package/dist/likec4diagram/ui/sequence-outline/OutlineBody.js +106 -0
  118. package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.d.ts +2 -0
  119. package/dist/likec4diagram/ui/sequence-outline/OutlineHeader.js +140 -0
  120. package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.d.ts +17 -0
  121. package/dist/likec4diagram/ui/sequence-outline/OutlineNodes.js +83 -0
  122. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +4 -0
  123. package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +49 -525
  124. package/dist/likec4diagram/ui/sequence-outline/StepBadge.d.ts +8 -0
  125. package/dist/likec4diagram/ui/sequence-outline/StepBadge.js +52 -0
  126. package/dist/likec4diagram/ui/sequence-outline/StepRow.d.ts +7 -0
  127. package/dist/likec4diagram/ui/sequence-outline/StepRow.js +190 -0
  128. package/dist/likec4diagram/ui/sequence-outline/StoreProvider.d.ts +238 -0
  129. package/dist/likec4diagram/ui/sequence-outline/StoreProvider.js +94 -0
  130. package/dist/likec4diagram/ui/sequence-outline/depth-of-field.d.ts +21 -0
  131. package/dist/likec4diagram/ui/sequence-outline/depth-of-field.js +71 -0
  132. package/dist/likec4diagram/ui/sequence-outline/index.d.ts +2 -0
  133. package/dist/likec4diagram/ui/sequence-outline/motion.d.ts +13 -0
  134. package/dist/likec4diagram/ui/sequence-outline/motion.js +21 -0
  135. package/dist/likec4diagram/ui/sequence-outline/presentation.d.ts +10 -0
  136. package/dist/likec4diagram/ui/sequence-outline/presentation.js +80 -0
  137. package/dist/likec4diagram/ui/sequence-outline/tree.d.ts +9 -0
  138. package/dist/likec4diagram/ui/sequence-outline/tree.js +67 -0
  139. package/dist/likec4diagram/ui/sequence-outline/{state.d.ts → types.d.ts} +4 -2
  140. package/dist/likec4diagram/ui/sequence-outline/types.js +12 -0
  141. package/dist/likec4diagram/useLayoutConstraints.js +13 -1
  142. package/dist/likec4diagram/xyflow-sequence/layouter.js +8 -10
  143. package/dist/likec4diagram/xyflow-sequence/sequence-view-to-xy.js +1 -0
  144. package/dist/likec4diagram/xyflow-sequence/utils.js +0 -1
  145. package/dist/navigationpanel/NavigationPanel.js +45 -41
  146. package/dist/navigationpanel/NavigationPanelControls.js +102 -63
  147. package/dist/navigationpanel/NavigationPanelDropdown.js +52 -77
  148. package/dist/navigationpanel/_common.d.ts +6 -6
  149. package/dist/navigationpanel/_common.js +31 -42
  150. package/dist/navigationpanel/actor.actions.js +6 -5
  151. package/dist/navigationpanel/actor.js +2 -2
  152. package/dist/navigationpanel/actor.setup.d.ts +6 -6
  153. package/dist/navigationpanel/actor.setup.js +2 -1
  154. package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -4
  155. package/dist/navigationpanel/comparepanel/ComparePanel.js +8 -10
  156. package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
  157. package/dist/navigationpanel/comparepanel/DriftsSummary.js +11 -9
  158. package/dist/navigationpanel/controls/LayoutWarning.js +69 -72
  159. package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
  160. package/dist/navigationpanel/controls/NavigationButtons.js +8 -8
  161. package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
  162. package/dist/navigationpanel/controls/OpenSource.js +5 -8
  163. package/dist/navigationpanel/controls/SearchControl.js +24 -9
  164. package/dist/navigationpanel/controls/ToggleReadonly.d.ts +4 -1
  165. package/dist/navigationpanel/controls/ToggleReadonly.js +56 -76
  166. package/dist/navigationpanel/controls/ViewDetailsButton.d.ts +5 -0
  167. package/dist/navigationpanel/controls/ViewDetailsButton.js +121 -0
  168. package/dist/navigationpanel/controls/index.d.ts +1 -1
  169. package/dist/navigationpanel/dropdown/ProjectsMenu.js +27 -16
  170. package/dist/navigationpanel/editorpanel/ApplySemanticLayout.js +2 -1
  171. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +12 -10
  172. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -0
  173. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +19 -10
  174. package/dist/navigationpanel/editorpanel/styles.js +8 -15
  175. package/dist/navigationpanel/hooks.d.ts +6 -2
  176. package/dist/navigationpanel/styles.css.d.ts +2 -2
  177. package/dist/navigationpanel/styles.css.js +0 -1
  178. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -2
  179. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -4
  180. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +10 -39
  181. package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.d.ts +1 -0
  182. package/dist/navigationpanel/walkthrough/DynamicViewModeSwitcher.js +49 -0
  183. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +8 -8
  184. package/dist/navigationpanel/windows/ViewDetailsWindow.d.ts +1 -0
  185. package/dist/navigationpanel/windows/ViewDetailsWindow.js +379 -0
  186. package/dist/overlays/Overlays.js +29 -17
  187. package/dist/overlays/element-details/ElementDetailsCard.css.js +28 -36
  188. package/dist/overlays/element-details/ElementDetailsCard.js +3 -3
  189. package/dist/overlays/element-details/MetadataValue.js +18 -16
  190. package/dist/overlays/element-details/TabPanelDeployments.css.js +6 -14
  191. package/dist/overlays/element-details/TabPanelRelationships.css.js +8 -12
  192. package/dist/overlays/element-details/TabPanelStructure.css.js +4 -8
  193. package/dist/overlays/hooks.d.ts +3 -1
  194. package/dist/overlays/overlay/Overlay.js +8 -7
  195. package/dist/overlays/overlaysActor.js +20 -17
  196. package/dist/overlays/relationship-details/RelationshipDetails.js +2 -1
  197. package/dist/overlays/relationship-details/SelectEdge.css.js +14 -9
  198. package/dist/overlays/relationship-details/actor.js +1 -1
  199. package/dist/overlays/relationship-details/hooks.js +2 -1
  200. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +6 -0
  201. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +15 -8
  202. package/dist/overlays/relationships-browser/SelectElement.css.js +2 -8
  203. package/dist/overlays/relationships-browser/SelectElement.js +5 -1
  204. package/dist/overlays/relationships-browser/actor.js +3 -2
  205. package/dist/overlays/relationships-browser/custom/ElementActions.js +39 -38
  206. package/dist/overlays/relationships-browser/custom/EmptyNode.js +7 -9
  207. package/dist/overlays/relationships-browser/hooks.js +2 -1
  208. package/dist/projects-overview/ProjectsOverview.js +8 -7
  209. package/dist/projects-overview/actor.js +1 -1
  210. package/dist/projects-overview/hooks.js +2 -1
  211. package/dist/search/Search.js +9 -7
  212. package/dist/search/components/ElementsColumn.css.js +6 -5
  213. package/dist/search/components/ElementsColumn.js +4 -3
  214. package/dist/search/components/SearchByTags.js +3 -3
  215. package/dist/search/components/ViewsColum.js +46 -43
  216. package/dist/search/components/ViewsColumn.css.js +4 -4
  217. package/dist/search/components/_shared.css.d.ts +2 -2
  218. package/dist/search/components/_shared.css.js +31 -46
  219. package/dist/search/components/styles.css.js +4 -4
  220. package/dist/search/hooks.js +2 -1
  221. package/dist/shadowroot/ShadowRoot.js +6 -5
  222. package/dist/styles2.js +1 -1
  223. package/dist/utils/index.js +3 -3
  224. package/package.json +29 -29
  225. package/panda.buildinfo.json +342 -299
  226. package/styles-min.css +1 -1
  227. package/styles-xyflow.css +1 -1
  228. package/styles.css +1 -1
  229. package/dist/context/DefaultMantineProvider.d.ts +0 -2
  230. package/dist/context/DefaultMantineProvider.js +0 -48
  231. package/dist/likec4diagram/ui/sequence-outline/state.js +0 -55
  232. package/dist/navigationpanel/controls/DetailsControls.d.ts +0 -2
  233. package/dist/navigationpanel/controls/DetailsControls.js +0 -223
@@ -37,18 +37,21 @@ var initializing = machine.createStateConfig({ on: {
37
37
  */
38
38
  var isReady = machine.createStateConfig({ always: [{
39
39
  guard: "isReady",
40
- actions: [
41
- fitDiagram({ duration: 0 }),
42
- assign(({ context }) => ({ navigationHistory: {
40
+ actions: machine.enqueueActions(({ context, enqueue }) => {
41
+ enqueue(fitDiagram({
42
+ duration: 0,
43
+ zoom: context.initialZoom ?? (context.fitView ? void 0 : 1)
44
+ }));
45
+ enqueue(assign(({ context }) => ({ navigationHistory: {
43
46
  currentIndex: 0,
44
47
  history: [{
45
48
  viewId: context.view.id,
46
49
  viewport: { ...context.xyflow.getViewport() },
47
50
  viewportChangedManually: false
48
51
  }]
49
- } })),
50
- emitInitialized()
51
- ],
52
+ } })));
53
+ enqueue(emitInitialized());
54
+ }),
52
55
  target: "ready"
53
56
  }, { target: "initializing" }] });
54
57
  //#endregion
@@ -1,10 +1,10 @@
1
1
  import "../../_virtual/_rolldown/runtime.js";
2
2
  import { roundDpr } from "../../utils/roundDpr.js";
3
3
  import { parsePaddings } from "../../utils/xyflow.js";
4
+ import { convertToXYFlow } from "../convert-to-xyflow.js";
4
5
  import { calcViewportForBounds, findCorrespondingNode, findNodeByModelFqn, nodeRef, viewBounds } from "./utils.js";
5
6
  import { machine, targetState, to } from "./machine.setup.js";
6
7
  import { mergeXYNodesEdges } from "./assign.js";
7
- import { convertToXYFlow } from "../convert-to-xyflow.js";
8
8
  import { cancelFitDiagram, raiseSetViewport } from "./machine.actions.layout.js";
9
9
  import { disableCompareWithLatest } from "./machine.actions.js";
10
10
  import { isTruthy } from "remeda";
@@ -1399,6 +1399,111 @@ export declare const ready: {
1399
1399
  'key.arrow.down': {
1400
1400
  actions: ActionFunction<Context, HotKeyEvent, Events, undefined, never, never, never, never, never>;
1401
1401
  };
1402
+ 'sequence.flow.*': {
1403
+ actions: ActionFunction<Context, Events, Events, undefined, {
1404
+ src: "search";
1405
+ logic: SearchActorLogic;
1406
+ id: "search";
1407
+ } | {
1408
+ src: "hotkey";
1409
+ logic: HotkeyActorLogic;
1410
+ id: "hotkey";
1411
+ } | {
1412
+ src: "overlays";
1413
+ logic: OverlaysActorLogic;
1414
+ id: "overlays";
1415
+ } | {
1416
+ src: "mediaPrint";
1417
+ logic: MediaPrintActorLogic;
1418
+ id: "mediaPrint";
1419
+ } | {
1420
+ src: "editor";
1421
+ logic: EditorActorLogic;
1422
+ id: "editor";
1423
+ } | {
1424
+ src: "navigationPanel";
1425
+ logic: NavigationPanelActorLogic;
1426
+ id: "navigationPanel";
1427
+ }, never, {
1428
+ type: "isReady";
1429
+ params: unknown;
1430
+ } | {
1431
+ type: "enabled: Editor";
1432
+ params: unknown;
1433
+ } | {
1434
+ type: "enabled: FitView";
1435
+ params: unknown;
1436
+ } | {
1437
+ type: "enabled: FocusMode";
1438
+ params: unknown;
1439
+ } | {
1440
+ type: "enabled: Readonly";
1441
+ params: unknown;
1442
+ } | {
1443
+ type: "enabled: RelationshipDetails";
1444
+ params: unknown;
1445
+ } | {
1446
+ type: "enabled: Search";
1447
+ params: unknown;
1448
+ } | {
1449
+ type: "enabled: ElementDetails";
1450
+ params: unknown;
1451
+ } | {
1452
+ type: "enabled: OpenSource";
1453
+ params: unknown;
1454
+ } | {
1455
+ type: "enabled: DynamicViewWalkthrough";
1456
+ params: unknown;
1457
+ } | {
1458
+ type: "enabled: NavigationPanel";
1459
+ params: unknown;
1460
+ } | {
1461
+ type: "focus.node: autoUnfocus";
1462
+ params: unknown;
1463
+ } | {
1464
+ type: "enabled: Overlays";
1465
+ params: unknown;
1466
+ } | {
1467
+ type: "not readonly";
1468
+ params: unknown;
1469
+ } | {
1470
+ type: "is dynamic view";
1471
+ params: unknown;
1472
+ } | {
1473
+ type: "is dynamic view in sequence variant";
1474
+ params: unknown;
1475
+ } | {
1476
+ type: "is same view";
1477
+ params: unknown;
1478
+ } | {
1479
+ type: "is another view";
1480
+ params: unknown;
1481
+ } | {
1482
+ type: "click: node has modelFqn";
1483
+ params: unknown;
1484
+ } | {
1485
+ type: "click: selected node";
1486
+ params: unknown;
1487
+ } | {
1488
+ type: "click: same node";
1489
+ params: unknown;
1490
+ } | {
1491
+ type: "click: focused node";
1492
+ params: unknown;
1493
+ } | {
1494
+ type: "click: node.type = seq-subflow";
1495
+ params: unknown;
1496
+ } | {
1497
+ type: "click: node has connections";
1498
+ params: unknown;
1499
+ } | {
1500
+ type: "click: selected edge";
1501
+ params: unknown;
1502
+ } | {
1503
+ type: "click: active walkthrough step";
1504
+ params: unknown;
1505
+ }, never, EmittedEvents>[];
1506
+ };
1402
1507
  'walkthrough.step': {
1403
1508
  actions: ActionFunction<Context, {
1404
1509
  type: "walkthrough.step";
@@ -2460,8 +2565,8 @@ export declare const ready: {
2460
2565
  }, never, never, never, never>[];
2461
2566
  };
2462
2567
  'layout.resetManualLayout': {
2463
- guard: "not readonly";
2464
- actions: ActionFunction<Context, Events, Events, undefined, {
2568
+ guard: "enabled: Editor";
2569
+ actions: ( ActionFunction<Context, Events, Events, undefined, {
2465
2570
  src: "search";
2466
2571
  logic: SearchActorLogic;
2467
2572
  id: "search";
@@ -2563,7 +2668,33 @@ export declare const ready: {
2563
2668
  } | {
2564
2669
  type: "click: active walkthrough step";
2565
2670
  params: unknown;
2566
- }, never, EmittedEvents>[];
2671
+ }, never, EmittedEvents> | ActionFunction<Context, {
2672
+ type: "layout.resetManualLayout";
2673
+ }, Events, undefined, {
2674
+ src: "search";
2675
+ logic: SearchActorLogic;
2676
+ id: "search";
2677
+ } | {
2678
+ src: "hotkey";
2679
+ logic: HotkeyActorLogic;
2680
+ id: "hotkey";
2681
+ } | {
2682
+ src: "overlays";
2683
+ logic: OverlaysActorLogic;
2684
+ id: "overlays";
2685
+ } | {
2686
+ src: "mediaPrint";
2687
+ logic: MediaPrintActorLogic;
2688
+ id: "mediaPrint";
2689
+ } | {
2690
+ src: "editor";
2691
+ logic: EditorActorLogic;
2692
+ id: "editor";
2693
+ } | {
2694
+ src: "navigationPanel";
2695
+ logic: NavigationPanelActorLogic;
2696
+ id: "navigationPanel";
2697
+ }, never, never, never, never>)[];
2567
2698
  };
2568
2699
  'media.print.on': {
2569
2700
  target: string;
@@ -45,10 +45,11 @@ var ready = machine.createStateConfig({
45
45
  ]
46
46
  },
47
47
  "layout.resetManualLayout": {
48
- guard: "not readonly",
48
+ guard: "enabled: Editor",
49
49
  actions: [
50
50
  cancelEditing(),
51
51
  disableCompareWithLatest(),
52
+ assign({ viewportChangedManually: false }),
52
53
  triggerChange({ op: "reset-manual-layout" })
53
54
  ]
54
55
  },
@@ -2,12 +2,12 @@ import { Types } from '../types';
2
2
  import { Context, Events, EmittedEvents } from './machine.setup';
3
3
  import { CancelAction, ActionFunction } from 'xstate';
4
4
  import { HotKeyEvent, HotkeyActorLogic } from './hotkeyActor';
5
- import { StepPath } from '@likec4/core';
6
5
  import { SearchActorLogic } from '../../search/searchActor';
7
6
  import { OverlaysActorLogic } from '../../overlays/overlaysActor';
8
7
  import { MediaPrintActorLogic } from './mediaPrintActor';
9
8
  import { EditorActorLogic } from '../../editor';
10
9
  import { NavigationPanelActorLogic } from '../../navigationpanel/actor';
10
+ import { StepPath } from '@likec4/core';
11
11
  export declare const walkthrough: {
12
12
  id: string;
13
13
  entry: CancelAction<Context, Events, undefined, Events>[];
@@ -28,6 +28,111 @@ export declare const walkthrough: {
28
28
  'key.arrow.down': {
29
29
  actions: ActionFunction<Context, HotKeyEvent, Events, undefined, never, never, never, never, never>;
30
30
  };
31
+ 'sequence.flow.*': {
32
+ actions: ActionFunction<Context, Events, Events, undefined, {
33
+ src: "search";
34
+ logic: SearchActorLogic;
35
+ id: "search";
36
+ } | {
37
+ src: "hotkey";
38
+ logic: HotkeyActorLogic;
39
+ id: "hotkey";
40
+ } | {
41
+ src: "overlays";
42
+ logic: OverlaysActorLogic;
43
+ id: "overlays";
44
+ } | {
45
+ src: "mediaPrint";
46
+ logic: MediaPrintActorLogic;
47
+ id: "mediaPrint";
48
+ } | {
49
+ src: "editor";
50
+ logic: EditorActorLogic;
51
+ id: "editor";
52
+ } | {
53
+ src: "navigationPanel";
54
+ logic: NavigationPanelActorLogic;
55
+ id: "navigationPanel";
56
+ }, never, {
57
+ type: "isReady";
58
+ params: unknown;
59
+ } | {
60
+ type: "enabled: Editor";
61
+ params: unknown;
62
+ } | {
63
+ type: "enabled: FitView";
64
+ params: unknown;
65
+ } | {
66
+ type: "enabled: FocusMode";
67
+ params: unknown;
68
+ } | {
69
+ type: "enabled: Readonly";
70
+ params: unknown;
71
+ } | {
72
+ type: "enabled: RelationshipDetails";
73
+ params: unknown;
74
+ } | {
75
+ type: "enabled: Search";
76
+ params: unknown;
77
+ } | {
78
+ type: "enabled: ElementDetails";
79
+ params: unknown;
80
+ } | {
81
+ type: "enabled: OpenSource";
82
+ params: unknown;
83
+ } | {
84
+ type: "enabled: DynamicViewWalkthrough";
85
+ params: unknown;
86
+ } | {
87
+ type: "enabled: NavigationPanel";
88
+ params: unknown;
89
+ } | {
90
+ type: "focus.node: autoUnfocus";
91
+ params: unknown;
92
+ } | {
93
+ type: "enabled: Overlays";
94
+ params: unknown;
95
+ } | {
96
+ type: "not readonly";
97
+ params: unknown;
98
+ } | {
99
+ type: "is dynamic view";
100
+ params: unknown;
101
+ } | {
102
+ type: "is dynamic view in sequence variant";
103
+ params: unknown;
104
+ } | {
105
+ type: "is same view";
106
+ params: unknown;
107
+ } | {
108
+ type: "is another view";
109
+ params: unknown;
110
+ } | {
111
+ type: "click: node has modelFqn";
112
+ params: unknown;
113
+ } | {
114
+ type: "click: selected node";
115
+ params: unknown;
116
+ } | {
117
+ type: "click: same node";
118
+ params: unknown;
119
+ } | {
120
+ type: "click: focused node";
121
+ params: unknown;
122
+ } | {
123
+ type: "click: node.type = seq-subflow";
124
+ params: unknown;
125
+ } | {
126
+ type: "click: node has connections";
127
+ params: unknown;
128
+ } | {
129
+ type: "click: selected edge";
130
+ params: unknown;
131
+ } | {
132
+ type: "click: active walkthrough step";
133
+ params: unknown;
134
+ }, never, EmittedEvents>[];
135
+ };
31
136
  'walkthrough.step': {
32
137
  actions: ActionFunction<Context, {
33
138
  type: "walkthrough.step";
@@ -3,10 +3,10 @@ import { roundDpr } from "../../utils/roundDpr.js";
3
3
  import { Base } from "../../base/Base.js";
4
4
  import { machine, targetState, to } from "./machine.setup.js";
5
5
  import { assignViewportBefore, cancelFitDiagram, fitFocusedBounds, returnViewportBefore } from "./machine.actions.layout.js";
6
- import { assignLastClickedNode, cancelEditing, emitEdgeClick, emitPaneClick, resetLastClickedNode, resetSelection, startHotKeyActor, stopHotKeyActor, updateView } from "./machine.actions.js";
7
- import { clamp, firstBy, isNumber, map } from "remeda";
6
+ import { assignLastClickedNode, cancelEditing, collapseOrExpandSequenceFlow, emitEdgeClick, emitPaneClick, resetLastClickedNode, resetSelection, startHotKeyActor, stopHotKeyActor, updateView } from "./machine.actions.js";
7
+ import { clamp, find, firstBy, isNumber, map } from "remeda";
8
8
  import { invariant, nonNullable } from "@likec4/core";
9
- import { dynamicViewFlow as dynamicViewFlow$1, isDynamicView as isDynamicView$1, isStepPath as isStepPath$1, parentFlow } from "@likec4/core/types";
9
+ import { dynamicViewFlow as dynamicViewFlow$1, flowAncestors as flowAncestors$1, flowHelpers, isDynamicView as isDynamicView$1, isDynamicViewWithFlow as isDynamicViewWithFlow$1, isStepPath as isStepPath$1, parentFlow } from "@likec4/core/types";
10
10
  import { assertEvent, enqueueActions } from "xstate";
11
11
  import { assign as assign$1, raise as raise$1 } from "xstate/actions";
12
12
  //#region src/likec4diagram/state/machine.state.ready.walkthrough.ts
@@ -15,10 +15,26 @@ var outlinePanelWidth = ({ activeWalkthrough, xystore }) => {
15
15
  if (activeWalkthrough) return activeWalkthrough.outlinePanelWidth;
16
16
  const { width } = xystore.getState();
17
17
  return clamp(roundDpr(width * .3), {
18
- min: 180,
19
- max: 400
18
+ min: 240,
19
+ max: 500
20
20
  });
21
21
  };
22
+ var guardContext = (context) => {
23
+ const { activeWalkthrough, view } = context;
24
+ invariant(isDynamicViewWithFlow$1(view), "View must be a dynamic view with flows");
25
+ invariant(activeWalkthrough, "Active walkthrough must not be null");
26
+ return {
27
+ activeWalkthrough,
28
+ view
29
+ };
30
+ };
31
+ /**
32
+ * Creates a predicate that checks if a step is collapsed based on the current state
33
+ */
34
+ var isCollapsed = (context) => (step) => {
35
+ const path = flowHelpers.extractPath(step);
36
+ return context.collapsedSequenceFlows[path] ?? false;
37
+ };
22
38
  var updateActiveWalkthroughState = () => machine.enqueueActions(({ context, enqueue }) => {
23
39
  const { activeWalkthrough } = context;
24
40
  if (!activeWalkthrough) {
@@ -86,6 +102,18 @@ var clearWalkthroughState = () => machine.assign(({ context }) => {
86
102
  }))
87
103
  };
88
104
  });
105
+ var checkIfActiveStepCollapsed = () => machine.enqueueActions(({ context, enqueue }) => {
106
+ const { activeWalkthrough, view } = guardContext(context);
107
+ const checkIsCollapsed = isCollapsed(context);
108
+ if (!find(flowAncestors$1(activeWalkthrough.stepId), checkIsCollapsed)) return;
109
+ const { prev, next } = dynamicViewFlow$1(view).prevAndNext(activeWalkthrough.stepId, checkIsCollapsed);
110
+ const goToStep = prev ?? next;
111
+ if (!goToStep) return;
112
+ enqueue.raise({
113
+ type: "walkthrough.step",
114
+ stepId: goToStep
115
+ });
116
+ });
89
117
  var emitWalkthroughStarted = () => machine.emit(({ context }) => {
90
118
  return {
91
119
  type: "walkthroughStarted",
@@ -147,13 +175,18 @@ var walkthrough = machine.createStateConfig({
147
175
  type: "walkthrough.step",
148
176
  direction: "next"
149
177
  }) },
178
+ "sequence.flow.*": { actions: [
179
+ collapseOrExpandSequenceFlow(),
180
+ resetLastClickedNode(),
181
+ checkIfActiveStepCollapsed()
182
+ ] },
150
183
  "walkthrough.step": { actions: [enqueueActions(({ enqueue, context, event }) => {
151
184
  let predicate;
152
185
  const activeWalkthrough = nonNullable(context.activeWalkthrough, "walkthrough.step: activeWalkthrough is null");
153
186
  if (event.direction) {
154
187
  invariant(isDynamicView$1(context.view));
155
188
  const { stepId } = activeWalkthrough;
156
- const prevNext = dynamicViewFlow$1(context.view).prevAndNext(stepId, (flowId) => context.collapsedSequenceFlows[flowId] ?? false);
189
+ const prevNext = dynamicViewFlow$1(context.view).prevAndNext(stepId, isCollapsed(context));
157
190
  predicate = (edge) => edge.data.id === prevNext[event.direction];
158
191
  } else predicate = (edge) => edge.data.id === event.stepId;
159
192
  const nextStepId = context.xyedges.find(predicate)?.data.id;
@@ -172,9 +205,9 @@ var walkthrough = machine.createStateConfig({
172
205
  actions: [fitFocusedBounds(), emitEdgeClick()]
173
206
  }, { actions: [
174
207
  assign$1(({ event, context }) => {
175
- invariant(event.edge.type === "seq-step", `Expected seq-step edge, but got "${event.edge.type}"`);
176
208
  invariant(!!context.activeWalkthrough);
177
209
  const stepId = event.edge.data.id;
210
+ invariant(isStepPath$1(stepId), `Expected step edge, but got "${stepId}"`);
178
211
  return { activeWalkthrough: {
179
212
  ...context.activeWalkthrough,
180
213
  stepId,
@@ -70,4 +70,4 @@ export declare function findCorrespondingNode(context: Pick<Context, 'lastOnNavi
70
70
  fromNode: Types.Node;
71
71
  toNode: Types.Node | null;
72
72
  };
73
- export declare function calcViewportForBounds(context: Pick<Context, 'xystore' | 'fitViewPadding'>, bounds: BBox): Viewport;
73
+ export declare function calcViewportForBounds(context: Pick<Context, 'xystore' | 'fitViewPadding' | 'minZoom'>, bounds: BBox): Viewport;
@@ -1,5 +1,4 @@
1
1
  import "../../_virtual/_rolldown/runtime.js";
2
- import { MinZoom } from "../../base/const.js";
3
2
  import { pickViewBounds } from "../../utils/view-bounds.js";
4
3
  import { BBox } from "@likec4/core/geometry";
5
4
  import { invariant, nonNullable, nonexhaustive } from "@likec4/core/utils";
@@ -56,7 +55,8 @@ function findDiagramEdge(ctx, xyedgeId) {
56
55
  * If {@link nextView} is provided, returns the bounds of the next view.
57
56
  */
58
57
  function viewBounds(ctx, nextView) {
59
- return pickViewBounds(nextView ?? ctx.view, ctx.dynamicViewVariant);
58
+ const view = nextView ?? ctx.view;
59
+ return pickViewBounds(view, ctx.dynamicViewVariant);
60
60
  }
61
61
  function focusedBounds(params) {
62
62
  const b = params.context.xynodes.reduce((acc, node) => {
@@ -107,7 +107,9 @@ function activeSequenceBounds(params) {
107
107
  })
108
108
  };
109
109
  }
110
- const actorsBounds = getNodesBounds([nonNullable(xystate.nodeLookup.get(stepEdge.source)), nonNullable(xystate.nodeLookup.get(stepEdge.target))], xystate);
110
+ const sourceNode = nonNullable(xystate.nodeLookup.get(stepEdge.source));
111
+ const targetNode = nonNullable(xystate.nodeLookup.get(stepEdge.target));
112
+ const actorsBounds = getNodesBounds([sourceNode, targetNode], xystate);
111
113
  let stepBounds = edgeBounds ? BBox.merge(edgeBounds, actorsBounds) : actorsBounds;
112
114
  return {
113
115
  duration: 500,
@@ -157,7 +159,8 @@ function findCorrespondingNode(context, event) {
157
159
  }
158
160
  function calcViewportForBounds(context, bounds) {
159
161
  let { width, height, transform } = context.xystore.getState();
160
- return getViewportForBounds(bounds, width, height, MinZoom, Math.max(transform[2], 1), context.fitViewPadding);
162
+ const maxZoom = Math.max(transform[2], 1);
163
+ return getViewportForBounds(bounds, width, height, context.minZoom, maxZoom, context.fitViewPadding);
161
164
  }
162
165
  //#endregion
163
166
  export { activeSequenceBounds, calcViewportForBounds, findCorrespondingNode, findDiagramEdge, findDiagramNode, findNodeByModelFqn, focusedBounds, getEdgeBounds, nodeRef, typedSystem, viewBounds };
@@ -39,9 +39,10 @@ var selectActorNodes = selectXYStore((state) => {
39
39
  * Shows sequence actors at the top of the diagram, if current viewport does not fit them
40
40
  */
41
41
  function FloatingSequenceActors({ isActiveWalkthrough }) {
42
+ const ids = useXYStore(selectActorNodes);
42
43
  return /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(AnimatePresence, {
43
44
  anchorY: "top",
44
- children: useXYStore(selectActorNodes).map((id) => /* @__PURE__ */ jsx(SequenceActor, {
45
+ children: ids.map((id) => /* @__PURE__ */ jsx(SequenceActor, {
45
46
  id,
46
47
  top: isActiveWalkthrough ? 24 : 64
47
48
  }, id))
@@ -1,17 +1,24 @@
1
1
  import "../../_virtual/_rolldown/runtime.js";
2
2
  import { useDiagramCompareLayout } from "../../hooks/useDiagramCompareLayout.js";
3
- import { css } from "@likec4/styles/css";
3
+ import { css, cx } from "@likec4/styles/css";
4
4
  import { memo } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { UnstyledButton } from "@mantine/core";
7
7
  import { Box as Box$1 } from "@likec4/styles/jsx";
8
8
  import { hstack } from "@likec4/styles/patterns";
9
9
  //#region src/likec4diagram/ui/LayoutDriftFrame.tsx
10
+ var borderColors = {
11
+ manual: css({ borderColor: "likec4.compare.manual" }),
12
+ auto: css({ borderColor: "likec4.compare.latest" })
13
+ };
14
+ var bgColors = {
15
+ manual: css({ backgroundColor: "likec4.compare.manual" }),
16
+ auto: css({ backgroundColor: "likec4.compare.latest" })
17
+ };
10
18
  var LayoutDriftFrame = memo(() => {
11
- const [{ layout, isActive }, { toggleCompare }] = useDiagramCompareLayout();
12
- const bgColor = layout === "manual" ? "var(--mantine-color-orange-6)" : "var(--mantine-color-green-6)";
19
+ const [{ layout, state }, { toggleCompare }] = useDiagramCompareLayout();
13
20
  return /* @__PURE__ */ jsx(Box$1, {
14
- className: hstack({
21
+ className: cx(hstack({
15
22
  position: "absolute",
16
23
  top: "0",
17
24
  left: "0",
@@ -22,14 +29,13 @@ var LayoutDriftFrame = memo(() => {
22
29
  pointerEvents: "none",
23
30
  alignItems: "flex-start",
24
31
  justifyContent: "center"
25
- }),
32
+ }), borderColors[layout]),
26
33
  style: {
27
34
  zIndex: "9999",
28
- display: !isActive ? "none" : void 0,
29
- borderColor: bgColor
35
+ display: state == "inactive" ? "none" : void 0
30
36
  },
31
37
  children: /* @__PURE__ */ jsx(Btn, {
32
- style: { backgroundColor: bgColor },
38
+ className: bgColors[layout],
33
39
  onClick: (e) => {
34
40
  e.stopPropagation();
35
41
  toggleCompare();
@@ -38,7 +44,7 @@ var LayoutDriftFrame = memo(() => {
38
44
  })
39
45
  });
40
46
  });
41
- var Btn = UnstyledButton.withProps({ className: css({
47
+ var Btn = UnstyledButton.withProps({ classNames: { root: css({
42
48
  fontSize: "xs",
43
49
  fontWeight: "medium",
44
50
  py: "1.5",
@@ -50,6 +56,6 @@ var Btn = UnstyledButton.withProps({ className: css({
50
56
  color: "mantine.gray[9]",
51
57
  pointerEvents: "all",
52
58
  _active: { transform: "translateY(-3px)" }
53
- }) });
59
+ }) } });
54
60
  //#endregion
55
61
  export { LayoutDriftFrame };
@@ -1,4 +1,4 @@
1
1
  export { FloatingSequenceActors } from './FloatingSequenceActors';
2
2
  export { LayoutDriftFrame } from './LayoutDriftFrame';
3
3
  export { NotationPanel } from './notation/NotationPanel';
4
- export { SequenceOutlinePanel } from './sequence-outline/SequenceOutlinePanel';
4
+ export { SequenceOutlinePanel } from './sequence-outline';
@@ -17,37 +17,35 @@ var icon = css({
17
17
  var card = css({
18
18
  cursor: "default",
19
19
  userSelect: "none",
20
- minWidth: 200,
21
- maxWidth: "calc(100vw - 20px)",
20
+ minWidth: "[200px]",
21
+ maxWidth: "[calc(100vw - 20px)]",
22
22
  backgroundColor: `surface.default/80`,
23
23
  sm: {
24
- minWidth: 300,
25
- maxWidth: `65vw`
24
+ minWidth: "[300px]",
25
+ maxWidth: `[65vw]`
26
26
  },
27
- md: { maxWidth: `40vw` },
28
- _dark: { backgroundColor: `mantine.dark[6]/80` }
27
+ md: { maxWidth: `[40vw]` }
29
28
  });
30
29
  var tabPanel = css({ padding: "xxs" });
31
30
  var elementNotation = css({
32
31
  backgroundColor: "transparent",
33
- transition: "all 100ms ease-in",
32
+ transition: "[all 100ms ease-in]",
34
33
  _hover: {
35
- transition: "all 120ms ease-out",
36
- backgroundColor: `mantine.primary[2]/50`
37
- },
38
- _dark: { _hover: { backgroundColor: `mantine.dark[3]/40` } }
34
+ transition: "[all 120ms ease-out]",
35
+ backgroundColor: `surface.hover`
36
+ }
39
37
  });
40
38
  css({
41
39
  fill: "var(--likec4-palette-fill)",
42
40
  stroke: "var(--likec4-palette-stroke)",
43
- strokeWidth: 1,
41
+ strokeWidth: "[1px]",
44
42
  overflow: "visible",
45
43
  width: "100%",
46
44
  height: "auto",
47
- filter: `
45
+ filter: `[
48
46
  drop-shadow(0 2px 3px rgb(0 0 0 / 22%))
49
47
  drop-shadow(0 1px 8px rgb(0 0 0 / 10%))
50
- `
48
+ ]`
51
49
  });
52
50
  var shapeBadge = css({
53
51
  fontWeight: "medium",
@@ -55,7 +53,7 @@ var shapeBadge = css({
55
53
  paddingTop: "0",
56
54
  paddingBottom: "0",
57
55
  textTransform: "lowercase",
58
- transition: "all 150ms ease-in-out",
56
+ transition: "[all 150ms ease-in-out]",
59
57
  cursor: "pointer",
60
58
  ["--badge-radius"]: "2px",
61
59
  ["--badge-fz"]: "9.5px",