@likec4/diagram 1.27.0 → 1.27.2
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.
- package/bundle/index.js +2343 -6880
- package/dist/LikeC4Diagram.js +3 -9
- package/dist/LikeC4Diagram.props.d.ts +5 -3
- package/dist/StaticLikeC4Diagram.js +1 -1
- package/dist/_virtual/set.js +5 -0
- package/dist/_virtual/set2.js +3 -0
- package/dist/base/BaseXYFlow.d.ts +2 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.js +1 -2
- package/dist/base/primitives/edge/EdgeLabel.css.js +1 -4
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -1
- package/dist/base/primitives/edge/EdgePath.js +0 -3
- package/dist/base/primitives/edge/edge.css.js +2 -0
- package/dist/base/primitives/element/ElementActionButtons.js +5 -10
- package/dist/base/primitives/element/ElementNodeContainer.css.js +5 -4
- package/dist/base/primitives/element/ElementShape.css.js +1 -12
- package/dist/base/primitives/element/ElementTitle.css.js +3 -2
- package/dist/base/types.js +2 -2
- package/dist/base/updateEdges.js +1 -9
- package/dist/base/updateNodes.js +1 -12
- package/dist/bundle/LikeC4View.js +2 -2
- package/dist/bundle/LikeC4View.props.d.ts +7 -7
- package/dist/components/Link.js +1 -1
- package/dist/hooks/useCurrentViewId.js +8 -2
- package/dist/hooks/useDiagram.d.ts +2659 -1996
- package/dist/hooks/useDiagram.js +16 -8
- package/dist/likec4diagram/DiagramXYFlow.js +10 -9
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +30 -41
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +6 -1
- package/dist/likec4diagram/ui/controls/LayoutDriftNotification.js +13 -5
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +3 -3
- package/dist/likec4diagram/ui/notation/NotationPanel.js +10 -4
- package/dist/likec4diagram/useLayoutConstraints.d.ts +11 -10
- package/dist/likec4diagram/useLayoutConstraints.js +64 -61
- package/dist/node_modules/.pnpm/mnemonist@0.40.3_patch_hash_5c12abb43fcff6fd81e53021b89075d53249640d165a2556cc1e58d71201a13a/node_modules/mnemonist/set.js +369 -0
- package/dist/overlays/Overlays.js +5 -3
- package/dist/overlays/element-details/actor.d.ts +2769 -173
- package/dist/overlays/overlay/Overlay.css.d.ts +26 -2
- package/dist/overlays/overlay/Overlay.css.js +83 -16
- package/dist/overlays/overlay/Overlay.d.ts +7 -6
- package/dist/overlays/overlay/Overlay.js +39 -32
- package/dist/overlays/overlaysActor.js +2 -2
- package/dist/overlays/relationship-details/RelationshipDetails.js +113 -70
- package/dist/overlays/relationship-details/SelectEdge.d.ts +1 -1
- package/dist/overlays/relationship-details/SelectEdge.js +15 -9
- package/dist/overlays/relationship-details/_types.d.ts +4 -1
- package/dist/overlays/relationship-details/actor.d.ts +415 -128
- package/dist/overlays/relationship-details/actor.js +162 -53
- package/dist/overlays/relationship-details/compute.d.ts +12 -0
- package/dist/overlays/relationship-details/compute.js +139 -0
- package/dist/overlays/relationship-details/custom/ElementActions.js +27 -5
- package/dist/overlays/relationship-details/custom/edgeTypes.js +1 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +2 -1
- package/dist/overlays/relationship-details/hooks.d.ts +336 -6
- package/dist/overlays/relationship-details/hooks.js +9 -7
- package/dist/overlays/relationship-details/layout-to-xyflow.d.ts +12 -0
- package/dist/overlays/relationship-details/layout-to-xyflow.js +149 -0
- package/dist/overlays/relationship-details/layout.d.ts +22 -0
- package/dist/overlays/relationship-details/layout.js +314 -0
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +3 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.js +4 -4
- package/dist/overlays/relationships-browser/_types.d.ts +2 -0
- package/dist/overlays/relationships-browser/actor.d.ts +130 -14
- package/dist/overlays/relationships-browser/actor.js +30 -16
- package/dist/overlays/relationships-browser/custom/ElementActions.js +5 -3
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +3 -1
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.d.ts +3 -1
- package/dist/overlays/relationships-browser/hooks.js +1 -1
- package/dist/overlays/relationships-browser/{-useRelationshipsView.d.ts → layout.d.ts} +2 -0
- package/dist/overlays/relationships-browser/{-useRelationshipsView.js → layout.js} +19 -2
- package/dist/overlays/relationships-browser/useViewToNodesEdges.d.ts +1 -1
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +3 -1
- package/dist/packages/core/src/compute-view/relationships-view/compute.js +1 -1
- package/dist/packages/core/src/model/connection/model/ConnectionModel.js +121 -0
- package/dist/packages/core/src/model/connection/model/find.js +39 -0
- package/dist/packages/core/src/model/connection/ops.js +7 -0
- package/dist/packages/core/src/utils/const.js +3 -0
- package/dist/packages/core/src/utils/fqn.js +9 -1
- package/dist/packages/core/src/utils/iterable/find.js +21 -0
- package/dist/packages/core/src/utils/iterable/some.js +21 -0
- package/dist/packages/core/src/utils/set.js +48 -0
- package/dist/packages/core/src/utils/string-hash.js +13 -0
- package/dist/state/DiagramActorProvider.d.ts +4 -2
- package/dist/state/DiagramActorProvider.js +30 -37
- package/dist/state/assign.js +2 -2
- package/dist/state/diagram-machine.d.ts +1731 -1040
- package/dist/state/diagram-machine.js +126 -60
- package/dist/state/syncManualLayoutActor.d.ts +1 -1
- package/dist/styles.css.js +1 -1
- package/package.json +11 -11
- package/src/LikeC4Diagram.props.ts +7 -3
- package/src/LikeC4Diagram.tsx +2 -8
- package/src/StaticLikeC4Diagram.tsx +1 -1
- package/src/base/BaseXYFlow.tsx +2 -1
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +1 -3
- package/src/base/primitives/edge/EdgeLabel.css.ts +1 -4
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +1 -1
- package/src/base/primitives/edge/EdgePath.tsx +0 -3
- package/src/base/primitives/edge/edge.css.ts +2 -0
- package/src/base/primitives/element/ElementActionButtons.tsx +6 -7
- package/src/base/primitives/element/ElementNodeContainer.css.ts +5 -4
- package/src/base/primitives/element/ElementShape.css.ts +1 -12
- package/src/base/primitives/element/ElementTitle.css.ts +3 -2
- package/src/base/types.ts +2 -7
- package/src/base/updateEdges.ts +8 -8
- package/src/base/updateNodes.ts +11 -11
- package/src/bundle/LikeC4View.props.ts +7 -7
- package/src/bundle/LikeC4View.tsx +2 -2
- package/src/components/Link.tsx +3 -1
- package/src/hooks/useCurrentViewId.ts +4 -2
- package/src/hooks/useDiagram.ts +18 -9
- package/src/likec4diagram/DiagramXYFlow.tsx +11 -9
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +39 -48
- package/src/likec4diagram/custom/nodes/toolbar/Toolbar.tsx +2 -2
- package/src/likec4diagram/custom/nodes/toolbar/styles.css.ts +5 -0
- package/src/likec4diagram/ui/controls/LayoutDriftNotification.tsx +8 -4
- package/src/likec4diagram/ui/notation/NotationPanel.css.ts +2 -2
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +8 -6
- package/src/likec4diagram/useLayoutConstraints.ts +84 -89
- package/src/overlays/Overlays.tsx +5 -3
- package/src/overlays/overlay/Overlay.css.ts +83 -15
- package/src/overlays/overlay/Overlay.tsx +52 -41
- package/src/overlays/overlaysActor.ts +1 -1
- package/src/overlays/relationship-details/RelationshipDetails.tsx +131 -68
- package/src/overlays/relationship-details/SelectEdge.tsx +19 -12
- package/src/overlays/relationship-details/_types.ts +3 -1
- package/src/overlays/relationship-details/actor.ts +217 -68
- package/src/overlays/relationship-details/compute.ts +186 -0
- package/src/overlays/relationship-details/custom/ElementActions.tsx +27 -18
- package/src/overlays/relationship-details/custom/edgeTypes.tsx +1 -1
- package/src/overlays/relationship-details/hooks.ts +10 -8
- package/src/overlays/relationship-details/layout-to-xyflow.ts +195 -0
- package/src/overlays/relationship-details/layout.ts +470 -0
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +2 -2
- package/src/overlays/relationships-browser/SelectElement.tsx +5 -5
- package/src/overlays/relationships-browser/_types.ts +2 -0
- package/src/overlays/relationships-browser/actor.ts +39 -14
- package/src/overlays/relationships-browser/custom/ElementActions.tsx +5 -3
- package/src/overlays/relationships-browser/custom/edgeTypes.tsx +1 -1
- package/src/overlays/relationships-browser/hooks.ts +2 -2
- package/src/overlays/relationships-browser/{-useRelationshipsView.ts → layout.ts} +23 -13
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +3 -1
- package/src/state/DiagramActorProvider.tsx +40 -50
- package/src/state/assign.ts +2 -2
- package/src/state/diagram-machine.ts +151 -75
- package/dist/overlays/relationship-details/useLayoutedDetails.d.ts +0 -19
- package/dist/overlays/relationship-details/useLayoutedDetails.js +0 -267
- package/src/overlays/relationship-details/useLayoutedDetails.ts +0 -376
|
@@ -13,7 +13,7 @@ import { lastClickedNode, updateNavigationHistory, mergeXYNodesEdges, updateEdge
|
|
|
13
13
|
import { hotkeyActorLogic } from './hotkeyActor.js';
|
|
14
14
|
import { DiagramToggledFeaturesPersistence } from './persistence.js';
|
|
15
15
|
import { syncManualLayoutActorLogic } from './syncManualLayoutActor.js';
|
|
16
|
-
import { typedSystem, focusedBounds
|
|
16
|
+
import { findDiagramNode, typedSystem, focusedBounds } from './utils.js';
|
|
17
17
|
|
|
18
18
|
const diagramMachine = setup({
|
|
19
19
|
types: {
|
|
@@ -28,6 +28,7 @@ const diagramMachine = setup({
|
|
|
28
28
|
overlaysActorLogic
|
|
29
29
|
},
|
|
30
30
|
guards: {
|
|
31
|
+
"isReady": ({ context }) => context.initialized.xydata && context.initialized.xyflow,
|
|
31
32
|
"enabled: FitView": ({ context }) => context.features.enableFitView,
|
|
32
33
|
"enabled: FocusMode": ({ context }) => context.features.enableFocusMode,
|
|
33
34
|
"enabled: Readonly": ({ context }) => context.features.enableReadOnly,
|
|
@@ -160,15 +161,18 @@ const diagramMachine = setup({
|
|
|
160
161
|
}
|
|
161
162
|
const constraints = createLayoutConstraints(xystore, nodesToAlign);
|
|
162
163
|
const aligner = getAligner(mode);
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
const nodes = nodesToAlign.map((id) => ({
|
|
165
|
+
node: nonNullable(nodeLookup.get(id)),
|
|
166
|
+
rect: nonNullable(constraints.rects.get(id))
|
|
167
|
+
}));
|
|
168
|
+
aligner.computeLayout(nodes.map(({ node }) => toNodeRect(node)));
|
|
169
|
+
for (const { rect, node } of nodes) {
|
|
170
|
+
rect.positionAbsolute = {
|
|
171
|
+
...rect.positionAbsolute,
|
|
172
|
+
...aligner.applyPosition(toNodeRect(node))
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
constraints.updateXYFlowNodes();
|
|
172
176
|
},
|
|
173
177
|
"updateFeatures": enqueueActions(({ enqueue, system, event }) => {
|
|
174
178
|
assertEvent(event, "update.features");
|
|
@@ -195,6 +199,12 @@ const diagramMachine = setup({
|
|
|
195
199
|
type: "close.all"
|
|
196
200
|
}
|
|
197
201
|
),
|
|
202
|
+
"startSyncLayout": assign(({ context, spawn, self }) => ({
|
|
203
|
+
syncLayoutActorRef: spawn("syncManualLayoutActorLogic", {
|
|
204
|
+
id: "syncLayout",
|
|
205
|
+
input: { parent: self, viewId: context.view.id }
|
|
206
|
+
})
|
|
207
|
+
})),
|
|
198
208
|
"stopSyncLayout": enqueueActions(({ context, enqueue }) => {
|
|
199
209
|
enqueue.sendTo(context.syncLayoutActorRef, { type: "stop" });
|
|
200
210
|
enqueue.stopChild(context.syncLayoutActorRef);
|
|
@@ -241,17 +251,36 @@ const diagramMachine = setup({
|
|
|
241
251
|
return e;
|
|
242
252
|
})
|
|
243
253
|
};
|
|
254
|
+
}),
|
|
255
|
+
"notations.highlight": assign(({ context }, params) => {
|
|
256
|
+
const kinds = params.kind ? [params.kind] : params.notation.kinds;
|
|
257
|
+
const xynodes = context.xynodes.map((n) => {
|
|
258
|
+
const node = findDiagramNode(context, n.id);
|
|
259
|
+
if (node && node.notation === params.notation.title && node.shape === params.notation.shape && node.color === params.notation.color && kinds.includes(node.kind)) {
|
|
260
|
+
return Base.setDimmed(n, false);
|
|
261
|
+
}
|
|
262
|
+
return Base.setDimmed(n, "immediate");
|
|
263
|
+
});
|
|
264
|
+
return {
|
|
265
|
+
xynodes,
|
|
266
|
+
xyedges: context.xyedges.map(Base.setDimmed("immediate"))
|
|
267
|
+
};
|
|
244
268
|
})
|
|
245
269
|
}
|
|
246
270
|
}).createMachine({
|
|
247
271
|
initial: "initializing",
|
|
248
272
|
context: ({ input, self, spawn }) => ({
|
|
249
273
|
...input,
|
|
274
|
+
xyedges: [],
|
|
275
|
+
xynodes: [],
|
|
250
276
|
features: { ...AllDisabled },
|
|
251
277
|
toggledFeatures: DiagramToggledFeaturesPersistence.read() ?? {
|
|
252
278
|
enableReadOnly: true
|
|
253
279
|
},
|
|
254
|
-
initialized:
|
|
280
|
+
initialized: {
|
|
281
|
+
xydata: false,
|
|
282
|
+
xyflow: false
|
|
283
|
+
},
|
|
255
284
|
viewportChangedManually: false,
|
|
256
285
|
lastOnNavigate: null,
|
|
257
286
|
lastClickedNode: null,
|
|
@@ -264,10 +293,7 @@ const diagramMachine = setup({
|
|
|
264
293
|
},
|
|
265
294
|
viewport: { x: 0, y: 0, zoom: 1 },
|
|
266
295
|
xyflow: null,
|
|
267
|
-
syncLayoutActorRef:
|
|
268
|
-
id: "syncLayout",
|
|
269
|
-
input: { parent: self, viewId: input.view.id }
|
|
270
|
-
}),
|
|
296
|
+
syncLayoutActorRef: null,
|
|
271
297
|
activeWalkthrough: null
|
|
272
298
|
}),
|
|
273
299
|
// entry: ({ spawn }) => spawn(layoutActor, { id: 'layout', input: { parent: self } }),
|
|
@@ -275,32 +301,54 @@ const diagramMachine = setup({
|
|
|
275
301
|
initializing: {
|
|
276
302
|
on: {
|
|
277
303
|
"xyflow.init": {
|
|
278
|
-
actions:
|
|
279
|
-
|
|
280
|
-
initialized
|
|
281
|
-
xyflow:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
})
|
|
299
|
-
],
|
|
300
|
-
target: "ready"
|
|
304
|
+
actions: assign(({ context, event }) => ({
|
|
305
|
+
initialized: {
|
|
306
|
+
...context.initialized,
|
|
307
|
+
xyflow: true
|
|
308
|
+
},
|
|
309
|
+
xyflow: event.instance
|
|
310
|
+
})),
|
|
311
|
+
target: "isReady"
|
|
312
|
+
},
|
|
313
|
+
"update.view": {
|
|
314
|
+
actions: assign(({ context, event, spawn, self }) => ({
|
|
315
|
+
initialized: {
|
|
316
|
+
...context.initialized,
|
|
317
|
+
xydata: true
|
|
318
|
+
},
|
|
319
|
+
view: event.view,
|
|
320
|
+
xynodes: event.xynodes,
|
|
321
|
+
xyedges: event.xyedges
|
|
322
|
+
})),
|
|
323
|
+
target: "isReady"
|
|
301
324
|
}
|
|
302
325
|
}
|
|
303
326
|
},
|
|
327
|
+
"isReady": {
|
|
328
|
+
always: [{
|
|
329
|
+
guard: "isReady",
|
|
330
|
+
actions: [
|
|
331
|
+
{
|
|
332
|
+
type: "xyflow:fitDiagram",
|
|
333
|
+
params: { duration: 0 }
|
|
334
|
+
},
|
|
335
|
+
"startSyncLayout",
|
|
336
|
+
assign(({ context }) => ({
|
|
337
|
+
navigationHistory: {
|
|
338
|
+
currentIndex: 0,
|
|
339
|
+
history: [{
|
|
340
|
+
viewId: context.view.id,
|
|
341
|
+
fromNode: null,
|
|
342
|
+
viewport: { ...context.xyflow.getViewport() }
|
|
343
|
+
}]
|
|
344
|
+
}
|
|
345
|
+
}))
|
|
346
|
+
],
|
|
347
|
+
target: "ready"
|
|
348
|
+
}, {
|
|
349
|
+
target: "initializing"
|
|
350
|
+
}]
|
|
351
|
+
},
|
|
304
352
|
ready: {
|
|
305
353
|
initial: "idle",
|
|
306
354
|
on: {
|
|
@@ -389,8 +437,8 @@ const diagramMachine = setup({
|
|
|
389
437
|
"open.relationshipDetails": {
|
|
390
438
|
actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context, event }) => ({
|
|
391
439
|
type: "open.relationshipDetails",
|
|
392
|
-
|
|
393
|
-
|
|
440
|
+
viewId: context.view.id,
|
|
441
|
+
...event.params
|
|
394
442
|
}))
|
|
395
443
|
},
|
|
396
444
|
"open.source": {
|
|
@@ -437,6 +485,18 @@ const diagramMachine = setup({
|
|
|
437
485
|
params: prop("event")
|
|
438
486
|
}
|
|
439
487
|
},
|
|
488
|
+
"notations.highlight": {
|
|
489
|
+
actions: {
|
|
490
|
+
type: "notations.highlight",
|
|
491
|
+
params: prop("event")
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
"notations.unhighlight": {
|
|
495
|
+
actions: assign(({ context }) => ({
|
|
496
|
+
xynodes: context.xynodes.map(Base.setDimmed(false)),
|
|
497
|
+
xyedges: context.xyedges.map(Base.setDimmed(false))
|
|
498
|
+
}))
|
|
499
|
+
},
|
|
440
500
|
"saveManualLayout.*": {
|
|
441
501
|
guard: "not readonly",
|
|
442
502
|
actions: sendTo((c) => c.context.syncLayoutActorRef, ({ event }) => {
|
|
@@ -564,6 +624,11 @@ const diagramMachine = setup({
|
|
|
564
624
|
lastClickedNode: null
|
|
565
625
|
}),
|
|
566
626
|
target: "idle"
|
|
627
|
+
},
|
|
628
|
+
"notations.unhighlight": {
|
|
629
|
+
actions: assign((s) => ({
|
|
630
|
+
...focusNodesEdges(s)
|
|
631
|
+
}))
|
|
567
632
|
}
|
|
568
633
|
}
|
|
569
634
|
},
|
|
@@ -616,6 +681,11 @@ const diagramMachine = setup({
|
|
|
616
681
|
enqueue("xyflow:fitFocusedBounds");
|
|
617
682
|
})
|
|
618
683
|
},
|
|
684
|
+
"notations.unhighlight": {
|
|
685
|
+
actions: assign((s) => ({
|
|
686
|
+
...updateActiveWalkthrough(s)
|
|
687
|
+
}))
|
|
688
|
+
},
|
|
619
689
|
"walkthrough.end": {
|
|
620
690
|
target: "idle"
|
|
621
691
|
},
|
|
@@ -658,14 +728,6 @@ const diagramMachine = setup({
|
|
|
658
728
|
})
|
|
659
729
|
}
|
|
660
730
|
],
|
|
661
|
-
exit: assign({
|
|
662
|
-
syncLayoutActorRef: ({ self, context, spawn }) => spawn("syncManualLayoutActorLogic", {
|
|
663
|
-
id: "syncLayout",
|
|
664
|
-
systemId: "syncLayout",
|
|
665
|
-
input: { parent: self, viewId: context.view.id }
|
|
666
|
-
})
|
|
667
|
-
// lastOnNavigate: null,
|
|
668
|
-
}),
|
|
669
731
|
on: {
|
|
670
732
|
"update.view": {
|
|
671
733
|
actions: enqueueActions(({ enqueue, context, event }) => {
|
|
@@ -690,10 +752,11 @@ const diagramMachine = setup({
|
|
|
690
752
|
enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 25 });
|
|
691
753
|
}
|
|
692
754
|
enqueue.assign(updateNavigationHistory);
|
|
693
|
-
enqueue.assign(mergeXYNodesEdges);
|
|
694
755
|
enqueue.assign({
|
|
756
|
+
...mergeXYNodesEdges({ context, event }),
|
|
695
757
|
lastOnNavigate: null
|
|
696
758
|
});
|
|
759
|
+
enqueue("startSyncLayout");
|
|
697
760
|
}),
|
|
698
761
|
target: "#idle"
|
|
699
762
|
}
|
|
@@ -736,15 +799,10 @@ const diagramMachine = setup({
|
|
|
736
799
|
enqueueActions(({ enqueue, event, check, context }) => {
|
|
737
800
|
const isAnotherView = check("is another view");
|
|
738
801
|
if (isAnotherView) {
|
|
739
|
-
const viewId = event.view.id;
|
|
740
802
|
enqueue("closeAllOverlays");
|
|
741
803
|
enqueue("stopSyncLayout");
|
|
742
804
|
enqueue.assign({
|
|
743
|
-
focusedNode: null
|
|
744
|
-
syncLayoutActorRef: ({ self, spawn }) => spawn("syncManualLayoutActorLogic", {
|
|
745
|
-
id: "syncLayout",
|
|
746
|
-
input: { parent: self, viewId }
|
|
747
|
-
})
|
|
805
|
+
focusedNode: null
|
|
748
806
|
});
|
|
749
807
|
const { fromNode, toNode } = findCorrespondingNode(context, event);
|
|
750
808
|
if (fromNode && toNode) {
|
|
@@ -766,16 +824,19 @@ const diagramMachine = setup({
|
|
|
766
824
|
});
|
|
767
825
|
enqueue.raise({ type: "fitDiagram", duration: 200 }, { id: "fitDiagram", delay: 25 });
|
|
768
826
|
}
|
|
827
|
+
}
|
|
828
|
+
enqueue.assign({
|
|
829
|
+
...mergeXYNodesEdges({ context, event }),
|
|
830
|
+
lastOnNavigate: null
|
|
831
|
+
});
|
|
832
|
+
if (isAnotherView) {
|
|
833
|
+
enqueue("startSyncLayout");
|
|
769
834
|
} else {
|
|
770
835
|
enqueue.sendTo((c) => c.context.syncLayoutActorRef, { type: "synced" });
|
|
771
836
|
if (!context.viewportChangedManually) {
|
|
772
837
|
enqueue.raise({ type: "fitDiagram" }, { id: "fitDiagram", delay: 50 });
|
|
773
838
|
}
|
|
774
839
|
}
|
|
775
|
-
enqueue.assign(mergeXYNodesEdges);
|
|
776
|
-
enqueue.assign({
|
|
777
|
-
lastOnNavigate: null
|
|
778
|
-
});
|
|
779
840
|
})
|
|
780
841
|
]
|
|
781
842
|
},
|
|
@@ -793,7 +854,12 @@ const diagramMachine = setup({
|
|
|
793
854
|
assign({
|
|
794
855
|
xyflow: null,
|
|
795
856
|
xystore: null,
|
|
796
|
-
|
|
857
|
+
xyedges: [],
|
|
858
|
+
xynodes: [],
|
|
859
|
+
initialized: {
|
|
860
|
+
xydata: false,
|
|
861
|
+
xyflow: false
|
|
862
|
+
},
|
|
797
863
|
syncLayoutActorRef: null
|
|
798
864
|
})
|
|
799
865
|
]
|
|
@@ -23,7 +23,7 @@ export declare const syncManualLayoutActorLogic: StateMachine<Readonly<Input>, E
|
|
|
23
23
|
}, {
|
|
24
24
|
type: "same view";
|
|
25
25
|
params: unknown;
|
|
26
|
-
}, "timeout", "
|
|
26
|
+
}, "timeout", "synced" | "pending" | "stopped" | "idle" | "paused", "pending" | "ready", Input, NonReducibleUnknown, EventObject, MetaObject, {
|
|
27
27
|
readonly initial: "idle";
|
|
28
28
|
readonly context: ({ input }: {
|
|
29
29
|
spawn: {
|