@netless/appliance-plugin 1.1.34-beta.0 → 1.1.34-beta.2
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-A-oik2.js → fullWorker-CuVwdG.js} +1 -1
- package/cdn/{subWorker-hEAHPy.js → subWorker-DhqUsi.js} +1 -1
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/assets/fullWorker-CItZoPtX.js +593 -0
- package/dist/assets/subWorker-DTQZDdFT.js +593 -0
- package/dist/bridge-C4n1zHQZ.mjs +67 -0
- package/dist/bridge-DCJjH18X.js +1 -0
- package/dist/bridge-runtime.d.ts +11 -0
- package/dist/bridge.d.ts +5 -0
- package/dist/bridge.js +1 -0
- package/dist/bridge.mjs +7 -0
- package/dist/collector/collector.d.ts +1 -0
- package/dist/core/mainEngine.d.ts +1 -0
- package/dist/fullWorker.js +1 -1
- package/dist/{index-Ni5Bad0a.js → index-BZopbcnP.js} +1 -1
- package/dist/{index-B5PYiw1o.mjs → index-Bc6Cv0DB.mjs} +25 -27
- package/dist/index-CH_SAlCz.mjs +1255 -0
- package/dist/index-CR9Nc39_.js +1 -0
- package/dist/{index-DzxY6N7c.js → index-CnVA96FG.js} +1 -1
- package/dist/index-CslUUlge.mjs +15783 -0
- package/dist/index-D8qxABte.mjs +9855 -0
- package/dist/{index-D5lBaSz6.mjs → index-DD4uosmt.mjs} +1 -1
- package/dist/index-DjNO25oE.js +1 -0
- package/dist/{index-p4HeEgIq.mjs → index-Djm-u9a7.mjs} +1 -1
- package/dist/index-Dk4BLxV5.js +3 -0
- package/dist/index-DnccF_rY.js +1 -0
- package/dist/plugin/external.bridge.d.ts +1 -0
- package/dist/subWorker.js +1 -1
- package/package.json +18 -2
- package/dist/index-DjSg1GK5.js +0 -1
|
@@ -1142,7 +1142,7 @@ function hg(r) {
|
|
|
1142
1142
|
return cg(r, lg | ug);
|
|
1143
1143
|
}
|
|
1144
1144
|
var dg = hg;
|
|
1145
|
-
const un = /* @__PURE__ */ Pn(dg), vr = "1.1.34-beta.
|
|
1145
|
+
const un = /* @__PURE__ */ Pn(dg), vr = "1.1.34-beta.2", gg = "@netless/appliance-plugin", ji = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
|
|
1146
1146
|
if (typeof window < "u") {
|
|
1147
1147
|
let r = window.__netlessUA || "";
|
|
1148
1148
|
r += ` ${gg}@${vr}`, window.__netlessUA = r;
|
|
@@ -2285,11 +2285,11 @@ const Re = class Re extends RM {
|
|
|
2285
2285
|
"onObjectsLimit",
|
|
2286
2286
|
(p) => p(o, y)
|
|
2287
2287
|
)), !y) {
|
|
2288
|
-
this.
|
|
2288
|
+
this.Logger.error(
|
|
2289
2289
|
`[Appliance]: exceeds the limit of ${o} components, current: ${i}`
|
|
2290
2290
|
), (M = this.control.room) == null || M.disconnect().then(() => {
|
|
2291
2291
|
var p, f, N, S, C;
|
|
2292
|
-
(N = (f = (p = this.control.room) == null ? void 0 : p.callbacks) == null ? void 0 : f.listeners) != null && N.map.onKickedWithReason && (this.
|
|
2292
|
+
(N = (f = (p = this.control.room) == null ? void 0 : p.callbacks) == null ? void 0 : f.listeners) != null && N.map.onKickedWithReason && (this.Logger.info(
|
|
2293
2293
|
"[Appliance]: onKickedWithReason callback is called"
|
|
2294
2294
|
), (C = (S = this.control.room) == null ? void 0 : S.callbacks) == null || C.dispatch(
|
|
2295
2295
|
"onKickedWithReason",
|
|
@@ -2317,6 +2317,9 @@ const Re = class Re extends RM {
|
|
|
2317
2317
|
});
|
|
2318
2318
|
this.syncInterval = i, this.namespace = Re.namespace, this.authSpace = Re.authSpace, this.globalUndoRedoStackSpace = Re.globalUndoRedoStackSpace, this.serviceStorage = this.getNamespaceData(), this.storage = se(this.serviceStorage), this.authStorage = this.getAuthSpaceData(), this.globalUndoRedoStackStorage = {}, this.getLimitNums();
|
|
2319
2319
|
}
|
|
2320
|
+
get Logger() {
|
|
2321
|
+
return this.control.logger;
|
|
2322
|
+
}
|
|
2320
2323
|
hasId(e, t, i) {
|
|
2321
2324
|
const o = this.getLocalId(i) ? this.transformKey(i) : i;
|
|
2322
2325
|
return !!(this.storage[e] && this.storage[e][t] && this.storage[e][t][o]);
|
|
@@ -2727,7 +2730,7 @@ const Re = class Re extends RM {
|
|
|
2727
2730
|
}
|
|
2728
2731
|
runSyncService(e) {
|
|
2729
2732
|
if (!this.control.renderControl.isWritable) {
|
|
2730
|
-
this.
|
|
2733
|
+
this.Logger.error(
|
|
2731
2734
|
"[Appliance]: The current state is not writable and synchronization cannot be synchronized"
|
|
2732
2735
|
);
|
|
2733
2736
|
return;
|
|
@@ -4966,6 +4969,9 @@ class ep extends _M {
|
|
|
4966
4969
|
get isBezier() {
|
|
4967
4970
|
return this.control.pluginOptions.extras.bezier.enable;
|
|
4968
4971
|
}
|
|
4972
|
+
get Logger() {
|
|
4973
|
+
return this.control.logger;
|
|
4974
|
+
}
|
|
4969
4975
|
destroy() {
|
|
4970
4976
|
var e, t, i;
|
|
4971
4977
|
(e = this.methodBuilder) == null || e.destroy(), this.unWritable(), this.taskBatchData.clear(), this.tasksqueue.clear(), this.tmpImageConfigMap.clear(), this.localPointsBatchData.clear(), this.isActive = !1, this.clearAllResolveMap.clear(), this.snapshotMap.clear(), this.boundingRectMap.clear(), (t = this.fullWorker) == null || t.terminate(), (i = this.subWorker) == null || i.terminate();
|
|
@@ -5033,16 +5039,14 @@ class ep extends _M {
|
|
|
5033
5039
|
}
|
|
5034
5040
|
async useBackgroundThread() {
|
|
5035
5041
|
console.info("use background thread");
|
|
5036
|
-
const { BackgroundThreadManagerImpl: e } = await import("./index-
|
|
5042
|
+
const { BackgroundThreadManagerImpl: e } = await import("./index-Djm-u9a7.mjs");
|
|
5037
5043
|
this.backgroundThreadManager = new e(this);
|
|
5038
5044
|
}
|
|
5039
5045
|
async useMainThread() {
|
|
5040
5046
|
console.info("no OffscreenCanvas"), this.control.hasExtendFontFaces && await document.fonts.ready.then(() => {
|
|
5041
|
-
this.
|
|
5042
|
-
"[Appliance]: set font faces in main thread success"
|
|
5043
|
-
);
|
|
5047
|
+
this.Logger.info("[Appliance]: set font faces in main thread success");
|
|
5044
5048
|
});
|
|
5045
|
-
const { MainThreadManagerImpl: e } = await import("./index-
|
|
5049
|
+
const { MainThreadManagerImpl: e } = await import("./index-DD4uosmt.mjs");
|
|
5046
5050
|
this.mainThread = new e(this);
|
|
5047
5051
|
}
|
|
5048
5052
|
async on() {
|
|
@@ -5111,11 +5115,11 @@ class ep extends _M {
|
|
|
5111
5115
|
}
|
|
5112
5116
|
}), this.control.hasExtendFontFaces) {
|
|
5113
5117
|
const e = this.control.extendFontFaces, t = [], i = [];
|
|
5114
|
-
this.control.room && this.
|
|
5118
|
+
this.control.room && this.Logger.info(
|
|
5115
5119
|
`[Appliance]: load before font faces ${JSON.stringify(e)}`
|
|
5116
5120
|
), await new Promise(async (o) => {
|
|
5117
5121
|
this.setFontFacesResolve.resolve = o, this.setFontFacesResolve.timer = setTimeout(() => {
|
|
5118
|
-
this.setFontFacesResolve.resolve && (this.
|
|
5122
|
+
this.setFontFacesResolve.resolve && (this.Logger.warn("[Appliance]: set font faces timeout"), this.setFontFacesResolve.resolve(!1));
|
|
5119
5123
|
}, this.control.loadFontFacesTimeout);
|
|
5120
5124
|
try {
|
|
5121
5125
|
for (const s of e) {
|
|
@@ -5126,16 +5130,16 @@ class ep extends _M {
|
|
|
5126
5130
|
s.fontFamily,
|
|
5127
5131
|
s.src,
|
|
5128
5132
|
a
|
|
5129
|
-
) || this.
|
|
5133
|
+
) || this.Logger.warn(
|
|
5130
5134
|
`[Appliance]: Failed to save font ${s.fontFamily} to IndexedDB, but continuing with font loading`
|
|
5131
5135
|
))), a && a.byteLength > 0 ? (i.push({
|
|
5132
5136
|
fontFamily: s.fontFamily,
|
|
5133
5137
|
buffer: a
|
|
5134
|
-
}), t.push(a)) : this.
|
|
5138
|
+
}), t.push(a)) : this.Logger.warn(
|
|
5135
5139
|
`[Appliance]: Font ${s.fontFamily} could not be loaded from any source`
|
|
5136
5140
|
);
|
|
5137
5141
|
}
|
|
5138
|
-
this.
|
|
5142
|
+
this.Logger.info("[Appliance]: load end font faces"), i.length ? this.fullWorker.postMessage(
|
|
5139
5143
|
/* @__PURE__ */ new Set([
|
|
5140
5144
|
{
|
|
5141
5145
|
type: R.SetFontFace,
|
|
@@ -5145,16 +5149,10 @@ class ep extends _M {
|
|
|
5145
5149
|
t
|
|
5146
5150
|
) : this.setFontFacesResolve.resolve(!0);
|
|
5147
5151
|
} catch (s) {
|
|
5148
|
-
this.setFontFacesResolve.timer && (clearTimeout(this.setFontFacesResolve.timer), this.setFontFacesResolve.timer = void 0), this.setFontFacesResolve.resolve && (this.setFontFacesResolve.resolve(!1), this.
|
|
5149
|
-
`[Appliance]: set font faces error: ${s}`
|
|
5150
|
-
));
|
|
5152
|
+
this.setFontFacesResolve.timer && (clearTimeout(this.setFontFacesResolve.timer), this.setFontFacesResolve.timer = void 0), this.setFontFacesResolve.resolve && (this.setFontFacesResolve.resolve(!1), this.Logger.error(`[Appliance]: set font faces error: ${s}`));
|
|
5151
5153
|
}
|
|
5152
5154
|
}).then((o) => {
|
|
5153
|
-
this.setFontFacesResolve.resolve = void 0, this.setFontFacesResolve.timer = void 0, o ? this.
|
|
5154
|
-
"[Appliance]: set font faces in web worker success"
|
|
5155
|
-
) : this.control.logger.error(
|
|
5156
|
-
"[Appliance]: set font faces in web worker error"
|
|
5157
|
-
);
|
|
5155
|
+
this.setFontFacesResolve.resolve = void 0, this.setFontFacesResolve.timer = void 0, o ? this.Logger.info("[Appliance]: set font faces in web worker success") : this.Logger.error("[Appliance]: set font faces in web worker error");
|
|
5158
5156
|
});
|
|
5159
5157
|
}
|
|
5160
5158
|
}
|
|
@@ -5183,7 +5181,7 @@ class ep extends _M {
|
|
|
5183
5181
|
throw new Error("Invalid font data format: not a valid font file");
|
|
5184
5182
|
return i;
|
|
5185
5183
|
} catch (t) {
|
|
5186
|
-
this.
|
|
5184
|
+
this.Logger.error(
|
|
5187
5185
|
`[Appliance]: Failed to load font from ${e}: ${t instanceof Error ? t.message : String(t)}`
|
|
5188
5186
|
);
|
|
5189
5187
|
return;
|
|
@@ -5286,7 +5284,7 @@ class ep extends _M {
|
|
|
5286
5284
|
imageElement: Ee
|
|
5287
5285
|
} = c;
|
|
5288
5286
|
if (l === R.SetFontFace) {
|
|
5289
|
-
ht && this.setFontFacesResolve.resolve && (ot && ot.length > 0 && this.
|
|
5287
|
+
ht && this.setFontFacesResolve.resolve && (ot && ot.length > 0 && this.Logger.info(
|
|
5290
5288
|
"[Appliance]: set font face has failed fonts: " + ot.join(", ")
|
|
5291
5289
|
), this.setFontFacesResolve.resolve(ht));
|
|
5292
5290
|
return;
|
|
@@ -5421,9 +5419,9 @@ class ep extends _M {
|
|
|
5421
5419
|
break;
|
|
5422
5420
|
case R.ReportError:
|
|
5423
5421
|
case R.ReportLog:
|
|
5424
|
-
st && (l === R.ReportError ? this.
|
|
5422
|
+
st && (l === R.ReportError ? this.Logger.error(
|
|
5425
5423
|
`[Appliance]: [MasterControlForWorker] reportError ${st}`
|
|
5426
|
-
) : this.
|
|
5424
|
+
) : this.Logger.info(
|
|
5427
5425
|
`[Appliance]: [MasterControlForWorker] reportLog ${st}`
|
|
5428
5426
|
));
|
|
5429
5427
|
break;
|
|
@@ -5594,7 +5592,7 @@ class ep extends _M {
|
|
|
5594
5592
|
}), this.willSelectorWorkId = u.toString();
|
|
5595
5593
|
}
|
|
5596
5594
|
} catch (h) {
|
|
5597
|
-
this.
|
|
5595
|
+
this.Logger.error(
|
|
5598
5596
|
`[Appliance]: [MasterControlForWorker] onLocalEventEnd error: ${h instanceof Error ? h.message : String(h)}`
|
|
5599
5597
|
);
|
|
5600
5598
|
}
|