@netless/appliance-plugin 1.0.4 → 1.0.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,7 +1,7 @@
1
1
  var Se = Object.defineProperty;
2
2
  var ge = (v, r, t) => r in v ? Se(v, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : v[r] = t;
3
- var y = (v, r, t) => (ge(v, typeof r != "symbol" ? r + "" : r, t), t);
4
- import { g as Dt, _ as ee, i as At, D as dt, c as z, a as K, s as Et, b as Te, d as se, r as Pe, p as lt, e as ht, E as $, f as P, h as k, j as x, k as A, l as E, t as J, P as O, V as g, m as X, n as kt, o as ve, q as Ie, u as Le, v as Ne, w as We, x as Re, y as be, z as xe, S as F, A as Bt, B as oe, C as ut, F as Ce, G as Me, H as Oe, I as Ot, J as De, K as B, M as mt, T as $t, L as Ct, N as Yt, O as Ht, Q as Ae } from "./index-Bj242vt1.mjs";
3
+ var y = (v, r, t) => ge(v, typeof r != "symbol" ? r + "" : r, t);
4
+ import { g as Dt, _ as ee, i as At, D as dt, c as z, a as K, s as Et, b as Te, d as se, r as Pe, p as lt, e as ht, E as $, f as P, h as k, j as x, k as A, l as E, t as J, P as O, V as g, m as X, n as kt, o as ve, q as Ie, u as Le, v as Ne, w as We, x as Re, y as be, z as xe, S as F, A as Bt, B as oe, C as ut, F as Ce, G as Me, H as Oe, I as Ot, J as De, K as B, M as mt, T as $t, L as Ct, N as Yt, O as Ht, Q as Ae } from "./index-DDd3tlz2.mjs";
5
5
  import { Group as _, Path as at, Rect as qt, Polyline as rt, Ellipse as Ee, Sprite as Be, Label as ze, Scene as ie } from "spritejs";
6
6
  import Fe from "lineclip";
7
7
  import "lz-string";
@@ -89,8 +89,7 @@ const Z = /* @__PURE__ */ Dt(Ge), G = class G {
89
89
  for (let a = 1; a < s.length; a++)
90
90
  r.removeChild(s[a]), s[a].disconnect();
91
91
  e ? r.replaceChild(e, s[0]) : r.removeChild(s[0]), s[0].disconnect();
92
- } else
93
- e && r.append(e);
92
+ } else e && r.append(e);
94
93
  this.fullLayer === r ? (n = this.drawLayer) == null || n.getElementsByName(t).forEach((a) => {
95
94
  var c;
96
95
  (c = this.drawLayer) == null || c.removeChild(a), a.disconnect();
@@ -103,8 +102,7 @@ const Z = /* @__PURE__ */ Dt(Ge), G = class G {
103
102
  const { node: t, opt: e, vNodes: s, willSerializeData: o, targetNode: i } = r, { zIndex: n, translate: a, angle: c, originPoint: l, scenePoint: h, scale: p, pointMap: d, thickness: u } = e;
104
103
  let w;
105
104
  const f = i && K(i) || s.get(t.name);
106
- if (!f)
107
- return;
105
+ if (!f) return;
108
106
  Z(n) && (t.setAttribute("zIndex", n), f.opt.zIndex = n);
109
107
  const m = t.parent;
110
108
  if (m) {
@@ -2880,8 +2878,7 @@ class St extends I {
2880
2878
  }
2881
2879
  static updateNodeOpt(t) {
2882
2880
  const { node: e, opt: s, vNodes: o, targetNode: i } = t, { translate: n, originPoint: a, scenePoint: c, scale: l, angle: h, isLocked: p, zIndex: d } = s, u = i && K(i) || o.get(e.name);
2883
- if (!u)
2884
- return;
2881
+ if (!u) return;
2885
2882
  const w = e.parent;
2886
2883
  if (w) {
2887
2884
  if (Z(d) && (e.setAttribute("zIndex", d), u.opt.zIndex = d), it(p) && (u.opt.locked = p), a && c && l) {
@@ -3272,8 +3269,7 @@ const ot = class ot extends I {
3272
3269
  textInfos: R,
3273
3270
  zIndex: L
3274
3271
  } = s, S = i && K(i) || o.get(e.name);
3275
- if (!S || !e.parent)
3276
- return;
3272
+ if (!S || !e.parent) return;
3277
3273
  const N = S.opt;
3278
3274
  if (Z(L) && (e.setAttribute("zIndex", L), S.opt.zIndex = L), a && N.fontColor && (N.fontColor = a, e.children.forEach((C) => {
3279
3275
  C.tagName === "GROUP" && C.children.forEach((b) => {
@@ -3291,8 +3287,7 @@ const ot = class ot extends I {
3291
3287
  Et(N.boxPoint, h, p, c);
3292
3288
  const W = [S.op[0], S.op[1]], M = [W[0] - b[0], W[1] - b[1]];
3293
3289
  S.centerPos = [S.centerPos[0] + M[0], S.centerPos[1] + M[1]];
3294
- } else
3295
- c && N.boxPoint && (N.boxPoint = [N.boxPoint[0] + c[0], N.boxPoint[1] + c[1]], S.centerPos = [S.centerPos[0] + c[0], S.centerPos[1] + c[1]]);
3290
+ } else c && N.boxPoint && (N.boxPoint = [N.boxPoint[0] + c[0], N.boxPoint[1] + c[1]], S.centerPos = [S.centerPos[0] + c[0], S.centerPos[1] + c[1]]);
3296
3291
  return S && o.setInfo(e.name, S), S == null ? void 0 : S.rect;
3297
3292
  }
3298
3293
  static getRectFromLayer(t, e) {
@@ -3761,8 +3756,7 @@ class gs {
3761
3756
  async updateSelector(r) {
3762
3757
  var d;
3763
3758
  const t = this.workShapes.get(F);
3764
- if (!((d = t == null ? void 0 : t.selectIds) != null && d.length))
3765
- return;
3759
+ if (!((d = t == null ? void 0 : t.selectIds) != null && d.length)) return;
3766
3760
  const { callback: e, ...s } = r, { updateSelectorOpt: o, willSerializeData: i, scene: n } = s, a = await (t == null ? void 0 : t.updateSelector({
3767
3761
  updateSelectorOpt: o,
3768
3762
  selectIds: re(t.selectIds),
@@ -4025,8 +4019,7 @@ class gs {
4025
4019
  reRenderSelector(r = !1) {
4026
4020
  var s;
4027
4021
  const t = this.workShapes.get(F);
4028
- if (!t)
4029
- return;
4022
+ if (!t) return;
4030
4023
  if (t && !((s = t.selectIds) != null && s.length))
4031
4024
  return this.blurSelector();
4032
4025
  const e = t.reRenderSelector();
@@ -4380,18 +4373,17 @@ class Ts {
4380
4373
  op: M
4381
4374
  });
4382
4375
  }
4383
- } else
4384
- S.ops && ((R = S.node) == null || R.consumeService({
4385
- op: S.animationWorkData || [],
4386
- isFullWork: !0,
4387
- replaceId: W
4388
- }), S.isDel = !0, t.set(L, {
4389
- workState: A.Done,
4390
- op: b.filter((M, D) => {
4391
- if (D % T !== T - 1)
4392
- return !0;
4393
- }).slice(-2)
4394
- }));
4376
+ } else S.ops && ((R = S.node) == null || R.consumeService({
4377
+ op: S.animationWorkData || [],
4378
+ isFullWork: !0,
4379
+ replaceId: W
4380
+ }), S.isDel = !0, t.set(L, {
4381
+ workState: A.Done,
4382
+ op: b.filter((M, D) => {
4383
+ if (D % T !== T - 1)
4384
+ return !0;
4385
+ }).slice(-2)
4386
+ }));
4395
4387
  r = !0;
4396
4388
  break;
4397
4389
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="lodash" />
2
1
  import EventEmitter2 from "eventemitter2";
3
2
  import { MemberState, AppliancePluginLike, AppliancePluginOptions } from "./types";
4
3
  import { Collector } from "../collector";
@@ -1,5 +1,3 @@
1
- /// <reference types="react" />
2
- /// <reference types="lodash" />
3
1
  import type EventEmitter2 from "eventemitter2";
4
2
  import { ICameraOpt, ILayerOptionType, IMainMessageRenderData, IOffscreenCanvasOptionType } from "../core/types";
5
3
  import { BaseSubWorkModuleProps, ApplianceManagerLike } from "./types";
@@ -20,4 +20,7 @@ export declare const DefaultAppliancePluginOptions: {
20
20
  full: number;
21
21
  sub: number;
22
22
  };
23
+ bezier: {
24
+ combineUnitTime: number;
25
+ };
23
26
  };
@@ -26,7 +26,7 @@ export interface BaseDisplayerState {
26
26
  activeTextId?: string;
27
27
  }
28
28
  export declare const DisplayerContext: React.Context<Pick<BaseDisplayerState, "scale" | "dpr" | "angle" | "floatBarData" | "operationType"> & {
29
- mananger?: ApplianceViewManagerLike | undefined;
29
+ mananger?: ApplianceViewManagerLike;
30
30
  floatBarColors: [number, number, number][];
31
31
  setAngle: (angle: number) => void;
32
32
  setOperationType: (type: EmitEventType) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="lodash" />
2
1
  import { BaseApplianceManager, BaseApplianceManagerProps } from "../baseApplianceManager";
3
2
  import type { CameraState } from "../types";
4
3
  import { ViewContainerSingleManager } from "./containerManager";