dishui 0.0.59 → 0.0.60
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 +1092 -947
- 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,186 +1,188 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (
|
|
1
|
+
import { resolveThemeColor as O } from "../utils/themeColor.js";
|
|
2
|
+
import { drawDashedPath as L } from "../utils/dashedLine.js";
|
|
3
|
+
function g(i, t) {
|
|
4
|
+
if (!(!i || i === "solid")) {
|
|
5
|
+
if (i === "dynamic") return [t * 4, t * 3];
|
|
6
|
+
if (i === "dashed") return [t * 4, t * 2];
|
|
7
|
+
if (i === "dotted") return [t, t * 2];
|
|
6
8
|
}
|
|
7
9
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
for (let
|
|
11
|
-
x:
|
|
10
|
+
function _(i, t, e = 3) {
|
|
11
|
+
const r = [];
|
|
12
|
+
for (let n = 0; n <= i; n += e) r.push({
|
|
13
|
+
x: n,
|
|
12
14
|
y: 0
|
|
13
15
|
});
|
|
14
|
-
for (let
|
|
15
|
-
x: e,
|
|
16
|
-
y: i
|
|
17
|
-
});
|
|
18
|
-
for (let i = e - h; i >= 0; i -= h) n.push({
|
|
16
|
+
for (let n = e; n <= t; n += e) r.push({
|
|
19
17
|
x: i,
|
|
18
|
+
y: n
|
|
19
|
+
});
|
|
20
|
+
for (let n = i - e; n >= 0; n -= e) r.push({
|
|
21
|
+
x: n,
|
|
20
22
|
y: t
|
|
21
23
|
});
|
|
22
|
-
for (let
|
|
24
|
+
for (let n = t - e; n > 0; n -= e) r.push({
|
|
23
25
|
x: 0,
|
|
24
|
-
y:
|
|
26
|
+
y: n
|
|
25
27
|
});
|
|
26
|
-
return
|
|
28
|
+
return r.push({
|
|
27
29
|
x: 0,
|
|
28
30
|
y: 0
|
|
29
|
-
}),
|
|
31
|
+
}), r;
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
for (let
|
|
34
|
-
const p =
|
|
35
|
-
|
|
36
|
-
x:
|
|
37
|
-
y:
|
|
33
|
+
function b(i, t, e, r = 3) {
|
|
34
|
+
const n = [], a = Math.max(4, Math.ceil(Math.PI / 2 * e / r)), s = (h, c, l) => {
|
|
35
|
+
for (let u = 0; u <= a; u++) {
|
|
36
|
+
const p = l + Math.PI / 2 * (u / a);
|
|
37
|
+
n.push({
|
|
38
|
+
x: h + e * Math.cos(p),
|
|
39
|
+
y: c + e * Math.sin(p)
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
42
|
};
|
|
41
|
-
return
|
|
43
|
+
return s(i - e, e, -Math.PI / 2), s(i - e, t - e, 0), s(e, t - e, Math.PI / 2), s(e, e, Math.PI), n.length > 0 && n.push(n[0]), n;
|
|
42
44
|
}
|
|
43
|
-
function
|
|
45
|
+
function H(i, t, e, r, n = 60) {
|
|
44
46
|
const a = [];
|
|
45
|
-
for (let
|
|
46
|
-
const
|
|
47
|
+
for (let s = 0; s <= n; s++) {
|
|
48
|
+
const h = Math.PI * 2 * s / n;
|
|
47
49
|
a.push({
|
|
48
|
-
x:
|
|
49
|
-
y: t +
|
|
50
|
+
x: i + e * Math.cos(h),
|
|
51
|
+
y: t + r * Math.sin(h)
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
54
|
return a;
|
|
53
55
|
}
|
|
54
|
-
function
|
|
56
|
+
function R(i, t, e, r, n, a) {
|
|
55
57
|
if (t.length < 2) return;
|
|
56
|
-
const
|
|
57
|
-
for (let
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
let
|
|
62
|
-
const p = (
|
|
63
|
-
if (
|
|
64
|
-
if (
|
|
65
|
-
let
|
|
66
|
-
for (;
|
|
67
|
-
const
|
|
68
|
-
|
|
58
|
+
const s = [0];
|
|
59
|
+
for (let y = 1; y < t.length; y++) s.push(s[y - 1] + Math.hypot(t[y].x - t[y - 1].x, t[y].y - t[y - 1].y));
|
|
60
|
+
const h = s[s.length - 1];
|
|
61
|
+
if (h < 1) return;
|
|
62
|
+
const c = e[0] + e[1];
|
|
63
|
+
let l = -((r % c + c) % c), u = !0;
|
|
64
|
+
const p = (y) => {
|
|
65
|
+
if (y <= 0) return t[0];
|
|
66
|
+
if (y >= h) return t[t.length - 1];
|
|
67
|
+
let f = 0, o = s.length - 1;
|
|
68
|
+
for (; f < o - 1; ) {
|
|
69
|
+
const M = f + o >> 1;
|
|
70
|
+
s[M] <= y ? f = M : o = M;
|
|
69
71
|
}
|
|
70
|
-
const
|
|
72
|
+
const d = s[o] - s[f] > 0 ? (y - s[f]) / (s[o] - s[f]) : 0;
|
|
71
73
|
return {
|
|
72
|
-
x: t[
|
|
73
|
-
y: t[
|
|
74
|
+
x: t[f].x + (t[o].x - t[f].x) * d,
|
|
75
|
+
y: t[f].y + (t[o].y - t[f].y) * d
|
|
74
76
|
};
|
|
75
77
|
};
|
|
76
|
-
for (;
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
for (let
|
|
82
|
-
const v = p(
|
|
83
|
-
|
|
78
|
+
for (; l < h; ) {
|
|
79
|
+
const y = u ? e[0] : e[1], f = Math.max(l, 0), o = Math.min(l + y, h);
|
|
80
|
+
if (u && o > f) {
|
|
81
|
+
const d = p(f);
|
|
82
|
+
i.moveTo(d.x, d.y);
|
|
83
|
+
for (let w = f + 2; w < o; w += 2) {
|
|
84
|
+
const v = p(w);
|
|
85
|
+
i.lineTo(v.x, v.y);
|
|
84
86
|
}
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
+
const M = p(o);
|
|
88
|
+
i.lineTo(M.x, M.y);
|
|
87
89
|
}
|
|
88
|
-
|
|
90
|
+
l += y, u = !u;
|
|
89
91
|
}
|
|
90
|
-
|
|
91
|
-
color:
|
|
92
|
+
i.stroke({
|
|
93
|
+
color: n,
|
|
92
94
|
width: a,
|
|
93
95
|
cap: "round"
|
|
94
96
|
});
|
|
95
97
|
}
|
|
96
|
-
function
|
|
97
|
-
t.fill && t.fill !== "transparent" &&
|
|
98
|
+
function x(i, t) {
|
|
99
|
+
t.fill && t.fill !== "transparent" && i.fill({ color: t.fill }), t.borderStyle !== "none" && t.stroke && t.stroke !== "transparent" && t.strokeWidth > 0 && (g(t.borderStyle, t.strokeWidth) || i.stroke({
|
|
98
100
|
color: t.stroke,
|
|
99
101
|
width: t.strokeWidth
|
|
100
102
|
}));
|
|
101
103
|
}
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
!
|
|
104
|
+
function m(i, t, e) {
|
|
105
|
+
const r = g(t.borderStyle, t.strokeWidth);
|
|
106
|
+
!r || !t.stroke || t.stroke === "transparent" || t.strokeWidth <= 0 || R(i, e, r, t.borderStyle === "dynamic" ? t.dashOffset ?? 0 : 0, t.stroke, t.strokeWidth);
|
|
105
107
|
}
|
|
106
|
-
function
|
|
108
|
+
function rt(i, t, e) {
|
|
107
109
|
if (t.borderStyle === "none" || !t.stroke || t.stroke === "transparent" || t.strokeWidth <= 0) return;
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
110
|
+
const r = e ?? Math.min(12, t.width * 0.1, t.height * 0.1), n = g(t.borderStyle, t.strokeWidth);
|
|
111
|
+
if (n) {
|
|
110
112
|
const a = t.borderStyle === "dynamic" ? t.dashOffset ?? 0 : 0;
|
|
111
|
-
|
|
112
|
-
} else
|
|
113
|
+
R(i, b(t.width, t.height, r), n, a, t.stroke, t.strokeWidth);
|
|
114
|
+
} else i.roundRect(0, 0, t.width, t.height, r).stroke({
|
|
113
115
|
color: t.stroke,
|
|
114
116
|
width: t.strokeWidth
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
|
-
function
|
|
118
|
-
return [...
|
|
119
|
+
function T(i) {
|
|
120
|
+
return [...i, i[0]];
|
|
119
121
|
}
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
+
function W(i, t) {
|
|
123
|
+
i.rect(0, 0, t.width, t.height), x(i, t), m(i, t, _(t.width, t.height));
|
|
122
124
|
}
|
|
123
|
-
function
|
|
124
|
-
const
|
|
125
|
-
|
|
125
|
+
function G(i, t) {
|
|
126
|
+
const e = Math.min(12, t.width * 0.1, t.height * 0.1);
|
|
127
|
+
i.roundRect(0, 0, t.width, t.height, e), x(i, t), m(i, t, b(t.width, t.height, e));
|
|
126
128
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
+
function N(i, t) {
|
|
130
|
+
i.ellipse(t.width / 2, t.height / 2, t.width / 2, t.height / 2), x(i, t), m(i, t, H(t.width / 2, t.height / 2, t.width / 2, t.height / 2));
|
|
129
131
|
}
|
|
130
|
-
function
|
|
131
|
-
const
|
|
132
|
+
function q(i, t) {
|
|
133
|
+
const e = t.width / 2, r = t.height / 2, n = [
|
|
132
134
|
{
|
|
133
|
-
x:
|
|
135
|
+
x: e,
|
|
134
136
|
y: 0
|
|
135
137
|
},
|
|
136
138
|
{
|
|
137
139
|
x: t.width,
|
|
138
|
-
y:
|
|
140
|
+
y: r
|
|
139
141
|
},
|
|
140
142
|
{
|
|
141
|
-
x:
|
|
143
|
+
x: e,
|
|
142
144
|
y: t.height
|
|
143
145
|
},
|
|
144
146
|
{
|
|
145
147
|
x: 0,
|
|
146
|
-
y:
|
|
148
|
+
y: r
|
|
147
149
|
}
|
|
148
150
|
];
|
|
149
|
-
|
|
151
|
+
i.moveTo(e, 0).lineTo(t.width, r).lineTo(e, t.height).lineTo(0, r).closePath(), x(i, t), m(i, t, T(n));
|
|
150
152
|
}
|
|
151
|
-
function
|
|
152
|
-
const
|
|
153
|
-
|
|
153
|
+
function A(i, t) {
|
|
154
|
+
const e = t.width, r = t.height, n = r * 0.15;
|
|
155
|
+
i.moveTo(0, 0).lineTo(e, 0).lineTo(e, r - n).bezierCurveTo(e * 0.75, r - n * 2, e * 0.25, r, 0, r - n).closePath(), x(i, t);
|
|
154
156
|
const a = [
|
|
155
157
|
{
|
|
156
158
|
x: 0,
|
|
157
159
|
y: 0
|
|
158
160
|
},
|
|
159
161
|
{
|
|
160
|
-
x:
|
|
162
|
+
x: e,
|
|
161
163
|
y: 0
|
|
162
164
|
},
|
|
163
165
|
{
|
|
164
|
-
x:
|
|
165
|
-
y:
|
|
166
|
+
x: e,
|
|
167
|
+
y: r - n
|
|
166
168
|
}
|
|
167
|
-
],
|
|
168
|
-
for (let
|
|
169
|
-
const
|
|
169
|
+
], s = 20;
|
|
170
|
+
for (let h = 1; h <= s; h++) {
|
|
171
|
+
const c = h / s, l = 1 - c;
|
|
170
172
|
a.push({
|
|
171
|
-
x:
|
|
172
|
-
y:
|
|
173
|
+
x: l * l * l * e + 3 * l * l * c * (e * 0.75) + 3 * l * c * c * (e * 0.25),
|
|
174
|
+
y: l * l * l * (r - n) + 3 * l * l * c * (r - n * 2) + 3 * l * c * c * r + c * c * c * (r - n)
|
|
173
175
|
});
|
|
174
176
|
}
|
|
175
177
|
a.push({
|
|
176
178
|
x: 0,
|
|
177
179
|
y: 0
|
|
178
|
-
}),
|
|
180
|
+
}), m(i, t, a);
|
|
179
181
|
}
|
|
180
|
-
function
|
|
181
|
-
const
|
|
182
|
+
function F(i, t) {
|
|
183
|
+
const e = t.width * 0.2, r = [
|
|
182
184
|
{
|
|
183
|
-
x:
|
|
185
|
+
x: e,
|
|
184
186
|
y: 0
|
|
185
187
|
},
|
|
186
188
|
{
|
|
@@ -188,7 +190,7 @@ function z(e, t) {
|
|
|
188
190
|
y: 0
|
|
189
191
|
},
|
|
190
192
|
{
|
|
191
|
-
x: t.width -
|
|
193
|
+
x: t.width - e,
|
|
192
194
|
y: t.height
|
|
193
195
|
},
|
|
194
196
|
{
|
|
@@ -196,10 +198,10 @@ function z(e, t) {
|
|
|
196
198
|
y: t.height
|
|
197
199
|
}
|
|
198
200
|
];
|
|
199
|
-
|
|
201
|
+
i.moveTo(e, 0).lineTo(t.width, 0).lineTo(t.width - e, t.height).lineTo(0, t.height).closePath(), x(i, t), m(i, t, T(r));
|
|
200
202
|
}
|
|
201
|
-
function
|
|
202
|
-
const
|
|
203
|
+
function K(i, t) {
|
|
204
|
+
const e = [
|
|
203
205
|
{
|
|
204
206
|
x: t.width / 2,
|
|
205
207
|
y: 0
|
|
@@ -213,16 +215,16 @@ function E(e, t) {
|
|
|
213
215
|
y: t.height
|
|
214
216
|
}
|
|
215
217
|
];
|
|
216
|
-
|
|
218
|
+
i.moveTo(t.width / 2, 0).lineTo(t.width, t.height).lineTo(0, t.height).closePath(), x(i, t), m(i, t, T(e));
|
|
217
219
|
}
|
|
218
|
-
function
|
|
219
|
-
const
|
|
220
|
+
function Q(i, t) {
|
|
221
|
+
const e = t.width * 0.15, r = [
|
|
220
222
|
{
|
|
221
|
-
x:
|
|
223
|
+
x: e,
|
|
222
224
|
y: 0
|
|
223
225
|
},
|
|
224
226
|
{
|
|
225
|
-
x: t.width -
|
|
227
|
+
x: t.width - e,
|
|
226
228
|
y: 0
|
|
227
229
|
},
|
|
228
230
|
{
|
|
@@ -234,55 +236,55 @@ function L(e, t) {
|
|
|
234
236
|
y: t.height
|
|
235
237
|
}
|
|
236
238
|
];
|
|
237
|
-
|
|
239
|
+
i.moveTo(e, 0).lineTo(t.width - e, 0).lineTo(t.width, t.height).lineTo(0, t.height).closePath(), x(i, t), m(i, t, T(r));
|
|
238
240
|
}
|
|
239
|
-
function
|
|
240
|
-
const
|
|
241
|
-
for (let
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
x:
|
|
245
|
-
y: t +
|
|
241
|
+
function B(i, t, e, r, n, a) {
|
|
242
|
+
const s = [];
|
|
243
|
+
for (let h = 0; h < e; h++) {
|
|
244
|
+
const c = Math.PI * 2 * h / e + a;
|
|
245
|
+
s.push({
|
|
246
|
+
x: i + r * Math.cos(c),
|
|
247
|
+
y: t + n * Math.sin(c)
|
|
246
248
|
});
|
|
247
249
|
}
|
|
248
|
-
return
|
|
250
|
+
return s;
|
|
249
251
|
}
|
|
250
|
-
function
|
|
251
|
-
const
|
|
252
|
-
for (let
|
|
253
|
-
|
|
252
|
+
function Y(i, t) {
|
|
253
|
+
const e = t.width / 2, r = t.height / 2, n = Math.min(e, r), a = B(e, r, 5, n, n, -Math.PI / 2);
|
|
254
|
+
for (let s = 0; s < a.length; s++) s === 0 ? i.moveTo(a[s].x, a[s].y) : i.lineTo(a[s].x, a[s].y);
|
|
255
|
+
i.closePath(), x(i, t), m(i, t, T(a));
|
|
254
256
|
}
|
|
255
|
-
function
|
|
256
|
-
const
|
|
257
|
-
for (let a = 0; a <
|
|
258
|
-
|
|
257
|
+
function Z(i, t) {
|
|
258
|
+
const e = t.width / 2, r = t.height / 2, n = B(e, r, 6, e, r, -Math.PI / 6);
|
|
259
|
+
for (let a = 0; a < n.length; a++) a === 0 ? i.moveTo(n[a].x, n[a].y) : i.lineTo(n[a].x, n[a].y);
|
|
260
|
+
i.closePath(), x(i, t), m(i, t, T(n));
|
|
259
261
|
}
|
|
260
|
-
function
|
|
261
|
-
const
|
|
262
|
-
for (let
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
x:
|
|
266
|
-
y:
|
|
262
|
+
function j(i, t) {
|
|
263
|
+
const e = t.width / 2, r = t.height / 2, n = Math.min(e, r), a = n * 0.4, s = 5, h = [];
|
|
264
|
+
for (let c = 0; c < s * 2; c++) {
|
|
265
|
+
const l = Math.PI * c / s - Math.PI / 2, u = c % 2 === 0 ? n : a;
|
|
266
|
+
h.push({
|
|
267
|
+
x: e + u * Math.cos(l),
|
|
268
|
+
y: r + u * Math.sin(l)
|
|
267
269
|
});
|
|
268
270
|
}
|
|
269
|
-
for (let
|
|
270
|
-
|
|
271
|
+
for (let c = 0; c < h.length; c++) c === 0 ? i.moveTo(h[c].x, h[c].y) : i.lineTo(h[c].x, h[c].y);
|
|
272
|
+
i.closePath(), x(i, t), m(i, t, T(h));
|
|
271
273
|
}
|
|
272
|
-
function
|
|
273
|
-
const
|
|
274
|
-
for (let
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
x:
|
|
278
|
-
y:
|
|
274
|
+
function J(i, t) {
|
|
275
|
+
const e = t.width / 2, r = t.height / 2, n = Math.min(e, r), a = n * 0.55, s = [];
|
|
276
|
+
for (let h = 0; h < 12; h++) {
|
|
277
|
+
const c = Math.PI * h / 6 - Math.PI / 2, l = h % 2 === 0 ? n : a;
|
|
278
|
+
s.push({
|
|
279
|
+
x: e + l * Math.cos(c),
|
|
280
|
+
y: r + l * Math.sin(c)
|
|
279
281
|
});
|
|
280
282
|
}
|
|
281
|
-
for (let
|
|
282
|
-
|
|
283
|
+
for (let h = 0; h < s.length; h++) h === 0 ? i.moveTo(s[h].x, s[h].y) : i.lineTo(s[h].x, s[h].y);
|
|
284
|
+
i.closePath(), x(i, t), m(i, t, T(s));
|
|
283
285
|
}
|
|
284
|
-
function
|
|
285
|
-
const
|
|
286
|
+
function U(i, t) {
|
|
287
|
+
const e = [
|
|
286
288
|
{
|
|
287
289
|
x: 0,
|
|
288
290
|
y: 0
|
|
@@ -296,10 +298,10 @@ function q(e, t) {
|
|
|
296
298
|
y: t.height
|
|
297
299
|
}
|
|
298
300
|
];
|
|
299
|
-
|
|
301
|
+
i.moveTo(0, 0).lineTo(t.width, t.height).lineTo(0, t.height).closePath(), x(i, t), m(i, t, T(e));
|
|
300
302
|
}
|
|
301
|
-
function
|
|
302
|
-
const
|
|
303
|
+
function V(i, t) {
|
|
304
|
+
const e = Math.min(t.width, t.height) * 0.4, r = [
|
|
303
305
|
{
|
|
304
306
|
x: 0,
|
|
305
307
|
y: 0
|
|
@@ -310,14 +312,14 @@ function A(e, t) {
|
|
|
310
312
|
},
|
|
311
313
|
{
|
|
312
314
|
x: t.width,
|
|
313
|
-
y:
|
|
315
|
+
y: e
|
|
314
316
|
},
|
|
315
317
|
{
|
|
316
|
-
x:
|
|
317
|
-
y:
|
|
318
|
+
x: e,
|
|
319
|
+
y: e
|
|
318
320
|
},
|
|
319
321
|
{
|
|
320
|
-
x:
|
|
322
|
+
x: e,
|
|
321
323
|
y: t.height
|
|
322
324
|
},
|
|
323
325
|
{
|
|
@@ -325,65 +327,298 @@ function A(e, t) {
|
|
|
325
327
|
y: t.height
|
|
326
328
|
}
|
|
327
329
|
];
|
|
328
|
-
|
|
330
|
+
i.moveTo(0, 0).lineTo(t.width, 0).lineTo(t.width, e).lineTo(e, e).lineTo(e, t.height).lineTo(0, t.height).closePath(), x(i, t), m(i, t, T(r));
|
|
329
331
|
}
|
|
330
|
-
function
|
|
331
|
-
const
|
|
332
|
-
|
|
332
|
+
function C(i, t) {
|
|
333
|
+
const e = Math.min(6, t.width * 0.04, t.height * 0.04);
|
|
334
|
+
i.roundRect(0, 0, t.width, t.height, e), t.fill && t.fill !== "transparent" && i.fill({
|
|
333
335
|
color: t.fill,
|
|
334
336
|
alpha: 0.08
|
|
335
337
|
});
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
const a =
|
|
341
|
-
|
|
342
|
-
} else
|
|
338
|
+
const r = t.borderStyle ?? "dashed";
|
|
339
|
+
if (r !== "none" && t.stroke && t.stroke !== "transparent" && t.strokeWidth > 0) {
|
|
340
|
+
const n = g(r, t.strokeWidth);
|
|
341
|
+
if (n) {
|
|
342
|
+
const a = r === "dynamic" ? t.dashOffset ?? 0 : 0;
|
|
343
|
+
R(i, b(t.width, t.height, e), n, a, t.stroke, t.strokeWidth);
|
|
344
|
+
} else i.stroke({
|
|
343
345
|
color: t.stroke,
|
|
344
346
|
width: t.strokeWidth
|
|
345
347
|
});
|
|
346
348
|
}
|
|
347
349
|
}
|
|
348
|
-
var
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
350
|
+
var X = C, z = [
|
|
351
|
+
"top",
|
|
352
|
+
"right",
|
|
353
|
+
"bottom",
|
|
354
|
+
"left"
|
|
355
|
+
], $ = /* @__PURE__ */ new Set([
|
|
356
|
+
"shapeRect",
|
|
357
|
+
"shapeRoundRect",
|
|
358
|
+
"shapeEllipse",
|
|
359
|
+
"shapeDiamond",
|
|
360
|
+
"shapeDocument",
|
|
361
|
+
"shapeParallelogram",
|
|
362
|
+
"shapeTrapezoid",
|
|
363
|
+
"mediaNode",
|
|
364
|
+
"flowGroup",
|
|
365
|
+
"geometryGroup"
|
|
366
|
+
]);
|
|
367
|
+
function ht(i, t) {
|
|
368
|
+
if (t !== void 0 && !$.has(t)) return !1;
|
|
369
|
+
const e = i.borderSides;
|
|
370
|
+
return e ? z.some((r) => {
|
|
371
|
+
const n = e[r];
|
|
372
|
+
return !!n && (n.visible === !1 || n.color !== void 0 || n.width !== void 0);
|
|
373
|
+
}) : !1;
|
|
374
|
+
}
|
|
375
|
+
function tt(i, t, e) {
|
|
376
|
+
switch (i) {
|
|
377
|
+
case "shapeRoundRect":
|
|
378
|
+
return Math.min(12, t * 0.1, e * 0.1);
|
|
379
|
+
case "mediaNode":
|
|
380
|
+
return 6;
|
|
381
|
+
case "flowGroup":
|
|
382
|
+
case "geometryGroup":
|
|
383
|
+
return Math.min(6, t * 0.04, e * 0.04);
|
|
384
|
+
default:
|
|
385
|
+
return 0;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
var k = 0.5522847498;
|
|
389
|
+
function et(i, t, e, r) {
|
|
390
|
+
const n = [], a = (o, d) => n.push({
|
|
391
|
+
type: "L",
|
|
392
|
+
x: o,
|
|
393
|
+
y: d
|
|
394
|
+
}), s = (o, d, M, w, v, P) => n.push({
|
|
395
|
+
type: "C",
|
|
396
|
+
cp1x: o,
|
|
397
|
+
cp1y: d,
|
|
398
|
+
cp2x: M,
|
|
399
|
+
cp2y: w,
|
|
400
|
+
x: v,
|
|
401
|
+
y: P
|
|
402
|
+
}), h = tt(i, t, e);
|
|
403
|
+
if (h >= 0.5) {
|
|
404
|
+
const o = k * h;
|
|
405
|
+
switch (r) {
|
|
406
|
+
case "top":
|
|
407
|
+
n.push({
|
|
408
|
+
type: "M",
|
|
409
|
+
x: 0,
|
|
410
|
+
y: h
|
|
411
|
+
}), s(0, h - o, h - o, 0, h, 0), a(t - h, 0);
|
|
412
|
+
break;
|
|
413
|
+
case "right":
|
|
414
|
+
n.push({
|
|
415
|
+
type: "M",
|
|
416
|
+
x: t - h,
|
|
417
|
+
y: 0
|
|
418
|
+
}), s(t - h + o, 0, t, h - o, t, h), a(t, e - h);
|
|
419
|
+
break;
|
|
420
|
+
case "bottom":
|
|
421
|
+
n.push({
|
|
422
|
+
type: "M",
|
|
423
|
+
x: t,
|
|
424
|
+
y: e - h
|
|
425
|
+
}), s(t, e - h + o, t - h + o, e, t - h, e), a(h, e);
|
|
426
|
+
break;
|
|
427
|
+
case "left":
|
|
428
|
+
n.push({
|
|
429
|
+
type: "M",
|
|
430
|
+
x: h,
|
|
431
|
+
y: e
|
|
432
|
+
}), s(h - o, e, 0, e - h + o, 0, e - h), a(0, h);
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
return n;
|
|
436
|
+
}
|
|
437
|
+
if (i === "shapeEllipse") {
|
|
438
|
+
const o = t / 2, d = e / 2, M = t / 2, w = e / 2, [v, P] = {
|
|
439
|
+
top: [Math.PI * 1.25, Math.PI * 1.75],
|
|
440
|
+
right: [Math.PI * 1.75, Math.PI * 2.25],
|
|
441
|
+
bottom: [Math.PI * 0.25, Math.PI * 0.75],
|
|
442
|
+
left: [Math.PI * 0.75, Math.PI * 1.25]
|
|
443
|
+
}[r], I = o + M * Math.cos(v), S = d + w * Math.sin(v), D = o + M * Math.cos(P), E = d + w * Math.sin(P);
|
|
444
|
+
return n.push({
|
|
445
|
+
type: "M",
|
|
446
|
+
x: I,
|
|
447
|
+
y: S
|
|
448
|
+
}), s(I - k * M * Math.sin(v), S + k * w * Math.cos(v), D + k * M * Math.sin(P), E - k * w * Math.cos(P), D, E), n;
|
|
449
|
+
}
|
|
450
|
+
if (i === "shapeDocument") {
|
|
451
|
+
const o = e * 0.15;
|
|
452
|
+
return r === "top" ? (n.push({
|
|
453
|
+
type: "M",
|
|
454
|
+
x: 0,
|
|
455
|
+
y: 0
|
|
456
|
+
}), a(t, 0)) : r === "right" ? (n.push({
|
|
457
|
+
type: "M",
|
|
458
|
+
x: t,
|
|
459
|
+
y: 0
|
|
460
|
+
}), a(t, e - o)) : r === "bottom" ? (n.push({
|
|
461
|
+
type: "M",
|
|
462
|
+
x: t,
|
|
463
|
+
y: e - o
|
|
464
|
+
}), s(t * 0.75, e - o * 2, t * 0.25, e, 0, e - o)) : (n.push({
|
|
465
|
+
type: "M",
|
|
466
|
+
x: 0,
|
|
467
|
+
y: e - o
|
|
468
|
+
}), a(0, 0)), n;
|
|
469
|
+
}
|
|
470
|
+
let c, l, u, p;
|
|
471
|
+
if (i === "shapeDiamond") {
|
|
472
|
+
const o = t / 2, d = e / 2;
|
|
473
|
+
c = {
|
|
474
|
+
x: o,
|
|
475
|
+
y: 0
|
|
476
|
+
}, l = {
|
|
477
|
+
x: t,
|
|
478
|
+
y: d
|
|
479
|
+
}, u = {
|
|
480
|
+
x: o,
|
|
481
|
+
y: e
|
|
482
|
+
}, p = {
|
|
483
|
+
x: 0,
|
|
484
|
+
y: d
|
|
485
|
+
};
|
|
486
|
+
} else if (i === "shapeParallelogram") {
|
|
487
|
+
const o = t * 0.2;
|
|
488
|
+
c = {
|
|
489
|
+
x: o,
|
|
490
|
+
y: 0
|
|
491
|
+
}, l = {
|
|
492
|
+
x: t,
|
|
493
|
+
y: 0
|
|
494
|
+
}, u = {
|
|
495
|
+
x: t - o,
|
|
496
|
+
y: e
|
|
497
|
+
}, p = {
|
|
498
|
+
x: 0,
|
|
499
|
+
y: e
|
|
500
|
+
};
|
|
501
|
+
} else if (i === "shapeTrapezoid") {
|
|
502
|
+
const o = t * 0.15;
|
|
503
|
+
c = {
|
|
504
|
+
x: o,
|
|
505
|
+
y: 0
|
|
506
|
+
}, l = {
|
|
507
|
+
x: t - o,
|
|
508
|
+
y: 0
|
|
509
|
+
}, u = {
|
|
510
|
+
x: t,
|
|
511
|
+
y: e
|
|
512
|
+
}, p = {
|
|
513
|
+
x: 0,
|
|
514
|
+
y: e
|
|
515
|
+
};
|
|
516
|
+
} else
|
|
517
|
+
c = {
|
|
518
|
+
x: 0,
|
|
519
|
+
y: 0
|
|
520
|
+
}, l = {
|
|
521
|
+
x: t,
|
|
522
|
+
y: 0
|
|
523
|
+
}, u = {
|
|
524
|
+
x: t,
|
|
525
|
+
y: e
|
|
526
|
+
}, p = {
|
|
527
|
+
x: 0,
|
|
528
|
+
y: e
|
|
529
|
+
};
|
|
530
|
+
const [y, f] = {
|
|
531
|
+
top: [c, l],
|
|
532
|
+
right: [l, u],
|
|
533
|
+
bottom: [u, p],
|
|
534
|
+
left: [p, c]
|
|
535
|
+
}[r];
|
|
536
|
+
return n.push({
|
|
537
|
+
type: "M",
|
|
538
|
+
x: y.x,
|
|
539
|
+
y: y.y
|
|
540
|
+
}), a(f.x, f.y), n;
|
|
541
|
+
}
|
|
542
|
+
function st(i, t, e, r, n, a, s, h, c) {
|
|
543
|
+
if (h !== "none")
|
|
544
|
+
for (const l of z) {
|
|
545
|
+
const u = n?.[l];
|
|
546
|
+
if (u?.visible === !1) continue;
|
|
547
|
+
const p = O(u?.color, a) || a, y = u?.width ?? s;
|
|
548
|
+
if (!p || p === "transparent" || !(y > 0)) continue;
|
|
549
|
+
const f = et(t, e, r, l), o = g(h, y);
|
|
550
|
+
if (o)
|
|
551
|
+
L(i, f, o, h === "dynamic" ? c : 0), i.stroke({
|
|
552
|
+
color: p,
|
|
553
|
+
width: y,
|
|
554
|
+
cap: "round"
|
|
555
|
+
});
|
|
556
|
+
else {
|
|
557
|
+
for (const d of f) switch (d.type) {
|
|
558
|
+
case "M":
|
|
559
|
+
i.moveTo(d.x, d.y);
|
|
560
|
+
break;
|
|
561
|
+
case "L":
|
|
562
|
+
i.lineTo(d.x, d.y);
|
|
563
|
+
break;
|
|
564
|
+
case "C":
|
|
565
|
+
i.bezierCurveTo(d.cp1x, d.cp1y, d.cp2x, d.cp2y, d.x, d.y);
|
|
566
|
+
break;
|
|
567
|
+
case "Q":
|
|
568
|
+
i.quadraticCurveTo(d.cp1x, d.cp1y, d.x, d.y);
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
i.stroke({
|
|
572
|
+
color: p,
|
|
573
|
+
width: y
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
var at = {
|
|
579
|
+
shapeRect: W,
|
|
580
|
+
shapeRoundRect: G,
|
|
581
|
+
shapeEllipse: N,
|
|
582
|
+
shapeDiamond: q,
|
|
583
|
+
shapeDocument: A,
|
|
584
|
+
shapeParallelogram: F,
|
|
585
|
+
shapeTriangle: K,
|
|
586
|
+
shapeTrapezoid: Q,
|
|
587
|
+
shapePentagon: Y,
|
|
588
|
+
shapeHexagon: Z,
|
|
589
|
+
shapeStar: j,
|
|
590
|
+
shapeHexagram: J,
|
|
591
|
+
shapeRightTriangle: U,
|
|
592
|
+
shapeCorner: V,
|
|
593
|
+
textLabel: W,
|
|
594
|
+
flowGroup: C,
|
|
595
|
+
geometryGroup: X,
|
|
596
|
+
shapeSvg: G
|
|
367
597
|
};
|
|
368
598
|
export {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
599
|
+
z as BORDER_SIDE_NAMES,
|
|
600
|
+
$ as BORDER_SIDE_TYPES,
|
|
601
|
+
et as buildBorderSideSegments,
|
|
602
|
+
st as drawBorderSides,
|
|
603
|
+
V as drawCorner,
|
|
604
|
+
q as drawDiamond,
|
|
605
|
+
A as drawDocument,
|
|
606
|
+
N as drawEllipse,
|
|
607
|
+
C as drawFlowGroup,
|
|
608
|
+
X as drawGeometryGroup,
|
|
609
|
+
Z as drawHexagon,
|
|
610
|
+
J as drawHexagram,
|
|
611
|
+
F as drawParallelogram,
|
|
612
|
+
Y as drawPentagon,
|
|
613
|
+
W as drawRect,
|
|
614
|
+
U as drawRightTriangle,
|
|
615
|
+
G as drawRoundRect,
|
|
616
|
+
rt as drawRoundRectBorder,
|
|
617
|
+
j as drawStar,
|
|
618
|
+
Q as drawTrapezoid,
|
|
619
|
+
K as drawTriangle,
|
|
620
|
+
ht as hasBorderSideOverrides,
|
|
621
|
+
at as shapeDrawers
|
|
387
622
|
};
|
|
388
623
|
|
|
389
624
|
//# sourceMappingURL=shapes.js.map
|