@netless/appliance-plugin 1.1.22-beta.4 → 1.1.22-beta.5

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.
@@ -1142,7 +1142,7 @@ function og(o) {
1142
1142
  return tg(o, ig | ng);
1143
1143
  }
1144
1144
  var rg = og;
1145
- const oi = /* @__PURE__ */ xi(rg), fo = "1.1.22-beta.4", sg = "@netless/appliance-plugin", Nn = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1145
+ const oi = /* @__PURE__ */ xi(rg), fo = "1.1.22-beta.5", sg = "@netless/appliance-plugin", Nn = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1146
1146
  if (typeof window < "u") {
1147
1147
  let o = window.__netlessUA || "";
1148
1148
  o += ` ${sg}@${fo}`, window.__netlessUA = o;
@@ -4755,7 +4755,7 @@ class $f extends Hf {
4755
4755
  "set font faces in main thread success"
4756
4756
  );
4757
4757
  });
4758
- const { MainThreadManagerImpl: e } = await import("./index-D-DKJlcZ.mjs");
4758
+ const { MainThreadManagerImpl: e } = await import("./index-tNa1mbnF.mjs");
4759
4759
  this.mainThread = new e(this);
4760
4760
  }
4761
4761
  async on() {
@@ -4816,7 +4816,7 @@ class $f extends Hf {
4816
4816
  this.reRenders.set(this.subWorkerDrawCount, c);
4817
4817
  } else this.reRenders.size && this.clearReRenders(this.subWorkerDrawCount);
4818
4818
  }
4819
- a.length && (console.log("msg---layer--sub-render", a), this.viewContainerManager.render(a));
4819
+ a.length && this.viewContainerManager.render(a);
4820
4820
  }
4821
4821
  }), this.control.hasExtendFontFaces) {
4822
4822
  const e = this.control.extendFontFaces, t = [], n = [];
@@ -8241,7 +8241,7 @@ class vo {
8241
8241
  }
8242
8242
  });
8243
8243
  y(this, "keydown", (i) => {
8244
- console.log("keydown===>", i), this.control.hotkeyManager.colloctHotkey(i);
8244
+ this.control.hotkeyManager.colloctHotkey(i);
8245
8245
  });
8246
8246
  this.control = i, this.internalMsgEmitter = e;
8247
8247
  const n = {
@@ -12633,7 +12633,7 @@ class Fe extends At {
12633
12633
  ), n.callbacks.on(
12634
12634
  "onCameraUpdated",
12635
12635
  this.onAppViewCameraUpdated.bind(this, t)
12636
- ), n.callbacks.on("onActiveHotkey", this.onActiveHotkeyChange.bind(this)), console.log("onActiveHotkey===>0000"), this.tmpFocusedViewId === t) {
12636
+ ), n.callbacks.on("onActiveHotkey", this.onActiveHotkeyChange.bind(this)), this.tmpFocusedViewId === t) {
12637
12637
  const f = this.control.worker.getLocalWorkViewId();
12638
12638
  f && f !== t ? this.setFocuedViewId(f) : this.setFocuedViewId(t), this.tmpFocusedViewId = void 0;
12639
12639
  }
@@ -12785,7 +12785,7 @@ class Fe extends At {
12785
12785
  });
12786
12786
  }
12787
12787
  onActiveHotkeyChange(e) {
12788
- console.log("onActiveHotkey===>1111"), this.control.hotkeyManager.onActiveHotkey(e);
12788
+ this.control.hotkeyManager.onActiveHotkey(e);
12789
12789
  }
12790
12790
  }
12791
12791
  class rt extends je {
@@ -1,7 +1,7 @@
1
1
  var Xe = Object.defineProperty;
2
2
  var Ye = (k, i, t) => i in k ? Xe(k, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : k[i] = t;
3
3
  var m = (k, i, t) => Ye(k, typeof i != "symbol" ? i + "" : i, t);
4
- import { g as Zt, _ as Se, i as Kt, p as kt, a as St, D as Q, c as E, b as Rt, E as Bt, d as J, P as M, V as P, s as Vt, e as Jt, f as Nt, h as ve, r as $e, j as _e, k as S, l as _t, m as U, n as g, o as x, q as O, t as F, u as tt, v as $, w as qt, x as Ge, y as He, z as qe, A as je, B as Ze, C as Ke, F as Ve, G as Je, S as X, H as Qe, I as ne, J as Wt, K as Te, L as yt, M as ts, N as Pe, O as es, Q as ss, R as ct, T as _, U as ut, W as os, X as is, Y as rs, Z as ns, $ as bt, a0 as as, a1 as z, a2 as ae, a3 as ce, a4 as cs } from "./index-rz3Qash_.mjs";
4
+ import { g as Zt, _ as Se, i as Kt, p as kt, a as St, D as J, c as E, b as Rt, E as Bt, d as Q, P as M, V as P, s as Vt, e as Jt, f as Nt, h as ve, r as $e, j as _e, k as S, l as _t, m as U, n as g, o as x, q as O, t as F, u as tt, v as $, w as qt, x as Ge, y as He, z as qe, A as je, B as Ze, C as Ke, F as Ve, G as Je, S as X, H as Qe, I as ne, J as Wt, K as Te, L as yt, M as ts, N as Pe, O as es, Q as ss, R as ct, T as _, U as ut, W as os, X as is, Y as rs, Z as ns, $ as bt, a0 as as, a1 as z, a2 as ae, a3 as ce, a4 as cs } from "./index-ChaMAgdB.mjs";
5
5
  import { Group as j, Path as wt, Sprite as Ie, Rect as le, Polyline as ht, Ellipse as ls, Label as hs, Scene as Qt, Layer as ps } from "spritejs";
6
6
  import it from "clipper-lib";
7
7
  import te from "lineclip";
@@ -34,9 +34,9 @@ function mt(k, i = !0) {
34
34
  }
35
35
  const et = class et {
36
36
  constructor(i) {
37
- m(this, "maxImageWidth", Q.pencilEraser.maxImageWidth);
38
- m(this, "maxImageHeight", Q.pencilEraser.maxImageHeight);
39
- m(this, "syncUnitTime", Q.syncOpt.interval);
37
+ m(this, "maxImageWidth", J.pencilEraser.maxImageWidth);
38
+ m(this, "maxImageHeight", J.pencilEraser.maxImageHeight);
39
+ m(this, "syncUnitTime", J.syncOpt.interval);
40
40
  m(this, "vNodes");
41
41
  m(this, "drawLayer");
42
42
  m(this, "fullLayer");
@@ -148,7 +148,7 @@ const et = class et {
148
148
  Z(v, T), y.removeChild(T), this.isDelete = !0;
149
149
  return;
150
150
  }
151
- const D = J(L);
151
+ const D = Q(L);
152
152
  D.x = Math.floor(Math.max(L.x, 0)), D.y = Math.floor(Math.max(L.y, 0)), D.w = Math.min(L.x + L.w, y.width) - D.x, D.h = Math.min(L.y + L.h, y.height) - D.y;
153
153
  const B = this.getGroupRect(D, I), Y = B.x, G = B.y, rt = B.w, K = B.h;
154
154
  let V = W.getImageData(Y, G, rt, K);
@@ -335,7 +335,7 @@ const et = class et {
335
335
  thickness: u
336
336
  } = e;
337
337
  let y;
338
- const f = r && J(r) || s.get(t.name);
338
+ const f = r && Q(r) || s.get(t.name);
339
339
  if (!f) return;
340
340
  q(n) && (t.setAttribute("zIndex", n), f.opt.zIndex = n);
341
341
  const w = t.parent;
@@ -4590,7 +4590,7 @@ const ft = class ft extends b {
4590
4590
  fontSize: w,
4591
4591
  textInfos: v,
4592
4592
  zIndex: T
4593
- } = s, C = r && J(r) || o.get(e.name);
4593
+ } = s, C = r && Q(r) || o.get(e.name);
4594
4594
  if (!C || !e.parent) return;
4595
4595
  const I = C.opt;
4596
4596
  if (q(T) && (e.setAttribute("zIndex", T), C.opt.zIndex = T), a && I.fontColor && (I.fontColor = a, e.children.forEach((R) => {
@@ -5189,7 +5189,7 @@ class ze {
5189
5189
  name: i,
5190
5190
  rect: t.rect
5191
5191
  };
5192
- t.rect && (e.rect = J(t.rect)), t.op && es(t.op) && (e.op = J(t.op)), t.canRotate && (e.canRotate = t.canRotate), t.scaleType && (e.scaleType = t.scaleType), t.opt && (e.opt = J(t.opt)), t.toolsType && (e.toolsType = t.toolsType), t.centerPos && (e.centerPos = J(t.centerPos)), vt(t.isSelected) && (e.isSelected = t.isSelected), e.rect ? this.curNodeMap.set(i, e) : this.curNodeMap.delete(i);
5192
+ t.rect && (e.rect = Q(t.rect)), t.op && es(t.op) && (e.op = Q(t.op)), t.canRotate && (e.canRotate = t.canRotate), t.scaleType && (e.scaleType = t.scaleType), t.opt && (e.opt = Q(t.opt)), t.toolsType && (e.toolsType = t.toolsType), t.centerPos && (e.centerPos = Q(t.centerPos)), vt(t.isSelected) && (e.isSelected = t.isSelected), e.rect ? this.curNodeMap.set(i, e) : this.curNodeMap.delete(i);
5193
5193
  }
5194
5194
  selected(i) {
5195
5195
  this.setInfo(i, { isSelected: !0 });
@@ -5249,12 +5249,12 @@ class ze {
5249
5249
  const t = /* @__PURE__ */ new Map();
5250
5250
  for (const e of i) {
5251
5251
  const s = this.curNodeMap.get(e);
5252
- s && t.set(e, J(s));
5252
+ s && t.set(e, Q(s));
5253
5253
  }
5254
- return this.targetNodeMap.push(J(t)), this.targetNodeMap.length - 1;
5254
+ return this.targetNodeMap.push(Q(t)), this.targetNodeMap.length - 1;
5255
5255
  }
5256
5256
  setTarget() {
5257
- return this.targetNodeMap.push(J(this.curNodeMap)), this.targetNodeMap.length - 1;
5257
+ return this.targetNodeMap.push(Q(this.curNodeMap)), this.targetNodeMap.length - 1;
5258
5258
  }
5259
5259
  getLastTarget() {
5260
5260
  return this.targetNodeMap[this.targetNodeMap.length - 1];
@@ -5327,7 +5327,7 @@ class qs {
5327
5327
  this.vNodes = new ze(i, this.scene);
5328
5328
  }
5329
5329
  createRenderLayer(i, t) {
5330
- const e = Q.bufferSize.full, s = Q.bufferSize.sub;
5330
+ const e = J.bufferSize.full, s = J.bufferSize.sub;
5331
5331
  this.fullLayer = this.createLayer("fullLayer", i, {
5332
5332
  ...t.layerOpt,
5333
5333
  bufferSize: this.viewId === ct ? e : s * 2
@@ -5613,9 +5613,9 @@ class js {
5613
5613
  m(this, "workShapes", /* @__PURE__ */ new Map());
5614
5614
  m(this, "drawCount", 0);
5615
5615
  m(this, "consumeCount", 0);
5616
- m(this, "syncUnitTime", Q.syncOpt.interval);
5617
- m(this, "combineUnitTime", Q.bezier.combineUnitTime);
5618
- m(this, "maxCombineEraserTime", Q.pencilEraser.maxCombineTime);
5616
+ m(this, "syncUnitTime", J.syncOpt.interval);
5617
+ m(this, "combineUnitTime", J.bezier.combineUnitTime);
5618
+ m(this, "maxCombineEraserTime", J.pencilEraser.maxCombineTime);
5619
5619
  this.thread = i.thread, this.viewId = i.viewId, this.vNodes = i.vNodes, this.fullLayer = i.fullLayer, this.drawLayer = i.drawLayer, this._post = this.thread.post.bind(i.thread);
5620
5620
  }
5621
5621
  setmaxCombineEraserTime(i) {
@@ -5719,7 +5719,7 @@ class Zs {
5719
5719
  async getSnapshot(i) {
5720
5720
  const { scenePath: t, scenes: e, cameraOpt: s, w: o, h: r } = i;
5721
5721
  if (t && e && s && this.snapshotFullLayer) {
5722
- const n = J(this.opt.getCameraOpt());
5722
+ const n = Q(this.opt.getCameraOpt());
5723
5723
  this.opt.setCameraOpt(s, this.snapshotFullLayer), this.opt.localWork.fullLayer = this.snapshotFullLayer, this.opt.localWork.drawLayer = void 0;
5724
5724
  let a;
5725
5725
  for (const [h, l] of Object.entries(e))
@@ -5795,7 +5795,7 @@ class Zs {
5795
5795
  async getBoundingRect(i) {
5796
5796
  const { scenePath: t, scenes: e, cameraOpt: s } = i;
5797
5797
  if (t && e && s && this.snapshotFullLayer) {
5798
- const o = J(this.opt.getCameraOpt());
5798
+ const o = Q(this.opt.getCameraOpt());
5799
5799
  this.opt.setCameraOpt(s, this.snapshotFullLayer), this.opt.localWork.fullLayer = this.snapshotFullLayer, this.opt.localWork.drawLayer = void 0;
5800
5800
  let r;
5801
5801
  for (const [n, a] of Object.entries(e))
@@ -6062,7 +6062,7 @@ class Vs {
6062
6062
  m(this, "serviceWorkShapes", /* @__PURE__ */ new Map());
6063
6063
  m(this, "localWorkShapes", /* @__PURE__ */ new Map());
6064
6064
  m(this, "tmpOpt");
6065
- m(this, "syncUnitTime", Q.syncOpt.interval);
6065
+ m(this, "syncUnitTime", J.syncOpt.interval);
6066
6066
  m(this, "animationId");
6067
6067
  this.viewId = i.viewId, this.vNodes = i.vNodes, this.topLayer = i.topLayer, this.thread = i.thread, this.post = i.thread.post.bind(i.thread);
6068
6068
  }
@@ -6294,7 +6294,7 @@ class Js extends qs {
6294
6294
  m(this, "topLayerWork");
6295
6295
  m(this, "snapshotWork");
6296
6296
  this._post = s;
6297
- const o = Q.bufferSize.sub;
6297
+ const o = J.bufferSize.sub;
6298
6298
  this.topLayer = e.isUseSimple ? void 0 : this.createLayer("topLayer", this.scene, {
6299
6299
  ...e.layerOpt,
6300
6300
  bufferSize: o,
@@ -6331,7 +6331,7 @@ class Js extends qs {
6331
6331
  for (const c of t)
6332
6332
  if (c.rect) {
6333
6333
  if (c.rect = eo(
6334
- J(c.rect),
6334
+ Q(c.rect),
6335
6335
  this.scene,
6336
6336
  this.dpr
6337
6337
  ), !c.rect)
@@ -6349,12 +6349,7 @@ class Js extends qs {
6349
6349
  const o = (r = e.sp) == null ? void 0 : r.filter(
6350
6350
  (a) => a.type !== g.None || a.isLockSentEventCursor
6351
6351
  );
6352
- o != null && o.length ? e.sp = o.map((a) => ({ ...a, viewId: this.viewId })) : delete e.sp, e.consumeCount === void 0 && delete e.consumeCount, e.subWorkerDrawCount === void 0 && delete e.subWorkerDrawCount, (o != null && o.length || e.consumeCount || e.subWorkerDrawCount || (n = e == null ? void 0 : e.render) != null && n.length) && (console.log(
6353
- "msg---layer--sub",
6354
- this.viewId,
6355
- J(e),
6356
- this.fullLayer.children.length
6357
- ), this._post(e, s)), this.delayPostDoneResolve && this.delayPostDoneResolve(!0);
6352
+ o != null && o.length ? e.sp = o.map((a) => ({ ...a, viewId: this.viewId })) : delete e.sp, e.consumeCount === void 0 && delete e.consumeCount, e.subWorkerDrawCount === void 0 && delete e.subWorkerDrawCount, (o != null && o.length || e.consumeCount || e.subWorkerDrawCount || (n = e == null ? void 0 : e.render) != null && n.length) && this._post(e, s), this.delayPostDoneResolve && this.delayPostDoneResolve(!0);
6358
6353
  }
6359
6354
  getLayer(t, e) {
6360
6355
  if (e && this.snapshotFullLayer)
@@ -6649,7 +6644,7 @@ class xt extends b {
6649
6644
  isLocked: p,
6650
6645
  zIndex: d,
6651
6646
  strokeColor: u
6652
- } = s, y = r && J(r) || o.get(e.name);
6647
+ } = s, y = r && Q(r) || o.get(e.name);
6653
6648
  if (!y) return;
6654
6649
  const f = e.parent;
6655
6650
  if (f) {
@@ -6749,7 +6744,7 @@ class so {
6749
6744
  m(this, "localWorkShapes", /* @__PURE__ */ new Map());
6750
6745
  m(this, "tmpOpt");
6751
6746
  m(this, "animationId");
6752
- m(this, "syncUnitTime", Q.syncOpt.interval);
6747
+ m(this, "syncUnitTime", J.syncOpt.interval);
6753
6748
  this.vNodes = i.vNodes, this.thread = i.thread;
6754
6749
  }
6755
6750
  createLocalWork(i) {
@@ -6962,7 +6957,7 @@ class oo {
6962
6957
  m(this, "batchEraserRemoveNodes", /* @__PURE__ */ new Set());
6963
6958
  m(this, "batchEraserWorks", /* @__PURE__ */ new Set());
6964
6959
  m(this, "tmpOpt");
6965
- m(this, "syncUnitTime", Q.syncOpt.interval);
6960
+ m(this, "syncUnitTime", J.syncOpt.interval);
6966
6961
  m(this, "fullWorkerDrawCount", 0);
6967
6962
  m(this, "drawWorkActiveId");
6968
6963
  m(this, "consumeCount", 0);
@@ -7662,7 +7657,7 @@ class io {
7662
7657
  m(this, "willRunEffectSelectorIds", /* @__PURE__ */ new Set());
7663
7658
  m(this, "runEffectId");
7664
7659
  m(this, "animationId");
7665
- m(this, "syncUnitTime", Q.syncOpt.interval);
7660
+ m(this, "syncUnitTime", J.syncOpt.interval);
7666
7661
  this.vNodes = i.vNodes, this.thread = i.thread;
7667
7662
  }
7668
7663
  async loadImageBitMap(i) {
@@ -8604,7 +8599,7 @@ class go {
8604
8599
  ...t.canvasOpt,
8605
8600
  container: t.container
8606
8601
  }), this.master = t.master;
8607
- const e = Q.bufferSize.full, s = Q.bufferSize.sub;
8602
+ const e = J.bufferSize.full, s = J.bufferSize.sub;
8608
8603
  this.fullLayer = this.createLayer("fullLayer", this.scene, {
8609
8604
  ...t.layerOpt,
8610
8605
  bufferSize: this.viewId === ct ? e : s * 2