@netless/appliance-plugin 1.1.30-beta.0 → 1.1.30-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/cdn.js +1 -1
- package/cdn/{fullWorker-CWzLC1.js → fullWorker-p8falm.js} +1 -1
- package/cdn/{subWorker-Bb5WAj.js → subWorker-C9RT-E.js} +1 -1
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/fullWorker.js +1 -1
- package/dist/{index-OkrVupZ5.mjs → index-BD54IjWE.mjs} +3 -3
- package/dist/{index-GdF83s93.js → index-BzAXfqUt.js} +1 -1
- package/dist/{index-CaGxVP6U.mjs → index-DISopYJV.mjs} +105 -105
- package/dist/{index-ELCL_4SK.js → index-Dl9SVLOP.js} +2 -2
- package/dist/{index-Cp4iDsa1.mjs → index-if-UBrhO.mjs} +1 -1
- package/dist/{index-DIJe5ta7.js → index-rYoIjlxS.js} +1 -1
- package/dist/subWorker.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var K = Object.defineProperty;
|
|
2
2
|
var j = (o, e, t) => e in o ? K(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { E as B, a as k, b as D, c as x, d as E, V as P, S as Z } from "./index-
|
|
3
|
+
var u = (o, e, t) => j(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { E as B, a as k, b as D, c as x, d as E, V as P, S as Z } from "./index-BD54IjWE.mjs";
|
|
5
5
|
import { isEqual as W, isString as _, clone as J, throttle as Q } from "lodash";
|
|
6
6
|
import "white-web-sdk";
|
|
7
7
|
import "spritejs";
|
|
@@ -16,7 +16,7 @@ import { Transformer as ee } from "markmap-lib";
|
|
|
16
16
|
import { O as te } from "./ObserverMap-BudneEfB.mjs";
|
|
17
17
|
class re {
|
|
18
18
|
constructor() {
|
|
19
|
-
|
|
19
|
+
u(this, "threadEngine");
|
|
20
20
|
}
|
|
21
21
|
registerBackgroundThread(e) {
|
|
22
22
|
return this.threadEngine = e, this;
|
|
@@ -25,7 +25,7 @@ class re {
|
|
|
25
25
|
class ae extends re {
|
|
26
26
|
constructor() {
|
|
27
27
|
super(...arguments);
|
|
28
|
-
|
|
28
|
+
u(this, "emitEventType", B.CopyNode);
|
|
29
29
|
}
|
|
30
30
|
async consume(t) {
|
|
31
31
|
const { msgType: r, dataType: s, emitEventType: i } = t;
|
|
@@ -40,7 +40,7 @@ class ae extends re {
|
|
|
40
40
|
}
|
|
41
41
|
class se {
|
|
42
42
|
constructor(e) {
|
|
43
|
-
|
|
43
|
+
u(this, "builders", /* @__PURE__ */ new Map());
|
|
44
44
|
this.builders = new Map(e.map((t) => [t, this.build(t)]));
|
|
45
45
|
}
|
|
46
46
|
build(e) {
|
|
@@ -83,7 +83,7 @@ function oe() {
|
|
|
83
83
|
const I = class I {
|
|
84
84
|
constructor() {
|
|
85
85
|
// 使用 workId 作为 key,存储每个实例的 mermaid 代码块
|
|
86
|
-
|
|
86
|
+
u(this, "mermaidCodeBlocksByWorkId", /* @__PURE__ */ new Map());
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* 获取 MermaidManager 单例实例
|
|
@@ -136,10 +136,10 @@ const I = class I {
|
|
|
136
136
|
extendMarkdown(e, t) {
|
|
137
137
|
const r = e.md.renderer, s = r.rules.fence, i = this;
|
|
138
138
|
r.rules.fence = (a, n, c, d, w) => {
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
139
|
+
const p = a[n];
|
|
140
|
+
if (p.info.trim() === "mermaid") {
|
|
141
141
|
const g = i.generateId();
|
|
142
|
-
return i.createContainer(g,
|
|
142
|
+
return i.createContainer(g, p.content, t);
|
|
143
143
|
}
|
|
144
144
|
return s ? s(a, n, c, d, w) : "";
|
|
145
145
|
};
|
|
@@ -165,7 +165,7 @@ const I = class I {
|
|
|
165
165
|
I.getInstance().extendMarkdown(e, t);
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
|
-
|
|
168
|
+
u(I, "instance", null);
|
|
169
169
|
let b = I;
|
|
170
170
|
class T {
|
|
171
171
|
/**
|
|
@@ -222,29 +222,29 @@ class T {
|
|
|
222
222
|
return;
|
|
223
223
|
const a = Array.from(s).map(
|
|
224
224
|
async (n, c) => {
|
|
225
|
-
const d = n, w = d.getAttribute("data-mermaid-id"),
|
|
225
|
+
const d = n, w = d.getAttribute("data-mermaid-id"), p = w ? b.getCode(w, t) : void 0, l = d.querySelector(
|
|
226
226
|
".mermaid-placeholder"
|
|
227
227
|
);
|
|
228
|
-
if (!(!l || !
|
|
228
|
+
if (!(!l || !p))
|
|
229
229
|
try {
|
|
230
|
-
const f = `mermaid-${t.replace(/[^a-zA-Z0-9_-]/g, "-")}-${Date.now()}-${c}`, { svg: v } = await r.render(f,
|
|
230
|
+
const f = `mermaid-${t.replace(/[^a-zA-Z0-9_-]/g, "-")}-${Date.now()}-${c}`, { svg: v } = await r.render(f, p);
|
|
231
231
|
if (l && l.parentNode) {
|
|
232
232
|
const y = document.createElement("div");
|
|
233
233
|
y.innerHTML = v;
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
if (!
|
|
237
|
-
const A =
|
|
234
|
+
const m = y.querySelector("svg");
|
|
235
|
+
if (m) {
|
|
236
|
+
if (!m.getAttribute("viewBox") && m.getAttribute("width") && m.getAttribute("height")) {
|
|
237
|
+
const A = m.getAttribute("width"), S = m.getAttribute("height"), M = parseFloat((A == null ? void 0 : A.replace(/px|%/, "")) || "0"), O = parseFloat(
|
|
238
238
|
(S == null ? void 0 : S.replace(/px|%/, "")) || "0"
|
|
239
239
|
);
|
|
240
|
-
M > 0 && O > 0 &&
|
|
240
|
+
M > 0 && O > 0 && m.setAttribute(
|
|
241
241
|
"viewBox",
|
|
242
242
|
`0 0 ${M} ${O}`
|
|
243
243
|
);
|
|
244
244
|
}
|
|
245
|
-
|
|
246
|
-
const
|
|
247
|
-
|
|
245
|
+
m.style.display = "block", m.style.maxWidth = "100%", m.style.width = "auto", m.style.height = "auto", m.style.overflow = "visible", m.style.verticalAlign = "top", m.style.objectFit = "contain";
|
|
246
|
+
const h = document.createElement("div");
|
|
247
|
+
h.className = "mermaid-wrapper", h.style.width = "100%", h.style.height = "auto", h.style.overflow = "hidden", h.style.display = "inline-block", h.style.verticalAlign = "top", h.style.margin = "0", h.style.padding = "0", h.style.boxSizing = "border-box", h.style.position = "relative", this.isSafari() && (h.style.clipPath = "inset(100% 0 0 0)", h.style.pointerEvents = "none"), h.appendChild(m), m.style.width = "100%", m.style.height = "100%", m.style.maxWidth = "100%", m.style.maxHeight = "100%", m.style.objectFit = "contain", m.setAttribute("data-type", "mermaid"), this.isSafari() && (m.style.opacity = "0"), l.parentNode.replaceChild(h, l);
|
|
248
248
|
} else
|
|
249
249
|
l.outerHTML = v;
|
|
250
250
|
}
|
|
@@ -305,7 +305,7 @@ class T {
|
|
|
305
305
|
), d = c == null ? void 0 : c.getAttribute("data-mermaid-id");
|
|
306
306
|
if (d)
|
|
307
307
|
try {
|
|
308
|
-
const w = parseFloat(a.getAttribute("x") || "0"),
|
|
308
|
+
const w = parseFloat(a.getAttribute("x") || "0"), p = parseFloat(a.getAttribute("y") || "0"), l = parseFloat(
|
|
309
309
|
a.getAttribute("width") || "0"
|
|
310
310
|
), g = parseFloat(
|
|
311
311
|
a.getAttribute("height") || "0"
|
|
@@ -317,50 +317,50 @@ class T {
|
|
|
317
317
|
return;
|
|
318
318
|
let v = f.getAttribute("transform");
|
|
319
319
|
if (!v)
|
|
320
|
-
v = `translate(${w}, ${
|
|
320
|
+
v = `translate(${w}, ${p})`;
|
|
321
321
|
else {
|
|
322
322
|
const S = v.match(
|
|
323
323
|
/translate\(([^,]+),([^)]+)\)/
|
|
324
324
|
);
|
|
325
325
|
if (S) {
|
|
326
|
-
const M = parseFloat(S[1]), O = parseFloat(S[2]), F = M + w, R = O +
|
|
326
|
+
const M = parseFloat(S[1]), O = parseFloat(S[2]), F = M + w, R = O + p;
|
|
327
327
|
v = v.replace(
|
|
328
328
|
/translate\([^)]+\)/,
|
|
329
329
|
`translate(${F}, ${R})`
|
|
330
330
|
);
|
|
331
331
|
} else
|
|
332
|
-
v = `translate(${w}, ${
|
|
332
|
+
v = `translate(${w}, ${p}) ${v}`;
|
|
333
333
|
}
|
|
334
334
|
const y = e.querySelector(
|
|
335
335
|
`g[data-mermaid-wrapper][data-mermaid-id="${d}"][data-mermaid-clone="true"]`
|
|
336
336
|
);
|
|
337
|
-
let
|
|
337
|
+
let m;
|
|
338
338
|
if (y) {
|
|
339
|
-
|
|
340
|
-
const S =
|
|
341
|
-
S &&
|
|
339
|
+
m = y;
|
|
340
|
+
const S = m.querySelector('svg[data-type="mermaid"]');
|
|
341
|
+
S && m.removeChild(S);
|
|
342
342
|
} else
|
|
343
|
-
|
|
343
|
+
m = document.createElementNS(
|
|
344
344
|
"http://www.w3.org/2000/svg",
|
|
345
345
|
"g"
|
|
346
|
-
),
|
|
347
|
-
|
|
348
|
-
const
|
|
349
|
-
if (
|
|
350
|
-
const S =
|
|
346
|
+
), m.setAttribute("data-mermaid-wrapper", "true"), m.setAttribute("data-mermaid-clone", "true"), m.setAttribute("data-mermaid-id", d);
|
|
347
|
+
m.setAttribute("transform", v);
|
|
348
|
+
const h = n.cloneNode(!0);
|
|
349
|
+
if (h.setAttribute("width", l.toString()), h.setAttribute("height", g.toString()), h.setAttribute("data-mermaid-transformed", "true"), h.style.width = "", h.style.height = "", h.style.maxWidth = "", h.style.maxHeight = "", h.style.transform = "", h.style.transformOrigin = "", h.style.display = "block", h.style.overflow = "visible", h.style.opacity = "1", !h.getAttribute("viewBox")) {
|
|
350
|
+
const S = h.getAttribute("width"), M = h.getAttribute("height");
|
|
351
351
|
if (S && M) {
|
|
352
352
|
const O = parseFloat(
|
|
353
353
|
S.replace(/px|%/, "") || "0"
|
|
354
354
|
), F = parseFloat(
|
|
355
355
|
M.replace(/px|%/, "") || "0"
|
|
356
356
|
);
|
|
357
|
-
O > 0 && F > 0 &&
|
|
357
|
+
O > 0 && F > 0 && h.setAttribute(
|
|
358
358
|
"viewBox",
|
|
359
359
|
`0 0 ${O} ${F}`
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
|
|
363
|
+
m.appendChild(h), y || (f && f.parentNode ? f.parentNode.insertBefore(m, f.nextSibling) : e.appendChild(m)), c && (c.style.opacity = "0", c.style.pointerEvents = "none");
|
|
364
364
|
} catch (w) {
|
|
365
365
|
console.error("[transformMermaidSvgToMarkmapSvg] error: ", w);
|
|
366
366
|
}
|
|
@@ -380,10 +380,10 @@ class T {
|
|
|
380
380
|
const s = [], i = t.split(`
|
|
381
381
|
`);
|
|
382
382
|
let a = "", n = !1, c = [], d = -1;
|
|
383
|
-
for (let
|
|
384
|
-
const l = i[
|
|
383
|
+
for (let p = 0; p < i.length; p++) {
|
|
384
|
+
const l = i[p], g = l.match(/^(#{1,6})\s+(.+)$/);
|
|
385
385
|
if (g && (a = g[2].trim()), l.trim().startsWith("```mermaid"))
|
|
386
|
-
n = !0, c = [], d =
|
|
386
|
+
n = !0, c = [], d = p;
|
|
387
387
|
else if (n && l.trim() === "```") {
|
|
388
388
|
n = !1;
|
|
389
389
|
const f = c.join(`
|
|
@@ -395,9 +395,9 @@ class T {
|
|
|
395
395
|
}), c = [];
|
|
396
396
|
} else n && c.push(l);
|
|
397
397
|
}
|
|
398
|
-
const w = (
|
|
399
|
-
if (!
|
|
400
|
-
const l =
|
|
398
|
+
const w = (p) => {
|
|
399
|
+
if (!p) return;
|
|
400
|
+
const l = p.content || "", g = T.decodeHtmlEntities(l);
|
|
401
401
|
for (const f of s)
|
|
402
402
|
if (g.includes(f.title) || l.includes(f.title)) {
|
|
403
403
|
const v = b.generateId(), y = b.createContainer(
|
|
@@ -405,10 +405,10 @@ class T {
|
|
|
405
405
|
f.content,
|
|
406
406
|
r
|
|
407
407
|
);
|
|
408
|
-
|
|
408
|
+
p.content ? p.content = p.content + y : p.content = y;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
|
-
|
|
411
|
+
p.children && p.children.length > 0 && p.children.forEach((f) => {
|
|
412
412
|
w(f);
|
|
413
413
|
});
|
|
414
414
|
};
|
|
@@ -435,7 +435,7 @@ class T {
|
|
|
435
435
|
class U extends ee {
|
|
436
436
|
constructor(t) {
|
|
437
437
|
super(t);
|
|
438
|
-
|
|
438
|
+
u(this, "currentWorkId", null);
|
|
439
439
|
}
|
|
440
440
|
/**
|
|
441
441
|
* 设置当前工作 ID(用于命名空间隔离)
|
|
@@ -528,17 +528,17 @@ class U extends ee {
|
|
|
528
528
|
if (!c || a.has(c) || (a.add(c), n.complete && n.naturalWidth > 0))
|
|
529
529
|
return;
|
|
530
530
|
const d = new Promise((w) => {
|
|
531
|
-
const
|
|
531
|
+
const p = setTimeout(() => {
|
|
532
532
|
w();
|
|
533
533
|
}, r);
|
|
534
534
|
if (n.complete && n.naturalWidth > 0) {
|
|
535
|
-
clearTimeout(
|
|
535
|
+
clearTimeout(p), w();
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
538
538
|
const l = () => {
|
|
539
|
-
clearTimeout(
|
|
539
|
+
clearTimeout(p), n.removeEventListener("load", l), n.removeEventListener("error", g), w();
|
|
540
540
|
}, g = () => {
|
|
541
|
-
clearTimeout(
|
|
541
|
+
clearTimeout(p), n.removeEventListener("load", l), n.removeEventListener("error", g), w();
|
|
542
542
|
};
|
|
543
543
|
n.addEventListener("load", l), n.addEventListener("error", g), !n.src && c && (n.src = c);
|
|
544
544
|
});
|
|
@@ -593,7 +593,7 @@ async function me(o) {
|
|
|
593
593
|
await new Promise((a) => setTimeout(a, 50));
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
-
async function
|
|
596
|
+
async function pe(o) {
|
|
597
597
|
const e = o.querySelectorAll("svg");
|
|
598
598
|
if (!e.length)
|
|
599
599
|
return;
|
|
@@ -629,7 +629,7 @@ async function G(o) {
|
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
async function
|
|
632
|
+
async function ue(o, e = {}) {
|
|
633
633
|
const { width: t = o.offsetWidth, height: r = o.offsetHeight } = e, s = o.offsetWidth || t, i = o.offsetHeight || r;
|
|
634
634
|
try {
|
|
635
635
|
const { loadSvgToImageLib: a, getSvgToImageLib: n } = await import("./svgToImageLoader-mXH53h-l.mjs");
|
|
@@ -640,7 +640,7 @@ async function pe(o, e = {}) {
|
|
|
640
640
|
} catch (l) {
|
|
641
641
|
return console.error("[loadSvgToImageLib] error: ", l), null;
|
|
642
642
|
}
|
|
643
|
-
const d = o.style.width, w = o.style.height,
|
|
643
|
+
const d = o.style.width, w = o.style.height, p = o.style.display;
|
|
644
644
|
o.style.width || (o.style.width = `${s}px`), o.style.height || (o.style.height = `${i}px`), (!o.style.display || o.style.display === "none") && (o.style.display = "block");
|
|
645
645
|
try {
|
|
646
646
|
await new Promise((g) => {
|
|
@@ -655,7 +655,7 @@ async function pe(o, e = {}) {
|
|
|
655
655
|
height: i,
|
|
656
656
|
quality: 1
|
|
657
657
|
});
|
|
658
|
-
return o.style.width = d, o.style.height = w, o.style.display =
|
|
658
|
+
return o.style.width = d, o.style.height = w, o.style.display = p, new Promise((g) => {
|
|
659
659
|
const f = new Image();
|
|
660
660
|
f.crossOrigin = "anonymous", f.onload = () => {
|
|
661
661
|
g(f);
|
|
@@ -664,7 +664,7 @@ async function pe(o, e = {}) {
|
|
|
664
664
|
}, f.src = l;
|
|
665
665
|
});
|
|
666
666
|
} catch (l) {
|
|
667
|
-
return o.style.width = d, o.style.height = w, o.style.display =
|
|
667
|
+
return o.style.width = d, o.style.height = w, o.style.display = p, console.error("[divToImageElement] error: ", l), null;
|
|
668
668
|
}
|
|
669
669
|
} catch (a) {
|
|
670
670
|
return console.error("[divToImageElement] error: ", a), null;
|
|
@@ -672,14 +672,14 @@ async function pe(o, e = {}) {
|
|
|
672
672
|
}
|
|
673
673
|
class ge {
|
|
674
674
|
constructor(e) {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
675
|
+
u(this, "toolsType", x.BackgroundSVG);
|
|
676
|
+
u(this, "vNodes");
|
|
677
|
+
u(this, "workOptions");
|
|
678
|
+
u(this, "workId");
|
|
679
|
+
u(this, "markmapInstance", null);
|
|
680
|
+
u(this, "isDestroyed", !1);
|
|
681
|
+
u(this, "element");
|
|
682
|
+
u(this, "manager");
|
|
683
683
|
const { vNodes: t, workId: r, toolsOpt: s, manager: i } = e;
|
|
684
684
|
this.workId = r, this.vNodes = t, this.workOptions = s, this.manager = i, this.element = this.createElement(), this.manager.fullLayer.appendChild(this.element), this.vNodes.setInfo(this.workId, {
|
|
685
685
|
workShape: this
|
|
@@ -741,8 +741,8 @@ class ge {
|
|
|
741
741
|
this.element,
|
|
742
742
|
this.manager.markmapOptions
|
|
743
743
|
), this.markmapInstance.handleClick = async (n, c) => {
|
|
744
|
-
var
|
|
745
|
-
(
|
|
744
|
+
var p, l, g;
|
|
745
|
+
(p = this.markmapInstance) == null || p.toggleNode(c);
|
|
746
746
|
const d = this.serializeData((l = this.markmapInstance) == null ? void 0 : l.state.data);
|
|
747
747
|
this.setWorkOptions(
|
|
748
748
|
{
|
|
@@ -853,9 +853,9 @@ function X(o) {
|
|
|
853
853
|
}
|
|
854
854
|
class Y {
|
|
855
855
|
constructor(e) {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
856
|
+
u(this, "viewId");
|
|
857
|
+
u(this, "fullLayer");
|
|
858
|
+
u(this, "curNodeMap");
|
|
859
859
|
this.viewId = e, this.curNodeMap = new te();
|
|
860
860
|
}
|
|
861
861
|
init(e) {
|
|
@@ -890,14 +890,14 @@ class Y {
|
|
|
890
890
|
}
|
|
891
891
|
class fe {
|
|
892
892
|
constructor(e, t) {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
893
|
+
u(this, "opt");
|
|
894
|
+
u(this, "viewId");
|
|
895
|
+
u(this, "fullLayer");
|
|
896
|
+
u(this, "vNodes");
|
|
897
|
+
u(this, "master");
|
|
898
|
+
u(this, "cameraOpt");
|
|
899
|
+
u(this, "methodBuilder");
|
|
900
|
+
u(this, "updateCamera", Q(async (e) => {
|
|
901
901
|
const { cameraOpt: t } = e;
|
|
902
902
|
t && !W(this.cameraOpt, t) && await this.setCameraOpt(t);
|
|
903
903
|
}, 100));
|
|
@@ -1026,13 +1026,13 @@ class fe {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
class we {
|
|
1028
1028
|
constructor(e, t) {
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1029
|
+
u(this, "viewId");
|
|
1030
|
+
u(this, "fullLayer");
|
|
1031
|
+
u(this, "master");
|
|
1032
|
+
u(this, "vNodes");
|
|
1033
|
+
u(this, "cameraOpt");
|
|
1034
|
+
u(this, "opt");
|
|
1035
|
+
u(this, "workShapes", /* @__PURE__ */ new Map());
|
|
1036
1036
|
this.viewId = e, this.opt = t, this.master = t.master, this.fullLayer = t.container, this.vNodes = new Y(e), this.vNodes.init(this.fullLayer);
|
|
1037
1037
|
}
|
|
1038
1038
|
get camera() {
|
|
@@ -1095,8 +1095,8 @@ class we {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
try {
|
|
1097
1097
|
if (t) {
|
|
1098
|
-
await G(this.fullLayer), await de(this.fullLayer), await
|
|
1099
|
-
const i = await
|
|
1098
|
+
await G(this.fullLayer), await de(this.fullLayer), await pe(this.fullLayer);
|
|
1099
|
+
const i = await ue(this.fullLayer);
|
|
1100
1100
|
i && this.opt.post({
|
|
1101
1101
|
sp: [
|
|
1102
1102
|
{
|
|
@@ -1156,10 +1156,10 @@ class we {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
class We {
|
|
1158
1158
|
constructor(e) {
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1159
|
+
u(this, "backgroundThreadMap", /* @__PURE__ */ new Map());
|
|
1160
|
+
u(this, "snapshotThread");
|
|
1161
|
+
u(this, "master");
|
|
1162
|
+
u(this, "post", (e) => {
|
|
1163
1163
|
const { sp: t } = e;
|
|
1164
1164
|
t && this.master.collectorSyncData(t);
|
|
1165
1165
|
});
|
|
@@ -1178,7 +1178,7 @@ class We {
|
|
|
1178
1178
|
msgType: c,
|
|
1179
1179
|
viewId: d,
|
|
1180
1180
|
layerOpt: w,
|
|
1181
|
-
offscreenCanvasOpt:
|
|
1181
|
+
offscreenCanvasOpt: p,
|
|
1182
1182
|
cameraOpt: l,
|
|
1183
1183
|
tasksqueue: g,
|
|
1184
1184
|
mainTasksqueueCount: f
|
|
@@ -1188,30 +1188,30 @@ class We {
|
|
|
1188
1188
|
continue;
|
|
1189
1189
|
}
|
|
1190
1190
|
if (c === k.Init) {
|
|
1191
|
-
const y = (t = this.master.control.viewContainerManager.getView(d)) == null ? void 0 : t.displayer,
|
|
1192
|
-
if (y &&
|
|
1193
|
-
const
|
|
1191
|
+
const y = (t = this.master.control.viewContainerManager.getView(d)) == null ? void 0 : t.displayer, m = (r = y == null ? void 0 : y.backgroundContainerRef) == null ? void 0 : r.current;
|
|
1192
|
+
if (y && m && w && p) {
|
|
1193
|
+
const h = this.createBackgroundThread(d, {
|
|
1194
1194
|
displayer: y,
|
|
1195
|
-
container:
|
|
1195
|
+
container: m,
|
|
1196
1196
|
layerOpt: w,
|
|
1197
1197
|
master: this.master,
|
|
1198
|
-
canvasOpt:
|
|
1198
|
+
canvasOpt: p,
|
|
1199
1199
|
post: this.post
|
|
1200
1200
|
});
|
|
1201
|
-
this.backgroundThreadMap.set(d,
|
|
1201
|
+
this.backgroundThreadMap.set(d, h), h && l && await h.setCameraOpt(l);
|
|
1202
1202
|
}
|
|
1203
1203
|
continue;
|
|
1204
1204
|
}
|
|
1205
|
-
if (c === k.Snapshot
|
|
1206
|
-
const y = (
|
|
1205
|
+
if (c === k.Snapshot) {
|
|
1206
|
+
const y = (s = this.master.control.viewContainerManager.getView(d)) == null ? void 0 : s.displayer, h = (a = ((i = this.master.control.viewContainerManager.mainView) == null ? void 0 : i.displayer).backgroundSnapshotContainerRef) == null ? void 0 : a.current;
|
|
1207
1207
|
if (y && h && l) {
|
|
1208
1208
|
h.style.width = `${l.width}px`, h.style.height = `${l.height}px`;
|
|
1209
|
-
const
|
|
1209
|
+
const A = {
|
|
1210
1210
|
...P.defaultLayerOpt,
|
|
1211
1211
|
offscreen: !1,
|
|
1212
1212
|
width: l.width,
|
|
1213
1213
|
height: l.height
|
|
1214
|
-
},
|
|
1214
|
+
}, S = {
|
|
1215
1215
|
...P.defaultScreenCanvasOpt,
|
|
1216
1216
|
width: l.width,
|
|
1217
1217
|
height: l.height
|
|
@@ -1219,18 +1219,18 @@ class We {
|
|
|
1219
1219
|
this.snapshotThread = this.createSnapshotThread(d, {
|
|
1220
1220
|
displayer: y,
|
|
1221
1221
|
container: h,
|
|
1222
|
-
layerOpt:
|
|
1222
|
+
layerOpt: A,
|
|
1223
1223
|
master: this.master,
|
|
1224
|
-
canvasOpt:
|
|
1224
|
+
canvasOpt: S,
|
|
1225
1225
|
post: this.post
|
|
1226
1226
|
}), await this.snapshotThread.getSnapshot(n), this.snapshotThread.destroy(), this.snapshotThread = void 0;
|
|
1227
1227
|
continue;
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
1230
|
if (c === k.TasksQueue && (g != null && g.size)) {
|
|
1231
|
-
for (const [y,
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1231
|
+
for (const [y, m] of this.backgroundThreadMap.entries()) {
|
|
1232
|
+
const h = g.get(y);
|
|
1233
|
+
h && (await m.on(h), f && this.post({ workerTasksqueueCount: f }));
|
|
1234
1234
|
}
|
|
1235
1235
|
continue;
|
|
1236
1236
|
}
|