@netless/appliance-plugin 1.1.36-beta.1 → 1.1.36-beta.3

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.
Files changed (35) hide show
  1. package/READMA.zh-CN.md +60 -49
  2. package/README.md +92 -50
  3. package/dist/appliance-plugin.js +1 -1
  4. package/dist/appliance-plugin.mjs +1 -1
  5. package/dist/assets/{fullWorker-B_mvkoeW.js → fullWorker-C5kniG7M.js} +7 -7
  6. package/dist/assets/{subWorker-CRdsidWT.js → subWorker-Cps_t9fu.js} +7 -7
  7. package/dist/{bridge-enxPG6qf.js → bridge-DeN8jJgs.js} +1 -1
  8. package/dist/bridge-DvqpopG1.mjs +67 -0
  9. package/dist/bridge.js +1 -1
  10. package/dist/bridge.mjs +1 -1
  11. package/dist/component/textEditor/manager.d.ts +0 -1
  12. package/dist/fullWorker.js +2 -2
  13. package/dist/{index-D8SnD90W.mjs → index-B3MjbDsW.mjs} +1 -1
  14. package/dist/{index-2On9v0Ff.mjs → index-B7jKsOvs.mjs} +4089 -4324
  15. package/dist/{index-BZql6xgR.mjs → index-C-mmzWhD.mjs} +1 -1
  16. package/dist/{index-CcS9cKSp.js → index-C5LkBIDy.js} +1 -1
  17. package/dist/{index-D4z0hSjm.js → index-CGUukLaV.js} +1 -1
  18. package/dist/{index-Bm90lQii.js → index-CR9y5tMJ.js} +1 -1
  19. package/dist/{index-CIjmeY9J.js → index-ChEzLTlY.js} +1 -1
  20. package/dist/{index-K9QVPOhV.mjs → index-CobMH-xU.mjs} +14 -21
  21. package/dist/index-D9xjZ07S.js +1 -0
  22. package/dist/index-DJpL2E5_.js +1 -0
  23. package/dist/{index-DbI0V6BY.mjs → index-Dllr4Im3.mjs} +3937 -4172
  24. package/dist/{index-BrJL-fin.mjs → index-v6moTe3J.mjs} +14 -21
  25. package/dist/plugin/selectorApi.d.ts +4 -1
  26. package/dist/plugin/types.d.ts +8 -3
  27. package/dist/subWorker.js +2 -2
  28. package/dist/undo/index.d.ts +0 -1
  29. package/package.json +2 -4
  30. package/cdn/cdn.js +0 -1
  31. package/cdn/fullWorker-uAwmRi.js +0 -486
  32. package/cdn/subWorker-BVNpAC.js +0 -486
  33. package/dist/bridge-DYkH1J6p.mjs +0 -67
  34. package/dist/index-BSD0B_eV.js +0 -1
  35. package/dist/index-W9Jz9E04.js +0 -1
@@ -1,7 +1,7 @@
1
1
  var _t = Object.defineProperty;
2
2
  var Vt = (T, i, e) => i in T ? _t(T, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[i] = e;
3
3
  var y = (T, i, e) => Vt(T, typeof i != "symbol" ? i + "" : i, e);
4
- import { g as Je, i as et, _ as Pt, p as Se, e as Te, D as J, f as A, h as Re, j as Ve, k as se, P as E, l as W, c as k, s as qe, m as tt, n as Ne, o as st, r as qt, q as Ht, t as Me, u as U, a as w, b as x, v as O, w as G, x as ee, y as $, z as Ze, A as jt, B as Zt, C as Kt, F as Qt, G as Jt, H as es, I as ts, J as ss, K as X, L as os, M as ht, N as We, O as Wt, T as Be, Q as ye, R as is, U as Lt, W as rs, X as ns, Y as ce, Z as _, $ as ue, a0 as as, a1 as cs, a2 as ls, a3 as hs, a4 as be, a5 as ps, E as Y, a6 as pt, V as dt, S as ds } from "./index-DbI0V6BY.mjs";
4
+ import { g as Je, i as et, _ as Pt, p as Se, e as Te, D as J, f as A, h as Re, j as Ve, k as se, P as E, l as W, c as k, s as qe, m as tt, n as Ne, o as st, r as qt, q as Ht, t as Me, u as U, a as w, b as x, v as O, w as G, x as ee, y as $, z as Ze, A as jt, B as Zt, C as Kt, F as Qt, G as Jt, H as es, I as ts, J as ss, K as X, L as os, M as ht, N as We, O as Wt, T as Be, Q as ye, R as is, U as Lt, W as rs, X as ns, Y as ce, Z as _, $ as ue, a0 as as, a1 as cs, a2 as ls, a3 as hs, a4 as be, a5 as ps, E as Y, a6 as pt, V as dt, S as ds } from "./index-Dllr4Im3.mjs";
5
5
  import { Group as j, Path as we, Sprite as Ct, Rect as Ke, Polyline as he, Ellipse as us, Label as fs, Scene as ot, Layer as ms } from "spritejs";
6
6
  import ie from "clipper-lib";
7
7
  import it from "lineclip";
@@ -7448,37 +7448,30 @@ class no {
7448
7448
  }
7449
7449
  }
7450
7450
  async consumeFull(i) {
7451
- var s, o, r;
7451
+ var s;
7452
7452
  const e = this.setFullWork(i), t = i.ops && ye(i.ops);
7453
7453
  if (e) {
7454
- const n = (s = i.workId) == null ? void 0 : s.toString();
7455
- n && i.clearPreviewLocalWork && this.thread.localLayer.getElementsByName(n).forEach((c) => {
7456
- c.remove(), V(c, this.thread.localLayer.parent);
7454
+ const o = (s = i.workId) == null ? void 0 : s.toString();
7455
+ o && i.clearPreviewLocalWork && this.thread.localLayer.getElementsByName(o).forEach((n) => {
7456
+ n.remove(), V(n, this.thread.localLayer.parent);
7457
7457
  }), e.toolsType === k.BackgroundSVG ? e.consumeService({
7458
7458
  isFullWork: !0,
7459
- replaceId: n
7459
+ replaceId: o
7460
7460
  }) : e.toolsType === k.Image ? await e.consumeServiceAsync({
7461
7461
  isFullWork: !0,
7462
- replaceId: n,
7462
+ replaceId: o,
7463
7463
  worker: this
7464
7464
  }) : e.toolsType === k.Text ? await e.consumeServiceAsync({
7465
7465
  isFullWork: !0,
7466
- replaceId: n,
7466
+ replaceId: o,
7467
7467
  boxRect: this.thread.getSceneRect()
7468
7468
  }) : e.consumeService({
7469
7469
  op: t,
7470
7470
  isFullWork: !0,
7471
- replaceId: n
7471
+ replaceId: o
7472
7472
  }), i != null && i.updateNodeOpt && e.updataOptService(i.updateNodeOpt);
7473
- const a = [];
7474
- i.workId && this.workShapes.delete(i.workId.toString()), i.willSyncService && (i.toolsType === k.Image && console.info("[appliance-plugin]", {
7475
- target: "image-undo.mainThread.full.post",
7476
- viewId: this.thread.viewId,
7477
- workId: ((r = (o = i.workId) == null ? void 0 : o.toString) == null ? void 0 : r.call(o)) || i.workId,
7478
- needUndoTicker: i.needUndoTicker,
7479
- requestId: i.requestId,
7480
- emitEventType: i.emitEventType
7481
- }), a.push({
7473
+ const r = [];
7474
+ i.workId && this.workShapes.delete(i.workId.toString()), i.willSyncService && r.push({
7482
7475
  opt: i.opt,
7483
7476
  toolsType: i.toolsType,
7484
7477
  type: w.FullWork,
@@ -7489,15 +7482,15 @@ class no {
7489
7482
  needUndoTicker: i.needUndoTicker,
7490
7483
  requestId: i.requestId,
7491
7484
  emitEventType: i.emitEventType
7492
- })), i.isLockSentEventCursor && a.push({
7485
+ }), i.isLockSentEventCursor && r.push({
7493
7486
  type: w.None,
7494
7487
  isLockSentEventCursor: !0
7495
- }), i.needUndoTicker && a.push({
7488
+ }), i.needUndoTicker && r.push({
7496
7489
  type: w.None,
7497
7490
  needUndoTicker: i.needUndoTicker,
7498
7491
  emitEventType: i.emitEventType,
7499
7492
  requestId: i.requestId
7500
- }), a.length && (i.needUndoTicker, this.thread.post({ sp: a }));
7493
+ }), r.length && (i.needUndoTicker, this.thread.post({ sp: r }));
7501
7494
  }
7502
7495
  }
7503
7496
  async colloctEffectSelectWork(i) {
@@ -31,6 +31,9 @@ export declare class SelectorApiManager {
31
31
  /** 同一次属性更新导致的几何变化做尾部合并,只派发最后一次 */
32
32
  private pendingPropertyGeometryByKey;
33
33
  constructor(control: BaseApplianceManager);
34
+ private formatFieldsFromChanges;
35
+ private hasShapeChanges;
36
+ private resolveShapeDispatchToolsTypes;
34
37
  private cancelUndoTicker;
35
38
  private resolveCancelableUndoTickerId;
36
39
  private captureUndoTickerDuringDispatch;
@@ -123,7 +126,7 @@ export declare class SelectorApiManager {
123
126
  }) => void;
124
127
  /** 收集本次 selector 更新需要等待的内部 method ack */
125
128
  private collectPendingMethods;
126
- private hasSupportedChangesForToolsType;
129
+ private hasApplicableChangesForToolsType;
127
130
  private buildUpdatedElementValue;
128
131
  private normalizeUpdateElementInfo;
129
132
  /** 把 UpdateSelectedElementChanges 分发到对应的内部 method emit */
@@ -303,9 +303,9 @@ export interface AppliancePluginInstance {
303
303
  insertBackgroundImage(viewId: string, imageInfo: ISVGUrlInformation): void;
304
304
  /**
305
305
  * 获取当前 selector 选中元素的快照。
306
- * @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的 appID。省略时取当前 focuedView / mainView。
307
- * @returns 当前选中态快照;若未选中任何元素则返回 `undefined`。
308
- */
306
+ * @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的 appID。省略时取当前 focuedView / mainView。
307
+ * @returns 当前选中态快照;若未选中任何元素则返回 `undefined`。
308
+ */
309
309
  getSelectedElements(viewId?: string): SelectedElementsSnapshot | undefined;
310
310
  /**
311
311
  * 判断某个属性字段是否属于指定 toolsType 的可编辑能力。
@@ -920,6 +920,11 @@ export type SelectorTransformChangeInfo = {
920
920
  workState: EventWorkState;
921
921
  };
922
922
  export type UpdateSelectedElementChanges = {
923
+ /**
924
+ * Shape 参数更新时传给 SetShapeOpt 的真实教具类型。
925
+ * 例如更新 Star 的 shape.vertices 时传 EToolsKey.Star。
926
+ */
927
+ toolsType?: EToolsKey;
923
928
  strokeColor?: string;
924
929
  fillColor?: string;
925
930
  thickness?: number;