dishui 0.0.55 → 0.0.57
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/dist/components/Select/index.js +90 -72
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +656 -568
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +1027 -970
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/canvas/ViewportContainer.d.ts +6 -0
- package/dist/components/pro/Flow/canvas/ViewportContainer.js +20 -15
- package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.d.ts +12 -3
- package/dist/components/pro/Flow/context/FlowUIContext.js +89 -81
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useCompactMode.d.ts +13 -0
- package/dist/components/pro/Flow/hooks/useCompactMode.js +20 -0
- package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -0
- package/dist/components/pro/Flow/hooks/useDraggablePanel.d.ts +19 -4
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js +31 -24
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useMindMap.js +16 -22
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js +16 -16
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowPanelGroup.d.ts +10 -5
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js +95 -67
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/utils/i18n.js +20 -0
- package/dist/utils/i18n.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,562 +1,508 @@
|
|
|
1
|
-
import { useFlowContext as
|
|
2
|
-
import { useFlowUI as
|
|
3
|
-
import { usePixiApp as
|
|
4
|
-
import { useViewport as
|
|
5
|
-
import { GridRenderer as
|
|
6
|
-
import { SelectionOverlay as
|
|
7
|
-
import { shapeDrawers as
|
|
8
|
-
import { findClosestHandleWorld as
|
|
9
|
-
import { distToSegment as
|
|
10
|
-
import { NodeRenderer as
|
|
11
|
-
import { buildEdgePath as
|
|
12
|
-
import { EdgeRenderer as
|
|
13
|
-
import { LineRenderer as
|
|
14
|
-
import { FreehandTool as
|
|
15
|
-
import { GeometricLineTool as
|
|
16
|
-
import { computeAlignmentSnap as
|
|
17
|
-
import { AlignmentGuidesRenderer as
|
|
18
|
-
import { getDocumentSlides as
|
|
19
|
-
import { useCallback as
|
|
20
|
-
import { jsx as
|
|
21
|
-
import { Graphics as
|
|
22
|
-
var
|
|
1
|
+
import { useFlowContext as sn } from "./context/FlowContext.js";
|
|
2
|
+
import { useFlowUI as cn } from "./context/FlowUIContext.js";
|
|
3
|
+
import { usePixiApp as dn } from "./hooks/usePixiApp.js";
|
|
4
|
+
import { useViewport as an } from "./hooks/useViewport.js";
|
|
5
|
+
import { GridRenderer as ln } from "./canvas/GridRenderer.js";
|
|
6
|
+
import { SelectionOverlay as un } from "./canvas/SelectionOverlay.js";
|
|
7
|
+
import { shapeDrawers as Be } from "./nodes/shapes.js";
|
|
8
|
+
import { findClosestHandleWorld as Gt, getHandlePositions as vt, handleWorldPos as Ut } from "./nodes/NodeHandles.js";
|
|
9
|
+
import { distToSegment as Ce, generateId as fn, isPointInNode as Lt, rectsOverlap as hn } from "./nodes/nodeUtils.js";
|
|
10
|
+
import { NodeRenderer as yn } from "./nodes/NodeRenderer.js";
|
|
11
|
+
import { buildEdgePath as en, linearizeSegments as nn, resolveEdgeEndpoints as Et } from "./edges/edgePaths.js";
|
|
12
|
+
import { EdgeRenderer as pn } from "./edges/EdgeRenderer.js";
|
|
13
|
+
import { LineRenderer as xn } from "./lines/LineRenderer.js";
|
|
14
|
+
import { FreehandTool as gn } from "./lines/FreehandTool.js";
|
|
15
|
+
import { GeometricLineTool as wn } from "./lines/GeometricLineTool.js";
|
|
16
|
+
import { computeAlignmentSnap as ae } from "./hooks/useAlignmentGuides.js";
|
|
17
|
+
import { AlignmentGuidesRenderer as mn } from "./canvas/AlignmentGuides.js";
|
|
18
|
+
import { getDocumentSlides as vn, nextAnimIndex as In } from "./nodes/animAnchors.js";
|
|
19
|
+
import { useCallback as jt, useEffect as It, useRef as w, useState as Ke } from "react";
|
|
20
|
+
import { jsx as Se, jsxs as Ue } from "react/jsx-runtime";
|
|
21
|
+
import { Graphics as $t } from "pixi.js";
|
|
22
|
+
var bn = {
|
|
23
23
|
nw: "nwse-resize",
|
|
24
24
|
ne: "nesw-resize",
|
|
25
25
|
se: "nwse-resize",
|
|
26
26
|
sw: "nesw-resize"
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
const { x:
|
|
28
|
+
function je(_, z, P) {
|
|
29
|
+
const { x: V, y: N } = z.position, G = z.width, T = z.height, C = [
|
|
30
30
|
[
|
|
31
31
|
"nw",
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
V,
|
|
33
|
+
N
|
|
34
34
|
],
|
|
35
35
|
[
|
|
36
36
|
"ne",
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
V + G,
|
|
38
|
+
N
|
|
39
39
|
],
|
|
40
40
|
[
|
|
41
41
|
"se",
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
V + G,
|
|
43
|
+
N + T
|
|
44
44
|
],
|
|
45
45
|
[
|
|
46
46
|
"sw",
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
V,
|
|
48
|
+
N + T
|
|
49
49
|
]
|
|
50
50
|
];
|
|
51
|
-
let
|
|
52
|
-
for (const [U,
|
|
53
|
-
const K = Math.hypot(
|
|
54
|
-
K <
|
|
51
|
+
let R = null, q = P;
|
|
52
|
+
for (const [U, dt, et] of C) {
|
|
53
|
+
const K = Math.hypot(_.x - dt, _.y - et);
|
|
54
|
+
K < q && (q = K, R = U);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return R;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
let
|
|
60
|
-
for (const
|
|
61
|
-
const
|
|
62
|
-
if (!
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
edgeId:
|
|
58
|
+
function $e(_, z, P, V, N) {
|
|
59
|
+
let G = null, T = N;
|
|
60
|
+
for (const C of P) {
|
|
61
|
+
const R = Et(C, V);
|
|
62
|
+
if (!R) continue;
|
|
63
|
+
const q = Math.hypot(_ - R.sx, z - R.sy);
|
|
64
|
+
q < T && (T = q, G = {
|
|
65
|
+
edgeId: C.id,
|
|
66
66
|
end: "source",
|
|
67
|
-
worldX:
|
|
68
|
-
worldY:
|
|
67
|
+
worldX: R.sx,
|
|
68
|
+
worldY: R.sy
|
|
69
69
|
});
|
|
70
|
-
const U = Math.hypot(
|
|
71
|
-
U <
|
|
72
|
-
edgeId:
|
|
70
|
+
const U = Math.hypot(_ - R.tx, z - R.ty);
|
|
71
|
+
U < T && (T = U, G = {
|
|
72
|
+
edgeId: C.id,
|
|
73
73
|
end: "target",
|
|
74
|
-
worldX:
|
|
75
|
-
worldY:
|
|
74
|
+
worldX: R.tx,
|
|
75
|
+
worldY: R.ty
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
return
|
|
78
|
+
return G;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
let
|
|
82
|
-
for (const
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
for (let
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
edgeId:
|
|
89
|
-
waypointIndex:
|
|
90
|
-
wx:
|
|
91
|
-
wy:
|
|
80
|
+
function Je(_, z, P, V) {
|
|
81
|
+
let N = null, G = V;
|
|
82
|
+
for (const T of P) {
|
|
83
|
+
const C = T.data.waypoints;
|
|
84
|
+
if (C)
|
|
85
|
+
for (let R = 0; R < C.length; R++) {
|
|
86
|
+
const q = Math.hypot(_ - C[R].x, z - C[R].y);
|
|
87
|
+
q < G && (G = q, N = {
|
|
88
|
+
edgeId: T.id,
|
|
89
|
+
waypointIndex: R,
|
|
90
|
+
wx: C[R].x,
|
|
91
|
+
wy: C[R].y
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return N;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
let
|
|
99
|
-
for (const
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
if (!
|
|
103
|
-
const
|
|
97
|
+
function Qe(_, z, P, V, N) {
|
|
98
|
+
let G = null, T = N;
|
|
99
|
+
for (const C of P) {
|
|
100
|
+
if (C.type !== "simplebezier") continue;
|
|
101
|
+
const R = Et(C, V);
|
|
102
|
+
if (!R) continue;
|
|
103
|
+
const q = C.data.waypoints ?? [], U = [
|
|
104
104
|
{
|
|
105
|
-
x:
|
|
106
|
-
y:
|
|
105
|
+
x: R.sx,
|
|
106
|
+
y: R.sy
|
|
107
107
|
},
|
|
108
|
-
...
|
|
108
|
+
...q,
|
|
109
109
|
{
|
|
110
|
-
x:
|
|
111
|
-
y:
|
|
110
|
+
x: R.tx,
|
|
111
|
+
y: R.ty
|
|
112
112
|
}
|
|
113
|
-
],
|
|
114
|
-
for (let K = 0; K <=
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
edgeId:
|
|
113
|
+
], dt = C.data.bezierControls, et = U.length - 2;
|
|
114
|
+
for (let K = 0; K <= et; K++) {
|
|
115
|
+
const nt = U[K], rt = U[K + 1], bt = dt?.[K], Wt = Math.hypot(rt.x - nt.x, rt.y - nt.y), Nt = Math.max(30, Wt * 0.3), Jt = bt?.c1x ?? (K === 0 ? nt.x + R.snx * Nt : nt.x + (rt.x - nt.x) * 0.4), At = bt?.c1y ?? (K === 0 ? nt.y + R.sny * Nt : nt.y), Yt = bt?.c2x ?? (K === et ? rt.x + R.tnx * Nt : rt.x - (rt.x - nt.x) * 0.4), Mt = bt?.c2y ?? (K === et ? rt.y + R.tny * Nt : rt.y), Rt = Math.hypot(_ - Jt, z - At);
|
|
116
|
+
Rt < T && (T = Rt, G = {
|
|
117
|
+
edgeId: C.id,
|
|
118
118
|
segmentIndex: K,
|
|
119
119
|
controlEnd: "c1",
|
|
120
|
-
wx:
|
|
121
|
-
wy:
|
|
120
|
+
wx: Jt,
|
|
121
|
+
wy: At
|
|
122
122
|
});
|
|
123
|
-
const yt = Math.hypot(
|
|
124
|
-
yt <
|
|
125
|
-
edgeId:
|
|
123
|
+
const yt = Math.hypot(_ - Yt, z - Mt);
|
|
124
|
+
yt < T && (T = yt, G = {
|
|
125
|
+
edgeId: C.id,
|
|
126
126
|
segmentIndex: K,
|
|
127
127
|
controlEnd: "c2",
|
|
128
|
-
wx:
|
|
129
|
-
wy:
|
|
128
|
+
wx: Yt,
|
|
129
|
+
wy: Mt
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
return
|
|
133
|
+
return G;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
138
|
-
const
|
|
135
|
+
function Mn(_, z, P, V) {
|
|
136
|
+
const N = Et(P, V);
|
|
137
|
+
if (!N) return 0;
|
|
138
|
+
const G = P.data.waypoints ?? [], T = [
|
|
139
139
|
{
|
|
140
|
-
x:
|
|
141
|
-
y:
|
|
140
|
+
x: N.sx,
|
|
141
|
+
y: N.sy
|
|
142
142
|
},
|
|
143
|
-
...
|
|
143
|
+
...G,
|
|
144
144
|
{
|
|
145
|
-
x:
|
|
146
|
-
y:
|
|
145
|
+
x: N.tx,
|
|
146
|
+
y: N.ty
|
|
147
147
|
}
|
|
148
148
|
];
|
|
149
|
-
let
|
|
150
|
-
for (let
|
|
151
|
-
const U =
|
|
152
|
-
U <
|
|
149
|
+
let C = 1 / 0, R = 0;
|
|
150
|
+
for (let q = 0; q < T.length - 1; q++) {
|
|
151
|
+
const U = Ce(_, z, T[q].x, T[q].y, T[q + 1].x, T[q + 1].y);
|
|
152
|
+
U < C && (C = U, R = q);
|
|
153
153
|
}
|
|
154
|
-
return
|
|
154
|
+
return R;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
let { x:
|
|
158
|
-
const
|
|
159
|
-
return
|
|
160
|
-
x:
|
|
161
|
-
y:
|
|
162
|
-
w:
|
|
163
|
-
h:
|
|
156
|
+
function Rn(_, z, P, V, N = 24) {
|
|
157
|
+
let { x: G, y: T, w: C, h: R } = { ..._ };
|
|
158
|
+
const q = z === "nw" || z === "sw", U = z === "ne" || z === "se", dt = z === "nw" || z === "ne", et = z === "sw" || z === "se";
|
|
159
|
+
return q && (G += P, C -= P), U && (C += P), dt && (T += V, R -= V), et && (R += V), C < N && (q && (G = _.x + _.w - N), C = N), R < N && (dt && (T = _.y + _.h - N), R = N), {
|
|
160
|
+
x: G,
|
|
161
|
+
y: T,
|
|
162
|
+
w: C,
|
|
163
|
+
h: R
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
const
|
|
168
|
-
if (!
|
|
169
|
-
const
|
|
170
|
-
for (let
|
|
166
|
+
function ze(_, z, P, V, N) {
|
|
167
|
+
const G = Et(P, V);
|
|
168
|
+
if (!G) return !1;
|
|
169
|
+
const T = nn(en(P.type, G, P.data.waypoints, P.data.bezierControls));
|
|
170
|
+
for (let C = 0; C < T.length - 1; C++) if (Ce(_, z, T[C].x, T[C].y, T[C + 1].x, T[C + 1].y) < N) return !0;
|
|
171
171
|
return !1;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
const
|
|
175
|
-
for (let
|
|
173
|
+
function tn(_, z, P, V) {
|
|
174
|
+
const N = P.points;
|
|
175
|
+
for (let G = 0; G < N.length - 1; G++) if (Ce(_, z, N[G].x, N[G].y, N[G + 1].x, N[G + 1].y) < V) return !0;
|
|
176
176
|
return !1;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
}, [])), { setViewportInternal:
|
|
178
|
+
function Bn({ onPixiReady: _ }) {
|
|
179
|
+
const z = w(null), P = w(null), V = w(13751771), { pixiRef: N, readyRef: G } = dn(z, jt((a) => {
|
|
180
|
+
V.current = a.gridDot, P.current && (P.current.dotColor = a.gridDot);
|
|
181
|
+
}, [])), { setViewportInternal: T, viewportReqRef: C, viewport: R, autoFocus: q, showGrid: U, showAnchors: dt, gridSize: et, toolMode: K, edgeType: nt, focusOnRect: rt, setFocusOnRect: bt, pendingPlacement: Wt, setPendingPlacement: Nt, setContextMenu: Jt, beginNodeDrag: At, endNodeDrag: Yt, presentation: Mt, editingNodeId: Rt, setEditingNodeId: yt } = cn(), { currentCanvas: le, selection: Ee, setSelection: ft, setDoc: J, currentCanvasId: ue, pushCanvas: rn, doc: Ne } = sn(), St = w(null), Qt = w(null), te = w(null), ee = w(null), fe = w(null), he = w(null), ne = w(null), Xt = w(null), Ft = w(null), re = w(null), Dt = w([]), ye = w(null), pe = w(null), at = w(null), _t = w(null), De = w({
|
|
182
182
|
time: 0,
|
|
183
183
|
wx: 0,
|
|
184
184
|
wy: 0
|
|
185
|
-
}),
|
|
185
|
+
}), Tt = w({
|
|
186
186
|
time: 0,
|
|
187
187
|
wx: 0,
|
|
188
188
|
wy: 0
|
|
189
|
-
}),
|
|
189
|
+
}), Te = w(0), qt = w(null), ke = w({
|
|
190
190
|
x: 0,
|
|
191
191
|
y: 0
|
|
192
|
-
}),
|
|
193
|
-
...
|
|
194
|
-
nodes:
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
192
|
+
}), He = dt || Mt ? le : {
|
|
193
|
+
...le,
|
|
194
|
+
nodes: le.nodes.filter((a) => a.type !== "animAnchor")
|
|
195
|
+
}, W = w(He);
|
|
196
|
+
W.current = He;
|
|
197
|
+
const B = w(ue);
|
|
198
|
+
B.current = ue;
|
|
199
|
+
const Zt = w(Ee);
|
|
200
|
+
Zt.current = Ee;
|
|
201
|
+
const Pe = w(Ne);
|
|
202
|
+
Pe.current = Ne;
|
|
203
|
+
const Ot = w(K);
|
|
204
|
+
Ot.current = K;
|
|
205
|
+
const Vt = w(q);
|
|
206
|
+
Vt.current = q;
|
|
207
|
+
const Bt = w(rt);
|
|
208
|
+
Bt.current = rt;
|
|
209
|
+
const Ge = w(nt);
|
|
210
|
+
Ge.current = nt;
|
|
211
|
+
const Le = w(dt);
|
|
212
|
+
Le.current = dt;
|
|
213
|
+
const kt = w(Mt);
|
|
214
|
+
kt.current = Mt;
|
|
215
|
+
const oe = w(Wt);
|
|
216
|
+
oe.current = Wt;
|
|
217
|
+
const We = w(At);
|
|
218
|
+
We.current = At;
|
|
219
|
+
const se = w(Yt);
|
|
220
|
+
se.current = Yt;
|
|
221
|
+
const ot = w(null), Q = w(null), tt = w(null), st = w(null), pt = w(null), ht = w(null), xt = w(null), xe = w(R), ge = w(0), { vmRef: Z, screenToWorld: Ae } = an(N, jt((a) => {
|
|
222
|
+
xe.current = a, ge.current || (ge.current = requestAnimationFrame(() => {
|
|
223
|
+
ge.current = 0, T(xe.current);
|
|
224
224
|
}));
|
|
225
|
-
}, [
|
|
226
|
-
|
|
227
|
-
const [
|
|
228
|
-
|
|
229
|
-
const
|
|
225
|
+
}, [T])), ct = w(Ae);
|
|
226
|
+
ct.current = Ae;
|
|
227
|
+
const [lt, we] = Ke(null), [me, ve] = Ke(null), Ie = w(lt);
|
|
228
|
+
Ie.current = lt;
|
|
229
|
+
const ce = w(() => {
|
|
230
230
|
});
|
|
231
|
-
|
|
232
|
-
yt(
|
|
233
|
-
kind:
|
|
234
|
-
id:
|
|
235
|
-
value:
|
|
231
|
+
ce.current = (a, k, X) => {
|
|
232
|
+
yt(a === "node" ? k : null), we({
|
|
233
|
+
kind: a,
|
|
234
|
+
id: k,
|
|
235
|
+
value: X
|
|
236
236
|
});
|
|
237
237
|
};
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
const L =
|
|
242
|
-
if (!
|
|
243
|
-
let
|
|
244
|
-
if (
|
|
245
|
-
...
|
|
246
|
-
nodes:
|
|
247
|
-
...
|
|
238
|
+
const Ye = jt((a) => {
|
|
239
|
+
const k = Ie.current;
|
|
240
|
+
k && (J((X) => {
|
|
241
|
+
const L = B.current, O = X.canvases[L];
|
|
242
|
+
if (!O) return X;
|
|
243
|
+
let F = O;
|
|
244
|
+
if (k.kind === "node") F = {
|
|
245
|
+
...O,
|
|
246
|
+
nodes: O.nodes.map((A) => A.id === k.id ? {
|
|
247
|
+
...A,
|
|
248
248
|
data: {
|
|
249
|
-
...
|
|
250
|
-
label:
|
|
249
|
+
...A.data,
|
|
250
|
+
label: a
|
|
251
251
|
}
|
|
252
|
-
} :
|
|
252
|
+
} : A)
|
|
253
253
|
};
|
|
254
|
-
else if (
|
|
255
|
-
...
|
|
256
|
-
edges:
|
|
257
|
-
...
|
|
254
|
+
else if (k.kind === "edge") F = {
|
|
255
|
+
...O,
|
|
256
|
+
edges: O.edges.map((A) => A.id === k.id ? {
|
|
257
|
+
...A,
|
|
258
258
|
data: {
|
|
259
|
-
...
|
|
260
|
-
labelText:
|
|
259
|
+
...A.data,
|
|
260
|
+
labelText: a
|
|
261
261
|
}
|
|
262
|
-
} :
|
|
262
|
+
} : A)
|
|
263
263
|
};
|
|
264
|
-
else return
|
|
264
|
+
else return X;
|
|
265
265
|
return {
|
|
266
|
-
...
|
|
266
|
+
...X,
|
|
267
267
|
canvases: {
|
|
268
|
-
...
|
|
269
|
-
[L]:
|
|
268
|
+
...X.canvases,
|
|
269
|
+
[L]: F
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
|
-
}),
|
|
273
|
-
}, [J, yt]),
|
|
274
|
-
|
|
272
|
+
}), we(null), yt(null), ve(null));
|
|
273
|
+
}, [J, yt]), on = jt(() => {
|
|
274
|
+
we(null), yt(null), ve(null);
|
|
275
275
|
}, [yt]);
|
|
276
|
-
|
|
277
|
-
if (!
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
}, [
|
|
281
|
-
if (!
|
|
282
|
-
const
|
|
283
|
-
if (!
|
|
284
|
-
const
|
|
285
|
-
let
|
|
286
|
-
if (
|
|
287
|
-
const L =
|
|
288
|
-
L && (
|
|
276
|
+
It(() => {
|
|
277
|
+
if (!Rt || Ie.current?.id === Rt) return;
|
|
278
|
+
const a = W.current.nodes.find((k) => k.id === Rt);
|
|
279
|
+
a && ce.current("node", a.id, a.data.label);
|
|
280
|
+
}, [Rt]), It(() => {
|
|
281
|
+
if (!lt) return;
|
|
282
|
+
const a = Z.current;
|
|
283
|
+
if (!a) return;
|
|
284
|
+
const k = W.current;
|
|
285
|
+
let X = null;
|
|
286
|
+
if (lt.kind === "node") {
|
|
287
|
+
const L = k.nodes.find((O) => O.id === lt.id);
|
|
288
|
+
L && (X = {
|
|
289
289
|
x: L.position.x + L.width / 2,
|
|
290
290
|
y: L.position.y + L.height / 2
|
|
291
291
|
});
|
|
292
|
-
} else if (
|
|
293
|
-
const L =
|
|
294
|
-
for (const
|
|
292
|
+
} else if (lt.kind === "edge") {
|
|
293
|
+
const L = k.edges.find((F) => F.id === lt.id), O = /* @__PURE__ */ new Map();
|
|
294
|
+
for (const F of k.nodes) O.set(F.id, F);
|
|
295
295
|
if (L) {
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
x: (
|
|
300
|
-
y: (
|
|
296
|
+
const F = Et(L, O);
|
|
297
|
+
if (F) {
|
|
298
|
+
const A = nn(en(L.type, F, L.data.waypoints, L.data.bezierControls)), it = A[Math.floor(A.length / 2)] ?? {
|
|
299
|
+
x: (F.sx + F.tx) / 2,
|
|
300
|
+
y: (F.sy + F.ty) / 2
|
|
301
301
|
};
|
|
302
|
-
|
|
303
|
-
x:
|
|
304
|
-
y:
|
|
302
|
+
X = {
|
|
303
|
+
x: it.x,
|
|
304
|
+
y: it.y
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
if (
|
|
310
|
-
const L =
|
|
311
|
-
|
|
309
|
+
if (X) {
|
|
310
|
+
const L = a.worldToScreen(X.x, X.y);
|
|
311
|
+
ve({
|
|
312
312
|
x: L.x,
|
|
313
313
|
y: L.y
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
-
}, [
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
}, [lt, Z]);
|
|
317
|
+
const Xe = w(0);
|
|
318
|
+
It(() => {
|
|
319
|
+
C.current !== Xe.current && (Xe.current = C.current, xe.current = R, Z.current?.setState(R));
|
|
320
320
|
}, [
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
]),
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
if (!
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
x:
|
|
331
|
-
y:
|
|
332
|
-
zoom:
|
|
333
|
-
},
|
|
321
|
+
R,
|
|
322
|
+
Z,
|
|
323
|
+
C
|
|
324
|
+
]), It(() => {
|
|
325
|
+
bt((a, k, X, L, O) => {
|
|
326
|
+
const F = Z.current, A = z.current;
|
|
327
|
+
if (!F || !A) return;
|
|
328
|
+
const it = A.clientWidth || 800, gt = A.clientHeight || 600, wt = Math.max(0, O?.padding ?? 60), Ht = Math.max(1, it - wt * 2), mt = Math.max(1, gt - wt * 2), zt = O?.preserveZoom ? F.state.zoom : Math.min(Ht / Math.max(X, 1), mt / Math.max(L, 1), O?.maxZoom ?? 2), Ct = a + X / 2, ut = k + L / 2, Kt = it / 2 - Ct * zt, Me = gt / 2 - ut * zt;
|
|
329
|
+
F.animateTo({
|
|
330
|
+
x: Kt,
|
|
331
|
+
y: Me,
|
|
332
|
+
zoom: zt
|
|
333
|
+
}, O?.duration ?? 350);
|
|
334
334
|
});
|
|
335
|
-
}, [
|
|
336
|
-
const
|
|
337
|
-
J((
|
|
338
|
-
const
|
|
339
|
-
return
|
|
340
|
-
...
|
|
335
|
+
}, [bt, Z]);
|
|
336
|
+
const Fe = jt((a) => {
|
|
337
|
+
J((k) => {
|
|
338
|
+
const X = k.canvases[B.current];
|
|
339
|
+
return X ? {
|
|
340
|
+
...k,
|
|
341
341
|
canvases: {
|
|
342
|
-
...
|
|
343
|
-
[
|
|
344
|
-
...
|
|
345
|
-
lines: [...
|
|
342
|
+
...k.canvases,
|
|
343
|
+
[B.current]: {
|
|
344
|
+
...X,
|
|
345
|
+
lines: [...X.lines, a]
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
} :
|
|
348
|
+
} : k;
|
|
349
349
|
});
|
|
350
|
-
}, [J,
|
|
351
|
-
return
|
|
352
|
-
const
|
|
353
|
-
if (!
|
|
354
|
-
let
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
if (!
|
|
358
|
-
setTimeout(
|
|
350
|
+
}, [J, ue]), be = w(Fe);
|
|
351
|
+
return be.current = Fe, It(() => {
|
|
352
|
+
const a = N.current;
|
|
353
|
+
if (!a || a.destroyed) return;
|
|
354
|
+
let k = !1, X = null, L = null, O = null;
|
|
355
|
+
const F = () => {
|
|
356
|
+
if (k) return;
|
|
357
|
+
if (!G.current) {
|
|
358
|
+
setTimeout(F, 30);
|
|
359
359
|
return;
|
|
360
360
|
}
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
onLineComplete: (
|
|
373
|
-
screenToWorld: (
|
|
374
|
-
}),
|
|
375
|
-
onLineComplete: (
|
|
376
|
-
screenToWorld: (
|
|
377
|
-
}),
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
if (
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
383
|
-
|
|
361
|
+
P.current = new ln(a.app.stage, et, U), P.current.dotColor = V.current, St.current = new un(a.app.stage), Qt.current = new yn(a.world), te.current = new pn(a.world), ee.current = new xn(a.world);
|
|
362
|
+
const A = new $t();
|
|
363
|
+
A.label = "connect-line", A.visible = !1, a.world.addChild(A), pt.current = A;
|
|
364
|
+
const it = new $t();
|
|
365
|
+
it.label = "transform-handles", a.app.stage.addChild(it), Xt.current = it;
|
|
366
|
+
const gt = new $t();
|
|
367
|
+
gt.label = "handle-hover", a.world.addChild(gt), Ft.current = gt;
|
|
368
|
+
const wt = new $t();
|
|
369
|
+
wt.label = "edge-edit-handles", a.world.addChild(wt), _t.current = wt;
|
|
370
|
+
const Ht = new $t();
|
|
371
|
+
Ht.label = "ghost-placement", Ht.alpha = 0.5, a.world.addChild(Ht), qt.current = Ht, re.current = new mn(a.world), fe.current = new gn(a.app.stage, a.world, {
|
|
372
|
+
onLineComplete: (h) => be.current(h),
|
|
373
|
+
screenToWorld: (h, r) => ct.current(h, r)
|
|
374
|
+
}), he.current = new wn(a.app.stage, a.world, {
|
|
375
|
+
onLineComplete: (h) => be.current(h),
|
|
376
|
+
screenToWorld: (h, r) => ct.current(h, r)
|
|
377
|
+
}), _?.(a);
|
|
378
|
+
const mt = a.app.stage;
|
|
379
|
+
mt.on("pointerdown", (h) => {
|
|
380
|
+
if (z.current?.focus({ preventScroll: !0 }), Z.current?.multiTouchActive || Z.current?.isPanning || Z.current?.isSpaceHeld || h.button !== 0) return;
|
|
381
|
+
const r = Ot.current;
|
|
382
|
+
if (r === "pan") {
|
|
383
|
+
Z.current?.startPan(h.global.x, h.global.y);
|
|
384
384
|
return;
|
|
385
385
|
}
|
|
386
|
-
if (
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
width: e.width,
|
|
397
|
-
height: e.height,
|
|
398
|
-
data: {}
|
|
399
|
-
}], v), r = i + o.dx, d = n + o.dy;
|
|
400
|
-
J((w) => {
|
|
401
|
-
const g = w.canvases[V.current];
|
|
402
|
-
if (!g) return w;
|
|
403
|
-
const C = {};
|
|
404
|
-
e.type === "animAnchor" && (C.animIndex = an(w));
|
|
405
|
-
const H = Math.max(0, ...g.nodes.map((h) => h.zIndex ?? 0), ...g.lines.map((h) => h.zIndex ?? 0));
|
|
406
|
-
return {
|
|
407
|
-
...w,
|
|
408
|
-
canvases: {
|
|
409
|
-
...w.canvases,
|
|
410
|
-
[V.current]: {
|
|
411
|
-
...g,
|
|
412
|
-
nodes: [...g.nodes, {
|
|
413
|
-
id: t,
|
|
414
|
-
type: e.type,
|
|
415
|
-
position: {
|
|
416
|
-
x: r,
|
|
417
|
-
y: d
|
|
418
|
-
},
|
|
419
|
-
width: e.width,
|
|
420
|
-
height: e.height,
|
|
421
|
-
zIndex: H + 1,
|
|
422
|
-
data: {
|
|
423
|
-
...e.data,
|
|
424
|
-
...C
|
|
425
|
-
}
|
|
426
|
-
}]
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
}), lt({
|
|
431
|
-
nodeIds: /* @__PURE__ */ new Set([t]),
|
|
432
|
-
edgeIds: /* @__PURE__ */ new Set(),
|
|
433
|
-
lineIds: /* @__PURE__ */ new Set()
|
|
434
|
-
}), Ft.current && window.setTimeout(() => {
|
|
435
|
-
_t.current(r, d, e.width, e.height, {
|
|
436
|
-
padding: 80,
|
|
437
|
-
preserveZoom: !0,
|
|
438
|
-
duration: 280
|
|
439
|
-
});
|
|
440
|
-
}, 0);
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
const c = Date.now(), y = be.current, f = c - y.time < 350 && Math.hypot(u.x - y.wx, u.y - y.wy) < 8 / O;
|
|
444
|
-
if (be.current = {
|
|
445
|
-
time: c,
|
|
446
|
-
wx: u.x,
|
|
447
|
-
wy: u.y
|
|
448
|
-
}, I.nodeIds.size === 1 && !S && s === "select") {
|
|
449
|
-
const t = v.find((i) => i.id === [...I.nodeIds][0]);
|
|
386
|
+
if (r === "freehand" || r === "line" || r === "polyline" || r === "arrow") return;
|
|
387
|
+
const d = ct.current(h.global.x, h.global.y), p = W.current.nodes, D = W.current.edges, E = W.current.lines, m = Zt.current, S = h.metaKey || h.ctrlKey || h.shiftKey, Y = Z.current?.state.zoom ?? 1;
|
|
388
|
+
if (oe.current) return;
|
|
389
|
+
const o = Date.now(), f = De.current, u = o - f.time < 350 && Math.hypot(d.x - f.wx, d.y - f.wy) < 8 / Y;
|
|
390
|
+
if (De.current = {
|
|
391
|
+
time: o,
|
|
392
|
+
wx: d.x,
|
|
393
|
+
wy: d.y
|
|
394
|
+
}, m.nodeIds.size === 1 && !S && r === "select") {
|
|
395
|
+
const t = p.find((s) => s.id === [...m.nodeIds][0]);
|
|
450
396
|
if (t) {
|
|
451
|
-
const
|
|
452
|
-
if (
|
|
453
|
-
const
|
|
454
|
-
for (const
|
|
455
|
-
|
|
456
|
-
x:
|
|
457
|
-
y:
|
|
458
|
-
w:
|
|
459
|
-
h:
|
|
460
|
-
}) :
|
|
461
|
-
x:
|
|
462
|
-
y:
|
|
463
|
-
w:
|
|
464
|
-
h:
|
|
397
|
+
const s = je(d, t, Math.min(10 / Y, 16));
|
|
398
|
+
if (s) {
|
|
399
|
+
const l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), n = t.type === "geometryGroup", i = n || t.type === "flowGroup" || t.data.isGroup, I = t.position.x, g = t.position.y, b = t.width, H = t.height;
|
|
400
|
+
for (const y of p)
|
|
401
|
+
y.id !== t.id && (y.parentId === t.id ? l.set(y.id, {
|
|
402
|
+
x: y.position.x,
|
|
403
|
+
y: y.position.y,
|
|
404
|
+
w: y.width,
|
|
405
|
+
h: y.height
|
|
406
|
+
}) : n && y.position.x >= I && y.position.y >= g && y.position.x + y.width <= I + b && y.position.y + y.height <= g + H && l.set(y.id, {
|
|
407
|
+
x: y.position.x,
|
|
408
|
+
y: y.position.y,
|
|
409
|
+
w: y.width,
|
|
410
|
+
h: y.height
|
|
465
411
|
}));
|
|
466
|
-
if (
|
|
467
|
-
for (const
|
|
468
|
-
|
|
412
|
+
if (i)
|
|
413
|
+
for (const y of W.current.lines) y.parentId === t.id ? c.set(y.id, y.points.map((M) => ({ ...M }))) : n && y.points.length > 0 && y.points.every((M) => M.x >= I && M.x <= I + b && M.y >= g && M.y <= g + H) && c.set(y.id, y.points.map((M) => ({ ...M })));
|
|
414
|
+
ht.current = {
|
|
469
415
|
active: !0,
|
|
470
416
|
nodeId: t.id,
|
|
471
|
-
handle:
|
|
472
|
-
startWorld:
|
|
417
|
+
handle: s,
|
|
418
|
+
startWorld: d,
|
|
473
419
|
startBounds: {
|
|
474
420
|
x: t.position.x,
|
|
475
421
|
y: t.position.y,
|
|
476
422
|
w: t.width,
|
|
477
423
|
h: t.height
|
|
478
424
|
},
|
|
479
|
-
childStarts:
|
|
480
|
-
childLineStarts:
|
|
425
|
+
childStarts: l,
|
|
426
|
+
childLineStarts: c.size > 0 ? c : void 0
|
|
481
427
|
};
|
|
482
428
|
return;
|
|
483
429
|
}
|
|
484
430
|
}
|
|
485
431
|
}
|
|
486
|
-
let
|
|
487
|
-
for (let t =
|
|
488
|
-
|
|
432
|
+
let e = null;
|
|
433
|
+
for (let t = p.length - 1; t >= 0; t--) if (Lt(d.x, d.y, p[t])) {
|
|
434
|
+
e = p[t];
|
|
489
435
|
break;
|
|
490
436
|
}
|
|
491
|
-
if (
|
|
492
|
-
const t =
|
|
493
|
-
t && (
|
|
437
|
+
if (e?.parentId) {
|
|
438
|
+
const t = p.find((s) => s.id === e.parentId);
|
|
439
|
+
t && (e = t);
|
|
494
440
|
}
|
|
495
|
-
if (
|
|
496
|
-
const t =
|
|
441
|
+
if (e && (r === "select" || r === "connect")) {
|
|
442
|
+
const t = Gt(vt(e.width, e.height), e, d.x, d.y, Math.min(14 / Y, 20));
|
|
497
443
|
if (t) {
|
|
498
|
-
|
|
444
|
+
tt.current = {
|
|
499
445
|
active: !0,
|
|
500
|
-
sourceNodeId:
|
|
446
|
+
sourceNodeId: e.id,
|
|
501
447
|
sourceHandleId: t.id
|
|
502
448
|
};
|
|
503
449
|
return;
|
|
504
450
|
}
|
|
505
451
|
}
|
|
506
|
-
if ((
|
|
452
|
+
if ((r === "select" || r === "connect") && !S && m.edgeIds.size > 0) {
|
|
507
453
|
const t = /* @__PURE__ */ new Map();
|
|
508
|
-
for (const
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
513
|
-
const
|
|
514
|
-
|
|
454
|
+
for (const c of p) t.set(c.id, c);
|
|
455
|
+
const s = D.filter((c) => m.edgeIds.has(c.id)), l = $e(d.x, d.y, s, t, Math.min(14 / Y, 20));
|
|
456
|
+
if (l) {
|
|
457
|
+
const c = D.find((n) => n.id === l.edgeId);
|
|
458
|
+
if (c) {
|
|
459
|
+
const n = l.end === "source" ? "target" : "source";
|
|
460
|
+
st.current = {
|
|
515
461
|
active: !0,
|
|
516
|
-
edgeId:
|
|
517
|
-
movingEnd:
|
|
518
|
-
fixedNodeId:
|
|
519
|
-
fixedHandleId:
|
|
462
|
+
edgeId: c.id,
|
|
463
|
+
movingEnd: l.end,
|
|
464
|
+
fixedNodeId: n === "source" ? c.source : c.target,
|
|
465
|
+
fixedHandleId: n === "source" ? c.sourceHandle : c.targetHandle
|
|
520
466
|
};
|
|
521
467
|
return;
|
|
522
468
|
}
|
|
523
469
|
}
|
|
524
470
|
}
|
|
525
|
-
if (
|
|
471
|
+
if (r === "select" && m.edgeIds.size > 0 && !e) {
|
|
526
472
|
const t = /* @__PURE__ */ new Map();
|
|
527
|
-
for (const
|
|
528
|
-
const
|
|
529
|
-
if (
|
|
530
|
-
|
|
473
|
+
for (const i of p) t.set(i.id, i);
|
|
474
|
+
const s = D.filter((i) => m.edgeIds.has(i.id)), l = Math.min(10 / Y, 14), c = Qe(d.x, d.y, s, t, l);
|
|
475
|
+
if (c) {
|
|
476
|
+
at.current = {
|
|
531
477
|
active: !0,
|
|
532
|
-
edgeId:
|
|
533
|
-
type:
|
|
534
|
-
index:
|
|
478
|
+
edgeId: c.edgeId,
|
|
479
|
+
type: c.controlEnd === "c1" ? "bezierC1" : "bezierC2",
|
|
480
|
+
index: c.segmentIndex
|
|
535
481
|
};
|
|
536
482
|
return;
|
|
537
483
|
}
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
if (
|
|
541
|
-
J((
|
|
542
|
-
const
|
|
543
|
-
return
|
|
544
|
-
...
|
|
484
|
+
const n = Je(d.x, d.y, s, l);
|
|
485
|
+
if (n) {
|
|
486
|
+
if (u) {
|
|
487
|
+
J((i) => {
|
|
488
|
+
const I = i.canvases[B.current];
|
|
489
|
+
return I ? {
|
|
490
|
+
...i,
|
|
545
491
|
canvases: {
|
|
546
|
-
...
|
|
547
|
-
[
|
|
548
|
-
...
|
|
549
|
-
edges:
|
|
550
|
-
if (g.id !==
|
|
551
|
-
const
|
|
552
|
-
|
|
492
|
+
...i.canvases,
|
|
493
|
+
[B.current]: {
|
|
494
|
+
...I,
|
|
495
|
+
edges: I.edges.map((g) => {
|
|
496
|
+
if (g.id !== n.edgeId) return g;
|
|
497
|
+
const b = [...g.data.waypoints ?? []];
|
|
498
|
+
b.splice(n.waypointIndex, 1);
|
|
553
499
|
const H = {
|
|
554
500
|
...g.data,
|
|
555
|
-
waypoints:
|
|
501
|
+
waypoints: b.length > 0 ? b : void 0
|
|
556
502
|
};
|
|
557
503
|
if (g.type === "simplebezier" && g.data.bezierControls) {
|
|
558
|
-
const
|
|
559
|
-
|
|
504
|
+
const y = [...g.data.bezierControls];
|
|
505
|
+
y.splice(n.waypointIndex, 2, null), H.bezierControls = y.some((M) => M !== null) ? y : void 0;
|
|
560
506
|
}
|
|
561
507
|
return {
|
|
562
508
|
...g,
|
|
@@ -565,133 +511,133 @@ function Wn({ onPixiReady: F }) {
|
|
|
565
511
|
})
|
|
566
512
|
}
|
|
567
513
|
}
|
|
568
|
-
} :
|
|
514
|
+
} : i;
|
|
569
515
|
});
|
|
570
516
|
return;
|
|
571
517
|
}
|
|
572
|
-
|
|
518
|
+
at.current = {
|
|
573
519
|
active: !0,
|
|
574
|
-
edgeId:
|
|
520
|
+
edgeId: n.edgeId,
|
|
575
521
|
type: "waypoint",
|
|
576
|
-
index:
|
|
522
|
+
index: n.waypointIndex
|
|
577
523
|
};
|
|
578
524
|
return;
|
|
579
525
|
}
|
|
580
|
-
if (
|
|
581
|
-
for (const
|
|
582
|
-
const
|
|
583
|
-
x:
|
|
584
|
-
y:
|
|
526
|
+
if (u) {
|
|
527
|
+
for (const i of s) if (ze(d.x, d.y, i, t, Math.min(8 / Y, 12))) {
|
|
528
|
+
const I = Mn(d.x, d.y, i, t), g = {
|
|
529
|
+
x: d.x,
|
|
530
|
+
y: d.y
|
|
585
531
|
};
|
|
586
|
-
J((
|
|
587
|
-
const H =
|
|
532
|
+
J((b) => {
|
|
533
|
+
const H = b.canvases[B.current];
|
|
588
534
|
return H ? {
|
|
589
|
-
...
|
|
535
|
+
...b,
|
|
590
536
|
canvases: {
|
|
591
|
-
...
|
|
592
|
-
[
|
|
537
|
+
...b.canvases,
|
|
538
|
+
[B.current]: {
|
|
593
539
|
...H,
|
|
594
|
-
edges: H.edges.map((
|
|
595
|
-
if (
|
|
596
|
-
const
|
|
597
|
-
|
|
540
|
+
edges: H.edges.map((y) => {
|
|
541
|
+
if (y.id !== i.id) return y;
|
|
542
|
+
const M = [...y.data.waypoints ?? []];
|
|
543
|
+
M.splice(I, 0, g);
|
|
598
544
|
const j = {
|
|
599
|
-
...
|
|
600
|
-
waypoints:
|
|
545
|
+
...y.data,
|
|
546
|
+
waypoints: M
|
|
601
547
|
};
|
|
602
|
-
if (
|
|
603
|
-
const
|
|
604
|
-
for (;
|
|
605
|
-
|
|
548
|
+
if (y.type === "simplebezier" && y.data.bezierControls) {
|
|
549
|
+
const $ = [...y.data.bezierControls];
|
|
550
|
+
for (; $.length < (y.data.waypoints ?? []).length + 1; ) $.push(null);
|
|
551
|
+
$.splice(I, 1, null, null), j.bezierControls = $;
|
|
606
552
|
}
|
|
607
553
|
return {
|
|
608
|
-
...
|
|
554
|
+
...y,
|
|
609
555
|
data: j
|
|
610
556
|
};
|
|
611
557
|
})
|
|
612
558
|
}
|
|
613
559
|
}
|
|
614
|
-
} :
|
|
615
|
-
}),
|
|
560
|
+
} : b;
|
|
561
|
+
}), at.current = {
|
|
616
562
|
active: !0,
|
|
617
|
-
edgeId:
|
|
563
|
+
edgeId: i.id,
|
|
618
564
|
type: "waypoint",
|
|
619
|
-
index:
|
|
565
|
+
index: I
|
|
620
566
|
};
|
|
621
567
|
return;
|
|
622
568
|
}
|
|
623
569
|
}
|
|
624
570
|
}
|
|
625
|
-
if (
|
|
626
|
-
!S && !
|
|
627
|
-
nodeIds: /* @__PURE__ */ new Set([
|
|
571
|
+
if (e && (r === "select" || r === "connect")) {
|
|
572
|
+
!S && !m.nodeIds.has(e.id) ? ft({
|
|
573
|
+
nodeIds: /* @__PURE__ */ new Set([e.id]),
|
|
628
574
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
629
575
|
lineIds: /* @__PURE__ */ new Set()
|
|
630
|
-
}) : S &&
|
|
631
|
-
const
|
|
632
|
-
return
|
|
633
|
-
nodeIds:
|
|
576
|
+
}) : S && ft((n) => {
|
|
577
|
+
const i = new Set(n.nodeIds);
|
|
578
|
+
return i.has(e.id) ? i.delete(e.id) : i.add(e.id), {
|
|
579
|
+
nodeIds: i,
|
|
634
580
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
635
581
|
lineIds: /* @__PURE__ */ new Set()
|
|
636
582
|
};
|
|
637
|
-
}),
|
|
583
|
+
}), Vt.current && Bt.current(e.position.x, e.position.y, e.width, e.height, {
|
|
638
584
|
padding: 80,
|
|
639
585
|
preserveZoom: !0,
|
|
640
586
|
duration: 280
|
|
641
587
|
});
|
|
642
|
-
const t =
|
|
643
|
-
S && !
|
|
644
|
-
const
|
|
645
|
-
for (const
|
|
646
|
-
const
|
|
647
|
-
if (!
|
|
648
|
-
const
|
|
649
|
-
for (const
|
|
650
|
-
if (!(t.has(
|
|
651
|
-
if (
|
|
652
|
-
t.add(
|
|
588
|
+
const t = m.nodeIds.has(e.id) ? new Set(m.nodeIds) : /* @__PURE__ */ new Set([e.id]);
|
|
589
|
+
S && !m.nodeIds.has(e.id) && t.add(e.id);
|
|
590
|
+
const s = /* @__PURE__ */ new Set();
|
|
591
|
+
for (const n of [...t]) {
|
|
592
|
+
const i = p.find((M) => M.id === n);
|
|
593
|
+
if (!i || i.type !== "flowGroup" && i.type !== "geometryGroup" && !i.data.isGroup) continue;
|
|
594
|
+
const I = i.type === "geometryGroup", g = i.position.x, b = i.position.y, H = i.width, y = i.height;
|
|
595
|
+
for (const M of p)
|
|
596
|
+
if (!(t.has(M.id) || M.id === n)) {
|
|
597
|
+
if (M.parentId === n) {
|
|
598
|
+
t.add(M.id);
|
|
653
599
|
continue;
|
|
654
600
|
}
|
|
655
|
-
|
|
601
|
+
I && M.position.x >= g && M.position.y >= b && M.position.x + M.width <= g + H && M.position.y + M.height <= b + y && t.add(M.id);
|
|
656
602
|
}
|
|
657
|
-
for (const
|
|
658
|
-
if (
|
|
659
|
-
|
|
603
|
+
for (const M of W.current.lines) M.parentId === n && s.add(M.id);
|
|
604
|
+
if (I) for (const M of W.current.lines)
|
|
605
|
+
s.has(M.id) || M.points.length > 0 && M.points.every((j) => j.x >= g && j.x <= g + H && j.y >= b && j.y <= b + y) && s.add(M.id);
|
|
660
606
|
}
|
|
661
|
-
const
|
|
662
|
-
for (const
|
|
663
|
-
const
|
|
664
|
-
if (
|
|
665
|
-
for (const
|
|
666
|
-
|
|
607
|
+
const l = /* @__PURE__ */ new Map();
|
|
608
|
+
for (const n of p) t.has(n.id) && l.set(n.id, { ...n.position });
|
|
609
|
+
const c = /* @__PURE__ */ new Map();
|
|
610
|
+
if (s.size > 0)
|
|
611
|
+
for (const n of W.current.lines) s.has(n.id) && c.set(n.id, n.points.map((i) => ({ ...i })));
|
|
612
|
+
ot.current = {
|
|
667
613
|
active: !0,
|
|
668
614
|
nodeIds: t,
|
|
669
|
-
lineIds:
|
|
670
|
-
startWorld:
|
|
671
|
-
nodeStarts:
|
|
672
|
-
linePointStarts:
|
|
673
|
-
},
|
|
615
|
+
lineIds: s.size > 0 ? s : void 0,
|
|
616
|
+
startWorld: d,
|
|
617
|
+
nodeStarts: l,
|
|
618
|
+
linePointStarts: c.size > 0 ? c : void 0
|
|
619
|
+
}, We.current();
|
|
674
620
|
return;
|
|
675
621
|
}
|
|
676
|
-
const
|
|
677
|
-
for (const t of
|
|
678
|
-
const
|
|
679
|
-
for (const t of
|
|
680
|
-
if (
|
|
681
|
-
const
|
|
682
|
-
return
|
|
683
|
-
...
|
|
684
|
-
edgeIds:
|
|
622
|
+
const v = /* @__PURE__ */ new Map();
|
|
623
|
+
for (const t of p) v.set(t.id, t);
|
|
624
|
+
const x = Math.min(8 / Y, 12);
|
|
625
|
+
for (const t of D) if (ze(d.x, d.y, t, v, x)) {
|
|
626
|
+
if (ft(S ? (s) => {
|
|
627
|
+
const l = new Set(s.edgeIds);
|
|
628
|
+
return l.has(t.id) ? l.delete(t.id) : l.add(t.id), {
|
|
629
|
+
...s,
|
|
630
|
+
edgeIds: l
|
|
685
631
|
};
|
|
686
632
|
} : {
|
|
687
633
|
nodeIds: /* @__PURE__ */ new Set(),
|
|
688
634
|
edgeIds: /* @__PURE__ */ new Set([t.id]),
|
|
689
635
|
lineIds: /* @__PURE__ */ new Set()
|
|
690
|
-
}),
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
const
|
|
694
|
-
|
|
636
|
+
}), Vt.current) {
|
|
637
|
+
const s = v.get(t.source), l = v.get(t.target);
|
|
638
|
+
if (s && l) {
|
|
639
|
+
const c = Math.min(s.position.x, l.position.x), n = Math.min(s.position.y, l.position.y), i = Math.max(s.position.x + s.width, l.position.x + l.width), I = Math.max(s.position.y + s.height, l.position.y + l.height);
|
|
640
|
+
Bt.current(c, n, i - c, I - n, {
|
|
695
641
|
padding: 80,
|
|
696
642
|
preserveZoom: !0,
|
|
697
643
|
duration: 280
|
|
@@ -700,465 +646,465 @@ function Wn({ onPixiReady: F }) {
|
|
|
700
646
|
}
|
|
701
647
|
return;
|
|
702
648
|
}
|
|
703
|
-
for (const t of
|
|
704
|
-
const
|
|
705
|
-
if (S ?
|
|
706
|
-
const
|
|
707
|
-
return
|
|
708
|
-
...
|
|
709
|
-
lineIds:
|
|
649
|
+
for (const t of E) if (tn(d.x, d.y, t, x)) {
|
|
650
|
+
const s = m.lineIds.has(t.id);
|
|
651
|
+
if (S ? ft((n) => {
|
|
652
|
+
const i = new Set(n.lineIds);
|
|
653
|
+
return i.has(t.id) ? i.delete(t.id) : i.add(t.id), {
|
|
654
|
+
...n,
|
|
655
|
+
lineIds: i
|
|
710
656
|
};
|
|
711
|
-
}) :
|
|
657
|
+
}) : s || ft({
|
|
712
658
|
nodeIds: /* @__PURE__ */ new Set(),
|
|
713
659
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
714
660
|
lineIds: /* @__PURE__ */ new Set([t.id])
|
|
715
|
-
}),
|
|
716
|
-
const
|
|
717
|
-
|
|
661
|
+
}), Vt.current && t.points.length > 0) {
|
|
662
|
+
const n = t.points.map((y) => y.x), i = t.points.map((y) => y.y), I = Math.min(...n), g = Math.min(...i), b = Math.max(...n), H = Math.max(...i);
|
|
663
|
+
Bt.current(I, g, Math.max(1, b - I), Math.max(1, H - g), {
|
|
718
664
|
padding: 80,
|
|
719
665
|
preserveZoom: !0,
|
|
720
666
|
duration: 280
|
|
721
667
|
});
|
|
722
668
|
}
|
|
723
|
-
const
|
|
724
|
-
for (const
|
|
725
|
-
|
|
669
|
+
const l = s ? new Set(m.lineIds) : /* @__PURE__ */ new Set([t.id]), c = /* @__PURE__ */ new Map();
|
|
670
|
+
for (const n of E) l.has(n.id) && c.set(n.id, n.points.map((i) => ({ ...i })));
|
|
671
|
+
xt.current = {
|
|
726
672
|
active: !0,
|
|
727
|
-
lineIds:
|
|
728
|
-
startWorld:
|
|
729
|
-
pointStarts:
|
|
673
|
+
lineIds: l,
|
|
674
|
+
startWorld: d,
|
|
675
|
+
pointStarts: c
|
|
730
676
|
};
|
|
731
677
|
return;
|
|
732
678
|
}
|
|
733
|
-
S ||
|
|
679
|
+
S || ft({
|
|
734
680
|
nodeIds: /* @__PURE__ */ new Set(),
|
|
735
681
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
736
682
|
lineIds: /* @__PURE__ */ new Set()
|
|
737
|
-
}),
|
|
683
|
+
}), r === "select" && (Q.current = {
|
|
738
684
|
active: !0,
|
|
739
685
|
startScreen: {
|
|
740
|
-
x:
|
|
741
|
-
y:
|
|
686
|
+
x: h.global.x,
|
|
687
|
+
y: h.global.y
|
|
742
688
|
}
|
|
743
689
|
});
|
|
744
|
-
}),
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
const
|
|
748
|
-
if (
|
|
749
|
-
const
|
|
690
|
+
}), mt.on("globalpointermove", (h) => {
|
|
691
|
+
const r = ct.current(h.global.x, h.global.y);
|
|
692
|
+
if (ke.current = r, Z.current?.multiTouchActive) return;
|
|
693
|
+
const d = Ot.current;
|
|
694
|
+
if (d === "freehand" || d === "line" || d === "polyline" || d === "arrow") return;
|
|
695
|
+
const p = W.current.nodes, D = W.current.edges, E = Z.current?.state.zoom ?? 1, m = !ot.current?.active && !tt.current?.active && !ht.current?.active && !st.current?.active && !at.current?.active && !xt.current?.active;
|
|
750
696
|
let S = null;
|
|
751
|
-
for (let
|
|
752
|
-
const
|
|
753
|
-
S =
|
|
697
|
+
for (let o = p.length - 1; o >= 0; o--) if (Lt(r.x, r.y, p[o])) {
|
|
698
|
+
const f = p[o];
|
|
699
|
+
S = f.parentId ? p.find((u) => u.id === f.parentId)?.id ?? f.id : f.id;
|
|
754
700
|
break;
|
|
755
701
|
}
|
|
756
|
-
if (
|
|
757
|
-
const
|
|
758
|
-
for (const
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
let
|
|
702
|
+
if (ne.current = S, m && (d === "select" || d === "connect")) {
|
|
703
|
+
const o = /* @__PURE__ */ new Map();
|
|
704
|
+
for (const x of p) o.set(x.id, x);
|
|
705
|
+
const f = Zt.current, u = f.edgeIds.size > 0 ? D.filter((x) => f.edgeIds.has(x.id)) : [], e = u.length > 0 ? $e(r.x, r.y, u, o, Math.min(12 / E, 18)) : null;
|
|
706
|
+
pe.current = e;
|
|
707
|
+
let v = null;
|
|
762
708
|
if (S) {
|
|
763
|
-
const
|
|
764
|
-
if (
|
|
765
|
-
const
|
|
766
|
-
if (
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
nodeId:
|
|
770
|
-
handleId:
|
|
771
|
-
wx:
|
|
772
|
-
wy:
|
|
709
|
+
const x = p.find((t) => t.id === S);
|
|
710
|
+
if (x) {
|
|
711
|
+
const t = Gt(vt(x.width, x.height), x, r.x, r.y, Math.min(14 / E, 20));
|
|
712
|
+
if (t) {
|
|
713
|
+
const s = Ut(t, x);
|
|
714
|
+
v = {
|
|
715
|
+
nodeId: x.id,
|
|
716
|
+
handleId: t.id,
|
|
717
|
+
wx: s.x,
|
|
718
|
+
wy: s.y
|
|
773
719
|
};
|
|
774
720
|
}
|
|
775
721
|
}
|
|
776
722
|
}
|
|
777
|
-
|
|
723
|
+
ye.current = v;
|
|
778
724
|
}
|
|
779
|
-
const
|
|
780
|
-
if (
|
|
781
|
-
const
|
|
782
|
-
let
|
|
783
|
-
if (
|
|
784
|
-
else if (
|
|
785
|
-
else if (
|
|
786
|
-
const
|
|
787
|
-
for (const
|
|
788
|
-
const
|
|
789
|
-
(
|
|
725
|
+
const Y = z.current;
|
|
726
|
+
if (Y && m) {
|
|
727
|
+
const o = Zt.current;
|
|
728
|
+
let f = "";
|
|
729
|
+
if (pe.current) f = "crosshair";
|
|
730
|
+
else if (ye.current) f = "crosshair";
|
|
731
|
+
else if (o.edgeIds.size > 0 && d === "select") {
|
|
732
|
+
const u = D.filter((x) => o.edgeIds.has(x.id)), e = /* @__PURE__ */ new Map();
|
|
733
|
+
for (const x of p) e.set(x.id, x);
|
|
734
|
+
const v = Math.min(10 / E, 14);
|
|
735
|
+
(Je(r.x, r.y, u, v) || Qe(r.x, r.y, u, e, v)) && (f = "grab");
|
|
790
736
|
}
|
|
791
|
-
if (!
|
|
792
|
-
const
|
|
793
|
-
if (
|
|
794
|
-
const
|
|
795
|
-
|
|
737
|
+
if (!f && o.nodeIds.size === 1 && d === "select") {
|
|
738
|
+
const u = p.find((e) => e.id === [...o.nodeIds][0]);
|
|
739
|
+
if (u) {
|
|
740
|
+
const e = je(r, u, Math.min(10 / E, 16));
|
|
741
|
+
e && (f = bn[e]);
|
|
796
742
|
}
|
|
797
743
|
}
|
|
798
|
-
if (!
|
|
799
|
-
const
|
|
800
|
-
for (const
|
|
801
|
-
|
|
744
|
+
if (!f && d === "select") {
|
|
745
|
+
const u = W.current.lines, e = Math.min(8 / E, 12);
|
|
746
|
+
for (const v of u) if (tn(r.x, r.y, v, e)) {
|
|
747
|
+
f = "move";
|
|
802
748
|
break;
|
|
803
749
|
}
|
|
804
750
|
}
|
|
805
|
-
|
|
751
|
+
Y.style.cursor = f;
|
|
806
752
|
}
|
|
807
|
-
if (
|
|
808
|
-
const
|
|
809
|
-
id:
|
|
753
|
+
if (ht.current?.active) {
|
|
754
|
+
const o = ht.current, f = r.x - o.startWorld.x, u = r.y - o.startWorld.y, e = Rn(o.startBounds, o.handle, f, u), v = W.current.nodes, x = ae([{
|
|
755
|
+
id: o.nodeId,
|
|
810
756
|
type: "shapeRect",
|
|
811
757
|
position: {
|
|
812
|
-
x:
|
|
813
|
-
y:
|
|
758
|
+
x: e.x,
|
|
759
|
+
y: e.y
|
|
814
760
|
},
|
|
815
|
-
width:
|
|
816
|
-
height:
|
|
761
|
+
width: e.w,
|
|
762
|
+
height: e.h,
|
|
817
763
|
data: {}
|
|
818
|
-
}],
|
|
819
|
-
|
|
820
|
-
const
|
|
821
|
-
J((
|
|
822
|
-
const
|
|
823
|
-
return
|
|
824
|
-
...
|
|
764
|
+
}], v);
|
|
765
|
+
e.x += x.dx, e.y += x.dy, (o.handle === "ne" || o.handle === "se") && (e.w += x.dx), (o.handle === "se" || o.handle === "sw") && (e.h += x.dy), Dt.current = x.guides;
|
|
766
|
+
const t = o.startBounds, s = Math.max(e.w, 24), l = Math.max(e.h, 24), c = t.w > 0 ? s / t.w : 1, n = t.h > 0 ? l / t.h : 1;
|
|
767
|
+
J((i) => {
|
|
768
|
+
const I = i.canvases[B.current];
|
|
769
|
+
return I ? {
|
|
770
|
+
...i,
|
|
825
771
|
canvases: {
|
|
826
|
-
...
|
|
827
|
-
[
|
|
828
|
-
...
|
|
829
|
-
nodes:
|
|
830
|
-
if (
|
|
831
|
-
...
|
|
772
|
+
...i.canvases,
|
|
773
|
+
[B.current]: {
|
|
774
|
+
...I,
|
|
775
|
+
nodes: I.nodes.map((g) => {
|
|
776
|
+
if (g.id === o.nodeId) return {
|
|
777
|
+
...g,
|
|
832
778
|
position: {
|
|
833
|
-
x:
|
|
834
|
-
y:
|
|
779
|
+
x: e.x,
|
|
780
|
+
y: e.y
|
|
835
781
|
},
|
|
836
|
-
width:
|
|
837
|
-
height:
|
|
782
|
+
width: s,
|
|
783
|
+
height: l
|
|
838
784
|
};
|
|
839
|
-
const
|
|
840
|
-
return
|
|
841
|
-
...
|
|
785
|
+
const b = o.childStarts.get(g.id);
|
|
786
|
+
return b ? {
|
|
787
|
+
...g,
|
|
842
788
|
position: {
|
|
843
|
-
x:
|
|
844
|
-
y:
|
|
789
|
+
x: e.x + (b.x - t.x) * c,
|
|
790
|
+
y: e.y + (b.y - t.y) * n
|
|
845
791
|
},
|
|
846
|
-
width: Math.max(
|
|
847
|
-
height: Math.max(
|
|
848
|
-
} :
|
|
792
|
+
width: Math.max(b.w * c, 24),
|
|
793
|
+
height: Math.max(b.h * n, 24)
|
|
794
|
+
} : g;
|
|
849
795
|
}),
|
|
850
|
-
lines:
|
|
851
|
-
const
|
|
852
|
-
return
|
|
853
|
-
...
|
|
854
|
-
points:
|
|
855
|
-
x:
|
|
856
|
-
y:
|
|
796
|
+
lines: o.childLineStarts ? I.lines.map((g) => {
|
|
797
|
+
const b = o.childLineStarts.get(g.id);
|
|
798
|
+
return b ? {
|
|
799
|
+
...g,
|
|
800
|
+
points: b.map((H) => ({
|
|
801
|
+
x: e.x + (H.x - t.x) * c,
|
|
802
|
+
y: e.y + (H.y - t.y) * n
|
|
857
803
|
}))
|
|
858
|
-
} :
|
|
859
|
-
}) :
|
|
804
|
+
} : g;
|
|
805
|
+
}) : I.lines
|
|
860
806
|
}
|
|
861
807
|
}
|
|
862
|
-
} :
|
|
808
|
+
} : i;
|
|
863
809
|
});
|
|
864
810
|
return;
|
|
865
811
|
}
|
|
866
|
-
if (
|
|
867
|
-
const
|
|
868
|
-
for (const
|
|
869
|
-
J((
|
|
870
|
-
const
|
|
871
|
-
return
|
|
872
|
-
...
|
|
812
|
+
if (at.current?.active) {
|
|
813
|
+
const o = at.current, f = W.current.nodes, u = /* @__PURE__ */ new Map();
|
|
814
|
+
for (const e of f) u.set(e.id, e);
|
|
815
|
+
J((e) => {
|
|
816
|
+
const v = e.canvases[B.current];
|
|
817
|
+
return v ? {
|
|
818
|
+
...e,
|
|
873
819
|
canvases: {
|
|
874
|
-
...
|
|
875
|
-
[
|
|
876
|
-
...
|
|
877
|
-
edges:
|
|
878
|
-
if (
|
|
879
|
-
if (
|
|
880
|
-
const
|
|
881
|
-
return
|
|
882
|
-
x:
|
|
883
|
-
y:
|
|
820
|
+
...e.canvases,
|
|
821
|
+
[B.current]: {
|
|
822
|
+
...v,
|
|
823
|
+
edges: v.edges.map((x) => {
|
|
824
|
+
if (x.id !== o.edgeId) return x;
|
|
825
|
+
if (o.type === "waypoint") {
|
|
826
|
+
const Pt = [...x.data.waypoints ?? []];
|
|
827
|
+
return o.index < Pt.length && (Pt[o.index] = {
|
|
828
|
+
x: r.x,
|
|
829
|
+
y: r.y
|
|
884
830
|
}), {
|
|
885
|
-
...
|
|
831
|
+
...x,
|
|
886
832
|
data: {
|
|
887
|
-
...
|
|
888
|
-
waypoints:
|
|
833
|
+
...x.data,
|
|
834
|
+
waypoints: Pt
|
|
889
835
|
}
|
|
890
836
|
};
|
|
891
837
|
}
|
|
892
|
-
const
|
|
893
|
-
if (!
|
|
894
|
-
const
|
|
838
|
+
const t = Et(x, u);
|
|
839
|
+
if (!t) return x;
|
|
840
|
+
const s = x.data.waypoints ?? [], l = [
|
|
895
841
|
{
|
|
896
|
-
x:
|
|
897
|
-
y:
|
|
842
|
+
x: t.sx,
|
|
843
|
+
y: t.sy
|
|
898
844
|
},
|
|
899
|
-
...
|
|
845
|
+
...s,
|
|
900
846
|
{
|
|
901
|
-
x:
|
|
902
|
-
y:
|
|
847
|
+
x: t.tx,
|
|
848
|
+
y: t.ty
|
|
903
849
|
}
|
|
904
|
-
],
|
|
905
|
-
for (;
|
|
906
|
-
const
|
|
907
|
-
if (
|
|
908
|
-
const
|
|
909
|
-
return
|
|
910
|
-
c1x:
|
|
911
|
-
c1y:
|
|
912
|
-
c2x:
|
|
913
|
-
c2y:
|
|
914
|
-
} :
|
|
915
|
-
c1x:
|
|
916
|
-
c1y:
|
|
917
|
-
c2x:
|
|
918
|
-
c2y:
|
|
850
|
+
], c = l.length - 1, n = [...x.data.bezierControls ?? []];
|
|
851
|
+
for (; n.length < c; ) n.push(null);
|
|
852
|
+
const i = o.index;
|
|
853
|
+
if (i >= c) return x;
|
|
854
|
+
const I = l[i], g = l[i + 1], b = n[i], H = Math.hypot(g.x - I.x, g.y - I.y), y = Math.max(30, H * 0.3), M = c - 1, j = i === 0 ? I.x + t.snx * y : I.x + (g.x - I.x) * 0.4, $ = i === 0 ? I.y + t.sny * y : I.y, ie = i === M ? g.x + t.tnx * y : g.x - (g.x - I.x) * 0.4, de = i === M ? g.y + t.tny * y : g.y;
|
|
855
|
+
return o.type === "bezierC1" ? n[i] = {
|
|
856
|
+
c1x: r.x,
|
|
857
|
+
c1y: r.y,
|
|
858
|
+
c2x: b?.c2x ?? ie,
|
|
859
|
+
c2y: b?.c2y ?? de
|
|
860
|
+
} : n[i] = {
|
|
861
|
+
c1x: b?.c1x ?? j,
|
|
862
|
+
c1y: b?.c1y ?? $,
|
|
863
|
+
c2x: r.x,
|
|
864
|
+
c2y: r.y
|
|
919
865
|
}, {
|
|
920
|
-
...
|
|
866
|
+
...x,
|
|
921
867
|
data: {
|
|
922
|
-
...
|
|
923
|
-
bezierControls:
|
|
868
|
+
...x.data,
|
|
869
|
+
bezierControls: n
|
|
924
870
|
}
|
|
925
871
|
};
|
|
926
872
|
})
|
|
927
873
|
}
|
|
928
874
|
}
|
|
929
|
-
} :
|
|
875
|
+
} : e;
|
|
930
876
|
});
|
|
931
877
|
return;
|
|
932
878
|
}
|
|
933
|
-
if (
|
|
934
|
-
const
|
|
935
|
-
J((
|
|
936
|
-
const
|
|
937
|
-
return
|
|
938
|
-
...
|
|
879
|
+
if (xt.current?.active) {
|
|
880
|
+
const o = xt.current, f = r.x - o.startWorld.x, u = r.y - o.startWorld.y;
|
|
881
|
+
J((e) => {
|
|
882
|
+
const v = e.canvases[B.current];
|
|
883
|
+
return v ? {
|
|
884
|
+
...e,
|
|
939
885
|
canvases: {
|
|
940
|
-
...
|
|
941
|
-
[
|
|
942
|
-
...
|
|
943
|
-
lines:
|
|
944
|
-
const
|
|
945
|
-
return
|
|
946
|
-
...
|
|
947
|
-
points:
|
|
948
|
-
x:
|
|
949
|
-
y:
|
|
886
|
+
...e.canvases,
|
|
887
|
+
[B.current]: {
|
|
888
|
+
...v,
|
|
889
|
+
lines: v.lines.map((x) => {
|
|
890
|
+
const t = o.pointStarts.get(x.id);
|
|
891
|
+
return t ? {
|
|
892
|
+
...x,
|
|
893
|
+
points: t.map((s) => ({
|
|
894
|
+
x: s.x + f,
|
|
895
|
+
y: s.y + u
|
|
950
896
|
}))
|
|
951
|
-
} :
|
|
897
|
+
} : x;
|
|
952
898
|
})
|
|
953
899
|
}
|
|
954
900
|
}
|
|
955
|
-
} :
|
|
901
|
+
} : e;
|
|
956
902
|
});
|
|
957
903
|
return;
|
|
958
904
|
}
|
|
959
|
-
if (
|
|
960
|
-
const
|
|
961
|
-
const
|
|
905
|
+
if (ot.current?.active) {
|
|
906
|
+
const o = ot.current, f = r.x - o.startWorld.x, u = r.y - o.startWorld.y, e = W.current.nodes, v = ae(e.filter((s) => o.nodeIds.has(s.id)).map((s) => {
|
|
907
|
+
const l = o.nodeStarts.get(s.id);
|
|
962
908
|
return {
|
|
963
|
-
...
|
|
909
|
+
...s,
|
|
964
910
|
position: {
|
|
965
|
-
x:
|
|
966
|
-
y:
|
|
911
|
+
x: l.x + f,
|
|
912
|
+
y: l.y + u
|
|
967
913
|
}
|
|
968
914
|
};
|
|
969
|
-
}),
|
|
970
|
-
|
|
971
|
-
const
|
|
972
|
-
return
|
|
973
|
-
...
|
|
915
|
+
}), e), x = f + v.dx, t = u + v.dy;
|
|
916
|
+
Dt.current = v.guides, J((s) => {
|
|
917
|
+
const l = s.canvases[B.current];
|
|
918
|
+
return l ? {
|
|
919
|
+
...s,
|
|
974
920
|
canvases: {
|
|
975
|
-
...
|
|
976
|
-
[
|
|
977
|
-
...
|
|
978
|
-
nodes:
|
|
979
|
-
const
|
|
980
|
-
return
|
|
981
|
-
...
|
|
921
|
+
...s.canvases,
|
|
922
|
+
[B.current]: {
|
|
923
|
+
...l,
|
|
924
|
+
nodes: l.nodes.map((c) => {
|
|
925
|
+
const n = o.nodeStarts.get(c.id);
|
|
926
|
+
return n ? {
|
|
927
|
+
...c,
|
|
982
928
|
position: {
|
|
983
|
-
x:
|
|
984
|
-
y:
|
|
929
|
+
x: n.x + x,
|
|
930
|
+
y: n.y + t
|
|
985
931
|
}
|
|
986
|
-
} :
|
|
932
|
+
} : c;
|
|
987
933
|
}),
|
|
988
|
-
lines:
|
|
989
|
-
const
|
|
990
|
-
return
|
|
991
|
-
...
|
|
992
|
-
points:
|
|
993
|
-
x:
|
|
994
|
-
y:
|
|
934
|
+
lines: o.linePointStarts ? l.lines.map((c) => {
|
|
935
|
+
const n = o.linePointStarts.get(c.id);
|
|
936
|
+
return n ? {
|
|
937
|
+
...c,
|
|
938
|
+
points: n.map((i) => ({
|
|
939
|
+
x: i.x + x,
|
|
940
|
+
y: i.y + t
|
|
995
941
|
}))
|
|
996
|
-
} :
|
|
997
|
-
}) :
|
|
942
|
+
} : c;
|
|
943
|
+
}) : l.lines
|
|
998
944
|
}
|
|
999
945
|
}
|
|
1000
|
-
} :
|
|
946
|
+
} : s;
|
|
1001
947
|
});
|
|
1002
948
|
return;
|
|
1003
949
|
}
|
|
1004
|
-
if (
|
|
1005
|
-
const
|
|
1006
|
-
St.current.showMarquee(
|
|
950
|
+
if (Q.current?.active && St.current) {
|
|
951
|
+
const o = Math.min(Q.current.startScreen.x, h.global.x), f = Math.min(Q.current.startScreen.y, h.global.y), u = Math.abs(h.global.x - Q.current.startScreen.x), e = Math.abs(h.global.y - Q.current.startScreen.y);
|
|
952
|
+
St.current.showMarquee(o, f, u, e);
|
|
1007
953
|
}
|
|
1008
|
-
if (
|
|
1009
|
-
const
|
|
1010
|
-
if (
|
|
1011
|
-
const
|
|
1012
|
-
if (
|
|
1013
|
-
const
|
|
1014
|
-
let
|
|
1015
|
-
const
|
|
1016
|
-
if (
|
|
1017
|
-
const
|
|
1018
|
-
if (
|
|
1019
|
-
const
|
|
1020
|
-
if (
|
|
1021
|
-
const
|
|
1022
|
-
|
|
954
|
+
if (tt.current?.active && pt.current) {
|
|
955
|
+
const o = W.current.nodes.find((f) => f.id === tt.current.sourceNodeId);
|
|
956
|
+
if (o) {
|
|
957
|
+
const f = vt(o.width, o.height).find((u) => u.id === tt.current.sourceHandleId);
|
|
958
|
+
if (f) {
|
|
959
|
+
const u = Ut(f, o), e = u.x, v = u.y;
|
|
960
|
+
let x = r.x, t = r.y;
|
|
961
|
+
const s = ne.current;
|
|
962
|
+
if (s && s !== tt.current.sourceNodeId) {
|
|
963
|
+
const c = W.current.nodes.find((n) => n.id === s);
|
|
964
|
+
if (c) {
|
|
965
|
+
const n = Gt(vt(c.width, c.height), c, r.x, r.y, 1 / 0);
|
|
966
|
+
if (n) {
|
|
967
|
+
const i = Ut(n, c);
|
|
968
|
+
x = i.x, t = i.y;
|
|
1023
969
|
}
|
|
1024
970
|
}
|
|
1025
971
|
}
|
|
1026
|
-
const
|
|
1027
|
-
|
|
972
|
+
const l = pt.current;
|
|
973
|
+
l.clear(), l.moveTo(e, v).lineTo(x, t).stroke({
|
|
1028
974
|
color: 3900150,
|
|
1029
975
|
width: 2,
|
|
1030
976
|
alpha: 0.6
|
|
1031
|
-
}),
|
|
977
|
+
}), l.visible = !0;
|
|
1032
978
|
}
|
|
1033
979
|
}
|
|
1034
980
|
}
|
|
1035
|
-
if (
|
|
1036
|
-
const
|
|
1037
|
-
if (
|
|
1038
|
-
const
|
|
1039
|
-
x:
|
|
1040
|
-
y:
|
|
1041
|
-
},
|
|
1042
|
-
let
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1047
|
-
const
|
|
1048
|
-
if (
|
|
1049
|
-
const
|
|
1050
|
-
|
|
981
|
+
if (st.current?.active && pt.current && !pt.current.destroyed) {
|
|
982
|
+
const o = st.current, f = W.current.nodes.find((u) => u.id === o.fixedNodeId);
|
|
983
|
+
if (f) {
|
|
984
|
+
const u = vt(f.width, f.height).find((n) => n.id === o.fixedHandleId), e = u ? Ut(u, f) : {
|
|
985
|
+
x: f.position.x + f.width / 2,
|
|
986
|
+
y: f.position.y + f.height / 2
|
|
987
|
+
}, v = e.x, x = e.y;
|
|
988
|
+
let t = r.x, s = r.y;
|
|
989
|
+
const l = ne.current;
|
|
990
|
+
if (l && l !== o.fixedNodeId) {
|
|
991
|
+
const n = W.current.nodes.find((i) => i.id === l);
|
|
992
|
+
if (n) {
|
|
993
|
+
const i = Gt(vt(n.width, n.height), n, r.x, r.y, 1 / 0);
|
|
994
|
+
if (i) {
|
|
995
|
+
const I = Ut(i, n);
|
|
996
|
+
t = I.x, s = I.y;
|
|
1051
997
|
}
|
|
1052
998
|
}
|
|
1053
999
|
}
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1000
|
+
const c = pt.current;
|
|
1001
|
+
c.clear(), c.moveTo(v, x).lineTo(t, s).stroke({
|
|
1056
1002
|
color: 16347926,
|
|
1057
1003
|
width: 2,
|
|
1058
1004
|
alpha: 0.7
|
|
1059
|
-
}),
|
|
1005
|
+
}), c.visible = !0;
|
|
1060
1006
|
}
|
|
1061
1007
|
}
|
|
1062
1008
|
});
|
|
1063
|
-
const
|
|
1064
|
-
|
|
1009
|
+
const zt = () => {
|
|
1010
|
+
Dt.current = [];
|
|
1065
1011
|
try {
|
|
1066
|
-
|
|
1012
|
+
re.current?.clear();
|
|
1067
1013
|
} catch {
|
|
1068
1014
|
}
|
|
1069
1015
|
try {
|
|
1070
|
-
const
|
|
1071
|
-
|
|
1016
|
+
const h = pt.current;
|
|
1017
|
+
h && !h.destroyed && (h.clear(), h.visible = !1);
|
|
1072
1018
|
} catch {
|
|
1073
1019
|
}
|
|
1074
|
-
|
|
1020
|
+
z.current && (z.current.style.cursor = "");
|
|
1075
1021
|
};
|
|
1076
|
-
|
|
1077
|
-
if (
|
|
1078
|
-
|
|
1022
|
+
mt.on("pointerup", (h) => {
|
|
1023
|
+
if (zt(), at.current?.active) {
|
|
1024
|
+
at.current = null;
|
|
1079
1025
|
return;
|
|
1080
1026
|
}
|
|
1081
|
-
if (
|
|
1082
|
-
|
|
1027
|
+
if (ht.current?.active) {
|
|
1028
|
+
ht.current = null;
|
|
1083
1029
|
return;
|
|
1084
1030
|
}
|
|
1085
|
-
if (
|
|
1086
|
-
|
|
1031
|
+
if (xt.current?.active) {
|
|
1032
|
+
xt.current = null;
|
|
1087
1033
|
return;
|
|
1088
1034
|
}
|
|
1089
|
-
if (
|
|
1090
|
-
const
|
|
1091
|
-
if (
|
|
1092
|
-
const S =
|
|
1093
|
-
|
|
1094
|
-
nodeIds: new Set(S.map((
|
|
1035
|
+
if (ot.current?.active && (ot.current = null, se.current()), Q.current?.active) {
|
|
1036
|
+
const r = ct.current(Q.current.startScreen.x, Q.current.startScreen.y), d = ct.current(h.global.x, h.global.y), p = Math.min(r.x, d.x), D = Math.min(r.y, d.y), E = Math.abs(d.x - r.x), m = Math.abs(d.y - r.y);
|
|
1037
|
+
if (E > 4 && m > 4) {
|
|
1038
|
+
const S = W.current.nodes.filter((o) => hn(p, D, E, m, o.position.x, o.position.y, o.width, o.height)), Y = W.current.lines.filter((o) => o.points.length === 0 ? !1 : o.points.every((f) => f.x >= p && f.x <= p + E && f.y >= D && f.y <= D + m));
|
|
1039
|
+
ft({
|
|
1040
|
+
nodeIds: new Set(S.map((o) => o.id)),
|
|
1095
1041
|
edgeIds: /* @__PURE__ */ new Set(),
|
|
1096
|
-
lineIds: new Set(
|
|
1042
|
+
lineIds: new Set(Y.map((o) => o.id))
|
|
1097
1043
|
});
|
|
1098
1044
|
}
|
|
1099
|
-
|
|
1045
|
+
Q.current = null, St.current?.hideMarquee();
|
|
1100
1046
|
}
|
|
1101
|
-
if (
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1105
|
-
let
|
|
1106
|
-
for (let S =
|
|
1107
|
-
|
|
1047
|
+
if (st.current?.active) {
|
|
1048
|
+
const r = st.current.edgeId, d = st.current.movingEnd, p = st.current.fixedNodeId;
|
|
1049
|
+
st.current = null;
|
|
1050
|
+
const D = ct.current(h.global.x, h.global.y), E = W.current.nodes;
|
|
1051
|
+
let m = null;
|
|
1052
|
+
for (let S = E.length - 1; S >= 0; S--) if (Lt(D.x, D.y, E[S]) && E[S].id !== p) {
|
|
1053
|
+
m = E[S];
|
|
1108
1054
|
break;
|
|
1109
1055
|
}
|
|
1110
|
-
if (
|
|
1111
|
-
const S =
|
|
1112
|
-
J((
|
|
1113
|
-
const
|
|
1114
|
-
return
|
|
1115
|
-
...
|
|
1056
|
+
if (m) {
|
|
1057
|
+
const S = m.id, Y = Gt(vt(m.width, m.height), m, D.x, D.y, 1 / 0)?.id;
|
|
1058
|
+
J((o) => {
|
|
1059
|
+
const f = o.canvases[B.current];
|
|
1060
|
+
return f ? {
|
|
1061
|
+
...o,
|
|
1116
1062
|
canvases: {
|
|
1117
|
-
...
|
|
1118
|
-
[
|
|
1119
|
-
...
|
|
1120
|
-
edges:
|
|
1121
|
-
...
|
|
1063
|
+
...o.canvases,
|
|
1064
|
+
[B.current]: {
|
|
1065
|
+
...f,
|
|
1066
|
+
edges: f.edges.map((u) => u.id !== r ? u : d === "source" ? {
|
|
1067
|
+
...u,
|
|
1122
1068
|
source: S,
|
|
1123
|
-
sourceHandle:
|
|
1069
|
+
sourceHandle: Y
|
|
1124
1070
|
} : {
|
|
1125
|
-
...
|
|
1071
|
+
...u,
|
|
1126
1072
|
target: S,
|
|
1127
|
-
targetHandle:
|
|
1073
|
+
targetHandle: Y
|
|
1128
1074
|
})
|
|
1129
1075
|
}
|
|
1130
1076
|
}
|
|
1131
|
-
} :
|
|
1077
|
+
} : o;
|
|
1132
1078
|
});
|
|
1133
1079
|
}
|
|
1134
1080
|
return;
|
|
1135
1081
|
}
|
|
1136
|
-
if (
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1139
|
-
const
|
|
1140
|
-
let
|
|
1141
|
-
for (let
|
|
1142
|
-
|
|
1082
|
+
if (tt.current?.active) {
|
|
1083
|
+
const r = tt.current.sourceNodeId, d = tt.current.sourceHandleId;
|
|
1084
|
+
tt.current = null;
|
|
1085
|
+
const p = ct.current(h.global.x, h.global.y), D = W.current.nodes;
|
|
1086
|
+
let E = null;
|
|
1087
|
+
for (let m = D.length - 1; m >= 0; m--) if (Lt(p.x, p.y, D[m]) && D[m].id !== r) {
|
|
1088
|
+
E = D[m];
|
|
1143
1089
|
break;
|
|
1144
1090
|
}
|
|
1145
|
-
if (
|
|
1146
|
-
const
|
|
1147
|
-
J((
|
|
1148
|
-
const
|
|
1149
|
-
return !
|
|
1150
|
-
...
|
|
1091
|
+
if (E) {
|
|
1092
|
+
const m = E.id, S = Gt(vt(E.width, E.height), E, p.x, p.y, 1 / 0)?.id, Y = `edge_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 6)}`, o = Ge.current;
|
|
1093
|
+
J((f) => {
|
|
1094
|
+
const u = f.canvases[B.current];
|
|
1095
|
+
return !u || u.edges.some((e) => e.source === r && e.target === m && e.sourceHandle === d && e.targetHandle === S) ? f : {
|
|
1096
|
+
...f,
|
|
1151
1097
|
canvases: {
|
|
1152
|
-
...
|
|
1153
|
-
[
|
|
1154
|
-
...
|
|
1155
|
-
edges: [...
|
|
1156
|
-
id:
|
|
1157
|
-
source:
|
|
1158
|
-
target:
|
|
1159
|
-
sourceHandle:
|
|
1098
|
+
...f.canvases,
|
|
1099
|
+
[B.current]: {
|
|
1100
|
+
...u,
|
|
1101
|
+
edges: [...u.edges, {
|
|
1102
|
+
id: Y,
|
|
1103
|
+
source: r,
|
|
1104
|
+
target: m,
|
|
1105
|
+
sourceHandle: d,
|
|
1160
1106
|
targetHandle: S,
|
|
1161
|
-
type:
|
|
1107
|
+
type: o,
|
|
1162
1108
|
data: {
|
|
1163
1109
|
strokeColor: "theme:base-content",
|
|
1164
1110
|
strokeWidth: 2,
|
|
@@ -1172,49 +1118,145 @@ function Wn({ onPixiReady: F }) {
|
|
|
1172
1118
|
});
|
|
1173
1119
|
}
|
|
1174
1120
|
}
|
|
1175
|
-
}),
|
|
1176
|
-
|
|
1177
|
-
})
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1121
|
+
}), mt.on("pointerupoutside", () => {
|
|
1122
|
+
zt(), ot.current?.active && se.current(), ot.current = null, ht.current = null, Q.current = null, st.current = null, tt.current = null, at.current = null, xt.current = null, St.current?.hideMarquee();
|
|
1123
|
+
});
|
|
1124
|
+
const Ct = z.current;
|
|
1125
|
+
let ut = null;
|
|
1126
|
+
const Kt = (h) => {
|
|
1127
|
+
const r = Ct.getBoundingClientRect(), d = h[0].clientX, p = h[0].clientY, D = h[1].clientX, E = h[1].clientY;
|
|
1128
|
+
return {
|
|
1129
|
+
dist: Math.hypot(D - d, E - p),
|
|
1130
|
+
midX: (d + D) / 2 - r.left,
|
|
1131
|
+
midY: (p + E) / 2 - r.top
|
|
1132
|
+
};
|
|
1133
|
+
}, Me = () => {
|
|
1134
|
+
zt(), ot.current?.active && se.current(), ot.current = null, ht.current = null, Q.current = null, st.current = null, tt.current = null, at.current = null, xt.current = null, St.current?.hideMarquee(), Z.current?.cancelPan();
|
|
1135
|
+
}, _e = (h) => {
|
|
1136
|
+
if (h.touches.length < 2) return;
|
|
1137
|
+
const r = Z.current;
|
|
1138
|
+
r && (r.multiTouchActive = !0, Me(), ut = Kt(h.touches), h.preventDefault());
|
|
1139
|
+
}, qe = (h) => {
|
|
1140
|
+
if (!ut || h.touches.length < 2) return;
|
|
1141
|
+
h.preventDefault();
|
|
1142
|
+
const r = Z.current;
|
|
1143
|
+
if (!r) return;
|
|
1144
|
+
const d = Kt(h.touches), p = d.dist / Math.max(1, ut.dist);
|
|
1145
|
+
Number.isFinite(p) && p > 0 && r.zoomAt(d.midX, d.midY, p), r.setState({
|
|
1146
|
+
x: r.state.x + (d.midX - ut.midX),
|
|
1147
|
+
y: r.state.y + (d.midY - ut.midY)
|
|
1148
|
+
}), ut = d;
|
|
1149
|
+
}, Re = (h) => {
|
|
1150
|
+
if (h.touches.length >= 2) {
|
|
1151
|
+
ut = Kt(h.touches);
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1154
|
+
if (ut = null, h.touches.length === 0) {
|
|
1155
|
+
const r = Z.current;
|
|
1156
|
+
r && (r.multiTouchActive = !1), Te.current = performance.now() + 350;
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
Ct?.addEventListener("touchstart", _e, { passive: !1 }), Ct?.addEventListener("touchmove", qe, { passive: !1 }), Ct?.addEventListener("touchend", Re), Ct?.addEventListener("touchcancel", Re), X = _e, L = qe, O = Re, mt.on("rightclick", (h) => {
|
|
1160
|
+
if (h.preventDefault?.(), Z.current?.didRightPan) return;
|
|
1161
|
+
const r = ct.current(h.global.x, h.global.y), d = W.current.nodes;
|
|
1162
|
+
let p = null;
|
|
1163
|
+
for (let S = d.length - 1; S >= 0; S--) if (Lt(r.x, r.y, d[S])) {
|
|
1164
|
+
p = d[S].id;
|
|
1183
1165
|
break;
|
|
1184
1166
|
}
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1187
|
-
x:
|
|
1188
|
-
y:
|
|
1189
|
-
nodeId:
|
|
1167
|
+
const D = h.nativeEvent, E = D?.clientX ?? h.global.x, m = D?.clientY ?? h.global.y;
|
|
1168
|
+
Jt({
|
|
1169
|
+
x: E,
|
|
1170
|
+
y: m,
|
|
1171
|
+
nodeId: p
|
|
1190
1172
|
});
|
|
1191
|
-
}),
|
|
1192
|
-
if (
|
|
1193
|
-
const
|
|
1194
|
-
if (
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1173
|
+
}), mt.on("pointertap", (h) => {
|
|
1174
|
+
if (Z.current?.multiTouchActive || performance.now() < Te.current || h.button !== 0) return;
|
|
1175
|
+
const r = Date.now(), d = ct.current(h.global.x, h.global.y), p = oe.current;
|
|
1176
|
+
if (p) {
|
|
1177
|
+
const S = fn("node"), Y = d.x - p.width / 2, o = d.y - p.height / 2, f = ae([{
|
|
1178
|
+
id: "__ghost__",
|
|
1179
|
+
type: p.type,
|
|
1180
|
+
position: {
|
|
1181
|
+
x: Y,
|
|
1182
|
+
y: o
|
|
1183
|
+
},
|
|
1184
|
+
width: p.width,
|
|
1185
|
+
height: p.height,
|
|
1186
|
+
data: {}
|
|
1187
|
+
}], W.current.nodes), u = Y + f.dx, e = o + f.dy;
|
|
1188
|
+
J((v) => {
|
|
1189
|
+
const x = v.canvases[B.current];
|
|
1190
|
+
if (!x) return v;
|
|
1191
|
+
const t = {};
|
|
1192
|
+
p.type === "animAnchor" && (t.animIndex = In(v));
|
|
1193
|
+
const s = Math.max(0, ...x.nodes.map((l) => l.zIndex ?? 0), ...x.lines.map((l) => l.zIndex ?? 0));
|
|
1194
|
+
return {
|
|
1195
|
+
...v,
|
|
1196
|
+
canvases: {
|
|
1197
|
+
...v.canvases,
|
|
1198
|
+
[B.current]: {
|
|
1199
|
+
...x,
|
|
1200
|
+
nodes: [...x.nodes, {
|
|
1201
|
+
id: S,
|
|
1202
|
+
type: p.type,
|
|
1203
|
+
position: {
|
|
1204
|
+
x: u,
|
|
1205
|
+
y: e
|
|
1206
|
+
},
|
|
1207
|
+
width: p.width,
|
|
1208
|
+
height: p.height,
|
|
1209
|
+
zIndex: s + 1,
|
|
1210
|
+
data: {
|
|
1211
|
+
...p.data,
|
|
1212
|
+
...t
|
|
1213
|
+
}
|
|
1214
|
+
}]
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
};
|
|
1218
|
+
}), ft({
|
|
1219
|
+
nodeIds: /* @__PURE__ */ new Set([S]),
|
|
1220
|
+
edgeIds: /* @__PURE__ */ new Set(),
|
|
1221
|
+
lineIds: /* @__PURE__ */ new Set()
|
|
1222
|
+
}), Vt.current && window.setTimeout(() => {
|
|
1223
|
+
Bt.current(u, e, p.width, p.height, {
|
|
1224
|
+
padding: 80,
|
|
1225
|
+
preserveZoom: !0,
|
|
1226
|
+
duration: 280
|
|
1227
|
+
});
|
|
1228
|
+
}, 0), Tt.current = {
|
|
1229
|
+
time: 0,
|
|
1230
|
+
wx: 0,
|
|
1231
|
+
wy: 0
|
|
1232
|
+
};
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
const D = Tt.current, E = d.x - D.wx, m = d.y - D.wy;
|
|
1236
|
+
if (r - D.time < 400 && Math.abs(E) < 10 && Math.abs(m) < 10) {
|
|
1237
|
+
const S = W.current.nodes;
|
|
1238
|
+
for (let u = S.length - 1; u >= 0; u--) if (Lt(d.x, d.y, S[u])) {
|
|
1239
|
+
const e = S[u], v = e.data.childCanvasId;
|
|
1240
|
+
if (v) {
|
|
1241
|
+
rn(v), Tt.current = {
|
|
1200
1242
|
time: 0,
|
|
1201
1243
|
wx: 0,
|
|
1202
1244
|
wy: 0
|
|
1203
1245
|
};
|
|
1204
1246
|
return;
|
|
1205
1247
|
}
|
|
1206
|
-
|
|
1248
|
+
ce.current("node", e.id, e.data.label ?? ""), Tt.current = {
|
|
1207
1249
|
time: 0,
|
|
1208
1250
|
wx: 0,
|
|
1209
1251
|
wy: 0
|
|
1210
1252
|
};
|
|
1211
1253
|
return;
|
|
1212
1254
|
}
|
|
1213
|
-
const
|
|
1214
|
-
for (const
|
|
1215
|
-
const
|
|
1216
|
-
for (let
|
|
1217
|
-
|
|
1255
|
+
const Y = W.current.edges, o = /* @__PURE__ */ new Map();
|
|
1256
|
+
for (const u of S) o.set(u.id, u);
|
|
1257
|
+
const f = Z.current?.state.zoom ?? 1;
|
|
1258
|
+
for (let u = Y.length - 1; u >= 0; u--) if (ze(d.x, d.y, Y[u], o, Math.min(8 / f, 12))) {
|
|
1259
|
+
ce.current("edge", Y[u].id, Y[u].data.labelText ?? ""), Tt.current = {
|
|
1218
1260
|
time: 0,
|
|
1219
1261
|
wx: 0,
|
|
1220
1262
|
wy: 0
|
|
@@ -1222,161 +1264,161 @@ function Wn({ onPixiReady: F }) {
|
|
|
1222
1264
|
return;
|
|
1223
1265
|
}
|
|
1224
1266
|
}
|
|
1225
|
-
|
|
1226
|
-
time:
|
|
1227
|
-
wx:
|
|
1228
|
-
wy:
|
|
1267
|
+
Tt.current = {
|
|
1268
|
+
time: r,
|
|
1269
|
+
wx: d.x,
|
|
1270
|
+
wy: d.y
|
|
1229
1271
|
};
|
|
1230
1272
|
});
|
|
1231
|
-
let
|
|
1232
|
-
|
|
1233
|
-
if (
|
|
1234
|
-
const
|
|
1273
|
+
let Ze = !1;
|
|
1274
|
+
a.app.ticker.add((h) => {
|
|
1275
|
+
if (a.destroyed) return;
|
|
1276
|
+
const r = h.deltaMS, d = a.app.screen, p = Z.current?.state ?? {
|
|
1235
1277
|
x: 0,
|
|
1236
1278
|
y: 0,
|
|
1237
1279
|
zoom: 1
|
|
1238
1280
|
};
|
|
1239
|
-
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1242
|
-
const
|
|
1243
|
-
S.forEach((
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
showAnchors:
|
|
1247
|
-
presentation:
|
|
1248
|
-
presentationAnchorId:
|
|
1249
|
-
presentationAnchorVisible:
|
|
1281
|
+
P.current?.update(p, d.width, d.height);
|
|
1282
|
+
const D = Z.current?.isPanning ?? !1;
|
|
1283
|
+
D !== Ze && (Ze = D, z.current && (z.current.style.cursor = D ? "grabbing" : ""));
|
|
1284
|
+
const E = W.current, m = Zt.current, S = vn(Pe.current), Y = /* @__PURE__ */ new Map();
|
|
1285
|
+
S.forEach((t, s) => Y.set(t.node.id, s + 1)), Qt.current?.advanceAnimation(r);
|
|
1286
|
+
const o = kt.current ? S[kt.current.current] : void 0;
|
|
1287
|
+
Qt.current?.sync(E.nodes, m.nodeIds, ne.current, Y, {
|
|
1288
|
+
showAnchors: Le.current,
|
|
1289
|
+
presentation: kt.current !== null,
|
|
1290
|
+
presentationAnchorId: o?.node.id,
|
|
1291
|
+
presentationAnchorVisible: kt.current?.showAnchor ?? !1
|
|
1250
1292
|
});
|
|
1251
|
-
const
|
|
1252
|
-
for (const
|
|
1253
|
-
|
|
1254
|
-
const
|
|
1255
|
-
if (
|
|
1256
|
-
|
|
1257
|
-
const
|
|
1258
|
-
|
|
1293
|
+
const f = /* @__PURE__ */ new Map();
|
|
1294
|
+
for (const t of E.nodes) f.set(t.id, t);
|
|
1295
|
+
te.current?.advanceAnimation(r), te.current?.sync(E.edges, f, m.edgeIds, null, { presentation: kt.current !== null }), ee.current?.advanceAnimation(r), ee.current?.sync(E.lines, m.lineIds), re.current?.update(Dt.current, d.width, d.height, p);
|
|
1296
|
+
const u = Ft.current;
|
|
1297
|
+
if (u) {
|
|
1298
|
+
u.clear();
|
|
1299
|
+
const t = ye.current;
|
|
1300
|
+
t && (u.circle(t.wx, t.wy, 10).fill({
|
|
1259
1301
|
color: 3900150,
|
|
1260
1302
|
alpha: 0.12
|
|
1261
1303
|
}).stroke({
|
|
1262
1304
|
color: 3900150,
|
|
1263
1305
|
width: 1.5,
|
|
1264
1306
|
alpha: 0.5
|
|
1265
|
-
}),
|
|
1307
|
+
}), u.circle(t.wx, t.wy, 4).fill({
|
|
1266
1308
|
color: 3900150,
|
|
1267
1309
|
alpha: 0.9
|
|
1268
1310
|
}));
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1311
|
+
const s = pe.current;
|
|
1312
|
+
s && !t && (u.circle(s.worldX, s.worldY, 10).fill({
|
|
1271
1313
|
color: 16347926,
|
|
1272
1314
|
alpha: 0.12
|
|
1273
1315
|
}).stroke({
|
|
1274
1316
|
color: 16347926,
|
|
1275
1317
|
width: 1.5,
|
|
1276
1318
|
alpha: 0.5
|
|
1277
|
-
}),
|
|
1319
|
+
}), u.circle(s.worldX, s.worldY, 4).fill({
|
|
1278
1320
|
color: 16347926,
|
|
1279
1321
|
alpha: 0.9
|
|
1280
1322
|
}));
|
|
1281
1323
|
}
|
|
1282
|
-
const
|
|
1283
|
-
if (
|
|
1284
|
-
|
|
1285
|
-
const
|
|
1286
|
-
if (
|
|
1287
|
-
const
|
|
1324
|
+
const e = qt.current;
|
|
1325
|
+
if (e) {
|
|
1326
|
+
e.clear();
|
|
1327
|
+
const t = oe.current;
|
|
1328
|
+
if (t) {
|
|
1329
|
+
const s = ke.current, l = s.x - t.width / 2, c = s.y - t.height / 2, n = ae([{
|
|
1288
1330
|
id: "__ghost__",
|
|
1289
|
-
type:
|
|
1331
|
+
type: t.type,
|
|
1290
1332
|
position: {
|
|
1291
|
-
x:
|
|
1292
|
-
y:
|
|
1333
|
+
x: l,
|
|
1334
|
+
y: c
|
|
1293
1335
|
},
|
|
1294
|
-
width:
|
|
1295
|
-
height:
|
|
1336
|
+
width: t.width,
|
|
1337
|
+
height: t.height,
|
|
1296
1338
|
data: {}
|
|
1297
|
-
}],
|
|
1298
|
-
|
|
1299
|
-
width:
|
|
1300
|
-
height:
|
|
1339
|
+
}], E.nodes);
|
|
1340
|
+
Dt.current = n.guides, e.position.set(l + n.dx, c + n.dy), (Be[t.type] ?? Be.shapeRect)(e, {
|
|
1341
|
+
width: t.width,
|
|
1342
|
+
height: t.height,
|
|
1301
1343
|
fill: "#3b82f6",
|
|
1302
1344
|
stroke: "#3b82f6",
|
|
1303
1345
|
strokeWidth: 1.5,
|
|
1304
|
-
borderStyle:
|
|
1346
|
+
borderStyle: t.data.borderStyle
|
|
1305
1347
|
});
|
|
1306
1348
|
} else
|
|
1307
|
-
|
|
1349
|
+
e.position.set(0, 0), !ot.current?.active && !ht.current?.active && (Dt.current = []);
|
|
1308
1350
|
}
|
|
1309
|
-
const
|
|
1310
|
-
if (
|
|
1311
|
-
const
|
|
1312
|
-
for (const
|
|
1313
|
-
if (!
|
|
1314
|
-
const
|
|
1315
|
-
if (
|
|
1351
|
+
const v = _t.current;
|
|
1352
|
+
if (v && (v.clear(), m.edgeIds.size > 0 && Ot.current === "select")) {
|
|
1353
|
+
const t = 1 / p.zoom;
|
|
1354
|
+
for (const s of E.edges) {
|
|
1355
|
+
if (!m.edgeIds.has(s.id)) continue;
|
|
1356
|
+
const l = s.data.waypoints;
|
|
1357
|
+
if (l) for (const c of l) v.circle(c.x, c.y, 5 * t).fill({ color: 16777215 }).stroke({
|
|
1316
1358
|
color: 3900150,
|
|
1317
|
-
width: 1.5 *
|
|
1359
|
+
width: 1.5 * t
|
|
1318
1360
|
});
|
|
1319
|
-
if (
|
|
1320
|
-
const
|
|
1321
|
-
if (!
|
|
1322
|
-
const
|
|
1361
|
+
if (s.type === "simplebezier") {
|
|
1362
|
+
const c = Et(s, f);
|
|
1363
|
+
if (!c) continue;
|
|
1364
|
+
const n = l ?? [], i = [
|
|
1323
1365
|
{
|
|
1324
|
-
x:
|
|
1325
|
-
y:
|
|
1366
|
+
x: c.sx,
|
|
1367
|
+
y: c.sy
|
|
1326
1368
|
},
|
|
1327
|
-
...
|
|
1369
|
+
...n,
|
|
1328
1370
|
{
|
|
1329
|
-
x:
|
|
1330
|
-
y:
|
|
1371
|
+
x: c.tx,
|
|
1372
|
+
y: c.ty
|
|
1331
1373
|
}
|
|
1332
|
-
],
|
|
1333
|
-
for (let
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1374
|
+
], I = s.data.bezierControls, g = i.length - 2;
|
|
1375
|
+
for (let b = 0; b <= g; b++) {
|
|
1376
|
+
const H = i[b], y = i[b + 1], M = I?.[b], j = Math.hypot(y.x - H.x, y.y - H.y), $ = Math.max(30, j * 0.3), ie = M?.c1x ?? (b === 0 ? H.x + c.snx * $ : H.x + (y.x - H.x) * 0.4), de = M?.c1y ?? (b === 0 ? H.y + c.sny * $ : H.y), Pt = M?.c2x ?? (b === g ? y.x + c.tnx * $ : y.x - (y.x - H.x) * 0.4), Oe = M?.c2y ?? (b === g ? y.y + c.tny * $ : y.y);
|
|
1377
|
+
v.moveTo(H.x, H.y).lineTo(ie, de).stroke({
|
|
1336
1378
|
color: 10265519,
|
|
1337
|
-
width: 1 *
|
|
1338
|
-
}),
|
|
1379
|
+
width: 1 * t
|
|
1380
|
+
}), v.moveTo(y.x, y.y).lineTo(Pt, Oe).stroke({
|
|
1339
1381
|
color: 10265519,
|
|
1340
|
-
width: 1 *
|
|
1382
|
+
width: 1 * t
|
|
1341
1383
|
});
|
|
1342
|
-
const
|
|
1343
|
-
|
|
1384
|
+
const Ve = 4 * t;
|
|
1385
|
+
v.circle(ie, de, Ve).fill({ color: 16777215 }).stroke({
|
|
1344
1386
|
color: 3900150,
|
|
1345
|
-
width: 1.5 *
|
|
1346
|
-
}),
|
|
1387
|
+
width: 1.5 * t
|
|
1388
|
+
}), v.circle(Pt, Oe, Ve).fill({ color: 16777215 }).stroke({
|
|
1347
1389
|
color: 3900150,
|
|
1348
|
-
width: 1.5 *
|
|
1390
|
+
width: 1.5 * t
|
|
1349
1391
|
});
|
|
1350
1392
|
}
|
|
1351
1393
|
}
|
|
1352
1394
|
}
|
|
1353
1395
|
}
|
|
1354
|
-
const
|
|
1355
|
-
if (
|
|
1356
|
-
const
|
|
1357
|
-
if (
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1396
|
+
const x = Xt.current;
|
|
1397
|
+
if (x && (x.clear(), m.nodeIds.size === 1 && Ot.current === "select")) {
|
|
1398
|
+
const t = [...m.nodeIds][0], s = E.nodes.find((l) => l.id === t);
|
|
1399
|
+
if (s) {
|
|
1400
|
+
const l = p.zoom, c = s.position.x * l + p.x, n = s.position.y * l + p.y, i = s.width * l, I = s.height * l;
|
|
1401
|
+
x.rect(c, n, i, I).stroke({
|
|
1360
1402
|
color: 3900150,
|
|
1361
1403
|
width: 1.5
|
|
1362
1404
|
});
|
|
1363
|
-
const
|
|
1364
|
-
[
|
|
1365
|
-
[
|
|
1366
|
-
[
|
|
1367
|
-
[
|
|
1405
|
+
const g = 7, b = g / 2, H = [
|
|
1406
|
+
[c, n],
|
|
1407
|
+
[c + i, n],
|
|
1408
|
+
[c + i, n + I],
|
|
1409
|
+
[c, n + I]
|
|
1368
1410
|
];
|
|
1369
|
-
for (const [
|
|
1411
|
+
for (const [j, $] of H) x.rect(j - b, $ - b, g, g).fill({ color: 16777215 }).stroke({
|
|
1370
1412
|
color: 3900150,
|
|
1371
1413
|
width: 1.5
|
|
1372
1414
|
});
|
|
1373
|
-
const
|
|
1374
|
-
[
|
|
1375
|
-
[
|
|
1376
|
-
[
|
|
1377
|
-
[
|
|
1415
|
+
const y = 4, M = [
|
|
1416
|
+
[c + i / 2, n],
|
|
1417
|
+
[c + i, n + I / 2],
|
|
1418
|
+
[c + i / 2, n + I],
|
|
1419
|
+
[c, n + I / 2]
|
|
1378
1420
|
];
|
|
1379
|
-
for (const [
|
|
1421
|
+
for (const [j, $] of M) x.circle(j, $, y).fill({
|
|
1380
1422
|
color: 3900150,
|
|
1381
1423
|
alpha: 0.9
|
|
1382
1424
|
});
|
|
@@ -1384,72 +1426,87 @@ function Wn({ onPixiReady: F }) {
|
|
|
1384
1426
|
}
|
|
1385
1427
|
});
|
|
1386
1428
|
};
|
|
1387
|
-
return
|
|
1388
|
-
if (
|
|
1389
|
-
|
|
1429
|
+
return F(), () => {
|
|
1430
|
+
if (k = !0, a && !a.destroyed) try {
|
|
1431
|
+
a.app.stage.removeAllListeners();
|
|
1390
1432
|
} catch {
|
|
1391
1433
|
}
|
|
1392
|
-
|
|
1434
|
+
const A = z.current;
|
|
1435
|
+
X && A?.removeEventListener("touchstart", X), L && A?.removeEventListener("touchmove", L), O && (A?.removeEventListener("touchend", O), A?.removeEventListener("touchcancel", O)), P.current?.destroy(), St.current?.destroy(), Qt.current?.destroy(), te.current?.destroy(), ee.current?.destroy(), fe.current?.destroy(), he.current?.destroy(), pt.current?.destroy(), Xt.current && (Xt.current.destroy(), Xt.current = null), Ft.current && (Ft.current.destroy(), Ft.current = null), _t.current && (_t.current.destroy(), _t.current = null), qt.current && (qt.current.destroy(), qt.current = null), re.current?.destroy();
|
|
1393
1436
|
};
|
|
1394
|
-
}, [
|
|
1395
|
-
const
|
|
1396
|
-
if (!(!
|
|
1397
|
-
switch (
|
|
1437
|
+
}, [N.current]), It(() => {
|
|
1438
|
+
const a = fe.current, k = he.current;
|
|
1439
|
+
if (!(!a || !k))
|
|
1440
|
+
switch (a.deactivate(), k.deactivate(), K) {
|
|
1398
1441
|
case "freehand":
|
|
1399
|
-
|
|
1442
|
+
a.activate();
|
|
1400
1443
|
break;
|
|
1401
1444
|
case "line":
|
|
1402
|
-
|
|
1445
|
+
k.activate("straight");
|
|
1403
1446
|
break;
|
|
1404
1447
|
case "polyline":
|
|
1405
|
-
|
|
1448
|
+
k.activate("polyline");
|
|
1406
1449
|
break;
|
|
1407
1450
|
case "arrow":
|
|
1408
|
-
|
|
1451
|
+
k.activate("arrow");
|
|
1409
1452
|
break;
|
|
1410
1453
|
}
|
|
1411
|
-
}, [K]),
|
|
1412
|
-
|
|
1413
|
-
}, [U,
|
|
1414
|
-
const
|
|
1415
|
-
if (!
|
|
1416
|
-
const
|
|
1454
|
+
}, [K]), It(() => {
|
|
1455
|
+
P.current && (P.current.visible = U, P.current.gridSize = et);
|
|
1456
|
+
}, [U, et]), It(() => {
|
|
1457
|
+
const a = z.current;
|
|
1458
|
+
if (!a) return;
|
|
1459
|
+
const k = 1e-3, X = (L) => {
|
|
1417
1460
|
L.preventDefault();
|
|
1418
|
-
const
|
|
1419
|
-
if (!
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1461
|
+
const O = Z.current;
|
|
1462
|
+
if (!O) return;
|
|
1463
|
+
const F = a.getBoundingClientRect(), A = L.clientX - F.left, it = L.clientY - F.top, gt = L.ctrlKey ? 3 : 1, wt = -L.deltaY * k * gt;
|
|
1464
|
+
O.zoomAt(A, it, 1 + wt);
|
|
1422
1465
|
};
|
|
1423
|
-
return
|
|
1424
|
-
}, [
|
|
1466
|
+
return a.addEventListener("wheel", X, { passive: !1 }), () => a.removeEventListener("wheel", X);
|
|
1467
|
+
}, [Z]), /* @__PURE__ */ Ue("div", {
|
|
1425
1468
|
style: {
|
|
1426
1469
|
position: "relative",
|
|
1427
1470
|
width: "100%",
|
|
1428
1471
|
height: "100%"
|
|
1429
1472
|
},
|
|
1430
|
-
children: [
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1473
|
+
children: [
|
|
1474
|
+
/* @__PURE__ */ Se("div", {
|
|
1475
|
+
ref: z,
|
|
1476
|
+
className: "flow-canvas-wrapper",
|
|
1477
|
+
tabIndex: -1,
|
|
1478
|
+
onContextMenu: (a) => a.preventDefault()
|
|
1479
|
+
}),
|
|
1480
|
+
lt && me && /* @__PURE__ */ Se("input", {
|
|
1481
|
+
className: "flow-label-editor",
|
|
1482
|
+
autoFocus: !0,
|
|
1483
|
+
defaultValue: lt.value,
|
|
1484
|
+
style: {
|
|
1485
|
+
left: me.x,
|
|
1486
|
+
top: me.y
|
|
1487
|
+
},
|
|
1488
|
+
onFocus: (a) => a.currentTarget.select(),
|
|
1489
|
+
onKeyDown: (a) => {
|
|
1490
|
+
a.key === "Enter" ? (a.preventDefault(), Ye(a.target.value)) : a.key === "Escape" && (a.preventDefault(), on()), a.stopPropagation();
|
|
1491
|
+
},
|
|
1492
|
+
onBlur: (a) => Ye(a.target.value),
|
|
1493
|
+
onPointerDown: (a) => a.stopPropagation()
|
|
1494
|
+
}),
|
|
1495
|
+
Wt && !Mt && /* @__PURE__ */ Ue("button", {
|
|
1496
|
+
type: "button",
|
|
1497
|
+
className: "flow-esc-button",
|
|
1498
|
+
onClick: () => Nt(null),
|
|
1499
|
+
title: "取消连续放置 (Esc)",
|
|
1500
|
+
children: [/* @__PURE__ */ Se("span", {
|
|
1501
|
+
"aria-hidden": !0,
|
|
1502
|
+
children: "⎋"
|
|
1503
|
+
}), " 取消放置 (ESC)"]
|
|
1504
|
+
})
|
|
1505
|
+
]
|
|
1449
1506
|
});
|
|
1450
1507
|
}
|
|
1451
1508
|
export {
|
|
1452
|
-
|
|
1509
|
+
Bn as default
|
|
1453
1510
|
};
|
|
1454
1511
|
|
|
1455
1512
|
//# sourceMappingURL=FlowCanvas.js.map
|