jvs-draw 1.0.2 → 1.0.3
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/jvs-draw.css +1 -1
- package/dist/jvs-draw.es.js +424 -422
- package/dist/jvs-draw.umd.js +4 -4
- package/package.json +1 -1
package/dist/jvs-draw.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as Qe, computed as U, ref as J, watch as It, resolveComponent as it, createElementBlock as j, openBlock as V, normalizeStyle as Ke, createElementVNode as m, normalizeClass as Xe, Fragment as We, renderList as ut, createBlock as Tt, withCtx as Ae, createCommentVNode as we, toDisplayString as nt, unref as ze, createVNode as ie, nextTick as Rt, withModifiers as Mt, onMounted as nn, onUnmounted as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import { ElMessageBox as
|
|
4
|
-
const
|
|
1
|
+
import { markRaw as On, defineComponent as Qe, computed as U, ref as J, watch as It, resolveComponent as it, createElementBlock as j, openBlock as V, normalizeStyle as Ke, createElementVNode as m, normalizeClass as Xe, Fragment as We, renderList as ut, createBlock as Tt, withCtx as Ae, createCommentVNode as we, toDisplayString as nt, unref as ze, createVNode as ie, nextTick as Rt, withModifiers as Mt, onMounted as nn, onUnmounted as bs, withDirectives as js, vModelText as Hs, mergeModels as Ws, useModel as Us, createStaticVNode as qs } from "vue";
|
|
2
|
+
import { defineStore as Gs } from "pinia";
|
|
3
|
+
import { ElMessageBox as Ns } from "element-plus";
|
|
4
|
+
const Ks = (i, t, e, n, s) => [
|
|
5
5
|
(i - e) * Math.cos(s) - (t - n) * Math.sin(s) + e,
|
|
6
6
|
(i - e) * Math.sin(s) + (t - n) * Math.cos(s) + n
|
|
7
|
-
], me = (i, t, e) =>
|
|
7
|
+
], me = (i, t, e) => Ks(i[0], i[1], t[0], t[1], e), Js = (i) => {
|
|
8
8
|
const t = i.x + i.width / 2, e = i.y + i.height / 2, s = [
|
|
9
9
|
[i.x, i.y],
|
|
10
10
|
[i.x + i.width, i.y],
|
|
@@ -17,10 +17,10 @@ const Ns = (i, t, e, n, s) => [
|
|
|
17
17
|
maxX: Math.max(...a),
|
|
18
18
|
maxY: Math.max(...o)
|
|
19
19
|
};
|
|
20
|
-
},
|
|
20
|
+
}, as = (i, t, e, n) => {
|
|
21
21
|
const s = e - i, a = n - t;
|
|
22
22
|
return Math.hypot(s, a);
|
|
23
|
-
},
|
|
23
|
+
}, Zs = (i, t) => {
|
|
24
24
|
if (i.length < 3)
|
|
25
25
|
return i.length === 2 ? `M ${i[0][0]} ${i[0][1]} L ${i[1][0]} ${i[1][1]}` : "";
|
|
26
26
|
let e = `M ${i[0][0]} ${i[0][1]}`;
|
|
@@ -31,7 +31,7 @@ const Ns = (i, t, e, n, s) => [
|
|
|
31
31
|
const n = i[i.length - 1];
|
|
32
32
|
return e += ` L ${n[0]} ${n[1]}`, e;
|
|
33
33
|
}, _t = (i, t) => {
|
|
34
|
-
if (i.length < 3) return
|
|
34
|
+
if (i.length < 3) return Zs(i, t);
|
|
35
35
|
let e = "";
|
|
36
36
|
const n = i.length;
|
|
37
37
|
for (let s = 0; s < n; s++) {
|
|
@@ -53,7 +53,7 @@ const Ns = (i, t, e, n, s) => [
|
|
|
53
53
|
}, At = (i, t, e, n, s, a, o) => {
|
|
54
54
|
const [l, r] = me([i, t], [e + s / 2, n + a / 2], -o), c = e + s / 2, f = n + a / 2, k = Math.abs(l - c) / (s / 2), d = Math.abs(r - f) / (a / 2);
|
|
55
55
|
return k + d <= 1;
|
|
56
|
-
},
|
|
56
|
+
}, Qs = (i, t, e, n, s, a, o, l = 5) => {
|
|
57
57
|
const [r, c] = me([i, t], [e + s / 2, n + a / 2], -o), f = e + s / 2, k = n + a / 2, d = s / 2, v = a / 2, h = Math.abs(r - f), M = Math.abs(c - k), I = h / d + M / v, T = l / Math.max(d, v);
|
|
58
58
|
return Math.abs(I - 1) <= T;
|
|
59
59
|
}, Dt = (i, t, e, n, s, a) => {
|
|
@@ -63,16 +63,16 @@ const Ns = (i, t, e, n, s) => [
|
|
|
63
63
|
f > t != d > t && i < (k - c) * (t - f) / (d - f) + c && (o = !o);
|
|
64
64
|
}
|
|
65
65
|
return o;
|
|
66
|
-
},
|
|
66
|
+
}, qn = (i, t, e) => {
|
|
67
67
|
const n = (e[0] - t[0]) ** 2 + (e[1] - t[1]) ** 2;
|
|
68
68
|
if (n === 0) return (i[0] - t[0]) ** 2 + (i[1] - t[1]) ** 2;
|
|
69
69
|
let s = ((i[0] - t[0]) * (e[0] - t[0]) + (i[1] - t[1]) * (e[1] - t[1])) / n;
|
|
70
70
|
return s = Math.max(0, Math.min(1, s)), (i[0] - (t[0] + s * (e[0] - t[0]))) ** 2 + (i[1] - (t[1] + s * (e[1] - t[1]))) ** 2;
|
|
71
|
-
},
|
|
71
|
+
}, ls = (i, t, e, n, s, a, o = 5) => {
|
|
72
72
|
const l = o * o;
|
|
73
73
|
for (let r = 0; r < e.length; r++) {
|
|
74
74
|
const c = (r + 1) % e.length, f = [e[r][0] + n, e[r][1] + s], k = [e[c][0] + n, e[c][1] + s];
|
|
75
|
-
if (
|
|
75
|
+
if (qn([i, t], f, k) <= l) return !0;
|
|
76
76
|
}
|
|
77
77
|
return !1;
|
|
78
78
|
}, bt = (i, t) => {
|
|
@@ -96,36 +96,36 @@ const Ns = (i, t, e, n, s) => [
|
|
|
96
96
|
[i, 0],
|
|
97
97
|
[i * 0.75, t],
|
|
98
98
|
[0, t]
|
|
99
|
-
],
|
|
99
|
+
], ei = (i, t) => [
|
|
100
100
|
[i / 2, 0],
|
|
101
101
|
[i, t / 2],
|
|
102
102
|
[i / 2, t],
|
|
103
103
|
[0, t / 2]
|
|
104
|
-
],
|
|
105
|
-
const [l, r] = me([i, t], [e + s / 2, n + a / 2], -o), c =
|
|
104
|
+
], Ss = (i) => Math.min(i * 0.15, 20), rs = (i, t, e, n, s, a, o) => {
|
|
105
|
+
const [l, r] = me([i, t], [e + s / 2, n + a / 2], -o), c = Ss(a), f = n + c;
|
|
106
106
|
if ((l - (e + s / 2)) ** 2 / (s / 2) ** 2 + (r - f) ** 2 / c ** 2 <= 1) return !0;
|
|
107
107
|
const d = n + a - c;
|
|
108
108
|
return (l - (e + s / 2)) ** 2 / (s / 2) ** 2 + (r - d) ** 2 / c ** 2 <= 1 ? !0 : l >= e && l <= e + s && r >= n + c && r <= n + a - c;
|
|
109
|
-
},
|
|
110
|
-
const [r, c] = me([i, t], [e + s / 2, n + a / 2], -o), f =
|
|
111
|
-
if (
|
|
109
|
+
}, ti = (i, t, e, n, s, a, o, l = 5) => {
|
|
110
|
+
const [r, c] = me([i, t], [e + s / 2, n + a / 2], -o), f = Ss(a);
|
|
111
|
+
if (Gn(i, t, e, n, s, f * 2, o, l)) return !0;
|
|
112
112
|
const k = n + a - f;
|
|
113
|
-
if (c >= k &&
|
|
113
|
+
if (c >= k && Gn(i, t, e, n + a - f * 2, s, f * 2, o, l)) return !0;
|
|
114
114
|
const d = [e, n + f], v = [e, n + a - f], h = [e + s, n + f], M = [e + s, n + a - f];
|
|
115
|
-
return
|
|
116
|
-
},
|
|
115
|
+
return qn([r, c], d, v) <= l * l || qn([r, c], h, M) <= l * l;
|
|
116
|
+
}, ni = (i, t, e, n, s, a, o, l = 5) => {
|
|
117
117
|
const [r, c] = me([i, t], [e + s / 2, n + a / 2], -o), f = Math.abs(r - e) <= l, k = Math.abs(r - (e + s)) <= l, d = Math.abs(c - n) <= l, v = Math.abs(c - (n + a)) <= l, h = c >= n - l && c <= n + a + l, M = r >= e - l && r <= e + s + l;
|
|
118
118
|
return (f || k) && h || (d || v) && M;
|
|
119
|
-
},
|
|
119
|
+
}, Gn = (i, t, e, n, s, a, o, l = 5) => {
|
|
120
120
|
const [r, c] = me([i, t], [e + s / 2, n + a / 2], -o), f = e + s / 2, k = n + a / 2, d = s / 2, v = a / 2, h = r - f, M = c - k, I = h * h / (d + l) ** 2 + M * M / (v + l) ** 2, T = d - l > 0 && v - l > 0 ? h * h / (d - l) ** 2 + M * M / (v - l) ** 2 : 2;
|
|
121
121
|
return I <= 1 && T >= 1;
|
|
122
|
-
},
|
|
122
|
+
}, si = (i) => {
|
|
123
123
|
if (i.type !== "arrow") return null;
|
|
124
124
|
const t = i.points;
|
|
125
125
|
if (t.length < 2) return null;
|
|
126
126
|
const [e, n] = t[t.length - 2], [s, a] = t[t.length - 1], o = Math.atan2(a - n, s - e), l = 20, r = Math.PI / 6, c = s - l * Math.cos(o - r), f = a - l * Math.sin(o - r), k = s - l * Math.cos(o + r), d = a - l * Math.sin(o + r);
|
|
127
127
|
return [[c, f], [s, a], [k, d]];
|
|
128
|
-
},
|
|
128
|
+
}, cs = (i, t, e, n) => {
|
|
129
129
|
const s = i[0], a = i[1], o = t[0], l = t[1], r = e[0], c = e[1], f = n[0], k = n[1], d = (k - c) * (o - s) - (f - r) * (l - a);
|
|
130
130
|
if (d === 0) return null;
|
|
131
131
|
const v = ((f - r) * (a - c) - (k - c) * (s - r)) / d, h = ((o - s) * (a - c) - (l - a) * (s - r)) / d;
|
|
@@ -142,9 +142,9 @@ const Ns = (i, t, e, n, s) => [
|
|
|
142
142
|
];
|
|
143
143
|
let M = 1 / 0;
|
|
144
144
|
for (const I of h) {
|
|
145
|
-
const T =
|
|
145
|
+
const T = cs(k, d, I[0], I[1]);
|
|
146
146
|
if (T) {
|
|
147
|
-
const b =
|
|
147
|
+
const b = as(k[0], k[1], T[0], T[1]);
|
|
148
148
|
b < M && (M = b, v = T);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
@@ -179,15 +179,15 @@ const Ns = (i, t, e, n, s) => [
|
|
|
179
179
|
}
|
|
180
180
|
let T = 1 / 0;
|
|
181
181
|
for (const b of I) {
|
|
182
|
-
const B =
|
|
182
|
+
const B = cs(k, d, b[0], b[1]);
|
|
183
183
|
if (B) {
|
|
184
|
-
const X =
|
|
184
|
+
const X = as(k[0], k[1], B[0], B[1]);
|
|
185
185
|
X < T && (T = X, v = B);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
return v ? me(v, [c, f], r) : null;
|
|
190
|
-
},
|
|
190
|
+
}, ii = (i, t, e) => {
|
|
191
191
|
const n = i[0], s = i[1], a = t[0], o = t[1], l = e[0], r = e[1], c = n - a, f = s - o, k = l - a, d = r - o, v = c * k + f * d, h = k * k + d * d;
|
|
192
192
|
let M = -1;
|
|
193
193
|
h !== 0 && (M = v / h);
|
|
@@ -196,10 +196,10 @@ const Ns = (i, t, e, n, s) => [
|
|
|
196
196
|
const b = n - I, B = s - T;
|
|
197
197
|
return Math.sqrt(b * b + B * B);
|
|
198
198
|
};
|
|
199
|
-
let
|
|
199
|
+
let Ln = null;
|
|
200
200
|
const Ne = (i, t, e, n, s) => {
|
|
201
|
-
|
|
202
|
-
const a =
|
|
201
|
+
Ln || (Ln = document.createElement("canvas"));
|
|
202
|
+
const a = Ln.getContext("2d");
|
|
203
203
|
if (!a) return { width: 10, height: t };
|
|
204
204
|
const o = s?.isItalic ? "italic " : "", l = s?.isBold ? "bold " : "";
|
|
205
205
|
if (a.font = `${o}${l}${t}px ${e}`, n) {
|
|
@@ -232,7 +232,7 @@ const Ne = (i, t, e, n, s) => {
|
|
|
232
232
|
k > c && (c = k);
|
|
233
233
|
}), { width: Math.max(c + 8, 10), height: r.length * (t * 1.25) + 10 };
|
|
234
234
|
}
|
|
235
|
-
},
|
|
235
|
+
}, oi = (i, t = 0.5, e = 10) => {
|
|
236
236
|
if (i.length < 2) return i;
|
|
237
237
|
const n = [], s = (a) => a < 0 ? i[0] : a >= i.length ? i[i.length - 1] : i[a];
|
|
238
238
|
for (let a = 0; a < i.length - 1; a++) {
|
|
@@ -248,7 +248,7 @@ const Ne = (i, t, e, n, s) => {
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
return n;
|
|
251
|
-
},
|
|
251
|
+
}, ai = (i) => {
|
|
252
252
|
const { x: t, y: e, width: n, height: s, angle: a } = i;
|
|
253
253
|
if (a === 0)
|
|
254
254
|
return {
|
|
@@ -271,7 +271,7 @@ const Ne = (i, t, e, n, s) => {
|
|
|
271
271
|
if (i.length === 0) return null;
|
|
272
272
|
let t = 1 / 0, e = 1 / 0, n = -1 / 0, s = -1 / 0;
|
|
273
273
|
return i.forEach((a) => {
|
|
274
|
-
const o =
|
|
274
|
+
const o = ai(a);
|
|
275
275
|
t = Math.min(t, o.minX), e = Math.min(e, o.minY), n = Math.max(n, o.maxX), s = Math.max(s, o.maxY);
|
|
276
276
|
}), {
|
|
277
277
|
x: t,
|
|
@@ -283,13 +283,13 @@ const Ne = (i, t, e, n, s) => {
|
|
|
283
283
|
maxX: n,
|
|
284
284
|
maxY: s
|
|
285
285
|
};
|
|
286
|
-
},
|
|
286
|
+
}, Rn = (i, t, e, n, s) => {
|
|
287
287
|
const { x: a, y: o, angle: l, points: r } = n, c = [a + n.width / 2, o + n.height / 2], [f, k] = me([t, e], c, -l), d = f - a, v = k - o;
|
|
288
288
|
if (!r || r.length < 2) return !1;
|
|
289
289
|
let h = r;
|
|
290
290
|
if (n.type === "arrow") {
|
|
291
291
|
if (n.arrowType === "round" && r.length > 2)
|
|
292
|
-
h =
|
|
292
|
+
h = oi(r);
|
|
293
293
|
else if (n.arrowType === "elbow") {
|
|
294
294
|
let M, I;
|
|
295
295
|
if (s && (n.startBinding || n.endBinding)) {
|
|
@@ -307,15 +307,15 @@ const Ne = (i, t, e, n, s) => {
|
|
|
307
307
|
};
|
|
308
308
|
n.startBinding && (M = T(n.startBinding)), n.endBinding && (I = T(n.endBinding));
|
|
309
309
|
}
|
|
310
|
-
h =
|
|
310
|
+
h = Zn(r, M, I);
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
for (let M = 0; M < h.length - 1; M++) {
|
|
314
314
|
const I = h[M], T = h[M + 1];
|
|
315
|
-
if (
|
|
315
|
+
if (ii([d, v], I, T) <= i) return !0;
|
|
316
316
|
}
|
|
317
317
|
return !1;
|
|
318
|
-
},
|
|
318
|
+
}, Zn = (i, t, e) => {
|
|
319
319
|
if (i.length < 2) return [...i];
|
|
320
320
|
const n = i[0], s = i[i.length - 1], a = 20;
|
|
321
321
|
let o = n, l = s;
|
|
@@ -323,8 +323,8 @@ const Ne = (i, t, e, n, s) => {
|
|
|
323
323
|
t && (o = [n[0] + t[0] * a, n[1] + t[1] * a], r.push(o)), e && (l = [s[0] + e[0] * a, s[1] + e[1] * a]);
|
|
324
324
|
const [c, f] = o, [k, d] = l, v = (c + k) / 2, h = (f + d) / 2, M = Math.abs(k - c), I = Math.abs(d - f);
|
|
325
325
|
return M > I ? (r.push([v, f]), r.push([v, d])) : (r.push([c, h]), r.push([k, h])), e && r.push(l), r.push(s), r;
|
|
326
|
-
},
|
|
327
|
-
const s =
|
|
326
|
+
}, li = (i, t = 20, e, n) => {
|
|
327
|
+
const s = Zn(i, e, n), a = [];
|
|
328
328
|
s.length > 0 && a.push(s[0]);
|
|
329
329
|
for (let r = 1; r < s.length; r++) {
|
|
330
330
|
const c = a[a.length - 1], f = s[r];
|
|
@@ -344,18 +344,18 @@ const Ne = (i, t, e, n, s) => {
|
|
|
344
344
|
}
|
|
345
345
|
const l = a[a.length - 1];
|
|
346
346
|
return o += ` L ${l[0]} ${l[1]}`, o;
|
|
347
|
-
},
|
|
347
|
+
}, ri = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
348
348
|
let St = (i = 21) => {
|
|
349
349
|
let t = "", e = crypto.getRandomValues(new Uint8Array(i |= 0));
|
|
350
350
|
for (; i--; )
|
|
351
|
-
t +=
|
|
351
|
+
t += ri[e[i] & 63];
|
|
352
352
|
return t;
|
|
353
353
|
};
|
|
354
|
-
const ot =
|
|
354
|
+
const ot = Gs("excalidraw", {
|
|
355
355
|
state: () => ({
|
|
356
356
|
// State initialized correctly
|
|
357
357
|
elements: [],
|
|
358
|
-
history: [[]],
|
|
358
|
+
history: On([[]]),
|
|
359
359
|
historyStep: 0,
|
|
360
360
|
appState: {
|
|
361
361
|
lockedTool: !1,
|
|
@@ -706,7 +706,8 @@ const ot = qs("excalidraw", {
|
|
|
706
706
|
}
|
|
707
707
|
},
|
|
708
708
|
recordHistory() {
|
|
709
|
-
|
|
709
|
+
const i = this.history.slice(0, this.historyStep + 1);
|
|
710
|
+
i.length >= 100 && (i.shift(), this.historyStep = i.length - 1), i.push(On(JSON.parse(JSON.stringify(this.elements)))), this.history = On(i), this.historyStep = this.history.length - 1;
|
|
710
711
|
},
|
|
711
712
|
undo() {
|
|
712
713
|
this.historyStep > 0 && (this.historyStep--, this.elements = JSON.parse(JSON.stringify(this.history[this.historyStep])), this.appState.selectedElementIds = {});
|
|
@@ -994,7 +995,7 @@ const ot = qs("excalidraw", {
|
|
|
994
995
|
}
|
|
995
996
|
}
|
|
996
997
|
}
|
|
997
|
-
}),
|
|
998
|
+
}), Is = () => new Promise((i) => {
|
|
998
999
|
const t = document.createElement("input");
|
|
999
1000
|
t.type = "file", t.accept = "image/*";
|
|
1000
1001
|
let e = !1;
|
|
@@ -1032,13 +1033,13 @@ const ot = qs("excalidraw", {
|
|
|
1032
1033
|
}, 500);
|
|
1033
1034
|
};
|
|
1034
1035
|
window.addEventListener("focus", n), t.click();
|
|
1035
|
-
}),
|
|
1036
|
+
}), ci = { class: "tool-group" }, di = { class: "svg-icon" }, ui = ["xlink:href"], hi = ["title"], pi = { class: "svg-icon" }, fi = ["xlink:href"], gi = {
|
|
1036
1037
|
key: 0,
|
|
1037
1038
|
class: "shortcut"
|
|
1038
|
-
},
|
|
1039
|
+
}, vi = { class: "sub-tools-container" }, mi = ["onClick"], yi = { class: "svg-icon" }, xi = ["xlink:href"], ki = ["onClick", "title"], wi = { class: "svg-icon" }, bi = ["xlink:href"], Si = {
|
|
1039
1040
|
key: 0,
|
|
1040
1041
|
class: "shortcut"
|
|
1041
|
-
},
|
|
1042
|
+
}, Ii = /* @__PURE__ */ Qe({
|
|
1042
1043
|
__name: "Toolbar",
|
|
1043
1044
|
setup(i) {
|
|
1044
1045
|
const t = ot(), e = U(() => t.appState.activeTool), n = U(() => t.appState.activeToolType), s = J(!1);
|
|
@@ -1081,7 +1082,7 @@ const ot = qs("excalidraw", {
|
|
|
1081
1082
|
if (s.value = !1, d === "image") {
|
|
1082
1083
|
const v = t.appState.activeTool;
|
|
1083
1084
|
t.setTool("image");
|
|
1084
|
-
const h = await
|
|
1085
|
+
const h = await Is();
|
|
1085
1086
|
if (h) {
|
|
1086
1087
|
const M = window.innerWidth / 2, I = window.innerHeight / 2;
|
|
1087
1088
|
t.insertImage ? t.insertImage(h.dataURL, M - h.width / 2, I - h.height / 2, h.width, h.height) : (console.error("Store action insertImage not found, reloading might fix this."), location.reload()), t.setTool(v);
|
|
@@ -1106,16 +1107,16 @@ const ot = qs("excalidraw", {
|
|
|
1106
1107
|
class: "toolbar glass",
|
|
1107
1108
|
style: Ke({ pointerEvents: r.value ? "none" : "auto" })
|
|
1108
1109
|
}, [
|
|
1109
|
-
m("div",
|
|
1110
|
+
m("div", ci, [
|
|
1110
1111
|
m("div", {
|
|
1111
1112
|
class: Xe({ "tool-item": !0, active: o.value }),
|
|
1112
1113
|
onClick: k,
|
|
1113
1114
|
title: "绘制后保持所选工具状态"
|
|
1114
1115
|
}, [
|
|
1115
|
-
(V(), j("svg",
|
|
1116
|
+
(V(), j("svg", di, [
|
|
1116
1117
|
m("use", {
|
|
1117
1118
|
"xlink:href": `${o.value ? "#icon-zujiansuoding" : "#icon-zujianjiesuo"}`
|
|
1118
|
-
}, null, 8,
|
|
1119
|
+
}, null, 8, ui)
|
|
1119
1120
|
]))
|
|
1120
1121
|
], 2),
|
|
1121
1122
|
(V(), j(We, null, ut(a, (M) => (V(), j(We, {
|
|
@@ -1138,27 +1139,27 @@ const ot = qs("excalidraw", {
|
|
|
1138
1139
|
class: Xe({ "tool-item": !0, active: e.value === M.name }),
|
|
1139
1140
|
title: M.label
|
|
1140
1141
|
}, [
|
|
1141
|
-
(V(), j("svg",
|
|
1142
|
+
(V(), j("svg", pi, [
|
|
1142
1143
|
m("use", {
|
|
1143
1144
|
"xlink:href": `${e.value === M.name ? M.activeIcon : M.icon}`
|
|
1144
|
-
}, null, 8,
|
|
1145
|
+
}, null, 8, fi)
|
|
1145
1146
|
])),
|
|
1146
|
-
M.key ? (V(), j("span",
|
|
1147
|
-
], 10,
|
|
1147
|
+
M.key ? (V(), j("span", gi, nt(M.key), 1)) : we("", !0)
|
|
1148
|
+
], 10, hi)
|
|
1148
1149
|
]),
|
|
1149
1150
|
default: Ae(() => [
|
|
1150
|
-
m("div",
|
|
1151
|
+
m("div", vi, [
|
|
1151
1152
|
(V(!0), j(We, null, ut(M.subTools, (I) => (V(), j("div", {
|
|
1152
1153
|
key: I.name,
|
|
1153
1154
|
class: Xe(["sub-tool-item", { active: e.value === M.name && n.value === I.name }]),
|
|
1154
1155
|
onClick: (T) => c(I.name, M.name)
|
|
1155
1156
|
}, [
|
|
1156
|
-
(V(), j("svg",
|
|
1157
|
+
(V(), j("svg", yi, [
|
|
1157
1158
|
m("use", {
|
|
1158
1159
|
"xlink:href": `${I.icon}`
|
|
1159
|
-
}, null, 8,
|
|
1160
|
+
}, null, 8, xi)
|
|
1160
1161
|
]))
|
|
1161
|
-
], 10,
|
|
1162
|
+
], 10, mi))), 128))
|
|
1162
1163
|
])
|
|
1163
1164
|
]),
|
|
1164
1165
|
_: 2
|
|
@@ -1169,14 +1170,14 @@ const ot = qs("excalidraw", {
|
|
|
1169
1170
|
title: M.label
|
|
1170
1171
|
}, [
|
|
1171
1172
|
M.name !== "trand" ? (V(), j(We, { key: 0 }, [
|
|
1172
|
-
(V(), j("svg",
|
|
1173
|
+
(V(), j("svg", wi, [
|
|
1173
1174
|
m("use", {
|
|
1174
1175
|
"xlink:href": `${e.value === M.name ? M.activeIcon : M.icon}`
|
|
1175
|
-
}, null, 8,
|
|
1176
|
+
}, null, 8, bi)
|
|
1176
1177
|
])),
|
|
1177
|
-
M.key ? (V(), j("span",
|
|
1178
|
+
M.key ? (V(), j("span", Si, nt(M.key), 1)) : we("", !0)
|
|
1178
1179
|
], 64)) : we("", !0)
|
|
1179
|
-
], 10,
|
|
1180
|
+
], 10, ki))
|
|
1180
1181
|
], 64))), 64))
|
|
1181
1182
|
])
|
|
1182
1183
|
], 4);
|
|
@@ -1187,8 +1188,8 @@ const ot = qs("excalidraw", {
|
|
|
1187
1188
|
for (const [n, s] of t)
|
|
1188
1189
|
e[n] = s;
|
|
1189
1190
|
return e;
|
|
1190
|
-
},
|
|
1191
|
-
function
|
|
1191
|
+
}, Mi = /* @__PURE__ */ st(Ii, [["__scopeId", "data-v-b6ea5f5c"]]);
|
|
1192
|
+
function ds(i) {
|
|
1192
1193
|
let t;
|
|
1193
1194
|
if (i > 100 && (i = 100), i < 0 || i > 100)
|
|
1194
1195
|
throw new Error("Input must be between 0 and 100.");
|
|
@@ -1200,7 +1201,7 @@ function pn(i) {
|
|
|
1200
1201
|
const t = parseInt(i, 16);
|
|
1201
1202
|
return isNaN(t) ? 100 : Math.round(t / 255 * 100);
|
|
1202
1203
|
}
|
|
1203
|
-
const
|
|
1204
|
+
const Ei = { class: "fill-style-box" }, Ci = ["onClick"], Ti = { class: "svg-icon" }, Pi = ["xlink:href"], Bi = /* @__PURE__ */ Qe({
|
|
1204
1205
|
__name: "fillStyle",
|
|
1205
1206
|
setup(i) {
|
|
1206
1207
|
const t = ot(), e = U(() => {
|
|
@@ -1233,21 +1234,21 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1233
1234
|
]), a = (o) => {
|
|
1234
1235
|
t.updateSelectedElements({ fillStyle: o });
|
|
1235
1236
|
};
|
|
1236
|
-
return (o, l) => (V(), j("div",
|
|
1237
|
+
return (o, l) => (V(), j("div", Ei, [
|
|
1237
1238
|
(V(!0), j(We, null, ut(s.value, (r, c) => (V(), j("div", {
|
|
1238
1239
|
key: c,
|
|
1239
1240
|
class: Xe(["fill-style-item", { active: e.value === r.value }]),
|
|
1240
1241
|
onClick: (f) => a(r.value)
|
|
1241
1242
|
}, [
|
|
1242
|
-
(V(), j("svg",
|
|
1243
|
+
(V(), j("svg", Ti, [
|
|
1243
1244
|
m("use", {
|
|
1244
1245
|
"xlink:href": `#${e.value === r.value ? r.iconActive : r.icon}`
|
|
1245
|
-
}, null, 8,
|
|
1246
|
+
}, null, 8, Pi)
|
|
1246
1247
|
]))
|
|
1247
|
-
], 10,
|
|
1248
|
+
], 10, Ci))), 128))
|
|
1248
1249
|
]));
|
|
1249
1250
|
}
|
|
1250
|
-
}),
|
|
1251
|
+
}), Ms = /* @__PURE__ */ st(Bi, [["__scopeId", "data-v-9356d2e1"]]), zi = { class: "fill-style-box" }, $i = ["onClick"], _i = { class: "svg-icon" }, Ai = ["xlink:href"], Di = /* @__PURE__ */ Qe({
|
|
1251
1252
|
__name: "borderStyle",
|
|
1252
1253
|
setup(i) {
|
|
1253
1254
|
const t = ot(), e = U(() => {
|
|
@@ -1280,21 +1281,21 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1280
1281
|
]), a = (o) => {
|
|
1281
1282
|
t.updateSelectedElements({ strokeStyle: o });
|
|
1282
1283
|
};
|
|
1283
|
-
return (o, l) => (V(), j("div",
|
|
1284
|
+
return (o, l) => (V(), j("div", zi, [
|
|
1284
1285
|
(V(!0), j(We, null, ut(s.value, (r, c) => (V(), j("div", {
|
|
1285
1286
|
key: c,
|
|
1286
1287
|
class: Xe(["fill-style-item", { active: e.value === r.value }]),
|
|
1287
1288
|
onClick: (f) => a(r.value)
|
|
1288
1289
|
}, [
|
|
1289
|
-
(V(), j("svg",
|
|
1290
|
+
(V(), j("svg", _i, [
|
|
1290
1291
|
m("use", {
|
|
1291
1292
|
"xlink:href": `#${e.value === r.value ? r.iconActive : r.icon}`
|
|
1292
|
-
}, null, 8,
|
|
1293
|
+
}, null, 8, Ai)
|
|
1293
1294
|
]))
|
|
1294
|
-
], 10,
|
|
1295
|
+
], 10, $i))), 128))
|
|
1295
1296
|
]));
|
|
1296
1297
|
}
|
|
1297
|
-
}),
|
|
1298
|
+
}), Es = /* @__PURE__ */ st(Di, [["__scopeId", "data-v-dcf857c8"]]), Fi = { class: "fill-style-box" }, Oi = ["onClick"], Li = { class: "svg-icon" }, Ri = ["xlink:href"], Xi = /* @__PURE__ */ Qe({
|
|
1298
1299
|
__name: "lineStyle",
|
|
1299
1300
|
setup(i) {
|
|
1300
1301
|
const t = ot(), e = U(() => {
|
|
@@ -1327,21 +1328,21 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1327
1328
|
]), a = (o) => {
|
|
1328
1329
|
t.updateSelectedElements({ roughness: o });
|
|
1329
1330
|
};
|
|
1330
|
-
return (o, l) => (V(), j("div",
|
|
1331
|
+
return (o, l) => (V(), j("div", Fi, [
|
|
1331
1332
|
(V(!0), j(We, null, ut(s.value, (r, c) => (V(), j("div", {
|
|
1332
1333
|
key: c,
|
|
1333
1334
|
class: Xe(["fill-style-item", { active: e.value === r.value }]),
|
|
1334
1335
|
onClick: (f) => a(r.value)
|
|
1335
1336
|
}, [
|
|
1336
|
-
(V(), j("svg",
|
|
1337
|
+
(V(), j("svg", Li, [
|
|
1337
1338
|
m("use", {
|
|
1338
1339
|
"xlink:href": `#${e.value === r.value ? r.iconActive : r.icon}`
|
|
1339
|
-
}, null, 8,
|
|
1340
|
+
}, null, 8, Ri)
|
|
1340
1341
|
]))
|
|
1341
|
-
], 10,
|
|
1342
|
+
], 10, Oi))), 128))
|
|
1342
1343
|
]));
|
|
1343
1344
|
}
|
|
1344
|
-
}),
|
|
1345
|
+
}), Cs = /* @__PURE__ */ st(Xi, [["__scopeId", "data-v-794ba895"]]), Yi = { class: "fill-style-box" }, Vi = ["onClick"], ji = { class: "svg-icon" }, Hi = ["xlink:href"], Wi = /* @__PURE__ */ Qe({
|
|
1345
1346
|
__name: "textStyle",
|
|
1346
1347
|
setup(i) {
|
|
1347
1348
|
const t = ot(), e = () => {
|
|
@@ -1393,21 +1394,21 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1393
1394
|
value: "strikethrough"
|
|
1394
1395
|
}
|
|
1395
1396
|
]);
|
|
1396
|
-
return (o, l) => (V(), j("div",
|
|
1397
|
+
return (o, l) => (V(), j("div", Yi, [
|
|
1397
1398
|
(V(!0), j(We, null, ut(a.value, (r, c) => (V(), j("div", {
|
|
1398
1399
|
key: c,
|
|
1399
1400
|
class: Xe(["fill-style-item", { active: n(r.value) }]),
|
|
1400
1401
|
onClick: (f) => s(r.value)
|
|
1401
1402
|
}, [
|
|
1402
|
-
(V(), j("svg",
|
|
1403
|
+
(V(), j("svg", ji, [
|
|
1403
1404
|
m("use", {
|
|
1404
1405
|
"xlink:href": `#${n(r.value) ? r.iconActive : r.icon}`
|
|
1405
|
-
}, null, 8,
|
|
1406
|
+
}, null, 8, Hi)
|
|
1406
1407
|
]))
|
|
1407
|
-
], 10,
|
|
1408
|
+
], 10, Vi))), 128))
|
|
1408
1409
|
]));
|
|
1409
1410
|
}
|
|
1410
|
-
}),
|
|
1411
|
+
}), Ts = /* @__PURE__ */ st(Wi, [["__scopeId", "data-v-36600f47"]]), Ui = ["onClick"], qi = { class: "svg-icon" }, Gi = ["xlink:href"], Ni = ["onClick"], Ki = { class: "svg-icon" }, Ji = ["xlink:href"], Zi = /* @__PURE__ */ Qe({
|
|
1411
1412
|
__name: "alignStyle",
|
|
1412
1413
|
setup(i) {
|
|
1413
1414
|
const t = ot(), e = U(() => t.appState.activeTool), n = U(() => Object.keys(t.appState.selectedElementIds)), s = U(() => n.value.length > 0), a = () => {
|
|
@@ -1484,26 +1485,26 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1484
1485
|
class: Xe(["fill-style-item", { active: l.value === I.value }]),
|
|
1485
1486
|
onClick: (b) => d(I.value)
|
|
1486
1487
|
}, [
|
|
1487
|
-
(V(), j("svg",
|
|
1488
|
+
(V(), j("svg", qi, [
|
|
1488
1489
|
m("use", {
|
|
1489
1490
|
"xlink:href": `#${l.value === I.value ? I.iconActive : I.icon}`
|
|
1490
|
-
}, null, 8,
|
|
1491
|
+
}, null, 8, Gi)
|
|
1491
1492
|
]))
|
|
1492
|
-
], 10,
|
|
1493
|
+
], 10, Ui))), 128)),
|
|
1493
1494
|
o.value ? (V(!0), j(We, { key: 0 }, ut(k.value, (I, T) => (V(), j("div", {
|
|
1494
1495
|
key: T,
|
|
1495
1496
|
class: Xe(["fill-style-item", { active: r.value === I.value }]),
|
|
1496
1497
|
onClick: (b) => v(I.value)
|
|
1497
1498
|
}, [
|
|
1498
|
-
(V(), j("svg",
|
|
1499
|
+
(V(), j("svg", Ki, [
|
|
1499
1500
|
m("use", {
|
|
1500
1501
|
"xlink:href": `#${r.value === I.value ? I.iconActive : I.icon}`
|
|
1501
|
-
}, null, 8,
|
|
1502
|
+
}, null, 8, Ji)
|
|
1502
1503
|
]))
|
|
1503
|
-
], 10,
|
|
1504
|
+
], 10, Ni))), 128)) : we("", !0)
|
|
1504
1505
|
], 2));
|
|
1505
1506
|
}
|
|
1506
|
-
}),
|
|
1507
|
+
}), Ps = /* @__PURE__ */ st(Zi, [["__scopeId", "data-v-b408686c"]]), Qi = { class: "fill-style-box" }, eo = ["onClick"], to = { class: "svg-icon" }, no = ["xlink:href"], so = /* @__PURE__ */ Qe({
|
|
1507
1508
|
__name: "arrowStyle",
|
|
1508
1509
|
setup(i) {
|
|
1509
1510
|
const t = ot(), e = U(() => {
|
|
@@ -1536,51 +1537,51 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1536
1537
|
]), a = (o) => {
|
|
1537
1538
|
t.updateSelectedElements({ arrowType: o });
|
|
1538
1539
|
};
|
|
1539
|
-
return (o, l) => (V(), j("div",
|
|
1540
|
+
return (o, l) => (V(), j("div", Qi, [
|
|
1540
1541
|
(V(!0), j(We, null, ut(s.value, (r, c) => (V(), j("div", {
|
|
1541
1542
|
key: c,
|
|
1542
1543
|
class: Xe(["fill-style-item", { active: e.value === r.value }]),
|
|
1543
1544
|
onClick: (f) => a(r.value)
|
|
1544
1545
|
}, [
|
|
1545
|
-
(V(), j("svg",
|
|
1546
|
+
(V(), j("svg", to, [
|
|
1546
1547
|
m("use", {
|
|
1547
1548
|
"xlink:href": `#${e.value === r.value ? r.iconActive : r.icon}`
|
|
1548
|
-
}, null, 8,
|
|
1549
|
+
}, null, 8, no)
|
|
1549
1550
|
]))
|
|
1550
|
-
], 10,
|
|
1551
|
+
], 10, eo))), 128))
|
|
1551
1552
|
]));
|
|
1552
1553
|
}
|
|
1553
|
-
}),
|
|
1554
|
+
}), Bs = /* @__PURE__ */ st(so, [["__scopeId", "data-v-b56fafad"]]), io = { class: "header" }, oo = { class: "content" }, ao = { class: "shape-panel-box" }, lo = { class: "input-box" }, ro = { class: "input-box" }, co = {
|
|
1554
1555
|
key: 0,
|
|
1555
1556
|
class: "input-box"
|
|
1556
|
-
},
|
|
1557
|
+
}, uo = {
|
|
1557
1558
|
key: 1,
|
|
1558
1559
|
class: "input-box"
|
|
1559
|
-
},
|
|
1560
|
+
}, ho = {
|
|
1560
1561
|
key: 3,
|
|
1561
1562
|
class: "btn-box"
|
|
1562
|
-
},
|
|
1563
|
+
}, po = { class: "svg-icon" }, fo = ["xlink:href"], go = {
|
|
1563
1564
|
key: 0,
|
|
1564
1565
|
class: "roundness-box"
|
|
1565
|
-
},
|
|
1566
|
+
}, vo = { class: "style-item" }, mo = {
|
|
1566
1567
|
key: 0,
|
|
1567
1568
|
class: "svg-icon"
|
|
1568
|
-
},
|
|
1569
|
+
}, yo = { class: "color-text" }, xo = { class: "style-item" }, ko = { class: "style-item" }, wo = { class: "style-item" }, bo = {
|
|
1569
1570
|
key: 0,
|
|
1570
1571
|
class: "svg-icon"
|
|
1571
|
-
},
|
|
1572
|
+
}, So = { class: "color-text" }, Io = { class: "style-item" }, Mo = { class: "style-item" }, Eo = {
|
|
1572
1573
|
key: 0,
|
|
1573
1574
|
class: "style-item"
|
|
1574
|
-
},
|
|
1575
|
+
}, Co = { class: "style-item" }, To = {
|
|
1575
1576
|
key: 1,
|
|
1576
1577
|
class: "style-item"
|
|
1577
|
-
},
|
|
1578
|
+
}, Po = { class: "title" }, Bo = { class: "style-item" }, zo = { class: "style-boxs" }, $o = { class: "style-boxs-item" }, _o = { class: "style-boxs-item" }, Ao = { class: "style-item" }, Do = {
|
|
1578
1579
|
key: 0,
|
|
1579
1580
|
class: "svg-icon"
|
|
1580
|
-
},
|
|
1581
|
+
}, Fo = { class: "color-text" }, Oo = { class: "style-item" }, Lo = {
|
|
1581
1582
|
key: 0,
|
|
1582
1583
|
class: "svg-icon"
|
|
1583
|
-
},
|
|
1584
|
+
}, Ro = { class: "color-text" }, Xo = /* @__PURE__ */ Qe({
|
|
1584
1585
|
__name: "PropertiesPanel",
|
|
1585
1586
|
setup(i) {
|
|
1586
1587
|
const t = ot(), e = J(), n = J(), s = J(), a = J(), o = J(), l = J(), r = J(), c = J(), f = () => {
|
|
@@ -1597,7 +1598,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1597
1598
|
return $ ? $.type : "none";
|
|
1598
1599
|
}
|
|
1599
1600
|
return v.value === "shapes" ? t.appState.activeToolType : v.value;
|
|
1600
|
-
}, T = U(() => H.value +
|
|
1601
|
+
}, T = U(() => H.value + ds(N.value)), b = U(() => Ee.value + ds(D.value));
|
|
1601
1602
|
U(() => Fe.value), U(() => Pe.value);
|
|
1602
1603
|
const B = U(() => {
|
|
1603
1604
|
const z = I();
|
|
@@ -1900,7 +1901,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1900
1901
|
class: "properties-panel",
|
|
1901
1902
|
style: Ke({ pointerEvents: he.value ? "none" : "auto" })
|
|
1902
1903
|
}, [
|
|
1903
|
-
m("div",
|
|
1904
|
+
m("div", io, [
|
|
1904
1905
|
$[16] || ($[16] = m("div", null, "形状", -1)),
|
|
1905
1906
|
(V(), j("svg", { onClick: f }, [...$[15] || ($[15] = [
|
|
1906
1907
|
m("use", { "xlink:href": "#jvs-public-danchuangguanbi1" }, null, -1)
|
|
@@ -1908,12 +1909,12 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1908
1909
|
]),
|
|
1909
1910
|
ie($n, null, {
|
|
1910
1911
|
default: Ae(() => [
|
|
1911
|
-
m("div",
|
|
1912
|
-
m("div",
|
|
1912
|
+
m("div", oo, [
|
|
1913
|
+
m("div", ao, [
|
|
1913
1914
|
m("div", {
|
|
1914
1915
|
class: Xe(["shape-panel-row", { "not-bind-width-height": q.value || !se.value }])
|
|
1915
1916
|
}, [
|
|
1916
|
-
m("div",
|
|
1917
|
+
m("div", lo, [
|
|
1917
1918
|
$[17] || ($[17] = m("div", { class: "icon" }, "X", -1)),
|
|
1918
1919
|
ie(ge, {
|
|
1919
1920
|
modelValue: ne.value,
|
|
@@ -1922,7 +1923,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1922
1923
|
"controls-position": "right"
|
|
1923
1924
|
}, null, 8, ["modelValue"])
|
|
1924
1925
|
]),
|
|
1925
|
-
m("div",
|
|
1926
|
+
m("div", ro, [
|
|
1926
1927
|
$[18] || ($[18] = m("div", { class: "icon" }, "Y", -1)),
|
|
1927
1928
|
ie(ge, {
|
|
1928
1929
|
modelValue: Ue.value,
|
|
@@ -1931,7 +1932,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1931
1932
|
"controls-position": "right"
|
|
1932
1933
|
}, null, 8, ["modelValue"])
|
|
1933
1934
|
]),
|
|
1934
|
-
q.value ? we("", !0) : (V(), j("div",
|
|
1935
|
+
q.value ? we("", !0) : (V(), j("div", co, [
|
|
1935
1936
|
$[19] || ($[19] = m("div", { class: "icon" }, "W", -1)),
|
|
1936
1937
|
ie(ge, {
|
|
1937
1938
|
modelValue: ae.value,
|
|
@@ -1940,7 +1941,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1940
1941
|
"controls-position": "right"
|
|
1941
1942
|
}, null, 8, ["modelValue"])
|
|
1942
1943
|
])),
|
|
1943
|
-
q.value ? we("", !0) : (V(), j("div",
|
|
1944
|
+
q.value ? we("", !0) : (V(), j("div", uo, [
|
|
1944
1945
|
$[20] || ($[20] = m("div", { class: "icon" }, "H", -1)),
|
|
1945
1946
|
ie(ge, {
|
|
1946
1947
|
modelValue: et.value,
|
|
@@ -1970,7 +1971,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1970
1971
|
style: Ke({ left: 32 + Oe.value * 8 + "px" })
|
|
1971
1972
|
}, "°", 4)
|
|
1972
1973
|
], 32)) : we("", !0),
|
|
1973
|
-
le.value ? (V(), j("div",
|
|
1974
|
+
le.value ? (V(), j("div", ho, [
|
|
1974
1975
|
m("div", {
|
|
1975
1976
|
class: Xe(["btn-item", { active: xe.value }]),
|
|
1976
1977
|
onClick: de
|
|
@@ -1994,14 +1995,14 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
1994
1995
|
class: Xe(["bind-box", { active: an.value }]),
|
|
1995
1996
|
onClick: vt
|
|
1996
1997
|
}, [
|
|
1997
|
-
(V(), j("svg",
|
|
1998
|
+
(V(), j("svg", po, [
|
|
1998
1999
|
m("use", {
|
|
1999
2000
|
"xlink:href": an.value ? "#icon-suoding1" : "#icon-quxiaosuoding"
|
|
2000
|
-
}, null, 8,
|
|
2001
|
+
}, null, 8, fo)
|
|
2001
2002
|
]))
|
|
2002
2003
|
], 2))
|
|
2003
2004
|
]),
|
|
2004
|
-
se.value ? (V(), j("div",
|
|
2005
|
+
se.value ? (V(), j("div", go, [
|
|
2005
2006
|
$[25] || ($[25] = m("div", {
|
|
2006
2007
|
class: "item-label",
|
|
2007
2008
|
style: { "padding-right": "8px" }
|
|
@@ -2028,7 +2029,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2028
2029
|
$[31] || ($[31] = m("div", { class: "type-item-title" }, [
|
|
2029
2030
|
m("div", { class: "title" }, "填充")
|
|
2030
2031
|
], -1)),
|
|
2031
|
-
m("div",
|
|
2032
|
+
m("div", vo, [
|
|
2032
2033
|
$[27] || ($[27] = m("div", { class: "title" }, "颜色", -1)),
|
|
2033
2034
|
ie(re, {
|
|
2034
2035
|
color: H.value,
|
|
@@ -2047,14 +2048,14 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2047
2048
|
ref: e,
|
|
2048
2049
|
onClick: $[7] || ($[7] = (zt) => rn())
|
|
2049
2050
|
}, [
|
|
2050
|
-
H.value == "transparent" || !H.value || N.value == 0 ? (V(), j("svg",
|
|
2051
|
+
H.value == "transparent" || !H.value || N.value == 0 ? (V(), j("svg", mo, [...$[26] || ($[26] = [
|
|
2051
2052
|
m("use", { "xlink:href": "#icon-wuyanse" }, null, -1)
|
|
2052
2053
|
])])) : (V(), j("div", {
|
|
2053
2054
|
key: 1,
|
|
2054
2055
|
class: "color-box",
|
|
2055
2056
|
style: Ke({ background: T.value })
|
|
2056
2057
|
}, null, 4)),
|
|
2057
|
-
m("div",
|
|
2058
|
+
m("div", yo, nt(H.value != "transparent" ? H.value.substring(
|
|
2058
2059
|
0,
|
|
2059
2060
|
7
|
|
2060
2061
|
).toUpperCase() : H.value), 1)
|
|
@@ -2063,7 +2064,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2063
2064
|
_: 1
|
|
2064
2065
|
}, 8, ["color", "options"])
|
|
2065
2066
|
]),
|
|
2066
|
-
m("div",
|
|
2067
|
+
m("div", xo, [
|
|
2067
2068
|
$[28] || ($[28] = m("div", { class: "title" }, "透明度", -1)),
|
|
2068
2069
|
ie(Ce, {
|
|
2069
2070
|
modelValue: N.value,
|
|
@@ -2074,9 +2075,9 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2074
2075
|
max: 100
|
|
2075
2076
|
}, null, 8, ["modelValue"])
|
|
2076
2077
|
]),
|
|
2077
|
-
m("div",
|
|
2078
|
+
m("div", ko, [
|
|
2078
2079
|
$[29] || ($[29] = m("div", { class: "title" }, "填充样式", -1)),
|
|
2079
|
-
ie(
|
|
2080
|
+
ie(Ms, { style: { width: "100%" } })
|
|
2080
2081
|
])
|
|
2081
2082
|
], 64)) : we("", !0),
|
|
2082
2083
|
ee.value ? (V(), j(We, { key: 2 }, [
|
|
@@ -2084,7 +2085,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2084
2085
|
$[39] || ($[39] = m("div", { class: "type-item-title" }, [
|
|
2085
2086
|
m("div", { class: "title" }, "描边")
|
|
2086
2087
|
], -1)),
|
|
2087
|
-
m("div",
|
|
2088
|
+
m("div", wo, [
|
|
2088
2089
|
$[33] || ($[33] = m("div", { class: "title" }, "颜色", -1)),
|
|
2089
2090
|
ie(re, {
|
|
2090
2091
|
color: Ee.value,
|
|
@@ -2103,14 +2104,14 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2103
2104
|
ref: s,
|
|
2104
2105
|
onClick: $[9] || ($[9] = (zt) => Xt())
|
|
2105
2106
|
}, [
|
|
2106
|
-
Ee.value == "transparent" || !Ee.value || D.value == 0 ? (V(), j("svg",
|
|
2107
|
+
Ee.value == "transparent" || !Ee.value || D.value == 0 ? (V(), j("svg", bo, [...$[32] || ($[32] = [
|
|
2107
2108
|
m("use", { "xlink:href": "#icon-wuyanse" }, null, -1)
|
|
2108
2109
|
])])) : (V(), j("div", {
|
|
2109
2110
|
key: 1,
|
|
2110
2111
|
class: "color-box",
|
|
2111
2112
|
style: Ke({ background: b.value })
|
|
2112
2113
|
}, null, 4)),
|
|
2113
|
-
m("div",
|
|
2114
|
+
m("div", So, nt(Ee.value != "transparent" ? Ee.value.substring(
|
|
2114
2115
|
0,
|
|
2115
2116
|
7
|
|
2116
2117
|
).toUpperCase() : Ee.value), 1)
|
|
@@ -2119,7 +2120,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2119
2120
|
_: 1
|
|
2120
2121
|
}, 8, ["color", "options"])
|
|
2121
2122
|
]),
|
|
2122
|
-
m("div",
|
|
2123
|
+
m("div", Io, [
|
|
2123
2124
|
$[34] || ($[34] = m("div", { class: "title" }, "粗细", -1)),
|
|
2124
2125
|
ie(Ce, {
|
|
2125
2126
|
modelValue: te.value,
|
|
@@ -2130,7 +2131,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2130
2131
|
max: 10
|
|
2131
2132
|
}, null, 8, ["modelValue"])
|
|
2132
2133
|
]),
|
|
2133
|
-
m("div",
|
|
2134
|
+
m("div", Mo, [
|
|
2134
2135
|
$[35] || ($[35] = m("div", { class: "title" }, "透明度", -1)),
|
|
2135
2136
|
ie(Ce, {
|
|
2136
2137
|
modelValue: D.value,
|
|
@@ -2141,17 +2142,17 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2141
2142
|
max: 100
|
|
2142
2143
|
}, null, 8, ["modelValue"])
|
|
2143
2144
|
]),
|
|
2144
|
-
I() != "freedraw" ? (V(), j("div",
|
|
2145
|
+
I() != "freedraw" ? (V(), j("div", Eo, [
|
|
2145
2146
|
$[36] || ($[36] = m("div", { class: "title" }, "样式", -1)),
|
|
2146
|
-
ie(
|
|
2147
|
+
ie(Es, { style: { width: "100%" } })
|
|
2147
2148
|
])) : we("", !0),
|
|
2148
|
-
m("div",
|
|
2149
|
+
m("div", Co, [
|
|
2149
2150
|
$[37] || ($[37] = m("div", { class: "title" }, "风格", -1)),
|
|
2150
|
-
ie(
|
|
2151
|
+
ie(Cs, { style: { width: "100%" } })
|
|
2151
2152
|
]),
|
|
2152
|
-
oe.value ? (V(), j("div",
|
|
2153
|
-
m("div",
|
|
2154
|
-
ie(
|
|
2153
|
+
oe.value ? (V(), j("div", To, [
|
|
2154
|
+
m("div", Po, nt(I() == "arrow" ? "箭头" : "线条") + "类型", 1),
|
|
2155
|
+
ie(Bs, { style: { width: "100%" } })
|
|
2155
2156
|
])) : we("", !0)
|
|
2156
2157
|
], 64)) : we("", !0),
|
|
2157
2158
|
X.value ? (V(), j(We, { key: 3 }, [
|
|
@@ -2159,10 +2160,10 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2159
2160
|
$[46] || ($[46] = m("div", { class: "type-item-title" }, [
|
|
2160
2161
|
m("div", { class: "title" }, "文本设置")
|
|
2161
2162
|
], -1)),
|
|
2162
|
-
m("div",
|
|
2163
|
+
m("div", Bo, [
|
|
2163
2164
|
$[40] || ($[40] = m("div", { class: "title" }, "样式", -1)),
|
|
2164
|
-
m("div",
|
|
2165
|
-
m("div",
|
|
2165
|
+
m("div", zo, [
|
|
2166
|
+
m("div", $o, [
|
|
2166
2167
|
ie(ve, { style: { width: "100%" } }),
|
|
2167
2168
|
ie(ve, {
|
|
2168
2169
|
style: { width: "100%" },
|
|
@@ -2180,15 +2181,15 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2180
2181
|
_: 1
|
|
2181
2182
|
}, 8, ["modelValue"])
|
|
2182
2183
|
]),
|
|
2183
|
-
m("div",
|
|
2184
|
+
m("div", _o, [
|
|
2184
2185
|
ie(hn),
|
|
2185
2186
|
ie(hn)
|
|
2186
2187
|
]),
|
|
2187
|
-
ie(
|
|
2188
|
-
ie(
|
|
2188
|
+
ie(Ts),
|
|
2189
|
+
ie(Ps)
|
|
2189
2190
|
])
|
|
2190
2191
|
]),
|
|
2191
|
-
m("div",
|
|
2192
|
+
m("div", Ao, [
|
|
2192
2193
|
$[42] || ($[42] = m("div", { class: "title" }, "文本颜色", -1)),
|
|
2193
2194
|
ie(re, {
|
|
2194
2195
|
color: Pe.value,
|
|
@@ -2207,14 +2208,14 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2207
2208
|
ref: l,
|
|
2208
2209
|
onClick: $[13] || ($[13] = (zt) => Pn())
|
|
2209
2210
|
}, [
|
|
2210
|
-
Pe.value == "transparent" || !Pe.value ? (V(), j("svg",
|
|
2211
|
+
Pe.value == "transparent" || !Pe.value ? (V(), j("svg", Do, [...$[41] || ($[41] = [
|
|
2211
2212
|
m("use", { "xlink:href": "#icon-wuyanse" }, null, -1)
|
|
2212
2213
|
])])) : (V(), j("div", {
|
|
2213
2214
|
key: 1,
|
|
2214
2215
|
class: "color-box",
|
|
2215
2216
|
style: Ke({ background: Pe.value })
|
|
2216
2217
|
}, null, 4)),
|
|
2217
|
-
m("div",
|
|
2218
|
+
m("div", Fo, nt(Pe.value != "transparent" ? Pe.value.substring(
|
|
2218
2219
|
0,
|
|
2219
2220
|
7
|
|
2220
2221
|
).toUpperCase() : Pe.value), 1)
|
|
@@ -2223,7 +2224,7 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2223
2224
|
_: 1
|
|
2224
2225
|
}, 8, ["color", "options"])
|
|
2225
2226
|
]),
|
|
2226
|
-
m("div",
|
|
2227
|
+
m("div", Oo, [
|
|
2227
2228
|
$[44] || ($[44] = m("div", { class: "title" }, "文本背景色", -1)),
|
|
2228
2229
|
ie(re, {
|
|
2229
2230
|
color: Fe.value,
|
|
@@ -2242,14 +2243,14 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2242
2243
|
ref: o,
|
|
2243
2244
|
onClick: $[14] || ($[14] = (zt) => Tn())
|
|
2244
2245
|
}, [
|
|
2245
|
-
Fe.value == "transparent" || !Fe.value ? (V(), j("svg",
|
|
2246
|
+
Fe.value == "transparent" || !Fe.value ? (V(), j("svg", Lo, [...$[43] || ($[43] = [
|
|
2246
2247
|
m("use", { "xlink:href": "#icon-wuyanse" }, null, -1)
|
|
2247
2248
|
])])) : (V(), j("div", {
|
|
2248
2249
|
key: 1,
|
|
2249
2250
|
class: "color-box",
|
|
2250
2251
|
style: Ke({ background: Fe.value })
|
|
2251
2252
|
}, null, 4)),
|
|
2252
|
-
m("div",
|
|
2253
|
+
m("div", Ro, nt(Fe.value != "transparent" ? Fe.value.substring(
|
|
2253
2254
|
0,
|
|
2254
2255
|
7
|
|
2255
2256
|
).toUpperCase() : Fe.value), 1)
|
|
@@ -2266,8 +2267,8 @@ const Mi = { class: "fill-style-box" }, Ei = ["onClick"], Ci = { class: "svg-ico
|
|
|
2266
2267
|
], 4)) : we("", !0);
|
|
2267
2268
|
};
|
|
2268
2269
|
}
|
|
2269
|
-
}),
|
|
2270
|
-
function
|
|
2270
|
+
}), Yo = /* @__PURE__ */ st(Xo, [["__scopeId", "data-v-00889af3"]]);
|
|
2271
|
+
function Xn(i, t, e) {
|
|
2271
2272
|
if (i && i.length) {
|
|
2272
2273
|
const [n, s] = t, a = Math.PI / 180 * e, o = Math.cos(a), l = Math.sin(a);
|
|
2273
2274
|
for (const r of i) {
|
|
@@ -2276,17 +2277,17 @@ function Rn(i, t, e) {
|
|
|
2276
2277
|
}
|
|
2277
2278
|
}
|
|
2278
2279
|
}
|
|
2279
|
-
function
|
|
2280
|
+
function Vo(i, t) {
|
|
2280
2281
|
return i[0] === t[0] && i[1] === t[1];
|
|
2281
2282
|
}
|
|
2282
|
-
function
|
|
2283
|
+
function jo(i, t, e, n = 1) {
|
|
2283
2284
|
const s = e, a = Math.max(t, 0.1), o = i[0] && i[0][0] && typeof i[0][0] == "number" ? [i] : i, l = [0, 0];
|
|
2284
|
-
if (s) for (const c of o)
|
|
2285
|
+
if (s) for (const c of o) Xn(c, l, s);
|
|
2285
2286
|
const r = (function(c, f, k) {
|
|
2286
2287
|
const d = [];
|
|
2287
2288
|
for (const b of c) {
|
|
2288
2289
|
const B = [...b];
|
|
2289
|
-
|
|
2290
|
+
Vo(B[0], B[B.length - 1]) || B.push([B[0][0], B[0][1]]), B.length > 2 && d.push(B);
|
|
2290
2291
|
}
|
|
2291
2292
|
const v = [];
|
|
2292
2293
|
f = Math.max(f, 0.1);
|
|
@@ -2321,10 +2322,10 @@ function Vo(i, t, e, n = 1) {
|
|
|
2321
2322
|
return v;
|
|
2322
2323
|
})(o, a, n);
|
|
2323
2324
|
if (s) {
|
|
2324
|
-
for (const c of o)
|
|
2325
|
+
for (const c of o) Xn(c, l, -s);
|
|
2325
2326
|
(function(c, f, k) {
|
|
2326
2327
|
const d = [];
|
|
2327
|
-
c.forEach(((v) => d.push(...v))),
|
|
2328
|
+
c.forEach(((v) => d.push(...v))), Xn(d, f, k);
|
|
2328
2329
|
})(r, l, -s);
|
|
2329
2330
|
}
|
|
2330
2331
|
return r;
|
|
@@ -2335,9 +2336,9 @@ function sn(i, t) {
|
|
|
2335
2336
|
let s = t.hachureGap;
|
|
2336
2337
|
s < 0 && (s = 4 * t.strokeWidth), s = Math.round(Math.max(s, 0.1));
|
|
2337
2338
|
let a = 1;
|
|
2338
|
-
return t.roughness >= 1 && (((e = t.randomizer) === null || e === void 0 ? void 0 : e.next()) || Math.random()) > 0.7 && (a = s),
|
|
2339
|
+
return t.roughness >= 1 && (((e = t.randomizer) === null || e === void 0 ? void 0 : e.next()) || Math.random()) > 0.7 && (a = s), jo(i, s, n, a || 1);
|
|
2339
2340
|
}
|
|
2340
|
-
class
|
|
2341
|
+
class Qn {
|
|
2341
2342
|
constructor(t) {
|
|
2342
2343
|
this.helper = t;
|
|
2343
2344
|
}
|
|
@@ -2358,7 +2359,7 @@ function Sn(i) {
|
|
|
2358
2359
|
const t = i[0], e = i[1];
|
|
2359
2360
|
return Math.sqrt(Math.pow(t[0] - e[0], 2) + Math.pow(t[1] - e[1], 2));
|
|
2360
2361
|
}
|
|
2361
|
-
class
|
|
2362
|
+
class Ho extends Qn {
|
|
2362
2363
|
fillPolygons(t, e) {
|
|
2363
2364
|
let n = e.hachureGap;
|
|
2364
2365
|
n < 0 && (n = 4 * e.strokeWidth), n = Math.max(n, 0.1);
|
|
@@ -2367,13 +2368,13 @@ class jo extends Zn {
|
|
|
2367
2368
|
return { type: "fillSketch", ops: this.renderLines(o, e) };
|
|
2368
2369
|
}
|
|
2369
2370
|
}
|
|
2370
|
-
class
|
|
2371
|
+
class Wo extends Qn {
|
|
2371
2372
|
fillPolygons(t, e) {
|
|
2372
2373
|
const n = this._fillPolygons(t, e), s = Object.assign({}, e, { hachureAngle: e.hachureAngle + 90 }), a = this._fillPolygons(t, s);
|
|
2373
2374
|
return n.ops = n.ops.concat(a.ops), n;
|
|
2374
2375
|
}
|
|
2375
2376
|
}
|
|
2376
|
-
class
|
|
2377
|
+
class Uo {
|
|
2377
2378
|
constructor(t) {
|
|
2378
2379
|
this.helper = t;
|
|
2379
2380
|
}
|
|
@@ -2398,7 +2399,7 @@ class Wo {
|
|
|
2398
2399
|
return { type: "fillSketch", ops: n };
|
|
2399
2400
|
}
|
|
2400
2401
|
}
|
|
2401
|
-
class
|
|
2402
|
+
class qo {
|
|
2402
2403
|
constructor(t) {
|
|
2403
2404
|
this.helper = t;
|
|
2404
2405
|
}
|
|
@@ -2420,7 +2421,7 @@ class Uo {
|
|
|
2420
2421
|
})), a;
|
|
2421
2422
|
}
|
|
2422
2423
|
}
|
|
2423
|
-
class
|
|
2424
|
+
class Go {
|
|
2424
2425
|
constructor(t) {
|
|
2425
2426
|
this.helper = t;
|
|
2426
2427
|
}
|
|
@@ -2443,7 +2444,7 @@ class qo {
|
|
|
2443
2444
|
}
|
|
2444
2445
|
}
|
|
2445
2446
|
const dt = {};
|
|
2446
|
-
class
|
|
2447
|
+
class No {
|
|
2447
2448
|
constructor(t) {
|
|
2448
2449
|
this.seed = t;
|
|
2449
2450
|
}
|
|
@@ -2451,33 +2452,33 @@ class Go {
|
|
|
2451
2452
|
return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
|
|
2452
2453
|
}
|
|
2453
2454
|
}
|
|
2454
|
-
const
|
|
2455
|
-
function
|
|
2455
|
+
const Ko = 0, Yn = 1, us = 2, fn = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 };
|
|
2456
|
+
function Vn(i, t) {
|
|
2456
2457
|
return i.type === t;
|
|
2457
2458
|
}
|
|
2458
|
-
function
|
|
2459
|
+
function es(i) {
|
|
2459
2460
|
const t = [], e = (function(o) {
|
|
2460
2461
|
const l = new Array();
|
|
2461
2462
|
for (; o !== ""; ) if (o.match(/^([ \t\r\n,]+)/)) o = o.substr(RegExp.$1.length);
|
|
2462
|
-
else if (o.match(/^([aAcChHlLmMqQsStTvVzZ])/)) l[l.length] = { type:
|
|
2463
|
+
else if (o.match(/^([aAcChHlLmMqQsStTvVzZ])/)) l[l.length] = { type: Ko, text: RegExp.$1 }, o = o.substr(RegExp.$1.length);
|
|
2463
2464
|
else {
|
|
2464
2465
|
if (!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)) return [];
|
|
2465
|
-
l[l.length] = { type:
|
|
2466
|
+
l[l.length] = { type: Yn, text: `${parseFloat(RegExp.$1)}` }, o = o.substr(RegExp.$1.length);
|
|
2466
2467
|
}
|
|
2467
|
-
return l[l.length] = { type:
|
|
2468
|
+
return l[l.length] = { type: us, text: "" }, l;
|
|
2468
2469
|
})(i);
|
|
2469
2470
|
let n = "BOD", s = 0, a = e[s];
|
|
2470
|
-
for (; !
|
|
2471
|
+
for (; !Vn(a, us); ) {
|
|
2471
2472
|
let o = 0;
|
|
2472
2473
|
const l = [];
|
|
2473
2474
|
if (n === "BOD") {
|
|
2474
|
-
if (a.text !== "M" && a.text !== "m") return
|
|
2475
|
+
if (a.text !== "M" && a.text !== "m") return es("M0,0" + i);
|
|
2475
2476
|
s++, o = fn[a.text], n = a.text;
|
|
2476
|
-
} else
|
|
2477
|
+
} else Vn(a, Yn) ? o = fn[n] : (s++, o = fn[a.text], n = a.text);
|
|
2477
2478
|
if (!(s + o < e.length)) throw new Error("Path data ended short");
|
|
2478
2479
|
for (let r = s; r < s + o; r++) {
|
|
2479
2480
|
const c = e[r];
|
|
2480
|
-
if (!
|
|
2481
|
+
if (!Vn(c, Yn)) throw new Error("Param not a number: " + n + "," + c.text);
|
|
2481
2482
|
l[l.length] = +c.text;
|
|
2482
2483
|
}
|
|
2483
2484
|
if (typeof fn[n] != "number") throw new Error("Bad segment: " + n);
|
|
@@ -2488,7 +2489,7 @@ function Qn(i) {
|
|
|
2488
2489
|
}
|
|
2489
2490
|
return t;
|
|
2490
2491
|
}
|
|
2491
|
-
function
|
|
2492
|
+
function zs(i) {
|
|
2492
2493
|
let t = 0, e = 0, n = 0, s = 0;
|
|
2493
2494
|
const a = [];
|
|
2494
2495
|
for (const { key: o, data: l } of i) switch (o) {
|
|
@@ -2558,7 +2559,7 @@ function Bs(i) {
|
|
|
2558
2559
|
}
|
|
2559
2560
|
return a;
|
|
2560
2561
|
}
|
|
2561
|
-
function
|
|
2562
|
+
function $s(i) {
|
|
2562
2563
|
const t = [];
|
|
2563
2564
|
let e = "", n = 0, s = 0, a = 0, o = 0, l = 0, r = 0;
|
|
2564
2565
|
for (const { key: c, data: f } of i) {
|
|
@@ -2598,7 +2599,7 @@ function zs(i) {
|
|
|
2598
2599
|
}
|
|
2599
2600
|
case "A": {
|
|
2600
2601
|
const k = Math.abs(f[0]), d = Math.abs(f[1]), v = f[2], h = f[3], M = f[4], I = f[5], T = f[6];
|
|
2601
|
-
k === 0 || d === 0 ? (t.push({ key: "C", data: [n, s, I, T, I, T] }), n = I, s = T) : (n !== I || s !== T) && (
|
|
2602
|
+
k === 0 || d === 0 ? (t.push({ key: "C", data: [n, s, I, T, I, T] }), n = I, s = T) : (n !== I || s !== T) && (_s(n, s, I, T, k, d, v, h, M).forEach((function(b) {
|
|
2602
2603
|
t.push({ key: "C", data: b });
|
|
2603
2604
|
})), n = I, s = T);
|
|
2604
2605
|
break;
|
|
@@ -2613,7 +2614,7 @@ function zs(i) {
|
|
|
2613
2614
|
function Qt(i, t, e) {
|
|
2614
2615
|
return [i * Math.cos(e) - t * Math.sin(e), i * Math.sin(e) + t * Math.cos(e)];
|
|
2615
2616
|
}
|
|
2616
|
-
function
|
|
2617
|
+
function _s(i, t, e, n, s, a, o, l, r, c) {
|
|
2617
2618
|
const f = (k = o, Math.PI * k / 180);
|
|
2618
2619
|
var k;
|
|
2619
2620
|
let d = [], v = 0, h = 0, M = 0, I = 0;
|
|
@@ -2629,7 +2630,7 @@ function $s(i, t, e, n, s, a, o, l, r, c) {
|
|
|
2629
2630
|
let T = h - v;
|
|
2630
2631
|
if (Math.abs(T) > 120 * Math.PI / 180) {
|
|
2631
2632
|
const D = h, N = e, te = n;
|
|
2632
|
-
h = r && h > v ? v + 120 * Math.PI / 180 * 1 : v + 120 * Math.PI / 180 * -1, d =
|
|
2633
|
+
h = r && h > v ? v + 120 * Math.PI / 180 * 1 : v + 120 * Math.PI / 180 * -1, d = _s(e = M + s * Math.cos(h), n = I + a * Math.sin(h), N, te, s, a, o, 0, r, [h, D, M, I]);
|
|
2633
2634
|
}
|
|
2634
2635
|
T = h - v;
|
|
2635
2636
|
const b = Math.cos(v), B = Math.sin(v), X = Math.cos(h), q = Math.sin(h), se = Math.tan(T / 4), le = 4 / 3 * s * se, oe = 4 / 3 * a * se, ee = [i, t], G = [i + le * B, t - oe * b], he = [e + le * q, n - oe * X], H = [e, n];
|
|
@@ -2644,17 +2645,17 @@ function $s(i, t, e, n, s, a, o, l, r, c) {
|
|
|
2644
2645
|
return D;
|
|
2645
2646
|
}
|
|
2646
2647
|
}
|
|
2647
|
-
const
|
|
2648
|
+
const Jo = { randOffset: function(i, t) {
|
|
2648
2649
|
return ce(i, t);
|
|
2649
2650
|
}, randOffsetWithRange: function(i, t, e) {
|
|
2650
2651
|
return xn(i, t, e);
|
|
2651
2652
|
}, ellipse: function(i, t, e, n, s) {
|
|
2652
|
-
const a =
|
|
2653
|
-
return
|
|
2653
|
+
const a = Ds(e, n, s);
|
|
2654
|
+
return Nn(i, t, s, a).opset;
|
|
2654
2655
|
}, doubleLineOps: function(i, t, e, n, s) {
|
|
2655
2656
|
return Bt(i, t, e, n, s, !0);
|
|
2656
2657
|
} };
|
|
2657
|
-
function
|
|
2658
|
+
function As(i, t, e, n, s) {
|
|
2658
2659
|
return { type: "path", ops: Bt(i, t, e, n, s) };
|
|
2659
2660
|
}
|
|
2660
2661
|
function mn(i, t, e) {
|
|
@@ -2664,20 +2665,20 @@ function mn(i, t, e) {
|
|
|
2664
2665
|
for (let a = 0; a < n - 1; a++) s.push(...Bt(i[a][0], i[a][1], i[a + 1][0], i[a + 1][1], e));
|
|
2665
2666
|
return t && s.push(...Bt(i[n - 1][0], i[n - 1][1], i[0][0], i[0][1], e)), { type: "path", ops: s };
|
|
2666
2667
|
}
|
|
2667
|
-
return n === 2 ?
|
|
2668
|
+
return n === 2 ? As(i[0][0], i[0][1], i[1][0], i[1][1], e) : { type: "path", ops: [] };
|
|
2668
2669
|
}
|
|
2669
|
-
function
|
|
2670
|
+
function Zo(i, t, e, n, s) {
|
|
2670
2671
|
return (function(a, o) {
|
|
2671
2672
|
return mn(a, !0, o);
|
|
2672
2673
|
})([[i, t], [i + e, t], [i + e, t + n], [i, t + n]], s);
|
|
2673
2674
|
}
|
|
2674
|
-
function
|
|
2675
|
+
function hs(i, t) {
|
|
2675
2676
|
if (i.length) {
|
|
2676
|
-
const e = typeof i[0][0] == "number" ? [i] : i, n = gn(e[0], 1 * (1 + 0.2 * t.roughness), t), s = t.disableMultiStroke ? [] : gn(e[0], 1.5 * (1 + 0.22 * t.roughness),
|
|
2677
|
+
const e = typeof i[0][0] == "number" ? [i] : i, n = gn(e[0], 1 * (1 + 0.2 * t.roughness), t), s = t.disableMultiStroke ? [] : gn(e[0], 1.5 * (1 + 0.22 * t.roughness), gs(t));
|
|
2677
2678
|
for (let a = 1; a < e.length; a++) {
|
|
2678
2679
|
const o = e[a];
|
|
2679
2680
|
if (o.length) {
|
|
2680
|
-
const l = gn(o, 1 * (1 + 0.2 * t.roughness), t), r = t.disableMultiStroke ? [] : gn(o, 1.5 * (1 + 0.22 * t.roughness),
|
|
2681
|
+
const l = gn(o, 1 * (1 + 0.2 * t.roughness), t), r = t.disableMultiStroke ? [] : gn(o, 1.5 * (1 + 0.22 * t.roughness), gs(t));
|
|
2681
2682
|
for (const c of l) c.op !== "move" && n.push(c);
|
|
2682
2683
|
for (const c of r) c.op !== "move" && s.push(c);
|
|
2683
2684
|
}
|
|
@@ -2686,37 +2687,37 @@ function us(i, t) {
|
|
|
2686
2687
|
}
|
|
2687
2688
|
return { type: "path", ops: [] };
|
|
2688
2689
|
}
|
|
2689
|
-
function
|
|
2690
|
+
function Ds(i, t, e) {
|
|
2690
2691
|
const n = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(i / 2, 2) + Math.pow(t / 2, 2)) / 2)), s = Math.ceil(Math.max(e.curveStepCount, e.curveStepCount / Math.sqrt(200) * n)), a = 2 * Math.PI / s;
|
|
2691
2692
|
let o = Math.abs(i / 2), l = Math.abs(t / 2);
|
|
2692
2693
|
const r = 1 - e.curveFitting;
|
|
2693
2694
|
return o += ce(o * r, e), l += ce(l * r, e), { increment: a, rx: o, ry: l };
|
|
2694
2695
|
}
|
|
2695
|
-
function
|
|
2696
|
-
const [s, a] =
|
|
2696
|
+
function Nn(i, t, e, n) {
|
|
2697
|
+
const [s, a] = vs(n.increment, i, t, n.rx, n.ry, 1, n.increment * xn(0.1, xn(0.4, 1, e), e), e);
|
|
2697
2698
|
let o = kn(s, null, e);
|
|
2698
2699
|
if (!e.disableMultiStroke && e.roughness !== 0) {
|
|
2699
|
-
const [l] =
|
|
2700
|
+
const [l] = vs(n.increment, i, t, n.rx, n.ry, 1.5, 0, e), r = kn(l, null, e);
|
|
2700
2701
|
o = o.concat(r);
|
|
2701
2702
|
}
|
|
2702
2703
|
return { estimatedPoints: a, opset: { type: "path", ops: o } };
|
|
2703
2704
|
}
|
|
2704
|
-
function
|
|
2705
|
+
function ps(i, t, e, n, s, a, o, l, r) {
|
|
2705
2706
|
const c = i, f = t;
|
|
2706
2707
|
let k = Math.abs(e / 2), d = Math.abs(n / 2);
|
|
2707
2708
|
k += ce(0.01 * k, r), d += ce(0.01 * d, r);
|
|
2708
2709
|
let v = s, h = a;
|
|
2709
2710
|
for (; v < 0; ) v += 2 * Math.PI, h += 2 * Math.PI;
|
|
2710
2711
|
h - v > 2 * Math.PI && (v = 0, h = 2 * Math.PI);
|
|
2711
|
-
const M = 2 * Math.PI / r.curveStepCount, I = Math.min(M / 2, (h - v) / 2), T =
|
|
2712
|
+
const M = 2 * Math.PI / r.curveStepCount, I = Math.min(M / 2, (h - v) / 2), T = ms(I, c, f, k, d, v, h, 1, r);
|
|
2712
2713
|
if (!r.disableMultiStroke) {
|
|
2713
|
-
const b =
|
|
2714
|
+
const b = ms(I, c, f, k, d, v, h, 1.5, r);
|
|
2714
2715
|
T.push(...b);
|
|
2715
2716
|
}
|
|
2716
2717
|
return o && (l ? T.push(...Bt(c, f, c + k * Math.cos(v), f + d * Math.sin(v), r), ...Bt(c, f, c + k * Math.cos(h), f + d * Math.sin(h), r)) : T.push({ op: "lineTo", data: [c, f] }, { op: "lineTo", data: [c + k * Math.cos(v), f + d * Math.sin(v)] })), { type: "path", ops: T };
|
|
2717
2718
|
}
|
|
2718
|
-
function
|
|
2719
|
-
const e = zs(
|
|
2719
|
+
function fs(i, t) {
|
|
2720
|
+
const e = $s(zs(es(i))), n = [];
|
|
2720
2721
|
let s = [0, 0], a = [0, 0];
|
|
2721
2722
|
for (const { key: o, data: l } of e) switch (o) {
|
|
2722
2723
|
case "M":
|
|
@@ -2727,7 +2728,7 @@ function ps(i, t) {
|
|
|
2727
2728
|
break;
|
|
2728
2729
|
case "C": {
|
|
2729
2730
|
const [r, c, f, k, d, v] = l;
|
|
2730
|
-
n.push(...
|
|
2731
|
+
n.push(...Qo(r, c, f, k, d, v, a, t)), a = [d, v];
|
|
2731
2732
|
break;
|
|
2732
2733
|
}
|
|
2733
2734
|
case "Z":
|
|
@@ -2735,7 +2736,7 @@ function ps(i, t) {
|
|
|
2735
2736
|
}
|
|
2736
2737
|
return { type: "path", ops: n };
|
|
2737
2738
|
}
|
|
2738
|
-
function
|
|
2739
|
+
function jn(i, t) {
|
|
2739
2740
|
const e = [];
|
|
2740
2741
|
for (const n of i) if (n.length) {
|
|
2741
2742
|
const s = t.maxRandomnessOffset || 0, a = n.length;
|
|
@@ -2751,52 +2752,52 @@ function Ut(i, t) {
|
|
|
2751
2752
|
let s = e.fillStyle || "hachure";
|
|
2752
2753
|
if (!dt[s]) switch (s) {
|
|
2753
2754
|
case "zigzag":
|
|
2754
|
-
dt[s] || (dt[s] = new
|
|
2755
|
+
dt[s] || (dt[s] = new Ho(n));
|
|
2755
2756
|
break;
|
|
2756
2757
|
case "cross-hatch":
|
|
2757
|
-
dt[s] || (dt[s] = new
|
|
2758
|
+
dt[s] || (dt[s] = new Wo(n));
|
|
2758
2759
|
break;
|
|
2759
2760
|
case "dots":
|
|
2760
|
-
dt[s] || (dt[s] = new
|
|
2761
|
+
dt[s] || (dt[s] = new Uo(n));
|
|
2761
2762
|
break;
|
|
2762
2763
|
case "dashed":
|
|
2763
|
-
dt[s] || (dt[s] = new
|
|
2764
|
+
dt[s] || (dt[s] = new qo(n));
|
|
2764
2765
|
break;
|
|
2765
2766
|
case "zigzag-line":
|
|
2766
|
-
dt[s] || (dt[s] = new
|
|
2767
|
+
dt[s] || (dt[s] = new Go(n));
|
|
2767
2768
|
break;
|
|
2768
2769
|
default:
|
|
2769
|
-
s = "hachure", dt[s] || (dt[s] = new
|
|
2770
|
+
s = "hachure", dt[s] || (dt[s] = new Qn(n));
|
|
2770
2771
|
}
|
|
2771
2772
|
return dt[s];
|
|
2772
|
-
})(t,
|
|
2773
|
+
})(t, Jo).fillPolygons(i, t);
|
|
2773
2774
|
}
|
|
2774
|
-
function
|
|
2775
|
+
function gs(i) {
|
|
2775
2776
|
const t = Object.assign({}, i);
|
|
2776
2777
|
return t.randomizer = void 0, i.seed && (t.seed = i.seed + 1), t;
|
|
2777
2778
|
}
|
|
2778
|
-
function
|
|
2779
|
-
return i.randomizer || (i.randomizer = new
|
|
2779
|
+
function Fs(i) {
|
|
2780
|
+
return i.randomizer || (i.randomizer = new No(i.seed || 0)), i.randomizer.next();
|
|
2780
2781
|
}
|
|
2781
2782
|
function xn(i, t, e, n = 1) {
|
|
2782
|
-
return e.roughness * n * (
|
|
2783
|
+
return e.roughness * n * (Fs(e) * (t - i) + i);
|
|
2783
2784
|
}
|
|
2784
2785
|
function ce(i, t, e = 1) {
|
|
2785
2786
|
return xn(-i, i, t, e);
|
|
2786
2787
|
}
|
|
2787
2788
|
function Bt(i, t, e, n, s, a = !1) {
|
|
2788
|
-
const o = a ? s.disableMultiStrokeFill : s.disableMultiStroke, l =
|
|
2789
|
+
const o = a ? s.disableMultiStrokeFill : s.disableMultiStroke, l = Kn(i, t, e, n, s, !0, !1);
|
|
2789
2790
|
if (o) return l;
|
|
2790
|
-
const r =
|
|
2791
|
+
const r = Kn(i, t, e, n, s, !0, !0);
|
|
2791
2792
|
return l.concat(r);
|
|
2792
2793
|
}
|
|
2793
|
-
function
|
|
2794
|
+
function Kn(i, t, e, n, s, a, o) {
|
|
2794
2795
|
const l = Math.pow(i - e, 2) + Math.pow(t - n, 2), r = Math.sqrt(l);
|
|
2795
2796
|
let c = 1;
|
|
2796
2797
|
c = r < 200 ? 1 : r > 500 ? 0.4 : -16668e-7 * r + 1.233334;
|
|
2797
2798
|
let f = s.maxRandomnessOffset || 0;
|
|
2798
2799
|
f * f * 100 > l && (f = r / 10);
|
|
2799
|
-
const k = f / 2, d = 0.2 + 0.2 *
|
|
2800
|
+
const k = f / 2, d = 0.2 + 0.2 * Fs(s);
|
|
2800
2801
|
let v = s.bowing * s.maxRandomnessOffset * (n - t) / 200, h = s.bowing * s.maxRandomnessOffset * (i - e) / 200;
|
|
2801
2802
|
v = ce(v, s, c), h = ce(h, s, c);
|
|
2802
2803
|
const M = [], I = () => ce(k, s, c), T = () => ce(f, s, c), b = s.preserveVertices;
|
|
@@ -2818,10 +2819,10 @@ function kn(i, t, e) {
|
|
|
2818
2819
|
const r = i[l];
|
|
2819
2820
|
a[0] = [r[0], r[1]], a[1] = [r[0] + (o * i[l + 1][0] - o * i[l - 1][0]) / 6, r[1] + (o * i[l + 1][1] - o * i[l - 1][1]) / 6], a[2] = [i[l + 1][0] + (o * i[l][0] - o * i[l + 2][0]) / 6, i[l + 1][1] + (o * i[l][1] - o * i[l + 2][1]) / 6], a[3] = [i[l + 1][0], i[l + 1][1]], s.push({ op: "bcurveTo", data: [a[1][0], a[1][1], a[2][0], a[2][1], a[3][0], a[3][1]] });
|
|
2820
2821
|
}
|
|
2821
|
-
} else n === 3 ? (s.push({ op: "move", data: [i[1][0], i[1][1]] }), s.push({ op: "bcurveTo", data: [i[1][0], i[1][1], i[2][0], i[2][1], i[2][0], i[2][1]] })) : n === 2 && s.push(...
|
|
2822
|
+
} else n === 3 ? (s.push({ op: "move", data: [i[1][0], i[1][1]] }), s.push({ op: "bcurveTo", data: [i[1][0], i[1][1], i[2][0], i[2][1], i[2][0], i[2][1]] })) : n === 2 && s.push(...Kn(i[0][0], i[0][1], i[1][0], i[1][1], e, !0, !0));
|
|
2822
2823
|
return s;
|
|
2823
2824
|
}
|
|
2824
|
-
function
|
|
2825
|
+
function vs(i, t, e, n, s, a, o, l) {
|
|
2825
2826
|
const r = [], c = [];
|
|
2826
2827
|
if (l.roughness === 0) {
|
|
2827
2828
|
i /= 4, c.push([t + n * Math.cos(-i), e + s * Math.sin(-i)]);
|
|
@@ -2842,13 +2843,13 @@ function gs(i, t, e, n, s, a, o, l) {
|
|
|
2842
2843
|
}
|
|
2843
2844
|
return [c, r];
|
|
2844
2845
|
}
|
|
2845
|
-
function
|
|
2846
|
+
function ms(i, t, e, n, s, a, o, l, r) {
|
|
2846
2847
|
const c = a + ce(0.1, r), f = [];
|
|
2847
2848
|
f.push([ce(l, r) + t + 0.9 * n * Math.cos(c - i), ce(l, r) + e + 0.9 * s * Math.sin(c - i)]);
|
|
2848
2849
|
for (let k = c; k <= o; k += i) f.push([ce(l, r) + t + n * Math.cos(k), ce(l, r) + e + s * Math.sin(k)]);
|
|
2849
2850
|
return f.push([t + n * Math.cos(o), e + s * Math.sin(o)]), f.push([t + n * Math.cos(o), e + s * Math.sin(o)]), kn(f, null, r);
|
|
2850
2851
|
}
|
|
2851
|
-
function
|
|
2852
|
+
function Qo(i, t, e, n, s, a, o, l) {
|
|
2852
2853
|
const r = [], c = [l.maxRandomnessOffset || 1, (l.maxRandomnessOffset || 1) + 0.3];
|
|
2853
2854
|
let f = [0, 0];
|
|
2854
2855
|
const k = l.disableMultiStroke ? 1 : 2, d = l.preserveVertices;
|
|
@@ -2858,7 +2859,7 @@ function Zo(i, t, e, n, s, a, o, l) {
|
|
|
2858
2859
|
function en(i) {
|
|
2859
2860
|
return [...i];
|
|
2860
2861
|
}
|
|
2861
|
-
function
|
|
2862
|
+
function ys(i, t = 0) {
|
|
2862
2863
|
const e = i.length;
|
|
2863
2864
|
if (e < 3) throw new Error("A curve must have at least three points.");
|
|
2864
2865
|
const n = [];
|
|
@@ -2879,7 +2880,7 @@ function ms(i, t = 0) {
|
|
|
2879
2880
|
function yn(i, t) {
|
|
2880
2881
|
return Math.pow(i[0] - t[0], 2) + Math.pow(i[1] - t[1], 2);
|
|
2881
2882
|
}
|
|
2882
|
-
function
|
|
2883
|
+
function ea(i, t, e) {
|
|
2883
2884
|
const n = yn(t, e);
|
|
2884
2885
|
if (n === 0) return yn(i, t);
|
|
2885
2886
|
let s = ((i[0] - t[0]) * (e[0] - t[0]) + (i[1] - t[1]) * (e[1] - t[1])) / n;
|
|
@@ -2888,7 +2889,7 @@ function Qo(i, t, e) {
|
|
|
2888
2889
|
function Lt(i, t, e) {
|
|
2889
2890
|
return [i[0] + (t[0] - i[0]) * e, i[1] + (t[1] - i[1]) * e];
|
|
2890
2891
|
}
|
|
2891
|
-
function
|
|
2892
|
+
function Jn(i, t, e, n) {
|
|
2892
2893
|
const s = n || [];
|
|
2893
2894
|
if ((function(l, r) {
|
|
2894
2895
|
const c = l[r + 0], f = l[r + 1], k = l[r + 2], d = l[r + 3];
|
|
@@ -2905,27 +2906,27 @@ function Kn(i, t, e, n) {
|
|
|
2905
2906
|
s.length ? (a = s[s.length - 1], o = l, Math.sqrt(yn(a, o)) > 1 && s.push(l)) : s.push(l), s.push(i[t + 3]);
|
|
2906
2907
|
} else {
|
|
2907
2908
|
const r = i[t + 0], c = i[t + 1], f = i[t + 2], k = i[t + 3], d = Lt(r, c, 0.5), v = Lt(c, f, 0.5), h = Lt(f, k, 0.5), M = Lt(d, v, 0.5), I = Lt(v, h, 0.5), T = Lt(M, I, 0.5);
|
|
2908
|
-
|
|
2909
|
+
Jn([r, d, M, T], 0, e, s), Jn([T, I, h, k], 0, e, s);
|
|
2909
2910
|
}
|
|
2910
2911
|
var a, o;
|
|
2911
2912
|
return s;
|
|
2912
2913
|
}
|
|
2913
|
-
function
|
|
2914
|
+
function ta(i, t) {
|
|
2914
2915
|
return wn(i, 0, i.length, t);
|
|
2915
2916
|
}
|
|
2916
2917
|
function wn(i, t, e, n, s) {
|
|
2917
2918
|
const a = s || [], o = i[t], l = i[e - 1];
|
|
2918
2919
|
let r = 0, c = 1;
|
|
2919
2920
|
for (let f = t + 1; f < e - 1; ++f) {
|
|
2920
|
-
const k =
|
|
2921
|
+
const k = ea(i[f], o, l);
|
|
2921
2922
|
k > r && (r = k, c = f);
|
|
2922
2923
|
}
|
|
2923
2924
|
return Math.sqrt(r) > n ? (wn(i, t, c + 1, n, a), wn(i, c, e, n, a)) : (a.length || a.push(o), a.push(l)), a;
|
|
2924
2925
|
}
|
|
2925
|
-
function
|
|
2926
|
+
function Hn(i, t = 0.15, e) {
|
|
2926
2927
|
const n = [], s = (i.length - 1) / 3;
|
|
2927
2928
|
for (let a = 0; a < s; a++)
|
|
2928
|
-
|
|
2929
|
+
Jn(i, 3 * a, t, n);
|
|
2929
2930
|
return e && e > 0 ? wn(n, 0, n.length, e) : n;
|
|
2930
2931
|
}
|
|
2931
2932
|
const gt = "none";
|
|
@@ -2944,20 +2945,20 @@ class bn {
|
|
|
2944
2945
|
}
|
|
2945
2946
|
line(t, e, n, s, a) {
|
|
2946
2947
|
const o = this._o(a);
|
|
2947
|
-
return this._d("line", [
|
|
2948
|
+
return this._d("line", [As(t, e, n, s, o)], o);
|
|
2948
2949
|
}
|
|
2949
2950
|
rectangle(t, e, n, s, a) {
|
|
2950
|
-
const o = this._o(a), l = [], r =
|
|
2951
|
+
const o = this._o(a), l = [], r = Zo(t, e, n, s, o);
|
|
2951
2952
|
if (o.fill) {
|
|
2952
2953
|
const c = [[t, e], [t + n, e], [t + n, e + s], [t, e + s]];
|
|
2953
|
-
o.fillStyle === "solid" ? l.push(
|
|
2954
|
+
o.fillStyle === "solid" ? l.push(jn([c], o)) : l.push(Ut([c], o));
|
|
2954
2955
|
}
|
|
2955
2956
|
return o.stroke !== gt && l.push(r), this._d("rectangle", l, o);
|
|
2956
2957
|
}
|
|
2957
2958
|
ellipse(t, e, n, s, a) {
|
|
2958
|
-
const o = this._o(a), l = [], r =
|
|
2959
|
+
const o = this._o(a), l = [], r = Ds(n, s, o), c = Nn(t, e, o, r);
|
|
2959
2960
|
if (o.fill) if (o.fillStyle === "solid") {
|
|
2960
|
-
const f =
|
|
2961
|
+
const f = Nn(t, e, o, r).opset;
|
|
2961
2962
|
f.type = "fillPath", l.push(f);
|
|
2962
2963
|
} else l.push(Ut([c.estimatedPoints], o));
|
|
2963
2964
|
return o.stroke !== gt && l.push(c.opset), this._d("ellipse", l, o);
|
|
@@ -2971,11 +2972,11 @@ class bn {
|
|
|
2971
2972
|
return this._d("linearPath", [mn(t, !1, n)], n);
|
|
2972
2973
|
}
|
|
2973
2974
|
arc(t, e, n, s, a, o, l = !1, r) {
|
|
2974
|
-
const c = this._o(r), f = [], k =
|
|
2975
|
+
const c = this._o(r), f = [], k = ps(t, e, n, s, a, o, l, !0, c);
|
|
2975
2976
|
if (l && c.fill) if (c.fillStyle === "solid") {
|
|
2976
2977
|
const d = Object.assign({}, c);
|
|
2977
2978
|
d.disableMultiStroke = !0;
|
|
2978
|
-
const v =
|
|
2979
|
+
const v = ps(t, e, n, s, a, o, !0, !1, d);
|
|
2979
2980
|
v.type = "fillPath", f.push(v);
|
|
2980
2981
|
} else f.push((function(d, v, h, M, I, T, b) {
|
|
2981
2982
|
const B = d, X = v;
|
|
@@ -2991,15 +2992,15 @@ class bn {
|
|
|
2991
2992
|
return c.stroke !== gt && f.push(k), this._d("arc", f, c);
|
|
2992
2993
|
}
|
|
2993
2994
|
curve(t, e) {
|
|
2994
|
-
const n = this._o(e), s = [], a =
|
|
2995
|
+
const n = this._o(e), s = [], a = hs(t, n);
|
|
2995
2996
|
if (n.fill && n.fill !== gt) if (n.fillStyle === "solid") {
|
|
2996
|
-
const o =
|
|
2997
|
+
const o = hs(t, Object.assign(Object.assign({}, n), { disableMultiStroke: !0, roughness: n.roughness ? n.roughness + n.fillShapeRoughnessGain : 0 }));
|
|
2997
2998
|
s.push({ type: "fillPath", ops: this._mergedShape(o.ops) });
|
|
2998
2999
|
} else {
|
|
2999
3000
|
const o = [], l = t;
|
|
3000
3001
|
if (l.length) {
|
|
3001
3002
|
const r = typeof l[0][0] == "number" ? [l] : l;
|
|
3002
|
-
for (const c of r) c.length < 3 ? o.push(...c) : c.length === 3 ? o.push(...
|
|
3003
|
+
for (const c of r) c.length < 3 ? o.push(...c) : c.length === 3 ? o.push(...Hn(ys([c[0], c[0], c[1], c[2]]), 10, (1 + n.roughness) / 2)) : o.push(...Hn(ys(c), 10, (1 + n.roughness) / 2));
|
|
3003
3004
|
}
|
|
3004
3005
|
o.length && s.push(Ut([o], n));
|
|
3005
3006
|
}
|
|
@@ -3007,17 +3008,17 @@ class bn {
|
|
|
3007
3008
|
}
|
|
3008
3009
|
polygon(t, e) {
|
|
3009
3010
|
const n = this._o(e), s = [], a = mn(t, !0, n);
|
|
3010
|
-
return n.fill && (n.fillStyle === "solid" ? s.push(
|
|
3011
|
+
return n.fill && (n.fillStyle === "solid" ? s.push(jn([t], n)) : s.push(Ut([t], n))), n.stroke !== gt && s.push(a), this._d("polygon", s, n);
|
|
3011
3012
|
}
|
|
3012
3013
|
path(t, e) {
|
|
3013
3014
|
const n = this._o(e), s = [];
|
|
3014
3015
|
if (!t) return this._d("path", s, n);
|
|
3015
3016
|
t = (t || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
|
|
3016
3017
|
const a = n.fill && n.fill !== "transparent" && n.fill !== gt, o = n.stroke !== gt, l = !!(n.simplification && n.simplification < 1), r = (function(f, k, d) {
|
|
3017
|
-
const v = zs(
|
|
3018
|
+
const v = $s(zs(es(f))), h = [];
|
|
3018
3019
|
let M = [], I = [0, 0], T = [];
|
|
3019
3020
|
const b = () => {
|
|
3020
|
-
T.length >= 4 && M.push(...
|
|
3021
|
+
T.length >= 4 && M.push(...Hn(T, k)), T = [];
|
|
3021
3022
|
}, B = () => {
|
|
3022
3023
|
b(), M.length && (h.push(M), M = []);
|
|
3023
3024
|
};
|
|
@@ -3041,15 +3042,15 @@ class bn {
|
|
|
3041
3042
|
if (B(), !d) return h;
|
|
3042
3043
|
const X = [];
|
|
3043
3044
|
for (const q of h) {
|
|
3044
|
-
const se =
|
|
3045
|
+
const se = ta(q, d);
|
|
3045
3046
|
se.length && X.push(se);
|
|
3046
3047
|
}
|
|
3047
3048
|
return X;
|
|
3048
|
-
})(t, 1, l ? 4 - 4 * (n.simplification || 1) : (1 + n.roughness) / 2), c =
|
|
3049
|
+
})(t, 1, l ? 4 - 4 * (n.simplification || 1) : (1 + n.roughness) / 2), c = fs(t, n);
|
|
3049
3050
|
if (a) if (n.fillStyle === "solid") if (r.length === 1) {
|
|
3050
|
-
const f =
|
|
3051
|
+
const f = fs(t, Object.assign(Object.assign({}, n), { disableMultiStroke: !0, roughness: n.roughness ? n.roughness + n.fillShapeRoughnessGain : 0 }));
|
|
3051
3052
|
s.push({ type: "fillPath", ops: this._mergedShape(f.ops) });
|
|
3052
|
-
} else s.push(
|
|
3053
|
+
} else s.push(jn(r, n));
|
|
3053
3054
|
else s.push(Ut(r, n));
|
|
3054
3055
|
return o && (l ? r.forEach(((f) => {
|
|
3055
3056
|
s.push(mn(f, !1, n));
|
|
@@ -3098,7 +3099,7 @@ class bn {
|
|
|
3098
3099
|
return t.filter(((e, n) => n === 0 || e.op !== "move"));
|
|
3099
3100
|
}
|
|
3100
3101
|
}
|
|
3101
|
-
class
|
|
3102
|
+
class na {
|
|
3102
3103
|
constructor(t, e) {
|
|
3103
3104
|
this.canvas = t, this.ctx = this.canvas.getContext("2d"), this.gen = new bn(e);
|
|
3104
3105
|
}
|
|
@@ -3183,7 +3184,7 @@ class ta {
|
|
|
3183
3184
|
}
|
|
3184
3185
|
}
|
|
3185
3186
|
const vn = "http://www.w3.org/2000/svg";
|
|
3186
|
-
class
|
|
3187
|
+
class sa {
|
|
3187
3188
|
constructor(t, e) {
|
|
3188
3189
|
this.svg = t, this.gen = new bn(e);
|
|
3189
3190
|
}
|
|
@@ -3257,9 +3258,9 @@ class na {
|
|
|
3257
3258
|
return this.draw(n);
|
|
3258
3259
|
}
|
|
3259
3260
|
}
|
|
3260
|
-
var
|
|
3261
|
-
const
|
|
3262
|
-
if (
|
|
3261
|
+
var ia = { canvas: (i, t) => new na(i, t), svg: (i, t) => new sa(i, t), generator: (i) => new bn(i), newSeed: () => bn.newSeed() };
|
|
3262
|
+
const xs = /* @__PURE__ */ new Map(), Wn = /* @__PURE__ */ new Map(), oa = (i) => {
|
|
3263
|
+
if (Wn.has(i)) return Wn.get(i);
|
|
3263
3264
|
const t = document.createElement("canvas");
|
|
3264
3265
|
t.width = 40, t.height = 40;
|
|
3265
3266
|
const e = t.getContext("2d");
|
|
@@ -3269,8 +3270,8 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3269
3270
|
const o = 0.024;
|
|
3270
3271
|
e.scale(o, o), e.translate(-512, -512);
|
|
3271
3272
|
const l = new Path2D("M771.09045312 471.64751562L252.89970312 471.64751562c-44.7575625 0-81.03670312 36.20432813-81.03670312 80.87625001l0 343.07339062c0 44.67290625 36.27914062 80.87625 81.03670312 80.87625l518.19173438 0c44.75854688 0 81.04753125-36.20334375 81.04753125-80.87625L852.13896875 552.52376563C852.13798437 507.85184375 815.849 471.64751562 771.09045312 471.64751562zM546.12434375 721.73979687l0 90.04964063c0 18.8409375-15.26864062 34.13123438-34.12926563 34.13123438-18.84979688 0-34.12926563-15.29029687-34.12926562-34.13123438l0-90.04964062c-20.37951562-11.804625-34.13025-33.80835938-34.13025-59.06348438 0-37.7015625 30.55795313-68.2605 68.25951562-68.2605s68.27034375 30.5589375 68.27034375 68.2605C580.26542188 687.9314375 566.52551562 709.93517188 546.12434375 721.73979687zM511.99507812 147.37175c-131.95251562 0-238.92946875 105.46889063-238.92946875 244.04034375l1e-8 105.98273437 477.87075 22.75284375L750.93635938 391.41209375C750.93635938 252.84064062 643.95940625 147.37175 511.99507812 147.37175zM341.36745312 491.406875L341.36745312 389.03876562c0-94.2204375 76.395375-170.627625 170.62664063-170.627625 94.24209375 0 170.627625 76.4071875 170.627625 170.627625l0 104.76309375L341.36745312 491.406875z");
|
|
3272
|
-
return e.fillStyle = i, e.fill(l), e.restore(),
|
|
3273
|
-
},
|
|
3273
|
+
return e.fillStyle = i, e.fill(l), e.restore(), Wn.set(i, t), t;
|
|
3274
|
+
}, aa = (i, t, e, n, s, a, o) => {
|
|
3274
3275
|
if (o === "none") return;
|
|
3275
3276
|
const l = t.width / a, r = t.height / a, c = -e, f = -n, k = c + l / s, d = f + r / s, v = 20, h = Math.floor(c / v) * v, M = Math.floor(f / v) * v;
|
|
3276
3277
|
if (i.save(), o === "dot") {
|
|
@@ -3300,13 +3301,13 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3300
3301
|
i.stroke();
|
|
3301
3302
|
}
|
|
3302
3303
|
i.restore();
|
|
3303
|
-
},
|
|
3304
|
+
}, la = (i, t, e, n, s, a = {}, o = null, l = {}, r = null, c = {}, f = "none", k = null, d = "#FFFFFF") => {
|
|
3304
3305
|
const v = i.getContext("2d");
|
|
3305
3306
|
if (!v) return;
|
|
3306
|
-
const h =
|
|
3307
|
+
const h = ia.canvas(i);
|
|
3307
3308
|
v.clearRect(0, 0, i.width, i.height), v.fillStyle = d, v.fillRect(0, 0, i.width, i.height);
|
|
3308
3309
|
const M = window.devicePixelRatio || 1;
|
|
3309
|
-
v.save(), v.scale(M, M), v.scale(s, s), v.translate(e, n),
|
|
3310
|
+
v.save(), v.scale(M, M), v.scale(s, s), v.translate(e, n), aa(v, i, e, n, s, M, f);
|
|
3310
3311
|
const I = [], T = [], b = [], B = [], X = {};
|
|
3311
3312
|
t.forEach((D) => {
|
|
3312
3313
|
if (D.isDeleted) return;
|
|
@@ -3331,23 +3332,23 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3331
3332
|
D.type === "arrow" || D.type === "line" ? b.push(D) : a[D.id] || N && a[N] ? T.push(D) : I.push(D);
|
|
3332
3333
|
}), I.forEach((D) => {
|
|
3333
3334
|
const N = (r ? D.id === r : !1) || c[D.id], te = o === D.id;
|
|
3334
|
-
|
|
3335
|
+
Un(h, v, D, t, !1, l[D.id], "dashed", N, te, k === D.id);
|
|
3335
3336
|
});
|
|
3336
3337
|
const se = b.filter((D) => a[D.id]), le = [...T, ...se], oe = le.length, ee = oe === 2 ? le.find((D) => D.type === "text" && D.containerId) : null, G = !!(ee && le.find((D) => D.id === ee.containerId)), he = oe > 1 && le[0] && !!le[0].groupIds.find((D) => le.every((N) => N.groupIds.includes(D))), H = oe > 1 && !G ? "solid" : "dashed";
|
|
3337
3338
|
if (T.forEach((D) => {
|
|
3338
3339
|
const N = D.frameId, te = N && a[N], ye = a[D.id], ke = oe === 1 || !he && (!!ye || !te), Ee = (r ? D.id === r : !1) || c[D.id], Pe = o === D.id;
|
|
3339
|
-
|
|
3340
|
+
Un(h, v, D, t, ke, l[D.id], H, Ee, Pe, k === D.id);
|
|
3340
3341
|
}), b.forEach((D) => {
|
|
3341
3342
|
let N = !!a[D.id];
|
|
3342
3343
|
(oe === 1 && N || oe > 1 && he) && (N = !1);
|
|
3343
3344
|
const te = (r ? D.id === r : !1) || c[D.id], ye = o === D.id;
|
|
3344
|
-
|
|
3345
|
+
Un(h, v, D, t, N, l[D.id], H, te, ye, k === D.id);
|
|
3345
3346
|
}), oe > 1 && !G) {
|
|
3346
3347
|
const D = Gt(le);
|
|
3347
3348
|
D && (v.save(), v.translate(D.minX, D.minY), v.strokeStyle = "#6965db", v.lineWidth = 1, v.setLineDash([5, 5]), v.strokeRect(-4, -4, D.width + 8, D.height + 8), v.restore());
|
|
3348
3349
|
}
|
|
3349
3350
|
v.restore();
|
|
3350
|
-
},
|
|
3351
|
+
}, ks = (i, t) => {
|
|
3351
3352
|
if (!i || i === "transparent") return "rgba(0,0,0,0)";
|
|
3352
3353
|
if (i.startsWith("rgb")) return i;
|
|
3353
3354
|
let e = i.replace("#", "");
|
|
@@ -3356,9 +3357,9 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3356
3357
|
return `rgba(${n}, ${s}, ${a}, ${t})`;
|
|
3357
3358
|
}
|
|
3358
3359
|
return i;
|
|
3359
|
-
},
|
|
3360
|
-
const f = (e.backgroundOpacity ?? 100) / 100, k = (e.strokeOpacity ?? 100) / 100, d = e.backgroundColor === "transparent" ? void 0 :
|
|
3361
|
-
stroke:
|
|
3360
|
+
}, Un = (i, t, e, n, s = !1, a = !1, o = "dashed", l = !1, r = !1, c = !1) => {
|
|
3361
|
+
const f = (e.backgroundOpacity ?? 100) / 100, k = (e.strokeOpacity ?? 100) / 100, d = e.backgroundColor === "transparent" ? void 0 : ks(e.backgroundColor, f), h = {
|
|
3362
|
+
stroke: ks(e.strokeColor, k),
|
|
3362
3363
|
fill: d,
|
|
3363
3364
|
fillStyle: e.fillStyle === "solid" ? "solid" : e.fillStyle,
|
|
3364
3365
|
strokeWidth: e.strokeWidth,
|
|
@@ -3495,7 +3496,7 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3495
3496
|
if (Ye === xe) return [0, 1];
|
|
3496
3497
|
};
|
|
3497
3498
|
e.startBinding && (ke = Pe(e.startBinding)), e.endBinding && (Ee = Pe(e.endBinding));
|
|
3498
|
-
const Fe =
|
|
3499
|
+
const Fe = li(D, 20, ke, Ee);
|
|
3499
3500
|
i.path(Fe, H);
|
|
3500
3501
|
} else
|
|
3501
3502
|
i.linearPath(D, H);
|
|
@@ -3514,9 +3515,9 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3514
3515
|
if (xe === $e) return [0, -1];
|
|
3515
3516
|
if (xe === De) return [0, 1];
|
|
3516
3517
|
};
|
|
3517
|
-
e.startBinding && (ke = Pe(e.startBinding)), e.endBinding && (Ee = Pe(e.endBinding)), N =
|
|
3518
|
+
e.startBinding && (ke = Pe(e.startBinding)), e.endBinding && (Ee = Pe(e.endBinding)), N = Zn(e.points, ke, Ee);
|
|
3518
3519
|
}
|
|
3519
|
-
const te = { ...e, points: N }, ye =
|
|
3520
|
+
const te = { ...e, points: N }, ye = si(te);
|
|
3520
3521
|
ye && i.linearPath(ye, h);
|
|
3521
3522
|
}
|
|
3522
3523
|
break;
|
|
@@ -3530,7 +3531,7 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3530
3531
|
case "text":
|
|
3531
3532
|
let b = "";
|
|
3532
3533
|
e.isItalic && (b += "italic "), e.isBold && (b += "bold "), t.font = `${b}${e.fontSize}px ${e.fontFamily}`, t.fillStyle = e.fontColor || e.strokeColor, t.textAlign = e.textAlign || "left", t.textBaseline = "top";
|
|
3533
|
-
const B = Math.round(e.fontSize * 1.25), X = 4, q = Math.max(0, e.width - X * 2), se = Math.max(0, e.height - X * 2), le = (e.text || "").split(`
|
|
3534
|
+
const B = Math.round(e.fontSize * 1.25), X = 4, q = Math.max(0, e.width - X * 2) + 2, se = Math.max(0, e.height - X * 2) + 2, le = (e.text || "").split(`
|
|
3534
3535
|
`), oe = [];
|
|
3535
3536
|
if (le.forEach((H) => {
|
|
3536
3537
|
if (!H) {
|
|
@@ -3579,13 +3580,13 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3579
3580
|
break;
|
|
3580
3581
|
case "image":
|
|
3581
3582
|
if (e.dataURL) {
|
|
3582
|
-
let H =
|
|
3583
|
-
H || (H = new Image(), H.src = e.dataURL,
|
|
3583
|
+
let H = xs.get(e.dataURL);
|
|
3584
|
+
H || (H = new Image(), H.src = e.dataURL, xs.set(e.dataURL, H)), H.complete && H.naturalWidth > 0 && t.drawImage(H, 0, 0, e.width, e.height);
|
|
3584
3585
|
}
|
|
3585
3586
|
break;
|
|
3586
3587
|
}
|
|
3587
3588
|
if (t.globalAlpha = 1, s && !e.containerId && (t.strokeStyle = e.locked ? "#d2e2ff" : "#1e6fff", t.lineWidth = 1, o === "dashed" && t.setLineDash([5, 5]), t.strokeRect(-4, -4, e.width + 8, e.height + 8), t.setLineDash([]), e.locked)) {
|
|
3588
|
-
const se =
|
|
3589
|
+
const se = oa(c ? "#1e6fff" : "black");
|
|
3589
3590
|
se && t.drawImage(se, 0, -50, 40, 40);
|
|
3590
3591
|
}
|
|
3591
3592
|
if (l) {
|
|
@@ -3631,7 +3632,7 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3631
3632
|
t.stroke();
|
|
3632
3633
|
}
|
|
3633
3634
|
t.restore();
|
|
3634
|
-
},
|
|
3635
|
+
}, ra = (i) => {
|
|
3635
3636
|
if (i.length < 3) return i;
|
|
3636
3637
|
let t = [...i];
|
|
3637
3638
|
for (let e = 0; e < 2; e++) {
|
|
@@ -3652,7 +3653,7 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3652
3653
|
n.push(t[t.length - 1]), t = n;
|
|
3653
3654
|
}
|
|
3654
3655
|
return t;
|
|
3655
|
-
},
|
|
3656
|
+
}, ca = (i, t, e, n, s) => {
|
|
3656
3657
|
const a = i.getContext("2d");
|
|
3657
3658
|
if (!a || t.length === 0) return;
|
|
3658
3659
|
a.save();
|
|
@@ -3661,7 +3662,7 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3661
3662
|
const l = Date.now(), r = 1600;
|
|
3662
3663
|
t.forEach((c) => {
|
|
3663
3664
|
if (c.length < 2) return;
|
|
3664
|
-
const f =
|
|
3665
|
+
const f = ra(c);
|
|
3665
3666
|
for (let k = 0; k < f.length - 1; k++) {
|
|
3666
3667
|
const d = f[k], v = f[k + 1];
|
|
3667
3668
|
if (!d || !v) continue;
|
|
@@ -3794,7 +3795,7 @@ const ys = /* @__PURE__ */ new Map(), Hn = /* @__PURE__ */ new Map(), ia = (i) =
|
|
|
3794
3795
|
}
|
|
3795
3796
|
};
|
|
3796
3797
|
let Ze = null;
|
|
3797
|
-
const
|
|
3798
|
+
const da = {
|
|
3798
3799
|
height: "0",
|
|
3799
3800
|
visibility: "hidden",
|
|
3800
3801
|
overflow: "hidden",
|
|
@@ -3804,14 +3805,14 @@ const ca = {
|
|
|
3804
3805
|
right: "0",
|
|
3805
3806
|
whiteSpace: "pre-wrap"
|
|
3806
3807
|
};
|
|
3807
|
-
function
|
|
3808
|
+
function ua(i, t = 1, e = null) {
|
|
3808
3809
|
if (!i) return;
|
|
3809
3810
|
Ze || (Ze = document.createElement("textarea"), (i.parentNode ?? document.body).appendChild(Ze));
|
|
3810
|
-
const { paddingSize: n, borderSize: s, boxSizing: a, contextStyle: o, lineHeight: l } =
|
|
3811
|
+
const { paddingSize: n, borderSize: s, boxSizing: a, contextStyle: o, lineHeight: l } = pa(i);
|
|
3811
3812
|
o.forEach((I) => {
|
|
3812
3813
|
const T = I[0], b = I[1] ?? "";
|
|
3813
3814
|
Ze && Ze.style.setProperty(T, b);
|
|
3814
|
-
}), Object.entries(
|
|
3815
|
+
}), Object.entries(da).forEach(([I, T]) => {
|
|
3815
3816
|
Ze && Ze.style.setProperty(I, T, "important");
|
|
3816
3817
|
}), Ze.style.width = window.getComputedStyle(i).getPropertyValue("width"), Ze.value = i.value || (i.placeholder ?? "");
|
|
3817
3818
|
const r = Ze.scrollHeight;
|
|
@@ -3830,7 +3831,7 @@ function da(i, t = 1, e = null) {
|
|
|
3830
3831
|
};
|
|
3831
3832
|
return Ze && Ze.parentNode && Ze.parentNode.removeChild(Ze), Ze = null, M;
|
|
3832
3833
|
}
|
|
3833
|
-
const
|
|
3834
|
+
const ha = [
|
|
3834
3835
|
"letter-spacing",
|
|
3835
3836
|
"line-height",
|
|
3836
3837
|
"padding-top",
|
|
@@ -3848,14 +3849,14 @@ const ua = [
|
|
|
3848
3849
|
"box-sizing",
|
|
3849
3850
|
"word-break"
|
|
3850
3851
|
];
|
|
3851
|
-
function
|
|
3852
|
-
const t = window.getComputedStyle(i), e = t.getPropertyValue("box-sizing"), n = Number.parseFloat(t.getPropertyValue("padding-bottom")) + Number.parseFloat(t.getPropertyValue("padding-top")), s = Number.parseFloat(t.getPropertyValue("border-bottom-width")) + Number.parseFloat(t.getPropertyValue("border-top-width")), a =
|
|
3852
|
+
function pa(i) {
|
|
3853
|
+
const t = window.getComputedStyle(i), e = t.getPropertyValue("box-sizing"), n = Number.parseFloat(t.getPropertyValue("padding-bottom")) + Number.parseFloat(t.getPropertyValue("padding-top")), s = Number.parseFloat(t.getPropertyValue("border-bottom-width")) + Number.parseFloat(t.getPropertyValue("border-top-width")), a = ha.map((l) => [
|
|
3853
3854
|
l,
|
|
3854
3855
|
t.getPropertyValue(l)
|
|
3855
3856
|
]), o = parseFloat(t.getPropertyValue("line-height"));
|
|
3856
3857
|
return { contextStyle: a, paddingSize: n, borderSize: s, boxSizing: e, lineHeight: o };
|
|
3857
3858
|
}
|
|
3858
|
-
const
|
|
3859
|
+
const fa = { key: 0 }, ga = { key: 1 }, va = /* @__PURE__ */ Qe({
|
|
3859
3860
|
__name: "ContextMenu",
|
|
3860
3861
|
props: {
|
|
3861
3862
|
visible: { type: Boolean },
|
|
@@ -3894,7 +3895,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
3894
3895
|
onMousedown: c[14] || (c[14] = Mt(() => {
|
|
3895
3896
|
}, ["stop"]))
|
|
3896
3897
|
}, [
|
|
3897
|
-
i.isElementSelected ? (V(), j("ul",
|
|
3898
|
+
i.isElementSelected ? (V(), j("ul", fa, [
|
|
3898
3899
|
m("li", {
|
|
3899
3900
|
onClick: c[0] || (c[0] = (f) => l("cut"))
|
|
3900
3901
|
}, [...c[15] || (c[15] = [
|
|
@@ -3953,7 +3954,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
3953
3954
|
m("span", null, "删除", -1),
|
|
3954
3955
|
m("span", { class: "shortcut" }, "Del", -1)
|
|
3955
3956
|
])])
|
|
3956
|
-
])) : (V(), j("ul",
|
|
3957
|
+
])) : (V(), j("ul", ga, [
|
|
3957
3958
|
m("li", {
|
|
3958
3959
|
onClick: c[9] || (c[9] = (f) => l("paste"))
|
|
3959
3960
|
}, [...c[27] || (c[27] = [
|
|
@@ -3975,10 +3976,10 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
3975
3976
|
]))
|
|
3976
3977
|
], 36)) : we("", !0);
|
|
3977
3978
|
}
|
|
3978
|
-
}),
|
|
3979
|
+
}), ma = /* @__PURE__ */ st(va, [["__scopeId", "data-v-22c72497"]]), ya = {
|
|
3979
3980
|
class: "excalidraw-container",
|
|
3980
3981
|
ref: "container"
|
|
3981
|
-
},
|
|
3982
|
+
}, xa = ["width", "height"], ka = `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2"><path d="M20 20H7L3 16C2 15 2 13 3 12L13 2L22 11L20 20Z" fill="white"/></svg>') 0 20, auto`, wa = /* @__PURE__ */ Qe({
|
|
3982
3983
|
__name: "ExcalidrawCanvas",
|
|
3983
3984
|
props: {
|
|
3984
3985
|
elements: {},
|
|
@@ -4115,7 +4116,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
4115
4116
|
if (r.value)
|
|
4116
4117
|
return "grabbing";
|
|
4117
4118
|
const p = e.appState.activeTool === "shapes" ? e.appState.activeToolType : e.appState.activeTool;
|
|
4118
|
-
return p === "hand" ? e.appState.viewLocked ? "not-allowed" : d.value ? "grabbing" : "grab" : p === "selection" ? T.value ? "move" : d.value ? rn(b.value) : "default" : p === "text" ? "text" : p === "eraser" ?
|
|
4119
|
+
return p === "hand" ? e.appState.viewLocked ? "not-allowed" : d.value ? "grabbing" : "grab" : p === "selection" ? T.value ? "move" : d.value ? rn(b.value) : "default" : p === "text" ? "text" : p === "eraser" ? ka : "crosshair";
|
|
4119
4120
|
}, De = U(() => {
|
|
4120
4121
|
if (!G.value) return {};
|
|
4121
4122
|
const p = e.elements.find((u) => u.id === G.value);
|
|
@@ -4182,6 +4183,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
4182
4183
|
width: `${_}px`,
|
|
4183
4184
|
// Allow it to expand? Textarea handles typically fixed or auto-grow
|
|
4184
4185
|
height: `${E}px`,
|
|
4186
|
+
padding: `${4 * t.zoom}px`,
|
|
4185
4187
|
fontSize: `${g}px`,
|
|
4186
4188
|
color: P,
|
|
4187
4189
|
fontFamily: S,
|
|
@@ -4234,17 +4236,17 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
4234
4236
|
L = Se[0], A = Se[1];
|
|
4235
4237
|
}
|
|
4236
4238
|
if (["rectangle", "frame", "square", "process"].includes(S.type))
|
|
4237
|
-
Y ? _ = ft(L, A, S.x, S.y, S.width, S.height, S.angle) : _ =
|
|
4239
|
+
Y ? _ = ft(L, A, S.x, S.y, S.width, S.height, S.angle) : _ = ni(L, A, S.x, S.y, S.width, S.height, S.angle);
|
|
4238
4240
|
else if (["ellipse", "circle"].includes(S.type))
|
|
4239
|
-
Y ? _ = Ct(L, A, S.x, S.y, S.width, S.height, S.angle) : _ =
|
|
4241
|
+
Y ? _ = Ct(L, A, S.x, S.y, S.width, S.height, S.angle) : _ = Gn(L, A, S.x, S.y, S.width, S.height, S.angle);
|
|
4240
4242
|
else if (S.type === "cylinder")
|
|
4241
|
-
Y ? _ =
|
|
4243
|
+
Y ? _ = rs(L, A, S.x, S.y, S.width, S.height, S.angle) : _ = ti(L, A, S.x, S.y, S.width, S.height, S.angle);
|
|
4242
4244
|
else if (["diamond", "decision"].includes(S.type))
|
|
4243
|
-
Y ? _ = At(L, A, S.x, S.y, S.width, S.height, S.angle) : _ =
|
|
4245
|
+
Y ? _ = At(L, A, S.x, S.y, S.width, S.height, S.angle) : _ = Qs(L, A, S.x, S.y, S.width, S.height, S.angle);
|
|
4244
4246
|
else if (["star", "trapezoid", "parallelogram"].includes(S.type)) {
|
|
4245
4247
|
let w = [];
|
|
4246
|
-
S.type === "star" ? w = bt(S.width, S.height) : S.type === "trapezoid" ? w = Ft(S.width, S.height) : S.type === "parallelogram" && (w = Ot(S.width, S.height)), Y ? _ = Dt(L, A, w, S.x, S.y, S.angle) : _ =
|
|
4247
|
-
} else S.type === "freedraw" ? _ = an(L, A, S) : S.type === "text" || S.type === "image" ? _ = ft(L, A, S.x, S.y, S.width, S.height, S.angle) : (S.type === "line" || S.type === "arrow") && (_ =
|
|
4248
|
+
S.type === "star" ? w = bt(S.width, S.height) : S.type === "trapezoid" ? w = Ft(S.width, S.height) : S.type === "parallelogram" && (w = Ot(S.width, S.height)), Y ? _ = Dt(L, A, w, S.x, S.y, S.angle) : _ = ls(L, A, w, S.x, S.y, S.angle);
|
|
4249
|
+
} else S.type === "freedraw" ? _ = an(L, A, S) : S.type === "text" || S.type === "image" ? _ = ft(L, A, S.x, S.y, S.width, S.height, S.angle) : (S.type === "line" || S.type === "arrow") && (_ = Rn(10, L, A, S, e.elements));
|
|
4248
4250
|
if (_)
|
|
4249
4251
|
if (u) {
|
|
4250
4252
|
if (e.appState.selectedElementIds[S.id])
|
|
@@ -4367,11 +4369,11 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
4367
4369
|
else if (["ellipse", "circle"].includes(E.type))
|
|
4368
4370
|
Y = Ct(y, u, E.x, E.y, E.width, E.height, E.angle);
|
|
4369
4371
|
else if (E.type === "cylinder")
|
|
4370
|
-
Y =
|
|
4372
|
+
Y = rs(y, u, E.x, E.y, E.width, E.height, E.angle);
|
|
4371
4373
|
else if (["star", "trapezoid", "parallelogram", "diamond", "decision"].includes(E.type)) {
|
|
4372
4374
|
let L = [];
|
|
4373
|
-
E.type === "star" ? L = bt(E.width, E.height) : E.type === "trapezoid" ? L = Ft(E.width, E.height) : E.type === "parallelogram" ? L = Ot(E.width, E.height) : (E.type === "diamond" || E.type === "decision") && (L =
|
|
4374
|
-
} else E.type === "freedraw" ? Y = ft(y, u, E.x, E.y, E.width, E.height, E.angle) : (E.type === "arrow" || E.type === "line") && (Y =
|
|
4375
|
+
E.type === "star" ? L = bt(E.width, E.height) : E.type === "trapezoid" ? L = Ft(E.width, E.height) : E.type === "parallelogram" ? L = Ot(E.width, E.height) : (E.type === "diamond" || E.type === "decision") && (L = ei(E.width, E.height)), Y = Dt(y, u, L, E.x, E.y, E.angle);
|
|
4376
|
+
} else E.type === "freedraw" ? Y = ft(y, u, E.x, E.y, E.width, E.height, E.angle) : (E.type === "arrow" || E.type === "line") && (Y = Rn(10, y, u, E, e.elements));
|
|
4375
4377
|
if (Y) {
|
|
4376
4378
|
g = E;
|
|
4377
4379
|
break;
|
|
@@ -4618,12 +4620,12 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
4618
4620
|
const ue = qe[0], Re = qe[2];
|
|
4619
4621
|
qe[1] = [(ue[0] + Re[0]) / 2, (ue[1] + Re[1]) / 2];
|
|
4620
4622
|
}
|
|
4621
|
-
const Jt = qe.map((ue) => ue[0]),
|
|
4622
|
-
x:
|
|
4623
|
-
y:
|
|
4624
|
-
width:
|
|
4625
|
-
height:
|
|
4626
|
-
points:
|
|
4623
|
+
const Jt = qe.map((ue) => ue[0]), ts = qe.map((ue) => ue[1]), ns = Math.min(...Jt), Ls = Math.max(...Jt), ss = Math.min(...ts), Rs = Math.max(...ts), is = ns, os = ss, Xs = Ls - ns, Ys = Rs - ss, Vs = qe.map((ue) => [ue[0] - is, ue[1] - os]), Zt = {
|
|
4624
|
+
x: is,
|
|
4625
|
+
y: os,
|
|
4626
|
+
width: Xs,
|
|
4627
|
+
height: Ys,
|
|
4628
|
+
points: Vs,
|
|
4627
4629
|
angle: 0
|
|
4628
4630
|
// Reset angle for simplicity
|
|
4629
4631
|
};
|
|
@@ -5039,7 +5041,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5039
5041
|
};
|
|
5040
5042
|
It(() => te.value, (p) => {
|
|
5041
5043
|
if (G.value) {
|
|
5042
|
-
p && s.value ? et.value =
|
|
5044
|
+
p && s.value ? et.value = ua(s.value, 1, null).height : et.value = "23px";
|
|
5043
5045
|
const x = e.elements.find((y) => y.id === G.value);
|
|
5044
5046
|
if (x && x.type === "text")
|
|
5045
5047
|
if (x.containerId) {
|
|
@@ -5074,7 +5076,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5074
5076
|
}, dn = () => {
|
|
5075
5077
|
const p = Math.min(ne.value.x, ae.value.x), x = Math.min(ne.value.y, ae.value.y), y = Math.max(ne.value.x, ae.value.x), u = Math.max(ne.value.y, ae.value.y);
|
|
5076
5078
|
let C = e.elements.filter((S) => !S.isDeleted && !S.locked).filter((S) => {
|
|
5077
|
-
const _ =
|
|
5079
|
+
const _ = Js(S);
|
|
5078
5080
|
return _.minX >= p && _.maxX <= y && _.minY >= x && _.maxY <= u;
|
|
5079
5081
|
});
|
|
5080
5082
|
const g = new Set(C.map((S) => S.id)), P = /* @__PURE__ */ new Set();
|
|
@@ -5096,8 +5098,8 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5096
5098
|
C = At(p, x, u.x, u.y, u.width, u.height, u.angle);
|
|
5097
5099
|
else if (["star", "trapezoid", "parallelogram"].includes(u.type)) {
|
|
5098
5100
|
let g = [];
|
|
5099
|
-
u.type === "star" ? g = bt(u.width, u.height) : u.type === "trapezoid" ? g = Ft(u.width, u.height) : u.type === "parallelogram" && (g = Ot(u.width, u.height)), C = Dt(p, x, g, u.x, u.y, u.angle) ||
|
|
5100
|
-
} else u.type === "text" || u.type === "image" ? C = p >= u.x && p <= u.x + u.width && x >= u.y && x <= u.y + u.height : (u.type === "line" || u.type === "arrow" || u.type === "freedraw") && (C =
|
|
5101
|
+
u.type === "star" ? g = bt(u.width, u.height) : u.type === "trapezoid" ? g = Ft(u.width, u.height) : u.type === "parallelogram" && (g = Ot(u.width, u.height)), C = Dt(p, x, g, u.x, u.y, u.angle) || ls(p, x, g, u.x, u.y, u.angle);
|
|
5102
|
+
} else u.type === "text" || u.type === "image" ? C = p >= u.x && p <= u.x + u.width && x >= u.y && x <= u.y + u.height : (u.type === "line" || u.type === "arrow" || u.type === "freedraw") && (C = Rn(10, p, x, u));
|
|
5101
5103
|
if (C) {
|
|
5102
5104
|
if (u.groupIds && u.groupIds.length > 0) {
|
|
5103
5105
|
const g = new Set(u.groupIds);
|
|
@@ -5200,7 +5202,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5200
5202
|
if ((p.key === "i" || p.key === "I") && !(p.metaKey || p.ctrlKey) && !G.value) {
|
|
5201
5203
|
p.preventDefault();
|
|
5202
5204
|
const g = e.appState.activeTool;
|
|
5203
|
-
e.setTool("image"),
|
|
5205
|
+
e.setTool("image"), Is().then((P) => {
|
|
5204
5206
|
if (P) {
|
|
5205
5207
|
const S = window.innerWidth / 2 / e.appState.zoom - e.appState.scrollX, _ = window.innerHeight / 2 / e.appState.zoom - e.appState.scrollY;
|
|
5206
5208
|
let E = S - P.width / 2, Y = _ - P.height / 2;
|
|
@@ -5383,7 +5385,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5383
5385
|
y(new Error("文件读取失败"));
|
|
5384
5386
|
}, u.readAsDataURL(p);
|
|
5385
5387
|
});
|
|
5386
|
-
|
|
5388
|
+
bs(() => {
|
|
5387
5389
|
document.removeEventListener("paste", un), window.removeEventListener("resize", c), window.removeEventListener("keydown", $), window.removeEventListener("keyup", jt), n.value?.removeEventListener("wheel", ge), window.removeEventListener("mousedown", _e);
|
|
5388
5390
|
});
|
|
5389
5391
|
const _e = (p) => {
|
|
@@ -5395,7 +5397,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5395
5397
|
const Be = () => {
|
|
5396
5398
|
zt && cancelAnimationFrame(zt), zt = requestAnimationFrame(() => {
|
|
5397
5399
|
if (n.value) {
|
|
5398
|
-
if (
|
|
5400
|
+
if (la(
|
|
5399
5401
|
n.value,
|
|
5400
5402
|
t.elements,
|
|
5401
5403
|
t.scrollX,
|
|
@@ -5409,7 +5411,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5409
5411
|
e.appState.showGrid ? e.appState.gridType : "none",
|
|
5410
5412
|
Pe.value,
|
|
5411
5413
|
e.appState.viewBackgroundColor
|
|
5412
|
-
), tt.value.length > 0 &&
|
|
5414
|
+
), tt.value.length > 0 && ca(
|
|
5413
5415
|
n.value,
|
|
5414
5416
|
tt.value,
|
|
5415
5417
|
e.appState.zoom,
|
|
@@ -5469,7 +5471,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5469
5471
|
if (x) {
|
|
5470
5472
|
x.save();
|
|
5471
5473
|
const y = window.devicePixelRatio || 1;
|
|
5472
|
-
x.setTransform(y, 0, 0, y, 0, 0), x.strokeStyle = "rgba(
|
|
5474
|
+
x.setTransform(y, 0, 0, y, 0, 0), x.strokeStyle = "rgba(30, 111, 255, 0.9)", x.fillStyle = "rgba(30, 111, 255, 0.1)", x.lineWidth = 1;
|
|
5473
5475
|
const u = Math.min(ne.value.x + t.scrollX, ae.value.x + t.scrollX) * t.zoom, C = Math.min(ne.value.y + t.scrollY, ae.value.y + t.scrollY) * t.zoom, g = Math.abs(ne.value.x - ae.value.x) * t.zoom, P = Math.abs(ne.value.y - ae.value.y) * t.zoom;
|
|
5474
5476
|
x.strokeRect(u, C, g, P), x.fillRect(u, C, g, P), x.restore();
|
|
5475
5477
|
}
|
|
@@ -5599,7 +5601,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5599
5601
|
}
|
|
5600
5602
|
});
|
|
5601
5603
|
};
|
|
5602
|
-
function
|
|
5604
|
+
function Os() {
|
|
5603
5605
|
s.value && s.value.focus();
|
|
5604
5606
|
}
|
|
5605
5607
|
return It([
|
|
@@ -5618,7 +5620,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5618
5620
|
e.saveToLocalStorage();
|
|
5619
5621
|
}, { detached: !0 });
|
|
5620
5622
|
}), It(() => e.elements, () => {
|
|
5621
|
-
}), (p, x) => (V(), j("div",
|
|
5623
|
+
}), (p, x) => (V(), j("div", ya, [
|
|
5622
5624
|
m("canvas", {
|
|
5623
5625
|
id: "canvas-container",
|
|
5624
5626
|
ref_key: "canvas",
|
|
@@ -5631,8 +5633,8 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5631
5633
|
onPointerup: Cn,
|
|
5632
5634
|
onDblclick: Ce,
|
|
5633
5635
|
onContextmenu: Mt(f, ["prevent"])
|
|
5634
|
-
}, null, 44,
|
|
5635
|
-
ie(
|
|
5636
|
+
}, null, 44, xa),
|
|
5637
|
+
ie(ma, {
|
|
5636
5638
|
visible: Oe.value.visible,
|
|
5637
5639
|
x: Oe.value.x,
|
|
5638
5640
|
y: Oe.value.y,
|
|
@@ -5645,9 +5647,9 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5645
5647
|
m("div", {
|
|
5646
5648
|
class: "excalidraw-textContainer",
|
|
5647
5649
|
style: Ke({ ...De.value }),
|
|
5648
|
-
onClick:
|
|
5650
|
+
onClick: Os
|
|
5649
5651
|
}, [
|
|
5650
|
-
G.value ?
|
|
5652
|
+
G.value ? js((V(), j("textarea", {
|
|
5651
5653
|
key: 0,
|
|
5652
5654
|
ref_key: "textInput",
|
|
5653
5655
|
ref: s,
|
|
@@ -5666,20 +5668,20 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5666
5668
|
onKeydown: x[2] || (x[2] = Mt(() => {
|
|
5667
5669
|
}, ["stop"]))
|
|
5668
5670
|
}, null, 36)), [
|
|
5669
|
-
[
|
|
5671
|
+
[Hs, te.value]
|
|
5670
5672
|
]) : we("", !0)
|
|
5671
5673
|
], 4)
|
|
5672
5674
|
], 512));
|
|
5673
5675
|
}
|
|
5674
|
-
}),
|
|
5676
|
+
}), ba = /* @__PURE__ */ st(wa, [["__scopeId", "data-v-5aa831b1"]]), Sa = { class: "color-box" }, Ia = ["onClick"], Ma = /* @__PURE__ */ Qe({
|
|
5675
5677
|
__name: "colorStyle",
|
|
5676
5678
|
props: {
|
|
5677
5679
|
modelValue: {},
|
|
5678
5680
|
modelModifiers: {}
|
|
5679
5681
|
},
|
|
5680
|
-
emits: /* @__PURE__ */
|
|
5682
|
+
emits: /* @__PURE__ */ Ws(["colorChange"], ["update:modelValue"]),
|
|
5681
5683
|
setup(i, { emit: t }) {
|
|
5682
|
-
const e =
|
|
5684
|
+
const e = Us(i, "modelValue"), n = t, s = J([
|
|
5683
5685
|
"#FFFFFF",
|
|
5684
5686
|
"#1E6FFF",
|
|
5685
5687
|
"#FF194C",
|
|
@@ -5705,7 +5707,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5705
5707
|
]), a = function(o) {
|
|
5706
5708
|
e.value = o, n("colorChange", o);
|
|
5707
5709
|
};
|
|
5708
|
-
return (o, l) => (V(), j("div",
|
|
5710
|
+
return (o, l) => (V(), j("div", Sa, [
|
|
5709
5711
|
m("div", {
|
|
5710
5712
|
class: Xe(["trans-icon", { active: e.value === "transparent" }]),
|
|
5711
5713
|
onClick: l[0] || (l[0] = (r) => a("transparent"))
|
|
@@ -5719,7 +5721,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5719
5721
|
class: Xe(["color-item", { active: e.value === r }]),
|
|
5720
5722
|
style: Ke({ background: r }),
|
|
5721
5723
|
onClick: (f) => a(r)
|
|
5722
|
-
}, null, 14,
|
|
5724
|
+
}, null, 14, Ia))), 128)),
|
|
5723
5725
|
l[2] || (l[2] = m("div", { class: "color-item-add" }, [
|
|
5724
5726
|
m("svg", { class: "svg-icon" }, [
|
|
5725
5727
|
m("use", { "xlink:href": "#icon-tianjiayanse" })
|
|
@@ -5727,14 +5729,14 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5727
5729
|
], -1))
|
|
5728
5730
|
]));
|
|
5729
5731
|
}
|
|
5730
|
-
}), qt = /* @__PURE__ */ st(
|
|
5732
|
+
}), qt = /* @__PURE__ */ st(Ma, [["__scopeId", "data-v-9b04b94a"]]), Ea = { class: "menu-list" }, Ca = { class: "preferences-list" }, Ta = { class: "preferences-list grid-list" }, Pa = ["onClick"], Ba = { class: "svg-icon" }, za = ["xlink:href"], $a = {
|
|
5731
5733
|
class: "preferences-list",
|
|
5732
5734
|
style: { padding: "12px", display: "flex", "justify-content": "center" }
|
|
5733
|
-
},
|
|
5735
|
+
}, _a = { class: "preference-item" }, Aa = { class: "preference-info" }, Da = { class: "preference-title" }, Fa = { class: "preference-item" }, Oa = { class: "preference-info" }, La = { class: "preference-title" }, Ra = {
|
|
5734
5736
|
key: 1,
|
|
5735
5737
|
class: "board-name-input",
|
|
5736
5738
|
style: { width: "195px", padding: "1px 23px 5px" }
|
|
5737
|
-
},
|
|
5739
|
+
}, Xa = /* @__PURE__ */ Qe({
|
|
5738
5740
|
__name: "BoardName",
|
|
5739
5741
|
setup(i) {
|
|
5740
5742
|
const t = ot(), e = J(!1), n = J(), s = J("");
|
|
@@ -5809,7 +5811,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5809
5811
|
], -1)
|
|
5810
5812
|
])]),
|
|
5811
5813
|
default: Ae(() => [
|
|
5812
|
-
m("div",
|
|
5814
|
+
m("div", Ea, [
|
|
5813
5815
|
ie(M, {
|
|
5814
5816
|
placement: "right-start",
|
|
5815
5817
|
trigger: "click",
|
|
@@ -5841,7 +5843,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5841
5843
|
], -1)
|
|
5842
5844
|
])]),
|
|
5843
5845
|
default: Ae(() => [
|
|
5844
|
-
m("div",
|
|
5846
|
+
m("div", Ca, [
|
|
5845
5847
|
ie(M, {
|
|
5846
5848
|
placement: "right-start",
|
|
5847
5849
|
trigger: "click",
|
|
@@ -5873,19 +5875,19 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5873
5875
|
], -1)
|
|
5874
5876
|
])]),
|
|
5875
5877
|
default: Ae(() => [
|
|
5876
|
-
m("div",
|
|
5878
|
+
m("div", Ta, [
|
|
5877
5879
|
(V(!0), j(We, null, ut(l.value, (b, B) => (V(), j("div", {
|
|
5878
5880
|
key: B,
|
|
5879
5881
|
class: Xe(["grid-item", { active: b.value === r.value }]),
|
|
5880
5882
|
onClick: (X) => d(b)
|
|
5881
5883
|
}, [
|
|
5882
|
-
(V(), j("svg",
|
|
5884
|
+
(V(), j("svg", Ba, [
|
|
5883
5885
|
m("use", {
|
|
5884
5886
|
"xlink:href": `#${b.value === r.value ? b.activeIcon : b.icon}`
|
|
5885
|
-
}, null, 8,
|
|
5887
|
+
}, null, 8, za)
|
|
5886
5888
|
])),
|
|
5887
5889
|
m("div", null, nt(b.label), 1)
|
|
5888
|
-
], 10,
|
|
5890
|
+
], 10, Pa))), 128))
|
|
5889
5891
|
])
|
|
5890
5892
|
]),
|
|
5891
5893
|
_: 1
|
|
@@ -5921,7 +5923,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5921
5923
|
], -1)
|
|
5922
5924
|
])]),
|
|
5923
5925
|
default: Ae(() => [
|
|
5924
|
-
m("div",
|
|
5926
|
+
m("div", $a, [
|
|
5925
5927
|
h[8] || (h[8] = m("div", { class: "title" }, "背景颜色", -1)),
|
|
5926
5928
|
ie(qt, {
|
|
5927
5929
|
modelValue: ze(t).appState.viewBackgroundColor,
|
|
@@ -5932,9 +5934,9 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5932
5934
|
_: 1
|
|
5933
5935
|
}),
|
|
5934
5936
|
h[13] || (h[13] = m("div", { class: "line" }, null, -1)),
|
|
5935
|
-
m("div",
|
|
5936
|
-
m("div",
|
|
5937
|
-
m("div",
|
|
5937
|
+
m("div", _a, [
|
|
5938
|
+
m("div", Aa, [
|
|
5939
|
+
m("div", Da, [
|
|
5938
5940
|
h[9] || (h[9] = m("div", null, "使用滚轮缩放画布", -1)),
|
|
5939
5941
|
ie(I, {
|
|
5940
5942
|
modelValue: ze(t).appState.useWheelZoom,
|
|
@@ -5945,9 +5947,9 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5945
5947
|
h[10] || (h[10] = m("div", { class: "preference-desc" }, "开启后,可通过鼠标滚轮进行缩放画布", -1))
|
|
5946
5948
|
])
|
|
5947
5949
|
]),
|
|
5948
|
-
m("div",
|
|
5949
|
-
m("div",
|
|
5950
|
-
m("div",
|
|
5950
|
+
m("div", Fa, [
|
|
5951
|
+
m("div", Oa, [
|
|
5952
|
+
m("div", La, [
|
|
5951
5953
|
h[11] || (h[11] = m("div", null, " 右键拖拽平移画布 ", -1)),
|
|
5952
5954
|
ie(I, {
|
|
5953
5955
|
modelValue: ze(t).appState.rightClickPan,
|
|
@@ -5989,7 +5991,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
5989
5991
|
class: "board-name-input",
|
|
5990
5992
|
placeholder: "Untitled Document",
|
|
5991
5993
|
onBlur: f
|
|
5992
|
-
}, null, 8, ["modelValue"])) : (V(), j("div",
|
|
5994
|
+
}, null, 8, ["modelValue"])) : (V(), j("div", Ra, nt(s.value), 1)),
|
|
5993
5995
|
e.value ? we("", !0) : (V(), j("div", {
|
|
5994
5996
|
key: 2,
|
|
5995
5997
|
class: "action-item",
|
|
@@ -6002,11 +6004,11 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6002
6004
|
], 4);
|
|
6003
6005
|
};
|
|
6004
6006
|
}
|
|
6005
|
-
}),
|
|
6007
|
+
}), Ya = /* @__PURE__ */ st(Xa, [["__scopeId", "data-v-59262e76"]]), Va = { class: "history-controls glass" }, ja = { class: "svg-icon" }, Ha = ["xlink:href"], Wa = { class: "svg-icon" }, Ua = ["xlink:href"], qa = { class: "zoom-controls glass" }, Ga = /* @__PURE__ */ Qe({
|
|
6006
6008
|
__name: "Footer",
|
|
6007
6009
|
setup(i) {
|
|
6008
6010
|
const t = ot(), e = () => {
|
|
6009
|
-
|
|
6011
|
+
Ns.confirm(
|
|
6010
6012
|
"确定要清空画布吗?",
|
|
6011
6013
|
"提示",
|
|
6012
6014
|
{
|
|
@@ -6033,29 +6035,29 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6033
6035
|
pointerEvents: n.value ? "none" : "auto"
|
|
6034
6036
|
})
|
|
6035
6037
|
}, [
|
|
6036
|
-
m("div",
|
|
6038
|
+
m("div", Va, [
|
|
6037
6039
|
m("div", {
|
|
6038
6040
|
onClick: s,
|
|
6039
6041
|
class: Xe(["tool-item", { disabled: ze(t).historyStep <= 0 }])
|
|
6040
6042
|
}, [
|
|
6041
|
-
(V(), j("svg",
|
|
6043
|
+
(V(), j("svg", ja, [
|
|
6042
6044
|
m("use", {
|
|
6043
6045
|
"xlink:href": `${ze(t).historyStep <= 0 ? "#icon-chexiao-copy" : "#icon-chexiao"}`
|
|
6044
|
-
}, null, 8,
|
|
6046
|
+
}, null, 8, Ha)
|
|
6045
6047
|
]))
|
|
6046
6048
|
], 2),
|
|
6047
6049
|
m("div", {
|
|
6048
6050
|
onClick: a,
|
|
6049
6051
|
class: Xe(["tool-item", { disabled: ze(t).historyStep >= ze(t).history.length - 1 }])
|
|
6050
6052
|
}, [
|
|
6051
|
-
(V(), j("svg",
|
|
6053
|
+
(V(), j("svg", Wa, [
|
|
6052
6054
|
m("use", {
|
|
6053
6055
|
"xlink:href": `${ze(t).historyStep >= ze(t).history.length - 1 ? "#icon-huifu-copy" : "#icon-huifu"}`
|
|
6054
|
-
}, null, 8,
|
|
6056
|
+
}, null, 8, Ua)
|
|
6055
6057
|
]))
|
|
6056
6058
|
], 2)
|
|
6057
6059
|
]),
|
|
6058
|
-
m("div",
|
|
6060
|
+
m("div", qa, [
|
|
6059
6061
|
m("div", {
|
|
6060
6062
|
class: Xe(["tool-item", { active: ze(t).appState.activeTool === "hand" }]),
|
|
6061
6063
|
onClick: r[0] || (r[0] = (c) => o())
|
|
@@ -6106,7 +6108,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6106
6108
|
])
|
|
6107
6109
|
], 4));
|
|
6108
6110
|
}
|
|
6109
|
-
}),
|
|
6111
|
+
}), Na = /* @__PURE__ */ st(Ga, [["__scopeId", "data-v-06dd6954"]]), Ka = /* @__PURE__ */ Qe({
|
|
6110
6112
|
__name: "HelpDialog",
|
|
6111
6113
|
setup(i) {
|
|
6112
6114
|
const t = ot(), e = () => {
|
|
@@ -6128,44 +6130,44 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6128
6130
|
m("i", { class: "ri-close-line" }, null, -1)
|
|
6129
6131
|
])])
|
|
6130
6132
|
]),
|
|
6131
|
-
s[2] || (s[2] =
|
|
6133
|
+
s[2] || (s[2] = qs('<div class="content" data-v-0caac542><div class="column" data-v-0caac542><h3 data-v-0caac542>工具</h3><div class="shortcut-list" data-v-0caac542><div class="item" data-v-0caac542><span data-v-0caac542>抓手 (平移工具)</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>H</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>选择</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>V</kbd> 或 <kbd data-v-0caac542>1</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>图形</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>R</kbd> 或 <kbd data-v-0caac542>2</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>箭头</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>A</kbd> 或 <kbd data-v-0caac542>5</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>线条</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>L</kbd> 或 <kbd data-v-0caac542>6</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>自由书写</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>P</kbd> 或 <kbd data-v-0caac542>7</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>文字</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>T</kbd> 或 <kbd data-v-0caac542>8</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>橡皮</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>E</kbd> 或 <kbd data-v-0caac542>0</kbd></span></div></div><h3 data-v-0caac542>视图</h3><div class="shortcut-list" data-v-0caac542><div class="item" data-v-0caac542><span data-v-0caac542>放大</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>+</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>缩小</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>-</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>重置缩放</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>0</kbd></span></div></div></div><div class="column" data-v-0caac542><h3 data-v-0caac542>编辑器</h3><div class="shortcut-list" data-v-0caac542><div class="item" data-v-0caac542><span data-v-0caac542>全选</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>A</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>删除</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Delete</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>复制</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>C</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>粘贴</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>V</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>剪切</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>X</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>撤销</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>Z</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>重做</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>Shift</kbd><kbd data-v-0caac542>Z</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>组合</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>G</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>取消组合</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Cmd</kbd><kbd data-v-0caac542>Shift</kbd><kbd data-v-0caac542>G</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>置于顶层</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>]</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>置于底层</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>[</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>上移一层</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Option</kbd><kbd data-v-0caac542>]</kbd></span></div><div class="item" data-v-0caac542><span data-v-0caac542>下移一层</span><span class="keys" data-v-0caac542><kbd data-v-0caac542>Option</kbd><kbd data-v-0caac542>[</kbd></span></div></div></div></div>', 1))
|
|
6132
6134
|
])
|
|
6133
6135
|
], 4)) : we("", !0);
|
|
6134
6136
|
}
|
|
6135
|
-
}),
|
|
6137
|
+
}), Ja = /* @__PURE__ */ st(Ka, [["__scopeId", "data-v-0caac542"]]), Za = { class: "popovers-container" }, Qa = { class: "popover-content" }, el = { class: "sub-tools-container" }, tl = ["onClick"], nl = { class: "svg-icon" }, sl = ["xlink:href"], il = {
|
|
6136
6138
|
key: 1,
|
|
6137
6139
|
class: "divider"
|
|
6138
|
-
},
|
|
6140
|
+
}, ol = {
|
|
6139
6141
|
class: "settings-btn",
|
|
6140
6142
|
title: "背景颜色"
|
|
6141
|
-
},
|
|
6143
|
+
}, al = {
|
|
6142
6144
|
key: 0,
|
|
6143
6145
|
class: "svg-icon"
|
|
6144
|
-
},
|
|
6146
|
+
}, ll = { class: "popover-content" }, rl = ["title"], cl = {
|
|
6145
6147
|
key: 0,
|
|
6146
6148
|
class: "svg-icon"
|
|
6147
|
-
},
|
|
6149
|
+
}, dl = {
|
|
6148
6150
|
key: 1,
|
|
6149
6151
|
class: "svg-icon"
|
|
6150
|
-
},
|
|
6152
|
+
}, ul = ["xlink:href"], hl = { class: "popover-content" }, pl = { class: "title" }, fl = { class: "title" }, gl = { class: "title" }, vl = { class: "title" }, ml = {
|
|
6151
6153
|
key: 4,
|
|
6152
6154
|
class: "divider"
|
|
6153
|
-
},
|
|
6155
|
+
}, yl = {
|
|
6154
6156
|
class: "settings-btn",
|
|
6155
6157
|
title: "箭头颜色"
|
|
6156
|
-
},
|
|
6158
|
+
}, xl = {
|
|
6157
6159
|
key: 0,
|
|
6158
6160
|
class: "svg-icon"
|
|
6159
|
-
},
|
|
6161
|
+
}, kl = { class: "popover-content" }, wl = { class: "popover-content" }, bl = {
|
|
6160
6162
|
key: 7,
|
|
6161
6163
|
class: "divider"
|
|
6162
|
-
},
|
|
6164
|
+
}, Sl = {
|
|
6163
6165
|
class: "settings-btn",
|
|
6164
6166
|
title: "文本颜色"
|
|
6165
|
-
},
|
|
6167
|
+
}, Il = ["fill"], Ml = ["fill"], El = ["fill"], Cl = { class: "popover-content" }, Tl = {
|
|
6166
6168
|
key: 9,
|
|
6167
6169
|
class: "font-size-select"
|
|
6168
|
-
},
|
|
6170
|
+
}, Pl = /* @__PURE__ */ Qe({
|
|
6169
6171
|
__name: "FloatingPopovers",
|
|
6170
6172
|
setup(i) {
|
|
6171
6173
|
const t = ot(), e = J(!1), n = J(!1), s = J(!1), a = J(!1), o = J(!1), l = J(!1), r = J(!1), c = J(null), f = J([
|
|
@@ -6188,7 +6190,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6188
6190
|
};
|
|
6189
6191
|
nn(() => {
|
|
6190
6192
|
window.addEventListener("mousedown", k, !0);
|
|
6191
|
-
}),
|
|
6193
|
+
}), bs(() => {
|
|
6192
6194
|
window.removeEventListener("mousedown", k, !0);
|
|
6193
6195
|
});
|
|
6194
6196
|
const d = () => {
|
|
@@ -6370,7 +6372,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6370
6372
|
};
|
|
6371
6373
|
return (O, W) => {
|
|
6372
6374
|
const $e = it("el-popover"), De = it("el-slider"), xe = it("el-option"), Ye = it("el-select");
|
|
6373
|
-
return V(), j("div",
|
|
6375
|
+
return V(), j("div", Za, [
|
|
6374
6376
|
T.value ? (V(), Tt($e, {
|
|
6375
6377
|
key: 0,
|
|
6376
6378
|
placement: "top",
|
|
@@ -6392,25 +6394,25 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6392
6394
|
], -1)
|
|
6393
6395
|
])]),
|
|
6394
6396
|
default: Ae(() => [
|
|
6395
|
-
m("div",
|
|
6396
|
-
m("div",
|
|
6397
|
+
m("div", Qa, [
|
|
6398
|
+
m("div", el, [
|
|
6397
6399
|
(V(!0), j(We, null, ut(f.value, (de) => (V(), j("div", {
|
|
6398
6400
|
key: de.name,
|
|
6399
6401
|
class: Xe(["sub-tool-item", { active: I() === de.name }]),
|
|
6400
6402
|
onClick: (on) => tt(de.name)
|
|
6401
6403
|
}, [
|
|
6402
|
-
(V(), j("svg",
|
|
6404
|
+
(V(), j("svg", nl, [
|
|
6403
6405
|
m("use", {
|
|
6404
6406
|
"xlink:href": `${de.icon}`
|
|
6405
|
-
}, null, 8,
|
|
6407
|
+
}, null, 8, sl)
|
|
6406
6408
|
]))
|
|
6407
|
-
], 10,
|
|
6409
|
+
], 10, tl))), 128))
|
|
6408
6410
|
])
|
|
6409
6411
|
])
|
|
6410
6412
|
]),
|
|
6411
6413
|
_: 1
|
|
6412
6414
|
}, 8, ["visible"])) : we("", !0),
|
|
6413
|
-
T.value ? (V(), j("div",
|
|
6415
|
+
T.value ? (V(), j("div", il)) : we("", !0),
|
|
6414
6416
|
b.value ? (V(), Tt($e, {
|
|
6415
6417
|
key: 2,
|
|
6416
6418
|
placement: "top",
|
|
@@ -6422,8 +6424,8 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6422
6424
|
"onUpdate:visible": W[3] || (W[3] = (de) => e.value = de)
|
|
6423
6425
|
}, {
|
|
6424
6426
|
reference: Ae(() => [
|
|
6425
|
-
m("div",
|
|
6426
|
-
G.value == "transparent" || !G.value ? (V(), j("svg",
|
|
6427
|
+
m("div", ol, [
|
|
6428
|
+
G.value == "transparent" || !G.value ? (V(), j("svg", al, [...W[16] || (W[16] = [
|
|
6427
6429
|
m("use", { "xlink:href": "#icon-wuyanse" }, null, -1)
|
|
6428
6430
|
])])) : (V(), j("div", {
|
|
6429
6431
|
key: 1,
|
|
@@ -6433,9 +6435,9 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6433
6435
|
])
|
|
6434
6436
|
]),
|
|
6435
6437
|
default: Ae(() => [
|
|
6436
|
-
m("div",
|
|
6438
|
+
m("div", ll, [
|
|
6437
6439
|
W[17] || (W[17] = m("div", { class: "title" }, "填充样式", -1)),
|
|
6438
|
-
ie(
|
|
6440
|
+
ie(Ms),
|
|
6439
6441
|
W[18] || (W[18] = m("div", { class: "title" }, "透明度", -1)),
|
|
6440
6442
|
ie(De, {
|
|
6441
6443
|
modelValue: D.value,
|
|
@@ -6470,29 +6472,29 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6470
6472
|
title: I() == "arrow" ? "箭头" : "边框"
|
|
6471
6473
|
}, [
|
|
6472
6474
|
I() !== "arrow" && I() !== "line" ? (V(), j(We, { key: 0 }, [
|
|
6473
|
-
ee.value == "transparent" || !ee.value ? (V(), j("svg",
|
|
6475
|
+
ee.value == "transparent" || !ee.value ? (V(), j("svg", cl, [...W[20] || (W[20] = [
|
|
6474
6476
|
m("use", { "xlink:href": "#icon-wubiankuang" }, null, -1)
|
|
6475
6477
|
])])) : (V(), j("div", {
|
|
6476
6478
|
key: 1,
|
|
6477
6479
|
class: "border-box",
|
|
6478
6480
|
style: Ke({ borderColor: ee.value })
|
|
6479
6481
|
}, null, 4))
|
|
6480
|
-
], 64)) : (V(), j("svg",
|
|
6482
|
+
], 64)) : (V(), j("svg", dl, [
|
|
6481
6483
|
m("use", {
|
|
6482
6484
|
"xlink:href": `#${I() == "line" ? "icon-zhixian" : oe.value == "sharp" ? "icon-zhixianlianjiexian" : "icon-quxian"}`
|
|
6483
|
-
}, null, 8,
|
|
6485
|
+
}, null, 8, ul)
|
|
6484
6486
|
]))
|
|
6485
|
-
], 8,
|
|
6487
|
+
], 8, rl)
|
|
6486
6488
|
]),
|
|
6487
6489
|
default: Ae(() => [
|
|
6488
|
-
m("div",
|
|
6490
|
+
m("div", hl, [
|
|
6489
6491
|
X.value ? (V(), j(We, { key: 0 }, [
|
|
6490
|
-
m("div",
|
|
6491
|
-
ie(
|
|
6492
|
+
m("div", pl, nt(["arrow", "line"].includes(I()) ? "线条" : "描边") + "样式", 1),
|
|
6493
|
+
ie(Es)
|
|
6492
6494
|
], 64)) : we("", !0),
|
|
6493
6495
|
W[22] || (W[22] = m("div", { class: "title" }, "线条风格", -1)),
|
|
6494
|
-
ie(
|
|
6495
|
-
m("div",
|
|
6496
|
+
ie(Cs),
|
|
6497
|
+
m("div", fl, nt(["arrow", "line"].includes(I()) ? "线条" : "描边") + "粗细", 1),
|
|
6496
6498
|
ie(De, {
|
|
6497
6499
|
modelValue: te.value,
|
|
6498
6500
|
"onUpdate:modelValue": W[4] || (W[4] = (de) => te.value = de),
|
|
@@ -6501,7 +6503,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6501
6503
|
min: 1,
|
|
6502
6504
|
max: 10
|
|
6503
6505
|
}, null, 8, ["modelValue"]),
|
|
6504
|
-
m("div",
|
|
6506
|
+
m("div", gl, nt(["arrow", "line"].includes(I()) ? "" : "描边") + "透明度", 1),
|
|
6505
6507
|
ie(De, {
|
|
6506
6508
|
modelValue: N.value,
|
|
6507
6509
|
"onUpdate:modelValue": W[5] || (W[5] = (de) => N.value = de),
|
|
@@ -6518,14 +6520,14 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6518
6520
|
}, null, 8, ["modelValue"])
|
|
6519
6521
|
], 64)),
|
|
6520
6522
|
le.value ? (V(), j(We, { key: 2 }, [
|
|
6521
|
-
m("div",
|
|
6522
|
-
ie(
|
|
6523
|
+
m("div", vl, nt(I() == "arrow" ? "箭头" : "线条") + "类型", 1),
|
|
6524
|
+
ie(Bs)
|
|
6523
6525
|
], 64)) : we("", !0)
|
|
6524
6526
|
])
|
|
6525
6527
|
]),
|
|
6526
6528
|
_: 1
|
|
6527
6529
|
}, 8, ["visible"])) : we("", !0),
|
|
6528
|
-
le.value ? (V(), j("div",
|
|
6530
|
+
le.value ? (V(), j("div", ml)) : we("", !0),
|
|
6529
6531
|
le.value ? (V(), Tt($e, {
|
|
6530
6532
|
key: 5,
|
|
6531
6533
|
placement: "top",
|
|
@@ -6537,8 +6539,8 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6537
6539
|
"onUpdate:visible": W[9] || (W[9] = (de) => s.value = de)
|
|
6538
6540
|
}, {
|
|
6539
6541
|
reference: Ae(() => [
|
|
6540
|
-
m("div",
|
|
6541
|
-
ee.value == "transparent" || !ee.value ? (V(), j("svg",
|
|
6542
|
+
m("div", yl, [
|
|
6543
|
+
ee.value == "transparent" || !ee.value ? (V(), j("svg", xl, [...W[23] || (W[23] = [
|
|
6542
6544
|
m("use", { "xlink:href": "#icon-wuyanse" }, null, -1)
|
|
6543
6545
|
])])) : (V(), j("div", {
|
|
6544
6546
|
key: 1,
|
|
@@ -6548,7 +6550,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6548
6550
|
])
|
|
6549
6551
|
]),
|
|
6550
6552
|
default: Ae(() => [
|
|
6551
|
-
m("div",
|
|
6553
|
+
m("div", kl, [
|
|
6552
6554
|
W[24] || (W[24] = m("div", { class: "title" }, [
|
|
6553
6555
|
m("span", null, "默认颜色")
|
|
6554
6556
|
], -1)),
|
|
@@ -6579,7 +6581,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6579
6581
|
], -1)
|
|
6580
6582
|
])]),
|
|
6581
6583
|
default: Ae(() => [
|
|
6582
|
-
m("div",
|
|
6584
|
+
m("div", wl, [
|
|
6583
6585
|
W[26] || (W[26] = m("div", { class: "title" }, "圆角", -1)),
|
|
6584
6586
|
ie(De, {
|
|
6585
6587
|
modelValue: ye.value,
|
|
@@ -6593,7 +6595,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6593
6595
|
]),
|
|
6594
6596
|
_: 1
|
|
6595
6597
|
})) : we("", !0),
|
|
6596
|
-
se.value && b.value ? (V(), j("div",
|
|
6598
|
+
se.value && b.value ? (V(), j("div", bl)) : we("", !0),
|
|
6597
6599
|
se.value ? (V(), Tt($e, {
|
|
6598
6600
|
key: 8,
|
|
6599
6601
|
placement: "top",
|
|
@@ -6605,7 +6607,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6605
6607
|
"onUpdate:visible": W[13] || (W[13] = (de) => o.value = de)
|
|
6606
6608
|
}, {
|
|
6607
6609
|
reference: Ae(() => [
|
|
6608
|
-
m("div",
|
|
6610
|
+
m("div", Sl, [
|
|
6609
6611
|
(V(), j("svg", {
|
|
6610
6612
|
class: "svg-icon",
|
|
6611
6613
|
viewBox: "0 0 1024 1024",
|
|
@@ -6615,30 +6617,30 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6615
6617
|
d: "M772.144762 747.52L566.369524 223.817143a24.137143 24.137143 0 0 0-24.380953-16.579048H484.449524c-11.702857 0-19.992381 5.36381-24.380953 16.579048L254.293333 747.52c-6.339048 16.579048-4.87619 32.182857 5.36381 46.811429 10.24 14.628571 23.893333 21.942857 41.935238 21.942857 22.918095 0 38.521905-10.727619 47.299048-32.182857l48.761904-123.855239h232.106667l48.761905 123.855239c8.289524 21.455238 23.893333 32.182857 46.811428 32.182857 18.041905 0 31.695238-7.314286 41.935238-21.942857 10.24-14.628571 11.702857-30.232381 5.36381-46.811429h-0.487619z m-25.356191 33.645714c-5.36381 7.801905-12.190476 11.215238-21.455238 11.215238-11.702857 0-19.992381-5.36381-24.380952-16.579047l-49.737143-126.780953a18.870857 18.870857 0 0 0-18.529524-12.678095H394.727619c-9.264762 0-15.60381 4.388571-18.529524 12.678095l-49.737143 126.780953c-4.388571 11.215238-12.678095 16.579048-24.380952 16.579047-9.264762 0-16.579048-3.900952-21.942857-11.702857a24.380952 24.380952 0 0 1-2.925714-24.380952L482.986667 232.594286s0.975238-0.975238 1.950476-0.975238h57.539047s1.462857 0 1.950477 0.975238l205.775238 523.702857a24.380952 24.380952 0 0 1-2.925715 24.380952l-0.487619 0.487619z",
|
|
6616
6618
|
fill: he.value == "transparent" ? "#EEEFF0" : he.value,
|
|
6617
6619
|
"p-id": "4210"
|
|
6618
|
-
}, null, 8,
|
|
6620
|
+
}, null, 8, Il),
|
|
6619
6621
|
m("path", {
|
|
6620
6622
|
d: "M529.310476 338.895238c-2.925714-7.314286-8.289524-10.727619-16.091428-10.727619s-13.165714 3.413333-16.091429 10.727619l-86.79619 220.40381c-2.438095 5.36381-1.462857 10.727619 1.950476 16.091428 3.413333 4.87619 8.289524 7.314286 14.140952 7.314286h173.104762c5.851429 0 10.727619-2.438095 14.140952-7.314286 3.413333-4.87619 3.900952-10.24 1.950477-16.091428l-86.308572-220.40381z m-91.672381 219.428572l76.068572-193.097143 75.580952 193.097143H437.638095z",
|
|
6621
6623
|
fill: he.value == "transparent" ? "#EEEFF0" : he.value,
|
|
6622
6624
|
"p-id": "4211"
|
|
6623
|
-
}, null, 8,
|
|
6625
|
+
}, null, 8, Ml),
|
|
6624
6626
|
m("path", {
|
|
6625
6627
|
d: "M700.952381 775.801905c4.388571 11.215238 12.678095 16.579048 24.380952 16.579047 9.264762 0 16.579048-3.900952 21.455238-11.215238a24.380952 24.380952 0 0 0 2.925715-24.380952L543.939048 233.081905s-0.975238-0.975238-1.950477-0.975238H484.449524s-1.462857 0-1.950476 0.975238L276.72381 756.784762a24.380952 24.380952 0 0 0 2.925714 24.380952c5.36381 7.801905 12.678095 11.702857 21.942857 11.702857 11.702857 0 19.992381-5.36381 24.380952-16.579047l49.737143-126.780953c3.413333-8.289524 9.752381-12.678095 18.529524-12.678095h237.958095c9.264762 0 15.60381 4.388571 18.529524 12.678095l49.737143 126.780953 0.487619-0.487619z m-274.529524-193.097143c-5.851429 0-10.727619-2.438095-14.140952-7.314286a17.066667 17.066667 0 0 1-1.950476-16.091428l86.79619-220.40381c2.925714-7.314286 8.289524-10.727619 16.091429-10.727619s13.165714 3.413333 16.091428 10.727619l86.308572 220.40381c2.438095 5.36381 1.462857 10.727619-1.950477 16.091428-3.413333 4.87619-8.289524 7.314286-14.140952 7.314286H426.422857z",
|
|
6626
6628
|
fill: he.value,
|
|
6627
6629
|
"p-id": "4212"
|
|
6628
|
-
}, null, 8,
|
|
6630
|
+
}, null, 8, El)
|
|
6629
6631
|
], 4))
|
|
6630
6632
|
])
|
|
6631
6633
|
]),
|
|
6632
6634
|
default: Ae(() => [
|
|
6633
|
-
m("div",
|
|
6635
|
+
m("div", Cl, [
|
|
6634
6636
|
W[27] || (W[27] = m("div", { class: "title" }, [
|
|
6635
6637
|
m("span", null, "文本样式")
|
|
6636
6638
|
], -1)),
|
|
6637
|
-
ie(
|
|
6639
|
+
ie(Ts),
|
|
6638
6640
|
W[28] || (W[28] = m("div", { class: "title" }, [
|
|
6639
6641
|
m("span", null, "对齐方式")
|
|
6640
6642
|
], -1)),
|
|
6641
|
-
ie(
|
|
6643
|
+
ie(Ps),
|
|
6642
6644
|
W[29] || (W[29] = m("div", { class: "title" }, [
|
|
6643
6645
|
m("span", null, "字体颜色")
|
|
6644
6646
|
], -1)),
|
|
@@ -6657,7 +6659,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6657
6659
|
]),
|
|
6658
6660
|
_: 1
|
|
6659
6661
|
}, 8, ["visible"])) : we("", !0),
|
|
6660
|
-
se.value ? (V(), j("div",
|
|
6662
|
+
se.value ? (V(), j("div", Tl, [
|
|
6661
6663
|
ie(Ye, {
|
|
6662
6664
|
modelValue: ke.value,
|
|
6663
6665
|
"onUpdate:modelValue": W[14] || (W[14] = (de) => ke.value = de),
|
|
@@ -6677,10 +6679,10 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6677
6679
|
]);
|
|
6678
6680
|
};
|
|
6679
6681
|
}
|
|
6680
|
-
}),
|
|
6682
|
+
}), Bl = /* @__PURE__ */ st(Pl, [["__scopeId", "data-v-1fe4c384"]]), zl = {
|
|
6681
6683
|
key: 0,
|
|
6682
6684
|
class: "divider"
|
|
6683
|
-
},
|
|
6685
|
+
}, $l = ["title"], _l = { class: "svg-icon" }, Al = ["xlink:href"], Dl = /* @__PURE__ */ Qe({
|
|
6684
6686
|
__name: "FloatingPropertiesBar",
|
|
6685
6687
|
props: {
|
|
6686
6688
|
zoom: {},
|
|
@@ -6759,8 +6761,8 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6759
6761
|
m("use", { "xlink:href": "#icon-tuodong" })
|
|
6760
6762
|
], -1)
|
|
6761
6763
|
])], 32),
|
|
6762
|
-
!c.value && !f.value ? (V(), j("div",
|
|
6763
|
-
ie(
|
|
6764
|
+
!c.value && !f.value ? (V(), j("div", zl)) : we("", !0),
|
|
6765
|
+
ie(Bl),
|
|
6764
6766
|
q[2] || (q[2] = m("div", { class: "divider" }, null, -1)),
|
|
6765
6767
|
k.value ? (V(), j("div", {
|
|
6766
6768
|
key: 1,
|
|
@@ -6768,12 +6770,12 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6768
6770
|
onClick: Mt(B, ["stop"]),
|
|
6769
6771
|
title: b.value ? "解除编组" : "编组"
|
|
6770
6772
|
}, [
|
|
6771
|
-
(V(), j("svg",
|
|
6773
|
+
(V(), j("svg", _l, [
|
|
6772
6774
|
m("use", {
|
|
6773
6775
|
"xlink:href": b.value ? "#icon-quxiaobianzu" : "#icon-bianzu"
|
|
6774
|
-
}, null, 8,
|
|
6776
|
+
}, null, 8, Al)
|
|
6775
6777
|
]))
|
|
6776
|
-
], 8,
|
|
6778
|
+
], 8, $l)) : we("", !0),
|
|
6777
6779
|
m("div", {
|
|
6778
6780
|
class: "settings-btn",
|
|
6779
6781
|
onClick: Mt(T, ["stop"]),
|
|
@@ -6785,7 +6787,7 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6785
6787
|
])])
|
|
6786
6788
|
], 4)) : we("", !0);
|
|
6787
6789
|
}
|
|
6788
|
-
}),
|
|
6790
|
+
}), Fl = /* @__PURE__ */ st(Dl, [["__scopeId", "data-v-206d2632"]]), Ol = { class: "app-container" }, ws = /* @__PURE__ */ Qe({
|
|
6789
6791
|
__name: "App",
|
|
6790
6792
|
setup(i) {
|
|
6791
6793
|
const t = ot();
|
|
@@ -6794,30 +6796,30 @@ const pa = { key: 0 }, fa = { key: 1 }, ga = /* @__PURE__ */ Qe({
|
|
|
6794
6796
|
const e = JSON.parse(JSON.stringify(t.elements)), n = JSON.parse(JSON.stringify(t.appState));
|
|
6795
6797
|
return console.log("Canvas Elements:", e), console.log("Canvas Config (AppState):", n), { elements: e, appState: n };
|
|
6796
6798
|
};
|
|
6797
|
-
}), (e, n) => (V(), j("div",
|
|
6798
|
-
ie(
|
|
6799
|
-
ie(
|
|
6800
|
-
ie(
|
|
6801
|
-
ie(
|
|
6799
|
+
}), (e, n) => (V(), j("div", Ol, [
|
|
6800
|
+
ie(Mi),
|
|
6801
|
+
ie(Yo),
|
|
6802
|
+
ie(Ya),
|
|
6803
|
+
ie(ba, {
|
|
6802
6804
|
elements: ze(t).elements,
|
|
6803
6805
|
zoom: ze(t).appState.zoom,
|
|
6804
6806
|
scrollX: ze(t).appState.scrollX,
|
|
6805
6807
|
scrollY: ze(t).appState.scrollY
|
|
6806
6808
|
}, null, 8, ["elements", "zoom", "scrollX", "scrollY"]),
|
|
6807
|
-
ie(
|
|
6809
|
+
ie(Fl, {
|
|
6808
6810
|
zoom: ze(t).appState.zoom,
|
|
6809
6811
|
scrollX: ze(t).appState.scrollX,
|
|
6810
6812
|
scrollY: ze(t).appState.scrollY
|
|
6811
6813
|
}, null, 8, ["zoom", "scrollX", "scrollY"]),
|
|
6812
|
-
ie(
|
|
6813
|
-
ie(
|
|
6814
|
+
ie(Na),
|
|
6815
|
+
ie(Ja)
|
|
6814
6816
|
]));
|
|
6815
6817
|
}
|
|
6816
6818
|
});
|
|
6817
|
-
|
|
6818
|
-
i.component("JvsDraw",
|
|
6819
|
+
ws.install = function(i) {
|
|
6820
|
+
i.component("JvsDraw", ws);
|
|
6819
6821
|
};
|
|
6820
6822
|
export {
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
+
ws as JvsDraw,
|
|
6824
|
+
ws as default
|
|
6823
6825
|
};
|