@netless/appliance-plugin 1.1.30 → 1.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/cdn.js +1 -1
- package/cdn/{fullWorker-Bdpfgf.js → fullWorker-BuCr8Z.js} +2 -2
- package/cdn/{subWorker-DBZ80n.js → subWorker-00SXWn.js} +2 -2
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/core/mainThread/subLocalThread.d.ts +2 -1
- package/dist/fullWorker.js +2 -2
- package/dist/{index-GAInlqSm.mjs → index-B9IvzEGP.mjs} +567 -549
- package/dist/{index-DNtpxjD9.mjs → index-BA9yB27Q.mjs} +383 -383
- package/dist/{index-DpO3MYcc.js → index-CcTOfya8.js} +1 -1
- package/dist/{index-DsHBXq5c.mjs → index-DFQ4hkMe.mjs} +1 -1
- package/dist/{index-CgG2pg0-.js → index-DfV03MPS.js} +1 -1
- package/dist/index-DpQJ_LNL.js +1 -0
- package/dist/subWorker.js +2 -2
- package/package.json +1 -1
- package/dist/index-bnjZuIEN.js +0 -1
|
@@ -1142,7 +1142,7 @@ function dg(r) {
|
|
|
1142
1142
|
return lg(r, ug | hg);
|
|
1143
1143
|
}
|
|
1144
1144
|
var gg = dg;
|
|
1145
|
-
const un = /* @__PURE__ */ Pn(gg), vr = "1.1.
|
|
1145
|
+
const un = /* @__PURE__ */ Pn(gg), vr = "1.1.32", fg = "@netless/appliance-plugin", ji = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
|
|
1146
1146
|
if (typeof window < "u") {
|
|
1147
1147
|
let r = window.__netlessUA || "";
|
|
1148
1148
|
r += ` ${fg}@${vr}`, window.__netlessUA = r;
|
|
@@ -1205,7 +1205,7 @@ const Se = {
|
|
|
1205
1205
|
},
|
|
1206
1206
|
markmap: {
|
|
1207
1207
|
enable: !0,
|
|
1208
|
-
timeout:
|
|
1208
|
+
timeout: 1e4,
|
|
1209
1209
|
options: {
|
|
1210
1210
|
autoFit: !0,
|
|
1211
1211
|
duration: 0,
|
|
@@ -1454,8 +1454,8 @@ class tf {
|
|
|
1454
1454
|
workId: n,
|
|
1455
1455
|
msgType: R.UpdateNode
|
|
1456
1456
|
}).forEach((v) => {
|
|
1457
|
-
var
|
|
1458
|
-
(
|
|
1457
|
+
var A;
|
|
1458
|
+
(A = this.control.worker) == null || A.taskBatchData.delete(v);
|
|
1459
1459
|
}), (S = this.control.worker) == null || S.taskBatchData.add({
|
|
1460
1460
|
workId: n,
|
|
1461
1461
|
msgType: R.UpdateNode,
|
|
@@ -2584,8 +2584,8 @@ const Re = class Re extends YM {
|
|
|
2584
2584
|
const k = this.isLocalId(i.toString()) ? this.transformKey(i) : i, v = this.storage[y] && this.storage[y][d] && this.storage[y][d][k] || void 0;
|
|
2585
2585
|
if (v != null && v.ops || (v == null ? void 0 : v.type) === R.FullWork)
|
|
2586
2586
|
return;
|
|
2587
|
-
const
|
|
2588
|
-
i && P && E &&
|
|
2587
|
+
const A = s ? ((v == null ? void 0 : v.op) || []).slice(0, s).concat(u) : u || (v == null ? void 0 : v.op), P = c || (v == null ? void 0 : v.toolsType), E = a || (v == null ? void 0 : v.opt), O = h || (v == null ? void 0 : v.updateNodeOpt);
|
|
2588
|
+
i && P && E && A && (this.control.renderControl.isUsePageAuth(y) && this.control.renderControl.addRenderPageElementId({
|
|
2589
2589
|
viewId: y,
|
|
2590
2590
|
scenePath: d,
|
|
2591
2591
|
elementId: k.toString()
|
|
@@ -2598,7 +2598,7 @@ const Re = class Re extends YM {
|
|
|
2598
2598
|
updateNodeOpt: O,
|
|
2599
2599
|
toolsType: P,
|
|
2600
2600
|
opt: E,
|
|
2601
|
-
op:
|
|
2601
|
+
op: A,
|
|
2602
2602
|
index: s
|
|
2603
2603
|
},
|
|
2604
2604
|
{ isSync: M, viewId: y, scenePath: d }
|
|
@@ -2607,7 +2607,7 @@ const Re = class Re extends YM {
|
|
|
2607
2607
|
break;
|
|
2608
2608
|
case R.FullWork:
|
|
2609
2609
|
if (d && i) {
|
|
2610
|
-
const k = this.isLocalId(i.toString()) ? this.transformKey(i) : i, v = this.storage[y] && this.storage[y][d] && this.storage[y][d][k] || void 0,
|
|
2610
|
+
const k = this.isLocalId(i.toString()) ? this.transformKey(i) : i, v = this.storage[y] && this.storage[y][d] && this.storage[y][d][k] || void 0, A = h || (v == null ? void 0 : v.updateNodeOpt), P = c || (v == null ? void 0 : v.toolsType), E = a || (v == null ? void 0 : v.opt), O = o || (v == null ? void 0 : v.ops);
|
|
2611
2611
|
P && E && (this.control.renderControl.isUsePageAuth(y) && this.control.renderControl.addRenderPageElementId({
|
|
2612
2612
|
viewId: y,
|
|
2613
2613
|
scenePath: d,
|
|
@@ -2616,7 +2616,7 @@ const Re = class Re extends YM {
|
|
|
2616
2616
|
k.toString(),
|
|
2617
2617
|
{
|
|
2618
2618
|
type: R.FullWork,
|
|
2619
|
-
updateNodeOpt:
|
|
2619
|
+
updateNodeOpt: A,
|
|
2620
2620
|
workId: k,
|
|
2621
2621
|
toolsType: P,
|
|
2622
2622
|
opt: E,
|
|
@@ -2625,8 +2625,8 @@ const Re = class Re extends YM {
|
|
|
2625
2625
|
{ isSync: M, viewId: y, scenePath: d }
|
|
2626
2626
|
), ot(
|
|
2627
2627
|
() => {
|
|
2628
|
-
var
|
|
2629
|
-
(
|
|
2628
|
+
var z, L;
|
|
2629
|
+
(z = this.control.pluginManager) == null || z.dispatchPluginEvent(
|
|
2630
2630
|
"syncStorage",
|
|
2631
2631
|
y,
|
|
2632
2632
|
d
|
|
@@ -2669,8 +2669,8 @@ const Re = class Re extends YM {
|
|
|
2669
2669
|
scenePath: d
|
|
2670
2670
|
}), this.control.isUseSimple || ot(
|
|
2671
2671
|
() => {
|
|
2672
|
-
var
|
|
2673
|
-
(
|
|
2672
|
+
var A;
|
|
2673
|
+
(A = this.control.miniMapManager) == null || A.updateMiniMapCamera(y);
|
|
2674
2674
|
},
|
|
2675
2675
|
this.syncInterval,
|
|
2676
2676
|
this.control.hasPolyfillMethod("requestIdleCallback")
|
|
@@ -2927,7 +2927,7 @@ const Re = class Re extends YM {
|
|
|
2927
2927
|
return s;
|
|
2928
2928
|
}
|
|
2929
2929
|
dispatchPageAuth(e, t = !0) {
|
|
2930
|
-
var l, h, u, g, M, d, y, w, p, f, N, S, C, k, v,
|
|
2930
|
+
var l, h, u, g, M, d, y, w, p, f, N, S, C, k, v, A, P, E, O, z, L, j, F, X, Y, Q, _, ce, ie, K, H, fe, Je, Xe, ht, tt, Ke, mt;
|
|
2931
2931
|
const { operation: i, viewId: o, scenePath: s, pageId: a, pageData: c } = e;
|
|
2932
2932
|
switch (i) {
|
|
2933
2933
|
case be.addPage: {
|
|
@@ -2977,7 +2977,7 @@ const Re = class Re extends YM {
|
|
|
2977
2977
|
case be.clearPage: {
|
|
2978
2978
|
if (!o || !s || !a)
|
|
2979
2979
|
return;
|
|
2980
|
-
(P = (
|
|
2980
|
+
(P = (A = (v = (k = (C = this.authStorage) == null ? void 0 : C.pageAuth) == null ? void 0 : k[o]) == null ? void 0 : v[s]) == null ? void 0 : A.pages) != null && P[a] && (delete this.authStorage.pageAuth[o][s].pages[a], t && ((E = this.plugin) == null || E.updateAttributes(
|
|
2981
2981
|
[this.authSpace, "pageAuth", o, s, "pages", a],
|
|
2982
2982
|
{}
|
|
2983
2983
|
)));
|
|
@@ -2986,7 +2986,7 @@ const Re = class Re extends YM {
|
|
|
2986
2986
|
case be.addElement: {
|
|
2987
2987
|
if (!o || !s || !a || !(c != null && c.elementId))
|
|
2988
2988
|
return;
|
|
2989
|
-
(F = (j = (L = (
|
|
2989
|
+
(F = (j = (L = (z = (O = this.authStorage) == null ? void 0 : O.pageAuth) == null ? void 0 : z[o]) == null ? void 0 : L[s]) == null ? void 0 : j.pages) != null && F[a] && (this.authStorage.pageAuth[o][s].pages[a][c.elementId] = !0, t && ((X = this.plugin) == null || X.updateAttributes(
|
|
2990
2990
|
[
|
|
2991
2991
|
this.authSpace,
|
|
2992
2992
|
"pageAuth",
|
|
@@ -3038,7 +3038,7 @@ const Re = class Re extends YM {
|
|
|
3038
3038
|
}
|
|
3039
3039
|
}
|
|
3040
3040
|
dispatchRenderAuth(e, t = !0) {
|
|
3041
|
-
var l, h, u, g, M, d, y, w, p, f, N, S, C, k, v,
|
|
3041
|
+
var l, h, u, g, M, d, y, w, p, f, N, S, C, k, v, A, P, E, O, z;
|
|
3042
3042
|
const { operation: i, viewId: o, uid: s, renderData: a, isClear: c } = e;
|
|
3043
3043
|
if (o)
|
|
3044
3044
|
switch (i) {
|
|
@@ -3118,7 +3118,7 @@ const Re = class Re extends YM {
|
|
|
3118
3118
|
) : L.length === 2 ? (k = this.plugin) == null || k.updateAttributes(L, se(j)) : L.length === 3 ? (v = this.plugin) == null || v.updateAttributes(
|
|
3119
3119
|
L,
|
|
3120
3120
|
se(j[o])
|
|
3121
|
-
) : (
|
|
3121
|
+
) : (A = this.plugin) == null || A.updateAttributes(L, !0));
|
|
3122
3122
|
return;
|
|
3123
3123
|
}
|
|
3124
3124
|
case et.setClear: {
|
|
@@ -3133,7 +3133,7 @@ const Re = class Re extends YM {
|
|
|
3133
3133
|
) : L.length === 2 ? (E = this.plugin) == null || E.updateAttributes(L, se(j)) : L.length === 3 ? (O = this.plugin) == null || O.updateAttributes(
|
|
3134
3134
|
L,
|
|
3135
3135
|
se(j[o])
|
|
3136
|
-
) : (
|
|
3136
|
+
) : (z = this.plugin) == null || z.updateAttributes(L, c ? !0 : void 0));
|
|
3137
3137
|
return;
|
|
3138
3138
|
}
|
|
3139
3139
|
}
|
|
@@ -3735,12 +3735,12 @@ class WM extends Ze {
|
|
|
3735
3735
|
x: M.x - d.x,
|
|
3736
3736
|
y: M.y - d.y
|
|
3737
3737
|
});
|
|
3738
|
-
for (const
|
|
3738
|
+
for (const A of s) {
|
|
3739
3739
|
const P = (v = (k = this.serviceColloctor) == null ? void 0 : k.getStorageData(
|
|
3740
3740
|
o.id,
|
|
3741
3741
|
o.focusScenePath
|
|
3742
|
-
)) == null ? void 0 : v[
|
|
3743
|
-
P && a.set(
|
|
3742
|
+
)) == null ? void 0 : v[A];
|
|
3743
|
+
P && a.set(A, P);
|
|
3744
3744
|
}
|
|
3745
3745
|
return {
|
|
3746
3746
|
copyStores: a,
|
|
@@ -3757,7 +3757,7 @@ class WM extends Ze {
|
|
|
3757
3757
|
l.y + g
|
|
3758
3758
|
] || [g / u, g / u], d = [], y = [];
|
|
3759
3759
|
for (const [S, C] of t.entries()) {
|
|
3760
|
-
const v = (this.serviceColloctor.isLocalId(S) ? S : this.serviceColloctor.getLocalId(S.toString())) + "-" + a,
|
|
3760
|
+
const v = (this.serviceColloctor.isLocalId(S) ? S : this.serviceColloctor.getLocalId(S.toString())) + "-" + a, A = { useAnimation: !1 };
|
|
3761
3761
|
if (C.toolsType === T.Text && C.opt) {
|
|
3762
3762
|
const P = C.opt;
|
|
3763
3763
|
if (P && P.boxPoint && P.text) {
|
|
@@ -3795,8 +3795,8 @@ class WM extends Ze {
|
|
|
3795
3795
|
}
|
|
3796
3796
|
if ((C.toolsType === T.Image || C.toolsType === T.BackgroundSVG) && (C.opt.uuid = v, C.opt.centerX = C.opt.centerX + M[0], C.opt.centerY = C.opt.centerY + M[1]), C.ops) {
|
|
3797
3797
|
const P = $n(C.ops).map(
|
|
3798
|
-
(O,
|
|
3799
|
-
const L =
|
|
3798
|
+
(O, z) => {
|
|
3799
|
+
const L = z % 3;
|
|
3800
3800
|
return L === 0 ? O + M[0] : L === 1 ? O + M[1] : O;
|
|
3801
3801
|
}
|
|
3802
3802
|
), E = _t(P);
|
|
@@ -3806,13 +3806,13 @@ class WM extends Ze {
|
|
|
3806
3806
|
for (const P of (N = C == null ? void 0 : C.opt) == null ? void 0 : N.eraserlines) {
|
|
3807
3807
|
const { op: E } = P;
|
|
3808
3808
|
for (let O = 0; O < E.length; O++) {
|
|
3809
|
-
const
|
|
3810
|
-
P.op[O] =
|
|
3809
|
+
const z = E[O].map((L, j) => j % 2 ? L + M[1] : L + M[0]);
|
|
3810
|
+
P.op[O] = z;
|
|
3811
3811
|
}
|
|
3812
3812
|
}
|
|
3813
3813
|
y.push({
|
|
3814
3814
|
...C,
|
|
3815
|
-
updateNodeOpt:
|
|
3815
|
+
updateNodeOpt: A,
|
|
3816
3816
|
type: R.FullWork,
|
|
3817
3817
|
workId: v,
|
|
3818
3818
|
viewId: o,
|
|
@@ -3820,7 +3820,7 @@ class WM extends Ze {
|
|
|
3820
3820
|
}), d.push([
|
|
3821
3821
|
{
|
|
3822
3822
|
...C,
|
|
3823
|
-
updateNodeOpt:
|
|
3823
|
+
updateNodeOpt: A,
|
|
3824
3824
|
workId: v,
|
|
3825
3825
|
msgType: R.FullWork,
|
|
3826
3826
|
dataType: q.Local,
|
|
@@ -3885,27 +3885,27 @@ class FM extends Ze {
|
|
|
3885
3885
|
if (!S)
|
|
3886
3886
|
continue;
|
|
3887
3887
|
const C = S.toString(), k = this.serviceColloctor.isLocalId(C), v = k ? this.serviceColloctor.transformKey(S) : C;
|
|
3888
|
-
let
|
|
3889
|
-
!k && this.serviceColloctor.isOwn(
|
|
3888
|
+
let A = C;
|
|
3889
|
+
!k && this.serviceColloctor.isOwn(A) && (A = this.serviceColloctor.getLocalId(A));
|
|
3890
3890
|
const P = (N = (f = y == null ? void 0 : y[c]) == null ? void 0 : f[M]) == null ? void 0 : N[v];
|
|
3891
3891
|
if (P) {
|
|
3892
3892
|
const E = P.updateNodeOpt || {};
|
|
3893
3893
|
if (s || a) {
|
|
3894
3894
|
if (s) {
|
|
3895
3895
|
E.fontColor = s;
|
|
3896
|
-
const [
|
|
3897
|
-
p.textColor = [
|
|
3896
|
+
const [z, L, j, F] = Wt(s);
|
|
3897
|
+
p.textColor = [z, L, j], p.textOpacity = F;
|
|
3898
3898
|
}
|
|
3899
3899
|
if (a)
|
|
3900
3900
|
if (E.fontBgColor = Ft(a) ? "transparent" : a, Ft(a))
|
|
3901
3901
|
p.textBgColor = void 0, p.textBgOpacity = void 0;
|
|
3902
3902
|
else {
|
|
3903
|
-
const [
|
|
3904
|
-
p.textBgColor = [
|
|
3903
|
+
const [z, L, j, F] = Wt(a);
|
|
3904
|
+
p.textBgColor = [z, L, j], p.textBgOpacity = F;
|
|
3905
3905
|
}
|
|
3906
3906
|
if (P.toolsType === T.Text && P.opt && l !== x.Start) {
|
|
3907
3907
|
this.setTextColor(
|
|
3908
|
-
|
|
3908
|
+
A,
|
|
3909
3909
|
un(P),
|
|
3910
3910
|
E,
|
|
3911
3911
|
c
|
|
@@ -3915,19 +3915,19 @@ class FM extends Ze {
|
|
|
3915
3915
|
}
|
|
3916
3916
|
if (i) {
|
|
3917
3917
|
E.strokeColor = i;
|
|
3918
|
-
const [
|
|
3919
|
-
p.strokeColor = [
|
|
3918
|
+
const [z, L, j, F] = Wt(i);
|
|
3919
|
+
p.strokeColor = [z, L, j], p.strokeOpacity = F;
|
|
3920
3920
|
}
|
|
3921
3921
|
if (o)
|
|
3922
3922
|
if (E.fillColor = Ft(o) ? "transparent" : o, Ft(o))
|
|
3923
3923
|
p.fillColor = void 0, p.fillOpacity = void 0;
|
|
3924
3924
|
else {
|
|
3925
|
-
const [
|
|
3926
|
-
p.fillColor = [
|
|
3925
|
+
const [z, L, j, F] = Wt(o);
|
|
3926
|
+
p.fillColor = [z, L, j], p.fillOpacity = F;
|
|
3927
3927
|
}
|
|
3928
3928
|
h && (E.thickness = h, p.strokeWidth = h), u && (E.strokeType = u, p.strokeType = u);
|
|
3929
3929
|
const O = {
|
|
3930
|
-
workId:
|
|
3930
|
+
workId: A,
|
|
3931
3931
|
msgType: R.UpdateNode,
|
|
3932
3932
|
dataType: q.Local,
|
|
3933
3933
|
updateNodeOpt: E,
|
|
@@ -3942,7 +3942,7 @@ class FM extends Ze {
|
|
|
3942
3942
|
w.push([
|
|
3943
3943
|
O,
|
|
3944
3944
|
{
|
|
3945
|
-
workId:
|
|
3945
|
+
workId: A,
|
|
3946
3946
|
msgType: R.UpdateNode,
|
|
3947
3947
|
emitEventType: this.emitEventType
|
|
3948
3948
|
}
|
|
@@ -4054,8 +4054,8 @@ class VM extends Ze {
|
|
|
4054
4054
|
if (C && S === $) {
|
|
4055
4055
|
if (C.selectIds) {
|
|
4056
4056
|
for (const E of C.selectIds) {
|
|
4057
|
-
const O = M(E, this.serviceColloctor),
|
|
4058
|
-
|
|
4057
|
+
const O = M(E, this.serviceColloctor), z = (y = (d = l == null ? void 0 : l[o]) == null ? void 0 : d[a]) == null ? void 0 : y[O];
|
|
4058
|
+
z && z.toolsType === T.BackgroundSVG ? (g.push(E), g.sort((L, j) => {
|
|
4059
4059
|
var Y, Q, _, ce;
|
|
4060
4060
|
const F = ((Q = (Y = l[M(L, this.serviceColloctor)]) == null ? void 0 : Y.opt) == null ? void 0 : Q.zIndex) || 0, X = ((ce = (_ = l[M(L, this.serviceColloctor)]) == null ? void 0 : _.opt) == null ? void 0 : ce.zIndex) || 0;
|
|
4061
4061
|
return F > X ? 1 : L < j ? -1 : 0;
|
|
@@ -4065,13 +4065,13 @@ class VM extends Ze {
|
|
|
4065
4065
|
return F > X ? 1 : L < j ? -1 : 0;
|
|
4066
4066
|
}));
|
|
4067
4067
|
}
|
|
4068
|
-
const
|
|
4069
|
-
|
|
4068
|
+
const A = C.updateNodeOpt || {};
|
|
4069
|
+
A.zIndexLayer = i;
|
|
4070
4070
|
const P = {
|
|
4071
4071
|
workId: w,
|
|
4072
4072
|
msgType: R.UpdateNode,
|
|
4073
4073
|
dataType: q.Local,
|
|
4074
|
-
updateNodeOpt:
|
|
4074
|
+
updateNodeOpt: A,
|
|
4075
4075
|
emitEventType: this.emitEventType,
|
|
4076
4076
|
willRefreshSelector: !0,
|
|
4077
4077
|
willSyncService: !0,
|
|
@@ -4080,15 +4080,15 @@ class VM extends Ze {
|
|
|
4080
4080
|
u.length && (i === Lt.Top ? (this.addMaxLayer(o), k = this.getMaxZIndex(o)) : (this.addMinLayer(o), k = this.getMinZIndex(o)), u.forEach((E) => {
|
|
4081
4081
|
var j, F, X, Y, Q;
|
|
4082
4082
|
const O = (j = this.serviceColloctor) == null ? void 0 : j.isLocalId(E);
|
|
4083
|
-
let
|
|
4084
|
-
const L = (Y = (X = l == null ? void 0 : l[o]) == null ? void 0 : X[a]) == null ? void 0 : Y[
|
|
4085
|
-
L && (!O && ((Q = this.serviceColloctor) != null && Q.isOwn(
|
|
4083
|
+
let z = O && ((F = this.serviceColloctor) == null ? void 0 : F.transformKey(E)) || E;
|
|
4084
|
+
const L = (Y = (X = l == null ? void 0 : l[o]) == null ? void 0 : X[a]) == null ? void 0 : Y[z];
|
|
4085
|
+
L && (!O && ((Q = this.serviceColloctor) != null && Q.isOwn(z)) && (z = this.serviceColloctor.getLocalId(z)), A.zIndex = k, L != null && L.opt && (L.opt.zIndex = k));
|
|
4086
4086
|
})), g.length && (i === Lt.Top ? (this.addMaxLayerForBackgroundSVG(o), v = this.getMaxZIndexForBackgroundSVG(o)) : (this.addMinLayerForBackgroundSVG(o), v = this.getMinZIndexForBackgroundSVG(o)), g.forEach((E) => {
|
|
4087
4087
|
var j, F, X, Y, Q;
|
|
4088
4088
|
const O = (j = this.serviceColloctor) == null ? void 0 : j.isLocalId(E);
|
|
4089
|
-
let
|
|
4090
|
-
const L = (Y = (X = l == null ? void 0 : l[o]) == null ? void 0 : X[a]) == null ? void 0 : Y[
|
|
4091
|
-
L && (!O && ((Q = this.serviceColloctor) != null && Q.isOwn(
|
|
4089
|
+
let z = O && ((F = this.serviceColloctor) == null ? void 0 : F.transformKey(E)) || E;
|
|
4090
|
+
const L = (Y = (X = l == null ? void 0 : l[o]) == null ? void 0 : X[a]) == null ? void 0 : Y[z];
|
|
4091
|
+
L && (!O && ((Q = this.serviceColloctor) != null && Q.isOwn(z)) && (z = this.serviceColloctor.getLocalId(z)), A.zIndexForBackgroundSVG = v, L != null && L.opt && (L.opt.zIndex = v));
|
|
4092
4092
|
})), P.willSerializeData = !0, h.push([
|
|
4093
4093
|
P,
|
|
4094
4094
|
{
|
|
@@ -4142,16 +4142,16 @@ class QM extends Ze {
|
|
|
4142
4142
|
a
|
|
4143
4143
|
);
|
|
4144
4144
|
if (s === x.Start && (this.cachePosition = v), this.cachePosition) {
|
|
4145
|
-
const
|
|
4146
|
-
|
|
4145
|
+
const A = k.updateNodeOpt || {};
|
|
4146
|
+
A.translate = [
|
|
4147
4147
|
v[0] - this.cachePosition[0],
|
|
4148
4148
|
v[1] - this.cachePosition[1]
|
|
4149
|
-
],
|
|
4149
|
+
], A.workState = s, this.control.cursor.isEnableCursor ? A.useAnimation = !1 : (A.uid = this.serviceColloctor.uid, s === x.Start ? A.useAnimation = !1 : s === x.Done && (A.useAnimation = !0));
|
|
4150
4150
|
const P = {
|
|
4151
4151
|
workId: p,
|
|
4152
4152
|
msgType: R.UpdateNode,
|
|
4153
4153
|
dataType: q.Local,
|
|
4154
|
-
updateNodeOpt:
|
|
4154
|
+
updateNodeOpt: A,
|
|
4155
4155
|
emitEventType: this.emitEventType,
|
|
4156
4156
|
willSyncService: !0,
|
|
4157
4157
|
textUpdateForWoker: !0,
|
|
@@ -4242,7 +4242,7 @@ class ZM extends Ze {
|
|
|
4242
4242
|
return { key: e, textInfo: o };
|
|
4243
4243
|
}
|
|
4244
4244
|
async collect(e, t) {
|
|
4245
|
-
var f, N, S, C, k, v,
|
|
4245
|
+
var f, N, S, C, k, v, A;
|
|
4246
4246
|
if (!this.serviceColloctor || !this.mainEngine)
|
|
4247
4247
|
return;
|
|
4248
4248
|
const {
|
|
@@ -4268,10 +4268,10 @@ class ZM extends Ze {
|
|
|
4268
4268
|
const P = d.pop();
|
|
4269
4269
|
if (!P)
|
|
4270
4270
|
continue;
|
|
4271
|
-
const E = P.toString(), O = this.serviceColloctor.isLocalId(E),
|
|
4271
|
+
const E = P.toString(), O = this.serviceColloctor.isLocalId(E), z = O && this.serviceColloctor.transformKey(P) || E;
|
|
4272
4272
|
let L = E;
|
|
4273
4273
|
!O && this.serviceColloctor.isOwn(L) && (L = this.serviceColloctor.getLocalId(L));
|
|
4274
|
-
const j = (S = (N = y == null ? void 0 : y[s]) == null ? void 0 : N[M]) == null ? void 0 : S[
|
|
4274
|
+
const j = (S = (N = y == null ? void 0 : y[s]) == null ? void 0 : N[M]) == null ? void 0 : S[z];
|
|
4275
4275
|
if (j && L === $ && j.selectIds) {
|
|
4276
4276
|
const F = j.updateNodeOpt || {};
|
|
4277
4277
|
if (F.dir = l, F.originPoint = a, F.scenePoint = c, F.workState = o, F.scale = h, F.translate = u, o === x.Start) {
|
|
@@ -4287,7 +4287,7 @@ class ZM extends Ze {
|
|
|
4287
4287
|
if (this.targetText.size && o !== x.Start && h) {
|
|
4288
4288
|
const Y = [];
|
|
4289
4289
|
for (const [_, ce] of this.targetText.entries()) {
|
|
4290
|
-
const { opt: ie } = ce, K = Math.floor(ie.fontSize * h[0]), H = this.cacheTextInfo.get(_), fe = !H && ie.fontSize !== K || H && H.fontSize !== K || !1, Je = (
|
|
4290
|
+
const { opt: ie } = ce, K = Math.floor(ie.fontSize * h[0]), H = this.cacheTextInfo.get(_), fe = !H && ie.fontSize !== K || H && H.fontSize !== K || !1, Je = (A = this.control.textEditorManager.get(_)) == null ? void 0 : A.opt;
|
|
4291
4291
|
if (fe && Je && ie.boxSize && ie.boxPoint) {
|
|
4292
4292
|
const Xe = this.setTextStyle(
|
|
4293
4293
|
_,
|
|
@@ -4361,10 +4361,10 @@ class $M extends Ze {
|
|
|
4361
4361
|
const C = h.pop();
|
|
4362
4362
|
if (!C)
|
|
4363
4363
|
continue;
|
|
4364
|
-
const k = C.toString(), v = this.serviceColloctor.isLocalId(k),
|
|
4364
|
+
const k = C.toString(), v = this.serviceColloctor.isLocalId(k), A = v && this.serviceColloctor.transformKey(C) || k;
|
|
4365
4365
|
let P = k;
|
|
4366
4366
|
!v && this.serviceColloctor.isOwn(P) && (P = this.serviceColloctor.getLocalId(P));
|
|
4367
|
-
const E = (w = (y = u == null ? void 0 : u[a]) == null ? void 0 : y[l]) == null ? void 0 : w[
|
|
4367
|
+
const E = (w = (y = u == null ? void 0 : u[a]) == null ? void 0 : y[l]) == null ? void 0 : w[A];
|
|
4368
4368
|
if (E && P === $) {
|
|
4369
4369
|
if (((p = E.selectIds) == null ? void 0 : p.length) === 1) {
|
|
4370
4370
|
const O = E.selectIds[0];
|
|
@@ -4372,13 +4372,13 @@ class $M extends Ze {
|
|
|
4372
4372
|
const F = ((f = this.serviceColloctor) == null ? void 0 : f.isLocalId(O)) && ((N = this.serviceColloctor) == null ? void 0 : N.transformKey(O)) || O, X = u[a][l][F];
|
|
4373
4373
|
this.cacheOriginRotate = ((S = X == null ? void 0 : X.opt) == null ? void 0 : S.rotate) || 0;
|
|
4374
4374
|
}
|
|
4375
|
-
const
|
|
4376
|
-
|
|
4375
|
+
const z = E.updateNodeOpt || {};
|
|
4376
|
+
z.angle = (o + this.cacheOriginRotate) % 360, z.workState = s, this.control.cursor.isEnableCursor ? z.useAnimation = !1 : (z.uid = this.serviceColloctor.uid, s === x.Start ? z.useAnimation = !1 : s === x.Done && (z.useAnimation = !0));
|
|
4377
4377
|
const L = {
|
|
4378
4378
|
workId: C,
|
|
4379
4379
|
msgType: R.UpdateNode,
|
|
4380
4380
|
dataType: q.Local,
|
|
4381
|
-
updateNodeOpt:
|
|
4381
|
+
updateNodeOpt: z,
|
|
4382
4382
|
emitEventType: this.emitEventType,
|
|
4383
4383
|
willRefreshSelector: !1,
|
|
4384
4384
|
willSyncService: !0,
|
|
@@ -4454,18 +4454,18 @@ class JM extends Ze {
|
|
|
4454
4454
|
), this.control.textEditorManager.UndoTickerId = y;
|
|
4455
4455
|
const w = [];
|
|
4456
4456
|
for (; g.length; ) {
|
|
4457
|
-
const
|
|
4458
|
-
if (!
|
|
4457
|
+
const A = g.pop();
|
|
4458
|
+
if (!A)
|
|
4459
4459
|
continue;
|
|
4460
|
-
const P =
|
|
4461
|
-
let
|
|
4462
|
-
!E && this.serviceColloctor.isOwn(
|
|
4460
|
+
const P = A.toString(), E = this.serviceColloctor.isLocalId(P), O = E ? this.serviceColloctor.transformKey(A) : P;
|
|
4461
|
+
let z = P;
|
|
4462
|
+
!E && this.serviceColloctor.isOwn(z) && (z = this.serviceColloctor.getLocalId(z));
|
|
4463
4463
|
const L = (N = (f = M == null ? void 0 : M[c]) == null ? void 0 : f[u]) == null ? void 0 : N[O];
|
|
4464
4464
|
if (L) {
|
|
4465
4465
|
const j = L.updateNodeOpt || {};
|
|
4466
4466
|
if (i && (j.bold = i, d.bold = i === "bold"), o && (j.italic = o, d.italic = o === "italic"), We(s) && (j.lineThrough = s, d.lineThrough = s), We(a) && (j.underline = a, d.underline = a), l && (j.fontSize = l, d.textSize = l), L.toolsType === T.Text && L.opt) {
|
|
4467
4467
|
const F = this.setTextStyle(
|
|
4468
|
-
|
|
4468
|
+
z,
|
|
4469
4469
|
se(L),
|
|
4470
4470
|
j,
|
|
4471
4471
|
c
|
|
@@ -4473,7 +4473,7 @@ class JM extends Ze {
|
|
|
4473
4473
|
w.push(F);
|
|
4474
4474
|
continue;
|
|
4475
4475
|
}
|
|
4476
|
-
if (L &&
|
|
4476
|
+
if (L && z === $ && ((S = L.selectIds) != null && S.length))
|
|
4477
4477
|
for (const F of L.selectIds) {
|
|
4478
4478
|
const X = (C = this.serviceColloctor) == null ? void 0 : C.isLocalId(F);
|
|
4479
4479
|
let Y = X && ((k = this.serviceColloctor) == null ? void 0 : k.transformKey(F)) || F;
|
|
@@ -4492,14 +4492,14 @@ class JM extends Ze {
|
|
|
4492
4492
|
}
|
|
4493
4493
|
}
|
|
4494
4494
|
const p = await Promise.all(w);
|
|
4495
|
-
for (const
|
|
4496
|
-
if (
|
|
4497
|
-
const { key: P, textInfo: E } =
|
|
4495
|
+
for (const A of p)
|
|
4496
|
+
if (A) {
|
|
4497
|
+
const { key: P, textInfo: E } = A;
|
|
4498
4498
|
E && (E.canSync = !0, E.canWorker = !0, this.control.textEditorManager.updateForViewEdited(P, E));
|
|
4499
4499
|
}
|
|
4500
4500
|
Object.keys(d).length && (this.timerId && (clearTimeout(this.timerId), this.timerId = void 0), this.timerId = setTimeout(() => {
|
|
4501
|
-
var
|
|
4502
|
-
this.timerId = void 0, (
|
|
4501
|
+
var A;
|
|
4502
|
+
this.timerId = void 0, (A = this.control.room) == null || A.setMemberState(d);
|
|
4503
4503
|
}, 0));
|
|
4504
4504
|
}
|
|
4505
4505
|
}
|
|
@@ -5033,7 +5033,7 @@ class tp extends ep {
|
|
|
5033
5033
|
}
|
|
5034
5034
|
async useBackgroundThread() {
|
|
5035
5035
|
console.info("use background thread");
|
|
5036
|
-
const { BackgroundThreadManagerImpl: e } = await import("./index-
|
|
5036
|
+
const { BackgroundThreadManagerImpl: e } = await import("./index-DFQ4hkMe.mjs");
|
|
5037
5037
|
this.backgroundThreadManager = new e(this);
|
|
5038
5038
|
}
|
|
5039
5039
|
async useMainThread() {
|
|
@@ -5042,7 +5042,7 @@ class tp extends ep {
|
|
|
5042
5042
|
"set font faces in main thread success"
|
|
5043
5043
|
);
|
|
5044
5044
|
});
|
|
5045
|
-
const { MainThreadManagerImpl: e } = await import("./index-
|
|
5045
|
+
const { MainThreadManagerImpl: e } = await import("./index-B9IvzEGP.mjs");
|
|
5046
5046
|
this.mainThread = new e(this);
|
|
5047
5047
|
}
|
|
5048
5048
|
async on() {
|
|
@@ -5268,11 +5268,11 @@ class tp extends ep {
|
|
|
5268
5268
|
op: C,
|
|
5269
5269
|
canTextEdit: k,
|
|
5270
5270
|
points: v,
|
|
5271
|
-
selectorColor:
|
|
5271
|
+
selectorColor: A,
|
|
5272
5272
|
canRotate: P,
|
|
5273
5273
|
scaleType: E,
|
|
5274
5274
|
textOpt: O,
|
|
5275
|
-
toolsType:
|
|
5275
|
+
toolsType: z,
|
|
5276
5276
|
workId: L,
|
|
5277
5277
|
viewId: j,
|
|
5278
5278
|
dataType: F,
|
|
@@ -5307,7 +5307,7 @@ class tp extends ep {
|
|
|
5307
5307
|
switch (l) {
|
|
5308
5308
|
case R.Select: {
|
|
5309
5309
|
const B = h != null && h.length ? { ...g, selectIds: h, canvasHeight: f, canvasWidth: N, points: v } : void 0;
|
|
5310
|
-
B && (u != null && u.strokeColor) && (B.selectorColor = u.strokeColor), B &&
|
|
5310
|
+
B && (u != null && u.strokeColor) && (B.selectorColor = u.strokeColor), B && A && (B.selectorColor = A), B && M && (B.strokeColor = M), B && (u != null && u.fillColor) && (B.fillColor = u.fillColor), B && d && (B.fillColor = d), B && We(P) && (B.canRotate = P), B && E && (B.scaleType = E), B && k && (B.canTextEdit = k), B && O && (B.textOpt = O), B && We(X) && (B.canLock = X), B && We(Y) && (B.isLocked = Y), B && Q && (B.shapeOpt = Q), B && _ && (B.toolsTypes = _), B && ce && (B.thickness = ce), B && ie && (B.strokeType = ie), B && We(K) && (B.useStroke = K), j && this.viewContainerManager.showFloatBar(j, !!B, B), y && ((i = this.collector) == null || i.dispatch({
|
|
5311
5311
|
type: l,
|
|
5312
5312
|
selectIds: h,
|
|
5313
5313
|
opt: u,
|
|
@@ -5362,7 +5362,7 @@ class tp extends ep {
|
|
|
5362
5362
|
});
|
|
5363
5363
|
break;
|
|
5364
5364
|
case R.TextUpdate:
|
|
5365
|
-
if (
|
|
5365
|
+
if (z === T.Text && L && j) {
|
|
5366
5366
|
const B = this.viewContainerManager.transformToOriginPoint(
|
|
5367
5367
|
(u == null ? void 0 : u.boxPoint) || [0, 0],
|
|
5368
5368
|
j
|
|
@@ -5388,7 +5388,7 @@ class tp extends ep {
|
|
|
5388
5388
|
}
|
|
5389
5389
|
break;
|
|
5390
5390
|
case R.GetTextActive:
|
|
5391
|
-
|
|
5391
|
+
z === T.Text && L && j && this.control.textEditorManager.updateTextForWorker(
|
|
5392
5392
|
{
|
|
5393
5393
|
workId: L,
|
|
5394
5394
|
isActive: !0,
|
|
@@ -5467,8 +5467,7 @@ class tp extends ep {
|
|
|
5467
5467
|
viewId: f,
|
|
5468
5468
|
isLockSentEventCursor: N,
|
|
5469
5469
|
nextTasks: S,
|
|
5470
|
-
needUndoTicker: C
|
|
5471
|
-
willSyncService: k
|
|
5470
|
+
needUndoTicker: C
|
|
5472
5471
|
} = a;
|
|
5473
5472
|
if (!f) {
|
|
5474
5473
|
console.error(
|
|
@@ -5477,7 +5476,7 @@ class tp extends ep {
|
|
|
5477
5476
|
);
|
|
5478
5477
|
return;
|
|
5479
5478
|
}
|
|
5480
|
-
const
|
|
5479
|
+
const k = a.scenePath || this.viewContainerManager.getCurScenePath(f);
|
|
5481
5480
|
switch (c) {
|
|
5482
5481
|
case R.None: {
|
|
5483
5482
|
N && ot(
|
|
@@ -5505,7 +5504,7 @@ class tp extends ep {
|
|
|
5505
5504
|
index: u,
|
|
5506
5505
|
isSync: p,
|
|
5507
5506
|
viewId: f,
|
|
5508
|
-
scenePath:
|
|
5507
|
+
scenePath: k,
|
|
5509
5508
|
updateNodeOpt: y
|
|
5510
5509
|
});
|
|
5511
5510
|
break;
|
|
@@ -5520,12 +5519,12 @@ class tp extends ep {
|
|
|
5520
5519
|
toolsType: w,
|
|
5521
5520
|
isSync: p,
|
|
5522
5521
|
viewId: f,
|
|
5523
|
-
scenePath:
|
|
5524
|
-
}),
|
|
5525
|
-
const
|
|
5522
|
+
scenePath: k
|
|
5523
|
+
}), w === T.BackgroundSVG && h && this.markmapIdResolveMap.has(h.toString())) {
|
|
5524
|
+
const v = this.markmapIdResolveMap.get(
|
|
5526
5525
|
h.toString()
|
|
5527
5526
|
);
|
|
5528
|
-
|
|
5527
|
+
v != null && v.timer && (clearTimeout(v.timer), v.timer = void 0), v != null && v.resolve && v.resolve(h.toString()), this.markmapIdResolveMap.delete(h.toString());
|
|
5529
5528
|
}
|
|
5530
5529
|
this.willSelectorWorkId && h && h.toString() === this.willSelectorWorkId && this.control.runEffectWork(() => {
|
|
5531
5530
|
this.setShapeSelectorByWorkId(
|
|
@@ -5545,7 +5544,7 @@ class tp extends ep {
|
|
|
5545
5544
|
op: l,
|
|
5546
5545
|
isSync: p,
|
|
5547
5546
|
viewId: f,
|
|
5548
|
-
scenePath:
|
|
5547
|
+
scenePath: k
|
|
5549
5548
|
});
|
|
5550
5549
|
break;
|
|
5551
5550
|
}
|
|
@@ -5555,7 +5554,7 @@ class tp extends ep {
|
|
|
5555
5554
|
removeIds: g,
|
|
5556
5555
|
isSync: p,
|
|
5557
5556
|
viewId: f,
|
|
5558
|
-
scenePath:
|
|
5557
|
+
scenePath: k
|
|
5559
5558
|
}), this.willSelectorWorkId && (g != null && g.includes(this.willSelectorWorkId)) && (this.willSelectorWorkId = void 0);
|
|
5560
5559
|
break;
|
|
5561
5560
|
}
|
|
@@ -5890,9 +5889,9 @@ class tp extends ep {
|
|
|
5890
5889
|
return;
|
|
5891
5890
|
v.isRunBackgroundThread = !0;
|
|
5892
5891
|
}
|
|
5893
|
-
if (v.dataType = q.Service, v.viewId = s, v.scenePath = a, v.useAnimation = this.smoothSync && ((S = v.updateNodeOpt) == null ? void 0 : S.useAnimation) || !1, v.selectIds && (v.selectIds = v.selectIds.map((
|
|
5892
|
+
if (v.dataType = q.Service, v.viewId = s, v.scenePath = a, v.useAnimation = this.smoothSync && ((S = v.updateNodeOpt) == null ? void 0 : S.useAnimation) || !1, v.selectIds && (v.selectIds = v.selectIds.map((A) => {
|
|
5894
5893
|
var P, E;
|
|
5895
|
-
return (P = this.collector) != null && P.isOwn(
|
|
5894
|
+
return (P = this.collector) != null && P.isOwn(A) ? (E = this.collector) == null ? void 0 : E.getLocalId(A) : A;
|
|
5896
5895
|
})), v && v.toolsType === T.Text || (o == null ? void 0 : o.toolsType) === T.Text) {
|
|
5897
5896
|
this.control.textEditorManager.onServiceDerive(v);
|
|
5898
5897
|
return;
|
|
@@ -6538,46 +6537,47 @@ class tp extends ep {
|
|
|
6538
6537
|
throw new Error("data must be markdown string");
|
|
6539
6538
|
const o = i == null ? void 0 : i.focusScenePath;
|
|
6540
6539
|
if (e && o) {
|
|
6541
|
-
|
|
6540
|
+
const a = t.uuid.toString();
|
|
6541
|
+
if ((s = this.collector) != null && s.hasId(e, o, a))
|
|
6542
6542
|
throw new Error(
|
|
6543
6543
|
"instertBackgroundMarkMap svgInfo.uuid is already exist"
|
|
6544
6544
|
);
|
|
6545
|
-
if (this.markmapIdResolveMap.has(
|
|
6545
|
+
if (this.markmapIdResolveMap.has(a))
|
|
6546
6546
|
throw new Error(
|
|
6547
6547
|
"instertBackgroundMarkMap svgInfo.uuid is already resolving"
|
|
6548
6548
|
);
|
|
6549
|
-
const
|
|
6549
|
+
const c = this.now;
|
|
6550
6550
|
ke.InternalMsgEmitter.emit(
|
|
6551
6551
|
"addUndoTicker",
|
|
6552
|
-
|
|
6552
|
+
c,
|
|
6553
6553
|
e
|
|
6554
6554
|
);
|
|
6555
|
-
const
|
|
6556
|
-
return this.zIndexNodeMethod && (this.zIndexNodeMethod.addMaxLayerForBackgroundSVG(e),
|
|
6555
|
+
const l = { ...t, type: $t.markmap };
|
|
6556
|
+
return this.zIndexNodeMethod && (this.zIndexNodeMethod.addMaxLayerForBackgroundSVG(e), l.zIndex = this.zIndexNodeMethod.getMaxZIndexForBackgroundSVG(e)), this.taskBatchData.add({
|
|
6557
6557
|
msgType: R.FullWork,
|
|
6558
6558
|
dataType: q.Local,
|
|
6559
6559
|
toolsType: T.BackgroundSVG,
|
|
6560
|
-
workId:
|
|
6561
|
-
opt:
|
|
6560
|
+
workId: a,
|
|
6561
|
+
opt: l,
|
|
6562
6562
|
viewId: e,
|
|
6563
6563
|
willRefresh: !0,
|
|
6564
6564
|
willSyncService: !0,
|
|
6565
|
-
needUndoTicker:
|
|
6565
|
+
needUndoTicker: c,
|
|
6566
6566
|
isRunBackgroundThread: !0
|
|
6567
|
-
}), this.runAnimation(), new Promise((
|
|
6568
|
-
this.markmapIdResolveMap.set(
|
|
6569
|
-
resolve:
|
|
6567
|
+
}), this.runAnimation(), new Promise((h, u) => {
|
|
6568
|
+
this.markmapIdResolveMap.set(a, {
|
|
6569
|
+
resolve: h,
|
|
6570
6570
|
timer: setTimeout(() => {
|
|
6571
|
-
const
|
|
6572
|
-
|
|
6571
|
+
const g = this.markmapIdResolveMap.get(a);
|
|
6572
|
+
g != null && g.timer && (g.timer = void 0), u(a);
|
|
6573
6573
|
}, this.control.pluginOptions.extras.markmap.timeout)
|
|
6574
6574
|
});
|
|
6575
|
-
}).then((
|
|
6576
|
-
if (
|
|
6577
|
-
return this.markmapIdResolveMap.delete(
|
|
6578
|
-
}).catch((
|
|
6579
|
-
throw this.markmapIdResolveMap.delete(
|
|
6580
|
-
`instertBackgroundMarkMap svgInfo.uuid ${
|
|
6575
|
+
}).then((h) => {
|
|
6576
|
+
if (h)
|
|
6577
|
+
return this.markmapIdResolveMap.delete(h), h;
|
|
6578
|
+
}).catch((h) => {
|
|
6579
|
+
throw this.markmapIdResolveMap.delete(h), new Error(
|
|
6580
|
+
`instertBackgroundMarkMap svgInfo.uuid ${h} insert timeout`
|
|
6581
6581
|
);
|
|
6582
6582
|
});
|
|
6583
6583
|
}
|
|
@@ -8695,19 +8695,19 @@ const rt = class rt {
|
|
|
8695
8695
|
return !!e.includes(t);
|
|
8696
8696
|
}
|
|
8697
8697
|
refreshPlugin(n, e = !1) {
|
|
8698
|
-
var a, c, l, h, u, g, M, d, y, w, p, f, N, S, C, k, v,
|
|
8698
|
+
var a, c, l, h, u, g, M, d, y, w, p, f, N, S, C, k, v, A, P, E, O;
|
|
8699
8699
|
let t;
|
|
8700
8700
|
const { scenePath: i } = n, o = n.data;
|
|
8701
8701
|
if (!o || !this.collector)
|
|
8702
8702
|
return;
|
|
8703
8703
|
const s = se(this.collector.storage);
|
|
8704
|
-
for (const
|
|
8705
|
-
const { dataType: L, data: j, key: F } =
|
|
8704
|
+
for (const z of o.values()) {
|
|
8705
|
+
const { dataType: L, data: j, key: F } = z, X = this.collector.getStorageData(this.viewId, i), Y = X && Object.keys(X) || [];
|
|
8706
8706
|
switch (L) {
|
|
8707
8707
|
case Ve.Draw:
|
|
8708
|
-
if (t = e ? this.isDrawEffectiveScene(
|
|
8708
|
+
if (t = e ? this.isDrawEffectiveScene(z, Y) : this.isDeleteEffectiveScene(z, Y), t)
|
|
8709
8709
|
if (e && !Array.isArray(j)) {
|
|
8710
|
-
if ((a = j.updateNodeOpt) != null && a.useAnimation && (j.updateNodeOpt.useAnimation = !1), ((c = this.collector) == null ? void 0 : c.getLocalId(F)) === $ && ((l = this.collector) != null && l.isOwn(
|
|
8710
|
+
if ((a = j.updateNodeOpt) != null && a.useAnimation && (j.updateNodeOpt.useAnimation = !1), ((c = this.collector) == null ? void 0 : c.getLocalId(F)) === $ && ((l = this.collector) != null && l.isOwn(z.key))) {
|
|
8711
8711
|
const Q = j.selectIds;
|
|
8712
8712
|
if (Q) {
|
|
8713
8713
|
const _ = Y.filter(
|
|
@@ -8728,13 +8728,13 @@ const rt = class rt {
|
|
|
8728
8728
|
ce && (j.selectIds = Q.filter((ie) => !!ie));
|
|
8729
8729
|
}
|
|
8730
8730
|
}
|
|
8731
|
-
(u = this.collector) == null || u.updateValue(
|
|
8731
|
+
(u = this.collector) == null || u.updateValue(z.key, j, {
|
|
8732
8732
|
viewId: this.viewId,
|
|
8733
8733
|
scenePath: i,
|
|
8734
8734
|
isSync: !0,
|
|
8735
8735
|
storage: s
|
|
8736
8736
|
});
|
|
8737
|
-
} else !e && !Array.isArray(
|
|
8737
|
+
} else !e && !Array.isArray(z.data) && ((g = this.collector) == null || g.updateValue(z.key, void 0, {
|
|
8738
8738
|
viewId: this.viewId,
|
|
8739
8739
|
scenePath: i,
|
|
8740
8740
|
isSync: !0,
|
|
@@ -8742,7 +8742,7 @@ const rt = class rt {
|
|
|
8742
8742
|
}));
|
|
8743
8743
|
break;
|
|
8744
8744
|
case Ve.Delete:
|
|
8745
|
-
if (t = e ? this.isDeleteEffectiveScene(
|
|
8745
|
+
if (t = e ? this.isDeleteEffectiveScene(z, Y) : this.isDrawEffectiveScene(z, Y), t) {
|
|
8746
8746
|
if (e && !Array.isArray(j))
|
|
8747
8747
|
(M = this.collector) == null || M.updateValue(F, void 0, {
|
|
8748
8748
|
viewId: this.viewId,
|
|
@@ -8751,7 +8751,7 @@ const rt = class rt {
|
|
|
8751
8751
|
storage: s
|
|
8752
8752
|
});
|
|
8753
8753
|
else if (!e && !Array.isArray(j)) {
|
|
8754
|
-
if ((d = j.updateNodeOpt) != null && d.useAnimation && (j.updateNodeOpt.useAnimation = !1), ((y = this.collector) == null ? void 0 : y.getLocalId(
|
|
8754
|
+
if ((d = j.updateNodeOpt) != null && d.useAnimation && (j.updateNodeOpt.useAnimation = !1), ((y = this.collector) == null ? void 0 : y.getLocalId(z.key)) === $ && ((w = this.collector) != null && w.isOwn(z.key))) {
|
|
8755
8755
|
const Q = j.selectIds;
|
|
8756
8756
|
if (Q) {
|
|
8757
8757
|
const _ = Y.filter(
|
|
@@ -8772,7 +8772,7 @@ const rt = class rt {
|
|
|
8772
8772
|
ce && (j.selectIds = Q.filter((ie) => !!ie));
|
|
8773
8773
|
}
|
|
8774
8774
|
}
|
|
8775
|
-
(f = this.collector) == null || f.updateValue(
|
|
8775
|
+
(f = this.collector) == null || f.updateValue(z.key, z.data, {
|
|
8776
8776
|
viewId: this.viewId,
|
|
8777
8777
|
scenePath: i,
|
|
8778
8778
|
isSync: !0,
|
|
@@ -8782,10 +8782,10 @@ const rt = class rt {
|
|
|
8782
8782
|
}
|
|
8783
8783
|
break;
|
|
8784
8784
|
case Ve.Update:
|
|
8785
|
-
if (t = e ? this.isNewEffectiveScene(
|
|
8785
|
+
if (t = e ? this.isNewEffectiveScene(z, Y) : this.isOldEffectiveScene(z, Y), t) {
|
|
8786
8786
|
if (e && Array.isArray(j) && j.length === 2) {
|
|
8787
8787
|
const Q = j[1];
|
|
8788
|
-
if ((N = Q.updateNodeOpt) != null && N.useAnimation && (Q.updateNodeOpt.useAnimation = !1), ((S = this.collector) == null ? void 0 : S.getLocalId(
|
|
8788
|
+
if ((N = Q.updateNodeOpt) != null && N.useAnimation && (Q.updateNodeOpt.useAnimation = !1), ((S = this.collector) == null ? void 0 : S.getLocalId(z.key)) === $ && ((C = this.collector) != null && C.isOwn(z.key))) {
|
|
8789
8789
|
const _ = Q.selectIds;
|
|
8790
8790
|
if (_) {
|
|
8791
8791
|
const ce = Y.filter(
|
|
@@ -8814,7 +8814,7 @@ const rt = class rt {
|
|
|
8814
8814
|
});
|
|
8815
8815
|
} else if (!e && Array.isArray(j) && j.length === 2) {
|
|
8816
8816
|
const Q = j[0];
|
|
8817
|
-
if ((
|
|
8817
|
+
if ((A = Q.updateNodeOpt) != null && A.useAnimation && (Q.updateNodeOpt.useAnimation = !1), ((P = this.collector) == null ? void 0 : P.getLocalId(z.key)) === $ && ((E = this.collector) != null && E.isOwn(z.key))) {
|
|
8818
8818
|
const _ = Q.selectIds;
|
|
8819
8819
|
if (_) {
|
|
8820
8820
|
const ce = Y.filter(
|
|
@@ -8835,7 +8835,7 @@ const rt = class rt {
|
|
|
8835
8835
|
ie && (Q.selectIds = _.filter((K) => !!K));
|
|
8836
8836
|
}
|
|
8837
8837
|
}
|
|
8838
|
-
(O = this.collector) == null || O.updateValue(
|
|
8838
|
+
(O = this.collector) == null || O.updateValue(z.key, Q, {
|
|
8839
8839
|
viewId: this.viewId,
|
|
8840
8840
|
scenePath: i,
|
|
8841
8841
|
isSync: !0,
|
|
@@ -9017,18 +9017,18 @@ class Et {
|
|
|
9017
9017
|
imageBitmap: C,
|
|
9018
9018
|
isClear: k,
|
|
9019
9019
|
isUnClose: v,
|
|
9020
|
-
drawCanvas:
|
|
9020
|
+
drawCanvas: A,
|
|
9021
9021
|
clearCanvas: P,
|
|
9022
9022
|
viewId: E
|
|
9023
9023
|
} = N, O = (e = this.getView(E)) == null ? void 0 : e.displayer;
|
|
9024
9024
|
if (O && S) {
|
|
9025
9025
|
const {
|
|
9026
|
-
dpr:
|
|
9026
|
+
dpr: z,
|
|
9027
9027
|
canvasBgRef: L,
|
|
9028
9028
|
canvasFloatRef: j,
|
|
9029
9029
|
canvasServiceFloatRef: F,
|
|
9030
9030
|
canvasTopRef: X
|
|
9031
|
-
} = O, Y = Math.floor(S.w *
|
|
9031
|
+
} = O, Y = Math.floor(S.w * z), Q = Math.floor(S.h * z), _ = S.x * z, ce = S.y * z;
|
|
9032
9032
|
if (k) {
|
|
9033
9033
|
switch (P) {
|
|
9034
9034
|
case nt.TopFloat:
|
|
@@ -9046,8 +9046,8 @@ class Et {
|
|
|
9046
9046
|
}
|
|
9047
9047
|
continue;
|
|
9048
9048
|
}
|
|
9049
|
-
if (
|
|
9050
|
-
switch (
|
|
9049
|
+
if (A && C)
|
|
9050
|
+
switch (A) {
|
|
9051
9051
|
case nt.TopFloat:
|
|
9052
9052
|
(g = (u = X == null ? void 0 : X.current) == null ? void 0 : u.getContext("2d")) == null || g.drawImage(C, 0, 0, Y, Q, _, ce, Y, Q);
|
|
9053
9053
|
break;
|
|
@@ -11117,13 +11117,13 @@ const kp = (r) => {
|
|
|
11117
11117
|
/* none */
|
|
11118
11118
|
), [u, g] = m.useState(), M = xe(null);
|
|
11119
11119
|
ge(() => {
|
|
11120
|
-
var E, O,
|
|
11121
|
-
const v = {},
|
|
11122
|
-
if (i &&
|
|
11120
|
+
var E, O, z, L;
|
|
11121
|
+
const v = {}, A = (a == null ? void 0 : a.w) || ((E = n == null ? void 0 : n.boxSize) == null ? void 0 : E[0]) || 0, P = (a == null ? void 0 : a.h) || ((O = n == null ? void 0 : n.boxSize) == null ? void 0 : O[1]) || 0;
|
|
11122
|
+
if (i && A && P && (c != null && c.width) && (c != null && c.height)) {
|
|
11123
11123
|
if (i.y < 60 ? i.y + P < c.height - 60 ? v.bottom = -120 : i.y + P < c.height ? v.bottom = -58 : i.y > 0 ? v.top = 62 : v.top = -i.y + 62 : v.top = 0, i.x < 0)
|
|
11124
11124
|
v.left = -i.x + 3;
|
|
11125
|
-
else if (i.x + (((
|
|
11126
|
-
const j = c.width - (((L = M.current) == null ? void 0 : L.offsetWidth) ||
|
|
11125
|
+
else if (i.x + (((z = M.current) == null ? void 0 : z.offsetWidth) || A) > c.width) {
|
|
11126
|
+
const j = c.width - (((L = M.current) == null ? void 0 : L.offsetWidth) || A) - i.x;
|
|
11127
11127
|
v.left = j;
|
|
11128
11128
|
}
|
|
11129
11129
|
g(v);
|
|
@@ -11268,7 +11268,7 @@ const kp = (r) => {
|
|
|
11268
11268
|
textAlign: C,
|
|
11269
11269
|
strokeColor: k,
|
|
11270
11270
|
lineHeight: v,
|
|
11271
|
-
bold:
|
|
11271
|
+
bold: A,
|
|
11272
11272
|
italic: P
|
|
11273
11273
|
} = s, E = v || w * 1.2, O = {
|
|
11274
11274
|
fontSize: `${w}px`,
|
|
@@ -11280,7 +11280,7 @@ const kp = (r) => {
|
|
|
11280
11280
|
pointerEvents: "none",
|
|
11281
11281
|
paddingRight: `${P === "italic" ? Math.round(w * 0.3) : 5}px`
|
|
11282
11282
|
};
|
|
11283
|
-
return p && (O.fontFamily = `${p}`), (S || f) && (O.textDecoration = `${S && "line-through" || ""}${f && " underline" || ""}`), C && (O.textAlign = `${C}`),
|
|
11283
|
+
return p && (O.fontFamily = `${p}`), (S || f) && (O.textDecoration = `${S && "line-through" || ""}${f && " underline" || ""}`), C && (O.textAlign = `${C}`), A && (O.fontWeight = `${A}`), P && (O.fontStyle = `${P}`), O;
|
|
11284
11284
|
}, [s]), d = J(() => {
|
|
11285
11285
|
const w = [];
|
|
11286
11286
|
if (s.text) {
|
|
@@ -11406,7 +11406,7 @@ const kp = (r) => {
|
|
|
11406
11406
|
lineThrough: C,
|
|
11407
11407
|
textAlign: k,
|
|
11408
11408
|
lineHeight: v,
|
|
11409
|
-
bold:
|
|
11409
|
+
bold: A,
|
|
11410
11410
|
italic: P
|
|
11411
11411
|
} = g, E = xe(null), O = J(() => {
|
|
11412
11412
|
const V = p, B = v || V * 1.2, Z = {
|
|
@@ -11418,9 +11418,9 @@ const kp = (r) => {
|
|
|
11418
11418
|
paddingRight: `${P === "italic" ? Math.round(V * 0.3) : 5}px`,
|
|
11419
11419
|
borderWidth: 0
|
|
11420
11420
|
};
|
|
11421
|
-
return f && (Z.fontFamily = `${f}`), (C || N) && (Z.textDecoration = `${C && "line-through" || ""} ${N && " underline" || ""}`), k && (Z.textAlign = `${k}`),
|
|
11421
|
+
return f && (Z.fontFamily = `${f}`), (C || N) && (Z.textDecoration = `${C && "line-through" || ""} ${N && " underline" || ""}`), k && (Z.textAlign = `${k}`), A && (Z.fontWeight = `${A}`), P && (Z.fontStyle = `${P}`), Z;
|
|
11422
11422
|
}, [
|
|
11423
|
-
|
|
11423
|
+
A,
|
|
11424
11424
|
S,
|
|
11425
11425
|
f,
|
|
11426
11426
|
p,
|
|
@@ -11430,7 +11430,7 @@ const kp = (r) => {
|
|
|
11430
11430
|
M,
|
|
11431
11431
|
k,
|
|
11432
11432
|
N
|
|
11433
|
-
]),
|
|
11433
|
+
]), z = xe(!1), L = xe(6), j = xe({
|
|
11434
11434
|
fontSize: O.fontSize,
|
|
11435
11435
|
lineHeight: O.lineHeight,
|
|
11436
11436
|
fontStyle: O.fontStyle,
|
|
@@ -11718,7 +11718,7 @@ const kp = (r) => {
|
|
|
11718
11718
|
const V = E.current;
|
|
11719
11719
|
s(() => {
|
|
11720
11720
|
if (V) {
|
|
11721
|
-
if (Je(V), !
|
|
11721
|
+
if (Je(V), !z.current && ce((M || 1) * L.current)) {
|
|
11722
11722
|
const B = window.getSelection();
|
|
11723
11723
|
if (!(B != null && B.rangeCount)) return !1;
|
|
11724
11724
|
const Z = document.createRange(), oe = E.current.lastChild;
|
|
@@ -11729,10 +11729,10 @@ const kp = (r) => {
|
|
|
11729
11729
|
});
|
|
11730
11730
|
}, [s, i, ce, M]);
|
|
11731
11731
|
function ht() {
|
|
11732
|
-
|
|
11732
|
+
z.current = !0, s();
|
|
11733
11733
|
}
|
|
11734
11734
|
function tt() {
|
|
11735
|
-
|
|
11735
|
+
z.current = !1, Xe();
|
|
11736
11736
|
}
|
|
11737
11737
|
function Ke() {
|
|
11738
11738
|
Xe(), s();
|
|
@@ -12115,19 +12115,19 @@ const kp = (r) => {
|
|
|
12115
12115
|
f(!1);
|
|
12116
12116
|
}, k = (E, O) => {
|
|
12117
12117
|
N.current && (clearTimeout(N.current), N.current = 0), c(x.Done), g(!1);
|
|
12118
|
-
const
|
|
12118
|
+
const z = Math.round(
|
|
12119
12119
|
ve.GetAngleByPoints(
|
|
12120
12120
|
M,
|
|
12121
12121
|
y,
|
|
12122
12122
|
new ve(O.x, O.y)
|
|
12123
12123
|
)
|
|
12124
12124
|
) || 0;
|
|
12125
|
-
i(
|
|
12125
|
+
i(z), o(W.None), re.emitMethod(
|
|
12126
12126
|
te.MainEngine,
|
|
12127
12127
|
W.RotateNode,
|
|
12128
12128
|
{
|
|
12129
12129
|
workIds: [$],
|
|
12130
|
-
angle:
|
|
12130
|
+
angle: z,
|
|
12131
12131
|
workState: x.Done,
|
|
12132
12132
|
viewId: s == null ? void 0 : s.viewId
|
|
12133
12133
|
}
|
|
@@ -12153,14 +12153,14 @@ const kp = (r) => {
|
|
|
12153
12153
|
return;
|
|
12154
12154
|
}
|
|
12155
12155
|
N.current && (clearTimeout(N.current), N.current = 0), c(x.Start), g(!0);
|
|
12156
|
-
const
|
|
12156
|
+
const z = Math.round(
|
|
12157
12157
|
ve.GetAngleByPoints(
|
|
12158
12158
|
M,
|
|
12159
12159
|
y,
|
|
12160
12160
|
new ve(O.x, O.y)
|
|
12161
12161
|
)
|
|
12162
12162
|
) || 0;
|
|
12163
|
-
i(
|
|
12163
|
+
i(z), o(W.RotateNode), re.emitMethod(
|
|
12164
12164
|
te.MainEngine,
|
|
12165
12165
|
W.RotateNode,
|
|
12166
12166
|
{
|
|
@@ -12170,7 +12170,7 @@ const kp = (r) => {
|
|
|
12170
12170
|
viewId: s == null ? void 0 : s.viewId
|
|
12171
12171
|
}
|
|
12172
12172
|
);
|
|
12173
|
-
},
|
|
12173
|
+
}, A = (E, O) => {
|
|
12174
12174
|
if (s != null && s.control.worker.isBusy) {
|
|
12175
12175
|
f(!0), k(E, O);
|
|
12176
12176
|
return;
|
|
@@ -12183,19 +12183,19 @@ const kp = (r) => {
|
|
|
12183
12183
|
}
|
|
12184
12184
|
N.current || (h({ x: O.x, y: O.y }), g(!0), N.current = setTimeout(() => {
|
|
12185
12185
|
N.current = 0;
|
|
12186
|
-
const
|
|
12186
|
+
const z = Math.round(
|
|
12187
12187
|
ve.GetAngleByPoints(
|
|
12188
12188
|
M,
|
|
12189
12189
|
y,
|
|
12190
12190
|
new ve(O.x, O.y)
|
|
12191
12191
|
)
|
|
12192
12192
|
) || 0;
|
|
12193
|
-
i(
|
|
12193
|
+
i(z), o(W.RotateNode), c(x.Doing), re.emitMethod(
|
|
12194
12194
|
te.MainEngine,
|
|
12195
12195
|
W.RotateNode,
|
|
12196
12196
|
{
|
|
12197
12197
|
workIds: [$],
|
|
12198
|
-
angle:
|
|
12198
|
+
angle: z,
|
|
12199
12199
|
workState: x.Doing,
|
|
12200
12200
|
viewId: s == null ? void 0 : s.viewId
|
|
12201
12201
|
}
|
|
@@ -12209,7 +12209,7 @@ const kp = (r) => {
|
|
|
12209
12209
|
position: l,
|
|
12210
12210
|
onStart: v,
|
|
12211
12211
|
onDrag: P,
|
|
12212
|
-
onStop:
|
|
12212
|
+
onStop: A
|
|
12213
12213
|
},
|
|
12214
12214
|
/* @__PURE__ */ m.createElement(
|
|
12215
12215
|
"div",
|
|
@@ -12257,9 +12257,9 @@ const kp = (r) => {
|
|
|
12257
12257
|
return;
|
|
12258
12258
|
}
|
|
12259
12259
|
h(!1);
|
|
12260
|
-
}, p = (v,
|
|
12260
|
+
}, p = (v, A) => {
|
|
12261
12261
|
u.current && (clearTimeout(u.current), u.current = 0);
|
|
12262
|
-
const P = { x:
|
|
12262
|
+
const P = { x: A.x, y: A.y };
|
|
12263
12263
|
i(W.None), M.current = x.Done, c(P), re.emitMethod(
|
|
12264
12264
|
te.MainEngine,
|
|
12265
12265
|
W.TranslateNode,
|
|
@@ -12297,25 +12297,25 @@ const kp = (r) => {
|
|
|
12297
12297
|
viewId: o == null ? void 0 : o.viewId
|
|
12298
12298
|
}
|
|
12299
12299
|
));
|
|
12300
|
-
}, N = (v,
|
|
12300
|
+
}, N = (v, A) => {
|
|
12301
12301
|
var O;
|
|
12302
12302
|
o != null && o.control.worker.isBusy && h(!0);
|
|
12303
12303
|
const P = M.current, E = g.current;
|
|
12304
|
-
if (p(v,
|
|
12305
|
-
const
|
|
12304
|
+
if (p(v, A), g.current && (g.current = void 0), P === x.Start && (n != null && n.size) && E) {
|
|
12305
|
+
const z = (O = o == null ? void 0 : o.control.viewContainerManager.getView(
|
|
12306
12306
|
o.viewId
|
|
12307
12307
|
)) == null ? void 0 : O.focusScenePath;
|
|
12308
|
-
|
|
12308
|
+
z && (o == null || o.control.worker.blurSelector(o.viewId, z));
|
|
12309
12309
|
}
|
|
12310
12310
|
o == null || o.focusElement();
|
|
12311
|
-
}, S = (v,
|
|
12311
|
+
}, S = (v, A) => {
|
|
12312
12312
|
if (o != null && o.control.worker.isBusy) {
|
|
12313
|
-
h(!0), p(v,
|
|
12313
|
+
h(!0), p(v, A);
|
|
12314
12314
|
return;
|
|
12315
12315
|
}
|
|
12316
12316
|
if (u.current)
|
|
12317
12317
|
return;
|
|
12318
|
-
const P = { x:
|
|
12318
|
+
const P = { x: A.x, y: A.y };
|
|
12319
12319
|
c(P), u.current = setTimeout(() => {
|
|
12320
12320
|
u.current = 0, (P.x !== (a == null ? void 0 : a.x) || P.y !== (a == null ? void 0 : a.y)) && (g.current && (g.current = void 0), M.current = x.Doing, re.emitMethod(
|
|
12321
12321
|
te.MainEngine,
|
|
@@ -12397,7 +12397,7 @@ const kp = (r) => {
|
|
|
12397
12397
|
}, [u == null ? void 0 : u.control.worker.isBusy]);
|
|
12398
12398
|
const N = () => {
|
|
12399
12399
|
if (f.current && (clearTimeout(f.current), f.current = 0), d) {
|
|
12400
|
-
const { scale: O, translate:
|
|
12400
|
+
const { scale: O, translate: z } = d;
|
|
12401
12401
|
M(W.None), re.emitMethod(
|
|
12402
12402
|
te.MainEngine,
|
|
12403
12403
|
W.ScaleNode,
|
|
@@ -12405,7 +12405,7 @@ const kp = (r) => {
|
|
|
12405
12405
|
workIds: [$],
|
|
12406
12406
|
scale: O,
|
|
12407
12407
|
dir: c,
|
|
12408
|
-
translate:
|
|
12408
|
+
translate: z,
|
|
12409
12409
|
originPoint: i,
|
|
12410
12410
|
scenePoint: s,
|
|
12411
12411
|
workState: x.Done,
|
|
@@ -12425,8 +12425,8 @@ const kp = (r) => {
|
|
|
12425
12425
|
[O.x + O.w, O.y],
|
|
12426
12426
|
[O.x + O.w, O.y + O.h],
|
|
12427
12427
|
[O.x, O.y + O.h]
|
|
12428
|
-
], k = (O,
|
|
12429
|
-
switch (
|
|
12428
|
+
], k = (O, z) => {
|
|
12429
|
+
switch (z) {
|
|
12430
12430
|
case "top":
|
|
12431
12431
|
case "topLeft":
|
|
12432
12432
|
case "left":
|
|
@@ -12440,7 +12440,7 @@ const kp = (r) => {
|
|
|
12440
12440
|
case "bottomLeft":
|
|
12441
12441
|
return O[1];
|
|
12442
12442
|
}
|
|
12443
|
-
}, v = (O,
|
|
12443
|
+
}, v = (O, z, L, j) => {
|
|
12444
12444
|
let F = !1, X = !1;
|
|
12445
12445
|
const Y = {
|
|
12446
12446
|
x: e.x,
|
|
@@ -12450,51 +12450,51 @@ const kp = (r) => {
|
|
|
12450
12450
|
}, Q = [1, 1], _ = [0, 0];
|
|
12451
12451
|
switch (O) {
|
|
12452
12452
|
case "top": {
|
|
12453
|
-
const H =
|
|
12454
|
-
H < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(H)) : (Y.y = e.y -
|
|
12453
|
+
const H = z.height + e.h;
|
|
12454
|
+
H < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(H)) : (Y.y = e.y - z.height, Y.h = e.h + z.height);
|
|
12455
12455
|
break;
|
|
12456
12456
|
}
|
|
12457
12457
|
case "topLeft": {
|
|
12458
|
-
const H =
|
|
12459
|
-
H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x -
|
|
12460
|
-
const fe =
|
|
12461
|
-
fe < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(fe)) : (Y.y = e.y -
|
|
12458
|
+
const H = z.width + e.w;
|
|
12459
|
+
H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x - z.width, Y.w = e.w + z.width);
|
|
12460
|
+
const fe = z.height + e.h;
|
|
12461
|
+
fe < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(fe)) : (Y.y = e.y - z.height, Y.h = e.h + z.height);
|
|
12462
12462
|
break;
|
|
12463
12463
|
}
|
|
12464
12464
|
case "topRight": {
|
|
12465
|
-
const H =
|
|
12466
|
-
H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w +
|
|
12467
|
-
const fe =
|
|
12468
|
-
fe < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(fe)) : (Y.y = e.y -
|
|
12465
|
+
const H = z.width + e.w;
|
|
12466
|
+
H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w + z.width;
|
|
12467
|
+
const fe = z.height + e.h;
|
|
12468
|
+
fe < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(fe)) : (Y.y = e.y - z.height, Y.h = e.h + z.height);
|
|
12469
12469
|
break;
|
|
12470
12470
|
}
|
|
12471
12471
|
case "bottom": {
|
|
12472
|
-
const H =
|
|
12473
|
-
H < 0 ? (X = !0, Y.y = e.y + H, Y.h = Math.abs(H)) : Y.h = e.h +
|
|
12472
|
+
const H = z.height + e.h;
|
|
12473
|
+
H < 0 ? (X = !0, Y.y = e.y + H, Y.h = Math.abs(H)) : Y.h = e.h + z.height;
|
|
12474
12474
|
break;
|
|
12475
12475
|
}
|
|
12476
12476
|
case "bottomLeft": {
|
|
12477
|
-
const H =
|
|
12478
|
-
H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x -
|
|
12479
|
-
const fe =
|
|
12480
|
-
fe < 0 ? (X = !0, Y.y = e.y + fe, Y.h = Math.abs(fe)) : Y.h = e.h +
|
|
12477
|
+
const H = z.width + e.w;
|
|
12478
|
+
H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x - z.width, Y.w = e.w + z.width);
|
|
12479
|
+
const fe = z.height + e.h;
|
|
12480
|
+
fe < 0 ? (X = !0, Y.y = e.y + fe, Y.h = Math.abs(fe)) : Y.h = e.h + z.height;
|
|
12481
12481
|
break;
|
|
12482
12482
|
}
|
|
12483
12483
|
case "left": {
|
|
12484
|
-
const H =
|
|
12485
|
-
H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x -
|
|
12484
|
+
const H = z.width + e.w;
|
|
12485
|
+
H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x - z.width, Y.w = e.w + z.width);
|
|
12486
12486
|
break;
|
|
12487
12487
|
}
|
|
12488
12488
|
case "bottomRight": {
|
|
12489
|
-
const H =
|
|
12490
|
-
H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w +
|
|
12491
|
-
const fe =
|
|
12492
|
-
fe < 0 ? (X = !0, Y.y = e.y + fe, Y.h = Math.abs(fe)) : Y.h = e.h +
|
|
12489
|
+
const H = z.width + e.w;
|
|
12490
|
+
H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w + z.width;
|
|
12491
|
+
const fe = z.height + e.h;
|
|
12492
|
+
fe < 0 ? (X = !0, Y.y = e.y + fe, Y.h = Math.abs(fe)) : Y.h = e.h + z.height;
|
|
12493
12493
|
break;
|
|
12494
12494
|
}
|
|
12495
12495
|
case "right": {
|
|
12496
|
-
const H =
|
|
12497
|
-
H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w +
|
|
12496
|
+
const H = z.width + e.w;
|
|
12497
|
+
H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w + z.width;
|
|
12498
12498
|
break;
|
|
12499
12499
|
}
|
|
12500
12500
|
}
|
|
@@ -12506,7 +12506,7 @@ const kp = (r) => {
|
|
|
12506
12506
|
)
|
|
12507
12507
|
), K = k(ie, O);
|
|
12508
12508
|
return X && (_[1] = K[1] - j[1]), F && (_[0] = K[0] - j[0]), { scale: Q, translate: _ };
|
|
12509
|
-
},
|
|
12509
|
+
}, A = (O, z) => {
|
|
12510
12510
|
if (f.current && (clearTimeout(f.current), f.current = 0), u != null && u.control.worker.isBusy) {
|
|
12511
12511
|
p(!0);
|
|
12512
12512
|
return;
|
|
@@ -12522,8 +12522,8 @@ const kp = (r) => {
|
|
|
12522
12522
|
Q,
|
|
12523
12523
|
u.viewId
|
|
12524
12524
|
)
|
|
12525
|
-
), X = k(j,
|
|
12526
|
-
t(L), o(X), a(Y), l(
|
|
12525
|
+
), X = k(j, z), Y = k(F, z);
|
|
12526
|
+
t(L), o(X), a(Y), l(z), M(W.ScaleNode), re.emitMethod(
|
|
12527
12527
|
te.MainEngine,
|
|
12528
12528
|
W.ScaleNode,
|
|
12529
12529
|
{
|
|
@@ -12535,7 +12535,7 @@ const kp = (r) => {
|
|
|
12535
12535
|
}
|
|
12536
12536
|
);
|
|
12537
12537
|
}
|
|
12538
|
-
}, P = (O,
|
|
12538
|
+
}, P = (O, z, L, j) => {
|
|
12539
12539
|
if (!(!u || !i || !s)) {
|
|
12540
12540
|
if (u != null && u.control.worker.isBusy) {
|
|
12541
12541
|
p(!0), N();
|
|
@@ -12543,14 +12543,14 @@ const kp = (r) => {
|
|
|
12543
12543
|
}
|
|
12544
12544
|
f.current || (f.current = setTimeout(() => {
|
|
12545
12545
|
f.current = 0;
|
|
12546
|
-
const { scale: F, translate: X } = v(
|
|
12546
|
+
const { scale: F, translate: X } = v(z, j, u, s);
|
|
12547
12547
|
(!le(F, d == null ? void 0 : d.scale) || !le(X, d == null ? void 0 : d.translate)) && (y({ scale: F, translate: X }), M(W.ScaleNode), re.emitMethod(
|
|
12548
12548
|
te.MainEngine,
|
|
12549
12549
|
W.ScaleNode,
|
|
12550
12550
|
{
|
|
12551
12551
|
workIds: [$],
|
|
12552
12552
|
scale: F,
|
|
12553
|
-
dir:
|
|
12553
|
+
dir: z,
|
|
12554
12554
|
translate: X,
|
|
12555
12555
|
originPoint: i,
|
|
12556
12556
|
scenePoint: s,
|
|
@@ -12591,7 +12591,7 @@ const kp = (r) => {
|
|
|
12591
12591
|
topLeft: !0
|
|
12592
12592
|
},
|
|
12593
12593
|
lockAspectRatio: (h == null ? void 0 : h.scaleType) === Fe.proportional,
|
|
12594
|
-
onResizeStart:
|
|
12594
|
+
onResizeStart: A,
|
|
12595
12595
|
onResize: P,
|
|
12596
12596
|
onResizeStop: E
|
|
12597
12597
|
}
|
|
@@ -12627,11 +12627,11 @@ const kp = (r) => {
|
|
|
12627
12627
|
d.current && (clearTimeout(d.current), d.current = 0), o(W.None), u(x.Done);
|
|
12628
12628
|
const v = { x: k.x, y: k.y };
|
|
12629
12629
|
if (l(v), s != null && s.control.viewContainerManager) {
|
|
12630
|
-
const
|
|
12630
|
+
const A = s.control.viewContainerManager.transformToScenePoint(
|
|
12631
12631
|
[v.x, v.y],
|
|
12632
12632
|
s.viewId
|
|
12633
12633
|
), P = t.get(n);
|
|
12634
|
-
P && i === "start" ? P[0] =
|
|
12634
|
+
P && i === "start" ? P[0] = A : P && i === "end" && (P[1] = A), re.emitMethod(
|
|
12635
12635
|
te.MainEngine,
|
|
12636
12636
|
W.SetPoint,
|
|
12637
12637
|
{
|
|
@@ -12668,11 +12668,11 @@ const kp = (r) => {
|
|
|
12668
12668
|
const v = { x: k.x, y: k.y };
|
|
12669
12669
|
l(v), d.current = setTimeout(() => {
|
|
12670
12670
|
if (d.current = 0, (v.x !== (k == null ? void 0 : k.x) || v.y !== (k == null ? void 0 : k.y)) && (s != null && s.control.viewContainerManager)) {
|
|
12671
|
-
const
|
|
12671
|
+
const A = s.control.viewContainerManager.transformToScenePoint(
|
|
12672
12672
|
[v.x, v.y],
|
|
12673
12673
|
s.viewId
|
|
12674
12674
|
), P = t.get(n);
|
|
12675
|
-
P && i === "start" ? P[0] =
|
|
12675
|
+
P && i === "start" ? P[0] = A : P && i === "end" && (P[1] = A), u(x.Doing), re.emitMethod(
|
|
12676
12676
|
te.MainEngine,
|
|
12677
12677
|
W.SetPoint,
|
|
12678
12678
|
{
|
|
@@ -13352,7 +13352,19 @@ class qn extends m.Component {
|
|
|
13352
13352
|
className: De.SnapshotBox,
|
|
13353
13353
|
ref: this.props.refs.snapshotContainerRef
|
|
13354
13354
|
}
|
|
13355
|
-
) || null, /* @__PURE__ */ m.createElement(
|
|
13355
|
+
) || null, this.props.mananger.control.isUseBackgroundThread && !!this.props.refs.backgroundContainerRef && /* @__PURE__ */ m.createElement("div", { className: De.BackgroundBox }, /* @__PURE__ */ m.createElement(
|
|
13356
|
+
"div",
|
|
13357
|
+
{
|
|
13358
|
+
className: De.BackgroundSvgBox,
|
|
13359
|
+
ref: this.props.refs.backgroundContainerRef
|
|
13360
|
+
}
|
|
13361
|
+
), !!this.props.refs.backgroundSnapshotContainerRef && /* @__PURE__ */ m.createElement("div", { className: De.BackgroundSnapshotBox }, /* @__PURE__ */ m.createElement(
|
|
13362
|
+
"div",
|
|
13363
|
+
{
|
|
13364
|
+
className: De.BackgroundSnapshotContent,
|
|
13365
|
+
ref: this.props.refs.backgroundSnapshotContainerRef
|
|
13366
|
+
}
|
|
13367
|
+
))) || null, /* @__PURE__ */ m.createElement(
|
|
13356
13368
|
Te.Provider,
|
|
13357
13369
|
{
|
|
13358
13370
|
value: {
|
|
@@ -13403,19 +13415,7 @@ class qn extends m.Component {
|
|
|
13403
13415
|
active: this.state.activeMiniMapViewId,
|
|
13404
13416
|
miniMapManager: this.props.mananger.control.miniMapManager
|
|
13405
13417
|
}
|
|
13406
|
-
)
|
|
13407
|
-
"div",
|
|
13408
|
-
{
|
|
13409
|
-
className: De.BackgroundSvgBox,
|
|
13410
|
-
ref: this.props.refs.backgroundContainerRef
|
|
13411
|
-
}
|
|
13412
|
-
), !!this.props.refs.backgroundSnapshotContainerRef && /* @__PURE__ */ m.createElement("div", { className: De.BackgroundSnapshotBox }, /* @__PURE__ */ m.createElement(
|
|
13413
|
-
"div",
|
|
13414
|
-
{
|
|
13415
|
-
className: De.BackgroundSnapshotContent,
|
|
13416
|
-
ref: this.props.refs.backgroundSnapshotContainerRef
|
|
13417
|
-
}
|
|
13418
|
-
))) || null);
|
|
13418
|
+
));
|
|
13419
13419
|
}
|
|
13420
13420
|
}
|
|
13421
13421
|
class vy extends br {
|
|
@@ -14042,43 +14042,43 @@ class ct extends ke {
|
|
|
14042
14042
|
}), this.viewContainerManager.listenerWindowManager(this.windowManager);
|
|
14043
14043
|
}
|
|
14044
14044
|
}
|
|
14045
|
-
const
|
|
14045
|
+
const b = class b extends Zi {
|
|
14046
14046
|
constructor() {
|
|
14047
14047
|
super(...arguments);
|
|
14048
14048
|
I(this, "onPhaseChanged", (e) => {
|
|
14049
14049
|
var t;
|
|
14050
|
-
e === $i.Reconnecting && ((t =
|
|
14050
|
+
e === $i.Reconnecting && ((t = b.currentManager) == null || t.setSnapshootData());
|
|
14051
14051
|
});
|
|
14052
14052
|
I(this, "updateRoomWritable", () => {
|
|
14053
14053
|
var e;
|
|
14054
|
-
(e =
|
|
14054
|
+
(e = b.currentManager) == null || e.onWritableChange(
|
|
14055
14055
|
this.displayer.isWritable
|
|
14056
14056
|
);
|
|
14057
14057
|
});
|
|
14058
14058
|
I(this, "roomStateChangeListener", async (e) => {
|
|
14059
14059
|
var t, i;
|
|
14060
|
-
e != null && e.roomMembers && ((t =
|
|
14060
|
+
e != null && e.roomMembers && ((t = b.currentManager) == null || t.onRoomMembersChange(
|
|
14061
14061
|
e.roomMembers
|
|
14062
|
-
)), !(G(this.displayer) && !this.displayer.isWritable) && e.memberState && ((i =
|
|
14062
|
+
)), !(G(this.displayer) && !this.displayer.isWritable) && e.memberState && ((i = b.currentManager) == null || i.onMemberChange(
|
|
14063
14063
|
e.memberState
|
|
14064
14064
|
));
|
|
14065
14065
|
});
|
|
14066
14066
|
}
|
|
14067
14067
|
static async getInstance(e, t) {
|
|
14068
14068
|
var w;
|
|
14069
|
-
t.options && (((w = t.options.extras) == null ? void 0 : w.useWorker) === "mainThread" && (t.options.cdn.fullWorkerUrl = "", t.options.cdn.subWorkerUrl = ""), (t.options.extras && t.options.extras.useWorker !== "mainThread" || !t.options.extras) && !t.options.cdn.fullWorkerUrl && !t.options.cdn.subWorkerUrl &&
|
|
14069
|
+
t.options && (((w = t.options.extras) == null ? void 0 : w.useWorker) === "mainThread" && (t.options.cdn.fullWorkerUrl = "", t.options.cdn.subWorkerUrl = ""), (t.options.extras && t.options.extras.useWorker !== "mainThread" || !t.options.extras) && !t.options.cdn.fullWorkerUrl && !t.options.cdn.subWorkerUrl && b.logger.error(
|
|
14070
14070
|
"[ApplianceMultiPlugin] you must adaptor options cdn fullWorkerUrl and subWorkerUrl"
|
|
14071
14071
|
));
|
|
14072
14072
|
const i = e.displayer, o = i.callbacks.on, s = i.callbacks.off, a = i.callbacks.once, c = e.cleanCurrentScene, l = e.mainView.setMemberState;
|
|
14073
14073
|
let h;
|
|
14074
|
-
G(i) && (h = i.setWritable), t != null && t.logger && (
|
|
14074
|
+
G(i) && (h = i.setWritable), t != null && t.logger && (b.logger = t.logger);
|
|
14075
14075
|
let u = i.getInvisiblePlugin(
|
|
14076
|
-
|
|
14076
|
+
b.kind
|
|
14077
14077
|
);
|
|
14078
|
-
u || (u = await
|
|
14078
|
+
u || (u = await b.createApplianceMultiPlugin(
|
|
14079
14079
|
i,
|
|
14080
|
-
|
|
14081
|
-
)), i && u &&
|
|
14080
|
+
b.kind
|
|
14081
|
+
)), i && u && b.createCurrentManager(
|
|
14082
14082
|
e,
|
|
14083
14083
|
{
|
|
14084
14084
|
cdn: t.options.cdn,
|
|
@@ -14092,54 +14092,54 @@ const A = class A extends Zi {
|
|
|
14092
14092
|
const g = {
|
|
14093
14093
|
displayer: i,
|
|
14094
14094
|
windowManager: e,
|
|
14095
|
-
currentManager:
|
|
14095
|
+
currentManager: b.currentManager,
|
|
14096
14096
|
maxScreenshotWidth: 10 * 1024,
|
|
14097
14097
|
maxScreenshotHeight: 10 * 1024,
|
|
14098
14098
|
getBoundingRectAsync: async function(p) {
|
|
14099
14099
|
var S;
|
|
14100
|
-
|
|
14100
|
+
b.logger.info(
|
|
14101
14101
|
"[ApplianceMultiPlugin] getBoundingRectAsync"
|
|
14102
14102
|
);
|
|
14103
|
-
const f = (e.mainView || i).getBoundingRect(p), N = await ((S =
|
|
14103
|
+
const f = (e.mainView || i).getBoundingRect(p), N = await ((S = b.currentManager) == null ? void 0 : S.getBoundingRect(p));
|
|
14104
14104
|
return !f.width || !f.height ? N : Kn(f, N);
|
|
14105
14105
|
},
|
|
14106
14106
|
screenshotToCanvasAsync: async function(p, f, N, S, C, k) {
|
|
14107
|
-
var
|
|
14108
|
-
|
|
14107
|
+
var z;
|
|
14108
|
+
b.logger.info(
|
|
14109
14109
|
"[ApplianceMultiPlugin] screenshotToCanvasAsync"
|
|
14110
14110
|
);
|
|
14111
|
-
let v = N,
|
|
14112
|
-
v > this.maxScreenshotWidth && (P = this.maxScreenshotWidth / v * P, v = this.maxScreenshotWidth),
|
|
14111
|
+
let v = N, A = S, P = C.scale;
|
|
14112
|
+
v > this.maxScreenshotWidth && (P = this.maxScreenshotWidth / v * P, v = this.maxScreenshotWidth), A > this.maxScreenshotHeight && (P = Math.min(this.maxScreenshotHeight / A * P, P), A = this.maxScreenshotHeight), C.scale = P;
|
|
14113
14113
|
const E = document.createElement("canvas"), O = E.getContext("2d");
|
|
14114
|
-
E.width = v * (k || 1), E.height =
|
|
14114
|
+
E.width = v * (k || 1), E.height = A * (k || 1), O && ((e.mainView || i).screenshotToCanvas(
|
|
14115
14115
|
O,
|
|
14116
14116
|
f,
|
|
14117
14117
|
v,
|
|
14118
|
-
|
|
14118
|
+
A,
|
|
14119
14119
|
C,
|
|
14120
14120
|
k
|
|
14121
14121
|
), p.drawImage(
|
|
14122
14122
|
E,
|
|
14123
14123
|
Math.floor((N - v) / 2),
|
|
14124
|
-
Math.floor((S -
|
|
14124
|
+
Math.floor((S - A) / 2),
|
|
14125
14125
|
v * (k || 1),
|
|
14126
|
-
|
|
14126
|
+
A * (k || 1),
|
|
14127
14127
|
0,
|
|
14128
14128
|
0,
|
|
14129
14129
|
v,
|
|
14130
|
-
|
|
14131
|
-
), E.remove()),
|
|
14130
|
+
A
|
|
14131
|
+
), E.remove()), b.currentManager && await ((z = b.currentManager) == null ? void 0 : z.screenshotToCanvas(
|
|
14132
14132
|
p,
|
|
14133
14133
|
f,
|
|
14134
14134
|
v,
|
|
14135
|
-
|
|
14135
|
+
A,
|
|
14136
14136
|
C,
|
|
14137
14137
|
Math.floor((N - v) / 2),
|
|
14138
|
-
Math.floor((S -
|
|
14138
|
+
Math.floor((S - A) / 2)
|
|
14139
14139
|
));
|
|
14140
14140
|
},
|
|
14141
14141
|
scenePreviewAsync: async function(p, f, N, S, C) {
|
|
14142
|
-
|
|
14142
|
+
b.logger.info(
|
|
14143
14143
|
"[ApplianceMultiPlugin] scenePreviewAsync"
|
|
14144
14144
|
), (e.mainView || i).scenePreview(
|
|
14145
14145
|
p,
|
|
@@ -14149,13 +14149,13 @@ const A = class A extends Zi {
|
|
|
14149
14149
|
C
|
|
14150
14150
|
);
|
|
14151
14151
|
const k = document.createElement("img");
|
|
14152
|
-
k.className = "appliance-plugin-fill-scene-snapshot-img", f.append(k), getComputedStyle(f).position || (f.style.position = "relative"),
|
|
14152
|
+
k.className = "appliance-plugin-fill-scene-snapshot-img", f.append(k), getComputedStyle(f).position || (f.style.position = "relative"), b.currentManager && await b.currentManager.scenePreview(
|
|
14153
14153
|
p,
|
|
14154
14154
|
k
|
|
14155
14155
|
);
|
|
14156
14156
|
},
|
|
14157
14157
|
fillSceneSnapshotAsync: async function(p, f, N, S, C) {
|
|
14158
|
-
|
|
14158
|
+
b.logger.info(
|
|
14159
14159
|
"[ApplianceMultiPlugin] fillSceneSnapshotAsync"
|
|
14160
14160
|
), f.innerHTML = "", (e.mainView || i).fillSceneSnapshot(
|
|
14161
14161
|
p,
|
|
@@ -14165,20 +14165,20 @@ const A = class A extends Zi {
|
|
|
14165
14165
|
C
|
|
14166
14166
|
);
|
|
14167
14167
|
const k = N || e.mainView.size.width, v = S || e.mainView.size.height;
|
|
14168
|
-
let
|
|
14169
|
-
|
|
14168
|
+
let A = await this.getBoundingRectAsync(p);
|
|
14169
|
+
A || (A = {
|
|
14170
14170
|
originX: 0,
|
|
14171
14171
|
originY: 0,
|
|
14172
14172
|
width: k,
|
|
14173
14173
|
height: v
|
|
14174
14174
|
});
|
|
14175
|
-
let P = Math.max(
|
|
14176
|
-
const
|
|
14177
|
-
|
|
14175
|
+
let P = Math.max(A == null ? void 0 : A.width, k), E = Math.max(A == null ? void 0 : A.height, v), O = 1;
|
|
14176
|
+
const z = P > k && Math.min(k / P, O) || O, L = E > v && Math.min(v / E, O) || O;
|
|
14177
|
+
z <= L ? (P = z < 1 && k || P, E = Math.floor(E * z) + 1, O = z) : z > L && (E = L < 1 && v || E, P = Math.floor(P * L) + 1, O = L);
|
|
14178
14178
|
const j = {
|
|
14179
14179
|
scale: O,
|
|
14180
|
-
centerX:
|
|
14181
|
-
centerY:
|
|
14180
|
+
centerX: A.originX + A.width / 2,
|
|
14181
|
+
centerY: A.originY + A.height / 2
|
|
14182
14182
|
}, F = document.createElement("canvas"), X = F.getContext("2d");
|
|
14183
14183
|
F.width = P, F.height = E, X && await this.screenshotToCanvasAsync(
|
|
14184
14184
|
X,
|
|
@@ -14196,23 +14196,23 @@ const A = class A extends Zi {
|
|
|
14196
14196
|
}, f.append(Y), getComputedStyle(f).position || (f.style.position = "relative");
|
|
14197
14197
|
},
|
|
14198
14198
|
_callbacksOn: function(p, f) {
|
|
14199
|
-
|
|
14199
|
+
b.logger.info(
|
|
14200
14200
|
`[ApplianceMultiPlugin] callbacks ${p}`
|
|
14201
14201
|
), (p === "onCanUndoStepsUpdate" || p === "onCanRedoStepsUpdate") && G(i) && i.isWritable ? ct.InternalMsgEmitter.on(p, f) : o.call(i.callbacks, p, f);
|
|
14202
14202
|
},
|
|
14203
14203
|
_callbacksOnce: function(p, f) {
|
|
14204
|
-
|
|
14204
|
+
b.logger.info(
|
|
14205
14205
|
`[ApplianceMultiPlugin] callbacks ${p}`
|
|
14206
14206
|
), (p === "onCanUndoStepsUpdate" || p === "onCanRedoStepsUpdate") && G(i) && i.isWritable ? ct.InternalMsgEmitter.on(p, f) : a.call(i.callbacks, p, f);
|
|
14207
14207
|
},
|
|
14208
14208
|
_callbacksOff: function(p, f) {
|
|
14209
|
-
|
|
14209
|
+
b.logger.info(
|
|
14210
14210
|
`[ApplianceMultiPlugin] callbacks ${p}`
|
|
14211
14211
|
), (p === "onCanUndoStepsUpdate" || p === "onCanRedoStepsUpdate") && G(i) && i.isWritable ? ct.InternalMsgEmitter.off(p, f) : s.call(i.callbacks, p, f);
|
|
14212
14212
|
},
|
|
14213
14213
|
canRedoSteps() {
|
|
14214
|
-
if (
|
|
14215
|
-
const p =
|
|
14214
|
+
if (b.logger.info("[ApplianceMultiPlugin] canRedoSteps"), b.currentManager && G(i) && !i.disableSerialization) {
|
|
14215
|
+
const p = b.currentManager.viewContainerManager.focuedView, f = p == null ? void 0 : p.focusScenePath;
|
|
14216
14216
|
if (p && f)
|
|
14217
14217
|
return p.displayer.commiter.redoStack.filter(
|
|
14218
14218
|
(N) => N.scenePath === f
|
|
@@ -14221,8 +14221,8 @@ const A = class A extends Zi {
|
|
|
14221
14221
|
return 0;
|
|
14222
14222
|
},
|
|
14223
14223
|
canUndoSteps() {
|
|
14224
|
-
if (
|
|
14225
|
-
const p =
|
|
14224
|
+
if (b.logger.info("[ApplianceMultiPlugin] canUndoSteps"), b.currentManager && G(i) && !i.disableSerialization) {
|
|
14225
|
+
const p = b.currentManager.viewContainerManager.focuedView, f = p == null ? void 0 : p.focusScenePath;
|
|
14226
14226
|
if (p && f)
|
|
14227
14227
|
return p.displayer.commiter.undoStack.filter(
|
|
14228
14228
|
(C) => C.scenePath === f
|
|
@@ -14231,29 +14231,29 @@ const A = class A extends Zi {
|
|
|
14231
14231
|
return 0;
|
|
14232
14232
|
},
|
|
14233
14233
|
undo: function() {
|
|
14234
|
-
return
|
|
14234
|
+
return b.logger.info("[ApplianceMultiPlugin] undo"), b.currentManager && G(i) && !i.disableSerialization && i.isWritable ? b.currentManager.viewContainerManager.undo() : 0;
|
|
14235
14235
|
},
|
|
14236
14236
|
redo: function() {
|
|
14237
|
-
return
|
|
14237
|
+
return b.logger.info("[ApplianceMultiPlugin] redo"), b.currentManager && G(i) && !i.disableSerialization && i.isWritable ? b.currentManager.viewContainerManager.redo() : 0;
|
|
14238
14238
|
},
|
|
14239
14239
|
cleanCurrentScene: function() {
|
|
14240
|
-
|
|
14240
|
+
b.logger.info(
|
|
14241
14241
|
"[ApplianceMultiPlugin] cleanCurrentScene"
|
|
14242
|
-
),
|
|
14242
|
+
), b.currentManager && G(i) && i.isWritable && (b.currentManager.cleanCurrentScene(), c.call(e));
|
|
14243
14243
|
},
|
|
14244
14244
|
insertImage: function(p) {
|
|
14245
|
-
if (
|
|
14246
|
-
const f =
|
|
14247
|
-
|
|
14245
|
+
if (b.logger.info("[ApplianceMultiPlugin] insertImage"), b.currentManager && G(i) && i.isWritable) {
|
|
14246
|
+
const f = b.currentManager.viewContainerManager.focuedViewId || pe;
|
|
14247
|
+
b.currentManager.worker.insertImage(
|
|
14248
14248
|
f,
|
|
14249
14249
|
p
|
|
14250
14250
|
);
|
|
14251
14251
|
}
|
|
14252
14252
|
},
|
|
14253
14253
|
lockImage: function(p, f) {
|
|
14254
|
-
if (
|
|
14255
|
-
const N =
|
|
14256
|
-
|
|
14254
|
+
if (b.logger.info("[ApplianceMultiPlugin] lockImage"), b.currentManager && G(i) && i.isWritable) {
|
|
14255
|
+
const N = b.currentManager.viewContainerManager.focuedViewId || pe;
|
|
14256
|
+
b.currentManager.worker.lockImage(
|
|
14257
14257
|
N,
|
|
14258
14258
|
p,
|
|
14259
14259
|
f
|
|
@@ -14261,11 +14261,11 @@ const A = class A extends Zi {
|
|
|
14261
14261
|
}
|
|
14262
14262
|
},
|
|
14263
14263
|
completeImageUpload: function(p, f) {
|
|
14264
|
-
if (
|
|
14264
|
+
if (b.logger.info(
|
|
14265
14265
|
"[ApplianceMultiPlugin] completeImageUpload"
|
|
14266
|
-
),
|
|
14267
|
-
const N =
|
|
14268
|
-
|
|
14266
|
+
), b.currentManager && G(i) && i.isWritable) {
|
|
14267
|
+
const N = b.currentManager.viewContainerManager.focuedViewId || pe;
|
|
14268
|
+
b.currentManager.worker.completeImageUpload(
|
|
14269
14269
|
N,
|
|
14270
14270
|
p,
|
|
14271
14271
|
f
|
|
@@ -14273,16 +14273,16 @@ const A = class A extends Zi {
|
|
|
14273
14273
|
}
|
|
14274
14274
|
},
|
|
14275
14275
|
getImagesInformation: function(p) {
|
|
14276
|
-
return
|
|
14276
|
+
return b.logger.info(
|
|
14277
14277
|
"[ApplianceMultiPlugin] completeImageUpload"
|
|
14278
|
-
),
|
|
14278
|
+
), b.currentManager && G(i) && i.isWritable ? b.currentManager.worker.getImagesInformation(
|
|
14279
14279
|
p
|
|
14280
14280
|
) : [];
|
|
14281
14281
|
},
|
|
14282
14282
|
insertText: function(p, f, N) {
|
|
14283
|
-
if (
|
|
14284
|
-
const S =
|
|
14285
|
-
return
|
|
14283
|
+
if (b.logger.info("[ApplianceMultiPlugin] insertText"), b.currentManager && G(i) && i.isWritable) {
|
|
14284
|
+
const S = b.currentManager.viewContainerManager.focuedViewId || pe;
|
|
14285
|
+
return b.currentManager.textEditorManager.insertText(
|
|
14286
14286
|
S,
|
|
14287
14287
|
p,
|
|
14288
14288
|
f,
|
|
@@ -14291,12 +14291,12 @@ const A = class A extends Zi {
|
|
|
14291
14291
|
}
|
|
14292
14292
|
},
|
|
14293
14293
|
updateText: function(p, f) {
|
|
14294
|
-
|
|
14294
|
+
b.logger.info("[ApplianceMultiPlugin] updateText"), b.currentManager && G(i) && i.isWritable && b.currentManager.textEditorManager.updateText(
|
|
14295
14295
|
p,
|
|
14296
14296
|
f
|
|
14297
14297
|
);
|
|
14298
14298
|
},
|
|
14299
|
-
callbacks: () => (
|
|
14299
|
+
callbacks: () => (b.logger.info(
|
|
14300
14300
|
"[ApplianceMultiPlugin] callbacks bind"
|
|
14301
14301
|
), {
|
|
14302
14302
|
...i.callbacks,
|
|
@@ -14305,18 +14305,18 @@ const A = class A extends Zi {
|
|
|
14305
14305
|
off: g._callbacksOff.bind(g)
|
|
14306
14306
|
}),
|
|
14307
14307
|
destroy() {
|
|
14308
|
-
|
|
14308
|
+
b.currentManager && (b.logger.info("[ApplianceMultiPlugin] destroy"), b.currentManager.destroy(), b.currentManager = void 0);
|
|
14309
14309
|
},
|
|
14310
14310
|
setMemberState(p) {
|
|
14311
14311
|
var N;
|
|
14312
|
-
|
|
14312
|
+
b.logger.info(
|
|
14313
14313
|
`[ApplianceMultiPlugin] setMemberState ${JSON.stringify(p)}`
|
|
14314
14314
|
);
|
|
14315
14315
|
const f = Object.keys(p);
|
|
14316
14316
|
if (G(i) && i.isWritable) {
|
|
14317
14317
|
if (f.includes("currentApplianceName"))
|
|
14318
14318
|
if (p.currentApplianceName && p.currentApplianceName === ne.laserPen) {
|
|
14319
|
-
if ((N =
|
|
14319
|
+
if ((N = b.currentManager) != null && N.isUseSimple)
|
|
14320
14320
|
throw new Error(
|
|
14321
14321
|
"[ApplianceMultiPlugin] laserPen must be not support in simple mode"
|
|
14322
14322
|
);
|
|
@@ -14333,92 +14333,92 @@ const A = class A extends Zi {
|
|
|
14333
14333
|
);
|
|
14334
14334
|
},
|
|
14335
14335
|
createMiniMap: async function(p, f) {
|
|
14336
|
-
if (
|
|
14336
|
+
if (b.logger.info(
|
|
14337
14337
|
"[ApplianceMultiPlugin] createMiniMap"
|
|
14338
|
-
),
|
|
14339
|
-
return
|
|
14338
|
+
), b.currentManager && G(i) && i.isWritable)
|
|
14339
|
+
return b.currentManager.createMiniMap(p, f);
|
|
14340
14340
|
},
|
|
14341
14341
|
destroyMiniMap: async function(p) {
|
|
14342
|
-
if (
|
|
14342
|
+
if (b.logger.info(
|
|
14343
14343
|
"[ApplianceMultiPlugin] destroyeMiniMap"
|
|
14344
|
-
),
|
|
14345
|
-
return
|
|
14344
|
+
), b.currentManager && G(i) && i.isWritable)
|
|
14345
|
+
return b.currentManager.destroyMiniMap(p);
|
|
14346
14346
|
},
|
|
14347
14347
|
filterRenderByUid(p, f, N) {
|
|
14348
|
-
if (
|
|
14348
|
+
if (b.logger.info(
|
|
14349
14349
|
"[ApplianceMultiPlugin] filterRenderByUid"
|
|
14350
|
-
),
|
|
14351
|
-
return
|
|
14350
|
+
), b.currentManager && G(i) && i.isWritable)
|
|
14351
|
+
return b.currentManager.filterRenderByUid(
|
|
14352
14352
|
p,
|
|
14353
14353
|
f,
|
|
14354
14354
|
N
|
|
14355
14355
|
);
|
|
14356
14356
|
},
|
|
14357
14357
|
cancelFilterRender(p, f) {
|
|
14358
|
-
if (
|
|
14358
|
+
if (b.logger.info(
|
|
14359
14359
|
"[ApplianceMultiPlugin] filterRenderByUid"
|
|
14360
|
-
),
|
|
14361
|
-
return
|
|
14360
|
+
), b.currentManager && G(i) && i.isWritable)
|
|
14361
|
+
return b.currentManager.cancelFilterRender(
|
|
14362
14362
|
p,
|
|
14363
14363
|
f
|
|
14364
14364
|
);
|
|
14365
14365
|
},
|
|
14366
14366
|
addListener: (p, f) => {
|
|
14367
|
-
|
|
14367
|
+
b.logger.info(
|
|
14368
14368
|
`[ApplianceMultiPlugin] addListener ${p}`
|
|
14369
14369
|
), ct.PublicMsgEmitter.on(p, f);
|
|
14370
14370
|
},
|
|
14371
14371
|
removeListener: (p, f) => {
|
|
14372
|
-
|
|
14372
|
+
b.logger.info(
|
|
14373
14373
|
`[ApplianceMultiPlugin] removeListener ${p}`
|
|
14374
14374
|
), ct.PublicMsgEmitter.off(p, f);
|
|
14375
14375
|
},
|
|
14376
14376
|
usePlugin: (p) => {
|
|
14377
14377
|
var f;
|
|
14378
|
-
|
|
14378
|
+
b.logger.info(
|
|
14379
14379
|
"[ApplianceMultiPlugin] usePlugin",
|
|
14380
14380
|
p.kind
|
|
14381
|
-
), (f =
|
|
14381
|
+
), (f = b.currentManager) == null || f.usePlugin(p);
|
|
14382
14382
|
},
|
|
14383
14383
|
getDisableDeviceInputs() {
|
|
14384
|
-
if (
|
|
14385
|
-
return
|
|
14384
|
+
if (b.currentManager && G(i))
|
|
14385
|
+
return b.currentManager.disableDeviceInputs;
|
|
14386
14386
|
},
|
|
14387
14387
|
setDisableDeviceInputs(p) {
|
|
14388
|
-
|
|
14388
|
+
b.logger.info(
|
|
14389
14389
|
`[ApplianceMultiPlugin] setDisableDeviceInputs ${p}`
|
|
14390
|
-
),
|
|
14390
|
+
), b.currentManager && G(i) && (b.currentManager.disableDeviceInputs = p);
|
|
14391
14391
|
},
|
|
14392
14392
|
getDisableCameraTransform() {
|
|
14393
|
-
if (
|
|
14394
|
-
return
|
|
14393
|
+
if (b.currentManager && G(i))
|
|
14394
|
+
return b.currentManager.disableCameraTransform;
|
|
14395
14395
|
},
|
|
14396
14396
|
setDisableCameraTransform(p) {
|
|
14397
|
-
|
|
14397
|
+
b.logger.info(
|
|
14398
14398
|
`[ApplianceMultiPlugin] setDisableCameraTransform ${p}`
|
|
14399
|
-
),
|
|
14399
|
+
), b.currentManager && G(i) && (b.currentManager.disableCameraTransform = p);
|
|
14400
14400
|
},
|
|
14401
14401
|
getDisableEraseImage() {
|
|
14402
|
-
if (
|
|
14403
|
-
return
|
|
14402
|
+
if (b.currentManager && G(i))
|
|
14403
|
+
return b.currentManager.disableEraseImage;
|
|
14404
14404
|
},
|
|
14405
14405
|
setDisableEraseImage(p) {
|
|
14406
|
-
|
|
14406
|
+
b.logger.info(
|
|
14407
14407
|
`[ApplianceMultiPlugin] setDisableEraseImage ${p}`
|
|
14408
|
-
),
|
|
14408
|
+
), b.currentManager && G(i) && (b.currentManager.disableEraseImage = p);
|
|
14409
14409
|
},
|
|
14410
14410
|
setWritable: async function(p) {
|
|
14411
14411
|
var f;
|
|
14412
|
-
|
|
14412
|
+
b.logger.info(
|
|
14413
14413
|
`[ApplianceMultiPlugin] setWritable ${p}`
|
|
14414
|
-
), G(i) && h && (await ((f =
|
|
14414
|
+
), G(i) && h && (await ((f = b.currentManager) == null ? void 0 : f.setWritable(p)), await h.call(i, p));
|
|
14415
14415
|
},
|
|
14416
14416
|
requestIdleCallback: (p, f) => {
|
|
14417
14417
|
const N = (f == null ? void 0 : f.timeout) || 0, S = performance.now();
|
|
14418
14418
|
let C;
|
|
14419
14419
|
const k = new MessageChannel();
|
|
14420
14420
|
let v;
|
|
14421
|
-
const
|
|
14421
|
+
const A = (P) => {
|
|
14422
14422
|
try {
|
|
14423
14423
|
p({
|
|
14424
14424
|
didTimeout: P,
|
|
@@ -14428,7 +14428,7 @@ const A = class A extends Zi {
|
|
|
14428
14428
|
}
|
|
14429
14429
|
});
|
|
14430
14430
|
} catch (E) {
|
|
14431
|
-
|
|
14431
|
+
b.logger.error(
|
|
14432
14432
|
"[ApplianceMultiPlugin] requestIdleCallback error:",
|
|
14433
14433
|
E
|
|
14434
14434
|
);
|
|
@@ -14438,27 +14438,27 @@ const A = class A extends Zi {
|
|
|
14438
14438
|
};
|
|
14439
14439
|
return k.port1.onmessage = () => {
|
|
14440
14440
|
C = requestAnimationFrame(() => {
|
|
14441
|
-
N > 0 && performance.now() - S >= N ?
|
|
14441
|
+
N > 0 && performance.now() - S >= N ? A(!0) : A(!1);
|
|
14442
14442
|
});
|
|
14443
14443
|
}, k.port2.postMessage(null), N > 0 && (v = setTimeout(() => {
|
|
14444
|
-
|
|
14444
|
+
A(!0);
|
|
14445
14445
|
}, N)), v || C || 0;
|
|
14446
14446
|
},
|
|
14447
14447
|
cancelIdleCallback: (p) => {
|
|
14448
14448
|
try {
|
|
14449
14449
|
clearTimeout(p), cancelAnimationFrame(p);
|
|
14450
14450
|
} catch (f) {
|
|
14451
|
-
|
|
14451
|
+
b.logger.error(
|
|
14452
14452
|
"[ApplianceMultiPlugin] cancelIdleCallback error:",
|
|
14453
14453
|
f
|
|
14454
14454
|
);
|
|
14455
14455
|
}
|
|
14456
14456
|
},
|
|
14457
14457
|
injectMethodToObject: (p, f) => {
|
|
14458
|
-
if (
|
|
14458
|
+
if (b.logger.info(
|
|
14459
14459
|
`[ApplianceMultiPlugin] injectMethodToObject ${f}`
|
|
14460
14460
|
), typeof p[f] == "function" || typeof p[f] > "u") {
|
|
14461
|
-
(f === "requestIdleCallback" || f === "cancelIdleCallback") &&
|
|
14461
|
+
(f === "requestIdleCallback" || f === "cancelIdleCallback") && b.currentManager && b.currentManager.registerPolyfillMethod(
|
|
14462
14462
|
f
|
|
14463
14463
|
), p[f] = g[f];
|
|
14464
14464
|
return;
|
|
@@ -14466,20 +14466,20 @@ const A = class A extends Zi {
|
|
|
14466
14466
|
f === "callbacks" && (p.callbacks.on = g._callbacksOn.bind(g), p.callbacks.off = g._callbacksOff.bind(g), p.callbacks.once = g._callbacksOnce.bind(g));
|
|
14467
14467
|
},
|
|
14468
14468
|
blurText: () => {
|
|
14469
|
-
|
|
14469
|
+
b.logger.info("[ApplianceMultiPlugin] blurText"), b.currentManager && G(i) && i.isWritable && b.currentManager.textEditorManager.checkEmptyTextBlur();
|
|
14470
14470
|
},
|
|
14471
14471
|
hasElements: (p, f) => {
|
|
14472
14472
|
var N;
|
|
14473
|
-
if (
|
|
14473
|
+
if (b.logger.info(
|
|
14474
14474
|
`[ApplianceMultiPlugin] hasElements ${p}`
|
|
14475
|
-
),
|
|
14475
|
+
), b.currentManager && G(i) && i.isWritable) {
|
|
14476
14476
|
let S = p;
|
|
14477
14477
|
if (!S) {
|
|
14478
|
-
const C =
|
|
14478
|
+
const C = b.currentManager.viewContainerManager.focuedView;
|
|
14479
14479
|
S = C == null ? void 0 : C.focusScenePath;
|
|
14480
14480
|
}
|
|
14481
14481
|
if (S) {
|
|
14482
|
-
const C = (N =
|
|
14482
|
+
const C = (N = b.currentManager.collector) == null ? void 0 : N.getScenePathData(
|
|
14483
14483
|
S
|
|
14484
14484
|
);
|
|
14485
14485
|
if (C) {
|
|
@@ -14495,16 +14495,16 @@ const A = class A extends Zi {
|
|
|
14495
14495
|
},
|
|
14496
14496
|
getElements: (p, f) => {
|
|
14497
14497
|
var N;
|
|
14498
|
-
if (
|
|
14498
|
+
if (b.logger.info(
|
|
14499
14499
|
`[ApplianceMultiPlugin] getElements ${p}`
|
|
14500
|
-
),
|
|
14500
|
+
), b.currentManager && G(i) && i.isWritable) {
|
|
14501
14501
|
let S = p;
|
|
14502
14502
|
if (!S) {
|
|
14503
|
-
const C =
|
|
14503
|
+
const C = b.currentManager.viewContainerManager.focuedView;
|
|
14504
14504
|
S = C == null ? void 0 : C.focusScenePath;
|
|
14505
14505
|
}
|
|
14506
14506
|
if (S) {
|
|
14507
|
-
const C = (N =
|
|
14507
|
+
const C = (N = b.currentManager.collector) == null ? void 0 : N.getScenePathData(
|
|
14508
14508
|
S
|
|
14509
14509
|
), k = C && Object.values(C) || [];
|
|
14510
14510
|
return C && k.length > 0 && f ? k.filter(
|
|
@@ -14515,43 +14515,43 @@ const A = class A extends Zi {
|
|
|
14515
14515
|
}
|
|
14516
14516
|
},
|
|
14517
14517
|
stopDraw: (p) => {
|
|
14518
|
-
if (
|
|
14518
|
+
if (b.logger.info(
|
|
14519
14519
|
`[ApplianceMultiPlugin] stopDraw ${p}`
|
|
14520
|
-
),
|
|
14521
|
-
return
|
|
14520
|
+
), b.currentManager && G(i))
|
|
14521
|
+
return b.currentManager.stopDraw(p);
|
|
14522
14522
|
},
|
|
14523
14523
|
setViewLocalScenePathChange: async (p, f) => {
|
|
14524
|
-
|
|
14524
|
+
b.logger.info(
|
|
14525
14525
|
`[ApplianceMultiPlugin] setViewLocalScenePathChange ${p} ${f}`
|
|
14526
|
-
),
|
|
14526
|
+
), b.currentManager && await b.currentManager.setViewLocalScenePathChange(
|
|
14527
14527
|
f,
|
|
14528
14528
|
p
|
|
14529
14529
|
);
|
|
14530
14530
|
},
|
|
14531
14531
|
insertMarkmap: async (p, f) => {
|
|
14532
|
-
if (
|
|
14532
|
+
if (b.logger.info(
|
|
14533
14533
|
`[ApplianceMultiPlugin] insertMarkmap: ${p}, info: ${JSON.stringify(f)}`
|
|
14534
|
-
),
|
|
14535
|
-
return
|
|
14534
|
+
), b.currentManager && b.currentManager.isUseBackgroundThread)
|
|
14535
|
+
return b.currentManager.worker.insertBackgroundMarkMap(
|
|
14536
14536
|
p,
|
|
14537
14537
|
f
|
|
14538
14538
|
);
|
|
14539
14539
|
},
|
|
14540
14540
|
updateMarkmap: async (p, f, N) => {
|
|
14541
|
-
if (
|
|
14541
|
+
if (b.logger.info(
|
|
14542
14542
|
`[ApplianceMultiPlugin] updateMarkmap: ${p}, markmapId: ${f}, info: ${JSON.stringify(N)}`
|
|
14543
|
-
),
|
|
14544
|
-
return
|
|
14543
|
+
), b.currentManager && b.currentManager.isUseBackgroundThread)
|
|
14544
|
+
return b.currentManager.worker.updateBackgroundMarkMap(
|
|
14545
14545
|
p,
|
|
14546
14546
|
f,
|
|
14547
14547
|
N
|
|
14548
14548
|
);
|
|
14549
14549
|
},
|
|
14550
14550
|
insertBackgroundImage: async (p, f) => {
|
|
14551
|
-
if (
|
|
14551
|
+
if (b.logger.info(
|
|
14552
14552
|
`[ApplianceMultiPlugin] insertBackgroundImage: ${p}, info: ${JSON.stringify(f)}`
|
|
14553
|
-
),
|
|
14554
|
-
return
|
|
14553
|
+
), b.currentManager && b.currentManager.isUseBackgroundThread)
|
|
14554
|
+
return b.currentManager.worker.insertBackgroundSVG(
|
|
14555
14555
|
p,
|
|
14556
14556
|
f
|
|
14557
14557
|
);
|
|
@@ -14615,16 +14615,16 @@ const A = class A extends Zi {
|
|
|
14615
14615
|
get() {
|
|
14616
14616
|
return g.getDisableEraseImage();
|
|
14617
14617
|
}
|
|
14618
|
-
}), u &&
|
|
14618
|
+
}), u && b.currentManager && (b.currentManager.bindPlugin(u), u.init(i)), e._appliancePlugin = y, e._appliancePlugin;
|
|
14619
14619
|
}
|
|
14620
14620
|
static onCreate(e) {
|
|
14621
|
-
e &&
|
|
14621
|
+
e && b.currentManager && (b.currentManager.bindPlugin(
|
|
14622
14622
|
e
|
|
14623
14623
|
), e.init(e.displayer));
|
|
14624
14624
|
}
|
|
14625
14625
|
static async createApplianceMultiPlugin(e, t) {
|
|
14626
14626
|
try {
|
|
14627
|
-
await e.createInvisiblePlugin(
|
|
14627
|
+
await e.createInvisiblePlugin(b, {});
|
|
14628
14628
|
} catch (o) {
|
|
14629
14629
|
if (!e.isWritable) {
|
|
14630
14630
|
await e.setWritable(!0);
|
|
@@ -14634,7 +14634,7 @@ const A = class A extends Zi {
|
|
|
14634
14634
|
throw o;
|
|
14635
14635
|
}
|
|
14636
14636
|
let i = e.getInvisiblePlugin(t);
|
|
14637
|
-
return i || (i = await
|
|
14637
|
+
return i || (i = await b.createApplianceMultiPlugin(e, t)), i;
|
|
14638
14638
|
}
|
|
14639
14639
|
// static onDestroy(plugin: ApplianceMultiPlugin) {}
|
|
14640
14640
|
get isReplay() {
|
|
@@ -14646,9 +14646,9 @@ const A = class A extends Zi {
|
|
|
14646
14646
|
init(e) {
|
|
14647
14647
|
var i, o;
|
|
14648
14648
|
const t = e.state;
|
|
14649
|
-
(i =
|
|
14649
|
+
(i = b.currentManager) == null || i.onRoomMembersChange(
|
|
14650
14650
|
t.roomMembers
|
|
14651
|
-
), G(e) && ((o =
|
|
14651
|
+
), G(e) && ((o = b.currentManager) == null || o.onMemberChange(
|
|
14652
14652
|
t.memberState
|
|
14653
14653
|
)), this.displayer.callbacks.on(
|
|
14654
14654
|
this.callbackName,
|
|
@@ -14660,31 +14660,31 @@ const A = class A extends Zi {
|
|
|
14660
14660
|
}
|
|
14661
14661
|
destroy() {
|
|
14662
14662
|
var e;
|
|
14663
|
-
|
|
14663
|
+
b.logger.info("[ApplianceMultiPlugin] passive destroy"), (e = b.currentManager) == null || e.destroy(), b.currentManager = void 0;
|
|
14664
14664
|
}
|
|
14665
14665
|
};
|
|
14666
14666
|
// 组件类型,该组件的唯一识别符。应该取一个独特的名字,以和其他组件区分。
|
|
14667
|
-
I(
|
|
14667
|
+
I(b, "kind", "appliance-multi-plugin"), I(b, "currentManager"), I(b, "logger", {
|
|
14668
14668
|
info: console.log,
|
|
14669
14669
|
warn: console.warn,
|
|
14670
14670
|
error: console.error
|
|
14671
|
-
}), I(
|
|
14672
|
-
|
|
14671
|
+
}), I(b, "createCurrentManager", (e, t, i) => {
|
|
14672
|
+
b.currentManager && b.currentManager.destroy();
|
|
14673
14673
|
const o = {
|
|
14674
14674
|
plugin: i,
|
|
14675
14675
|
displayer: e.displayer,
|
|
14676
14676
|
options: t
|
|
14677
14677
|
}, s = new ct(o);
|
|
14678
|
-
if (
|
|
14678
|
+
if (b.logger.info(
|
|
14679
14679
|
"[ApplianceMultiPlugin] refresh ApplianceMultiManager object"
|
|
14680
|
-
), s.setWindowManager(e),
|
|
14680
|
+
), s.setWindowManager(e), b.currentManager = s, e.room) {
|
|
14681
14681
|
const a = s.hasOffscreenCanvas;
|
|
14682
14682
|
e.room.logger.info(
|
|
14683
14683
|
`[ApplianceMultiPlugin] use ${a ? "worker" : "mainThread"}`
|
|
14684
14684
|
);
|
|
14685
14685
|
}
|
|
14686
14686
|
});
|
|
14687
|
-
let Bi =
|
|
14687
|
+
let Bi = b;
|
|
14688
14688
|
var Sy = He, ky = function() {
|
|
14689
14689
|
return Sy.Date.now();
|
|
14690
14690
|
}, xy = ky, jy = /\s/;
|
|
@@ -14724,19 +14724,19 @@ function qy(r, n, e) {
|
|
|
14724
14724
|
throw new TypeError(Jy);
|
|
14725
14725
|
n = Vi(n) || 0, Hy(e) && (h = !!e.leading, u = "maxWait" in e, o = u ? Xy(Vi(e.maxWait) || 0, n) : o, g = "trailing" in e ? !!e.trailing : g);
|
|
14726
14726
|
function M(k) {
|
|
14727
|
-
var v = t,
|
|
14728
|
-
return t = i = void 0, l = k, s = r.apply(
|
|
14727
|
+
var v = t, A = i;
|
|
14728
|
+
return t = i = void 0, l = k, s = r.apply(A, v), s;
|
|
14729
14729
|
}
|
|
14730
14730
|
function d(k) {
|
|
14731
14731
|
return l = k, a = setTimeout(p, n), h ? M(k) : s;
|
|
14732
14732
|
}
|
|
14733
14733
|
function y(k) {
|
|
14734
|
-
var v = k - c,
|
|
14735
|
-
return u ? Ky(P, o -
|
|
14734
|
+
var v = k - c, A = k - l, P = n - v;
|
|
14735
|
+
return u ? Ky(P, o - A) : P;
|
|
14736
14736
|
}
|
|
14737
14737
|
function w(k) {
|
|
14738
|
-
var v = k - c,
|
|
14739
|
-
return c === void 0 || v >= n || v < 0 || u &&
|
|
14738
|
+
var v = k - c, A = k - l;
|
|
14739
|
+
return c === void 0 || v >= n || v < 0 || u && A >= o;
|
|
14740
14740
|
}
|
|
14741
14741
|
function p() {
|
|
14742
14742
|
var k = mn();
|
|
@@ -15142,9 +15142,9 @@ const D = class D extends Zi {
|
|
|
15142
15142
|
);
|
|
15143
15143
|
let S = w, C = p, k = f.scale;
|
|
15144
15144
|
S > this.maxScreenshotWidth && (k = this.maxScreenshotWidth / S * k, S = this.maxScreenshotWidth), C > this.maxScreenshotHeight && (k = Math.min(this.maxScreenshotHeight / C * k, k), C = this.maxScreenshotHeight), f.scale = k;
|
|
15145
|
-
const v = document.createElement("canvas"),
|
|
15146
|
-
v.width = S * (N || 1), v.height = C * (N || 1),
|
|
15147
|
-
|
|
15145
|
+
const v = document.createElement("canvas"), A = v.getContext("2d");
|
|
15146
|
+
v.width = S * (N || 1), v.height = C * (N || 1), A && (e.screenshotToCanvas(
|
|
15147
|
+
A,
|
|
15148
15148
|
y,
|
|
15149
15149
|
S,
|
|
15150
15150
|
C,
|
|
@@ -15193,15 +15193,15 @@ const D = class D extends Zi {
|
|
|
15193
15193
|
width: N,
|
|
15194
15194
|
height: S
|
|
15195
15195
|
});
|
|
15196
|
-
let k = Math.max(C == null ? void 0 : C.width, N), v = Math.max(C == null ? void 0 : C.height, S),
|
|
15197
|
-
const P = k > N && Math.min(N / k,
|
|
15198
|
-
P <= E ? (k = P < 1 && N || k, v = Math.floor(v * P) + 1,
|
|
15196
|
+
let k = Math.max(C == null ? void 0 : C.width, N), v = Math.max(C == null ? void 0 : C.height, S), A = 1;
|
|
15197
|
+
const P = k > N && Math.min(N / k, A) || A, E = v > S && Math.min(S / v, A) || A;
|
|
15198
|
+
P <= E ? (k = P < 1 && N || k, v = Math.floor(v * P) + 1, A = P) : P > E && (v = E < 1 && S || v, k = Math.floor(k * E) + 1, A = E);
|
|
15199
15199
|
const O = {
|
|
15200
|
-
scale:
|
|
15200
|
+
scale: A,
|
|
15201
15201
|
centerX: C.originX + C.width / 2,
|
|
15202
15202
|
centerY: C.originY + C.height / 2
|
|
15203
|
-
},
|
|
15204
|
-
|
|
15203
|
+
}, z = document.createElement("canvas"), L = z.getContext("2d");
|
|
15204
|
+
z.width = k, z.height = v, L && await this.screenshotToCanvasAsync(
|
|
15205
15205
|
L,
|
|
15206
15206
|
d,
|
|
15207
15207
|
k,
|
|
@@ -15210,10 +15210,10 @@ const D = class D extends Zi {
|
|
|
15210
15210
|
devicePixelRatio
|
|
15211
15211
|
);
|
|
15212
15212
|
const j = document.createElement("img");
|
|
15213
|
-
j.className = "appliance-plugin-fill-scene-snapshot-img", j.src =
|
|
15214
|
-
|
|
15213
|
+
j.className = "appliance-plugin-fill-scene-snapshot-img", j.src = z.toDataURL(), j.onload = () => {
|
|
15214
|
+
z.remove();
|
|
15215
15215
|
}, j.onerror = () => {
|
|
15216
|
-
|
|
15216
|
+
z.remove(), j.remove();
|
|
15217
15217
|
}, y.append(j), getComputedStyle(y).position || (y.style.position = "relative");
|
|
15218
15218
|
},
|
|
15219
15219
|
_callbacksOn: function(d, y) {
|
|
@@ -15435,8 +15435,8 @@ const D = class D extends Zi {
|
|
|
15435
15435
|
d({
|
|
15436
15436
|
didTimeout: k,
|
|
15437
15437
|
timeRemaining: () => {
|
|
15438
|
-
const
|
|
15439
|
-
return Math.max(0, w -
|
|
15438
|
+
const A = performance.now() - p;
|
|
15439
|
+
return Math.max(0, w - A);
|
|
15440
15440
|
}
|
|
15441
15441
|
});
|
|
15442
15442
|
} catch (v) {
|