dishui 0.0.45 → 0.0.46
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/chart.js +46 -0
- package/dist/components/Chart/Chart.d.ts +17 -0
- package/dist/components/Chart/Chart.js +29 -0
- package/dist/components/Chart/Chart.js.map +1 -0
- package/dist/components/Chart/index.d.ts +15 -0
- package/dist/components/Input/index.js +2 -2
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +492 -392
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +895 -864
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.d.ts +2 -0
- package/dist/components/pro/Flow/context/FlowUIContext.js +68 -65
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgePaths.js +234 -216
- package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js +21 -10
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useMindMap.js +138 -134
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/index.d.ts +1 -1
- package/dist/components/pro/Flow/nodes/MediaContent.js +47 -25
- package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
- package/dist/components/pro/Flow/nodes/Model3DView.d.ts +7 -0
- package/dist/components/pro/Flow/nodes/Model3DView.js +118 -0
- package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -0
- package/dist/components/pro/Flow/nodes/NodeHandles.d.ts +2 -1
- package/dist/components/pro/Flow/nodes/NodeHandles.js +4 -2
- package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.d.ts +2 -0
- package/dist/components/pro/Flow/nodes/NodeRenderer.js +115 -113
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeText.d.ts +3 -0
- package/dist/components/pro/Flow/nodes/NodeText.js +26 -17
- package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js +85 -79
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js +618 -488
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/OutlinePanel.js +15 -15
- package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/ShapePalette.js +71 -55
- package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +1 -0
- package/dist/components/pro/Flow/panels/toolbarIcons.js +59 -41
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.d.ts +13 -4
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/index-nostyled.d.ts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +145 -143
- package/dist/utils/i18n.d.ts +1 -0
- package/dist/utils/i18n.js +200 -6
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/menu.js +26 -10
- package/dist/utils/menu.js.map +1 -1
- package/package.json +14 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getHandlePositions as
|
|
1
|
+
import { getHandlePositions as M } from "../nodes/NodeHandles.js";
|
|
2
2
|
var p = {
|
|
3
3
|
top: {
|
|
4
4
|
dx: 0,
|
|
@@ -16,338 +16,356 @@ var p = {
|
|
|
16
16
|
dx: 1,
|
|
17
17
|
dy: 0
|
|
18
18
|
}
|
|
19
|
-
},
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
x:
|
|
23
|
-
y:
|
|
24
|
-
},
|
|
25
|
-
x:
|
|
26
|
-
y:
|
|
27
|
-
},
|
|
28
|
-
switch (
|
|
19
|
+
}, w = 20, _ = 30, E = 0.3;
|
|
20
|
+
function D(o, x, t, s) {
|
|
21
|
+
const y = {
|
|
22
|
+
x: x.sx,
|
|
23
|
+
y: x.sy
|
|
24
|
+
}, c = {
|
|
25
|
+
x: x.tx,
|
|
26
|
+
y: x.ty
|
|
27
|
+
}, n = t ?? [];
|
|
28
|
+
switch (o) {
|
|
29
29
|
case "straight":
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
...
|
|
33
|
-
|
|
30
|
+
return m([
|
|
31
|
+
y,
|
|
32
|
+
...n,
|
|
33
|
+
c
|
|
34
34
|
]);
|
|
35
35
|
case "step":
|
|
36
36
|
case "smoothstep":
|
|
37
|
-
return P(
|
|
37
|
+
return P(y, c, n, x, o === "smoothstep" ? 8 : 0);
|
|
38
38
|
case "simplebezier":
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
...
|
|
42
|
-
|
|
43
|
-
],
|
|
39
|
+
return O([
|
|
40
|
+
y,
|
|
41
|
+
...n,
|
|
42
|
+
c
|
|
43
|
+
], s, x);
|
|
44
44
|
default:
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
...
|
|
48
|
-
|
|
45
|
+
return m([
|
|
46
|
+
y,
|
|
47
|
+
...n,
|
|
48
|
+
c
|
|
49
49
|
]);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
52
|
+
function m(o) {
|
|
53
|
+
const x = [{
|
|
54
54
|
type: "M",
|
|
55
|
-
x:
|
|
56
|
-
y:
|
|
55
|
+
x: o[0].x,
|
|
56
|
+
y: o[0].y
|
|
57
57
|
}];
|
|
58
|
-
for (let t = 1; t <
|
|
58
|
+
for (let t = 1; t < o.length; t++) x.push({
|
|
59
59
|
type: "L",
|
|
60
|
-
x:
|
|
61
|
-
y:
|
|
60
|
+
x: o[t].x,
|
|
61
|
+
y: o[t].y
|
|
62
62
|
});
|
|
63
|
-
return
|
|
63
|
+
return x;
|
|
64
64
|
}
|
|
65
|
-
function P(
|
|
66
|
-
const
|
|
67
|
-
x:
|
|
68
|
-
y:
|
|
69
|
-
},
|
|
70
|
-
x:
|
|
71
|
-
y:
|
|
72
|
-
},
|
|
73
|
-
x:
|
|
74
|
-
y:
|
|
75
|
-
},
|
|
76
|
-
|
|
65
|
+
function P(o, x, t, s, y) {
|
|
66
|
+
const c = Math.hypot(x.x - o.x, x.y - o.y), n = Math.min(w, c / 4), e = {
|
|
67
|
+
x: o.x + s.snx * n,
|
|
68
|
+
y: o.y + s.sny * n
|
|
69
|
+
}, i = {
|
|
70
|
+
x: x.x + s.tnx * n,
|
|
71
|
+
y: x.y + s.tny * n
|
|
72
|
+
}, h = Math.abs(s.sny) > Math.abs(s.snx), a = Math.abs(s.tny) > Math.abs(s.tnx), r = [{
|
|
73
|
+
x: o.x,
|
|
74
|
+
y: o.y
|
|
75
|
+
}, e], f = [
|
|
76
|
+
e,
|
|
77
77
|
...t,
|
|
78
|
-
|
|
78
|
+
i
|
|
79
79
|
];
|
|
80
|
-
for (let
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
x:
|
|
86
|
-
y:
|
|
80
|
+
for (let l = 0; l < f.length - 1; l++) {
|
|
81
|
+
const u = f[l], d = f[l + 1];
|
|
82
|
+
if (l === 0 ? h : l === f.length - 2 ? a : h) {
|
|
83
|
+
const g = (u.y + d.y) / 2;
|
|
84
|
+
r.push({
|
|
85
|
+
x: u.x,
|
|
86
|
+
y: g
|
|
87
87
|
}, {
|
|
88
|
-
x:
|
|
89
|
-
y:
|
|
88
|
+
x: d.x,
|
|
89
|
+
y: g
|
|
90
90
|
});
|
|
91
91
|
} else {
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
x:
|
|
95
|
-
y:
|
|
92
|
+
const g = (u.x + d.x) / 2;
|
|
93
|
+
r.push({
|
|
94
|
+
x: g,
|
|
95
|
+
y: u.y
|
|
96
96
|
}, {
|
|
97
|
-
x:
|
|
98
|
-
y:
|
|
97
|
+
x: g,
|
|
98
|
+
y: d.y
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
x:
|
|
103
|
-
y:
|
|
101
|
+
r.push({
|
|
102
|
+
x: d.x,
|
|
103
|
+
y: d.y
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
return
|
|
107
|
-
x:
|
|
108
|
-
y:
|
|
109
|
-
}),
|
|
106
|
+
return r.push({
|
|
107
|
+
x: x.x,
|
|
108
|
+
y: x.y
|
|
109
|
+
}), k(S(r), y);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
const
|
|
113
|
-
for (const
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
x:
|
|
117
|
-
y:
|
|
111
|
+
function S(o) {
|
|
112
|
+
const x = [];
|
|
113
|
+
for (const s of o) {
|
|
114
|
+
const y = x[x.length - 1];
|
|
115
|
+
y && Math.abs(y.x - s.x) < 0.01 && Math.abs(y.y - s.y) < 0.01 || x.push({
|
|
116
|
+
x: s.x,
|
|
117
|
+
y: s.y
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
const t = [];
|
|
121
|
-
for (let
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
121
|
+
for (let s = 0; s < x.length; s++) {
|
|
122
|
+
const y = t[t.length - 1], c = x[s], n = x[s + 1];
|
|
123
|
+
if (y && n) {
|
|
124
|
+
const e = Math.abs(y.x - c.x) < 0.01 && Math.abs(c.x - n.x) < 0.01, i = Math.abs(y.y - c.y) < 0.01 && Math.abs(c.y - n.y) < 0.01;
|
|
125
|
+
if (e || i) continue;
|
|
126
126
|
}
|
|
127
|
-
t.push(
|
|
127
|
+
t.push(c);
|
|
128
128
|
}
|
|
129
129
|
return t;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
131
|
+
function k(o, x) {
|
|
132
|
+
if (o.length === 0) return [];
|
|
133
133
|
const t = [{
|
|
134
134
|
type: "M",
|
|
135
|
-
x:
|
|
136
|
-
y:
|
|
135
|
+
x: o[0].x,
|
|
136
|
+
y: o[0].y
|
|
137
137
|
}];
|
|
138
|
-
if (
|
|
139
|
-
if (
|
|
140
|
-
for (let
|
|
138
|
+
if (o.length === 1) return t;
|
|
139
|
+
if (x <= 0.5) {
|
|
140
|
+
for (let y = 1; y < o.length; y++) t.push({
|
|
141
141
|
type: "L",
|
|
142
|
-
x:
|
|
143
|
-
y:
|
|
142
|
+
x: o[y].x,
|
|
143
|
+
y: o[y].y
|
|
144
144
|
});
|
|
145
145
|
return t;
|
|
146
146
|
}
|
|
147
|
-
for (let
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
147
|
+
for (let y = 1; y < o.length - 1; y++) {
|
|
148
|
+
const c = o[y - 1], n = o[y], e = o[y + 1], i = Math.hypot(n.x - c.x, n.y - c.y), h = Math.hypot(e.x - n.x, e.y - n.y), a = Math.min(x, i / 2, h / 2);
|
|
149
|
+
if (a < 0.5) {
|
|
150
150
|
t.push({
|
|
151
151
|
type: "L",
|
|
152
|
-
x:
|
|
153
|
-
y:
|
|
152
|
+
x: n.x,
|
|
153
|
+
y: n.y
|
|
154
154
|
});
|
|
155
155
|
continue;
|
|
156
156
|
}
|
|
157
|
-
const
|
|
157
|
+
const r = Math.sign(n.x - c.x), f = Math.sign(n.y - c.y), l = Math.sign(e.x - n.x), u = Math.sign(e.y - n.y);
|
|
158
158
|
t.push({
|
|
159
159
|
type: "L",
|
|
160
|
-
x:
|
|
161
|
-
y:
|
|
160
|
+
x: n.x - r * a,
|
|
161
|
+
y: n.y - f * a
|
|
162
162
|
}), t.push({
|
|
163
163
|
type: "Q",
|
|
164
|
-
x:
|
|
165
|
-
y:
|
|
166
|
-
cp1x:
|
|
167
|
-
cp1y:
|
|
164
|
+
x: n.x + l * a,
|
|
165
|
+
y: n.y + u * a,
|
|
166
|
+
cp1x: n.x,
|
|
167
|
+
cp1y: n.y
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const s = o[o.length - 1];
|
|
171
171
|
return t.push({
|
|
172
172
|
type: "L",
|
|
173
|
-
x:
|
|
174
|
-
y:
|
|
173
|
+
x: s.x,
|
|
174
|
+
y: s.y
|
|
175
175
|
}), t;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
const
|
|
177
|
+
function O(o, x, t) {
|
|
178
|
+
const s = [{
|
|
179
179
|
type: "M",
|
|
180
|
-
x:
|
|
181
|
-
y:
|
|
182
|
-
}],
|
|
183
|
-
for (let
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
180
|
+
x: o[0].x,
|
|
181
|
+
y: o[0].y
|
|
182
|
+
}], y = o.length - 2;
|
|
183
|
+
for (let c = 0; c <= y; c++) {
|
|
184
|
+
const n = o[c], e = o[c + 1], i = x?.[c];
|
|
185
|
+
if (i) s.push({
|
|
186
186
|
type: "C",
|
|
187
|
-
x:
|
|
188
|
-
y:
|
|
189
|
-
cp1x:
|
|
190
|
-
cp1y:
|
|
191
|
-
cp2x:
|
|
192
|
-
cp2y:
|
|
187
|
+
x: e.x,
|
|
188
|
+
y: e.y,
|
|
189
|
+
cp1x: i.c1x,
|
|
190
|
+
cp1y: i.c1y,
|
|
191
|
+
cp2x: i.c2x,
|
|
192
|
+
cp2y: i.c2y
|
|
193
193
|
});
|
|
194
194
|
else {
|
|
195
|
-
const
|
|
196
|
-
let
|
|
197
|
-
|
|
198
|
-
let
|
|
199
|
-
|
|
195
|
+
const h = Math.hypot(e.x - n.x, e.y - n.y), a = Math.max(_, h * E);
|
|
196
|
+
let r, f;
|
|
197
|
+
c === 0 && t ? (r = n.x + t.snx * a, f = n.y + t.sny * a) : (r = n.x + (e.x - n.x) * 0.4, f = n.y);
|
|
198
|
+
let l, u;
|
|
199
|
+
c === y && t ? (l = e.x + t.tnx * a, u = e.y + t.tny * a) : (l = e.x - (e.x - n.x) * 0.4, u = e.y), s.push({
|
|
200
200
|
type: "C",
|
|
201
|
-
x:
|
|
202
|
-
y:
|
|
203
|
-
cp1x:
|
|
204
|
-
cp1y:
|
|
205
|
-
cp2x:
|
|
206
|
-
cp2y:
|
|
201
|
+
x: e.x,
|
|
202
|
+
y: e.y,
|
|
203
|
+
cp1x: r,
|
|
204
|
+
cp1y: f,
|
|
205
|
+
cp2x: l,
|
|
206
|
+
cp2y: u
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
return
|
|
210
|
+
return s;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
if (
|
|
214
|
-
x:
|
|
215
|
-
y:
|
|
212
|
+
function z(o) {
|
|
213
|
+
if (o.length < 2) return {
|
|
214
|
+
x: o[0]?.x ?? 0,
|
|
215
|
+
y: o[0]?.y ?? 0
|
|
216
216
|
};
|
|
217
|
-
const
|
|
217
|
+
const x = Math.floor(o.length / 2), t = o[x - 1], s = o[x];
|
|
218
218
|
return {
|
|
219
|
-
x: (t.x +
|
|
220
|
-
y: (t.y +
|
|
219
|
+
x: (t.x + s.x) / 2,
|
|
220
|
+
y: (t.y + s.y) / 2
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
x: t.position.x +
|
|
227
|
-
y: t.position.y +
|
|
223
|
+
function b(o, x, t) {
|
|
224
|
+
const s = t.data.rotation ?? 0;
|
|
225
|
+
if (s === 0) return {
|
|
226
|
+
x: t.position.x + o,
|
|
227
|
+
y: t.position.y + x
|
|
228
228
|
};
|
|
229
|
-
const
|
|
229
|
+
const y = s * Math.PI / 180, c = t.width / 2, n = t.height / 2, e = o - c, i = x - n, h = Math.cos(y), a = Math.sin(y);
|
|
230
230
|
return {
|
|
231
|
-
x: t.position.x +
|
|
232
|
-
y: t.position.y +
|
|
231
|
+
x: t.position.x + c + e * h - i * a,
|
|
232
|
+
y: t.position.y + n + e * a + i * h
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
const t = p[
|
|
237
|
-
if (
|
|
235
|
+
function H(o, x) {
|
|
236
|
+
const t = p[o?.side ?? "right"] ?? p.right, s = x.data.rotation ?? 0;
|
|
237
|
+
if (s === 0) return {
|
|
238
238
|
nx: t.dx,
|
|
239
239
|
ny: t.dy
|
|
240
240
|
};
|
|
241
|
-
const
|
|
241
|
+
const y = s * Math.PI / 180, c = Math.cos(y), n = Math.sin(y);
|
|
242
242
|
return {
|
|
243
|
-
nx: t.dx *
|
|
244
|
-
ny: t.dx *
|
|
243
|
+
nx: t.dx * c - t.dy * n,
|
|
244
|
+
ny: t.dx * n + t.dy * c
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
const t =
|
|
249
|
-
if (!t || !
|
|
250
|
-
const
|
|
251
|
-
let
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
|
|
247
|
+
function A(o, x) {
|
|
248
|
+
const t = x.get(o.source), s = x.get(o.target);
|
|
249
|
+
if (!t || !s) return null;
|
|
250
|
+
const y = M(t.width, t.height), c = M(s.width, s.height);
|
|
251
|
+
let n, e, i;
|
|
252
|
+
if (o.sourceHandle) {
|
|
253
|
+
i = y.find((d) => d.id === o.sourceHandle) ?? null;
|
|
254
|
+
const u = b(i ? i.x : t.width / 2, i ? i.y : t.height / 2, t);
|
|
255
|
+
n = u.x, e = u.y;
|
|
256
256
|
} else {
|
|
257
|
-
const
|
|
258
|
-
|
|
257
|
+
const u = L(t, s);
|
|
258
|
+
n = u.x, e = u.y, i = u.handleLike;
|
|
259
259
|
}
|
|
260
|
-
let
|
|
261
|
-
if (
|
|
262
|
-
|
|
263
|
-
const
|
|
264
|
-
|
|
260
|
+
let h, a, r;
|
|
261
|
+
if (o.targetHandle) {
|
|
262
|
+
r = c.find((d) => d.id === o.targetHandle) ?? null;
|
|
263
|
+
const u = b(r ? r.x : s.width / 2, r ? r.y : s.height / 2, s);
|
|
264
|
+
h = u.x, a = u.y;
|
|
265
265
|
} else {
|
|
266
|
-
const
|
|
267
|
-
|
|
266
|
+
const u = L(s, t);
|
|
267
|
+
h = u.x, a = u.y, r = u.handleLike;
|
|
268
268
|
}
|
|
269
|
-
const
|
|
269
|
+
const f = H(i, t), l = H(r, s);
|
|
270
270
|
return {
|
|
271
|
-
sx:
|
|
272
|
-
sy:
|
|
273
|
-
tx:
|
|
274
|
-
ty:
|
|
275
|
-
snx:
|
|
276
|
-
sny:
|
|
277
|
-
tnx:
|
|
278
|
-
tny:
|
|
271
|
+
sx: n,
|
|
272
|
+
sy: e,
|
|
273
|
+
tx: h,
|
|
274
|
+
ty: a,
|
|
275
|
+
snx: f.nx,
|
|
276
|
+
sny: f.ny,
|
|
277
|
+
tnx: l.nx,
|
|
278
|
+
tny: l.ny
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
const t =
|
|
283
|
-
let
|
|
284
|
-
return Math.abs(
|
|
285
|
-
x:
|
|
286
|
-
y:
|
|
281
|
+
function L(o, x) {
|
|
282
|
+
const t = o.position.x, s = o.position.y, y = o.width, c = o.height, n = t + y / 2, e = s + c / 2, i = x.position.x + x.width / 2, h = x.position.y + x.height / 2, a = i - n, r = h - e, f = Math.min(12, y / 2 - 1, c / 2 - 1);
|
|
283
|
+
let l, u, d;
|
|
284
|
+
return Math.abs(a) >= Math.abs(r) ? (l = a >= 0 ? "right" : "left", u = l === "right" ? t + y : t, d = Math.max(s + f, Math.min(s + c - f, h))) : (l = r >= 0 ? "bottom" : "top", d = l === "bottom" ? s + c : s, u = Math.max(t + f, Math.min(t + y - f, i))), (o.data.rotation ?? 0) !== 0 ? {
|
|
285
|
+
x: l === "right" ? t + y : l === "left" ? t : n,
|
|
286
|
+
y: l === "bottom" ? s + c : l === "top" ? s : e,
|
|
287
287
|
handleLike: {
|
|
288
|
-
id: `float_${
|
|
288
|
+
id: `float_${l}`,
|
|
289
289
|
x: 0,
|
|
290
290
|
y: 0,
|
|
291
|
-
side:
|
|
291
|
+
side: l
|
|
292
292
|
}
|
|
293
293
|
} : {
|
|
294
|
-
x:
|
|
295
|
-
y:
|
|
294
|
+
x: u,
|
|
295
|
+
y: d,
|
|
296
296
|
handleLike: {
|
|
297
|
-
id: `float_${
|
|
297
|
+
id: `float_${l}`,
|
|
298
298
|
x: 0,
|
|
299
299
|
y: 0,
|
|
300
|
-
side:
|
|
300
|
+
side: l
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
|
|
304
|
+
function I(o, x) {
|
|
305
|
+
const t = /* @__PURE__ */ new Map([
|
|
306
|
+
["0.25", String(0.3333333333333333)],
|
|
307
|
+
["0.5", String(0.5)],
|
|
308
|
+
["0.75", String(0.6666666666666666)]
|
|
309
|
+
]);
|
|
310
|
+
let s = !1;
|
|
311
|
+
const y = (n) => {
|
|
312
|
+
if (!n) return n;
|
|
313
|
+
const [e, i] = n.split("_"), h = t.get(i);
|
|
314
|
+
return !h || !e ? n : (s = !0, `${e}_${h}`);
|
|
315
|
+
}, c = o.map((n) => {
|
|
316
|
+
const e = y(n.sourceHandle), i = y(n.targetHandle);
|
|
317
|
+
return e === n.sourceHandle && i === n.targetHandle ? n : {
|
|
318
|
+
...n,
|
|
319
|
+
sourceHandle: e,
|
|
320
|
+
targetHandle: i
|
|
321
|
+
};
|
|
322
|
+
});
|
|
323
|
+
return s ? c : o;
|
|
306
324
|
}
|
|
307
|
-
function
|
|
325
|
+
function N(o, x = 8) {
|
|
308
326
|
const t = [];
|
|
309
|
-
let
|
|
310
|
-
for (const
|
|
327
|
+
let s = 0, y = 0;
|
|
328
|
+
for (const c of o) switch (c.type) {
|
|
311
329
|
case "M":
|
|
312
330
|
case "L":
|
|
313
|
-
|
|
314
|
-
x:
|
|
315
|
-
y
|
|
331
|
+
s = c.x, y = c.y, t.push({
|
|
332
|
+
x: s,
|
|
333
|
+
y
|
|
316
334
|
});
|
|
317
335
|
break;
|
|
318
336
|
case "Q": {
|
|
319
|
-
const
|
|
320
|
-
for (let
|
|
321
|
-
const
|
|
337
|
+
const n = c.cp1x, e = c.cp1y;
|
|
338
|
+
for (let i = 1; i <= x; i++) {
|
|
339
|
+
const h = i / x, a = 1 - h;
|
|
322
340
|
t.push({
|
|
323
|
-
x:
|
|
324
|
-
y:
|
|
341
|
+
x: a * a * s + 2 * a * h * n + h * h * c.x,
|
|
342
|
+
y: a * a * y + 2 * a * h * e + h * h * c.y
|
|
325
343
|
});
|
|
326
344
|
}
|
|
327
|
-
|
|
345
|
+
s = c.x, y = c.y;
|
|
328
346
|
break;
|
|
329
347
|
}
|
|
330
348
|
case "C": {
|
|
331
|
-
const
|
|
332
|
-
for (let
|
|
333
|
-
const
|
|
349
|
+
const n = c.cp1x, e = c.cp1y, i = c.cp2x, h = c.cp2y;
|
|
350
|
+
for (let a = 1; a <= x; a++) {
|
|
351
|
+
const r = a / x, f = 1 - r;
|
|
334
352
|
t.push({
|
|
335
|
-
x:
|
|
336
|
-
y:
|
|
353
|
+
x: f ** 3 * s + 3 * f ** 2 * r * n + 3 * f * r ** 2 * i + r ** 3 * c.x,
|
|
354
|
+
y: f ** 3 * y + 3 * f ** 2 * r * e + 3 * f * r ** 2 * h + r ** 3 * c.y
|
|
337
355
|
});
|
|
338
356
|
}
|
|
339
|
-
|
|
357
|
+
s = c.x, y = c.y;
|
|
340
358
|
break;
|
|
341
359
|
}
|
|
342
360
|
}
|
|
343
361
|
return t;
|
|
344
362
|
}
|
|
345
363
|
export {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
364
|
+
D as buildEdgePath,
|
|
365
|
+
z as getPathCenter,
|
|
366
|
+
N as linearizeSegments,
|
|
367
|
+
I as normalizeEdgeHandles,
|
|
368
|
+
A as resolveEdgeEndpoints
|
|
351
369
|
};
|
|
352
370
|
|
|
353
371
|
//# sourceMappingURL=edgePaths.js.map
|