@netless/appliance-plugin 1.1.14-beta.0 → 1.1.14-beta.1
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/cdn/cdn.js +1 -1
- package/cdn/{fullWorker-CU-58a.js → fullWorker-BPEN62.js} +5 -5
- package/cdn/{subWorker-D5mpo3.js → subWorker-BGZBNP.js} +5 -5
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/fullWorker.js +5 -5
- package/dist/{index-CrpL9wA9.mjs → index-20s2n69K.mjs} +2 -1
- package/dist/index-BEY3BEPC.js +1 -0
- package/dist/{index-B3RMMnuz.mjs → index-DFl78uPi.mjs} +463 -461
- package/dist/index-Dob0H3xr.js +1 -0
- package/dist/subWorker.js +5 -5
- package/package.json +1 -1
- package/dist/index-CKH81YBR.js +0 -1
- package/dist/index-CaVWchrK.js +0 -1
|
@@ -1133,7 +1133,7 @@ function sg(a) {
|
|
|
1133
1133
|
return tg(a, eg | ig);
|
|
1134
1134
|
}
|
|
1135
1135
|
var og = sg;
|
|
1136
|
-
const Pt = /* @__PURE__ */ je(og), Qo = "1.1.14-beta.
|
|
1136
|
+
const Pt = /* @__PURE__ */ je(og), Qo = "1.1.14-beta.1", ng = "@netless/appliance-plugin", ns = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
|
|
1137
1137
|
if (typeof window < "u") {
|
|
1138
1138
|
let a = window.__netlessUA || "";
|
|
1139
1139
|
a += ` ${ng}@${Qo}`, window.__netlessUA = a;
|
|
@@ -1267,7 +1267,7 @@ const jt = class jt {
|
|
|
1267
1267
|
y: Math.floor(p.y - jt.SafeBorderPadding),
|
|
1268
1268
|
width: Math.floor(p.width + jt.SafeBorderPadding * 2),
|
|
1269
1269
|
height: Math.floor(p.height + jt.SafeBorderPadding * 2)
|
|
1270
|
-
}, I = f.options.displayRatio, m = Math.floor(M.x * I),
|
|
1270
|
+
}, I = f.options.displayRatio, m = Math.floor(M.x * I), S = Math.floor(M.y * I), T = Math.floor(M.width * I), N = Math.floor(M.height * I), w = this.isTransparentRectByCanvas(f.context, { x: m, y: S, w: T, h: N });
|
|
1271
1271
|
if (c.removeChild(g), w) {
|
|
1272
1272
|
this.isDelete = !0, console.log("isTransparent===>", this.workId, (C = this.vNodes) == null ? void 0 : C.curNodeMap.size);
|
|
1273
1273
|
return;
|
|
@@ -1390,10 +1390,10 @@ const jt = class jt {
|
|
|
1390
1390
|
const I = t.parent;
|
|
1391
1391
|
if (I) {
|
|
1392
1392
|
if (h && d && n) {
|
|
1393
|
-
const
|
|
1393
|
+
const S = [M.op[0], M.op[1]];
|
|
1394
1394
|
ps(M.op, u, d, c);
|
|
1395
|
-
const T = [M.op[0], M.op[1]],
|
|
1396
|
-
if (M.centerPos = [M.centerPos[0] +
|
|
1395
|
+
const T = [M.op[0], M.op[1]], N = [T[0] - S[0], T[1] - S[1]];
|
|
1396
|
+
if (M.centerPos = [M.centerPos[0] + N[0], M.centerPos[1] + N[1]], M.opt.translate = void 0, M.opt.scale = void 0, M.opt.eraserlines)
|
|
1397
1397
|
for (const w of Object.values(M.opt.eraserlines)) {
|
|
1398
1398
|
const { op: C, thickness: L } = w;
|
|
1399
1399
|
w.thickness = L * Math.max(d[0], d[1]);
|
|
@@ -1402,46 +1402,46 @@ const jt = class jt {
|
|
|
1402
1402
|
}
|
|
1403
1403
|
} else if (c)
|
|
1404
1404
|
if (t.setAttribute("translate", c), M.opt.translate = c, n) {
|
|
1405
|
-
const
|
|
1406
|
-
p = Fi(M.rect,
|
|
1405
|
+
const S = [c[0] * I.worldScaling[0], c[1] * I.worldScaling[1]];
|
|
1406
|
+
p = Fi(M.rect, S), M.rect = p;
|
|
1407
1407
|
} else {
|
|
1408
|
-
const
|
|
1409
|
-
M.rect =
|
|
1408
|
+
const S = jt.getRectFromLayer(I, t.name);
|
|
1409
|
+
M.rect = S || M.rect;
|
|
1410
1410
|
}
|
|
1411
1411
|
else if (Wt(l))
|
|
1412
1412
|
if (t.setAttribute("rotate", l), M.opt.rotate = l, n)
|
|
1413
1413
|
p = un(M.rect, l), M.rect = p;
|
|
1414
1414
|
else {
|
|
1415
|
-
const
|
|
1416
|
-
M.rect =
|
|
1415
|
+
const S = jt.getRectFromLayer(I, t.name);
|
|
1416
|
+
M.rect = S || M.rect;
|
|
1417
1417
|
}
|
|
1418
1418
|
if (g) {
|
|
1419
|
-
const
|
|
1420
|
-
if (
|
|
1421
|
-
for (let T = 0,
|
|
1422
|
-
M.op[T] = N
|
|
1419
|
+
const S = g.get(t.name);
|
|
1420
|
+
if (S)
|
|
1421
|
+
for (let T = 0, N = 0; T < M.op.length; T += 3, N++)
|
|
1422
|
+
M.op[T] = S[N][0], M.op[T + 1] = S[N][1];
|
|
1423
1423
|
}
|
|
1424
1424
|
if (f && ((m = M == null ? void 0 : M.opt) != null && m.thickness) && (M.opt.thickness = f), o && !(h && d && n)) {
|
|
1425
1425
|
if (c) {
|
|
1426
|
-
const
|
|
1427
|
-
const w =
|
|
1426
|
+
const S = M.op.map((T, N) => {
|
|
1427
|
+
const w = N % 3;
|
|
1428
1428
|
return w === 0 ? T + c[0] : w === 1 ? T + c[1] : T;
|
|
1429
1429
|
});
|
|
1430
|
-
if (M.op =
|
|
1430
|
+
if (M.op = S, M.centerPos = [M.centerPos[0] + c[0], M.centerPos[1] + c[1]], M != null && M.opt && (M.opt.translate = void 0), M.opt.eraserlines)
|
|
1431
1431
|
for (const T of Object.values(M.opt.eraserlines)) {
|
|
1432
|
-
const { op:
|
|
1433
|
-
for (let w = 0; w <
|
|
1434
|
-
const C =
|
|
1432
|
+
const { op: N } = T;
|
|
1433
|
+
for (let w = 0; w < N.length; w++) {
|
|
1434
|
+
const C = N[w].map((L, A) => A % 2 ? L + c[1] : L + c[0]);
|
|
1435
1435
|
T.op[w] = C;
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
} else if (Wt(l)) {
|
|
1439
|
-
const
|
|
1440
|
-
if (EM(
|
|
1439
|
+
const S = M.op;
|
|
1440
|
+
if (EM(S, M.centerPos, l), M.op = S, M != null && M.opt && (M.opt.rotate = void 0), M.opt.eraserlines)
|
|
1441
1441
|
for (const T of Object.values(M.opt.eraserlines)) {
|
|
1442
|
-
const { op:
|
|
1443
|
-
for (let w = 0; w <
|
|
1444
|
-
OM(
|
|
1442
|
+
const { op: N } = T;
|
|
1443
|
+
for (let w = 0; w < N.length; w++)
|
|
1444
|
+
OM(N[w], M.centerPos, l);
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
@@ -1638,7 +1638,7 @@ class Go extends W {
|
|
|
1638
1638
|
(C = r.getElementById(w + "")) == null || C.remove();
|
|
1639
1639
|
}), n.clear()), c && this.removeDrawCountNodes(r, c);
|
|
1640
1640
|
let I;
|
|
1641
|
-
const m = [],
|
|
1641
|
+
const m = [], S = r.worldPosition, T = r.worldScaling;
|
|
1642
1642
|
for (let w = 0; w < s.length; w++) {
|
|
1643
1643
|
const { pos: C, points: L } = s[w], { ps: A, rect: j } = this.computDrawPoints(L);
|
|
1644
1644
|
let D;
|
|
@@ -1654,18 +1654,18 @@ class Go extends W {
|
|
|
1654
1654
|
lineWidth: h === et.Stroke || R ? 0 : u
|
|
1655
1655
|
};
|
|
1656
1656
|
I = ht(I, {
|
|
1657
|
-
x: Math.floor((j.x + C[0]) * T[0] +
|
|
1658
|
-
y: Math.floor((j.y + C[1]) * T[1] +
|
|
1657
|
+
x: Math.floor((j.x + C[0]) * T[0] + S[0] - W.SafeBorderPadding),
|
|
1658
|
+
y: Math.floor((j.y + C[1]) * T[1] + S[1] - W.SafeBorderPadding),
|
|
1659
1659
|
w: Math.floor(j.w * T[0] + 2 * W.SafeBorderPadding),
|
|
1660
1660
|
h: Math.floor(j.h * T[1] + 2 * W.SafeBorderPadding)
|
|
1661
1661
|
}), m.push(z);
|
|
1662
1662
|
}
|
|
1663
1663
|
g && (e.scale = g), f && (e.rotate = f), p && (e.translate = p);
|
|
1664
|
-
const
|
|
1664
|
+
const N = new Yt();
|
|
1665
1665
|
if (I) {
|
|
1666
1666
|
this.centerPos = W.getCenterPos(I, r);
|
|
1667
1667
|
const w = h === et.Stroke && !M;
|
|
1668
|
-
|
|
1668
|
+
N.attr({
|
|
1669
1669
|
...e,
|
|
1670
1670
|
normalize: !0,
|
|
1671
1671
|
anchor: [0.5, 0.5],
|
|
@@ -1675,15 +1675,15 @@ class Go extends W {
|
|
|
1675
1675
|
zIndex: d
|
|
1676
1676
|
});
|
|
1677
1677
|
const C = m.map((L) => (L.pos = [L.pos[0] - this.centerPos[0], L.pos[1] - this.centerPos[1]], new ce(L)));
|
|
1678
|
-
|
|
1679
|
-
group:
|
|
1678
|
+
N.append(...C), w && N.seal(), M && (this.scaleType = ct.proportional, this.drawEraserlines({
|
|
1679
|
+
group: N,
|
|
1680
1680
|
eraserlines: M,
|
|
1681
1681
|
pos: this.centerPos,
|
|
1682
1682
|
layer: r
|
|
1683
|
-
})), this.replace(r, o,
|
|
1683
|
+
})), this.replace(r, o, N);
|
|
1684
1684
|
}
|
|
1685
1685
|
if (g || f || p) {
|
|
1686
|
-
const w =
|
|
1686
|
+
const w = N == null ? void 0 : N.getBoundingClientRect();
|
|
1687
1687
|
if (w)
|
|
1688
1688
|
return {
|
|
1689
1689
|
x: Math.floor(w.x - W.SafeBorderPadding),
|
|
@@ -1752,7 +1752,7 @@ class Go extends W {
|
|
|
1752
1752
|
radius: M
|
|
1753
1753
|
}), o > 0 && o < t.length - 1) {
|
|
1754
1754
|
const I = t[o].getAngleByPoints(t[o - 1], t[o + 1]);
|
|
1755
|
-
if (I <
|
|
1755
|
+
if (I < 60 || I > 300) {
|
|
1756
1756
|
const m = (u = l.pop()) == null ? void 0 : u.point.clone();
|
|
1757
1757
|
m && s.push({
|
|
1758
1758
|
taskId: h,
|
|
@@ -1762,9 +1762,9 @@ class Go extends W {
|
|
|
1762
1762
|
radius: M
|
|
1763
1763
|
}]
|
|
1764
1764
|
}), n = t[o].x, r = t[o].y, c = [n, r];
|
|
1765
|
-
const
|
|
1765
|
+
const S = d.x - n, T = d.y - r;
|
|
1766
1766
|
l = [{
|
|
1767
|
-
point: new F(
|
|
1767
|
+
point: new F(S, T, p),
|
|
1768
1768
|
radius: M
|
|
1769
1769
|
}], h = Date.now();
|
|
1770
1770
|
}
|
|
@@ -1793,10 +1793,10 @@ class Go extends W {
|
|
|
1793
1793
|
if (g.setz(Math.min(g.z + 1, this.MAX_REPEAR)), r = Math.min(r, d), h > 1) {
|
|
1794
1794
|
let I = h - 1;
|
|
1795
1795
|
for (; I > 0; ) {
|
|
1796
|
-
const m = this.tmpPoints[I].distance(this.tmpPoints[I - 1]),
|
|
1797
|
-
if (this.tmpPoints[I - 1].z >=
|
|
1796
|
+
const m = this.tmpPoints[I].distance(this.tmpPoints[I - 1]), S = Math.max(this.tmpPoints[I].z - this.uniThickness * m, 0);
|
|
1797
|
+
if (this.tmpPoints[I - 1].z >= S)
|
|
1798
1798
|
break;
|
|
1799
|
-
this.tmpPoints[I - 1].setz(
|
|
1799
|
+
this.tmpPoints[I - 1].setz(S), r = Math.min(r, I - 1), I--;
|
|
1800
1800
|
}
|
|
1801
1801
|
}
|
|
1802
1802
|
} else
|
|
@@ -2100,7 +2100,7 @@ class Zo extends W {
|
|
|
2100
2100
|
const h = t[s], u = h.x - o, d = h.y - n;
|
|
2101
2101
|
if (c.push(new F(u, d)), s > 0 && s < t.length - 1) {
|
|
2102
2102
|
const g = t[s].getAngleByPoints(t[s - 1], t[s + 1]);
|
|
2103
|
-
if (g <
|
|
2103
|
+
if (g < 60 || g > 300) {
|
|
2104
2104
|
const f = (l = c.pop()) == null ? void 0 : l.clone();
|
|
2105
2105
|
f && e.push({
|
|
2106
2106
|
pos: r,
|
|
@@ -2404,16 +2404,16 @@ function Zg(a, i, t, e, s, o) {
|
|
|
2404
2404
|
d = r[u];
|
|
2405
2405
|
var I = a[d], m = i[d];
|
|
2406
2406
|
if (e)
|
|
2407
|
-
var
|
|
2408
|
-
if (!(
|
|
2407
|
+
var S = n ? e(m, I, d, i, a, o) : e(I, m, d, a, i, o);
|
|
2408
|
+
if (!(S === void 0 ? I === m || s(I, m, t, e, o) : S)) {
|
|
2409
2409
|
p = !1;
|
|
2410
2410
|
break;
|
|
2411
2411
|
}
|
|
2412
2412
|
M || (M = d == "constructor");
|
|
2413
2413
|
}
|
|
2414
2414
|
if (p && !M) {
|
|
2415
|
-
var T = a.constructor,
|
|
2416
|
-
T !=
|
|
2415
|
+
var T = a.constructor, N = i.constructor;
|
|
2416
|
+
T != N && "constructor" in a && "constructor" in i && !(typeof T == "function" && T instanceof T && typeof N == "function" && N instanceof N) && (p = !1);
|
|
2417
2417
|
}
|
|
2418
2418
|
return o.delete(a), o.delete(i), p;
|
|
2419
2419
|
}
|
|
@@ -2706,7 +2706,7 @@ const we = /* @__PURE__ */ je(lf), fi = class fi extends W {
|
|
|
2706
2706
|
return t === v.Ellipse || t === v.Triangle || t === v.Rectangle || t === v.Polygon || t === v.Star || t === v.SpeechBalloon;
|
|
2707
2707
|
}
|
|
2708
2708
|
async updateSelector(t) {
|
|
2709
|
-
var
|
|
2709
|
+
var N;
|
|
2710
2710
|
const { updateSelectorOpt: e, selectIds: s, vNodes: o, willSerializeData: n, worker: r, offset: c } = t, l = this.fullLayer;
|
|
2711
2711
|
if (!l)
|
|
2712
2712
|
return;
|
|
@@ -2735,7 +2735,7 @@ const we = /* @__PURE__ */ je(lf), fi = class fi extends W {
|
|
|
2735
2735
|
const z = { ...e };
|
|
2736
2736
|
let E;
|
|
2737
2737
|
if (L) {
|
|
2738
|
-
z.thickness && C.opt.thickness && (D = C.opt.thickness !== z.thickness), z.strokeType && ((
|
|
2738
|
+
z.thickness && C.opt.thickness && (D = C.opt.thickness !== z.thickness), z.strokeType && ((N = C.opt) != null && N.strokeType) && (R = C.opt.strokeType !== z.strokeType), E = m == null ? void 0 : m.get(w);
|
|
2739
2739
|
const st = nn(L);
|
|
2740
2740
|
if (st == null || st.updateNodeOpt({
|
|
2741
2741
|
node: j,
|
|
@@ -2780,13 +2780,13 @@ const we = /* @__PURE__ */ je(lf), fi = class fi extends W {
|
|
|
2780
2780
|
}
|
|
2781
2781
|
}
|
|
2782
2782
|
m && g === P.Done && (o.deleteLastTarget(), m = void 0);
|
|
2783
|
-
const
|
|
2784
|
-
if (d && p && I && M &&
|
|
2783
|
+
const S = h;
|
|
2784
|
+
if (d && p && I && M && S && !c) {
|
|
2785
2785
|
const w = [
|
|
2786
|
-
[
|
|
2787
|
-
[
|
|
2788
|
-
[
|
|
2789
|
-
[
|
|
2786
|
+
[S.x, S.y],
|
|
2787
|
+
[S.x + S.w, S.y],
|
|
2788
|
+
[S.x + S.w, S.y + S.h],
|
|
2789
|
+
[S.x, S.y + S.h]
|
|
2790
2790
|
];
|
|
2791
2791
|
let C;
|
|
2792
2792
|
switch (M) {
|
|
@@ -2814,15 +2814,15 @@ const we = /* @__PURE__ */ je(lf), fi = class fi extends W {
|
|
|
2814
2814
|
this.getSelecteorInfo(u), this.draw(H, l, {
|
|
2815
2815
|
selectIds: s || [],
|
|
2816
2816
|
subNodeMap: u,
|
|
2817
|
-
intersectRect:
|
|
2817
|
+
intersectRect: S
|
|
2818
2818
|
});
|
|
2819
|
-
const T = ht(this.oldSelectRect,
|
|
2820
|
-
return this.oldSelectRect =
|
|
2819
|
+
const T = ht(this.oldSelectRect, S);
|
|
2820
|
+
return this.oldSelectRect = S, {
|
|
2821
2821
|
type: x.Select,
|
|
2822
2822
|
dataType: U.Local,
|
|
2823
|
-
selectRect:
|
|
2823
|
+
selectRect: S,
|
|
2824
2824
|
renderRect: h,
|
|
2825
|
-
rect: ht(T,
|
|
2825
|
+
rect: ht(T, S),
|
|
2826
2826
|
selectIds: s
|
|
2827
2827
|
};
|
|
2828
2828
|
}
|
|
@@ -2986,11 +2986,11 @@ class qo extends W {
|
|
|
2986
2986
|
};
|
|
2987
2987
|
}
|
|
2988
2988
|
draw(t) {
|
|
2989
|
-
const { workId: e, layer: s } = t, { strokeColor: o, thickness: n, zIndex: r, scale: c, rotate: l, translate: h, strokeType: u, eraserlines: d } = this.workOptions, g = s.worldPosition, f = s.worldScaling, { points: p, pos: M, rect: I, isTriangle: m, trianglePoints:
|
|
2989
|
+
const { workId: e, layer: s } = t, { strokeColor: o, thickness: n, zIndex: r, scale: c, rotate: l, translate: h, strokeType: u, eraserlines: d } = this.workOptions, g = s.worldPosition, f = s.worldScaling, { points: p, pos: M, rect: I, isTriangle: m, trianglePoints: S, trianglePos: T } = this.computDrawPoints(n), N = [
|
|
2990
2990
|
I.x + I.w / 2,
|
|
2991
2991
|
I.y + I.h / 2
|
|
2992
2992
|
], w = {
|
|
2993
|
-
pos:
|
|
2993
|
+
pos: N,
|
|
2994
2994
|
name: e,
|
|
2995
2995
|
id: e,
|
|
2996
2996
|
zIndex: r,
|
|
@@ -2999,8 +2999,8 @@ class qo extends W {
|
|
|
2999
2999
|
};
|
|
3000
3000
|
c && (w.scale = c), l && (w.rotate = l), h && (w.translate = h);
|
|
3001
3001
|
const C = new Yt(w), L = {
|
|
3002
|
-
points:
|
|
3003
|
-
pos: [T[0] -
|
|
3002
|
+
points: S,
|
|
3003
|
+
pos: [T[0] - N[0], T[1] - N[1]],
|
|
3004
3004
|
fillColor: o,
|
|
3005
3005
|
strokeColor: o,
|
|
3006
3006
|
lineWidth: 0,
|
|
@@ -3009,7 +3009,7 @@ class qo extends W {
|
|
|
3009
3009
|
if (C.append(A), !m && p && M) {
|
|
3010
3010
|
const j = {
|
|
3011
3011
|
points: p,
|
|
3012
|
-
pos: [M[0] -
|
|
3012
|
+
pos: [M[0] - N[0], M[1] - N[1]],
|
|
3013
3013
|
fillColor: o,
|
|
3014
3014
|
strokeColor: o,
|
|
3015
3015
|
lineDash: u === et.Dotted && !m ? [1, n * 2] : u === et.LongDotted && !m ? [n, n * 2] : void 0,
|
|
@@ -3022,7 +3022,7 @@ class qo extends W {
|
|
|
3022
3022
|
if (d && (this.scaleType = ct.proportional, this.drawEraserlines({
|
|
3023
3023
|
group: C,
|
|
3024
3024
|
eraserlines: d,
|
|
3025
|
-
pos:
|
|
3025
|
+
pos: N,
|
|
3026
3026
|
layer: s
|
|
3027
3027
|
})), this.replace(s, e, C), c || l || h) {
|
|
3028
3028
|
const j = C.getBoundingClientRect();
|
|
@@ -3177,7 +3177,7 @@ class Ko extends W {
|
|
|
3177
3177
|
};
|
|
3178
3178
|
}
|
|
3179
3179
|
draw(t) {
|
|
3180
|
-
const { workId: e, layer: s, isDrawing: o } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, scale: h, rotate: u, translate: d, strokeType: g, eraserlines: f } = this.workOptions, p = s.worldScaling, { radius: M, rect: I, pos: m } = this.computDrawPoints(c),
|
|
3180
|
+
const { workId: e, layer: s, isDrawing: o } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, scale: h, rotate: u, translate: d, strokeType: g, eraserlines: f } = this.workOptions, p = s.worldScaling, { radius: M, rect: I, pos: m } = this.computDrawPoints(c), S = {
|
|
3181
3181
|
pos: m,
|
|
3182
3182
|
name: e,
|
|
3183
3183
|
id: e,
|
|
@@ -3198,7 +3198,7 @@ class Ko extends W {
|
|
|
3198
3198
|
size: [I.w, I.h]
|
|
3199
3199
|
};
|
|
3200
3200
|
h && (T.scale = h), u && (T.rotate = u), d && (T.translate = d);
|
|
3201
|
-
const
|
|
3201
|
+
const N = new Yt(T);
|
|
3202
3202
|
if (o) {
|
|
3203
3203
|
const L = new ce({
|
|
3204
3204
|
d: "M-4,0H4M0,-4V4",
|
|
@@ -3208,19 +3208,19 @@ class Ko extends W {
|
|
|
3208
3208
|
lineWidth: 1,
|
|
3209
3209
|
scale: [1 / p[0], 1 / p[1]]
|
|
3210
3210
|
});
|
|
3211
|
-
|
|
3211
|
+
N.append(L);
|
|
3212
3212
|
}
|
|
3213
3213
|
const w = new vn({
|
|
3214
|
-
...
|
|
3214
|
+
...S,
|
|
3215
3215
|
pos: [0, 0]
|
|
3216
3216
|
});
|
|
3217
|
-
|
|
3218
|
-
group:
|
|
3217
|
+
N.append(w), f && (this.scaleType = ct.proportional, this.drawEraserlines({
|
|
3218
|
+
group: N,
|
|
3219
3219
|
eraserlines: f,
|
|
3220
3220
|
pos: m,
|
|
3221
3221
|
layer: s
|
|
3222
|
-
})), this.replace(s, e,
|
|
3223
|
-
const C =
|
|
3222
|
+
})), this.replace(s, e, N);
|
|
3223
|
+
const C = N.getBoundingClientRect();
|
|
3224
3224
|
return {
|
|
3225
3225
|
x: Math.floor(C.x - W.SafeBorderPadding),
|
|
3226
3226
|
y: Math.floor(C.y - W.SafeBorderPadding),
|
|
@@ -3370,10 +3370,10 @@ class _o extends W {
|
|
|
3370
3370
|
};
|
|
3371
3371
|
}
|
|
3372
3372
|
draw(t) {
|
|
3373
|
-
const { workId: e, layer: s, isDrawing: o, ps: n, replaceId: r } = t, { strokeColor: c, fillColor: l, thickness: h, zIndex: u, scale: d, rotate: g, translate: f, strokeType: p, eraserlines: M } = this.workOptions, I = s.worldPosition, m = s.worldScaling, { points:
|
|
3373
|
+
const { workId: e, layer: s, isDrawing: o, ps: n, replaceId: r } = t, { strokeColor: c, fillColor: l, thickness: h, zIndex: u, scale: d, rotate: g, translate: f, strokeType: p, eraserlines: M } = this.workOptions, I = s.worldPosition, m = s.worldScaling, { points: S, rect: T, pos: N } = this.computDrawPoints(n), w = {
|
|
3374
3374
|
close: !0,
|
|
3375
3375
|
normalize: !0,
|
|
3376
|
-
points:
|
|
3376
|
+
points: S,
|
|
3377
3377
|
lineWidth: h,
|
|
3378
3378
|
fillColor: l !== "transparent" && l || void 0,
|
|
3379
3379
|
strokeColor: c,
|
|
@@ -3389,7 +3389,7 @@ class _o extends W {
|
|
|
3389
3389
|
name: e,
|
|
3390
3390
|
id: e,
|
|
3391
3391
|
zIndex: u,
|
|
3392
|
-
pos:
|
|
3392
|
+
pos: N,
|
|
3393
3393
|
anchor: [0.5, 0.5],
|
|
3394
3394
|
size: [
|
|
3395
3395
|
T.w,
|
|
@@ -3416,7 +3416,7 @@ class _o extends W {
|
|
|
3416
3416
|
if (M && (this.scaleType = ct.proportional, this.drawEraserlines({
|
|
3417
3417
|
group: L,
|
|
3418
3418
|
eraserlines: M,
|
|
3419
|
-
pos:
|
|
3419
|
+
pos: N,
|
|
3420
3420
|
layer: s
|
|
3421
3421
|
})), this.replace(s, r || e, L), d || g || f) {
|
|
3422
3422
|
const j = L.getBoundingClientRect();
|
|
@@ -3542,9 +3542,9 @@ class tn extends W {
|
|
|
3542
3542
|
};
|
|
3543
3543
|
}
|
|
3544
3544
|
draw(t) {
|
|
3545
|
-
const { workId: e, layer: s, isDrawing: o } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, vertices: h, innerVerticeStep: u, innerRatio: d, scale: g, rotate: f, translate: p, strokeType: M, eraserlines: I } = this.workOptions, m = s.worldScaling, { rect:
|
|
3545
|
+
const { workId: e, layer: s, isDrawing: o } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, vertices: h, innerVerticeStep: u, innerRatio: d, scale: g, rotate: f, translate: p, strokeType: M, eraserlines: I } = this.workOptions, m = s.worldScaling, { rect: S, pos: T, points: N } = this.computDrawPoints(c, h, u, d), w = {
|
|
3546
3546
|
close: !0,
|
|
3547
|
-
points:
|
|
3547
|
+
points: N,
|
|
3548
3548
|
lineWidth: c,
|
|
3549
3549
|
fillColor: r !== "transparent" && r || void 0,
|
|
3550
3550
|
strokeColor: n,
|
|
@@ -3558,7 +3558,7 @@ class tn extends W {
|
|
|
3558
3558
|
zIndex: l,
|
|
3559
3559
|
pos: T,
|
|
3560
3560
|
anchor: [0.5, 0.5],
|
|
3561
|
-
size: [
|
|
3561
|
+
size: [S.w, S.h]
|
|
3562
3562
|
};
|
|
3563
3563
|
g && (C.scale = g), f && (C.rotate = f), p && (C.translate = p);
|
|
3564
3564
|
const L = new Yt(C);
|
|
@@ -3717,9 +3717,9 @@ class en extends W {
|
|
|
3717
3717
|
};
|
|
3718
3718
|
}
|
|
3719
3719
|
draw(t) {
|
|
3720
|
-
const { workId: e, layer: s, isDrawing: o } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, vertices: h, scale: u, rotate: d, translate: g, strokeType: f, eraserlines: p } = this.workOptions, M = s.worldScaling, { rect: I, pos: m, points:
|
|
3720
|
+
const { workId: e, layer: s, isDrawing: o } = t, { strokeColor: n, fillColor: r, thickness: c, zIndex: l, vertices: h, scale: u, rotate: d, translate: g, strokeType: f, eraserlines: p } = this.workOptions, M = s.worldScaling, { rect: I, pos: m, points: S } = this.computDrawPoints(c, h), T = {
|
|
3721
3721
|
close: !0,
|
|
3722
|
-
points:
|
|
3722
|
+
points: S,
|
|
3723
3723
|
lineWidth: c,
|
|
3724
3724
|
fillColor: r !== "transparent" && r || void 0,
|
|
3725
3725
|
strokeColor: n,
|
|
@@ -3727,7 +3727,7 @@ class en extends W {
|
|
|
3727
3727
|
lineJoin: "round",
|
|
3728
3728
|
lineCap: "round",
|
|
3729
3729
|
lineDash: f === et.Dotted ? [1, c * 2] : f === et.LongDotted ? [c, c * 2] : void 0
|
|
3730
|
-
},
|
|
3730
|
+
}, N = {
|
|
3731
3731
|
name: e,
|
|
3732
3732
|
id: e,
|
|
3733
3733
|
zIndex: l,
|
|
@@ -3735,8 +3735,8 @@ class en extends W {
|
|
|
3735
3735
|
anchor: [0.5, 0.5],
|
|
3736
3736
|
size: [I.w, I.h]
|
|
3737
3737
|
};
|
|
3738
|
-
u && (
|
|
3739
|
-
const w = new Yt(
|
|
3738
|
+
u && (N.scale = u), d && (N.rotate = d), g && (N.translate = g);
|
|
3739
|
+
const w = new Yt(N);
|
|
3740
3740
|
if (o) {
|
|
3741
3741
|
const A = new ce({
|
|
3742
3742
|
d: "M-4,0H4M0,-4V4",
|
|
@@ -3969,7 +3969,7 @@ class sn extends W {
|
|
|
3969
3969
|
lineJoin: "round",
|
|
3970
3970
|
lineCap: "round",
|
|
3971
3971
|
lineDash: g === et.Dotted ? [1, r * 2] : g === et.LongDotted ? [r, r * 2] : void 0
|
|
3972
|
-
},
|
|
3972
|
+
}, S = {
|
|
3973
3973
|
name: e,
|
|
3974
3974
|
id: e,
|
|
3975
3975
|
zIndex: c,
|
|
@@ -3977,12 +3977,12 @@ class sn extends W {
|
|
|
3977
3977
|
anchor: [0.5, 0.5],
|
|
3978
3978
|
size: [p.w, p.h]
|
|
3979
3979
|
};
|
|
3980
|
-
h && (
|
|
3981
|
-
const T = new Yt(
|
|
3980
|
+
h && (S.scale = h), u && (S.rotate = u), d && (S.translate = d);
|
|
3981
|
+
const T = new Yt(S), N = new ue({
|
|
3982
3982
|
...m,
|
|
3983
3983
|
pos: [0, 0]
|
|
3984
3984
|
});
|
|
3985
|
-
T.append(
|
|
3985
|
+
T.append(N), f && (this.scaleType = ct.proportional, this.drawEraserlines({
|
|
3986
3986
|
group: T,
|
|
3987
3987
|
eraserlines: f,
|
|
3988
3988
|
pos: M,
|
|
@@ -4046,65 +4046,65 @@ class sn extends W {
|
|
|
4046
4046
|
}
|
|
4047
4047
|
}
|
|
4048
4048
|
computDrawPoints(t, e) {
|
|
4049
|
-
const s = Mt(this.tmpPoints), o = this.transformControlPoints(e), n = Math.floor(s.w * 0.1), r = Math.floor(s.h * 0.1), c = [], l = b.Add(o[0], new b(0, r, 0)), h = b.Add(o[0], new b(n, 0, 0)), u = qt.getBezierPoints(10, l, o[0], h), d = b.Sub(o[1], new b(n, 0, 0)), g = b.Add(o[1], new b(0, r, 0)), f = qt.getBezierPoints(10, d, o[1], g), p = b.Sub(o[2], new b(0, r, 0)), M = b.Sub(o[2], new b(n, 0, 0)), I = qt.getBezierPoints(10, p, o[2], M), m = b.Add(o[3], new b(n, 0, 0)),
|
|
4049
|
+
const s = Mt(this.tmpPoints), o = this.transformControlPoints(e), n = Math.floor(s.w * 0.1), r = Math.floor(s.h * 0.1), c = [], l = b.Add(o[0], new b(0, r, 0)), h = b.Add(o[0], new b(n, 0, 0)), u = qt.getBezierPoints(10, l, o[0], h), d = b.Sub(o[1], new b(n, 0, 0)), g = b.Add(o[1], new b(0, r, 0)), f = qt.getBezierPoints(10, d, o[1], g), p = b.Sub(o[2], new b(0, r, 0)), M = b.Sub(o[2], new b(n, 0, 0)), I = qt.getBezierPoints(10, p, o[2], M), m = b.Add(o[3], new b(n, 0, 0)), S = b.Sub(o[3], new b(0, r, 0)), T = qt.getBezierPoints(10, m, o[3], S), N = n * (1 - this.ratio) * 10, w = r * (1 - this.ratio) * 10;
|
|
4050
4050
|
switch (e) {
|
|
4051
4051
|
case "bottom": {
|
|
4052
|
-
const A = b.Sub(o[2], new b(n * 5 -
|
|
4052
|
+
const A = b.Sub(o[2], new b(n * 5 - N / 2, 0, 0)), j = b.Sub(o[2], new b(n * 5, -w, 0)), D = b.Sub(o[2], new b(n * 5 + N / 2, 0, 0));
|
|
4053
4053
|
c.push(j, D, ...T, ...u, ...f, ...I, A);
|
|
4054
4054
|
break;
|
|
4055
4055
|
}
|
|
4056
4056
|
case "bottomRight": {
|
|
4057
|
-
const A = b.Sub(o[2], new b(n * 1.1, 0, 0)), j = b.Sub(o[2], new b(n * 1.1 +
|
|
4057
|
+
const A = b.Sub(o[2], new b(n * 1.1, 0, 0)), j = b.Sub(o[2], new b(n * 1.1 + N / 2, -w, 0)), D = b.Sub(o[2], new b(n * 1.1 + N, 0, 0));
|
|
4058
4058
|
c.push(j, D, ...T, ...u, ...f, ...I, A);
|
|
4059
4059
|
break;
|
|
4060
4060
|
}
|
|
4061
4061
|
case "bottomLeft": {
|
|
4062
|
-
const A = b.Add(o[3], new b(n * 1.1 +
|
|
4062
|
+
const A = b.Add(o[3], new b(n * 1.1 + N, 0, 0)), j = b.Add(o[3], new b(n * 1.1 + N / 2, w, 0)), D = b.Add(o[3], new b(n * 1.1, 0, 0));
|
|
4063
4063
|
c.push(j, D, ...T, ...u, ...f, ...I, A);
|
|
4064
4064
|
break;
|
|
4065
4065
|
}
|
|
4066
4066
|
case "top": {
|
|
4067
|
-
const A = b.Sub(o[1], new b(n * 5 -
|
|
4067
|
+
const A = b.Sub(o[1], new b(n * 5 - N / 2, 0, 0)), j = b.Sub(o[1], new b(n * 5, w, 0)), D = b.Sub(o[1], new b(n * 5 + N / 2, 0, 0));
|
|
4068
4068
|
c.push(j, A, ...f, ...I, ...T, ...u, D);
|
|
4069
4069
|
break;
|
|
4070
4070
|
}
|
|
4071
4071
|
case "topRight": {
|
|
4072
|
-
const A = b.Sub(o[1], new b(n * 1.1, 0, 0)), j = b.Sub(o[1], new b(n * 1.1 +
|
|
4072
|
+
const A = b.Sub(o[1], new b(n * 1.1, 0, 0)), j = b.Sub(o[1], new b(n * 1.1 + N / 2, w, 0)), D = b.Sub(o[1], new b(n * 1.1 + N, 0, 0));
|
|
4073
4073
|
c.push(j, A, ...f, ...I, ...T, ...u, D);
|
|
4074
4074
|
break;
|
|
4075
4075
|
}
|
|
4076
4076
|
case "topLeft": {
|
|
4077
|
-
const A = b.Add(o[0], new b(n * 1.1 +
|
|
4077
|
+
const A = b.Add(o[0], new b(n * 1.1 + N, 0, 0)), j = b.Add(o[0], new b(n * 1.1 + N / 2, -w, 0)), D = b.Add(o[0], new b(n * 1.1, 0, 0));
|
|
4078
4078
|
c.push(j, A, ...f, ...I, ...T, ...u, D);
|
|
4079
4079
|
break;
|
|
4080
4080
|
}
|
|
4081
4081
|
case "left": {
|
|
4082
|
-
const A = b.Add(o[0], new b(0, r * 5 - w / 2, 0)), j = b.Add(o[0], new b(-
|
|
4082
|
+
const A = b.Add(o[0], new b(0, r * 5 - w / 2, 0)), j = b.Add(o[0], new b(-N, r * 5, 0)), D = b.Add(o[0], new b(0, r * 5 + w / 2, 0));
|
|
4083
4083
|
c.push(j, A, ...u, ...f, ...I, ...T, D);
|
|
4084
4084
|
break;
|
|
4085
4085
|
}
|
|
4086
4086
|
case "leftTop": {
|
|
4087
|
-
const A = b.Add(o[0], new b(0, r * 1.1, 0)), j = b.Add(o[0], new b(-
|
|
4087
|
+
const A = b.Add(o[0], new b(0, r * 1.1, 0)), j = b.Add(o[0], new b(-N, r * 1.1 + w / 2, 0)), D = b.Add(o[0], new b(0, r * 1.1 + w, 0));
|
|
4088
4088
|
c.push(j, A, ...u, ...f, ...I, ...T, D);
|
|
4089
4089
|
break;
|
|
4090
4090
|
}
|
|
4091
4091
|
case "leftBottom": {
|
|
4092
|
-
const A = b.Sub(o[3], new b(0, r * 1.1 + w, 0)), j = b.Sub(o[3], new b(
|
|
4092
|
+
const A = b.Sub(o[3], new b(0, r * 1.1 + w, 0)), j = b.Sub(o[3], new b(N, r * 1.1 + w / 2, 0)), D = b.Sub(o[3], new b(0, r * 1.1, 0));
|
|
4093
4093
|
c.push(j, A, ...u, ...f, ...I, ...T, D);
|
|
4094
4094
|
break;
|
|
4095
4095
|
}
|
|
4096
4096
|
case "right": {
|
|
4097
|
-
const A = b.Add(o[1], new b(0, r * 5 - w / 2, 0)), j = b.Add(o[1], new b(
|
|
4097
|
+
const A = b.Add(o[1], new b(0, r * 5 - w / 2, 0)), j = b.Add(o[1], new b(N, r * 5, 0)), D = b.Add(o[1], new b(0, r * 5 + w / 2, 0));
|
|
4098
4098
|
c.push(j, D, ...I, ...T, ...u, ...f, A);
|
|
4099
4099
|
break;
|
|
4100
4100
|
}
|
|
4101
4101
|
case "rightTop": {
|
|
4102
|
-
const A = b.Add(o[1], new b(0, r * 1.1, 0)), j = b.Add(o[1], new b(
|
|
4102
|
+
const A = b.Add(o[1], new b(0, r * 1.1, 0)), j = b.Add(o[1], new b(N, r * 1.1 + w / 2, 0)), D = b.Add(o[1], new b(0, r * 1.1 + w, 0));
|
|
4103
4103
|
c.push(j, D, ...I, ...T, ...u, ...f, A);
|
|
4104
4104
|
break;
|
|
4105
4105
|
}
|
|
4106
4106
|
case "rightBottom": {
|
|
4107
|
-
const A = b.Sub(o[2], new b(0, r * 1.1 + w, 0)), j = b.Sub(o[2], new b(-
|
|
4107
|
+
const A = b.Sub(o[2], new b(0, r * 1.1 + w, 0)), j = b.Sub(o[2], new b(-N, r * 1.1 + w / 2, 0)), D = b.Sub(o[2], new b(0, r * 1.1, 0));
|
|
4108
4108
|
c.push(j, D, ...I, ...T, ...u, ...f, A);
|
|
4109
4109
|
break;
|
|
4110
4110
|
}
|
|
@@ -4239,7 +4239,7 @@ class on extends W {
|
|
|
4239
4239
|
const { workId: e, layer: s } = t, { strokeColor: o, thickness: n, zIndex: r, scale: c, rotate: l, translate: h, strokeType: u, eraserlines: d } = this.workOptions, g = s.worldPosition, f = s.worldScaling, { d: p, rect: M, isDot: I } = this.computDrawPoints(n, u), m = [
|
|
4240
4240
|
M.x + M.w / 2,
|
|
4241
4241
|
M.y + M.h / 2
|
|
4242
|
-
],
|
|
4242
|
+
], S = new Yt({
|
|
4243
4243
|
pos: m,
|
|
4244
4244
|
anchor: [0.5, 0.5],
|
|
4245
4245
|
size: [M.w, M.h],
|
|
@@ -4258,14 +4258,14 @@ class on extends W {
|
|
|
4258
4258
|
lineWidth: u === et.Normal || I ? 0 : n
|
|
4259
4259
|
};
|
|
4260
4260
|
c && (T.scale = c), l && (T.rotate = l), h && (T.translate = h);
|
|
4261
|
-
const
|
|
4262
|
-
if (
|
|
4263
|
-
group:
|
|
4261
|
+
const N = new ce(T);
|
|
4262
|
+
if (S.append(N), d && (this.scaleType = ct.proportional, this.drawEraserlines({
|
|
4263
|
+
group: S,
|
|
4264
4264
|
eraserlines: d,
|
|
4265
4265
|
pos: m,
|
|
4266
4266
|
layer: s
|
|
4267
|
-
})), this.replace(s, e,
|
|
4268
|
-
const C =
|
|
4267
|
+
})), this.replace(s, e, S), l || c || h) {
|
|
4268
|
+
const C = N.getBoundingClientRect();
|
|
4269
4269
|
return {
|
|
4270
4270
|
x: Math.floor(C.x - W.SafeBorderPadding),
|
|
4271
4271
|
y: Math.floor(C.y - W.SafeBorderPadding),
|
|
@@ -4451,7 +4451,7 @@ const he = class he extends W {
|
|
|
4451
4451
|
}
|
|
4452
4452
|
static async createLabels(t, e, s) {
|
|
4453
4453
|
var D;
|
|
4454
|
-
const o = [], { x: n, y: r } = s, { width: c, height: l } = (D = e.parent) == null ? void 0 : D.parent, h = Ie(t.text), u = h.length, { fontSize: d, lineHeight: g, bold: f, textAlign: p, italic: M, fontFamily: I, verticalAlign: m, fontColor:
|
|
4454
|
+
const o = [], { x: n, y: r } = s, { width: c, height: l } = (D = e.parent) == null ? void 0 : D.parent, h = Ie(t.text), u = h.length, { fontSize: d, lineHeight: g, bold: f, textAlign: p, italic: M, fontFamily: I, verticalAlign: m, fontColor: S, fontBgColor: T, underline: N, lineThrough: w } = t, C = he.getSafetySnippetRatio(e) || 1, L = Math.floor(d * C), A = he.getSafetySnippetFontLength(L);
|
|
4455
4455
|
let j = 0;
|
|
4456
4456
|
for (let R = 0; R < u; R++) {
|
|
4457
4457
|
const z = h[R], E = g || L * 1.5;
|
|
@@ -4473,9 +4473,9 @@ const he = class he extends W {
|
|
|
4473
4473
|
fontFamily: I,
|
|
4474
4474
|
fontSize: L,
|
|
4475
4475
|
lineHeight: E,
|
|
4476
|
-
strokeColor:
|
|
4476
|
+
strokeColor: S,
|
|
4477
4477
|
fontWeight: f,
|
|
4478
|
-
fillColor:
|
|
4478
|
+
fillColor: S,
|
|
4479
4479
|
textAlign: p,
|
|
4480
4480
|
fontStyle: M,
|
|
4481
4481
|
scale: [1 / C, 1 / C]
|
|
@@ -4493,13 +4493,13 @@ const he = class he extends W {
|
|
|
4493
4493
|
V[0] = G, M === "italic" && (V[0] = V[0] + Q * d), j = Math.max(j, V[0]);
|
|
4494
4494
|
let Lt = !0;
|
|
4495
4495
|
if (((K[0] + V[0]) * e.worldScaling[0] + n <= 0 || K[0] * e.worldScaling[0] + n >= c || (K[1] + V[1]) * e.worldScaling[0] + r <= 0 || K[1] * e.worldScaling[1] + r >= l) && (Lt = !1), Lt) {
|
|
4496
|
-
if (
|
|
4496
|
+
if (N) {
|
|
4497
4497
|
const X = Math.floor(d / 10), $ = {
|
|
4498
4498
|
normalize: !1,
|
|
4499
4499
|
pos: [0, d * 1.1 + X / 2],
|
|
4500
4500
|
lineWidth: X,
|
|
4501
4501
|
points: [0, 0, Math.ceil(V[0]), 0],
|
|
4502
|
-
strokeColor:
|
|
4502
|
+
strokeColor: S,
|
|
4503
4503
|
className: "underline"
|
|
4504
4504
|
}, dt = new ue($);
|
|
4505
4505
|
q.push(dt);
|
|
@@ -4510,7 +4510,7 @@ const he = class he extends W {
|
|
|
4510
4510
|
pos: [0, d * 1.2 / 2],
|
|
4511
4511
|
lineWidth: Math.floor(d / 10),
|
|
4512
4512
|
points: [0, 0, Math.ceil(V[0]), 0],
|
|
4513
|
-
strokeColor:
|
|
4513
|
+
strokeColor: S,
|
|
4514
4514
|
className: "lineThrough"
|
|
4515
4515
|
}, $ = new ue(X);
|
|
4516
4516
|
q.push($);
|
|
@@ -4541,11 +4541,11 @@ const he = class he extends W {
|
|
|
4541
4541
|
underline: M,
|
|
4542
4542
|
fontSize: I,
|
|
4543
4543
|
textInfos: m,
|
|
4544
|
-
zIndex:
|
|
4545
|
-
} = s, T = n && Pt(n);
|
|
4544
|
+
zIndex: S
|
|
4545
|
+
} = s, T = n && Pt(n) || o.get(e.name);
|
|
4546
4546
|
if (!T || !e.parent) return;
|
|
4547
4547
|
const w = T.opt;
|
|
4548
|
-
if (Wt(
|
|
4548
|
+
if (Wt(S) && (e.setAttribute("zIndex", S), T.opt.zIndex = S), c && w.fontColor && (w.fontColor = c, e.children.forEach((C) => {
|
|
4549
4549
|
C.tagName === "GROUP" && C.children.forEach((L) => {
|
|
4550
4550
|
L.tagName === "LABEL" ? (L.setAttribute("fillColor", c), L.setAttribute("strokeColor", c)) : L.tagName === "POLYLINE" && L.setAttribute("strokeColor", c);
|
|
4551
4551
|
});
|
|
@@ -4714,18 +4714,18 @@ const be = class be extends W {
|
|
|
4714
4714
|
if (p.length && (s.add(c.name), !u)) {
|
|
4715
4715
|
const M = this.translateIntersect(p), I = this.cutPolyline(M, g);
|
|
4716
4716
|
for (let m = 0; m < I.length; m++) {
|
|
4717
|
-
const
|
|
4718
|
-
I[m].forEach((
|
|
4719
|
-
T.push((
|
|
4720
|
-
}), c.opt && c.toolsType && this.vNodes && (this.vNodes.setInfo(
|
|
4717
|
+
const S = `${r}_s_${m}`, T = [];
|
|
4718
|
+
I[m].forEach((N) => {
|
|
4719
|
+
T.push((N.x - this.worldPosition[0]) / this.worldScaling[0], (N.y - this.worldPosition[1]) / this.worldScaling[1], N.z);
|
|
4720
|
+
}), c.opt && c.toolsType && this.vNodes && (this.vNodes.setInfo(S, {
|
|
4721
4721
|
rect: f,
|
|
4722
4722
|
op: T,
|
|
4723
4723
|
opt: c.opt,
|
|
4724
4724
|
canRotate: c.canRotate,
|
|
4725
4725
|
scaleType: c.scaleType,
|
|
4726
4726
|
toolsType: c.toolsType
|
|
4727
|
-
}), o.set(
|
|
4728
|
-
workId:
|
|
4727
|
+
}), o.set(S, {
|
|
4728
|
+
workId: S,
|
|
4729
4729
|
op: T,
|
|
4730
4730
|
opt: c.opt,
|
|
4731
4731
|
toolsType: c.toolsType
|
|
@@ -4845,7 +4845,7 @@ const xe = class xe extends W {
|
|
|
4845
4845
|
name: r
|
|
4846
4846
|
};
|
|
4847
4847
|
return {
|
|
4848
|
-
rect: this.draw({ attrs: c, consumePoints: this.tmpPoints, replaceId: r, layer: n, thickness: o
|
|
4848
|
+
rect: this.draw({ attrs: c, consumePoints: this.tmpPoints, replaceId: r, layer: n, thickness: o }),
|
|
4849
4849
|
type: x.DrawWork,
|
|
4850
4850
|
dataType: U.Local
|
|
4851
4851
|
};
|
|
@@ -4866,7 +4866,7 @@ const xe = class xe extends W {
|
|
|
4866
4866
|
const n = this.tmpPoints[0].z * 2, r = s ? this.fullLayer : this.drawLayer || this.fullLayer, l = {
|
|
4867
4867
|
name: this.workId
|
|
4868
4868
|
};
|
|
4869
|
-
return this.draw({ attrs: l, consumePoints: this.tmpPoints, layer: r, thickness: n, replaceId: o
|
|
4869
|
+
return this.draw({ attrs: l, consumePoints: this.tmpPoints, layer: r, thickness: n, replaceId: o });
|
|
4870
4870
|
}
|
|
4871
4871
|
updateTempPoints(t, e) {
|
|
4872
4872
|
let s = this.tmpPoints.length - 1;
|
|
@@ -4909,25 +4909,25 @@ const xe = class xe extends W {
|
|
|
4909
4909
|
Qi.polyline(m, f, p);
|
|
4910
4910
|
if (p.length && d.opt)
|
|
4911
4911
|
for (const m of p) {
|
|
4912
|
-
const
|
|
4912
|
+
const S = [];
|
|
4913
4913
|
for (let T = 0; T < m.length; T++)
|
|
4914
|
-
T !== 0 && we(m[T], m[T - 1]) ||
|
|
4915
|
-
M.push(
|
|
4914
|
+
T !== 0 && we(m[T], m[T - 1]) || S.push(...m[T]);
|
|
4915
|
+
M.push(S);
|
|
4916
4916
|
}
|
|
4917
4917
|
if (d.opt.eraserlines || (d.opt.eraserlines = []), d.opt.eraserlines) {
|
|
4918
4918
|
if (d.opt.eraserlines.push({ op: M, thickness: t }), e) {
|
|
4919
|
-
const { toolsType: m } = d,
|
|
4919
|
+
const { toolsType: m } = d, S = e.createWorkShapeNode({
|
|
4920
4920
|
workId: u,
|
|
4921
4921
|
toolsType: m,
|
|
4922
4922
|
toolsOpt: d.opt
|
|
4923
4923
|
});
|
|
4924
|
-
|
|
4925
|
-
const T =
|
|
4924
|
+
S == null || S.setWorkId(u);
|
|
4925
|
+
const T = S == null ? void 0 : S.consumeService({
|
|
4926
4926
|
op: d.op,
|
|
4927
4927
|
isFullWork: !0,
|
|
4928
4928
|
replaceId: u
|
|
4929
4929
|
});
|
|
4930
|
-
if (n = ht(n, T),
|
|
4930
|
+
if (n = ht(n, T), S != null && S.isDelete) {
|
|
4931
4931
|
e.removeNode(u), o.add(u);
|
|
4932
4932
|
continue;
|
|
4933
4933
|
}
|
|
@@ -4954,67 +4954,67 @@ const xe = class xe extends W {
|
|
|
4954
4954
|
const m = {
|
|
4955
4955
|
name: this.workId,
|
|
4956
4956
|
id: Wt(c) && c.toString() || void 0
|
|
4957
|
-
},
|
|
4957
|
+
}, S = this.syncIndex;
|
|
4958
4958
|
this.syncTimestamp === 0 && (this.syncTimestamp = Date.now());
|
|
4959
|
-
let T = !1,
|
|
4959
|
+
let T = !1, N;
|
|
4960
4960
|
const w = this.tmpPoints.slice(M);
|
|
4961
4961
|
if (o || n) {
|
|
4962
4962
|
const L = s ? this.fullLayer : this.drawLayer || this.fullLayer;
|
|
4963
|
-
|
|
4963
|
+
N = this.draw({ attrs: m, consumePoints: w, layer: L, removeDrawCount: r, thickness: g });
|
|
4964
4964
|
}
|
|
4965
4965
|
if (o)
|
|
4966
4966
|
return M > 10 && this.tmpPoints.splice(0, M - 10), {
|
|
4967
|
-
rect:
|
|
4967
|
+
rect: N,
|
|
4968
4968
|
type: x.DrawWork,
|
|
4969
4969
|
dataType: U.Local
|
|
4970
4970
|
};
|
|
4971
4971
|
w[0].t - this.syncTimestamp > this.syncUnitTime && (T = !0, this.syncTimestamp = w[0].t, this.syncIndex = this.tmpPoints.length);
|
|
4972
4972
|
const C = [];
|
|
4973
|
-
return this.tmpPoints.slice(
|
|
4973
|
+
return this.tmpPoints.slice(S).forEach((L) => {
|
|
4974
4974
|
C.push(L.x, L.y, g / 2);
|
|
4975
4975
|
}), {
|
|
4976
4976
|
...this.baseConsumeResult,
|
|
4977
4977
|
type: x.DrawWork,
|
|
4978
4978
|
dataType: U.Local,
|
|
4979
|
-
rect:
|
|
4979
|
+
rect: N,
|
|
4980
4980
|
op: T ? C : void 0,
|
|
4981
|
-
index: T ?
|
|
4981
|
+
index: T ? S * 3 : void 0,
|
|
4982
4982
|
updateNodeOpt: {
|
|
4983
4983
|
useAnimation: !0
|
|
4984
4984
|
}
|
|
4985
4985
|
};
|
|
4986
4986
|
}
|
|
4987
4987
|
draw(t) {
|
|
4988
|
-
const { attrs: e, consumePoints: s, layer: o, thickness: n, replaceId: r,
|
|
4989
|
-
|
|
4990
|
-
let
|
|
4991
|
-
|
|
4992
|
-
x: Math.floor(
|
|
4993
|
-
y: Math.floor(
|
|
4994
|
-
w: Math.floor(
|
|
4995
|
-
h: Math.floor(
|
|
4988
|
+
const { attrs: e, consumePoints: s, layer: o, thickness: n, replaceId: r, removeDrawCount: c } = t;
|
|
4989
|
+
c && this.removeDrawCountNodes(o, c);
|
|
4990
|
+
let l = Mt(s, n);
|
|
4991
|
+
l = {
|
|
4992
|
+
x: Math.floor(l.x * this.worldScaling[0] + this.worldPosition[0] - W.SafeBorderPadding),
|
|
4993
|
+
y: Math.floor(l.y * this.worldScaling[1] + this.worldPosition[1] - W.SafeBorderPadding),
|
|
4994
|
+
w: Math.floor(l.w * this.worldScaling[0] + 2 * W.SafeBorderPadding),
|
|
4995
|
+
h: Math.floor(l.h * this.worldScaling[1] + 2 * W.SafeBorderPadding)
|
|
4996
4996
|
};
|
|
4997
|
-
const
|
|
4997
|
+
const h = new Yt({
|
|
4998
4998
|
...e,
|
|
4999
4999
|
normalize: !0,
|
|
5000
5000
|
pos: [0, 0],
|
|
5001
5001
|
anchor: [0.5, 0.5],
|
|
5002
5002
|
zIndex: 9999,
|
|
5003
5003
|
bgcolor: "rgba(136,136,136,0.3)"
|
|
5004
|
-
}),
|
|
5005
|
-
for (const
|
|
5006
|
-
|
|
5007
|
-
for (const
|
|
5008
|
-
const { thickness:
|
|
5004
|
+
}), u = this.computEraserPointLines(s), d = [];
|
|
5005
|
+
for (const g of u)
|
|
5006
|
+
d.push({ op: g, thickness: n });
|
|
5007
|
+
for (const g of d) {
|
|
5008
|
+
const { thickness: f, op: p } = g, M = p.reduce((N, w, C, L) => C > 0 && L[C - 1][0] === w[0] && L[C - 1][1] === w[1] ? N : N.concat(w[0], w[1]), []), I = this.computEraserPoints(M, f), m = re(I, !0), S = {
|
|
5009
5009
|
pos: [0, 0],
|
|
5010
|
-
d:
|
|
5010
|
+
d: m,
|
|
5011
5011
|
fillColor: "rgba(136,136,136,0.3)"
|
|
5012
|
-
},
|
|
5013
|
-
|
|
5012
|
+
}, T = new ce(S);
|
|
5013
|
+
h.append(T), h.seal();
|
|
5014
5014
|
}
|
|
5015
|
-
return this.replace(o, r,
|
|
5015
|
+
return this.replace(o, r, h), l;
|
|
5016
5016
|
}
|
|
5017
|
-
computEraserPointLines(t, e =
|
|
5017
|
+
computEraserPointLines(t, e = 60) {
|
|
5018
5018
|
const s = [];
|
|
5019
5019
|
let o = 0;
|
|
5020
5020
|
const n = 360 - e;
|
|
@@ -5756,13 +5756,13 @@ function Hf(a, i, t) {
|
|
|
5756
5756
|
function m(w) {
|
|
5757
5757
|
return r = void 0, d && e ? g(w) : (e = s = void 0, n);
|
|
5758
5758
|
}
|
|
5759
|
-
function
|
|
5759
|
+
function S() {
|
|
5760
5760
|
r !== void 0 && clearTimeout(r), l = 0, e = c = s = r = void 0;
|
|
5761
5761
|
}
|
|
5762
5762
|
function T() {
|
|
5763
5763
|
return r === void 0 ? n : m(Pi());
|
|
5764
5764
|
}
|
|
5765
|
-
function
|
|
5765
|
+
function N() {
|
|
5766
5766
|
var w = Pi(), C = M(w);
|
|
5767
5767
|
if (e = arguments, s = this, c = w, C) {
|
|
5768
5768
|
if (r === void 0)
|
|
@@ -5772,7 +5772,7 @@ function Hf(a, i, t) {
|
|
|
5772
5772
|
}
|
|
5773
5773
|
return r === void 0 && (r = setTimeout(I, i)), n;
|
|
5774
5774
|
}
|
|
5775
|
-
return
|
|
5775
|
+
return N.cancel = S, N.flush = T, N;
|
|
5776
5776
|
}
|
|
5777
5777
|
var Qf = Hf, Gf = Qf, Zf = de, Xf = "Expected a function";
|
|
5778
5778
|
function Jf(a, i, t) {
|
|
@@ -6689,10 +6689,10 @@ class He extends W {
|
|
|
6689
6689
|
const M = e.parent;
|
|
6690
6690
|
if (M) {
|
|
6691
6691
|
if (f && (p.opt.strokeColor = f), Wt(g) && (e.setAttribute("zIndex", g), p.opt.zIndex = g), ke(d) && (p.opt.locked = d), c && l && h && r) {
|
|
6692
|
-
const { centerX: I, centerY: m, width:
|
|
6692
|
+
const { centerX: I, centerY: m, width: S, height: T, uniformScale: N } = p.opt, w = N !== !1 ? [h[0], h[0]] : h, C = [I, m], L = [I, m];
|
|
6693
6693
|
ps(L, l, w, r);
|
|
6694
6694
|
const A = [L[0] - C[0], L[1] - C[1]];
|
|
6695
|
-
if (p.centerPos = [p.centerPos[0] + A[0], p.centerPos[1] + A[1]], p.opt.width = Math.round(
|
|
6695
|
+
if (p.centerPos = [p.centerPos[0] + A[0], p.centerPos[1] + A[1]], p.opt.width = Math.round(S * w[0]), p.opt.height = Math.round(T * w[1]), p.opt.centerX = L[0], p.opt.centerY = L[1], p.opt.eraserlines)
|
|
6696
6696
|
for (const j of Object.values(p.opt.eraserlines)) {
|
|
6697
6697
|
const { op: D, thickness: R } = j;
|
|
6698
6698
|
j.thickness = R * Math.max(h[0], h[1]);
|
|
@@ -6703,9 +6703,9 @@ class He extends W {
|
|
|
6703
6703
|
if (p.opt.centerX = p.opt.centerX + r[0], p.opt.centerY = p.opt.centerY + r[1], p.centerPos = [p.centerPos[0] + r[0], p.centerPos[1] + r[1]], p.opt.eraserlines)
|
|
6704
6704
|
for (const I of Object.values(p.opt.eraserlines)) {
|
|
6705
6705
|
const { op: m } = I;
|
|
6706
|
-
for (let
|
|
6707
|
-
const T = m[
|
|
6708
|
-
I.op[
|
|
6706
|
+
for (let S = 0; S < m.length; S++) {
|
|
6707
|
+
const T = m[S].map((N, w) => w % 2 ? N + r[1] : N + r[0]);
|
|
6708
|
+
I.op[S] = T;
|
|
6709
6709
|
}
|
|
6710
6710
|
}
|
|
6711
6711
|
} else if (Wt(u))
|
|
@@ -6919,8 +6919,8 @@ const Tt = class Tt extends VM {
|
|
|
6919
6919
|
const f = Tt.componentsLimits.indexOf(o), p = f >= 0 && f < Tt.componentsLimits.length - 1;
|
|
6920
6920
|
if ((h = (l = (c = this.control.room) == null ? void 0 : c.callbacks) == null ? void 0 : l.listeners) != null && h.map.onObjectsLimit && ((d = (u = this.control.room) == null ? void 0 : u.callbacks) == null || d.dispatch("onObjectsLimit", (I) => I(o, p))), !p) {
|
|
6921
6921
|
this.control.room.logger.error(`exceeds the limit of ${o} components, current: ${s}`), (g = this.control.room) == null || g.disconnect().then(() => {
|
|
6922
|
-
var I, m,
|
|
6923
|
-
(
|
|
6922
|
+
var I, m, S, T, N;
|
|
6923
|
+
(S = (m = (I = this.control.room) == null ? void 0 : I.callbacks) == null ? void 0 : m.listeners) != null && S.map.onKickedWithReason && ((N = (T = this.control.room) == null ? void 0 : T.callbacks) == null || N.dispatch("onKickedWithReason", (w) => w("kickByAdmin")));
|
|
6924
6924
|
});
|
|
6925
6925
|
return;
|
|
6926
6926
|
}
|
|
@@ -7132,18 +7132,18 @@ const Tt = class Tt extends VM {
|
|
|
7132
7132
|
case x.Clear:
|
|
7133
7133
|
const M = {};
|
|
7134
7134
|
f && this.storage[p] && this.storage[p][f] ? (delete this.storage[p][f], this.setState(M, { isSync: g, viewId: p, scenePath: f })) : this.storage[p] && (delete this.storage[p], this.setState(M, { isSync: g, viewId: p, scenePath: "" })), Gt(() => {
|
|
7135
|
-
var
|
|
7136
|
-
this.control.pluginManager.dispatchPluginEvent("syncStorage", p, f), (
|
|
7135
|
+
var N;
|
|
7136
|
+
this.control.pluginManager.dispatchPluginEvent("syncStorage", p, f), (N = this.control.miniMapManager) == null || N.updateMiniMapCamera(p), this.clearLimitComponents(p, f);
|
|
7137
7137
|
}, Tt.syncInterval);
|
|
7138
7138
|
break;
|
|
7139
7139
|
case x.CreateWork:
|
|
7140
7140
|
if (f && s && c && r) {
|
|
7141
|
-
const
|
|
7141
|
+
const N = this.isLocalId(s.toString()) ? this.transformKey(s) : s;
|
|
7142
7142
|
this.control.renderControl.isUsePageAuth(p) && this.control.renderControl.addRenderPageElementId({
|
|
7143
7143
|
viewId: p,
|
|
7144
7144
|
scenePath: f,
|
|
7145
|
-
elementId:
|
|
7146
|
-
}), this.updateValue(
|
|
7145
|
+
elementId: N.toString()
|
|
7146
|
+
}), this.updateValue(N.toString(), {
|
|
7147
7147
|
type: x.CreateWork,
|
|
7148
7148
|
workId: s,
|
|
7149
7149
|
toolsType: c,
|
|
@@ -7153,15 +7153,15 @@ const Tt = class Tt extends VM {
|
|
|
7153
7153
|
break;
|
|
7154
7154
|
case x.DrawWork:
|
|
7155
7155
|
if (f && s && typeof n == "number" && (u != null && u.length)) {
|
|
7156
|
-
const
|
|
7156
|
+
const N = this.isLocalId(s.toString()) ? this.transformKey(s) : s, w = this.storage[p] && this.storage[p][f] && this.storage[p][f][N] || void 0;
|
|
7157
7157
|
if (w != null && w.ops || (w == null ? void 0 : w.type) === x.FullWork)
|
|
7158
7158
|
return;
|
|
7159
7159
|
const C = n ? ((w == null ? void 0 : w.op) || []).slice(0, n).concat(u) : u || (w == null ? void 0 : w.op), L = c || (w == null ? void 0 : w.toolsType), A = r || (w == null ? void 0 : w.opt), j = h || (w == null ? void 0 : w.updateNodeOpt);
|
|
7160
7160
|
s && L && A && C && (this.control.renderControl.isUsePageAuth(p) && this.control.renderControl.addRenderPageElementId({
|
|
7161
7161
|
viewId: p,
|
|
7162
7162
|
scenePath: f,
|
|
7163
|
-
elementId:
|
|
7164
|
-
}), this.updateValue(
|
|
7163
|
+
elementId: N.toString()
|
|
7164
|
+
}), this.updateValue(N.toString(), {
|
|
7165
7165
|
...w,
|
|
7166
7166
|
type: x.DrawWork,
|
|
7167
7167
|
workId: s,
|
|
@@ -7175,15 +7175,15 @@ const Tt = class Tt extends VM {
|
|
|
7175
7175
|
break;
|
|
7176
7176
|
case x.FullWork:
|
|
7177
7177
|
if (f && s) {
|
|
7178
|
-
const
|
|
7178
|
+
const N = this.isLocalId(s.toString()) ? this.transformKey(s) : s, w = this.storage[p] && this.storage[p][f] && this.storage[p][f][N] || void 0, C = h || (w == null ? void 0 : w.updateNodeOpt), L = c || (w == null ? void 0 : w.toolsType), A = r || (w == null ? void 0 : w.opt), j = o || (w == null ? void 0 : w.ops);
|
|
7179
7179
|
L && A && (this.control.renderControl.isUsePageAuth(p) && this.control.renderControl.addRenderPageElementId({
|
|
7180
7180
|
viewId: p,
|
|
7181
7181
|
scenePath: f,
|
|
7182
|
-
elementId:
|
|
7183
|
-
}), this.updateValue(
|
|
7182
|
+
elementId: N.toString()
|
|
7183
|
+
}), this.updateValue(N.toString(), {
|
|
7184
7184
|
type: x.FullWork,
|
|
7185
7185
|
updateNodeOpt: C,
|
|
7186
|
-
workId:
|
|
7186
|
+
workId: N,
|
|
7187
7187
|
toolsType: L,
|
|
7188
7188
|
opt: A,
|
|
7189
7189
|
ops: j
|
|
@@ -7195,9 +7195,9 @@ const Tt = class Tt extends VM {
|
|
|
7195
7195
|
break;
|
|
7196
7196
|
case x.RemoveNode:
|
|
7197
7197
|
if (f && (l != null && l.length)) {
|
|
7198
|
-
const
|
|
7198
|
+
const N = l.map((w) => this.isLocalId(w + "") ? this.transformKey(w) : w);
|
|
7199
7199
|
this.storage[p] && this.storage[p][f] && (Object.keys(this.storage[p][f]).map((w) => {
|
|
7200
|
-
|
|
7200
|
+
N != null && N.includes(w) && (this.control.renderControl.isUsePageAuth(p) && this.control.renderControl.delRenderPageElementId({
|
|
7201
7201
|
viewId: p,
|
|
7202
7202
|
scenePath: f,
|
|
7203
7203
|
elementId: w
|
|
@@ -7210,8 +7210,8 @@ const Tt = class Tt extends VM {
|
|
|
7210
7210
|
break;
|
|
7211
7211
|
case x.UpdateNode:
|
|
7212
7212
|
if (f && s && (h || o || r)) {
|
|
7213
|
-
const
|
|
7214
|
-
w && (w.updateNodeOpt = h, (o || u) && (w.ops = o, w.op = u), r && (w.opt = r), w.type = x.FullWork, this.updateValue(
|
|
7213
|
+
const N = this.isLocalId(s.toString()) ? this.transformKey(s) : s, w = this.storage[p] && this.storage[p][f] && this.storage[p][f][N] || void 0;
|
|
7214
|
+
w && (w.updateNodeOpt = h, (o || u) && (w.ops = o, w.op = u), r && (w.opt = r), w.type = x.FullWork, this.updateValue(N.toString(), w, { isSync: g, viewId: p, scenePath: f }), Gt(() => {
|
|
7215
7215
|
var C;
|
|
7216
7216
|
(C = this.control.miniMapManager) == null || C.updateMiniMapCamera(p);
|
|
7217
7217
|
}, Tt.syncInterval));
|
|
@@ -7221,8 +7221,8 @@ const Tt = class Tt extends VM {
|
|
|
7221
7221
|
if (!f)
|
|
7222
7222
|
return;
|
|
7223
7223
|
let I;
|
|
7224
|
-
d != null && d.length && (I = d.map((
|
|
7225
|
-
const m = this.transformKey(H),
|
|
7224
|
+
d != null && d.length && (I = d.map((N) => this.isLocalId(N + "") ? this.transformKey(N) : N));
|
|
7225
|
+
const m = this.transformKey(H), S = this.storage[p] && this.storage[p][f] && this.storage[p][f][m] || void 0, T = r || (S == null ? void 0 : S.opt);
|
|
7226
7226
|
I && this.checkOtherSelector(m, I, { isSync: g, viewId: p, scenePath: f }), this.updateValue(m, I && {
|
|
7227
7227
|
type: x.Select,
|
|
7228
7228
|
toolsType: v.Selector,
|
|
@@ -7345,7 +7345,7 @@ const Tt = class Tt extends VM {
|
|
|
7345
7345
|
this.removeStorageStateListener(), this.serviceStorage = {}, this.storage = {}, this.removeAuthStateListener(), this.authStorage = {};
|
|
7346
7346
|
}
|
|
7347
7347
|
dispatchPageAuth(t, e = !0) {
|
|
7348
|
-
var l, h, u, d, g, f, p, M, I, m,
|
|
7348
|
+
var l, h, u, d, g, f, p, M, I, m, S, T, N, w, C, L, A, j, D, R, z, E, st, K, V, Z, Q, G, q, lt, Lt, ot, ut, X, $, dt, wt, $t;
|
|
7349
7349
|
const { operation: s, viewId: o, scenePath: n, pageId: r, pageData: c } = t;
|
|
7350
7350
|
switch (s) {
|
|
7351
7351
|
case Rt.addPage: {
|
|
@@ -7374,13 +7374,13 @@ const Tt = class Tt extends VM {
|
|
|
7374
7374
|
case Rt.deletePage: {
|
|
7375
7375
|
if (!o || !n || !r)
|
|
7376
7376
|
return;
|
|
7377
|
-
(
|
|
7377
|
+
(S = (m = (I = (M = (p = this.authStorage) == null ? void 0 : p.pageAuth) == null ? void 0 : M[o]) == null ? void 0 : I[n]) == null ? void 0 : m.pages) != null && S[r] && (delete this.authStorage.pageAuth[o][n].pages[r], e && ((T = this.plugin) == null || T.updateAttributes([this.authSpace, "pageAuth", o, n, "pages", r], void 0)));
|
|
7378
7378
|
return;
|
|
7379
7379
|
}
|
|
7380
7380
|
case Rt.clearPage: {
|
|
7381
7381
|
if (!o || !n || !r)
|
|
7382
7382
|
return;
|
|
7383
|
-
(A = (L = (C = (w = (
|
|
7383
|
+
(A = (L = (C = (w = (N = this.authStorage) == null ? void 0 : N.pageAuth) == null ? void 0 : w[o]) == null ? void 0 : C[n]) == null ? void 0 : L.pages) != null && A[r] && (delete this.authStorage.pageAuth[o][n].pages[r], e && ((j = this.plugin) == null || j.updateAttributes([this.authSpace, "pageAuth", o, n, "pages", r], {})));
|
|
7384
7384
|
return;
|
|
7385
7385
|
}
|
|
7386
7386
|
case Rt.addElement: {
|
|
@@ -7410,7 +7410,7 @@ const Tt = class Tt extends VM {
|
|
|
7410
7410
|
}
|
|
7411
7411
|
}
|
|
7412
7412
|
dispatchRenderAuth(t, e = !0) {
|
|
7413
|
-
var l, h, u, d, g, f, p, M, I, m,
|
|
7413
|
+
var l, h, u, d, g, f, p, M, I, m, S, T, N, w, C, L, A, j, D, R;
|
|
7414
7414
|
const { operation: s, viewId: o, uid: n, renderData: r, isClear: c } = t;
|
|
7415
7415
|
if (o)
|
|
7416
7416
|
switch (s) {
|
|
@@ -7463,7 +7463,7 @@ const Tt = class Tt extends VM {
|
|
|
7463
7463
|
const z = [this.authSpace];
|
|
7464
7464
|
Object.keys(this.authStorage).length && z.push("renderAuth");
|
|
7465
7465
|
const E = this.authStorage.renderAuth || {};
|
|
7466
|
-
Object.keys(E).length && z.push(o), E[o] = E[o] || {}, this.authStorage.renderAuth = E, Object.keys(E[o]).length && z.push("hide"), E[o].hide = E[o].hide || {}, E[o].hide !== !0 && (Object.keys(E[o].hide).length && z.push(n), E[o].hide[n] = !0), E[o].render !== !0 && ((
|
|
7466
|
+
Object.keys(E).length && z.push(o), E[o] = E[o] || {}, this.authStorage.renderAuth = E, Object.keys(E[o]).length && z.push("hide"), E[o].hide = E[o].hide || {}, E[o].hide !== !0 && (Object.keys(E[o].hide).length && z.push(n), E[o].hide[n] = !0), E[o].render !== !0 && ((S = E[o].render) != null && S[n]) && (delete E[o].render[n], e && ((T = this.plugin) == null || T.updateAttributes([this.authSpace, "renderAuth", o, "render", n], void 0))), e && (z.length === 1 ? (N = this.plugin) == null || N.updateAttributes(z, pt(this.authStorage)) : z.length === 2 ? (w = this.plugin) == null || w.updateAttributes(z, pt(E)) : z.length === 3 ? (C = this.plugin) == null || C.updateAttributes(z, pt(E[o])) : (L = this.plugin) == null || L.updateAttributes(z, !0));
|
|
7467
7467
|
return;
|
|
7468
7468
|
}
|
|
7469
7469
|
case ee.setClear: {
|
|
@@ -7651,7 +7651,7 @@ class QM {
|
|
|
7651
7651
|
get interceptors() {
|
|
7652
7652
|
return {
|
|
7653
7653
|
set: (i, t) => {
|
|
7654
|
-
var g, f, p, M, I, m,
|
|
7654
|
+
var g, f, p, M, I, m, S, T;
|
|
7655
7655
|
if (!this.collector)
|
|
7656
7656
|
return !0;
|
|
7657
7657
|
const { viewId: e, scenePath: s, canSync: o, canWorker: n, type: r, opt: c, dataType: l } = t;
|
|
@@ -7661,10 +7661,10 @@ class QM {
|
|
|
7661
7661
|
d ? d.toolsType === v.Text && (n && (this.control.worker.queryTaskBatchData({
|
|
7662
7662
|
workId: i,
|
|
7663
7663
|
msgType: x.UpdateNode
|
|
7664
|
-
}).forEach((
|
|
7664
|
+
}).forEach((N) => {
|
|
7665
7665
|
var w;
|
|
7666
|
-
(w = this.control.worker) == null || w.taskBatchData.delete(
|
|
7667
|
-
}), (
|
|
7666
|
+
(w = this.control.worker) == null || w.taskBatchData.delete(N);
|
|
7667
|
+
}), (S = this.control.worker) == null || S.taskBatchData.add({
|
|
7668
7668
|
workId: i,
|
|
7669
7669
|
msgType: x.UpdateNode,
|
|
7670
7670
|
dataType: l || U.Local,
|
|
@@ -7675,8 +7675,8 @@ class QM {
|
|
|
7675
7675
|
willRefresh: !0
|
|
7676
7676
|
// willSyncService: canSync
|
|
7677
7677
|
}), (T = this.control.worker) == null || T.runAnimation()), o && Gt(() => {
|
|
7678
|
-
var
|
|
7679
|
-
(
|
|
7678
|
+
var N;
|
|
7679
|
+
(N = this.collector) == null || N.dispatch({
|
|
7680
7680
|
type: x.UpdateNode,
|
|
7681
7681
|
workId: i,
|
|
7682
7682
|
toolsType: v.Text,
|
|
@@ -8221,8 +8221,8 @@ class ZM extends Xt {
|
|
|
8221
8221
|
const m = o.opt;
|
|
8222
8222
|
if (m && m.boxPoint && m.text) {
|
|
8223
8223
|
m.workState = P.Done;
|
|
8224
|
-
const
|
|
8225
|
-
m.boxPoint = [
|
|
8224
|
+
const S = m.boxPoint;
|
|
8225
|
+
m.boxPoint = [S[0] + g[0], S[1] + g[1]], m.workState = P.Done;
|
|
8226
8226
|
const T = this.control.viewContainerManager.transformToOriginPoint(m.boxPoint, r);
|
|
8227
8227
|
this.control.textEditorManager.createTextForMasterController({
|
|
8228
8228
|
workId: p,
|
|
@@ -8246,7 +8246,7 @@ class ZM extends Xt {
|
|
|
8246
8246
|
}
|
|
8247
8247
|
}
|
|
8248
8248
|
copySelector(t) {
|
|
8249
|
-
var p, M, I, m,
|
|
8249
|
+
var p, M, I, m, S, T, N, w, C;
|
|
8250
8250
|
const { viewId: e, store: s } = t, o = this.control.viewContainerManager.getView(e), n = s.selectIds;
|
|
8251
8251
|
if (!this.serviceColloctor || !(n != null && n.length) || !o)
|
|
8252
8252
|
return;
|
|
@@ -8260,7 +8260,7 @@ class ZM extends Xt {
|
|
|
8260
8260
|
centerY: ((M = o.cameraOpt) == null ? void 0 : M.centerY) || 0,
|
|
8261
8261
|
scale: ((I = o.cameraOpt) == null ? void 0 : I.scale) || 1
|
|
8262
8262
|
}
|
|
8263
|
-
}, l = this.control.hasOffscreenCanvas() && ((m = o.displayer.canvasBgRef.current) == null ? void 0 : m.getBoundingClientRect()) || ((
|
|
8263
|
+
}, l = this.control.hasOffscreenCanvas() && ((m = o.displayer.canvasBgRef.current) == null ? void 0 : m.getBoundingClientRect()) || ((S = o.displayer.canvasContainerRef.current) == null ? void 0 : S.getBoundingClientRect()), h = (N = (T = o.displayer) == null ? void 0 : T.floatBarRef.current) == null ? void 0 : N.getBoundingClientRect(), u = l && [l.x + l.width / 2, l.y + l.height / 2], d = h && [h.x + h.width / 2, h.y + h.height / 2], g = u && o.viewData && o.viewData.convertToPointInWorld({ x: u[0], y: u[1] }), f = d && o.viewData && o.viewData.convertToPointInWorld({ x: d[0], y: d[1] });
|
|
8264
8264
|
g && f && (c.offset = {
|
|
8265
8265
|
x: g.x - f.x,
|
|
8266
8266
|
y: g.y - f.y
|
|
@@ -8281,7 +8281,7 @@ class ZM extends Xt {
|
|
|
8281
8281
|
return;
|
|
8282
8282
|
const { offset: l, cameraOpt: h } = s, { scale: u } = h, d = Math.floor(Math.random() * 30 + 1), g = l && [l.x + d, l.y + d] || [d / u, d / u], f = [], p = [];
|
|
8283
8283
|
for (const [I, m] of e.entries()) {
|
|
8284
|
-
const T = (this.serviceColloctor.isLocalId(I) ? I : this.serviceColloctor.getLocalId(I.toString())) + "-" + r,
|
|
8284
|
+
const T = (this.serviceColloctor.isLocalId(I) ? I : this.serviceColloctor.getLocalId(I.toString())) + "-" + r, N = { useAnimation: !1 };
|
|
8285
8285
|
if (m.toolsType === v.Text && m.opt) {
|
|
8286
8286
|
const w = m.opt;
|
|
8287
8287
|
if (w && w.boxPoint && w.text) {
|
|
@@ -8320,14 +8320,14 @@ class ZM extends Xt {
|
|
|
8320
8320
|
}
|
|
8321
8321
|
p.push({
|
|
8322
8322
|
...m,
|
|
8323
|
-
updateNodeOpt:
|
|
8323
|
+
updateNodeOpt: N,
|
|
8324
8324
|
type: x.FullWork,
|
|
8325
8325
|
workId: T,
|
|
8326
8326
|
viewId: o,
|
|
8327
8327
|
scenePath: n
|
|
8328
8328
|
}), f.push([{
|
|
8329
8329
|
...m,
|
|
8330
|
-
updateNodeOpt:
|
|
8330
|
+
updateNodeOpt: N,
|
|
8331
8331
|
workId: T,
|
|
8332
8332
|
msgType: x.FullWork,
|
|
8333
8333
|
dataType: U.Local,
|
|
@@ -8388,10 +8388,10 @@ class XM extends Xt {
|
|
|
8388
8388
|
const m = f.pop();
|
|
8389
8389
|
if (!m)
|
|
8390
8390
|
continue;
|
|
8391
|
-
const
|
|
8392
|
-
let w =
|
|
8391
|
+
const S = m.toString(), T = this.serviceColloctor.isLocalId(S), N = T ? this.serviceColloctor.transformKey(m) : S;
|
|
8392
|
+
let w = S;
|
|
8393
8393
|
!T && this.serviceColloctor.isOwn(w) && (w = this.serviceColloctor.getLocalId(w));
|
|
8394
|
-
const C = p[c][g][
|
|
8394
|
+
const C = p[c][g][N] || void 0;
|
|
8395
8395
|
if (C) {
|
|
8396
8396
|
const L = C.updateNodeOpt || {};
|
|
8397
8397
|
if (n || r) {
|
|
@@ -8513,7 +8513,7 @@ class JM extends Xt {
|
|
|
8513
8513
|
let I = f;
|
|
8514
8514
|
!p && this.serviceColloctor.isOwn(I) && (I = this.serviceColloctor.getLocalId(I));
|
|
8515
8515
|
const m = Pt(l[o][r][M]);
|
|
8516
|
-
let
|
|
8516
|
+
let S;
|
|
8517
8517
|
if (m && I === H) {
|
|
8518
8518
|
if (m.selectIds) {
|
|
8519
8519
|
u.push(...m.selectIds), u.sort((C, L) => {
|
|
@@ -8523,7 +8523,7 @@ class JM extends Xt {
|
|
|
8523
8523
|
});
|
|
8524
8524
|
const T = m.updateNodeOpt || {};
|
|
8525
8525
|
T.zIndexLayer = s;
|
|
8526
|
-
const
|
|
8526
|
+
const N = {
|
|
8527
8527
|
workId: g,
|
|
8528
8528
|
msgType: x.UpdateNode,
|
|
8529
8529
|
dataType: U.Local,
|
|
@@ -8533,16 +8533,16 @@ class JM extends Xt {
|
|
|
8533
8533
|
willSyncService: !0,
|
|
8534
8534
|
viewId: o
|
|
8535
8535
|
}, w = /* @__PURE__ */ new Map();
|
|
8536
|
-
s === si.Top ? (this.addMaxLayer(o),
|
|
8536
|
+
s === si.Top ? (this.addMaxLayer(o), S = this.getMaxZIndex(o)) : (this.addMinLayer(o), S = this.getMinZIndex(o)), u.forEach((C) => {
|
|
8537
8537
|
var D, R, z;
|
|
8538
8538
|
const L = (D = this.serviceColloctor) == null ? void 0 : D.isLocalId(C);
|
|
8539
8539
|
let A = L && ((R = this.serviceColloctor) == null ? void 0 : R.transformKey(C)) || C;
|
|
8540
8540
|
const j = l[o][r][A];
|
|
8541
|
-
!L && ((z = this.serviceColloctor) != null && z.isOwn(A)) && (A = this.serviceColloctor.getLocalId(A)), T.zIndex =
|
|
8541
|
+
!L && ((z = this.serviceColloctor) != null && z.isOwn(A)) && (A = this.serviceColloctor.getLocalId(A)), T.zIndex = S, j != null && j.opt && (j.opt.zIndex = S), j != null && j.opt && w.set(A, {
|
|
8542
8542
|
updateNodeOpt: j.updateNodeOpt,
|
|
8543
8543
|
opt: j.opt
|
|
8544
8544
|
});
|
|
8545
|
-
}),
|
|
8545
|
+
}), N.selectStore = w, N.willSerializeData = !0, h.push([N, {
|
|
8546
8546
|
workId: g,
|
|
8547
8547
|
msgType: x.UpdateNode,
|
|
8548
8548
|
emitEventType: this.emitEventType
|
|
@@ -8578,15 +8578,15 @@ class qM extends Xt {
|
|
|
8578
8578
|
const p = h.pop();
|
|
8579
8579
|
if (!p) continue;
|
|
8580
8580
|
const M = p.toString(), I = this.serviceColloctor.isLocalId(M), m = I && this.serviceColloctor.transformKey(p) || M;
|
|
8581
|
-
let
|
|
8582
|
-
!I && this.serviceColloctor.isOwn(
|
|
8581
|
+
let S = M;
|
|
8582
|
+
!I && this.serviceColloctor.isOwn(S) && (S = this.serviceColloctor.getLocalId(S));
|
|
8583
8583
|
const T = u[r][l][m];
|
|
8584
|
-
if (T &&
|
|
8584
|
+
if (T && S === H) {
|
|
8585
8585
|
if (T.selectIds) {
|
|
8586
|
-
const
|
|
8587
|
-
if (n === P.Start && (this.cachePosition =
|
|
8586
|
+
const N = this.control.viewContainerManager.transformToScenePoint([o.x, o.y], r);
|
|
8587
|
+
if (n === P.Start && (this.cachePosition = N), this.cachePosition) {
|
|
8588
8588
|
const w = T.updateNodeOpt || {};
|
|
8589
|
-
w.translate = [
|
|
8589
|
+
w.translate = [N[0] - this.cachePosition[0], N[1] - this.cachePosition[1]], w.workState = n;
|
|
8590
8590
|
const C = {
|
|
8591
8591
|
workId: p,
|
|
8592
8592
|
msgType: x.UpdateNode,
|
|
@@ -8600,7 +8600,8 @@ class qM extends Xt {
|
|
|
8600
8600
|
n === P.Done && (C.textUpdateForWoker = !0, C.willSerializeData = !0, this.cachePosition = void 0), d.push([C, {
|
|
8601
8601
|
workId: p,
|
|
8602
8602
|
msgType: x.UpdateNode,
|
|
8603
|
-
emitEventType: this.emitEventType
|
|
8603
|
+
emitEventType: this.emitEventType,
|
|
8604
|
+
workState: n
|
|
8604
8605
|
}]);
|
|
8605
8606
|
}
|
|
8606
8607
|
}
|
|
@@ -8667,7 +8668,7 @@ class _M extends Xt {
|
|
|
8667
8668
|
return { key: t, textInfo: o };
|
|
8668
8669
|
}
|
|
8669
8670
|
async collect(t, e) {
|
|
8670
|
-
var m,
|
|
8671
|
+
var m, S, T, N, w;
|
|
8671
8672
|
if (!this.serviceColloctor || !this.mainEngine)
|
|
8672
8673
|
return;
|
|
8673
8674
|
const { workIds: s, workState: o, viewId: n, originPoint: r, scenePoint: c, dir: l, scale: h, translate: u } = t;
|
|
@@ -8689,9 +8690,9 @@ class _M extends Xt {
|
|
|
8689
8690
|
if (z.dir = l, z.originPoint = r, z.scenePoint = c, z.workState = o, z.scale = h, z.translate = u, o === P.Start) {
|
|
8690
8691
|
this.cacheTextInfo.clear();
|
|
8691
8692
|
for (const st of R.selectIds) {
|
|
8692
|
-
const K = (
|
|
8693
|
+
const K = (S = this.serviceColloctor) == null ? void 0 : S.isLocalId(st), V = K && ((T = this.serviceColloctor) == null ? void 0 : T.transformKey(st)) || st;
|
|
8693
8694
|
let Z = V;
|
|
8694
|
-
!K && ((
|
|
8695
|
+
!K && ((N = this.serviceColloctor) != null && N.isOwn(V)) && (Z = this.serviceColloctor.getLocalId(V));
|
|
8695
8696
|
const Q = this.control.textEditorManager.get(Z);
|
|
8696
8697
|
Q && o === P.Start && this.targetText.set(Z, Pt(Q));
|
|
8697
8698
|
}
|
|
@@ -8730,7 +8731,8 @@ class _M extends Xt {
|
|
|
8730
8731
|
o === P.Done && (E.willSerializeData = !0, this.targetText.clear()), M.push([E, {
|
|
8731
8732
|
workId: C,
|
|
8732
8733
|
msgType: x.UpdateNode,
|
|
8733
|
-
emitEventType: this.emitEventType
|
|
8734
|
+
emitEventType: this.emitEventType,
|
|
8735
|
+
workState: o
|
|
8734
8736
|
}]);
|
|
8735
8737
|
continue;
|
|
8736
8738
|
}
|
|
@@ -8878,12 +8880,12 @@ class tw extends Xt {
|
|
|
8878
8880
|
return;
|
|
8879
8881
|
const l = c.focusScenePath, h = [...s], u = (f = this.serviceColloctor) == null ? void 0 : f.storage, d = [], g = n === P.Start && Date.now() || void 0;
|
|
8880
8882
|
for (g && this.mainEngine.internalMsgEmitter.emit("addUndoTicker", g, r); h.length; ) {
|
|
8881
|
-
const
|
|
8882
|
-
if (!
|
|
8883
|
+
const S = h.pop();
|
|
8884
|
+
if (!S)
|
|
8883
8885
|
continue;
|
|
8884
|
-
const T =
|
|
8886
|
+
const T = S.toString(), N = this.serviceColloctor.isLocalId(T), w = N && this.serviceColloctor.transformKey(S) || T;
|
|
8885
8887
|
let C = T;
|
|
8886
|
-
!
|
|
8888
|
+
!N && this.serviceColloctor.isOwn(C) && (C = this.serviceColloctor.getLocalId(C));
|
|
8887
8889
|
const L = u[r][l][w];
|
|
8888
8890
|
if (L && C === H) {
|
|
8889
8891
|
if (((p = L.selectIds) == null ? void 0 : p.length) === 1) {
|
|
@@ -8895,7 +8897,7 @@ class tw extends Xt {
|
|
|
8895
8897
|
const j = L.updateNodeOpt || {};
|
|
8896
8898
|
j.angle = (o + this.cacheOriginRotate) % 360, j.workState = n;
|
|
8897
8899
|
const D = {
|
|
8898
|
-
workId:
|
|
8900
|
+
workId: S,
|
|
8899
8901
|
msgType: x.UpdateNode,
|
|
8900
8902
|
dataType: U.Local,
|
|
8901
8903
|
updateNodeOpt: j,
|
|
@@ -8905,9 +8907,10 @@ class tw extends Xt {
|
|
|
8905
8907
|
viewId: r
|
|
8906
8908
|
};
|
|
8907
8909
|
n === P.Done && (D.willRefreshSelector = !0, D.willSerializeData = !0, this.cacheOriginRotate = 0), d.push([D, {
|
|
8908
|
-
workId:
|
|
8910
|
+
workId: S,
|
|
8909
8911
|
msgType: x.UpdateNode,
|
|
8910
|
-
emitEventType: this.emitEventType
|
|
8912
|
+
emitEventType: this.emitEventType,
|
|
8913
|
+
workState: n
|
|
8911
8914
|
}]);
|
|
8912
8915
|
}
|
|
8913
8916
|
continue;
|
|
@@ -8953,7 +8956,7 @@ class iw extends Xt {
|
|
|
8953
8956
|
}
|
|
8954
8957
|
}
|
|
8955
8958
|
async collect(t) {
|
|
8956
|
-
var m,
|
|
8959
|
+
var m, S, T, N;
|
|
8957
8960
|
if (!this.serviceColloctor || !this.mainEngine)
|
|
8958
8961
|
return;
|
|
8959
8962
|
const { workIds: e, bold: s, italic: o, lineThrough: n, underline: r, viewId: c, fontSize: l } = t, h = this.control.viewContainerManager.getView(c);
|
|
@@ -8979,10 +8982,10 @@ class iw extends Xt {
|
|
|
8979
8982
|
}
|
|
8980
8983
|
if (D && j === H && ((m = D.selectIds) != null && m.length))
|
|
8981
8984
|
for (const z of D.selectIds) {
|
|
8982
|
-
const E = (
|
|
8985
|
+
const E = (S = this.serviceColloctor) == null ? void 0 : S.isLocalId(z);
|
|
8983
8986
|
let st = E && ((T = this.serviceColloctor) == null ? void 0 : T.transformKey(z)) || z;
|
|
8984
8987
|
const K = g[c][u][st] || void 0;
|
|
8985
|
-
if (!E && ((
|
|
8988
|
+
if (!E && ((N = this.serviceColloctor) != null && N.isOwn(st)) && (st = this.serviceColloctor.getLocalId(st)), K && K.toolsType === v.Text && D.opt) {
|
|
8986
8989
|
const V = this.setTextStyle(st, pt(K), R, c);
|
|
8987
8990
|
M.push(V);
|
|
8988
8991
|
continue;
|
|
@@ -9026,13 +9029,13 @@ class sw extends Xt {
|
|
|
9026
9029
|
!f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
|
|
9027
9030
|
const I = l[n][c][p];
|
|
9028
9031
|
if (I && M === H && I.selectIds) {
|
|
9029
|
-
const
|
|
9030
|
-
|
|
9032
|
+
const S = I.updateNodeOpt || {};
|
|
9033
|
+
S.pointMap = s, S.workState = o;
|
|
9031
9034
|
const T = {
|
|
9032
9035
|
workId: d,
|
|
9033
9036
|
msgType: x.UpdateNode,
|
|
9034
9037
|
dataType: U.Local,
|
|
9035
|
-
updateNodeOpt:
|
|
9038
|
+
updateNodeOpt: S,
|
|
9036
9039
|
emitEventType: this.emitEventType,
|
|
9037
9040
|
willRefreshSelector: !0,
|
|
9038
9041
|
willSyncService: !0,
|
|
@@ -9071,7 +9074,7 @@ class ow extends Xt {
|
|
|
9071
9074
|
if (I) {
|
|
9072
9075
|
const m = I.updateNodeOpt || {};
|
|
9073
9076
|
m.isLocked = s;
|
|
9074
|
-
const
|
|
9077
|
+
const S = {
|
|
9075
9078
|
workId: M,
|
|
9076
9079
|
msgType: x.UpdateNode,
|
|
9077
9080
|
dataType: U.Local,
|
|
@@ -9082,7 +9085,7 @@ class ow extends Xt {
|
|
|
9082
9085
|
willSyncService: !0,
|
|
9083
9086
|
viewId: o
|
|
9084
9087
|
};
|
|
9085
|
-
h.push([
|
|
9088
|
+
h.push([S, {
|
|
9086
9089
|
workId: M,
|
|
9087
9090
|
msgType: x.UpdateNode,
|
|
9088
9091
|
emitEventType: this.emitEventType
|
|
@@ -9120,7 +9123,7 @@ class nw extends Xt {
|
|
|
9120
9123
|
willRefresh: !0
|
|
9121
9124
|
};
|
|
9122
9125
|
if (I && M === H) {
|
|
9123
|
-
const
|
|
9126
|
+
const S = {
|
|
9124
9127
|
workId: M,
|
|
9125
9128
|
msgType: x.UpdateNode,
|
|
9126
9129
|
dataType: U.Local,
|
|
@@ -9131,7 +9134,7 @@ class nw extends Xt {
|
|
|
9131
9134
|
willSyncService: !0,
|
|
9132
9135
|
viewId: s
|
|
9133
9136
|
};
|
|
9134
|
-
h.push([
|
|
9137
|
+
h.push([S, {
|
|
9135
9138
|
workId: M,
|
|
9136
9139
|
msgType: x.UpdateNode,
|
|
9137
9140
|
emitEventType: this.emitEventType
|
|
@@ -9624,7 +9627,7 @@ class uw extends hw {
|
|
|
9624
9627
|
}
|
|
9625
9628
|
async useMainThread() {
|
|
9626
9629
|
console.info("no OffscreenCanvas");
|
|
9627
|
-
const { MainThreadManagerImpl: t } = await import("./index-
|
|
9630
|
+
const { MainThreadManagerImpl: t } = await import("./index-20s2n69K.mjs");
|
|
9628
9631
|
this.mainThread = new t(this);
|
|
9629
9632
|
}
|
|
9630
9633
|
async on() {
|
|
@@ -9732,9 +9735,9 @@ class uw extends hw {
|
|
|
9732
9735
|
isSync: M,
|
|
9733
9736
|
imageBitmap: I,
|
|
9734
9737
|
canvasHeight: m,
|
|
9735
|
-
canvasWidth:
|
|
9738
|
+
canvasWidth: S,
|
|
9736
9739
|
rect: T,
|
|
9737
|
-
op:
|
|
9740
|
+
op: N,
|
|
9738
9741
|
canTextEdit: w,
|
|
9739
9742
|
points: C,
|
|
9740
9743
|
selectorColor: L,
|
|
@@ -9761,7 +9764,7 @@ class uw extends hw {
|
|
|
9761
9764
|
const X = c.scenePath || this.viewContainerManager.getCurScenePath(E);
|
|
9762
9765
|
switch (l) {
|
|
9763
9766
|
case x.Select: {
|
|
9764
|
-
const $ = h != null && h.length ? { ...d, selectIds: h, canvasHeight: m, canvasWidth:
|
|
9767
|
+
const $ = h != null && h.length ? { ...d, selectIds: h, canvasHeight: m, canvasWidth: S, points: C } : void 0;
|
|
9765
9768
|
$ && (u != null && u.strokeColor) && ($.selectorColor = u.strokeColor), $ && L && ($.selectorColor = L), $ && g && ($.strokeColor = g), $ && (u != null && u.fillColor) && ($.fillColor = u.fillColor), $ && f && ($.fillColor = f), $ && Ut(A) && ($.canRotate = A), $ && j && ($.scaleType = j), $ && w && ($.canTextEdit = w), $ && D && ($.textOpt = D), $ && Ut(K) && ($.canLock = K), $ && Ut(V) && ($.isLocked = V), $ && Z && ($.shapeOpt = Z), $ && Q && ($.toolsTypes = Q), $ && G && ($.thickness = G), $ && q && ($.strokeType = q), $ && Ut(lt) && ($.useStroke = lt), E && this.viewContainerManager.showFloatBar(E, !!$, $), p && ((s = this.collector) == null || s.dispatch({ type: l, selectIds: h, opt: u, isSync: M, viewId: E, scenePath: X }));
|
|
9766
9769
|
break;
|
|
9767
9770
|
}
|
|
@@ -9778,7 +9781,7 @@ class uw extends hw {
|
|
|
9778
9781
|
}
|
|
9779
9782
|
break;
|
|
9780
9783
|
case x.Cursor:
|
|
9781
|
-
|
|
9784
|
+
N && this.control.cursor.collectServiceCursor({ ...c });
|
|
9782
9785
|
break;
|
|
9783
9786
|
case x.Clear:
|
|
9784
9787
|
if (E) {
|
|
@@ -9856,15 +9859,15 @@ class uw extends hw {
|
|
|
9856
9859
|
collectorAsyncData(t) {
|
|
9857
9860
|
var e, s, o, n;
|
|
9858
9861
|
for (const r of t) {
|
|
9859
|
-
const { type: c, op: l, workId: h, index: u, removeIds: d, ops: g, opt: f, updateNodeOpt: p, toolsType: M, isSync: I, viewId: m, isLockSentEventCursor:
|
|
9862
|
+
const { type: c, op: l, workId: h, index: u, removeIds: d, ops: g, opt: f, updateNodeOpt: p, toolsType: M, isSync: I, viewId: m, isLockSentEventCursor: S, nextTasks: T } = r;
|
|
9860
9863
|
if (!m) {
|
|
9861
9864
|
console.error("collectorAsyncData", r);
|
|
9862
9865
|
return;
|
|
9863
9866
|
}
|
|
9864
|
-
const
|
|
9867
|
+
const N = r.scenePath || this.viewContainerManager.getCurScenePath(m);
|
|
9865
9868
|
switch (c) {
|
|
9866
9869
|
case x.None: {
|
|
9867
|
-
|
|
9870
|
+
S && Gt(() => {
|
|
9868
9871
|
this.setLockSentEventCursor(!1);
|
|
9869
9872
|
}, this.maxLastSyncTime);
|
|
9870
9873
|
break;
|
|
@@ -9879,7 +9882,7 @@ class uw extends hw {
|
|
|
9879
9882
|
index: u,
|
|
9880
9883
|
isSync: I,
|
|
9881
9884
|
viewId: m,
|
|
9882
|
-
scenePath:
|
|
9885
|
+
scenePath: N,
|
|
9883
9886
|
updateNodeOpt: p
|
|
9884
9887
|
});
|
|
9885
9888
|
break;
|
|
@@ -9894,18 +9897,18 @@ class uw extends hw {
|
|
|
9894
9897
|
toolsType: M,
|
|
9895
9898
|
isSync: I,
|
|
9896
9899
|
viewId: m,
|
|
9897
|
-
scenePath:
|
|
9900
|
+
scenePath: N
|
|
9898
9901
|
}), this.willSelectorWorkId && h && h.toString() === this.willSelectorWorkId && this.control.runEffectWork(() => {
|
|
9899
9902
|
this.setShapeSelectorByWorkId(this.willSelectorWorkId, m), this.willSelectorWorkId = void 0;
|
|
9900
9903
|
});
|
|
9901
9904
|
break;
|
|
9902
9905
|
}
|
|
9903
9906
|
case x.UpdateNode: {
|
|
9904
|
-
(o = this.collector) == null || o.dispatch({ type: c, updateNodeOpt: p, workId: h, opt: f, ops: g, op: l, isSync: I, viewId: m, scenePath:
|
|
9907
|
+
(o = this.collector) == null || o.dispatch({ type: c, updateNodeOpt: p, workId: h, opt: f, ops: g, op: l, isSync: I, viewId: m, scenePath: N });
|
|
9905
9908
|
break;
|
|
9906
9909
|
}
|
|
9907
9910
|
case x.RemoveNode: {
|
|
9908
|
-
d && this.control.textEditorManager.deleteBatch(d, !1, !1), (n = this.collector) == null || n.dispatch({ type: c, removeIds: d, isSync: I, viewId: m, scenePath:
|
|
9911
|
+
d && this.control.textEditorManager.deleteBatch(d, !1, !1), (n = this.collector) == null || n.dispatch({ type: c, removeIds: d, isSync: I, viewId: m, scenePath: N }), this.willSelectorWorkId && (d != null && d.includes(this.willSelectorWorkId)) && (this.willSelectorWorkId = void 0);
|
|
9909
9912
|
break;
|
|
9910
9913
|
}
|
|
9911
9914
|
}
|
|
@@ -10167,9 +10170,9 @@ class uw extends hw {
|
|
|
10167
10170
|
if (!this.control.renderControl.isFilterAble({ viewId: n, elementId: t, scenePath: r }, h))
|
|
10168
10171
|
return;
|
|
10169
10172
|
const m = c;
|
|
10170
|
-
if (m.workId = (p = this.collector) != null && p.isOwn(l) ? (M = this.collector) == null ? void 0 : M.getLocalId(l) : l, m.msgType = h, m.toolsType === v.LaserPen && (m.isRunSubWork = !0), m.dataType = U.Service, m.viewId = n, m.scenePath = r, m.selectIds && (m.selectIds = m.selectIds.map((
|
|
10171
|
-
var T,
|
|
10172
|
-
return (T = this.collector) != null && T.isOwn(
|
|
10173
|
+
if (m.workId = (p = this.collector) != null && p.isOwn(l) ? (M = this.collector) == null ? void 0 : M.getLocalId(l) : l, m.msgType = h, m.toolsType === v.LaserPen && (m.isRunSubWork = !0), m.dataType = U.Service, m.viewId = n, m.scenePath = r, m.selectIds && (m.selectIds = m.selectIds.map((S) => {
|
|
10174
|
+
var T, N;
|
|
10175
|
+
return (T = this.collector) != null && T.isOwn(S) ? (N = this.collector) == null ? void 0 : N.getLocalId(S) : S;
|
|
10173
10176
|
})), m && m.toolsType === v.Text || (o == null ? void 0 : o.toolsType) === v.Text) {
|
|
10174
10177
|
this.control.textEditorManager.onServiceDerive(m);
|
|
10175
10178
|
return;
|
|
@@ -12120,7 +12123,7 @@ const Me = class Me {
|
|
|
12120
12123
|
return !!t.includes(e);
|
|
12121
12124
|
}
|
|
12122
12125
|
refreshPlugin(i, t = !1) {
|
|
12123
|
-
var n, r, c, l, h, u, d, g, f, p, M, I, m,
|
|
12126
|
+
var n, r, c, l, h, u, d, g, f, p, M, I, m, S, T, N, w, C, L, A, j;
|
|
12124
12127
|
let e;
|
|
12125
12128
|
const { scenePath: s } = i, o = i.data;
|
|
12126
12129
|
if (!(!o || !this.collector))
|
|
@@ -12180,7 +12183,7 @@ const Me = class Me {
|
|
|
12180
12183
|
if (e = t ? this.isNewEffectiveScene(D, K) : this.isOldEffectiveScene(D, K, s), e) {
|
|
12181
12184
|
if (t && Array.isArray(z) && z.length === 2) {
|
|
12182
12185
|
const V = z[1];
|
|
12183
|
-
if ((m = V.updateNodeOpt) != null && m.useAnimation && (V.updateNodeOpt.useAnimation = !1), ((
|
|
12186
|
+
if ((m = V.updateNodeOpt) != null && m.useAnimation && (V.updateNodeOpt.useAnimation = !1), ((S = this.collector) == null ? void 0 : S.getLocalId(D.key)) === H && ((T = this.collector) != null && T.isOwn(D.key))) {
|
|
12184
12187
|
const Z = V.selectIds;
|
|
12185
12188
|
if (Z) {
|
|
12186
12189
|
const Q = K.filter((q) => {
|
|
@@ -12193,7 +12196,7 @@ const Me = class Me {
|
|
|
12193
12196
|
let G = !1;
|
|
12194
12197
|
for (const q of Q)
|
|
12195
12198
|
for (let lt = 0; lt < Z.length; lt++)
|
|
12196
|
-
q != null && q.selectIds && ((
|
|
12199
|
+
q != null && q.selectIds && ((N = q.selectIds) != null && N.includes(Z[lt])) && (delete Z[lt], G = !0);
|
|
12197
12200
|
G && (V.selectIds = Z.filter((q) => !!q));
|
|
12198
12201
|
}
|
|
12199
12202
|
}
|
|
@@ -12376,8 +12379,8 @@ class Ve {
|
|
|
12376
12379
|
/** 绘制view */
|
|
12377
12380
|
render(i) {
|
|
12378
12381
|
var t, e, s, o, n, r, c, l, h, u, d, g, f, p, M, I, m;
|
|
12379
|
-
for (const
|
|
12380
|
-
const { rect: T, imageBitmap:
|
|
12382
|
+
for (const S of i) {
|
|
12383
|
+
const { rect: T, imageBitmap: N, isClear: w, isUnClose: C, drawCanvas: L, clearCanvas: A, viewId: j } = S, D = (t = this.getView(j)) == null ? void 0 : t.displayer;
|
|
12381
12384
|
if (D && T) {
|
|
12382
12385
|
const { dpr: R, canvasBgRef: z, canvasFloatRef: E, canvasServiceFloatRef: st, canvasTopRef: K } = D, V = Math.floor(T.w * R), Z = Math.floor(T.h * R), Q = T.x * R, G = T.y * R;
|
|
12383
12386
|
if (w) {
|
|
@@ -12397,27 +12400,27 @@ class Ve {
|
|
|
12397
12400
|
}
|
|
12398
12401
|
continue;
|
|
12399
12402
|
}
|
|
12400
|
-
if (L &&
|
|
12403
|
+
if (L && N)
|
|
12401
12404
|
switch (L) {
|
|
12402
12405
|
case It.TopFloat:
|
|
12403
|
-
(d = (u = K.current) == null ? void 0 : u.getContext("2d")) == null || d.drawImage(
|
|
12406
|
+
(d = (u = K.current) == null ? void 0 : u.getContext("2d")) == null || d.drawImage(N, 0, 0, V, Z, Q, G, V, Z);
|
|
12404
12407
|
break;
|
|
12405
12408
|
case It.Float: {
|
|
12406
|
-
(f = (g = E.current) == null ? void 0 : g.getContext("2d")) == null || f.drawImage(
|
|
12409
|
+
(f = (g = E.current) == null ? void 0 : g.getContext("2d")) == null || f.drawImage(N, 0, 0, V, Z, Q, G, V, Z);
|
|
12407
12410
|
break;
|
|
12408
12411
|
}
|
|
12409
12412
|
case It.ServiceFloat: {
|
|
12410
|
-
(M = (p = st.current) == null ? void 0 : p.getContext("2d")) == null || M.drawImage(
|
|
12413
|
+
(M = (p = st.current) == null ? void 0 : p.getContext("2d")) == null || M.drawImage(N, 0, 0, V, Z, Q, G, V, Z);
|
|
12411
12414
|
break;
|
|
12412
12415
|
}
|
|
12413
12416
|
case It.Bg: {
|
|
12414
|
-
(m = (I = z.current) == null ? void 0 : I.getContext("2d")) == null || m.drawImage(
|
|
12417
|
+
(m = (I = z.current) == null ? void 0 : I.getContext("2d")) == null || m.drawImage(N, 0, 0, V, Z, Q, G, V, Z);
|
|
12415
12418
|
break;
|
|
12416
12419
|
}
|
|
12417
12420
|
}
|
|
12418
12421
|
if (C)
|
|
12419
12422
|
continue;
|
|
12420
|
-
|
|
12423
|
+
N == null || N.close();
|
|
12421
12424
|
}
|
|
12422
12425
|
}
|
|
12423
12426
|
}
|
|
@@ -13099,8 +13102,8 @@ const Aw = (a) => {
|
|
|
13099
13102
|
const { open: i, setOpen: t, floatBarRef: e } = a, { floatBarData: s, floatBarColors: o, mananger: n, setFloatBarData: r } = bt(kt), [c, l] = nt(), [h, u] = nt(1);
|
|
13100
13103
|
ft(() => {
|
|
13101
13104
|
if (s != null && s.strokeColor) {
|
|
13102
|
-
const [m,
|
|
13103
|
-
l(m), u(
|
|
13105
|
+
const [m, S] = Ti(s.strokeColor);
|
|
13106
|
+
l(m), u(S);
|
|
13104
13107
|
}
|
|
13105
13108
|
}, [s]);
|
|
13106
13109
|
const d = J(() => {
|
|
@@ -13113,28 +13116,28 @@ const Aw = (a) => {
|
|
|
13113
13116
|
return m.top = "inherit", m.bottom = 50, m;
|
|
13114
13117
|
}
|
|
13115
13118
|
}
|
|
13116
|
-
}, [(e == null ? void 0 : e.current) && s, n == null ? void 0 : n.height]), g = J(() => /* @__PURE__ */ k.createElement(Ci, { key: "strokeColors", opacity: h, activeColor: c, setCurOpacity: (m,
|
|
13119
|
+
}, [(e == null ? void 0 : e.current) && s, n == null ? void 0 : n.height]), g = J(() => /* @__PURE__ */ k.createElement(Ci, { key: "strokeColors", opacity: h, activeColor: c, setCurOpacity: (m, S, T) => {
|
|
13117
13120
|
T === P.Start && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !0), T === P.Done && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !1), u(m);
|
|
13118
|
-
const
|
|
13119
|
-
s != null && s.strokeColor && r({ strokeColor:
|
|
13121
|
+
const N = xt(S, m);
|
|
13122
|
+
s != null && s.strokeColor && r({ strokeColor: N }), rt.emitMethod(
|
|
13120
13123
|
it.MainEngine,
|
|
13121
13124
|
B.SetColorNode,
|
|
13122
|
-
{ workIds: [H], strokeColor:
|
|
13125
|
+
{ workIds: [H], strokeColor: N, workState: T, viewId: n == null ? void 0 : n.viewId }
|
|
13123
13126
|
);
|
|
13124
13127
|
} }), [h, c, n == null ? void 0 : n.control.room, n == null ? void 0 : n.viewId, s]), f = J(() => {
|
|
13125
|
-
var m,
|
|
13128
|
+
var m, S;
|
|
13126
13129
|
return c && (s != null && s.thickness) ? /* @__PURE__ */ k.createElement(
|
|
13127
13130
|
Rw,
|
|
13128
13131
|
{
|
|
13129
13132
|
key: "strokeThickness",
|
|
13130
13133
|
min: Math.min(s.thickness, ((m = n == null ? void 0 : n.control.pluginOptions.strokeWidth) == null ? void 0 : m.min) || 1),
|
|
13131
|
-
max: Math.max(s.thickness, ((
|
|
13134
|
+
max: Math.max(s.thickness, ((S = n == null ? void 0 : n.control.pluginOptions.strokeWidth) == null ? void 0 : S.max) || 10),
|
|
13132
13135
|
activeNumber: s.thickness,
|
|
13133
|
-
setActiveNumber: (T,
|
|
13134
|
-
|
|
13136
|
+
setActiveNumber: (T, N) => {
|
|
13137
|
+
N === P.Start && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !0), N === P.Done && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !1), s != null && s.thickness && r({ thickness: T }), rt.emitMethod(
|
|
13135
13138
|
it.MainEngine,
|
|
13136
13139
|
B.SetColorNode,
|
|
13137
|
-
{ workIds: [H], thickness: T, workState:
|
|
13140
|
+
{ workIds: [H], thickness: T, workState: N, viewId: n == null ? void 0 : n.viewId }
|
|
13138
13141
|
);
|
|
13139
13142
|
},
|
|
13140
13143
|
color: c
|
|
@@ -13167,16 +13170,16 @@ const Aw = (a) => {
|
|
|
13167
13170
|
p,
|
|
13168
13171
|
f,
|
|
13169
13172
|
/* @__PURE__ */ k.createElement("div", { className: "font-colors-line" }),
|
|
13170
|
-
o.concat().map((m,
|
|
13173
|
+
o.concat().map((m, S) => {
|
|
13171
13174
|
const T = Xe(...m);
|
|
13172
13175
|
return /* @__PURE__ */ k.createElement(
|
|
13173
13176
|
ki,
|
|
13174
13177
|
{
|
|
13175
|
-
key:
|
|
13178
|
+
key: S,
|
|
13176
13179
|
color: T,
|
|
13177
13180
|
activeColor: c,
|
|
13178
|
-
onPointerUpHandler: (
|
|
13179
|
-
|
|
13181
|
+
onPointerUpHandler: (N) => {
|
|
13182
|
+
N.stopPropagation(), l(T);
|
|
13180
13183
|
const w = xt(T, h);
|
|
13181
13184
|
s != null && s.strokeColor && (s.strokeColor = w, r({ strokeColor: w })), rt.emitMethod(
|
|
13182
13185
|
it.MainEngine,
|
|
@@ -13220,8 +13223,8 @@ const Aw = (a) => {
|
|
|
13220
13223
|
}
|
|
13221
13224
|
}, [e == null ? void 0 : e.current, s, n == null ? void 0 : n.height]), g = J(() => c && c !== "transparent" ? /* @__PURE__ */ k.createElement(Ci, { key: "fillColors", opacity: h || 0, activeColor: c, setCurOpacity: (M, I, m) => {
|
|
13222
13225
|
m === P.Start && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !0), m === P.Done && (n != null && n.control.room) && (n.control.room.disableDeviceInputs = !1), u(M);
|
|
13223
|
-
const
|
|
13224
|
-
s != null && s.fillColor && (s.fillColor =
|
|
13226
|
+
const S = xt(I, M);
|
|
13227
|
+
s != null && s.fillColor && (s.fillColor = S, r({ fillColor: S })), rt.emitMethod(
|
|
13225
13228
|
it.MainEngine,
|
|
13226
13229
|
B.SetColorNode,
|
|
13227
13230
|
{ workIds: [H], fillColor: c && xt(I, M), workState: m, viewId: n == null ? void 0 : n.viewId }
|
|
@@ -13258,8 +13261,8 @@ const Aw = (a) => {
|
|
|
13258
13261
|
key: I,
|
|
13259
13262
|
color: m,
|
|
13260
13263
|
activeColor: c,
|
|
13261
|
-
onPointerUpHandler: (
|
|
13262
|
-
|
|
13264
|
+
onPointerUpHandler: (S) => {
|
|
13265
|
+
S.cancelable && S.preventDefault(), S.stopPropagation(), l(m);
|
|
13263
13266
|
const T = xt(m, h);
|
|
13264
13267
|
s != null && s.fillColor && (s.fillColor = T, r({ fillColor: T })), rt.emitMethod(
|
|
13265
13268
|
it.MainEngine,
|
|
@@ -13290,8 +13293,8 @@ const Aw = (a) => {
|
|
|
13290
13293
|
const { open: i, setOpen: t, textOpt: e, workIds: s, floatBarRef: o } = a, { floatBarColors: n, mananger: r, setFloatBarData: c, floatBarData: l } = bt(kt), [h, u] = nt(), [d, g] = nt(1);
|
|
13291
13294
|
ft(() => {
|
|
13292
13295
|
if (e != null && e.fontColor) {
|
|
13293
|
-
const [m,
|
|
13294
|
-
u(m), g(
|
|
13296
|
+
const [m, S] = (e == null ? void 0 : e.fontColor) === "transparent" && ["transparent", 0] || Ti(e.fontColor);
|
|
13297
|
+
u(m), g(S);
|
|
13295
13298
|
}
|
|
13296
13299
|
}, [e == null ? void 0 : e.fontColor]);
|
|
13297
13300
|
const f = J(() => {
|
|
@@ -13304,15 +13307,15 @@ const Aw = (a) => {
|
|
|
13304
13307
|
return m.top = "inherit", m.bottom = 50, m;
|
|
13305
13308
|
}
|
|
13306
13309
|
}
|
|
13307
|
-
}, [o == null ? void 0 : o.current, l, r]), p = J(() => h && h !== "transparent" ? /* @__PURE__ */ k.createElement(Ci, { key: "fontColors", opacity: d, activeColor: h, setCurOpacity: (m,
|
|
13310
|
+
}, [o == null ? void 0 : o.current, l, r]), p = J(() => h && h !== "transparent" ? /* @__PURE__ */ k.createElement(Ci, { key: "fontColors", opacity: d, activeColor: h, setCurOpacity: (m, S, T) => {
|
|
13308
13311
|
T === P.Start && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !0), T === P.Done && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !1), g(m);
|
|
13309
|
-
const
|
|
13310
|
-
l != null && l.textOpt && (l.textOpt.fontColor =
|
|
13312
|
+
const N = xt(S, m);
|
|
13313
|
+
l != null && l.textOpt && (l.textOpt.fontColor = N, c({ textOpt: l.textOpt })), rt.emitMethod(
|
|
13311
13314
|
it.MainEngine,
|
|
13312
13315
|
B.SetColorNode,
|
|
13313
13316
|
{
|
|
13314
13317
|
workIds: s || [H],
|
|
13315
|
-
fontColor: h &&
|
|
13318
|
+
fontColor: h && N,
|
|
13316
13319
|
workState: T,
|
|
13317
13320
|
viewId: r == null ? void 0 : r.viewId
|
|
13318
13321
|
}
|
|
@@ -13326,16 +13329,16 @@ const Aw = (a) => {
|
|
|
13326
13329
|
m.stopPropagation(), m.nativeEvent.stopImmediatePropagation();
|
|
13327
13330
|
}
|
|
13328
13331
|
},
|
|
13329
|
-
n.map((m,
|
|
13332
|
+
n.map((m, S) => {
|
|
13330
13333
|
const T = Xe(...m);
|
|
13331
13334
|
return /* @__PURE__ */ k.createElement(
|
|
13332
13335
|
ki,
|
|
13333
13336
|
{
|
|
13334
|
-
key:
|
|
13337
|
+
key: S,
|
|
13335
13338
|
color: T,
|
|
13336
13339
|
activeColor: h,
|
|
13337
|
-
onPointerUpHandler: (
|
|
13338
|
-
|
|
13340
|
+
onPointerUpHandler: (N) => {
|
|
13341
|
+
N.stopPropagation(), u(T);
|
|
13339
13342
|
const w = xt(T, d);
|
|
13340
13343
|
l != null && l.textOpt && (l.textOpt.fontColor = w, c({ textOpt: l.textOpt })), rt.emitMethod(
|
|
13341
13344
|
it.MainEngine,
|
|
@@ -13367,8 +13370,8 @@ const Aw = (a) => {
|
|
|
13367
13370
|
const { open: i, setOpen: t, textOpt: e, workIds: s, floatBarRef: o } = a, { floatBarColors: n, mananger: r, setFloatBarData: c, floatBarData: l } = bt(kt), [h, u] = nt(), [d, g] = nt(1);
|
|
13368
13371
|
ft(() => {
|
|
13369
13372
|
if (e != null && e.fontBgColor) {
|
|
13370
|
-
const [m,
|
|
13371
|
-
u(m), g(
|
|
13373
|
+
const [m, S] = (e == null ? void 0 : e.fontBgColor) === "transparent" && ["transparent", 1] || Ti(e.fontBgColor);
|
|
13374
|
+
u(m), g(S);
|
|
13372
13375
|
}
|
|
13373
13376
|
}, [e == null ? void 0 : e.fontBgColor]);
|
|
13374
13377
|
const f = J(() => {
|
|
@@ -13381,15 +13384,15 @@ const Aw = (a) => {
|
|
|
13381
13384
|
return m.top = "inherit", m.bottom = 50, m;
|
|
13382
13385
|
}
|
|
13383
13386
|
}
|
|
13384
|
-
}, [o == null ? void 0 : o.current, l, r]), p = J(() => h && h !== "transparent" ? /* @__PURE__ */ k.createElement(Ci, { key: "fontBgColor", opacity: d || 0, activeColor: h, setCurOpacity: (m,
|
|
13387
|
+
}, [o == null ? void 0 : o.current, l, r]), p = J(() => h && h !== "transparent" ? /* @__PURE__ */ k.createElement(Ci, { key: "fontBgColor", opacity: d || 0, activeColor: h, setCurOpacity: (m, S, T) => {
|
|
13385
13388
|
T === P.Start && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !0), T === P.Done && (r != null && r.control.room) && (r.control.room.disableDeviceInputs = !1), g(m);
|
|
13386
|
-
const
|
|
13387
|
-
l != null && l.textOpt && (l.textOpt.fontBgColor =
|
|
13389
|
+
const N = xt(S, m);
|
|
13390
|
+
l != null && l.textOpt && (l.textOpt.fontBgColor = N, c({ textOpt: l.textOpt })), rt.emitMethod(
|
|
13388
13391
|
it.MainEngine,
|
|
13389
13392
|
B.SetColorNode,
|
|
13390
13393
|
{
|
|
13391
13394
|
workIds: s || [H],
|
|
13392
|
-
fontBgColor: h && xt(
|
|
13395
|
+
fontBgColor: h && xt(S, m),
|
|
13393
13396
|
workState: T,
|
|
13394
13397
|
viewId: r == null ? void 0 : r.viewId
|
|
13395
13398
|
}
|
|
@@ -13409,25 +13412,25 @@ const Aw = (a) => {
|
|
|
13409
13412
|
activeColor: h,
|
|
13410
13413
|
onPointerUpHandler: (m) => {
|
|
13411
13414
|
m.stopPropagation();
|
|
13412
|
-
const
|
|
13413
|
-
u(
|
|
13415
|
+
const S = "transparent";
|
|
13416
|
+
u(S), l != null && l.textOpt && (l.textOpt.fontBgColor = S, c({ textOpt: l.textOpt })), rt.emitMethod(
|
|
13414
13417
|
it.MainEngine,
|
|
13415
13418
|
B.SetColorNode,
|
|
13416
|
-
{ workIds: s || [H], workState: P.Done, fontBgColor:
|
|
13419
|
+
{ workIds: s || [H], workState: P.Done, fontBgColor: S, viewId: r == null ? void 0 : r.viewId }
|
|
13417
13420
|
);
|
|
13418
13421
|
}
|
|
13419
13422
|
}
|
|
13420
13423
|
),
|
|
13421
|
-
n.map((m,
|
|
13424
|
+
n.map((m, S) => {
|
|
13422
13425
|
const T = Xe(...m);
|
|
13423
13426
|
return /* @__PURE__ */ k.createElement(
|
|
13424
13427
|
ki,
|
|
13425
13428
|
{
|
|
13426
|
-
key:
|
|
13429
|
+
key: S,
|
|
13427
13430
|
color: T,
|
|
13428
13431
|
activeColor: h,
|
|
13429
|
-
onPointerUpHandler: (
|
|
13430
|
-
|
|
13432
|
+
onPointerUpHandler: (N) => {
|
|
13433
|
+
N.stopPropagation(), u(T);
|
|
13431
13434
|
const w = xt(T, d);
|
|
13432
13435
|
l != null && l.textOpt && (l.textOpt.fontBgColor = w, c({ textOpt: l.textOpt })), rt.emitMethod(
|
|
13433
13436
|
it.MainEngine,
|
|
@@ -13517,11 +13520,11 @@ const Aw = (a) => {
|
|
|
13517
13520
|
const I = J(() => {
|
|
13518
13521
|
if (o && (n != null && n.current) && tt(c == null ? void 0 : c.y) && (r != null && r.height)) {
|
|
13519
13522
|
if (n.current.offsetTop && n.current.offsetTop + c.y > 180) {
|
|
13520
|
-
const
|
|
13521
|
-
return
|
|
13523
|
+
const S = {};
|
|
13524
|
+
return S.top = "inherit", S.bottom = 50, S;
|
|
13522
13525
|
} else if (!n.current.offsetTop && (r == null ? void 0 : r.height) - n.current.offsetTop - c.y < 120) {
|
|
13523
|
-
const
|
|
13524
|
-
return
|
|
13526
|
+
const S = {};
|
|
13527
|
+
return S.top = "inherit", S.bottom = 50, S;
|
|
13525
13528
|
}
|
|
13526
13529
|
}
|
|
13527
13530
|
}, [o, n == null ? void 0 : n.current, c, r]), m = J(() => i ? /* @__PURE__ */ k.createElement(
|
|
@@ -13529,8 +13532,8 @@ const Aw = (a) => {
|
|
|
13529
13532
|
{
|
|
13530
13533
|
className: "font-style-menu",
|
|
13531
13534
|
style: I,
|
|
13532
|
-
onPointerUp: (
|
|
13533
|
-
|
|
13535
|
+
onPointerUp: (S) => {
|
|
13536
|
+
S.stopPropagation(), S.nativeEvent.stopImmediatePropagation();
|
|
13534
13537
|
}
|
|
13535
13538
|
},
|
|
13536
13539
|
/* @__PURE__ */ k.createElement($w, { workIds: s || [H], bold: l, setBold: h, viewId: r == null ? void 0 : r.viewId }),
|
|
@@ -13542,8 +13545,8 @@ const Aw = (a) => {
|
|
|
13542
13545
|
"div",
|
|
13543
13546
|
{
|
|
13544
13547
|
className: `button normal-button ${i && "active"}`,
|
|
13545
|
-
onPointerUp: (
|
|
13546
|
-
|
|
13548
|
+
onPointerUp: (S) => {
|
|
13549
|
+
S.stopPropagation(), S.nativeEvent.stopImmediatePropagation(), t(!i);
|
|
13547
13550
|
}
|
|
13548
13551
|
},
|
|
13549
13552
|
/* @__PURE__ */ k.createElement("img", { alt: "icon", src: Dt(i ? "font-style-active" : "font-style") }),
|
|
@@ -13604,26 +13607,26 @@ const Aw = (a) => {
|
|
|
13604
13607
|
const f = J(() => {
|
|
13605
13608
|
if (n != null && n.current && tt(c == null ? void 0 : c.y) && (r != null && r.height)) {
|
|
13606
13609
|
if (n.current.offsetTop && n.current.offsetTop + c.y > 180) {
|
|
13607
|
-
const
|
|
13608
|
-
return
|
|
13610
|
+
const S = {};
|
|
13611
|
+
return S.top = "inherit", S.bottom = 35, S;
|
|
13609
13612
|
} else if (!n.current.offsetTop && (r == null ? void 0 : r.height) - n.current.offsetTop - c.y < 120) {
|
|
13610
|
-
const
|
|
13611
|
-
return
|
|
13613
|
+
const S = {};
|
|
13614
|
+
return S.top = "inherit", S.bottom = 35, S;
|
|
13612
13615
|
}
|
|
13613
13616
|
}
|
|
13614
13617
|
}, [n == null ? void 0 : n.current, c, r]);
|
|
13615
|
-
function p(
|
|
13616
|
-
h(
|
|
13618
|
+
function p(S) {
|
|
13619
|
+
h(S), S && S >= te[0] && S <= te[g] && rt.emitMethod(it.MainEngine, B.SetFontStyle, {
|
|
13617
13620
|
workIds: o || [H],
|
|
13618
|
-
fontSize:
|
|
13621
|
+
fontSize: S,
|
|
13619
13622
|
viewId: r == null ? void 0 : r.viewId
|
|
13620
13623
|
});
|
|
13621
13624
|
}
|
|
13622
|
-
const M = (
|
|
13625
|
+
const M = (S) => {
|
|
13623
13626
|
var T;
|
|
13624
|
-
(T = i.current) == null || T.blur(), e(!1), m(
|
|
13625
|
-
}, I = J(() => t ? /* @__PURE__ */ k.createElement(Zw, { onClickHandler: M, style: f }) : null, [t, M, f]), m = (
|
|
13626
|
-
|
|
13627
|
+
(T = i.current) == null || T.blur(), e(!1), m(S);
|
|
13628
|
+
}, I = J(() => t ? /* @__PURE__ */ k.createElement(Zw, { onClickHandler: M, style: f }) : null, [t, M, f]), m = (S) => {
|
|
13629
|
+
S > te[g] && (S = te[g]), S < te[0] && (S = te[0]), p(S);
|
|
13627
13630
|
};
|
|
13628
13631
|
return ft(() => () => {
|
|
13629
13632
|
r != null && r.control.room && Ut(u) && (r.control.room.disableDeviceInputs = u);
|
|
@@ -13632,8 +13635,8 @@ const Aw = (a) => {
|
|
|
13632
13635
|
{
|
|
13633
13636
|
className: "button normal-button font-size-barBtn",
|
|
13634
13637
|
style: { width: 50 },
|
|
13635
|
-
onPointerUp: (
|
|
13636
|
-
|
|
13638
|
+
onPointerUp: (S) => {
|
|
13639
|
+
S.stopPropagation(), S.nativeEvent.stopImmediatePropagation();
|
|
13637
13640
|
}
|
|
13638
13641
|
},
|
|
13639
13642
|
/* @__PURE__ */ k.createElement(
|
|
@@ -13647,19 +13650,19 @@ const Aw = (a) => {
|
|
|
13647
13650
|
onClick: () => {
|
|
13648
13651
|
e(!t), i.current && i.current.focus();
|
|
13649
13652
|
},
|
|
13650
|
-
onKeyDown: (
|
|
13651
|
-
if (
|
|
13652
|
-
const T = window.getSelection(),
|
|
13653
|
-
if (
|
|
13654
|
-
return
|
|
13653
|
+
onKeyDown: (S) => {
|
|
13654
|
+
if (S.key === "Backspace") {
|
|
13655
|
+
const T = window.getSelection(), N = T == null ? void 0 : T.getRangeAt(0);
|
|
13656
|
+
if (N != null && N.collapsed)
|
|
13657
|
+
return S.cancelable && S.preventDefault(), document.execCommand("delete", !1), !1;
|
|
13655
13658
|
}
|
|
13656
13659
|
return !1;
|
|
13657
13660
|
},
|
|
13658
|
-
onKeyUp: (
|
|
13661
|
+
onKeyUp: (S) => {
|
|
13659
13662
|
var T;
|
|
13660
13663
|
if (i.current) {
|
|
13661
|
-
const
|
|
13662
|
-
isNaN(w) ? i.current.value = "0" : i.current.value = w.toString(), w &&
|
|
13664
|
+
const N = i.current.value, w = parseInt(N);
|
|
13665
|
+
isNaN(w) ? i.current.value = "0" : i.current.value = w.toString(), w && S.key === "Enter" && (m(w), (T = i.current) == null || T.blur(), e(!1));
|
|
13663
13666
|
}
|
|
13664
13667
|
},
|
|
13665
13668
|
onFocus: () => {
|
|
@@ -14003,57 +14006,57 @@ const Aw = (a) => {
|
|
|
14003
14006
|
), [l, h] = k.useState(), u = De(null);
|
|
14004
14007
|
ft(() => {
|
|
14005
14008
|
var L, A, j, D;
|
|
14006
|
-
const
|
|
14009
|
+
const N = {}, w = (o == null ? void 0 : o.w) || ((L = i == null ? void 0 : i.boxSize) == null ? void 0 : L[0]) || 0, C = (o == null ? void 0 : o.h) || ((A = i == null ? void 0 : i.boxSize) == null ? void 0 : A[1]) || 0;
|
|
14007
14010
|
if (s && w && C && (n != null && n.width) && (n != null && n.height)) {
|
|
14008
|
-
if (s.y < 60 ? s.y + C < n.height - 60 ?
|
|
14009
|
-
|
|
14011
|
+
if (s.y < 60 ? s.y + C < n.height - 60 ? N.bottom = -120 : s.y + C < n.height ? N.bottom = -58 : s.y > 0 ? N.top = 62 : N.top = -s.y + 62 : N.top = 0, s.x < 0)
|
|
14012
|
+
N.left = -s.x + 3;
|
|
14010
14013
|
else if (s.x + (((j = u.current) == null ? void 0 : j.offsetWidth) || w) > n.width) {
|
|
14011
14014
|
const R = n.width - (((D = u.current) == null ? void 0 : D.offsetWidth) || w) - s.x;
|
|
14012
|
-
|
|
14015
|
+
N.left = R;
|
|
14013
14016
|
}
|
|
14014
|
-
h(
|
|
14017
|
+
h(N);
|
|
14015
14018
|
return;
|
|
14016
14019
|
}
|
|
14017
14020
|
h(void 0);
|
|
14018
14021
|
}, [u, s, o == null ? void 0 : o.w, o == null ? void 0 : o.h, n == null ? void 0 : n.width, n == null ? void 0 : n.height, i == null ? void 0 : i.boxSize]);
|
|
14019
|
-
const d = J(() => o != null && o.fillColor ? /* @__PURE__ */ k.createElement(Uw, { floatBarRef: u, open: r === 3, setOpen: (
|
|
14022
|
+
const d = J(() => o != null && o.fillColor ? /* @__PURE__ */ k.createElement(Uw, { floatBarRef: u, open: r === 3, setOpen: (N) => {
|
|
14020
14023
|
c(
|
|
14021
|
-
|
|
14024
|
+
N === !0 ? 3 : 0
|
|
14022
14025
|
/* FillColor */
|
|
14023
14026
|
);
|
|
14024
|
-
} }) : null, [o == null ? void 0 : o.fillColor, r, u]), g = J(() => o != null && o.strokeColor ? /* @__PURE__ */ k.createElement(Yw, { floatBarRef: u, open: r === 2, setOpen: (
|
|
14027
|
+
} }) : null, [o == null ? void 0 : o.fillColor, r, u]), g = J(() => o != null && o.strokeColor ? /* @__PURE__ */ k.createElement(Yw, { floatBarRef: u, open: r === 2, setOpen: (N) => {
|
|
14025
14028
|
c(
|
|
14026
|
-
|
|
14029
|
+
N === !0 ? 2 : 0
|
|
14027
14030
|
/* StrokeColor */
|
|
14028
14031
|
);
|
|
14029
|
-
} }) : null, [o == null ? void 0 : o.strokeColor, r, u]), f = J(() => i != null && i.fontColor && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Bw, { floatBarRef: u, open: r === 4, setOpen: (
|
|
14032
|
+
} }) : null, [o == null ? void 0 : o.strokeColor, r, u]), f = J(() => i != null && i.fontColor && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Bw, { floatBarRef: u, open: r === 4, setOpen: (N) => {
|
|
14030
14033
|
c(
|
|
14031
|
-
|
|
14034
|
+
N === !0 ? 4 : 0
|
|
14032
14035
|
/* TextColor */
|
|
14033
14036
|
);
|
|
14034
|
-
}, textOpt: i, workIds: t }) : null, [i, r, t, n, u]), p = J(() => i != null && i.fontBgColor && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Fw, { floatBarRef: u, open: r === 5, setOpen: (
|
|
14037
|
+
}, textOpt: i, workIds: t }) : null, [i, r, t, n, u]), p = J(() => i != null && i.fontBgColor && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Fw, { floatBarRef: u, open: r === 5, setOpen: (N) => {
|
|
14035
14038
|
c(
|
|
14036
|
-
|
|
14039
|
+
N === !0 ? 5 : 0
|
|
14037
14040
|
/* TextBgColor */
|
|
14038
14041
|
);
|
|
14039
|
-
}, textOpt: i, workIds: t }) : null, [i, r, t, n, u]), M = J(() => i && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Gw, { floatBarRef: u, open: r === 6, setOpen: (
|
|
14042
|
+
}, textOpt: i, workIds: t }) : null, [i, r, t, n, u]), M = J(() => i && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Gw, { floatBarRef: u, open: r === 6, setOpen: (N) => {
|
|
14040
14043
|
c(
|
|
14041
|
-
|
|
14044
|
+
N === !0 ? 6 : 0
|
|
14042
14045
|
/* FontStyle */
|
|
14043
14046
|
);
|
|
14044
|
-
}, textOpt: i, workIds: t, style: l }) : null, [i, r, t, n, l, u]), I = J(() => i && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Xw, { open: r === 7, setOpen: (
|
|
14047
|
+
}, textOpt: i, workIds: t, style: l }) : null, [i, r, t, n, l, u]), I = J(() => i && (n != null && n.viewId) ? /* @__PURE__ */ k.createElement(Xw, { open: r === 7, setOpen: (N) => {
|
|
14045
14048
|
c(
|
|
14046
|
-
|
|
14049
|
+
N === !0 ? 7 : 0
|
|
14047
14050
|
/* FontSize */
|
|
14048
14051
|
);
|
|
14049
|
-
}, textOpt: i, workIds: t, floatBarRef: u }) : null, [i, r, t, n, u]), m = J(() => e ? null : /* @__PURE__ */ k.createElement(Ew, { open: r === 1, setOpen: (
|
|
14052
|
+
}, textOpt: i, workIds: t, floatBarRef: u }) : null, [i, r, t, n, u]), m = J(() => e ? null : /* @__PURE__ */ k.createElement(Ew, { open: r === 1, setOpen: (N) => {
|
|
14050
14053
|
c(
|
|
14051
|
-
|
|
14054
|
+
N === !0 ? 1 : 0
|
|
14052
14055
|
/* Layer */
|
|
14053
14056
|
);
|
|
14054
|
-
}, floatBarRef: u }), [e, r, u]),
|
|
14057
|
+
}, floatBarRef: u }), [e, r, u]), S = J(() => o != null && o.canLock && n ? /* @__PURE__ */ k.createElement(Jw, { workIds: t, mananger: n, islocked: o.isLocked }) : null, [o, n, t]), T = J(() => n && (n != null && n.viewId) && l && (o != null && o.shapeOpt) && (o != null && o.toolsTypes) ? /* @__PURE__ */ k.createElement(nm, { open: r === 8, setOpen: (N) => {
|
|
14055
14058
|
c(
|
|
14056
|
-
|
|
14059
|
+
N === !0 ? 8 : 0
|
|
14057
14060
|
/* ShapeOpt */
|
|
14058
14061
|
);
|
|
14059
14062
|
}, floatBarRef: u, workIds: t, toolsTypes: o.toolsTypes, shapeOpt: o.shapeOpt }) : null, [o, n, r, l, t, u]);
|
|
@@ -14063,12 +14066,12 @@ const Aw = (a) => {
|
|
|
14063
14066
|
className: "appliance-plugin-floatbtns",
|
|
14064
14067
|
style: l,
|
|
14065
14068
|
ref: u,
|
|
14066
|
-
onMouseOver: (
|
|
14067
|
-
onMouseMove: (
|
|
14069
|
+
onMouseOver: (N) => (N.stopPropagation(), N.cancelable && N.preventDefault(), n == null || n.control.worker.blurCursor(n.viewId), !1),
|
|
14070
|
+
onMouseMove: (N) => (N.stopPropagation(), N.cancelable && N.preventDefault(), !1)
|
|
14068
14071
|
},
|
|
14069
14072
|
n && /* @__PURE__ */ k.createElement(Aw, { workIds: t, mananger: n }),
|
|
14070
14073
|
m,
|
|
14071
|
-
|
|
14074
|
+
S,
|
|
14072
14075
|
!!(n != null && n.viewId) && /* @__PURE__ */ k.createElement(jw, { workIds: t, viewId: n.viewId }),
|
|
14073
14076
|
T,
|
|
14074
14077
|
I,
|
|
@@ -14088,9 +14091,9 @@ const Aw = (a) => {
|
|
|
14088
14091
|
textAlign: M,
|
|
14089
14092
|
strokeColor: I,
|
|
14090
14093
|
lineHeight: m,
|
|
14091
|
-
bold:
|
|
14094
|
+
bold: S,
|
|
14092
14095
|
italic: T,
|
|
14093
|
-
uid:
|
|
14096
|
+
uid: N,
|
|
14094
14097
|
workState: w
|
|
14095
14098
|
} = o, C = u, L = m || C * 1.2, A = {
|
|
14096
14099
|
fontSize: `${C}px`,
|
|
@@ -14100,10 +14103,10 @@ const Aw = (a) => {
|
|
|
14100
14103
|
minHeight: `${L}px`,
|
|
14101
14104
|
paddingRight: `${T === "italic" ? Math.round(C * 0.3) : 5}px`
|
|
14102
14105
|
};
|
|
14103
|
-
d && (A.fontFamily = `${d}`), (p || g) && (A.textDecoration = `${p && "line-through" || ""}${g && " underline" || ""}`),
|
|
14106
|
+
d && (A.fontFamily = `${d}`), (p || g) && (A.textDecoration = `${p && "line-through" || ""}${g && " underline" || ""}`), S && (A.fontWeight = `${S}`), T && (A.fontStyle = `${T}`), M && (A.textAlign = `${M}`);
|
|
14104
14107
|
function j() {
|
|
14105
14108
|
var R;
|
|
14106
|
-
t && (
|
|
14109
|
+
t && (N && N === ((R = e.control.collector) == null ? void 0 : R.uid) || !N) && e.control.textEditorManager.active(s);
|
|
14107
14110
|
}
|
|
14108
14111
|
const D = J(() => {
|
|
14109
14112
|
const R = [];
|
|
@@ -14167,18 +14170,18 @@ const Aw = (a) => {
|
|
|
14167
14170
|
textAlign: M,
|
|
14168
14171
|
strokeColor: I,
|
|
14169
14172
|
lineHeight: m,
|
|
14170
|
-
bold:
|
|
14173
|
+
bold: S,
|
|
14171
14174
|
italic: T
|
|
14172
|
-
} = n,
|
|
14173
|
-
fontSize: `${
|
|
14175
|
+
} = n, N = u, w = m || N * 1.2, C = {
|
|
14176
|
+
fontSize: `${N}px`,
|
|
14174
14177
|
lineHeight: `${w}px`,
|
|
14175
14178
|
color: f,
|
|
14176
14179
|
borderColor: I,
|
|
14177
14180
|
minHeight: `${w}px`,
|
|
14178
14181
|
pointerEvents: "none",
|
|
14179
|
-
paddingRight: `${T === "italic" ? Math.round(
|
|
14182
|
+
paddingRight: `${T === "italic" ? Math.round(N * 0.3) : 5}px`
|
|
14180
14183
|
};
|
|
14181
|
-
d && (C.fontFamily = `${d}`), (p || g) && (C.textDecoration = `${p && "line-through" || ""}${g && " underline" || ""}`), M && (C.textAlign = `${M}`),
|
|
14184
|
+
d && (C.fontFamily = `${d}`), (p || g) && (C.textDecoration = `${p && "line-through" || ""}${g && " underline" || ""}`), M && (C.textAlign = `${M}`), S && (C.fontWeight = `${S}`), T && (C.fontStyle = `${T}`);
|
|
14182
14185
|
const L = J(() => {
|
|
14183
14186
|
const A = [];
|
|
14184
14187
|
if (n.text) {
|
|
@@ -14220,9 +14223,9 @@ const Aw = (a) => {
|
|
|
14220
14223
|
const { data: i, workId: t, isSelect: e, showFloatBtns: s, handleKeyUp: o, handleFocus: n, updateOptInfo: r, manager: c, runAnimation: l } = a, [h, u] = nt(), { opt: d, scale: g, translate: f, x: p, y: M } = i, {
|
|
14221
14224
|
fontSize: I,
|
|
14222
14225
|
fontFamily: m,
|
|
14223
|
-
underline:
|
|
14226
|
+
underline: S,
|
|
14224
14227
|
fontColor: T,
|
|
14225
|
-
lineThrough:
|
|
14228
|
+
lineThrough: N,
|
|
14226
14229
|
textAlign: w,
|
|
14227
14230
|
strokeColor: C,
|
|
14228
14231
|
lineHeight: L,
|
|
@@ -14239,8 +14242,8 @@ const Aw = (a) => {
|
|
|
14239
14242
|
paddingRight: `${j === "italic" ? Math.round(ot * 0.3) : 5}px`,
|
|
14240
14243
|
borderWidth: `${Math.max(Math.round(1 / (g || 1)), 1)}px`
|
|
14241
14244
|
};
|
|
14242
|
-
return m && (X.fontFamily = `${m}`), (
|
|
14243
|
-
}, [A, T, m, I, j, L,
|
|
14245
|
+
return m && (X.fontFamily = `${m}`), (N || S) && (X.textDecoration = `${N && "line-through" || ""} ${S && " underline" || ""}`), w && (X.textAlign = `${w}`), A && (X.fontWeight = `${A}`), j && (X.fontStyle = `${j}`), X;
|
|
14246
|
+
}, [A, T, m, I, j, L, N, g, C, w, S]), E = J(() => {
|
|
14244
14247
|
const ot = `scale(${g || 1}) ${f && "translate(" + f[0] + "px," + f[1] + "px)" || ""}`;
|
|
14245
14248
|
return {
|
|
14246
14249
|
left: `${p}px`,
|
|
@@ -14641,19 +14644,19 @@ const hm = () => {
|
|
|
14641
14644
|
rt.unmountActiveListener(I);
|
|
14642
14645
|
}), []), ft(() => {
|
|
14643
14646
|
if (t) {
|
|
14644
|
-
const
|
|
14645
|
-
f(new F(w.x, w.y)), d(new F(
|
|
14647
|
+
const N = { x: (t == null ? void 0 : t.x) - 20, y: (t == null ? void 0 : t.y) + (t == null ? void 0 : t.h) }, w = { x: (t == null ? void 0 : t.x) + (t == null ? void 0 : t.w) / 2, y: (t == null ? void 0 : t.y) + (t == null ? void 0 : t.h) / 2 };
|
|
14648
|
+
f(new F(w.x, w.y)), d(new F(N.x, N.y)), c({ x: N.x, y: N.y });
|
|
14646
14649
|
}
|
|
14647
14650
|
}, [t == null ? void 0 : t.x, t == null ? void 0 : t.y, t == null ? void 0 : t.h]);
|
|
14648
|
-
const I = (
|
|
14651
|
+
const I = (N) => {
|
|
14649
14652
|
var w;
|
|
14650
|
-
if (!
|
|
14653
|
+
if (!N) {
|
|
14651
14654
|
M(!0), h(!1), o(B.None);
|
|
14652
14655
|
return;
|
|
14653
14656
|
}
|
|
14654
14657
|
M(!1), (w = n == null ? void 0 : n.control.room) != null && w.disableDeviceInputs && (n.control.room.disableDeviceInputs = !1);
|
|
14655
|
-
}, m = (
|
|
14656
|
-
if (
|
|
14658
|
+
}, m = (N, w) => {
|
|
14659
|
+
if (N.cancelable && N.preventDefault(), N.stopPropagation(), n != null && n.control.worker.isBusy) {
|
|
14657
14660
|
M(!0);
|
|
14658
14661
|
return;
|
|
14659
14662
|
}
|
|
@@ -14664,8 +14667,8 @@ const hm = () => {
|
|
|
14664
14667
|
B.RotateNode,
|
|
14665
14668
|
{ workIds: [H], angle: 0, workState: P.Start, viewId: n == null ? void 0 : n.viewId }
|
|
14666
14669
|
);
|
|
14667
|
-
},
|
|
14668
|
-
if (T.cancel(),
|
|
14670
|
+
}, S = (N, w) => {
|
|
14671
|
+
if (T.cancel(), N.cancelable && N.preventDefault(), N.stopPropagation(), n != null && n.control.worker.isBusy) {
|
|
14669
14672
|
M(!0);
|
|
14670
14673
|
return;
|
|
14671
14674
|
}
|
|
@@ -14676,8 +14679,8 @@ const hm = () => {
|
|
|
14676
14679
|
B.RotateNode,
|
|
14677
14680
|
{ workIds: [H], angle: C, workState: P.Done, viewId: n == null ? void 0 : n.viewId }
|
|
14678
14681
|
);
|
|
14679
|
-
}, T = us((
|
|
14680
|
-
if (
|
|
14682
|
+
}, T = us((N, w) => {
|
|
14683
|
+
if (N.cancelable && N.preventDefault(), N.stopPropagation(), n != null && n.control.worker.isBusy) {
|
|
14681
14684
|
M(!0);
|
|
14682
14685
|
return;
|
|
14683
14686
|
}
|
|
@@ -14697,7 +14700,7 @@ const hm = () => {
|
|
|
14697
14700
|
handle: ".appliance-plugin-rotate-mouse-pointer",
|
|
14698
14701
|
onStart: m,
|
|
14699
14702
|
onDrag: T,
|
|
14700
|
-
onStop:
|
|
14703
|
+
onStop: S
|
|
14701
14704
|
},
|
|
14702
14705
|
/* @__PURE__ */ k.createElement(
|
|
14703
14706
|
"div",
|
|
@@ -14714,67 +14717,66 @@ const hm = () => {
|
|
|
14714
14717
|
)
|
|
14715
14718
|
);
|
|
14716
14719
|
}, fm = (a) => {
|
|
14717
|
-
const { floatBarData: i, setOperationType: t, mananger: e } = bt(kt), { onClickHandle: s } = a, [o, n] = nt(P.Pending), [r, c] = nt(), [l, h] = nt(
|
|
14720
|
+
const { floatBarData: i, setOperationType: t, mananger: e } = bt(kt), { onClickHandle: s } = a, [o, n] = nt(P.Pending), [r, c] = nt(), [l, h] = nt(), [u, d] = nt(!1);
|
|
14718
14721
|
ft(() => (rt.activeListener(g), () => {
|
|
14719
14722
|
rt.unmountActiveListener(g);
|
|
14720
14723
|
}), []);
|
|
14721
|
-
const g = (
|
|
14724
|
+
const g = (S) => {
|
|
14722
14725
|
var T;
|
|
14723
|
-
if (!
|
|
14724
|
-
|
|
14726
|
+
if (!S || i != null && i.isLocked) {
|
|
14727
|
+
d(!0), n(P.Pending), t(B.None);
|
|
14725
14728
|
return;
|
|
14726
14729
|
}
|
|
14727
|
-
|
|
14730
|
+
d(!1), (T = e == null ? void 0 : e.control.room) != null && T.disableDeviceInputs && (e.control.room.disableDeviceInputs = !1);
|
|
14728
14731
|
};
|
|
14729
14732
|
ft(() => {
|
|
14730
14733
|
if (i != null && i.isLocked || e != null && e.control.worker.isBusy) {
|
|
14731
|
-
|
|
14734
|
+
d(!0), n(P.Pending);
|
|
14732
14735
|
return;
|
|
14733
14736
|
}
|
|
14734
|
-
|
|
14737
|
+
d(!1);
|
|
14735
14738
|
}, [i == null ? void 0 : i.isLocked]), ft(() => {
|
|
14736
|
-
tt(i == null ? void 0 : i.x) && tt(i == null ? void 0 : i.y) && (o === P.Pending || o === P.Done) &&
|
|
14739
|
+
tt(i == null ? void 0 : i.x) && tt(i == null ? void 0 : i.y) && (o === P.Pending || o === P.Done) && h({ x: i == null ? void 0 : i.x, y: i == null ? void 0 : i.y });
|
|
14737
14740
|
}, [o, i == null ? void 0 : i.x, i == null ? void 0 : i.y]);
|
|
14738
|
-
const f = (
|
|
14739
|
-
if (
|
|
14740
|
-
|
|
14741
|
+
const f = (S) => {
|
|
14742
|
+
if (S.cancelable && S.preventDefault(), S.stopPropagation(), e != null && e.control.worker.isBusy) {
|
|
14743
|
+
d(!0), n(P.Pending);
|
|
14741
14744
|
return;
|
|
14742
14745
|
}
|
|
14743
|
-
|
|
14746
|
+
tt(i == null ? void 0 : i.x) && tt(i == null ? void 0 : i.y) && (t(B.TranslateNode), n(P.Start), c({ x: i == null ? void 0 : i.x, y: i == null ? void 0 : i.y }), e != null && e.control.room && (e.control.room.disableDeviceInputs = !0), rt.emitMethod(
|
|
14744
14747
|
it.MainEngine,
|
|
14745
14748
|
B.TranslateNode,
|
|
14746
14749
|
{ workIds: [H], position: { x: i == null ? void 0 : i.x, y: i == null ? void 0 : i.y }, workState: P.Start, viewId: e == null ? void 0 : e.viewId }
|
|
14747
14750
|
));
|
|
14748
|
-
}, p = (
|
|
14749
|
-
if (M.cancel(),
|
|
14750
|
-
|
|
14751
|
+
}, p = (S, T) => {
|
|
14752
|
+
if (M.cancel(), S.cancelable && S.preventDefault(), e != null && e.control.worker.isBusy) {
|
|
14753
|
+
d(!0), n(P.Pending);
|
|
14751
14754
|
return;
|
|
14752
14755
|
}
|
|
14753
|
-
|
|
14754
|
-
const
|
|
14756
|
+
S.stopPropagation();
|
|
14757
|
+
const N = { x: T.x, y: T.y };
|
|
14755
14758
|
t(B.None), n(P.Done), e != null && e.control.room && (e.control.room.disableDeviceInputs = !1), rt.emitMethod(
|
|
14756
14759
|
it.MainEngine,
|
|
14757
14760
|
B.TranslateNode,
|
|
14758
|
-
{ workIds: [H], position:
|
|
14761
|
+
{ workIds: [H], position: N, workState: P.Done, viewId: e == null ? void 0 : e.viewId }
|
|
14759
14762
|
);
|
|
14760
|
-
}, M = se((
|
|
14761
|
-
if (
|
|
14762
|
-
|
|
14763
|
+
}, M = se((S, T) => {
|
|
14764
|
+
if (S.cancelable && S.preventDefault(), S.stopPropagation(), e != null && e.control.worker.isBusy) {
|
|
14765
|
+
d(!0), n(P.Pending);
|
|
14763
14766
|
return;
|
|
14764
14767
|
}
|
|
14765
|
-
|
|
14766
|
-
const S = { x: T.x, y: T.y };
|
|
14768
|
+
const N = { x: T.x, y: T.y };
|
|
14767
14769
|
(T.x !== (i == null ? void 0 : i.x) || T.y !== (i == null ? void 0 : i.y)) && (n(P.Doing), rt.emitMethod(
|
|
14768
14770
|
it.MainEngine,
|
|
14769
14771
|
B.TranslateNode,
|
|
14770
|
-
{ workIds: [H], position:
|
|
14772
|
+
{ workIds: [H], position: N, workState: P.Doing, viewId: e == null ? void 0 : e.viewId }
|
|
14771
14773
|
));
|
|
14772
|
-
}, 100, { trailing: !0 }), I = J(() => !!((i == null ? void 0 : i.scaleType) === ct.none && (i != null && i.canLock)), [i]), m = yi((
|
|
14774
|
+
}, 100, { trailing: !0 }), I = J(() => !!((i == null ? void 0 : i.scaleType) === ct.none && (i != null && i.canLock)), [i]), m = yi((S) => (M.cancel(), S.stopPropagation(), S.cancelable && S.preventDefault(), (r == null ? void 0 : r.x) === (i == null ? void 0 : i.x) && (r == null ? void 0 : r.y) === (i == null ? void 0 : i.y) && s(S), !1), 100, { trailing: !0 });
|
|
14773
14775
|
return /* @__PURE__ */ k.createElement(
|
|
14774
14776
|
Ae,
|
|
14775
14777
|
{
|
|
14776
|
-
disabled:
|
|
14777
|
-
position:
|
|
14778
|
+
disabled: u,
|
|
14779
|
+
position: l,
|
|
14778
14780
|
onStart: f,
|
|
14779
14781
|
onDrag: M,
|
|
14780
14782
|
onStop: p
|
|
@@ -14792,8 +14794,8 @@ const hm = () => {
|
|
|
14792
14794
|
pointerEvents: I ? "none" : "auto",
|
|
14793
14795
|
touchAction: "none"
|
|
14794
14796
|
} : void 0,
|
|
14795
|
-
onPointerUp: (
|
|
14796
|
-
|
|
14797
|
+
onPointerUp: (S) => {
|
|
14798
|
+
S.persist(), m(S);
|
|
14797
14799
|
}
|
|
14798
14800
|
}
|
|
14799
14801
|
)
|
|
@@ -14836,7 +14838,7 @@ const hm = () => {
|
|
|
14836
14838
|
case "bottomLeft":
|
|
14837
14839
|
return C[1];
|
|
14838
14840
|
}
|
|
14839
|
-
},
|
|
14841
|
+
}, S = (C, L, A, j) => {
|
|
14840
14842
|
let D = !1, R = !1;
|
|
14841
14843
|
const z = {
|
|
14842
14844
|
x: t.x,
|
|
@@ -14910,14 +14912,14 @@ const hm = () => {
|
|
|
14910
14912
|
{ workIds: [H], originPoint: R, scenePoint: z, workState: P.Start, viewId: u.viewId }
|
|
14911
14913
|
);
|
|
14912
14914
|
}
|
|
14913
|
-
},
|
|
14915
|
+
}, N = se((C, L, A, j) => {
|
|
14914
14916
|
if (C.cancelable && C.preventDefault(), C.stopPropagation(), !u || !s || !n)
|
|
14915
14917
|
return;
|
|
14916
14918
|
if (u != null && u.control.worker.isBusy) {
|
|
14917
14919
|
p(!0);
|
|
14918
14920
|
return;
|
|
14919
14921
|
}
|
|
14920
|
-
const { scale: D, translate: R } =
|
|
14922
|
+
const { scale: D, translate: R } = S(L, j, u, n);
|
|
14921
14923
|
(!gt(D, d == null ? void 0 : d.scale) || !gt(R, d == null ? void 0 : d.translate)) && (g({
|
|
14922
14924
|
scale: D,
|
|
14923
14925
|
translate: R
|
|
@@ -14927,7 +14929,7 @@ const hm = () => {
|
|
|
14927
14929
|
{ workIds: [H], scale: D, dir: L, translate: R, originPoint: s, scenePoint: n, workState: P.Doing, viewId: u.viewId }
|
|
14928
14930
|
));
|
|
14929
14931
|
}, 100, { trailing: !0 }), w = (C) => {
|
|
14930
|
-
if (
|
|
14932
|
+
if (N.cancel(), C.cancelable && C.preventDefault(), C.stopPropagation(), !(!u || !s || !n)) {
|
|
14931
14933
|
if (u != null && u.control.worker.isBusy) {
|
|
14932
14934
|
p(!0);
|
|
14933
14935
|
return;
|
|
@@ -14971,7 +14973,7 @@ const hm = () => {
|
|
|
14971
14973
|
},
|
|
14972
14974
|
lockAspectRatio: (h == null ? void 0 : h.scaleType) === ct.proportional,
|
|
14973
14975
|
onResizeStart: T,
|
|
14974
|
-
onResize:
|
|
14976
|
+
onResize: N,
|
|
14975
14977
|
onResizeStop: w
|
|
14976
14978
|
}
|
|
14977
14979
|
);
|
|
@@ -14981,12 +14983,12 @@ const hm = () => {
|
|
|
14981
14983
|
rt.unmountActiveListener(f);
|
|
14982
14984
|
}), []);
|
|
14983
14985
|
const f = (m) => {
|
|
14984
|
-
var
|
|
14986
|
+
var S;
|
|
14985
14987
|
if (!m || r != null && r.isLocked) {
|
|
14986
14988
|
g(!0), u(P.Pending), o(B.None);
|
|
14987
14989
|
return;
|
|
14988
14990
|
}
|
|
14989
|
-
g(!1), (
|
|
14991
|
+
g(!1), (S = n == null ? void 0 : n.control.room) != null && S.disableDeviceInputs && (n.control.room.disableDeviceInputs = !1);
|
|
14990
14992
|
};
|
|
14991
14993
|
ft(() => {
|
|
14992
14994
|
tt(t.x) && tt(t.y) && (h === P.Pending || h === P.Done) && l({ x: t.x, y: t.y });
|
|
@@ -15001,30 +15003,30 @@ const hm = () => {
|
|
|
15001
15003
|
B.SetPoint,
|
|
15002
15004
|
{ workId: H, pointMap: e, workState: P.Start, viewId: n == null ? void 0 : n.viewId }
|
|
15003
15005
|
));
|
|
15004
|
-
}, M = se((m,
|
|
15006
|
+
}, M = se((m, S) => {
|
|
15005
15007
|
if (m.cancelable && m.preventDefault(), m.stopPropagation(), n != null && n.control.worker.isBusy) {
|
|
15006
15008
|
g(!0), u(P.Pending);
|
|
15007
15009
|
return;
|
|
15008
15010
|
}
|
|
15009
|
-
const T = { x:
|
|
15011
|
+
const T = { x: S.x, y: S.y };
|
|
15010
15012
|
if ((T.x !== (t == null ? void 0 : t.x) || T.y !== (t == null ? void 0 : t.y)) && (n != null && n.control.viewContainerManager)) {
|
|
15011
|
-
const
|
|
15012
|
-
w && s === "start" ? w[0] =
|
|
15013
|
+
const N = n.control.viewContainerManager.transformToScenePoint([T.x, T.y], n.viewId), w = e.get(i);
|
|
15014
|
+
w && s === "start" ? w[0] = N : w && s === "end" && (w[1] = N), u(P.Doing), rt.emitMethod(
|
|
15013
15015
|
it.MainEngine,
|
|
15014
15016
|
B.SetPoint,
|
|
15015
15017
|
{ workId: H, pointMap: e, workState: P.Doing, viewId: n == null ? void 0 : n.viewId }
|
|
15016
15018
|
);
|
|
15017
15019
|
}
|
|
15018
|
-
}, 100, { trailing: !0 }), I = (m,
|
|
15020
|
+
}, 100, { trailing: !0 }), I = (m, S) => {
|
|
15019
15021
|
if (M.cancel(), m.cancelable && m.preventDefault(), n != null && n.control.worker.isBusy) {
|
|
15020
15022
|
g(!0), u(P.Pending);
|
|
15021
15023
|
return;
|
|
15022
15024
|
}
|
|
15023
15025
|
m.stopPropagation(), o(B.None), u(P.Done);
|
|
15024
|
-
const T = { x:
|
|
15026
|
+
const T = { x: S.x, y: S.y };
|
|
15025
15027
|
if (n != null && n.control.viewContainerManager) {
|
|
15026
|
-
const
|
|
15027
|
-
w && s === "start" ? w[0] =
|
|
15028
|
+
const N = n.control.viewContainerManager.transformToScenePoint([T.x, T.y], n.viewId), w = e.get(i);
|
|
15029
|
+
w && s === "start" ? w[0] = N : w && s === "end" && (w[1] = N), n != null && n.control.room && (n.control.room.disableDeviceInputs = !1), rt.emitMethod(
|
|
15028
15030
|
it.MainEngine,
|
|
15029
15031
|
B.SetPoint,
|
|
15030
15032
|
{ workId: H, pointMap: e, workState: P.Done, viewId: n == null ? void 0 : n.viewId }
|
|
@@ -15266,18 +15268,18 @@ const Cm = (a) => {
|
|
|
15266
15268
|
const u = s.maps.get(i);
|
|
15267
15269
|
u && l(u.miniMapCamera, u.viewCamera);
|
|
15268
15270
|
}, l = (u, d) => {
|
|
15269
|
-
const { width: g, height: f } = o.getBoundingClientRect(), p = Math.min(g / u.width, f / u.height), M = d.width / d.scale, I = d.height / d.scale, m = [d.centerX, d.centerY],
|
|
15271
|
+
const { width: g, height: f } = o.getBoundingClientRect(), p = Math.min(g / u.width, f / u.height), M = d.width / d.scale, I = d.height / d.scale, m = [d.centerX, d.centerY], S = [u.centerX, u.centerY], T = [m[0] - S[0], m[1] - S[1]], N = Math.min(u.scale * p, u.scale * p), w = [T[0] * N, T[1] * N, M, I, N];
|
|
15270
15272
|
r(w);
|
|
15271
15273
|
}, h = (u) => {
|
|
15272
15274
|
var d;
|
|
15273
15275
|
if (s.control.renderControl.isWriteable()) {
|
|
15274
15276
|
const g = u.nativeEvent.target || u.nativeEvent.srcElement;
|
|
15275
15277
|
if (g && u.nativeEvent && n) {
|
|
15276
|
-
const { width: f, height: p } = g.getBoundingClientRect(), [M, I] = [f / 2, p / 2], [m,
|
|
15278
|
+
const { width: f, height: p } = g.getBoundingClientRect(), [M, I] = [f / 2, p / 2], [m, S] = [(u.nativeEvent.offsetX - M) / n[4], (u.nativeEvent.offsetY - I) / n[4]], T = s.maps.get(i);
|
|
15277
15279
|
if (T != null && T.viewCamera) {
|
|
15278
|
-
const [
|
|
15280
|
+
const [N, w] = [T.miniMapCamera.centerX + m, T.miniMapCamera.centerY + S];
|
|
15279
15281
|
(d = s.control.room) == null || d.moveCamera({
|
|
15280
|
-
centerX:
|
|
15282
|
+
centerX: N,
|
|
15281
15283
|
centerY: w,
|
|
15282
15284
|
animationMode: "immediately"
|
|
15283
15285
|
});
|
|
@@ -15970,32 +15972,32 @@ const Y = class Y extends fo {
|
|
|
15970
15972
|
const M = (t.mainView || s).getBoundingRect(p), I = await ((m = Y.currentManager) == null ? void 0 : m.getBoundingRect(p));
|
|
15971
15973
|
return !M.width || !M.height ? I : ds(M, I);
|
|
15972
15974
|
},
|
|
15973
|
-
screenshotToCanvasAsync: async function(p, M, I, m,
|
|
15975
|
+
screenshotToCanvasAsync: async function(p, M, I, m, S, T) {
|
|
15974
15976
|
var j;
|
|
15975
15977
|
Y.logger.info("[ApplianceMultiPlugin] screenshotToCanvasAsync");
|
|
15976
|
-
let
|
|
15977
|
-
|
|
15978
|
+
let N = I, w = m, C = S.scale;
|
|
15979
|
+
N > this.maxScreenshotWidth && (C = this.maxScreenshotWidth / N * C, N = this.maxScreenshotWidth), w > this.maxScreenshotHeight && (C = Math.min(this.maxScreenshotHeight / w * C, C), w = this.maxScreenshotHeight), S.scale = C;
|
|
15978
15980
|
const L = document.createElement("canvas"), A = L.getContext("2d");
|
|
15979
|
-
L.width =
|
|
15981
|
+
L.width = N * (T || 1), L.height = w * (T || 1), A && ((t.mainView || s).screenshotToCanvas(A, M, N, w, S, T), p.drawImage(L, Math.floor((I - N) / 2), Math.floor((m - w) / 2), N * (T || 1), w * (T || 1), 0, 0, N, w), L.remove()), Y.currentManager && await ((j = Y.currentManager) == null ? void 0 : j.screenshotToCanvas(p, M, N, w, S, Math.floor((I - N) / 2), Math.floor((m - w) / 2)));
|
|
15980
15982
|
},
|
|
15981
|
-
scenePreviewAsync: async function(p, M, I, m,
|
|
15982
|
-
Y.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"), (t.mainView || s).scenePreview(p, M, I, m,
|
|
15983
|
+
scenePreviewAsync: async function(p, M, I, m, S) {
|
|
15984
|
+
Y.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"), (t.mainView || s).scenePreview(p, M, I, m, S);
|
|
15983
15985
|
const T = document.createElement("img");
|
|
15984
15986
|
T.className = "appliance-plugin-fill-scene-snapshot-img", M.append(T), getComputedStyle(M).position || (M.style.position = "relative"), Y.currentManager && await Y.currentManager.scenePreview(p, T);
|
|
15985
15987
|
},
|
|
15986
|
-
fillSceneSnapshotAsync: async function(p, M, I, m,
|
|
15987
|
-
Y.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"), M.innerHTML = "", (t.mainView || s).fillSceneSnapshot(p, M, I, m,
|
|
15988
|
-
const T = I || t.mainView.size.width,
|
|
15988
|
+
fillSceneSnapshotAsync: async function(p, M, I, m, S) {
|
|
15989
|
+
Y.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"), M.innerHTML = "", (t.mainView || s).fillSceneSnapshot(p, M, I, m, S);
|
|
15990
|
+
const T = I || t.mainView.size.width, N = m || t.mainView.size.height;
|
|
15989
15991
|
let w = await this.getBoundingRectAsync(p);
|
|
15990
15992
|
w || (w = {
|
|
15991
15993
|
originX: 0,
|
|
15992
15994
|
originY: 0,
|
|
15993
15995
|
width: T,
|
|
15994
|
-
height:
|
|
15996
|
+
height: N
|
|
15995
15997
|
});
|
|
15996
|
-
let C = Math.max(w == null ? void 0 : w.width, T), L = Math.max(w == null ? void 0 : w.height,
|
|
15997
|
-
const j = C > T && Math.min(T / C, A) || A, D = L >
|
|
15998
|
-
j <= D ? (C = j < 1 && T || C, L = Math.floor(L * j) + 1, A = j) : j > D && (L = D < 1 &&
|
|
15998
|
+
let C = Math.max(w == null ? void 0 : w.width, T), L = Math.max(w == null ? void 0 : w.height, N), A = 1;
|
|
15999
|
+
const j = C > T && Math.min(T / C, A) || A, D = L > N && Math.min(N / L, A) || A;
|
|
16000
|
+
j <= D ? (C = j < 1 && T || C, L = Math.floor(L * j) + 1, A = j) : j > D && (L = D < 1 && N || L, C = Math.floor(C * D) + 1, A = D);
|
|
15999
16001
|
const R = {
|
|
16000
16002
|
scale: A,
|
|
16001
16003
|
centerX: w.originX + w.width / 2,
|
|
@@ -16486,37 +16488,37 @@ const O = class O extends fo {
|
|
|
16486
16488
|
const p = t.getBoundingRect(f), M = await ((I = O.currentManager) == null ? void 0 : I.getBoundingRect(f));
|
|
16487
16489
|
return !p.width || !p.height ? M : ds(p, M);
|
|
16488
16490
|
},
|
|
16489
|
-
screenshotToCanvasAsync: async function(f, p, M, I, m,
|
|
16491
|
+
screenshotToCanvasAsync: async function(f, p, M, I, m, S) {
|
|
16490
16492
|
var A;
|
|
16491
16493
|
O.logger.info("[ApplianceSinglePlugin] screenshotToCanvasAsync");
|
|
16492
|
-
let T = M,
|
|
16493
|
-
T > this.maxScreenshotWidth && (w = this.maxScreenshotWidth / T * w, T = this.maxScreenshotWidth),
|
|
16494
|
+
let T = M, N = I, w = m.scale;
|
|
16495
|
+
T > this.maxScreenshotWidth && (w = this.maxScreenshotWidth / T * w, T = this.maxScreenshotWidth), N > this.maxScreenshotHeight && (w = Math.min(this.maxScreenshotHeight / N * w, w), N = this.maxScreenshotHeight), m.scale = w;
|
|
16494
16496
|
const C = document.createElement("canvas"), L = C.getContext("2d");
|
|
16495
|
-
C.width = T * (
|
|
16497
|
+
C.width = T * (S || 1), C.height = N * (S || 1), L && (t.screenshotToCanvas(L, p, T, N, m, S), f.drawImage(C, Math.floor((M - T) / 2), Math.floor((I - N) / 2), T * (S || 1), N * (S || 1), 0, 0, T, N), C.remove()), O.currentManager && await ((A = O.currentManager) == null ? void 0 : A.screenshotToCanvas(f, p, T, N, m, Math.floor((M - T) / 2), Math.floor((I - N) / 2)));
|
|
16496
16498
|
},
|
|
16497
16499
|
scenePreviewAsync: async function(f, p, M, I, m) {
|
|
16498
16500
|
O.logger.info("[ApplianceSinglePlugin] scenePreviewAsync"), t.scenePreview(f, p, M, I, m);
|
|
16499
|
-
const
|
|
16500
|
-
|
|
16501
|
+
const S = document.createElement("img");
|
|
16502
|
+
S.className = "appliance-plugin-fill-scene-snapshot-img", p.append(S), getComputedStyle(p).position || (p.style.position = "relative"), O.currentManager && await O.currentManager.scenePreview(f, S);
|
|
16501
16503
|
},
|
|
16502
16504
|
fillSceneSnapshotAsync: async function(f, p, M, I, m) {
|
|
16503
16505
|
var st, K;
|
|
16504
16506
|
O.logger.info("[ApplianceSinglePlugin] fillSceneSnapshotAsync"), p.innerHTML = "", t.fillSceneSnapshot(f, p, M, I, m);
|
|
16505
|
-
const
|
|
16506
|
-
let
|
|
16507
|
-
|
|
16507
|
+
const S = M || ((st = t.state.cameraState) == null ? void 0 : st.width) || 0, T = I || ((K = t.state.cameraState) == null ? void 0 : K.height) || 0;
|
|
16508
|
+
let N = await this.getBoundingRectAsync(f);
|
|
16509
|
+
N || (N = {
|
|
16508
16510
|
originX: 0,
|
|
16509
16511
|
originY: 0,
|
|
16510
|
-
width:
|
|
16512
|
+
width: S,
|
|
16511
16513
|
height: T
|
|
16512
16514
|
});
|
|
16513
|
-
let w = Math.max(
|
|
16514
|
-
const A = w >
|
|
16515
|
-
A <= j ? (w = A < 1 &&
|
|
16515
|
+
let w = Math.max(N == null ? void 0 : N.width, S), C = Math.max(N == null ? void 0 : N.height, T), L = 1;
|
|
16516
|
+
const A = w > S && Math.min(S / w, L) || L, j = C > T && Math.min(T / C, L) || L;
|
|
16517
|
+
A <= j ? (w = A < 1 && S || w, C = Math.floor(C * A) + 1, L = A) : A > j && (C = j < 1 && T || C, w = Math.floor(w * j) + 1, L = j);
|
|
16516
16518
|
const D = {
|
|
16517
16519
|
scale: L,
|
|
16518
|
-
centerX:
|
|
16519
|
-
centerY:
|
|
16520
|
+
centerX: N.originX + N.width / 2,
|
|
16521
|
+
centerY: N.originY + N.height / 2
|
|
16520
16522
|
}, R = document.createElement("canvas"), z = R.getContext("2d");
|
|
16521
16523
|
R.width = w, R.height = C, z && await this.screenshotToCanvasAsync(z, f, w, C, D, devicePixelRatio);
|
|
16522
16524
|
const E = document.createElement("img");
|