@likec4/diagram 1.44.0 → 1.45.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 (134) hide show
  1. package/bundle/index.js +18160 -17671
  2. package/dist/LikeC4Diagram.js +7 -5
  3. package/dist/LikeC4Diagram.props.d.ts +9 -8
  4. package/dist/LikeC4Styles.js +0 -3
  5. package/dist/LikeC4View.d.ts +3 -3
  6. package/dist/LikeC4View.js +7 -3
  7. package/dist/ReactLikeC4.d.ts +2 -2
  8. package/dist/base/Base.d.ts +1 -1
  9. package/dist/base/updateEdges.js +25 -15
  10. package/dist/base/updateNodes.d.ts +14 -0
  11. package/dist/base/updateNodes.js +51 -18
  12. package/dist/base-primitives/Markdown.d.ts +30 -4
  13. package/dist/base-primitives/Markdown.js +3 -2
  14. package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
  15. package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
  16. package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
  17. package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
  18. package/dist/base-primitives/edge/EdgeContainer.js +4 -1
  19. package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -2
  20. package/dist/base-primitives/edge/EdgePath.js +24 -4
  21. package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
  22. package/dist/base-primitives/element/ElementActionButtons.js +2 -2
  23. package/dist/base-primitives/element/ElementData.d.ts +3 -3
  24. package/dist/base-primitives/element/ElementData.js +13 -7
  25. package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
  26. package/dist/base-primitives/element/ElementDetailsButton.js +3 -0
  27. package/dist/base-primitives/element/ElementShape.js +5 -5
  28. package/dist/base-primitives/element/ElementTags.d.ts +6 -4
  29. package/dist/context/DiagramFeatures.d.ts +1 -0
  30. package/dist/context/TagStylesContext.js +1 -1
  31. package/dist/custom/hooks.d.ts +2 -2
  32. package/dist/custom/index.js +1 -1
  33. package/dist/hooks/index.d.ts +2 -1
  34. package/dist/hooks/useDiagramCompareLayout.js +7 -2
  35. package/dist/hooks/useLikeC4Project.d.ts +6 -1
  36. package/dist/hooks/useLikeC4Project.js +14 -2
  37. package/dist/hooks/useMediaPrint.d.ts +6 -0
  38. package/dist/likec4diagram/DiagramXYFlow.js +11 -6
  39. package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
  40. package/dist/likec4diagram/custom/edges/EdgeDrifts.js +38 -0
  41. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +24 -14
  42. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +3 -1
  43. package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
  44. package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +5 -5
  45. package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
  46. package/dist/likec4diagram/custom/nodes/{ElementNodeDrifts.js → NodeDrifts.js} +8 -4
  47. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
  48. package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
  49. package/dist/likec4diagram/custom/nodes/nodes.js +64 -23
  50. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +3 -3
  51. package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
  52. package/dist/likec4diagram/state/DiagramActorProvider.d.ts +2 -2
  53. package/dist/likec4diagram/state/DiagramActorProvider.js +0 -1
  54. package/dist/likec4diagram/state/assign.d.ts +10 -6
  55. package/dist/likec4diagram/state/assign.js +17 -192
  56. package/dist/likec4diagram/state/createViewChange.js +15 -26
  57. package/dist/likec4diagram/state/diagram-api.d.ts +2 -6
  58. package/dist/likec4diagram/state/diagram-api.js +2 -10
  59. package/dist/likec4diagram/state/hotkeyActor.d.ts +0 -7
  60. package/dist/likec4diagram/state/hotkeyActor.js +1 -17
  61. package/dist/likec4diagram/state/machine.actions.d.ts +430 -746
  62. package/dist/likec4diagram/state/machine.actions.js +193 -284
  63. package/dist/likec4diagram/state/machine.actions.layout.d.ts +579 -0
  64. package/dist/likec4diagram/state/machine.actions.layout.js +129 -0
  65. package/dist/likec4diagram/state/machine.d.ts +17 -3712
  66. package/dist/likec4diagram/state/machine.js +59 -73
  67. package/dist/likec4diagram/state/machine.setup.d.ts +61 -18
  68. package/dist/likec4diagram/state/machine.setup.js +27 -5
  69. package/dist/likec4diagram/state/machine.state.initializing.d.ts +25 -0
  70. package/dist/likec4diagram/state/machine.state.initializing.js +5 -5
  71. package/dist/likec4diagram/state/machine.state.navigating.d.ts +5 -108
  72. package/dist/likec4diagram/state/machine.state.navigating.js +167 -34
  73. package/dist/likec4diagram/state/machine.state.ready.d.ts +2316 -2851
  74. package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +386 -0
  75. package/dist/likec4diagram/state/machine.state.ready.focused.js +85 -0
  76. package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +474 -0
  77. package/dist/likec4diagram/state/machine.state.ready.idle.js +96 -0
  78. package/dist/likec4diagram/state/machine.state.ready.js +144 -319
  79. package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +128 -0
  80. package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
  81. package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +511 -0
  82. package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +177 -0
  83. package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
  84. package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
  85. package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +6 -240
  86. package/dist/likec4diagram/state/syncManualLayoutActor.js +150 -89
  87. package/dist/likec4diagram/state/types.d.ts +5 -7
  88. package/dist/likec4diagram/state/utils.d.ts +15 -2
  89. package/dist/likec4diagram/state/utils.js +43 -3
  90. package/dist/likec4diagram/types.d.ts +8 -13
  91. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
  92. package/dist/likec4diagram/useLayoutConstraints.js +107 -102
  93. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +12 -15
  94. package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
  95. package/dist/navigationpanel/NavigationPanel.js +5 -1
  96. package/dist/navigationpanel/actor.d.ts +4 -204
  97. package/dist/navigationpanel/actor.js +1 -1
  98. package/dist/navigationpanel/controls/ToggleReadonly.js +8 -3
  99. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
  100. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +4 -3
  101. package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
  102. package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
  103. package/dist/overlays/element-details/actor.d.ts +8 -83
  104. package/dist/overlays/element-details/actor.js +0 -8
  105. package/dist/overlays/overlay/Overlay.js +10 -10
  106. package/dist/overlays/overlaysActor.d.ts +7 -392
  107. package/dist/overlays/overlaysActor.js +67 -46
  108. package/dist/overlays/relationship-details/_types.d.ts +3 -4
  109. package/dist/overlays/relationship-details/actor.d.ts +6 -562
  110. package/dist/overlays/relationship-details/actor.js +1 -0
  111. package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
  112. package/dist/overlays/relationship-details/layout.d.ts +3 -3
  113. package/dist/overlays/relationship-details/layout.js +4 -4
  114. package/dist/overlays/relationships-browser/_types.d.ts +2 -3
  115. package/dist/overlays/relationships-browser/actor.d.ts +7 -739
  116. package/dist/overlays/relationships-browser/layout.d.ts +2 -2
  117. package/dist/overlays/relationships-browser/layout.js +3 -3
  118. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
  119. package/dist/overlays/types.d.ts +12 -13
  120. package/dist/search/components/_shared.css.d.ts +1 -1
  121. package/dist/search/searchActor.d.ts +3 -66
  122. package/dist/shadowroot/ShadowRoot.d.ts +5 -7
  123. package/dist/shadowroot/ShadowRoot.js +7 -5
  124. package/dist/styles.css2.js +1 -1
  125. package/dist/utils/vector.d.ts +5 -0
  126. package/dist/utils/vector.js +7 -0
  127. package/dist/utils/view-bounds.js +7 -6
  128. package/dist/utils/xyflow.d.ts +4 -2
  129. package/dist/utils/xyflow.js +18 -50
  130. package/package.json +19 -18
  131. package/panda.buildinfo.json +17 -5
  132. package/styles-min.css +1 -1
  133. package/styles.css +1 -1
  134. package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.d.ts +0 -4
@@ -0,0 +1,511 @@
1
+ import { CancelAction, StopAction, ActionFunction, Values } from 'xstate';
2
+ import { Context, Events, EmittedEvents } from './machine.setup';
3
+ import { HotKeyEvent, HotkeyActorLogic } from './hotkeyActor';
4
+ import { SyncLayoutActorLogic } from './syncManualLayoutActor';
5
+ import { OverlaysActorLogic } from '../../overlays/overlaysActor';
6
+ import { SearchActorLogic } from '../../search/searchActor';
7
+ import { MediaPrintActorLogic } from './mediaPrintActor';
8
+ export declare const walkthrough: {
9
+ id: string;
10
+ entry: CancelAction<Context, Events, undefined, Events>[];
11
+ exit: StopAction<Context, Events, undefined, Events>[];
12
+ on: {
13
+ 'key.esc': {
14
+ target: string;
15
+ };
16
+ 'key.arrow.left': {
17
+ actions: ActionFunction<Context, HotKeyEvent, Events, undefined, never, never, never, never, never>;
18
+ };
19
+ 'key.arrow.right': {
20
+ actions: ActionFunction<Context, HotKeyEvent, Events, undefined, never, never, never, never, never>;
21
+ };
22
+ 'walkthrough.step': {
23
+ actions: ( ActionFunction<Context, Events, Events, undefined, Values<{
24
+ syncManualLayoutActorLogic: {
25
+ src: "syncManualLayoutActorLogic";
26
+ logic: SyncLayoutActorLogic;
27
+ id: "syncLayout";
28
+ };
29
+ hotkeyActorLogic: {
30
+ src: "hotkeyActorLogic";
31
+ logic: HotkeyActorLogic;
32
+ id: "hotkey";
33
+ };
34
+ overlaysActorLogic: {
35
+ src: "overlaysActorLogic";
36
+ logic: OverlaysActorLogic;
37
+ id: "overlays";
38
+ };
39
+ searchActorLogic: {
40
+ src: "searchActorLogic";
41
+ logic: SearchActorLogic;
42
+ id: "search";
43
+ };
44
+ mediaPrintActorLogic: {
45
+ src: "mediaPrintActorLogic";
46
+ logic: MediaPrintActorLogic;
47
+ id: "mediaPrint";
48
+ };
49
+ }>, never, Values<{
50
+ isReady: {
51
+ type: "isReady";
52
+ params: unknown;
53
+ };
54
+ "enabled: FitView": {
55
+ type: "enabled: FitView";
56
+ params: unknown;
57
+ };
58
+ "enabled: FocusMode": {
59
+ type: "enabled: FocusMode";
60
+ params: unknown;
61
+ };
62
+ "enabled: Readonly": {
63
+ type: "enabled: Readonly";
64
+ params: unknown;
65
+ };
66
+ "enabled: RelationshipDetails": {
67
+ type: "enabled: RelationshipDetails";
68
+ params: unknown;
69
+ };
70
+ "enabled: Search": {
71
+ type: "enabled: Search";
72
+ params: unknown;
73
+ };
74
+ "enabled: ElementDetails": {
75
+ type: "enabled: ElementDetails";
76
+ params: unknown;
77
+ };
78
+ "enabled: OpenSource": {
79
+ type: "enabled: OpenSource";
80
+ params: unknown;
81
+ };
82
+ "enabled: DynamicViewWalkthrough": {
83
+ type: "enabled: DynamicViewWalkthrough";
84
+ params: unknown;
85
+ };
86
+ "enabled: Overlays": {
87
+ type: "enabled: Overlays";
88
+ params: unknown;
89
+ };
90
+ "not readonly": {
91
+ type: "not readonly";
92
+ params: unknown;
93
+ };
94
+ "is dynamic view": {
95
+ type: "is dynamic view";
96
+ params: unknown;
97
+ };
98
+ "is another view": {
99
+ type: "is another view";
100
+ params: unknown;
101
+ };
102
+ "click: node has modelFqn": {
103
+ type: "click: node has modelFqn";
104
+ params: unknown;
105
+ };
106
+ "click: selected node": {
107
+ type: "click: selected node";
108
+ params: unknown;
109
+ };
110
+ "click: same node": {
111
+ type: "click: same node";
112
+ params: unknown;
113
+ };
114
+ "click: focused node": {
115
+ type: "click: focused node";
116
+ params: unknown;
117
+ };
118
+ "click: node has connections": {
119
+ type: "click: node has connections";
120
+ params: unknown;
121
+ };
122
+ "click: selected edge": {
123
+ type: "click: selected edge";
124
+ params: unknown;
125
+ };
126
+ }>, never, EmittedEvents> | ActionFunction<Context, {
127
+ type: "walkthrough.step";
128
+ direction: "next" | "previous";
129
+ }, Events, undefined, Values<{
130
+ syncManualLayoutActorLogic: {
131
+ src: "syncManualLayoutActorLogic";
132
+ logic: SyncLayoutActorLogic;
133
+ id: "syncLayout";
134
+ };
135
+ hotkeyActorLogic: {
136
+ src: "hotkeyActorLogic";
137
+ logic: HotkeyActorLogic;
138
+ id: "hotkey";
139
+ };
140
+ overlaysActorLogic: {
141
+ src: "overlaysActorLogic";
142
+ logic: OverlaysActorLogic;
143
+ id: "overlays";
144
+ };
145
+ searchActorLogic: {
146
+ src: "searchActorLogic";
147
+ logic: SearchActorLogic;
148
+ id: "search";
149
+ };
150
+ mediaPrintActorLogic: {
151
+ src: "mediaPrintActorLogic";
152
+ logic: MediaPrintActorLogic;
153
+ id: "mediaPrint";
154
+ };
155
+ }>, never, never, never, never>)[];
156
+ };
157
+ 'xyflow.edgeClick': {
158
+ actions: ( ActionFunction<Context, Events, Events, undefined, Values<{
159
+ syncManualLayoutActorLogic: {
160
+ src: "syncManualLayoutActorLogic";
161
+ logic: SyncLayoutActorLogic;
162
+ id: "syncLayout";
163
+ };
164
+ hotkeyActorLogic: {
165
+ src: "hotkeyActorLogic";
166
+ logic: HotkeyActorLogic;
167
+ id: "hotkey";
168
+ };
169
+ overlaysActorLogic: {
170
+ src: "overlaysActorLogic";
171
+ logic: OverlaysActorLogic;
172
+ id: "overlays";
173
+ };
174
+ searchActorLogic: {
175
+ src: "searchActorLogic";
176
+ logic: SearchActorLogic;
177
+ id: "search";
178
+ };
179
+ mediaPrintActorLogic: {
180
+ src: "mediaPrintActorLogic";
181
+ logic: MediaPrintActorLogic;
182
+ id: "mediaPrint";
183
+ };
184
+ }>, never, Values<{
185
+ isReady: {
186
+ type: "isReady";
187
+ params: unknown;
188
+ };
189
+ "enabled: FitView": {
190
+ type: "enabled: FitView";
191
+ params: unknown;
192
+ };
193
+ "enabled: FocusMode": {
194
+ type: "enabled: FocusMode";
195
+ params: unknown;
196
+ };
197
+ "enabled: Readonly": {
198
+ type: "enabled: Readonly";
199
+ params: unknown;
200
+ };
201
+ "enabled: RelationshipDetails": {
202
+ type: "enabled: RelationshipDetails";
203
+ params: unknown;
204
+ };
205
+ "enabled: Search": {
206
+ type: "enabled: Search";
207
+ params: unknown;
208
+ };
209
+ "enabled: ElementDetails": {
210
+ type: "enabled: ElementDetails";
211
+ params: unknown;
212
+ };
213
+ "enabled: OpenSource": {
214
+ type: "enabled: OpenSource";
215
+ params: unknown;
216
+ };
217
+ "enabled: DynamicViewWalkthrough": {
218
+ type: "enabled: DynamicViewWalkthrough";
219
+ params: unknown;
220
+ };
221
+ "enabled: Overlays": {
222
+ type: "enabled: Overlays";
223
+ params: unknown;
224
+ };
225
+ "not readonly": {
226
+ type: "not readonly";
227
+ params: unknown;
228
+ };
229
+ "is dynamic view": {
230
+ type: "is dynamic view";
231
+ params: unknown;
232
+ };
233
+ "is another view": {
234
+ type: "is another view";
235
+ params: unknown;
236
+ };
237
+ "click: node has modelFqn": {
238
+ type: "click: node has modelFqn";
239
+ params: unknown;
240
+ };
241
+ "click: selected node": {
242
+ type: "click: selected node";
243
+ params: unknown;
244
+ };
245
+ "click: same node": {
246
+ type: "click: same node";
247
+ params: unknown;
248
+ };
249
+ "click: focused node": {
250
+ type: "click: focused node";
251
+ params: unknown;
252
+ };
253
+ "click: node has connections": {
254
+ type: "click: node has connections";
255
+ params: unknown;
256
+ };
257
+ "click: selected edge": {
258
+ type: "click: selected edge";
259
+ params: unknown;
260
+ };
261
+ }>, never, EmittedEvents> | ActionFunction<Context, {
262
+ type: "xyflow.edgeClick";
263
+ edge: import("../types").Types.Edge;
264
+ }, Events, undefined, Values<{
265
+ syncManualLayoutActorLogic: {
266
+ src: "syncManualLayoutActorLogic";
267
+ logic: SyncLayoutActorLogic;
268
+ id: "syncLayout";
269
+ };
270
+ hotkeyActorLogic: {
271
+ src: "hotkeyActorLogic";
272
+ logic: HotkeyActorLogic;
273
+ id: "hotkey";
274
+ };
275
+ overlaysActorLogic: {
276
+ src: "overlaysActorLogic";
277
+ logic: OverlaysActorLogic;
278
+ id: "overlays";
279
+ };
280
+ searchActorLogic: {
281
+ src: "searchActorLogic";
282
+ logic: SearchActorLogic;
283
+ id: "search";
284
+ };
285
+ mediaPrintActorLogic: {
286
+ src: "mediaPrintActorLogic";
287
+ logic: MediaPrintActorLogic;
288
+ id: "mediaPrint";
289
+ };
290
+ }>, never, never, never, never>)[];
291
+ };
292
+ 'notations.unhighlight': {
293
+ actions: ActionFunction<Context, Events, Events, undefined, Values<{
294
+ syncManualLayoutActorLogic: {
295
+ src: "syncManualLayoutActorLogic";
296
+ logic: SyncLayoutActorLogic;
297
+ id: "syncLayout";
298
+ };
299
+ hotkeyActorLogic: {
300
+ src: "hotkeyActorLogic";
301
+ logic: HotkeyActorLogic;
302
+ id: "hotkey";
303
+ };
304
+ overlaysActorLogic: {
305
+ src: "overlaysActorLogic";
306
+ logic: OverlaysActorLogic;
307
+ id: "overlays";
308
+ };
309
+ searchActorLogic: {
310
+ src: "searchActorLogic";
311
+ logic: SearchActorLogic;
312
+ id: "search";
313
+ };
314
+ mediaPrintActorLogic: {
315
+ src: "mediaPrintActorLogic";
316
+ logic: MediaPrintActorLogic;
317
+ id: "mediaPrint";
318
+ };
319
+ }>, never, Values<{
320
+ isReady: {
321
+ type: "isReady";
322
+ params: unknown;
323
+ };
324
+ "enabled: FitView": {
325
+ type: "enabled: FitView";
326
+ params: unknown;
327
+ };
328
+ "enabled: FocusMode": {
329
+ type: "enabled: FocusMode";
330
+ params: unknown;
331
+ };
332
+ "enabled: Readonly": {
333
+ type: "enabled: Readonly";
334
+ params: unknown;
335
+ };
336
+ "enabled: RelationshipDetails": {
337
+ type: "enabled: RelationshipDetails";
338
+ params: unknown;
339
+ };
340
+ "enabled: Search": {
341
+ type: "enabled: Search";
342
+ params: unknown;
343
+ };
344
+ "enabled: ElementDetails": {
345
+ type: "enabled: ElementDetails";
346
+ params: unknown;
347
+ };
348
+ "enabled: OpenSource": {
349
+ type: "enabled: OpenSource";
350
+ params: unknown;
351
+ };
352
+ "enabled: DynamicViewWalkthrough": {
353
+ type: "enabled: DynamicViewWalkthrough";
354
+ params: unknown;
355
+ };
356
+ "enabled: Overlays": {
357
+ type: "enabled: Overlays";
358
+ params: unknown;
359
+ };
360
+ "not readonly": {
361
+ type: "not readonly";
362
+ params: unknown;
363
+ };
364
+ "is dynamic view": {
365
+ type: "is dynamic view";
366
+ params: unknown;
367
+ };
368
+ "is another view": {
369
+ type: "is another view";
370
+ params: unknown;
371
+ };
372
+ "click: node has modelFqn": {
373
+ type: "click: node has modelFqn";
374
+ params: unknown;
375
+ };
376
+ "click: selected node": {
377
+ type: "click: selected node";
378
+ params: unknown;
379
+ };
380
+ "click: same node": {
381
+ type: "click: same node";
382
+ params: unknown;
383
+ };
384
+ "click: focused node": {
385
+ type: "click: focused node";
386
+ params: unknown;
387
+ };
388
+ "click: node has connections": {
389
+ type: "click: node has connections";
390
+ params: unknown;
391
+ };
392
+ "click: selected edge": {
393
+ type: "click: selected edge";
394
+ params: unknown;
395
+ };
396
+ }>, never, EmittedEvents>;
397
+ };
398
+ 'tag.unhighlight': {
399
+ actions: ActionFunction<Context, Events, Events, undefined, Values<{
400
+ syncManualLayoutActorLogic: {
401
+ src: "syncManualLayoutActorLogic";
402
+ logic: SyncLayoutActorLogic;
403
+ id: "syncLayout";
404
+ };
405
+ hotkeyActorLogic: {
406
+ src: "hotkeyActorLogic";
407
+ logic: HotkeyActorLogic;
408
+ id: "hotkey";
409
+ };
410
+ overlaysActorLogic: {
411
+ src: "overlaysActorLogic";
412
+ logic: OverlaysActorLogic;
413
+ id: "overlays";
414
+ };
415
+ searchActorLogic: {
416
+ src: "searchActorLogic";
417
+ logic: SearchActorLogic;
418
+ id: "search";
419
+ };
420
+ mediaPrintActorLogic: {
421
+ src: "mediaPrintActorLogic";
422
+ logic: MediaPrintActorLogic;
423
+ id: "mediaPrint";
424
+ };
425
+ }>, never, Values<{
426
+ isReady: {
427
+ type: "isReady";
428
+ params: unknown;
429
+ };
430
+ "enabled: FitView": {
431
+ type: "enabled: FitView";
432
+ params: unknown;
433
+ };
434
+ "enabled: FocusMode": {
435
+ type: "enabled: FocusMode";
436
+ params: unknown;
437
+ };
438
+ "enabled: Readonly": {
439
+ type: "enabled: Readonly";
440
+ params: unknown;
441
+ };
442
+ "enabled: RelationshipDetails": {
443
+ type: "enabled: RelationshipDetails";
444
+ params: unknown;
445
+ };
446
+ "enabled: Search": {
447
+ type: "enabled: Search";
448
+ params: unknown;
449
+ };
450
+ "enabled: ElementDetails": {
451
+ type: "enabled: ElementDetails";
452
+ params: unknown;
453
+ };
454
+ "enabled: OpenSource": {
455
+ type: "enabled: OpenSource";
456
+ params: unknown;
457
+ };
458
+ "enabled: DynamicViewWalkthrough": {
459
+ type: "enabled: DynamicViewWalkthrough";
460
+ params: unknown;
461
+ };
462
+ "enabled: Overlays": {
463
+ type: "enabled: Overlays";
464
+ params: unknown;
465
+ };
466
+ "not readonly": {
467
+ type: "not readonly";
468
+ params: unknown;
469
+ };
470
+ "is dynamic view": {
471
+ type: "is dynamic view";
472
+ params: unknown;
473
+ };
474
+ "is another view": {
475
+ type: "is another view";
476
+ params: unknown;
477
+ };
478
+ "click: node has modelFqn": {
479
+ type: "click: node has modelFqn";
480
+ params: unknown;
481
+ };
482
+ "click: selected node": {
483
+ type: "click: selected node";
484
+ params: unknown;
485
+ };
486
+ "click: same node": {
487
+ type: "click: same node";
488
+ params: unknown;
489
+ };
490
+ "click: focused node": {
491
+ type: "click: focused node";
492
+ params: unknown;
493
+ };
494
+ "click: node has connections": {
495
+ type: "click: node has connections";
496
+ params: unknown;
497
+ };
498
+ "click: selected edge": {
499
+ type: "click: selected edge";
500
+ params: unknown;
501
+ };
502
+ }>, never, EmittedEvents>;
503
+ };
504
+ 'walkthrough.end': {
505
+ target: string;
506
+ };
507
+ 'xyflow.paneDblClick': {
508
+ target: string;
509
+ };
510
+ };
511
+ };
@@ -0,0 +1,177 @@
1
+ import { isStepEdgeId, getParallelStepsPrefix, invariant } from '@likec4/core';
2
+ import { clamp, first } from 'remeda';
3
+ import { assertEvent } from 'xstate';
4
+ import { SeqParallelAreaColor } from '../xyflow-sequence/const.js';
5
+ import { emitEdgeClick, stopHotKeyActor, undimEverything, startHotKeyActor, cancelEditing } from './machine.actions.js';
6
+ import { machine, targetState } from './machine.setup.js';
7
+ import { x as xstateActions_cjsExports } from '../../_virtual/xstate-actions.cjs.js';
8
+ import { fitFocusedBounds, returnViewportBefore, cancelFitDiagram, assignViewportBefore } from './machine.actions.layout.js';
9
+ import { Base } from '../../base/Base.js';
10
+
11
+ const updateActiveWalkthroughState = () => machine.enqueueActions(({ context, enqueue }) => {
12
+ const { activeWalkthrough } = context;
13
+ if (!activeWalkthrough) {
14
+ console.warn("Active walkthrough is null");
15
+ enqueue.raise({ type: "walkthrough.end" });
16
+ return;
17
+ }
18
+ const { stepId, parallelPrefix } = activeWalkthrough;
19
+ const step = context.xyedges.find((x) => x.id === stepId);
20
+ if (!step) {
21
+ console.warn("Invalid walkthrough stepId:", stepId);
22
+ enqueue.raise({ type: "walkthrough.end" });
23
+ return;
24
+ }
25
+ enqueue.assign({
26
+ xyedges: context.xyedges.map((edge) => {
27
+ const active = stepId === edge.id || !!parallelPrefix && edge.id.startsWith(parallelPrefix);
28
+ return Base.setData(edge, {
29
+ active,
30
+ dimmed: stepId !== edge.id
31
+ });
32
+ }),
33
+ xynodes: context.xynodes.map((node) => {
34
+ const dimmed = step.source !== node.id && step.target !== node.id;
35
+ if (node.type === "seq-parallel") {
36
+ return Base.setData(node, {
37
+ color: parallelPrefix === node.data.parallelPrefix ? SeqParallelAreaColor.active : SeqParallelAreaColor.default,
38
+ dimmed
39
+ });
40
+ }
41
+ return Base.setDimmed(node, dimmed);
42
+ })
43
+ });
44
+ });
45
+ const emitWalkthroughStarted = () => machine.emit(({ context }) => {
46
+ const edge = context.xyedges.find((x) => x.id === context.activeWalkthrough?.stepId);
47
+ invariant(edge, "Invalid walkthrough state");
48
+ return {
49
+ type: "walkthroughStarted",
50
+ edge
51
+ };
52
+ });
53
+ const emitWalkthroughStopped = () => machine.emit(() => ({
54
+ type: "walkthroughStopped"
55
+ }));
56
+ const emitWalkthroughStep = () => machine.emit(({ context }) => {
57
+ const edge = context.xyedges.find((x) => x.id === context.activeWalkthrough?.stepId);
58
+ invariant(edge, "Invalid walkthrough state");
59
+ return {
60
+ type: "walkthroughStep",
61
+ edge
62
+ };
63
+ });
64
+ const walkthrough = machine.createStateConfig({
65
+ id: targetState.walkthrough.slice(1),
66
+ entry: [
67
+ startHotKeyActor(),
68
+ cancelEditing(),
69
+ cancelFitDiagram(),
70
+ assignViewportBefore(),
71
+ xstateActions_cjsExports.assign({
72
+ activeWalkthrough: ({ context, event }) => {
73
+ assertEvent(event, "walkthrough.start");
74
+ const stepId = event.stepId ?? first(context.xyedges).id;
75
+ return {
76
+ stepId,
77
+ parallelPrefix: getParallelStepsPrefix(stepId)
78
+ };
79
+ }
80
+ }),
81
+ updateActiveWalkthroughState(),
82
+ fitFocusedBounds(),
83
+ emitWalkthroughStarted()
84
+ ],
85
+ exit: [
86
+ stopHotKeyActor(),
87
+ xstateActions_cjsExports.enqueueActions(({ enqueue, context }) => {
88
+ enqueue.assign({
89
+ activeWalkthrough: null
90
+ });
91
+ if (context.dynamicViewVariant === "sequence" && context.activeWalkthrough?.parallelPrefix) {
92
+ enqueue.assign({
93
+ xynodes: context.xynodes.map((n) => {
94
+ if (n.type === "seq-parallel") {
95
+ return Base.setData(n, {
96
+ color: SeqParallelAreaColor.default
97
+ });
98
+ }
99
+ return n;
100
+ })
101
+ });
102
+ }
103
+ }),
104
+ undimEverything(),
105
+ returnViewportBefore(),
106
+ emitWalkthroughStopped()
107
+ ],
108
+ on: {
109
+ "key.esc": {
110
+ target: targetState.idle
111
+ },
112
+ "key.arrow.left": {
113
+ actions: xstateActions_cjsExports.raise({ type: "walkthrough.step", direction: "previous" })
114
+ },
115
+ "key.arrow.right": {
116
+ actions: xstateActions_cjsExports.raise({ type: "walkthrough.step", direction: "next" })
117
+ },
118
+ "walkthrough.step": {
119
+ actions: [
120
+ xstateActions_cjsExports.assign(({ context, event }) => {
121
+ const { stepId } = context.activeWalkthrough;
122
+ const stepIndex = context.xyedges.findIndex((e) => e.id === stepId);
123
+ const nextStepIndex = clamp(event.direction === "next" ? stepIndex + 1 : stepIndex - 1, {
124
+ min: 0,
125
+ max: context.xyedges.length - 1
126
+ });
127
+ if (nextStepIndex === stepIndex) {
128
+ return {};
129
+ }
130
+ const nextStepId = context.xyedges[nextStepIndex].id;
131
+ return {
132
+ activeWalkthrough: {
133
+ stepId: nextStepId,
134
+ parallelPrefix: getParallelStepsPrefix(nextStepId)
135
+ }
136
+ };
137
+ }),
138
+ updateActiveWalkthroughState(),
139
+ fitFocusedBounds(),
140
+ emitWalkthroughStep()
141
+ ]
142
+ },
143
+ "xyflow.edgeClick": {
144
+ actions: [
145
+ xstateActions_cjsExports.assign(({ event, context }) => {
146
+ if (!isStepEdgeId(event.edge.id) || event.edge.id === context.activeWalkthrough?.stepId) {
147
+ return {};
148
+ }
149
+ return {
150
+ activeWalkthrough: {
151
+ stepId: event.edge.id,
152
+ parallelPrefix: getParallelStepsPrefix(event.edge.id)
153
+ }
154
+ };
155
+ }),
156
+ updateActiveWalkthroughState(),
157
+ fitFocusedBounds(),
158
+ emitEdgeClick(),
159
+ emitWalkthroughStep()
160
+ ]
161
+ },
162
+ "notations.unhighlight": {
163
+ actions: updateActiveWalkthroughState()
164
+ },
165
+ "tag.unhighlight": {
166
+ actions: updateActiveWalkthroughState()
167
+ },
168
+ "walkthrough.end": {
169
+ target: targetState.idle
170
+ },
171
+ "xyflow.paneDblClick": {
172
+ target: targetState.idle
173
+ }
174
+ }
175
+ });
176
+
177
+ export { walkthrough };
@@ -0,0 +1,12 @@
1
+ import { AnyEventObject, CallbackActorLogic, NonReducibleUnknown } from 'xstate';
2
+ export type MediaPrintEvent = {
3
+ type: 'media.print.on';
4
+ } | {
5
+ type: 'media.print.off';
6
+ };
7
+ export interface MediaPrintActorLogic extends CallbackActorLogic<AnyEventObject, NonReducibleUnknown, MediaPrintEvent> {
8
+ }
9
+ /**
10
+ * Actor logic to listen for media print events.
11
+ */
12
+ export declare const mediaPrintActorLogic: MediaPrintActorLogic;