@netless/appliance-plugin 1.1.27-beta.4 → 1.1.27-beta.6

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.
@@ -1,13 +1,13 @@
1
1
  var $e = Object.defineProperty;
2
2
  var _e = (S, i, t) => i in S ? $e(S, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : S[i] = t;
3
3
  var y = (S, i, t) => _e(S, typeof i != "symbol" ? i + "" : i, t);
4
- import { g as Kt, _ as Te, i as Vt, p as kt, a as St, D as J, c as E, b as Rt, E as _t, d as st, P as O, V as I, s as Qt, e as Jt, f as Nt, h as ve, r as Ge, j as He, k as T, l as Gt, m as X, n as w, o as D, q as A, t as z, u as tt, v as _, w as jt, x as qe, y as je, z as Ze, A as Ke, B as Ve, C as Qe, F as Je, G as ts, S as $, H as es, I as ae, J as Wt, K as Pe, T as At, L as yt, M as ss, N as Ie, O as os, Q as is, R as ct, U as G, W as ut, X as rs, Y as ns, Z as as, $ as cs, a0 as bt, a1 as ls, a2 as U, a3 as ce, a4 as le, a5 as hs } from "./index-DzMRkFqH.mjs";
4
+ import { g as Kt, _ as Te, i as Vt, p as kt, a as St, D as J, c as E, b as Rt, E as Gt, d as st, P as O, V as I, s as Qt, e as Jt, f as Nt, h as ve, r as Ge, j as He, k as T, l as Dt, m as X, n as w, o as D, q as A, t as z, u as tt, v as _, w as jt, x as qe, y as je, z as Ze, A as Ke, B as Ve, C as Qe, F as Je, G as ts, S as $, H as es, I as ae, J as Wt, K as Pe, T as Et, L as yt, M as ss, N as Ie, O as os, Q as is, R as ct, U as G, W as ut, X as rs, Y as ns, Z as as, $ as cs, a0 as bt, a1 as ls, a2 as U, a3 as ce, a4 as le, a5 as hs } from "./index-cut-EvPM.mjs";
5
5
  import { Group as K, Path as wt, Sprite as We, Rect as he, Polyline as ht, Ellipse as ps, Label as ds, Scene as te, Layer as us } from "spritejs";
6
6
  import rt from "clipper-lib";
7
7
  import ee from "lineclip";
8
8
  import "lz-string";
9
9
  import "xss";
10
- import { cloneDeep as Le, xor as fs, isNumber as Bt, isEqual as pe } from "lodash";
10
+ import { cloneDeep as Le, xor as fs, isNumber as Ft, isEqual as pe } from "lodash";
11
11
  import "white-web-sdk";
12
12
  import "react-dom";
13
13
  import "react";
@@ -144,7 +144,7 @@ const et = class et {
144
144
  w: f.width,
145
145
  h: f.height
146
146
  };
147
- if (Rt(W, N) === _t.outside) {
147
+ if (Rt(W, N) === Gt.outside) {
148
148
  Q(P, k), f.removeChild(k), this.isDelete = !0;
149
149
  return;
150
150
  }
@@ -434,7 +434,7 @@ const et = class et {
434
434
  }
435
435
  static isWillRefresh(i) {
436
436
  const { toolsType: t, opt: e, node: s, updateOpt: o, willSerializeData: r } = i;
437
- return !!(r && (o.angle || o.translate) || o.thickness && e.thickness && e.thickness !== o.thickness || o.strokeType && e.strokeType && e.strokeType !== o.strokeType || o.originPoint && o.scenePoint && o.scale || o.pointMap && o.pointMap.has(s.name) || t === T.Text && (o.fontSize || o.translate || o.textInfos && o.textInfos.get(s.name)) || t === T.Image && (o.angle || o.translate || o.scale || o.strokeColor && o.type === Gt.Iconify) || t === o.toolsType && o.willRefresh || e.eraserlines && e.eraserlines.length && (o.strokeColor || o.fillColor));
437
+ return !!(r && (o.angle || o.translate) || o.thickness && e.thickness && e.thickness !== o.thickness || o.strokeType && e.strokeType && e.strokeType !== o.strokeType || o.originPoint && o.scenePoint && o.scale || o.pointMap && o.pointMap.has(s.name) || t === T.Text && (o.fontSize || o.translate || o.textInfos && o.textInfos.get(s.name)) || t === T.Image && (o.angle || o.translate || o.scale || o.strokeColor && o.type === Dt.Iconify) || t === o.toolsType && o.willRefresh || e.eraserlines && e.eraserlines.length && (o.strokeColor || o.fillColor));
438
438
  }
439
439
  };
440
440
  y(et, "SafeBorderPadding", 10);
@@ -1551,7 +1551,7 @@ const vt = class vt extends b {
1551
1551
  };
1552
1552
  // 来源于white-sdk
1553
1553
  y(vt, "eraserSizes", se);
1554
- let Ft = vt;
1554
+ let Ut = vt;
1555
1555
  var ue = qe, Ls = 1, Cs = Object.prototype, bs = Cs.hasOwnProperty;
1556
1556
  function Rs(S, i, t, e, s, o) {
1557
1557
  var r = t & Ls, n = ue(S), a = n.length, c = ue(i), l = c.length;
@@ -1584,11 +1584,11 @@ function Rs(S, i, t, e, s, o) {
1584
1584
  }
1585
1585
  return o.delete(S), o.delete(i), f;
1586
1586
  }
1587
- var Ns = Rs, qt = je, xs = Ze, Ds = Ke, Ms = Ns, fe = Ve, me = ts, ye = Qe, Os = Je, As = 1, we = "[object Arguments]", ge = "[object Array]", Et = "[object Object]", Es = Object.prototype, ke = Es.hasOwnProperty;
1587
+ var Ns = Rs, qt = je, xs = Ze, Ds = Ke, Ms = Ns, fe = Ve, me = ts, ye = Qe, Os = Je, As = 1, we = "[object Arguments]", ge = "[object Array]", Bt = "[object Object]", Es = Object.prototype, ke = Es.hasOwnProperty;
1588
1588
  function Bs(S, i, t, e, s, o) {
1589
1589
  var r = me(S), n = me(i), a = r ? ge : fe(S), c = n ? ge : fe(i);
1590
- a = a == we ? Et : a, c = c == we ? Et : c;
1591
- var l = a == Et, h = c == Et, p = a == c;
1590
+ a = a == we ? Bt : a, c = c == we ? Bt : c;
1591
+ var l = a == Bt, h = c == Bt, p = a == c;
1592
1592
  if (p && ye(S)) {
1593
1593
  if (!ye(i))
1594
1594
  return !1;
@@ -1614,7 +1614,7 @@ function Ys(S, i) {
1614
1614
  return Xs(S, i);
1615
1615
  }
1616
1616
  var $s = Ys;
1617
- const lt = /* @__PURE__ */ Kt($s), $t = class $t extends b {
1617
+ const lt = /* @__PURE__ */ Kt($s), _t = class _t extends b {
1618
1618
  constructor(t) {
1619
1619
  super(t);
1620
1620
  y(this, "toolsType", T.Selector);
@@ -1686,7 +1686,7 @@ const lt = /* @__PURE__ */ Kt($s), $t = class $t extends b {
1686
1686
  strokeColor: this.selectorColor || this.workOptions.strokeColor,
1687
1687
  width: e.w,
1688
1688
  height: e.h,
1689
- name: $t.selectorBorderId
1689
+ name: _t.selectorBorderId
1690
1690
  });
1691
1691
  c.push(l);
1692
1692
  }
@@ -2268,8 +2268,8 @@ const lt = /* @__PURE__ */ Kt($s), $t = class $t extends b {
2268
2268
  });
2269
2269
  }
2270
2270
  };
2271
- y($t, "selectorBorderId", "selector-border");
2272
- let Ut = $t;
2271
+ y(_t, "selectorBorderId", "selector-border");
2272
+ let zt = _t;
2273
2273
  class xe extends b {
2274
2274
  constructor(t) {
2275
2275
  super(t);
@@ -2582,7 +2582,7 @@ class De extends b {
2582
2582
  dataType: D.Local,
2583
2583
  ...this.baseConsumeResult
2584
2584
  };
2585
- if (Rt(u, g) !== _t.outside) {
2585
+ if (Rt(u, g) !== Gt.outside) {
2586
2586
  const v = E(u, this.oldRect);
2587
2587
  if (this.oldRect = u, P.rect = v, !a)
2588
2588
  return P;
@@ -4465,13 +4465,13 @@ const ft = class ft extends b {
4465
4465
  const p = {
4466
4466
  name: e,
4467
4467
  id: e,
4468
- pos: [a[0] - At, a[1] - At],
4468
+ pos: [a[0] - Et, a[1] - Et],
4469
4469
  anchor: [0, 0],
4470
4470
  size: n,
4471
4471
  zIndex: c
4472
4472
  }, d = new K(p), u = {
4473
- x: a[0] - At,
4474
- y: a[1] - At,
4473
+ x: a[0] - Et,
4474
+ y: a[1] - Et,
4475
4475
  w: n[0],
4476
4476
  h: n[1]
4477
4477
  }, f = {
@@ -4482,7 +4482,7 @@ const ft = class ft extends b {
4482
4482
  };
4483
4483
  this.replace(s, e, d);
4484
4484
  let m;
4485
- if (r && (m = Rt(f, r)), (o || r && m !== _t.outside) && s && this.workOptions.text) {
4485
+ if (r && (m = Rt(f, r)), (o || r && m !== Gt.outside) && s && this.workOptions.text) {
4486
4486
  const g = await ft.createLabels(this.workOptions, s, f), { labels: P, maxWidth: k } = g;
4487
4487
  d.append(...P), f.w = Math.ceil(Math.max(k * s.worldScaling[0], f.w));
4488
4488
  }
@@ -4583,11 +4583,11 @@ const ft = class ft extends b {
4583
4583
  Z[0] = 6;
4584
4584
  const gt = Math.sin(Math.PI / 180 * 20);
4585
4585
  let pt = 0;
4586
- const Dt = [];
4586
+ const Mt = [];
4587
4587
  let Ct = 0;
4588
4588
  for (; Ct < j; ) {
4589
4589
  f === "left" && (nt[0] = pt), Ct === 0 && m === "italic" && (nt[0] = nt[0] - gt / 2 * p);
4590
- const Ht = F.slice(Ct, Ct + N), Mt = {
4590
+ const Ht = F.slice(Ct, Ct + N), Ot = {
4591
4591
  anchor: [0, 0],
4592
4592
  pos: nt,
4593
4593
  text: Ht,
@@ -4600,13 +4600,13 @@ const ft = class ft extends b {
4600
4600
  textAlign: f,
4601
4601
  fontStyle: m,
4602
4602
  scale: [1 / R, 1 / R]
4603
- }, dt = new ds(Mt), at = await dt.textImageReady;
4604
- let Ot = !0;
4603
+ }, dt = new ds(Ot), at = await dt.textImageReady;
4604
+ let At = !0;
4605
4605
  if (at) {
4606
4606
  const ie = at.rect && at.rect[2], re = at.rect && at.rect[3];
4607
4607
  if (ie && re) {
4608
4608
  const ne = ie / R, Ye = re / R;
4609
- pt = ne + pt, m === "italic" && (u === "bold" ? pt = pt - gt * p * 1.2 : pt = pt - gt * p), ((nt[0] + Z[0] + ne) * e.worldScaling[0] + r <= 0 || (nt[0] + Z[0]) * e.worldScaling[0] + r >= a || (nt[1] + Z[1] + Ye) * e.worldScaling[1] + n <= 0 || (nt[1] + Z[1]) * e.worldScaling[1] + n >= c) && (dt.disconnect(), Ot = !1), Ot && Dt.push(dt);
4609
+ pt = ne + pt, m === "italic" && (u === "bold" ? pt = pt - gt * p * 1.2 : pt = pt - gt * p), ((nt[0] + Z[0] + ne) * e.worldScaling[0] + r <= 0 || (nt[0] + Z[0]) * e.worldScaling[0] + r >= a || (nt[1] + Z[1] + Ye) * e.worldScaling[1] + n <= 0 || (nt[1] + Z[1]) * e.worldScaling[1] + n >= c) && (dt.disconnect(), At = !1), At && Mt.push(dt);
4610
4610
  }
4611
4611
  }
4612
4612
  Ct += N;
@@ -4622,8 +4622,8 @@ const ft = class ft extends b {
4622
4622
  points: [0, 0, Math.ceil(V[0]), 0],
4623
4623
  strokeColor: k,
4624
4624
  className: "underline"
4625
- }, Ot = new ht(at);
4626
- Dt.push(Ot);
4625
+ }, At = new ht(at);
4626
+ Mt.push(At);
4627
4627
  }
4628
4628
  if (C) {
4629
4629
  const dt = {
@@ -4634,15 +4634,15 @@ const ft = class ft extends b {
4634
4634
  strokeColor: k,
4635
4635
  className: "lineThrough"
4636
4636
  }, at = new ht(dt);
4637
- Dt.push(at);
4637
+ Mt.push(at);
4638
4638
  }
4639
4639
  const Ht = {
4640
4640
  pos: Z,
4641
4641
  anchor: [0, 0],
4642
4642
  size: V,
4643
4643
  bgcolor: v
4644
- }, Mt = new K(Ht);
4645
- Mt.append(...Dt), o.push(Mt);
4644
+ }, Ot = new K(Ht);
4645
+ Ot.append(...Mt), o.push(Ot);
4646
4646
  }
4647
4647
  }
4648
4648
  }
@@ -4733,7 +4733,7 @@ const ft = class ft extends b {
4733
4733
  };
4734
4734
  // 4k
4735
4735
  y(ft, "textImageSnippetSize", 1024 * 4), y(ft, "SafeBorderPadding", 30);
4736
- let zt = ft;
4736
+ let Xt = ft;
4737
4737
  const Pt = class Pt extends b {
4738
4738
  constructor(t) {
4739
4739
  super(t);
@@ -4922,7 +4922,7 @@ const Pt = class Pt extends b {
4922
4922
  };
4923
4923
  // 来源于white-sdk
4924
4924
  y(Pt, "eraserSizes", se);
4925
- let Xt = Pt;
4925
+ let Yt = Pt;
4926
4926
  const It = class It extends b {
4927
4927
  constructor(t) {
4928
4928
  super(t);
@@ -5104,7 +5104,7 @@ const It = class It extends b {
5104
5104
  };
5105
5105
  // 来源于white-sdk
5106
5106
  y(It, "eraserSizes", se);
5107
- let Yt = It;
5107
+ let $t = It;
5108
5108
  function Fe(S) {
5109
5109
  switch (S) {
5110
5110
  case T.Arrow:
@@ -5126,17 +5126,17 @@ function Fe(S) {
5126
5126
  case T.SpeechBalloon:
5127
5127
  return Ee;
5128
5128
  case T.Text:
5129
- return zt;
5129
+ return Xt;
5130
5130
  case T.LaserPen:
5131
5131
  return Re;
5132
5132
  case T.Eraser:
5133
- return Ft;
5133
+ return Ut;
5134
5134
  case T.PencilEraser:
5135
- return Xt;
5136
- case T.BitMapEraser:
5137
5135
  return Yt;
5136
+ case T.BitMapEraser:
5137
+ return $t;
5138
5138
  case T.Selector:
5139
- return Ut;
5139
+ return zt;
5140
5140
  case T.Image:
5141
5141
  return xt;
5142
5142
  }
@@ -5163,17 +5163,17 @@ function Lt(S, i) {
5163
5163
  case T.SpeechBalloon:
5164
5164
  return new Ee(e);
5165
5165
  case T.Text:
5166
- return new zt(e);
5166
+ return new Xt(e);
5167
5167
  case T.LaserPen:
5168
5168
  return new Re(e);
5169
5169
  case T.Eraser:
5170
- return new Ft(e, i);
5170
+ return new Ut(e, i);
5171
5171
  case T.BitMapEraser:
5172
- return new Yt(e);
5172
+ return new $t(e);
5173
5173
  case T.PencilEraser:
5174
- return new Xt(e);
5174
+ return new Yt(e);
5175
5175
  case T.Selector:
5176
- return e.vNodes ? new Ut({
5176
+ return e.vNodes ? new zt({
5177
5177
  ...e,
5178
5178
  vNodes: e.vNodes,
5179
5179
  drawLayer: e.fullLayer
@@ -5235,7 +5235,7 @@ class ze {
5235
5235
  getCanEraserNodes(i, t) {
5236
5236
  const e = /* @__PURE__ */ new Map();
5237
5237
  for (const [s, o] of i.entries())
5238
- o.toolsType === T.Image && (o.opt.locked || t && t.disableEraseImage) || o.toolsType === T.Text && (o.opt.workState === A.Doing || o.opt.workState === A.Start || t && t.disableEraseText) || this.isCanClearWorkId(s) && e.set(s, o);
5238
+ o.toolsType === T.Image && o.opt.type === Dt.Image && (o.opt.locked || t && t.disableEraseImage) || o.toolsType === T.Text && (o.opt.workState === A.Doing || o.opt.workState === A.Start || t && t.disableEraseText) || this.isCanClearWorkId(s) && e.set(s, o);
5239
5239
  return e;
5240
5240
  }
5241
5241
  getNodesByType(i) {
@@ -5487,7 +5487,7 @@ class Zs {
5487
5487
  if (!n || !a || !c || !l)
5488
5488
  return;
5489
5489
  let p = n;
5490
- if (a === Gt.Iconify) {
5490
+ if (a === Dt.Iconify) {
5491
5491
  const [m, g] = this.getIconSize(c, l, this.dpr);
5492
5492
  p = `${n}?width=${m}&height=${g}&color=${h}`;
5493
5493
  }
@@ -7552,7 +7552,7 @@ class io {
7552
7552
  dataType: D.Local
7553
7553
  },
7554
7554
  t
7555
- ), this.drawWorkActiveId = void 0), !this.drawWorkActiveId && a !== $ && (this.drawWorkActiveId = a), Bt(r) && (this.consumeCount = r), l) {
7555
+ ), this.drawWorkActiveId = void 0), !this.drawWorkActiveId && a !== $ && (this.drawWorkActiveId = a), Ft(r) && (this.consumeCount = r), l) {
7556
7556
  case T.Selector: {
7557
7557
  const h = c.consume({
7558
7558
  data: i,
@@ -8847,7 +8847,7 @@ class ko {
8847
8847
  } = i, p = r == null ? void 0 : r.toString();
8848
8848
  switch (t) {
8849
8849
  case w.UpdateDpr:
8850
- Bt(i.dpr) && this.updateDpr(i.dpr);
8850
+ Ft(i.dpr) && this.updateDpr(i.dpr);
8851
8851
  break;
8852
8852
  case w.AuthClear: {
8853
8853
  const { clearUids: d, localUid: u } = i;
@@ -8963,7 +8963,7 @@ class ko {
8963
8963
  if (!r || !n || !a || !c)
8964
8964
  return;
8965
8965
  let h = r;
8966
- if (n === Gt.Iconify) {
8966
+ if (n === Dt.Iconify) {
8967
8967
  const [f, m] = this.getIconSize(a, c, this.opt.displayer.dpr);
8968
8968
  h = `${r}?width=${f}&height=${m}&color=${l}`;
8969
8969
  }
@@ -9042,7 +9042,7 @@ class ko {
9042
9042
  }
9043
9043
  n || i.push(r);
9044
9044
  }
9045
- Bt(o.fullWorkerDrawCount) && (t = o.fullWorkerDrawCount), Bt(o.consumeCount) && (e = o.consumeCount);
9045
+ Ft(o.fullWorkerDrawCount) && (t = o.fullWorkerDrawCount), Ft(o.consumeCount) && (e = o.consumeCount);
9046
9046
  }
9047
9047
  return this.combinePostMsg.clear(), {
9048
9048
  sp: i,
@@ -9151,7 +9151,7 @@ class ko {
9151
9151
  if (h) {
9152
9152
  const p = l, d = h.rect, u = this.getSceneRect(), f = Rt(p, u), m = Rt(d, u);
9153
9153
  let g = !1;
9154
- if ((f !== m || p.w !== d.w || p.h !== d.h || m === _t.intersect) && (g = !0), g) {
9154
+ if ((f !== m || p.w !== d.w || p.h !== d.h || m === Gt.intersect) && (g = !0), g) {
9155
9155
  const { toolsType: P } = h;
9156
9156
  P === T.Text && this.debounceUpdateCache.add(c);
9157
9157
  }
@@ -9325,7 +9325,7 @@ class So {
9325
9325
  if (!r || !n || !a || !c)
9326
9326
  return;
9327
9327
  let h = r;
9328
- if (n === Gt.Iconify) {
9328
+ if (n === Dt.Iconify) {
9329
9329
  const [f, m] = this.getIconSize(a, c, this.opt.displayer.dpr);
9330
9330
  h = `${r}?width=${f}&height=${m}&color=${l}`;
9331
9331
  }