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