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