@netless/appliance-plugin 1.1.43-beta.0 → 1.1.43-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/READMA.zh-CN.md +1 -1
- package/README.md +5 -1
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/{bridge-D68E09T9.js → bridge-CDqtVTPN.js} +1 -1
- package/dist/{bridge-DcVN05tP.mjs → bridge-nmqVpnZ5.mjs} +1 -1
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/core/enum.d.ts +3 -1
- package/dist/core/mainEngine.d.ts +8 -2
- package/dist/core/mainThread/subLocalThread.d.ts +3 -0
- package/dist/core/tools/pencilEraserBitMap.d.ts +6 -2
- package/dist/core/types.d.ts +2 -0
- package/dist/core/worker/fullWorkerLocal.d.ts +2 -0
- package/dist/fullWorker.js +77 -77
- package/dist/{index-NG5kKK1W.mjs → index-B44o9ggV.mjs} +8993 -8843
- package/dist/{index-K_0NX6pD.mjs → index-BF310Wzc.mjs} +1 -1
- package/dist/{index-GZUDLXJC.js → index-BJOPyRJn.js} +1 -1
- package/dist/index-BiqhUSZ0.js +570 -0
- package/dist/{index-BNHPCii1.mjs → index-Cjaia8CY.mjs} +230 -212
- package/dist/index-Cu0f4kha.js +570 -0
- package/dist/{index-DiLPVPwQ.js → index-DDd-30M7.js} +1 -1
- package/dist/{index-CWDWQZBs.mjs → index-DdbAM7Xi.mjs} +230 -212
- package/dist/{index-B_vZ9d3x.mjs → index-DhCFlEfW.mjs} +7760 -7610
- package/dist/{index-CV8YaU3F.mjs → index-mcBiJOLo.mjs} +1 -1
- package/dist/index-o1TaWHww.js +1 -0
- package/dist/index-puxStU6w.js +1 -0
- package/dist/plugin/bitmapEraserOptions.d.ts +0 -2
- package/dist/plugin/types.d.ts +0 -4
- package/dist/subWorker.js +85 -85
- package/package.json +1 -1
- package/dist/index-C2AHqjj8.js +0 -570
- package/dist/index-DChI1--R.js +0 -1
- package/dist/index-DFo0Gmfx.js +0 -570
- package/dist/index-GBYM7kT5.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var ye = Object.defineProperty;
|
|
2
2
|
var we = (M, e, t) => e in M ? ye(M, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : M[e] = t;
|
|
3
3
|
var u = (M, e, t) => we(M, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { D as K, e as b, c as m, r as $, b as R, g as Z, t as V, a as h, f as de, M as ve, h as D, i as j, j as ke, C as H, k as z, l as Se, m as te, n as Ie, o as se, p as ge, q as Te, s as re, u as ie, v as Y, w as _, E as N, x as ee, y as Q, z as We, A as Re, B as Ee, F as be, G as Le, H as pe, I as ue, T as oe, J as ae, K as Ce, L as Ne, N as fe, P as me, Q as ne, R as Oe, S as ce, U as q, W as Be, V as he, X as De } from "./index-
|
|
4
|
+
import { D as K, e as b, c as m, r as $, b as R, g as Z, t as V, a as h, f as de, M as ve, h as D, i as j, j as ke, C as H, k as z, l as Se, m as te, n as Ie, o as se, p as ge, q as Te, s as re, u as ie, v as Y, w as _, E as N, x as ee, y as Q, z as We, A as Re, B as Ee, F as be, G as Le, H as pe, I as ue, T as oe, J as ae, K as Ce, L as Ne, N as fe, P as me, Q as ne, R as Oe, S as ce, U as q, W as Be, V as he, X as De } from "./index-B44o9ggV.mjs";
|
|
5
5
|
import { cloneDeep as J, xor as Me, isNumber as G, isEqual as le } from "lodash";
|
|
6
6
|
import "clipper-lib";
|
|
7
7
|
import "lineclip";
|
|
@@ -297,9 +297,9 @@ class Ae {
|
|
|
297
297
|
})), c = /* @__PURE__ */ new Map();
|
|
298
298
|
let d;
|
|
299
299
|
n != null && n.selectIds && (d = Me(t.selectIds, n.selectIds), n.selectIds.forEach((w) => {
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
302
|
-
const { toolsType: I, op: W, opt: g } =
|
|
300
|
+
const S = this.vNodes.get(w);
|
|
301
|
+
if (S) {
|
|
302
|
+
const { toolsType: I, op: W, opt: g } = S;
|
|
303
303
|
c.set(w, {
|
|
304
304
|
opt: g,
|
|
305
305
|
toolsType: I,
|
|
@@ -695,57 +695,70 @@ class Ae {
|
|
|
695
695
|
var t;
|
|
696
696
|
(t = this.getWorkShape(e)) == null || t.clearTmpPoints(), this.workShapes.delete(e);
|
|
697
697
|
}
|
|
698
|
+
/** Stop queued Bitmap Eraser work and restore Doing-time hidden nodes. */
|
|
699
|
+
abortBitmapEraser(e) {
|
|
700
|
+
const t = this.workShapes.get(e);
|
|
701
|
+
(t == null ? void 0 : t.toolsType) === m.BitMapEraser && (t.clearTmpPoints(), this.workShapes.delete(e), this.combineDrawActiveId === e && (this.combineDrawActiveId = void 0), this.drawWorkActiveId === e && (this.drawWorkActiveId = void 0), this.bitmapEraserRenderQueue = Promise.resolve());
|
|
702
|
+
}
|
|
698
703
|
async drawBitMapEraserFull(e, t, s, r) {
|
|
699
|
-
const {
|
|
700
|
-
|
|
704
|
+
const {
|
|
705
|
+
willUpdateNodes: i,
|
|
706
|
+
willDeleteNodes: o,
|
|
707
|
+
eraseTxnRecoveryRequired: a,
|
|
708
|
+
eraseTxnBeforeImages: n
|
|
709
|
+
} = t, c = e.getWorkId(), d = [
|
|
710
|
+
...i ? Array.from(i.keys()).map((p) => String(p)) : [],
|
|
701
711
|
...o ? Array.from(o) : []
|
|
702
|
-
],
|
|
703
|
-
if (r &&
|
|
712
|
+
], l = [];
|
|
713
|
+
if (r && l.push({
|
|
704
714
|
type: h.None,
|
|
705
715
|
needUndoTicker: r,
|
|
706
|
-
undoScopeIds:
|
|
716
|
+
undoScopeIds: d,
|
|
707
717
|
undoScopePhase: "finalize",
|
|
708
|
-
eraseTxnId:
|
|
709
|
-
eraseTxnRecoveryRequired: a
|
|
710
|
-
|
|
718
|
+
eraseTxnId: c,
|
|
719
|
+
eraseTxnRecoveryRequired: a,
|
|
720
|
+
eraseTxnBeforeImages: n
|
|
721
|
+
}), l.push({
|
|
711
722
|
type: h.RemoveNode,
|
|
712
|
-
removeIds: [
|
|
713
|
-
eraseTxnId:
|
|
723
|
+
removeIds: [c],
|
|
724
|
+
eraseTxnId: c,
|
|
714
725
|
viewId: this.thread.viewId,
|
|
715
726
|
needUndoTicker: r,
|
|
716
|
-
eraseTxnRecoveryRequired: a
|
|
717
|
-
|
|
727
|
+
eraseTxnRecoveryRequired: a,
|
|
728
|
+
eraseTxnBeforeImages: n
|
|
729
|
+
}), s && l.push({
|
|
718
730
|
type: h.None,
|
|
719
731
|
isLockSentEventCursor: s
|
|
720
732
|
}), i != null && i.size || o != null && o.size) {
|
|
721
733
|
if (i != null && i.size)
|
|
722
|
-
for (const [
|
|
723
|
-
|
|
734
|
+
for (const [p, f] of i)
|
|
735
|
+
l.push({
|
|
724
736
|
type: h.UpdateNode,
|
|
725
737
|
dataType: R.Local,
|
|
726
|
-
opt:
|
|
727
|
-
workId:
|
|
738
|
+
opt: f.opt,
|
|
739
|
+
workId: p,
|
|
728
740
|
updateNodeOpt: {
|
|
729
741
|
useAnimation: !1
|
|
730
742
|
},
|
|
731
|
-
eraseTxnId:
|
|
743
|
+
eraseTxnId: c,
|
|
732
744
|
needUndoTicker: r
|
|
733
745
|
});
|
|
734
|
-
o != null && o.size &&
|
|
746
|
+
o != null && o.size && l.push({
|
|
735
747
|
type: h.RemoveNode,
|
|
736
748
|
removeIds: [...o],
|
|
737
|
-
eraseTxnId:
|
|
749
|
+
eraseTxnId: c,
|
|
738
750
|
viewId: this.thread.viewId,
|
|
739
751
|
needUndoTicker: r
|
|
740
752
|
});
|
|
741
753
|
}
|
|
742
|
-
|
|
754
|
+
l.push({
|
|
743
755
|
type: h.None,
|
|
744
756
|
viewId: this.thread.viewId,
|
|
745
|
-
eraseTxnId:
|
|
757
|
+
eraseTxnId: c,
|
|
746
758
|
eraseTxnPhase: t.eraseTxnCommitStatus === "failed" || a ? "failed" : "applied",
|
|
747
|
-
eraseTxnRecoveryRequired: a
|
|
748
|
-
|
|
759
|
+
eraseTxnRecoveryRequired: a,
|
|
760
|
+
eraseTxnBeforeImages: n
|
|
761
|
+
}), l.length && this.thread.post({ sp: l });
|
|
749
762
|
}
|
|
750
763
|
drawPencilEraserFull(e, t, s, r) {
|
|
751
764
|
const { willNewNodes: i, willDeleteNodes: o } = t, a = e.getWorkId(), n = [
|
|
@@ -951,14 +964,14 @@ class Ae {
|
|
|
951
964
|
if (i || r) {
|
|
952
965
|
const p = i == null ? void 0 : i.willDeleteNodes, f = i == null ? void 0 : i.willNewNodes, w = [
|
|
953
966
|
...p ? Array.from(p) : []
|
|
954
|
-
],
|
|
967
|
+
], S = {
|
|
955
968
|
render: [],
|
|
956
969
|
sp: [],
|
|
957
970
|
...r
|
|
958
971
|
};
|
|
959
972
|
if (i != null && i.rect) {
|
|
960
973
|
const I = Te(i.rect);
|
|
961
|
-
(a =
|
|
974
|
+
(a = S.render) == null || a.push(
|
|
962
975
|
{
|
|
963
976
|
rect: I,
|
|
964
977
|
isClear: !0,
|
|
@@ -974,12 +987,12 @@ class Ae {
|
|
|
974
987
|
}
|
|
975
988
|
);
|
|
976
989
|
}
|
|
977
|
-
if (s && w.length && ((n = this.getWorkShape(e)) == null ? void 0 : n.toolsType) === m.BitMapEraser && ((c =
|
|
990
|
+
if (s && w.length && ((n = this.getWorkShape(e)) == null ? void 0 : n.toolsType) === m.BitMapEraser && ((c = S.sp) == null || c.push({
|
|
978
991
|
type: h.None,
|
|
979
992
|
collectUndoTicker: s,
|
|
980
993
|
undoScopeIds: w,
|
|
981
994
|
undoScopePhase: "collect"
|
|
982
|
-
})), p != null && p.size && ((d =
|
|
995
|
+
})), p != null && p.size && ((d = S.sp) == null || d.push({
|
|
983
996
|
type: h.RemoveNode,
|
|
984
997
|
removeIds: [...p],
|
|
985
998
|
viewId: this.thread.viewId,
|
|
@@ -987,7 +1000,7 @@ class Ae {
|
|
|
987
1000
|
collectUndoTicker: s
|
|
988
1001
|
})), f != null && f.size)
|
|
989
1002
|
for (const [I, W] of f)
|
|
990
|
-
(l =
|
|
1003
|
+
(l = S.sp) == null || l.push({
|
|
991
1004
|
type: h.FullWork,
|
|
992
1005
|
dataType: R.Local,
|
|
993
1006
|
toolsType: W.toolsType,
|
|
@@ -1000,7 +1013,7 @@ class Ae {
|
|
|
1000
1013
|
needUndoTicker: t,
|
|
1001
1014
|
collectUndoTicker: s
|
|
1002
1015
|
});
|
|
1003
|
-
i != null && i.rect && await this.thread.fullLayer.parent.prepareRender, this.thread.post(
|
|
1016
|
+
i != null && i.rect && await this.thread.fullLayer.parent.prepareRender, this.thread.post(S);
|
|
1004
1017
|
}
|
|
1005
1018
|
}
|
|
1006
1019
|
async consumeDrawAll(e, t) {
|
|
@@ -1018,23 +1031,23 @@ class Ae {
|
|
|
1018
1031
|
if (p === m.LaserPen)
|
|
1019
1032
|
return;
|
|
1020
1033
|
p === m.BitMapEraser && await this.bitmapEraserRenderQueue;
|
|
1021
|
-
const f = this.workShapes.get(H), w = (a = f == null ? void 0 : f.selectIds) == null ? void 0 : a[0],
|
|
1034
|
+
const f = this.workShapes.get(H), w = (a = f == null ? void 0 : f.selectIds) == null ? void 0 : a[0], S = await l.consumeAll({ data: e, workerEngine: this });
|
|
1022
1035
|
switch (p) {
|
|
1023
1036
|
case m.Selector:
|
|
1024
1037
|
{
|
|
1025
|
-
|
|
1038
|
+
S.selectIds && w && ((n = S.selectIds) != null && n.includes(w)) && f.cursorBlur();
|
|
1026
1039
|
const I = [];
|
|
1027
1040
|
i && I.push({
|
|
1028
1041
|
type: h.None,
|
|
1029
1042
|
isLockSentEventCursor: i,
|
|
1030
1043
|
scenePath: r
|
|
1031
|
-
}),
|
|
1044
|
+
}), S.type === h.Select && (S.selectIds && t.runReverseSelectWork(S.selectIds), I.push({ ...S, scenePath: r })), I.length && this.thread.post({ sp: I }), (c = l.selectIds) != null && c.length ? l.clearTmpPoints() : this.clearWorkShapeNodeCache(d);
|
|
1032
1045
|
}
|
|
1033
1046
|
break;
|
|
1034
1047
|
case m.PencilEraser:
|
|
1035
1048
|
await this.drawPencilEraserFull(
|
|
1036
1049
|
l,
|
|
1037
|
-
|
|
1050
|
+
S,
|
|
1038
1051
|
i,
|
|
1039
1052
|
o
|
|
1040
1053
|
), this.fullWorkerDrawCount = 0, this.clearWorkShapeNodeCache(d);
|
|
@@ -1042,14 +1055,14 @@ class Ae {
|
|
|
1042
1055
|
case m.BitMapEraser:
|
|
1043
1056
|
await this.drawBitMapEraserFull(
|
|
1044
1057
|
l,
|
|
1045
|
-
|
|
1058
|
+
S,
|
|
1046
1059
|
i,
|
|
1047
1060
|
o
|
|
1048
1061
|
), this.fullWorkerDrawCount = 0, this.clearWorkShapeNodeCache(d);
|
|
1049
1062
|
break;
|
|
1050
1063
|
case m.Eraser:
|
|
1051
1064
|
await this.drawEraser(
|
|
1052
|
-
{ ...
|
|
1065
|
+
{ ...S, scenePath: r },
|
|
1053
1066
|
i,
|
|
1054
1067
|
o,
|
|
1055
1068
|
e.collectUndoTicker
|
|
@@ -1068,17 +1081,17 @@ class Ae {
|
|
|
1068
1081
|
type: h.None,
|
|
1069
1082
|
isLockSentEventCursor: i,
|
|
1070
1083
|
scenePath: r
|
|
1071
|
-
}),
|
|
1072
|
-
const g = p === m.Pencil &&
|
|
1084
|
+
}), S) {
|
|
1085
|
+
const g = p === m.Pencil && S.type === h.RemoveNode;
|
|
1073
1086
|
g ? $(
|
|
1074
1087
|
this.thread.localLayer,
|
|
1075
1088
|
this.thread.localLayer.parent
|
|
1076
1089
|
) : I.push({
|
|
1077
|
-
...
|
|
1090
|
+
...S,
|
|
1078
1091
|
scenePath: r,
|
|
1079
1092
|
needUndoTicker: e.needUndoTicker,
|
|
1080
|
-
undoScopeIds:
|
|
1081
|
-
undoScopePhase:
|
|
1093
|
+
undoScopeIds: S.undoScopeIds || (S.workId !== void 0 ? [S.workId.toString()] : void 0),
|
|
1094
|
+
undoScopePhase: S.undoScopePhase || "finalize"
|
|
1082
1095
|
}), this.fullWorkerDrawCount = 0, e.needUndoTicker && I.push({
|
|
1083
1096
|
type: h.None,
|
|
1084
1097
|
needUndoTicker: e.needUndoTicker,
|
|
@@ -1250,13 +1263,13 @@ class Fe {
|
|
|
1250
1263
|
);
|
|
1251
1264
|
}
|
|
1252
1265
|
async animationDraw() {
|
|
1253
|
-
var r, i, o, a, n, c, d, l, p, f, w,
|
|
1266
|
+
var r, i, o, a, n, c, d, l, p, f, w, S, I, W, g, y, v, T, C, L, A;
|
|
1254
1267
|
let e = !1;
|
|
1255
1268
|
const t = /* @__PURE__ */ new Map(), s = [];
|
|
1256
|
-
for (const [E,
|
|
1257
|
-
switch (
|
|
1269
|
+
for (const [E, k] of this.workShapes.entries())
|
|
1270
|
+
switch (k.toolsType) {
|
|
1258
1271
|
case m.BackgroundSVG: {
|
|
1259
|
-
(r =
|
|
1272
|
+
(r = k.node) == null || r.consumeService({
|
|
1260
1273
|
isFullWork: !0,
|
|
1261
1274
|
replaceId: E
|
|
1262
1275
|
}), this.selectorWorkShapes.forEach((O, B) => {
|
|
@@ -1266,7 +1279,7 @@ class Fe {
|
|
|
1266
1279
|
break;
|
|
1267
1280
|
}
|
|
1268
1281
|
case m.Image: {
|
|
1269
|
-
await ((i =
|
|
1282
|
+
await ((i = k.node) == null ? void 0 : i.consumeServiceAsync({
|
|
1270
1283
|
isFullWork: !0,
|
|
1271
1284
|
worker: this
|
|
1272
1285
|
})), this.selectorWorkShapes.forEach((O, B) => {
|
|
@@ -1276,19 +1289,19 @@ class Fe {
|
|
|
1276
1289
|
break;
|
|
1277
1290
|
}
|
|
1278
1291
|
case m.Text: {
|
|
1279
|
-
|
|
1292
|
+
k.node && (await ((o = k.node) == null ? void 0 : o.consumeServiceAsync({
|
|
1280
1293
|
isFullWork: !0,
|
|
1281
1294
|
replaceId: E,
|
|
1282
1295
|
boxRect: this.thread.getSceneRect()
|
|
1283
1296
|
})), this.selectorWorkShapes.forEach((O, B) => {
|
|
1284
1297
|
var P;
|
|
1285
1298
|
(P = O.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(B), this.runEffect());
|
|
1286
|
-
}),
|
|
1299
|
+
}), k.refreshTextRender && k.requestId && s.push({
|
|
1287
1300
|
type: h.RefreshTextRender,
|
|
1288
|
-
requestId:
|
|
1301
|
+
requestId: k.requestId,
|
|
1289
1302
|
workId: E,
|
|
1290
1303
|
viewId: this.thread.viewId
|
|
1291
|
-
}), (a =
|
|
1304
|
+
}), (a = k.node) == null || a.clearTmpPoints(), this.workShapes.delete(E));
|
|
1292
1305
|
break;
|
|
1293
1306
|
}
|
|
1294
1307
|
case m.Arrow:
|
|
@@ -1298,60 +1311,60 @@ class Fe {
|
|
|
1298
1311
|
case m.Star:
|
|
1299
1312
|
case m.Polygon:
|
|
1300
1313
|
case m.SpeechBalloon: {
|
|
1301
|
-
const O = !!
|
|
1302
|
-
if ((n =
|
|
1303
|
-
const B =
|
|
1304
|
-
(c =
|
|
1305
|
-
op:
|
|
1314
|
+
const O = !!k.ops;
|
|
1315
|
+
if ((n = k.animationWorkData) != null && n.length) {
|
|
1316
|
+
const B = k.oldRect;
|
|
1317
|
+
(c = k.node) == null || c.consumeService({
|
|
1318
|
+
op: k.animationWorkData,
|
|
1306
1319
|
isFullWork: O
|
|
1307
1320
|
}), O && (this.selectorWorkShapes.forEach((P, F) => {
|
|
1308
1321
|
var U;
|
|
1309
1322
|
(U = P.selectIds) != null && U.includes(E) && (this.willRunEffectSelectorIds.add(F), this.runEffect());
|
|
1310
|
-
}), (d =
|
|
1311
|
-
cursorTool: _(
|
|
1312
|
-
workState: B ?
|
|
1313
|
-
op:
|
|
1314
|
-
}) : O && !
|
|
1315
|
-
cursorTool: _(
|
|
1323
|
+
}), (d = k.node) == null || d.clearTmpPoints(), this.workShapes.delete(E)), k.isEnableCursor ? t.set(E, {
|
|
1324
|
+
cursorTool: _(k.toolsType),
|
|
1325
|
+
workState: B ? k.ops ? b.Done : b.Doing : b.Start,
|
|
1326
|
+
op: k.animationWorkData.slice(-3, -1)
|
|
1327
|
+
}) : O && !k.useAnimation && ((l = k.updateNodeOpt) != null && l.useAnimation) && t.set(E, {
|
|
1328
|
+
cursorTool: _(k.toolsType),
|
|
1316
1329
|
workState: b.Done,
|
|
1317
|
-
op:
|
|
1318
|
-
uid: (p =
|
|
1319
|
-
}),
|
|
1330
|
+
op: k.animationWorkData.slice(-3, -1),
|
|
1331
|
+
uid: (p = k.updateNodeOpt) == null ? void 0 : p.uid
|
|
1332
|
+
}), k.animationWorkData.length = 0;
|
|
1320
1333
|
}
|
|
1321
1334
|
break;
|
|
1322
1335
|
}
|
|
1323
1336
|
case m.Pencil: {
|
|
1324
|
-
if (
|
|
1325
|
-
if (
|
|
1326
|
-
if (
|
|
1327
|
-
(y =
|
|
1337
|
+
if (k.useAnimation) {
|
|
1338
|
+
if (k.useAnimation) {
|
|
1339
|
+
if (k.isDel) {
|
|
1340
|
+
(y = k.node) == null || y.clearTmpPoints(), this.workShapes.delete(E);
|
|
1328
1341
|
break;
|
|
1329
1342
|
}
|
|
1330
1343
|
const O = 3, B = this.computNextAnimationIndex(
|
|
1331
|
-
|
|
1344
|
+
k,
|
|
1332
1345
|
O
|
|
1333
|
-
), P =
|
|
1346
|
+
), P = k.isDiff ? 0 : Math.max(0, (k.animationIndex || 0) - O), F = (k.animationWorkData || []).slice(
|
|
1334
1347
|
P,
|
|
1335
1348
|
B
|
|
1336
|
-
), U = (T = (
|
|
1337
|
-
if ((
|
|
1338
|
-
if ((C =
|
|
1349
|
+
), U = (T = (v = k.node) == null ? void 0 : v.getWorkId()) == null ? void 0 : T.toString();
|
|
1350
|
+
if ((k.animationIndex || 0) < B || k.isDiff) {
|
|
1351
|
+
if ((C = k.node) == null || C.consumeService({
|
|
1339
1352
|
op: F,
|
|
1340
1353
|
isFullWork: !1
|
|
1341
|
-
}),
|
|
1354
|
+
}), k.animationIndex = B, k.isDiff && (k.isDiff = !1), F.length && k.isEnableCursor) {
|
|
1342
1355
|
const X = F.slice(-3, -1);
|
|
1343
1356
|
t.set(E, {
|
|
1344
|
-
cursorTool: _(
|
|
1345
|
-
workState: P === 0 ? b.Start : B === ((L =
|
|
1357
|
+
cursorTool: _(k.toolsType),
|
|
1358
|
+
workState: P === 0 ? b.Start : B === ((L = k.animationWorkData) == null ? void 0 : L.length) ? b.Done : b.Doing,
|
|
1346
1359
|
op: X
|
|
1347
1360
|
});
|
|
1348
1361
|
}
|
|
1349
|
-
} else
|
|
1350
|
-
op:
|
|
1362
|
+
} else k.ops && ((A = k.node) == null || A.consumeService({
|
|
1363
|
+
op: k.animationWorkData || [],
|
|
1351
1364
|
isFullWork: !0,
|
|
1352
1365
|
replaceId: U
|
|
1353
|
-
}),
|
|
1354
|
-
cursorTool: _(
|
|
1366
|
+
}), k.isDel = !0, k.isEnableCursor && t.set(E, {
|
|
1367
|
+
cursorTool: _(k.toolsType),
|
|
1355
1368
|
workState: b.Done,
|
|
1356
1369
|
op: F.slice(-3, -1)
|
|
1357
1370
|
}));
|
|
@@ -1359,34 +1372,34 @@ class Fe {
|
|
|
1359
1372
|
break;
|
|
1360
1373
|
}
|
|
1361
1374
|
} else {
|
|
1362
|
-
const O = !!
|
|
1363
|
-
if ((f =
|
|
1364
|
-
op:
|
|
1375
|
+
const O = !!k.ops;
|
|
1376
|
+
if ((f = k.node) == null || f.consumeService({
|
|
1377
|
+
op: k.animationWorkData || [],
|
|
1365
1378
|
isFullWork: O,
|
|
1366
1379
|
replaceId: E
|
|
1367
|
-
}), (w =
|
|
1368
|
-
if (!
|
|
1369
|
-
const B =
|
|
1380
|
+
}), (w = k.node) == null || w.updataOptService(k.updateNodeOpt), O) {
|
|
1381
|
+
if (!k.isEnableCursor && ((S = k.updateNodeOpt) != null && S.useAnimation) && ((I = k.animationWorkData) != null && I.length)) {
|
|
1382
|
+
const B = k.animationWorkData.slice(-3, -1);
|
|
1370
1383
|
t.set(E, {
|
|
1371
|
-
cursorTool: _(
|
|
1384
|
+
cursorTool: _(k.toolsType),
|
|
1372
1385
|
workState: b.Done,
|
|
1373
1386
|
op: B,
|
|
1374
|
-
uid: (W =
|
|
1387
|
+
uid: (W = k.updateNodeOpt) == null ? void 0 : W.uid
|
|
1375
1388
|
});
|
|
1376
1389
|
}
|
|
1377
1390
|
this.selectorWorkShapes.forEach((B, P) => {
|
|
1378
1391
|
var F;
|
|
1379
1392
|
(F = B.selectIds) != null && F.includes(E) && (this.willRunEffectSelectorIds.add(P), this.runEffect());
|
|
1380
|
-
}), (g =
|
|
1393
|
+
}), (g = k.node) == null || g.clearTmpPoints(), this.workShapes.delete(E);
|
|
1381
1394
|
}
|
|
1382
1395
|
}
|
|
1383
1396
|
break;
|
|
1384
1397
|
}
|
|
1385
1398
|
}
|
|
1386
|
-
e && this.runAnimation(), t.size && t.forEach((E,
|
|
1399
|
+
e && this.runAnimation(), t.size && t.forEach((E, k) => {
|
|
1387
1400
|
s.push({
|
|
1388
1401
|
type: h.Cursor,
|
|
1389
|
-
uid: E.uid ||
|
|
1402
|
+
uid: E.uid || k.split(de)[0],
|
|
1390
1403
|
op: E.op,
|
|
1391
1404
|
workState: E.workState,
|
|
1392
1405
|
cursorTool: E.cursorTool,
|
|
@@ -1421,7 +1434,7 @@ class Fe {
|
|
|
1421
1434
|
return !1;
|
|
1422
1435
|
}
|
|
1423
1436
|
activeWorkShape(e) {
|
|
1424
|
-
var W, g, y,
|
|
1437
|
+
var W, g, y, v;
|
|
1425
1438
|
const {
|
|
1426
1439
|
workId: t,
|
|
1427
1440
|
opt: s,
|
|
@@ -1438,7 +1451,7 @@ class Fe {
|
|
|
1438
1451
|
} = e;
|
|
1439
1452
|
if (!t)
|
|
1440
1453
|
return;
|
|
1441
|
-
const w = t.toString(),
|
|
1454
|
+
const w = t.toString(), S = (W = this.vNodes.get(w)) == null ? void 0 : W.rect;
|
|
1442
1455
|
if (!((g = this.workShapes) != null && g.has(w))) {
|
|
1443
1456
|
let T = {
|
|
1444
1457
|
toolsType: r,
|
|
@@ -1448,19 +1461,19 @@ class Fe {
|
|
|
1448
1461
|
updateNodeOpt: o,
|
|
1449
1462
|
ops: a,
|
|
1450
1463
|
useAnimation: typeof c < "u" ? c : typeof (o == null ? void 0 : o.useAnimation) < "u" ? o == null ? void 0 : o.useAnimation : !0,
|
|
1451
|
-
oldRect:
|
|
1464
|
+
oldRect: S,
|
|
1452
1465
|
isDiff: !1,
|
|
1453
1466
|
imageBitmap: d,
|
|
1454
1467
|
isEnableCursor: l
|
|
1455
1468
|
};
|
|
1456
1469
|
r && s && (T = this.setNodeKey(w, T, r, s)), (y = this.workShapes) == null || y.set(w, T);
|
|
1457
1470
|
}
|
|
1458
|
-
const I = (
|
|
1471
|
+
const I = (v = this.workShapes) == null ? void 0 : v.get(w);
|
|
1459
1472
|
I.isEnableCursor = l, I.requestId = p, I.refreshTextRender = !!f, i && (I.type = i), a && (I.animationWorkData = V(a), I.ops = a), o && (I.updateNodeOpt = o), n && (I.isDiff = this.hasDiffData(
|
|
1460
1473
|
I.animationWorkData || [],
|
|
1461
1474
|
n,
|
|
1462
1475
|
I.toolsType
|
|
1463
|
-
), I.toolsType, m.Pencil, I.animationWorkData = n), I.node && I.node.getWorkId() !== w && I.node.setWorkId(w),
|
|
1476
|
+
), I.toolsType, m.Pencil, I.animationWorkData = n), I.node && I.node.getWorkId() !== w && I.node.setWorkId(w), S && (I.oldRect = S), r && s && (s.syncUnitTime && (this.syncUnitTime = s.syncUnitTime), I.toolsType !== r && r && s && this.setNodeKey(w, I, r, s), I.node && I.node.setWorkOptions(s)), d && (I.imageBitmap = d);
|
|
1464
1477
|
}
|
|
1465
1478
|
removeNode(e, t) {
|
|
1466
1479
|
e.indexOf(D) > -1 && this.removeSelectWork(t), this.thread.fullLayer.getElementsByName(e).forEach((r) => {
|
|
@@ -1702,7 +1715,7 @@ class qe extends x {
|
|
|
1702
1715
|
updateSelectorOpt: l,
|
|
1703
1716
|
textUpdateForWoker: p,
|
|
1704
1717
|
needUndoTicker: f
|
|
1705
|
-
} = s, w = l.workState,
|
|
1718
|
+
} = s, w = l.workState, S = r.sp || [];
|
|
1706
1719
|
if (w === b.Start)
|
|
1707
1720
|
return {
|
|
1708
1721
|
sp: [
|
|
@@ -1717,7 +1730,7 @@ class qe extends x {
|
|
|
1717
1730
|
const I = a == null ? void 0 : a.selectRect;
|
|
1718
1731
|
if (c) {
|
|
1719
1732
|
const g = w === b.Done ? f : void 0;
|
|
1720
|
-
|
|
1733
|
+
S.push({
|
|
1721
1734
|
type: h.Select,
|
|
1722
1735
|
selectIds: o.selectIds,
|
|
1723
1736
|
selectRect: I,
|
|
@@ -1733,34 +1746,34 @@ class qe extends x {
|
|
|
1733
1746
|
useAnimation: l.useAnimation || !1
|
|
1734
1747
|
};
|
|
1735
1748
|
l.uid && (y.uid = l.uid);
|
|
1736
|
-
for (const [
|
|
1737
|
-
T.toolsType === m.BackgroundSVG &&
|
|
1749
|
+
for (const [v, T] of i.entries())
|
|
1750
|
+
T.toolsType === m.BackgroundSVG && S.push({
|
|
1738
1751
|
...T,
|
|
1739
|
-
workId:
|
|
1752
|
+
workId: v,
|
|
1740
1753
|
type: h.BackgroundSVGUpdate,
|
|
1741
1754
|
dataType: R.Local,
|
|
1742
1755
|
willSyncService: w === b.Done ? !0 : n,
|
|
1743
1756
|
updateNodeOpt: y,
|
|
1744
1757
|
needUndoTicker: g,
|
|
1745
1758
|
emitEventType: this.emitEventType
|
|
1746
|
-
}), p && T.toolsType === m.Text ?
|
|
1759
|
+
}), p && T.toolsType === m.Text ? S.push({
|
|
1747
1760
|
...T,
|
|
1748
|
-
workId:
|
|
1761
|
+
workId: v,
|
|
1749
1762
|
type: h.TextUpdate,
|
|
1750
1763
|
dataType: R.Local,
|
|
1751
1764
|
willSyncService: w === b.Done ? !0 : n,
|
|
1752
1765
|
updateNodeOpt: y,
|
|
1753
1766
|
needUndoTicker: g,
|
|
1754
1767
|
emitEventType: this.emitEventType
|
|
1755
|
-
}) : (n || w === b.Done) &&
|
|
1768
|
+
}) : (n || w === b.Done) && S.push({
|
|
1756
1769
|
...T,
|
|
1757
|
-
workId:
|
|
1770
|
+
workId: v,
|
|
1758
1771
|
type: h.UpdateNode,
|
|
1759
1772
|
updateNodeOpt: {
|
|
1760
1773
|
...y,
|
|
1761
1774
|
eraserGeometryDelta: ee(
|
|
1762
1775
|
(W = this.localWork) == null ? void 0 : W.vNodes,
|
|
1763
|
-
|
|
1776
|
+
v
|
|
1764
1777
|
)
|
|
1765
1778
|
},
|
|
1766
1779
|
isSync: d,
|
|
@@ -1768,15 +1781,15 @@ class qe extends x {
|
|
|
1768
1781
|
emitEventType: this.emitEventType
|
|
1769
1782
|
});
|
|
1770
1783
|
}
|
|
1771
|
-
return f &&
|
|
1784
|
+
return f && S.push({
|
|
1772
1785
|
type: h.None,
|
|
1773
1786
|
needUndoTicker: f
|
|
1774
|
-
}),
|
|
1787
|
+
}), S.push({
|
|
1775
1788
|
type: h.SelectorTransform,
|
|
1776
1789
|
emitEventType: this.emitEventType,
|
|
1777
1790
|
workState: w
|
|
1778
1791
|
}), {
|
|
1779
|
-
sp:
|
|
1792
|
+
sp: S
|
|
1780
1793
|
};
|
|
1781
1794
|
});
|
|
1782
1795
|
}
|
|
@@ -1818,7 +1831,7 @@ class ze extends x {
|
|
|
1818
1831
|
u(this, "emitEventType", N.ScaleNode);
|
|
1819
1832
|
u(this, "updateSelectorCallback", (t) => {
|
|
1820
1833
|
var I;
|
|
1821
|
-
const { param: s, postData: r, workShapeNode: i, res: o, newServiceStore: a, smoothSync: n } = t, { updateSelectorOpt: c, willSyncService: d, needUndoTicker: l } = s, p = c.workState, f = r.sp || [], w = o == null ? void 0 : o.selectRect,
|
|
1834
|
+
const { param: s, postData: r, workShapeNode: i, res: o, newServiceStore: a, smoothSync: n } = t, { updateSelectorOpt: c, willSyncService: d, needUndoTicker: l } = s, p = c.workState, f = r.sp || [], w = o == null ? void 0 : o.selectRect, S = p === b.Done ? l : void 0;
|
|
1822
1835
|
if (p === b.Start)
|
|
1823
1836
|
return {
|
|
1824
1837
|
sp: [
|
|
@@ -1852,7 +1865,7 @@ class ze extends x {
|
|
|
1852
1865
|
dataType: R.Local,
|
|
1853
1866
|
willSyncService: p === b.Done ? !0 : n,
|
|
1854
1867
|
updateNodeOpt: W,
|
|
1855
|
-
needUndoTicker:
|
|
1868
|
+
needUndoTicker: S,
|
|
1856
1869
|
emitEventType: this.emitEventType
|
|
1857
1870
|
}), y.toolsType === m.Text ? f.push({
|
|
1858
1871
|
...y,
|
|
@@ -1861,7 +1874,7 @@ class ze extends x {
|
|
|
1861
1874
|
dataType: R.Local,
|
|
1862
1875
|
willSyncService: p === b.Done ? !0 : n,
|
|
1863
1876
|
updateNodeOpt: W,
|
|
1864
|
-
needUndoTicker:
|
|
1877
|
+
needUndoTicker: S,
|
|
1865
1878
|
emitEventType: this.emitEventType
|
|
1866
1879
|
}) : (n || p === b.Done) && f.push({
|
|
1867
1880
|
...y,
|
|
@@ -1875,7 +1888,7 @@ class ze extends x {
|
|
|
1875
1888
|
)
|
|
1876
1889
|
},
|
|
1877
1890
|
isSync: !0,
|
|
1878
|
-
needUndoTicker:
|
|
1891
|
+
needUndoTicker: S,
|
|
1879
1892
|
emitEventType: this.emitEventType
|
|
1880
1893
|
});
|
|
1881
1894
|
}
|
|
@@ -1929,9 +1942,9 @@ class Ve extends x {
|
|
|
1929
1942
|
willSerializeData: l,
|
|
1930
1943
|
isSync: p,
|
|
1931
1944
|
needUndoTicker: f
|
|
1932
|
-
} = s, w = c.workState,
|
|
1945
|
+
} = s, w = c.workState, S = r.sp || [], I = o == null ? void 0 : o.selectRect, W = w === b.Done ? f : void 0;
|
|
1933
1946
|
if (d) {
|
|
1934
|
-
l && w === b.Done &&
|
|
1947
|
+
l && w === b.Done && S.push({
|
|
1935
1948
|
type: h.Select,
|
|
1936
1949
|
selectIds: i.selectIds,
|
|
1937
1950
|
selectRect: I,
|
|
@@ -1943,16 +1956,16 @@ class Ve extends x {
|
|
|
1943
1956
|
useAnimation: c.useAnimation || !1
|
|
1944
1957
|
};
|
|
1945
1958
|
if (c.uid && (y.uid = c.uid), n || w === b.Done)
|
|
1946
|
-
for (const [
|
|
1947
|
-
|
|
1959
|
+
for (const [v, T] of a.entries())
|
|
1960
|
+
S.push({
|
|
1948
1961
|
...T,
|
|
1949
|
-
workId:
|
|
1962
|
+
workId: v,
|
|
1950
1963
|
type: h.UpdateNode,
|
|
1951
1964
|
updateNodeOpt: {
|
|
1952
1965
|
...y,
|
|
1953
1966
|
eraserGeometryDelta: ee(
|
|
1954
1967
|
(g = this.localWork) == null ? void 0 : g.vNodes,
|
|
1955
|
-
|
|
1968
|
+
v
|
|
1956
1969
|
)
|
|
1957
1970
|
},
|
|
1958
1971
|
isSync: p,
|
|
@@ -1960,15 +1973,15 @@ class Ve extends x {
|
|
|
1960
1973
|
emitEventType: this.emitEventType
|
|
1961
1974
|
});
|
|
1962
1975
|
}
|
|
1963
|
-
return f &&
|
|
1976
|
+
return f && S.push({
|
|
1964
1977
|
type: h.None,
|
|
1965
1978
|
needUndoTicker: f
|
|
1966
|
-
}),
|
|
1979
|
+
}), S.push({
|
|
1967
1980
|
type: h.SelectorTransform,
|
|
1968
1981
|
emitEventType: this.emitEventType,
|
|
1969
1982
|
workState: w
|
|
1970
1983
|
}), {
|
|
1971
|
-
sp:
|
|
1984
|
+
sp: S
|
|
1972
1985
|
};
|
|
1973
1986
|
});
|
|
1974
1987
|
}
|
|
@@ -2042,12 +2055,12 @@ class $e extends x {
|
|
|
2042
2055
|
textUpdateForWoker: l,
|
|
2043
2056
|
requestId: p,
|
|
2044
2057
|
emitEventType: f
|
|
2045
|
-
} = s, w = r.sp || [],
|
|
2058
|
+
} = s, w = r.sp || [], S = a == null ? void 0 : a.selectRect;
|
|
2046
2059
|
if (n && w) {
|
|
2047
2060
|
d.fontSize && w.push({
|
|
2048
2061
|
type: h.Select,
|
|
2049
2062
|
selectIds: o.selectIds,
|
|
2050
|
-
selectRect:
|
|
2063
|
+
selectRect: S,
|
|
2051
2064
|
willSyncService: n,
|
|
2052
2065
|
isSync: c,
|
|
2053
2066
|
points: o.getChildrenPoints()
|
|
@@ -2187,7 +2200,7 @@ class He extends x {
|
|
|
2187
2200
|
needUndoTicker: l,
|
|
2188
2201
|
requestId: p,
|
|
2189
2202
|
emitEventType: f
|
|
2190
|
-
} = s, w = r.sp || [],
|
|
2203
|
+
} = s, w = r.sp || [], S = a == null ? void 0 : a.selectRect;
|
|
2191
2204
|
if (n && w) {
|
|
2192
2205
|
for (const [I, W] of i.entries())
|
|
2193
2206
|
w.push({
|
|
@@ -2208,7 +2221,7 @@ class He extends x {
|
|
|
2208
2221
|
canRotate: o.canRotate,
|
|
2209
2222
|
type: h.Select,
|
|
2210
2223
|
selectIds: o.selectIds,
|
|
2211
|
-
selectRect:
|
|
2224
|
+
selectRect: S,
|
|
2212
2225
|
willSyncService: n,
|
|
2213
2226
|
isSync: c
|
|
2214
2227
|
});
|
|
@@ -2550,7 +2563,7 @@ class je {
|
|
|
2550
2563
|
workState: p,
|
|
2551
2564
|
imageSrc: f,
|
|
2552
2565
|
imageBitmap: w,
|
|
2553
|
-
imageElement:
|
|
2566
|
+
imageElement: S,
|
|
2554
2567
|
workIds: I,
|
|
2555
2568
|
isLockSentEventCursor: W,
|
|
2556
2569
|
requestId: g
|
|
@@ -2560,19 +2573,24 @@ class je {
|
|
|
2560
2573
|
G(e.dpr) && this.updateDpr(e.dpr);
|
|
2561
2574
|
break;
|
|
2562
2575
|
case h.AuthClear: {
|
|
2563
|
-
const { clearUids:
|
|
2564
|
-
this.vNodes.setCanClearUids(
|
|
2576
|
+
const { clearUids: v, localUid: T } = e;
|
|
2577
|
+
this.vNodes.setCanClearUids(v), this.vNodes.setLocalUid(T);
|
|
2565
2578
|
break;
|
|
2566
2579
|
}
|
|
2567
2580
|
case h.Destroy:
|
|
2568
2581
|
this.destroy();
|
|
2569
2582
|
break;
|
|
2583
|
+
case h.CancelBitmapEraser: {
|
|
2584
|
+
const v = y;
|
|
2585
|
+
v && this.localWork.abortBitmapEraser(v);
|
|
2586
|
+
break;
|
|
2587
|
+
}
|
|
2570
2588
|
case h.Clear:
|
|
2571
2589
|
this.clearAll();
|
|
2572
2590
|
break;
|
|
2573
2591
|
case h.ServiceSyncCommit: {
|
|
2574
2592
|
if (this.destroyed) break;
|
|
2575
|
-
const
|
|
2593
|
+
const v = [
|
|
2576
2594
|
(s = this.fullLayer) == null ? void 0 : s.parent,
|
|
2577
2595
|
(r = this.topLayer) == null ? void 0 : r.parent,
|
|
2578
2596
|
(i = this.localLayer) == null ? void 0 : i.parent,
|
|
@@ -2583,7 +2601,7 @@ class je {
|
|
|
2583
2601
|
(async () => {
|
|
2584
2602
|
await Le(
|
|
2585
2603
|
this.serviceWork,
|
|
2586
|
-
|
|
2604
|
+
v
|
|
2587
2605
|
);
|
|
2588
2606
|
})(),
|
|
2589
2607
|
{
|
|
@@ -2617,26 +2635,26 @@ class je {
|
|
|
2617
2635
|
try {
|
|
2618
2636
|
await Ee(
|
|
2619
2637
|
e.cameraTaskId,
|
|
2620
|
-
async (
|
|
2621
|
-
this.activeCameraTaskContext =
|
|
2638
|
+
async (v) => {
|
|
2639
|
+
this.activeCameraTaskContext = v;
|
|
2622
2640
|
try {
|
|
2623
|
-
await this.updateCamera(e,
|
|
2641
|
+
await this.updateCamera(e, v);
|
|
2624
2642
|
} finally {
|
|
2625
|
-
this.activeCameraTaskContext ===
|
|
2643
|
+
this.activeCameraTaskContext === v && (this.activeCameraTaskContext = void 0);
|
|
2626
2644
|
}
|
|
2627
2645
|
}
|
|
2628
2646
|
);
|
|
2629
|
-
} catch (
|
|
2630
|
-
throw this.cameraOpt = void 0, this.cancelCameraSettledRender(),
|
|
2647
|
+
} catch (v) {
|
|
2648
|
+
throw this.cameraOpt = void 0, this.cancelCameraSettledRender(), v;
|
|
2631
2649
|
}
|
|
2632
2650
|
break;
|
|
2633
2651
|
case h.UpdateTools:
|
|
2634
2652
|
if (n && c) {
|
|
2635
|
-
const
|
|
2653
|
+
const v = {
|
|
2636
2654
|
toolsType: n,
|
|
2637
2655
|
toolsOpt: c
|
|
2638
2656
|
};
|
|
2639
|
-
this.topWork.canUseTopLayer(n) ? this.topWork.setToolsOpt(
|
|
2657
|
+
this.topWork.canUseTopLayer(n) ? this.topWork.setToolsOpt(v) : this.localWork.setToolsOpt(v);
|
|
2640
2658
|
}
|
|
2641
2659
|
break;
|
|
2642
2660
|
case h.CreateWork:
|
|
@@ -2688,31 +2706,31 @@ class je {
|
|
|
2688
2706
|
d === R.Local && this.localWork.checkTextActive(e);
|
|
2689
2707
|
break;
|
|
2690
2708
|
case h.GetImageBitMap:
|
|
2691
|
-
if (f && (w ||
|
|
2692
|
-
const
|
|
2693
|
-
if (!
|
|
2694
|
-
this.closeImageSource(w ||
|
|
2709
|
+
if (f && (w || S) && l) {
|
|
2710
|
+
const v = this.imageResolveMap.get(f);
|
|
2711
|
+
if (!v || v.requestId !== g) {
|
|
2712
|
+
this.closeImageSource(w || S);
|
|
2695
2713
|
break;
|
|
2696
2714
|
}
|
|
2697
2715
|
const T = l.toString();
|
|
2698
2716
|
this.deleteCachedImagesByWorkId(T), this.cacheImages.set(f, {
|
|
2699
|
-
imageSource: w ||
|
|
2717
|
+
imageSource: w || S,
|
|
2700
2718
|
workId: T
|
|
2701
2719
|
});
|
|
2702
|
-
const { resolve: C, timer: L } =
|
|
2720
|
+
const { resolve: C, timer: L } = v;
|
|
2703
2721
|
L && clearTimeout(L), C && C(f);
|
|
2704
2722
|
}
|
|
2705
2723
|
break;
|
|
2706
2724
|
case h.GetVNodeInfo:
|
|
2707
2725
|
if (l && I) {
|
|
2708
|
-
const
|
|
2726
|
+
const v = I.map((T) => this.vNodes.get(T));
|
|
2709
2727
|
this.post({
|
|
2710
2728
|
sp: [
|
|
2711
2729
|
{
|
|
2712
2730
|
type: h.GetVNodeInfo,
|
|
2713
2731
|
dataType: R.Local,
|
|
2714
2732
|
workId: l,
|
|
2715
|
-
vInfo:
|
|
2733
|
+
vInfo: v
|
|
2716
2734
|
}
|
|
2717
2735
|
]
|
|
2718
2736
|
});
|
|
@@ -2733,8 +2751,8 @@ class je {
|
|
|
2733
2751
|
return;
|
|
2734
2752
|
let p = a;
|
|
2735
2753
|
if (n === pe.Iconify) {
|
|
2736
|
-
const [y,
|
|
2737
|
-
p = ue(a, y,
|
|
2754
|
+
const [y, v] = this.getIconSize(c, d, this.opt.displayer.dpr);
|
|
2755
|
+
p = ue(a, y, v, l);
|
|
2738
2756
|
}
|
|
2739
2757
|
if (this.cacheImages.has(p)) {
|
|
2740
2758
|
const y = this.getCachedImages(p);
|
|
@@ -2744,18 +2762,18 @@ class je {
|
|
|
2744
2762
|
const w = this.imageResolveMap.get(p);
|
|
2745
2763
|
if (w)
|
|
2746
2764
|
return await w.promise, this.getCachedImages(p);
|
|
2747
|
-
let
|
|
2748
|
-
const W = new Promise((y,
|
|
2749
|
-
|
|
2765
|
+
let S, I;
|
|
2766
|
+
const W = new Promise((y, v) => {
|
|
2767
|
+
S = y, I = v;
|
|
2750
2768
|
}), g = {
|
|
2751
|
-
resolve:
|
|
2769
|
+
resolve: S,
|
|
2752
2770
|
reject: I,
|
|
2753
2771
|
timer: void 0,
|
|
2754
2772
|
requestId: i,
|
|
2755
2773
|
promise: W
|
|
2756
2774
|
};
|
|
2757
2775
|
return g.timer = setTimeout(() => {
|
|
2758
|
-
this.imageResolveMap.get(p) === g &&
|
|
2776
|
+
this.imageResolveMap.get(p) === g && S(p);
|
|
2759
2777
|
}, 5e3), this.imageResolveMap.set(p, g), this.opt.post({
|
|
2760
2778
|
sp: [
|
|
2761
2779
|
{
|
|
@@ -2930,29 +2948,29 @@ class je {
|
|
|
2930
2948
|
}
|
|
2931
2949
|
if (t != null && t.aborted) return;
|
|
2932
2950
|
const f = /* @__PURE__ */ new Map();
|
|
2933
|
-
for (const [y,
|
|
2934
|
-
const T =
|
|
2951
|
+
for (const [y, v] of this.vNodes.getNodesByType(m.Text).entries()) {
|
|
2952
|
+
const T = v.rect;
|
|
2935
2953
|
f.set(y, J(T));
|
|
2936
2954
|
}
|
|
2937
|
-
for (const [y,
|
|
2938
|
-
f.set(y, J(
|
|
2955
|
+
for (const [y, v] of this.vNodes.gethasEraserNodes().entries())
|
|
2956
|
+
f.set(y, J(v.rect));
|
|
2939
2957
|
const w = new Set(f.keys());
|
|
2940
|
-
let
|
|
2958
|
+
let S = !1;
|
|
2941
2959
|
if (this.localWork.hasSelector()) {
|
|
2942
2960
|
const y = (l = this.localWork.getSelector()) == null ? void 0 : l.selectIds;
|
|
2943
2961
|
if (y) {
|
|
2944
|
-
|
|
2945
|
-
for (const
|
|
2946
|
-
w.add(
|
|
2962
|
+
S = !0;
|
|
2963
|
+
for (const v of y)
|
|
2964
|
+
w.add(v);
|
|
2947
2965
|
}
|
|
2948
2966
|
}
|
|
2949
2967
|
let I = !1;
|
|
2950
2968
|
if (this.serviceWork.selectorWorkShapes.size)
|
|
2951
2969
|
for (const y of this.serviceWork.selectorWorkShapes.values()) {
|
|
2952
|
-
const
|
|
2953
|
-
if (
|
|
2970
|
+
const v = y.selectIds;
|
|
2971
|
+
if (v) {
|
|
2954
2972
|
I = !0;
|
|
2955
|
-
for (const T of
|
|
2973
|
+
for (const T of v)
|
|
2956
2974
|
w.add(T);
|
|
2957
2975
|
}
|
|
2958
2976
|
}
|
|
@@ -2961,14 +2979,14 @@ class je {
|
|
|
2961
2979
|
for (const [T, C] of f.entries()) {
|
|
2962
2980
|
const L = this.vNodes.get(T);
|
|
2963
2981
|
if (L) {
|
|
2964
|
-
const A = C, E = L.rect,
|
|
2982
|
+
const A = C, E = L.rect, k = this.getSceneRect(), O = ae(A, k), B = ae(E, k);
|
|
2965
2983
|
let P = c;
|
|
2966
2984
|
(O !== B || A.w !== E.w || A.h !== E.h || B === Ce.intersect) && (P = !0);
|
|
2967
2985
|
const { toolsType: F, opt: U } = L, X = U.eraserlines && U.eraserlines.length > 0 || !!U.eraserFaces;
|
|
2968
2986
|
(P || p && X) && (F === m.Text || X) && this.debounceUpdateCache.add(T);
|
|
2969
2987
|
}
|
|
2970
2988
|
}
|
|
2971
|
-
if (
|
|
2989
|
+
if (S && this.localWork.reRenderSelector(), I)
|
|
2972
2990
|
for (const [
|
|
2973
2991
|
T,
|
|
2974
2992
|
C
|
|
@@ -2983,18 +3001,18 @@ class je {
|
|
|
2983
3001
|
o = !0;
|
|
2984
3002
|
const y = { cancelled: !1, cameraTaskId: i, context: t };
|
|
2985
3003
|
this.activeCameraSettledRender = y;
|
|
2986
|
-
const
|
|
3004
|
+
const v = () => !this.destroyed && !y.cancelled && this.activeCameraSettledRender === y && !(t != null && t.aborted);
|
|
2987
3005
|
this.debounceUpdateCameraId = setTimeout(async () => {
|
|
2988
3006
|
var T;
|
|
2989
3007
|
this.debounceUpdateCameraId = void 0;
|
|
2990
3008
|
try {
|
|
2991
|
-
if (!
|
|
3009
|
+
if (!v()) return;
|
|
2992
3010
|
const C = [];
|
|
2993
3011
|
for (const E of this.debounceUpdateCache.values()) {
|
|
2994
|
-
const
|
|
3012
|
+
const k = (T = this.fullLayer) == null ? void 0 : T.getElementsByName(E)[0], O = this.vNodes.get(E);
|
|
2995
3013
|
if (O) {
|
|
2996
3014
|
const { toolsType: B, opt: P } = O;
|
|
2997
|
-
if (
|
|
3015
|
+
if (k || B !== m.Text) {
|
|
2998
3016
|
const F = this.localWork.setFullWork({
|
|
2999
3017
|
toolsType: B,
|
|
3000
3018
|
opt: P,
|
|
@@ -3007,7 +3025,7 @@ class je {
|
|
|
3007
3025
|
isFullWork: !0,
|
|
3008
3026
|
replaceId: E,
|
|
3009
3027
|
boxRect: this.getSceneRect(),
|
|
3010
|
-
isActive:
|
|
3028
|
+
isActive: v
|
|
3011
3029
|
})
|
|
3012
3030
|
);
|
|
3013
3031
|
else if (P.eraserlines && P.eraserlines.length > 0 || P.eraserFaces) {
|
|
@@ -3024,7 +3042,7 @@ class je {
|
|
|
3024
3042
|
}
|
|
3025
3043
|
this.debounceUpdateCache.delete(E);
|
|
3026
3044
|
}
|
|
3027
|
-
if (await Promise.all(C), !
|
|
3045
|
+
if (await Promise.all(C), !v()) return;
|
|
3028
3046
|
this.vNodes.updateLowLevelNodesRect(), this.vNodes.clearHighLevelIds();
|
|
3029
3047
|
const L = [
|
|
3030
3048
|
this.fullLayer.parent.prepareRender,
|
|
@@ -3037,7 +3055,7 @@ class je {
|
|
|
3037
3055
|
this.topLayer.parent,
|
|
3038
3056
|
this.localLayer.parent,
|
|
3039
3057
|
this.serviceLayer.parent
|
|
3040
|
-
], await Promise.all(L), y.renderLayers = void 0, !
|
|
3058
|
+
], await Promise.all(L), y.renderLayers = void 0, !v()) return;
|
|
3041
3059
|
const A = y.cameraTaskId;
|
|
3042
3060
|
G(A) && this.opt.post({
|
|
3043
3061
|
viewId: this.viewId,
|
|
@@ -3045,7 +3063,7 @@ class je {
|
|
|
3045
3063
|
cameraSettledTaskId: A
|
|
3046
3064
|
});
|
|
3047
3065
|
} catch (C) {
|
|
3048
|
-
if (!
|
|
3066
|
+
if (!v()) return;
|
|
3049
3067
|
const L = {
|
|
3050
3068
|
code: "RENDERER_BUSINESS_ERROR",
|
|
3051
3069
|
business: "updateCamera",
|
|
@@ -3087,8 +3105,8 @@ class je {
|
|
|
3087
3105
|
"prepare-render"
|
|
3088
3106
|
)) {
|
|
3089
3107
|
W.filter(
|
|
3090
|
-
(
|
|
3091
|
-
).forEach((
|
|
3108
|
+
(v) => v.cancelPendingRender()
|
|
3109
|
+
).forEach((v) => v.render()), g.catch(() => {
|
|
3092
3110
|
});
|
|
3093
3111
|
return;
|
|
3094
3112
|
}
|
|
@@ -3382,17 +3400,17 @@ class Je {
|
|
|
3382
3400
|
const w = this.imageResolveMap.get(p);
|
|
3383
3401
|
if (w)
|
|
3384
3402
|
return await w.promise, this.getCachedImages(p);
|
|
3385
|
-
let
|
|
3403
|
+
let S;
|
|
3386
3404
|
const I = new Promise((g) => {
|
|
3387
|
-
|
|
3405
|
+
S = g;
|
|
3388
3406
|
}), W = {
|
|
3389
|
-
resolve:
|
|
3407
|
+
resolve: S,
|
|
3390
3408
|
timer: void 0,
|
|
3391
3409
|
requestId: i,
|
|
3392
3410
|
promise: I
|
|
3393
3411
|
};
|
|
3394
3412
|
return W.timer = setTimeout(() => {
|
|
3395
|
-
this.imageResolveMap.get(p) === W &&
|
|
3413
|
+
this.imageResolveMap.get(p) === W && S(p);
|
|
3396
3414
|
}, 5e3), this.imageResolveMap.set(p, W), this.opt.post({
|
|
3397
3415
|
viewId: this.viewId,
|
|
3398
3416
|
viewGeneration: this.viewGeneration,
|
|
@@ -3894,17 +3912,17 @@ class lt {
|
|
|
3894
3912
|
if (o === h.Init) {
|
|
3895
3913
|
const g = i.viewGeneration ?? (this.viewGenerationById.get(a) || 0) + 1;
|
|
3896
3914
|
await this.enqueueViewTask(a, async () => {
|
|
3897
|
-
var E,
|
|
3915
|
+
var E, k, O;
|
|
3898
3916
|
const y = this.viewGenerationById.get(a);
|
|
3899
3917
|
if (y !== void 0 && g < y)
|
|
3900
3918
|
return;
|
|
3901
3919
|
this.viewGenerationById.set(a, g);
|
|
3902
|
-
const
|
|
3920
|
+
const v = i.viewOwner || `${a}:${g}:${++this.ownerSequence}`, T = (E = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : E.displayer, C = T == null ? void 0 : T.canvasContainerRef.current;
|
|
3903
3921
|
if (!T || !C || !l || !p) {
|
|
3904
3922
|
this.viewOwnerById.delete(a);
|
|
3905
3923
|
return;
|
|
3906
3924
|
}
|
|
3907
|
-
this.viewOwnerById.set(a,
|
|
3925
|
+
this.viewOwnerById.set(a, v);
|
|
3908
3926
|
const L = this.mainThreadMap.get(a);
|
|
3909
3927
|
L == null || L.destroy();
|
|
3910
3928
|
const A = this.createMainThread(a, {
|
|
@@ -3913,14 +3931,14 @@ class lt {
|
|
|
3913
3931
|
layerOpt: l,
|
|
3914
3932
|
master: this.master,
|
|
3915
3933
|
canvasOpt: p,
|
|
3916
|
-
viewOwner:
|
|
3934
|
+
viewOwner: v,
|
|
3917
3935
|
viewGeneration: g,
|
|
3918
|
-
mainThreadRenderMode: ((O = (
|
|
3936
|
+
mainThreadRenderMode: ((O = (k = this.master.control) == null ? void 0 : k.renderingCompatibilityDecision) == null ? void 0 : O.mainThreadRenderMode) ?? "normal",
|
|
3919
3937
|
post: (B) => this.post({
|
|
3920
3938
|
...B,
|
|
3921
3939
|
viewId: B.viewId || a,
|
|
3922
3940
|
viewGeneration: B.viewGeneration ?? g,
|
|
3923
|
-
viewOwner:
|
|
3941
|
+
viewOwner: v
|
|
3924
3942
|
})
|
|
3925
3943
|
});
|
|
3926
3944
|
this.mainThreadMap.set(a, A), A && f && A.setCameraOpt(f), this.post({
|
|
@@ -3936,12 +3954,12 @@ class lt {
|
|
|
3936
3954
|
continue;
|
|
3937
3955
|
}
|
|
3938
3956
|
if (o === h.Snapshot || o === h.BoundingBox) {
|
|
3939
|
-
const g = (t = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : t.displayer, y = (s = this.master.control.viewContainerManager.mainView) == null ? void 0 : s.displayer,
|
|
3940
|
-
if (g &&
|
|
3957
|
+
const g = (t = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : t.displayer, y = (s = this.master.control.viewContainerManager.mainView) == null ? void 0 : s.displayer, v = (r = y == null ? void 0 : y.snapshotContainerRef) == null ? void 0 : r.current;
|
|
3958
|
+
if (g && v && f) {
|
|
3941
3959
|
const T = this.getSnapshotRequestKey(i), C = this.snapshotThreadsByRequest.get(T);
|
|
3942
3960
|
C && this.disposeSnapshotThread(T, C.thread, "replaced");
|
|
3943
3961
|
const L = document.createElement("div");
|
|
3944
|
-
L.style.width = `${f.width}px`, L.style.height = `${f.height}px`,
|
|
3962
|
+
L.style.width = `${f.width}px`, L.style.height = `${f.height}px`, v.append(L);
|
|
3945
3963
|
const A = {
|
|
3946
3964
|
...he.defaultLayerOpt,
|
|
3947
3965
|
offscreen: !1,
|
|
@@ -3951,7 +3969,7 @@ class lt {
|
|
|
3951
3969
|
...he.defaultScreenCanvasOpt,
|
|
3952
3970
|
width: f.width,
|
|
3953
3971
|
height: f.height
|
|
3954
|
-
},
|
|
3972
|
+
}, k = this.createSnapshotThread(a, {
|
|
3955
3973
|
displayer: g,
|
|
3956
3974
|
container: L,
|
|
3957
3975
|
layerOpt: A,
|
|
@@ -3962,14 +3980,14 @@ class lt {
|
|
|
3962
3980
|
viewGeneration: this.viewGenerationById.get(a)
|
|
3963
3981
|
});
|
|
3964
3982
|
this.snapshotThreadsByRequest.set(T, {
|
|
3965
|
-
thread:
|
|
3983
|
+
thread: k,
|
|
3966
3984
|
surface: L
|
|
3967
|
-
}),
|
|
3968
|
-
this.disposeSnapshotThread(T,
|
|
3985
|
+
}), k.on(i).then(() => {
|
|
3986
|
+
this.disposeSnapshotThread(T, k);
|
|
3969
3987
|
}).catch((O) => {
|
|
3970
3988
|
this.master.Logger.error(
|
|
3971
3989
|
`[Appliance]: snapshot render failed; viewId=${a}; error=${O instanceof Error ? O.message : String(O)}`
|
|
3972
|
-
), this.disposeSnapshotThread(T,
|
|
3990
|
+
), this.disposeSnapshotThread(T, k);
|
|
3973
3991
|
});
|
|
3974
3992
|
continue;
|
|
3975
3993
|
}
|
|
@@ -4000,8 +4018,8 @@ class lt {
|
|
|
4000
4018
|
continue;
|
|
4001
4019
|
}
|
|
4002
4020
|
if (o === h.GetImageBitMap) {
|
|
4003
|
-
const g = this.mainThreadMap.get(a), y = this.viewGenerationById.get(a),
|
|
4004
|
-
if (!g || i.viewGeneration !== void 0 && i.viewGeneration !== y || i.viewOwner !== void 0 && i.viewOwner !==
|
|
4021
|
+
const g = this.mainThreadMap.get(a), y = this.viewGenerationById.get(a), v = this.viewOwnerById.get(a);
|
|
4022
|
+
if (!g || i.viewGeneration !== void 0 && i.viewGeneration !== y || i.viewOwner !== void 0 && i.viewOwner !== v || this.mainThreadMap.get(a) !== g) {
|
|
4005
4023
|
this.releaseMessageBitmap(i);
|
|
4006
4024
|
continue;
|
|
4007
4025
|
}
|
|
@@ -4009,12 +4027,12 @@ class lt {
|
|
|
4009
4027
|
continue;
|
|
4010
4028
|
}
|
|
4011
4029
|
if (o === h.TasksQueue && (n != null && n.size)) {
|
|
4012
|
-
const g = n.get(a), y = this.mainThreadMap.get(a),
|
|
4030
|
+
const g = n.get(a), y = this.mainThreadMap.get(a), v = this.viewGenerationById.get(a), T = this.viewOwnerById.get(a);
|
|
4013
4031
|
let C;
|
|
4014
4032
|
if (g && y)
|
|
4015
4033
|
try {
|
|
4016
4034
|
await this.enqueueViewTask(a, async () => {
|
|
4017
|
-
this.viewGenerationById.get(a) !==
|
|
4035
|
+
this.viewGenerationById.get(a) !== v || this.viewOwnerById.get(a) !== T || this.mainThreadMap.get(a) !== y || await y.on(g);
|
|
4018
4036
|
});
|
|
4019
4037
|
} catch (L) {
|
|
4020
4038
|
if (g.msgType !== h.UpdateCamera) throw L;
|
|
@@ -4032,7 +4050,7 @@ class lt {
|
|
|
4032
4050
|
if (C && q(d)) {
|
|
4033
4051
|
this.post({
|
|
4034
4052
|
viewId: a,
|
|
4035
|
-
viewGeneration:
|
|
4053
|
+
viewGeneration: v,
|
|
4036
4054
|
viewOwner: T,
|
|
4037
4055
|
cameraTaskId: d,
|
|
4038
4056
|
cameraTaskStatus: C.code === "RENDERER_BUSINESS_TIMEOUT" ? "timeout" : "failed",
|
|
@@ -4044,26 +4062,26 @@ class lt {
|
|
|
4044
4062
|
workerTasksqueueCount: c,
|
|
4045
4063
|
cameraTaskId: d,
|
|
4046
4064
|
viewId: a,
|
|
4047
|
-
viewGeneration:
|
|
4065
|
+
viewGeneration: v,
|
|
4048
4066
|
viewOwner: T
|
|
4049
4067
|
});
|
|
4050
4068
|
continue;
|
|
4051
4069
|
}
|
|
4052
4070
|
if (a === ce) {
|
|
4053
4071
|
const g = [...this.mainThreadMap.entries()];
|
|
4054
|
-
for (const [y,
|
|
4072
|
+
for (const [y, v] of g) {
|
|
4055
4073
|
const T = this.enqueueViewTask(y, async () => {
|
|
4056
|
-
this.mainThreadMap.get(y) ===
|
|
4074
|
+
this.mainThreadMap.get(y) === v && (o === h.Destroy ? (v.destroy(), this.mainThreadMap.delete(y), this.viewOwnerById.delete(y), this.viewGenerationById.set(
|
|
4057
4075
|
y,
|
|
4058
4076
|
(this.viewGenerationById.get(y) || 0) + 1
|
|
4059
|
-
)) : await
|
|
4077
|
+
)) : await v.on(i));
|
|
4060
4078
|
});
|
|
4061
4079
|
await T, this.cameraRenderQueueByView.get(y) === T && this.cameraRenderQueueByView.delete(y);
|
|
4062
4080
|
}
|
|
4063
4081
|
continue;
|
|
4064
4082
|
}
|
|
4065
|
-
const
|
|
4066
|
-
if (o === h.Destroy && !
|
|
4083
|
+
const S = this.mainThreadMap.get(a);
|
|
4084
|
+
if (o === h.Destroy && !S) {
|
|
4067
4085
|
await this.enqueueViewTask(a, async () => {
|
|
4068
4086
|
this.viewGenerationById.set(
|
|
4069
4087
|
a,
|
|
@@ -4072,12 +4090,12 @@ class lt {
|
|
|
4072
4090
|
});
|
|
4073
4091
|
continue;
|
|
4074
4092
|
}
|
|
4075
|
-
if (!
|
|
4093
|
+
if (!S)
|
|
4076
4094
|
continue;
|
|
4077
4095
|
const I = this.viewGenerationById.get(a), W = this.enqueueViewTask(a, async () => {
|
|
4078
|
-
this.viewGenerationById.get(a) !== I || this.mainThreadMap.get(a) !==
|
|
4096
|
+
this.viewGenerationById.get(a) !== I || this.mainThreadMap.get(a) !== S || await S.on(i);
|
|
4079
4097
|
});
|
|
4080
|
-
o === h.Destroy && (await W, this.mainThreadMap.get(a) ===
|
|
4098
|
+
o === h.Destroy && (await W, this.mainThreadMap.get(a) === S && this.mainThreadMap.delete(a), this.viewOwnerById.delete(a), this.cameraRenderQueueByView.get(a) === W && this.cameraRenderQueueByView.delete(a), this.viewGenerationById.set(
|
|
4081
4099
|
a,
|
|
4082
4100
|
i.viewGeneration ?? (I || 0) + 1
|
|
4083
4101
|
));
|