@netless/appliance-plugin 1.1.13 → 1.1.14-beta.1

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Wi09G9p1.js");exports.ActiveContainerType=e.ActiveContainerType;exports.ApplianceMultiPlugin=e.ApplianceMultiPlugin;exports.ApplianceNames=e.ApplianceNames;exports.ApplianceSigleWrapper=e.ApplianceSigleWrapper;exports.ApplianceSinglePlugin=e.ApplianceSinglePlugin;exports.AutoDrawPlugin=e.AutoDrawPlugin;exports.ECanvasShowType=e.ECanvasShowType;exports.EDataType=e.EDataType;exports.EImageType=e.EImageType;exports.EMatrixrRelationType=e.EMatrixrRelationType;exports.EOperationType=e.EOperationType;exports.EPostMessageType=e.EPostMessageType;exports.ERenderFilterType=e.ERenderFilterType;exports.EScaleType=e.EScaleType;exports.EStrokeType=e.EStrokeType;exports.EToolsKey=e.EToolsKey;exports.ElayerType=e.ElayerType;exports.EmitEventType=e.EmitEventType;exports.EventMessageType=e.EventMessageType;exports.EvevtWorkState=e.EvevtWorkState;exports.EvevtWorkType=e.EvevtWorkType;exports.InternalMsgEmitterType=e.InternalMsgEmitterType;exports.Plugin=e.Plugin;exports.ShapeType=e.ShapeType;exports.fullWorkerUrl=e.fullWorker;exports.subWorkerUrl=e.subWorker;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BEY3BEPC.js");exports.ActiveContainerType=e.ActiveContainerType;exports.ApplianceMultiPlugin=e.ApplianceMultiPlugin;exports.ApplianceNames=e.ApplianceNames;exports.ApplianceSigleWrapper=e.ApplianceSigleWrapper;exports.ApplianceSinglePlugin=e.ApplianceSinglePlugin;exports.AutoDrawPlugin=e.AutoDrawPlugin;exports.ECanvasShowType=e.ECanvasShowType;exports.EDataType=e.EDataType;exports.EImageType=e.EImageType;exports.EMatrixrRelationType=e.EMatrixrRelationType;exports.EOperationType=e.EOperationType;exports.EPostMessageType=e.EPostMessageType;exports.ERenderFilterType=e.ERenderFilterType;exports.EScaleType=e.EScaleType;exports.EStrokeType=e.EStrokeType;exports.EToolsKey=e.EToolsKey;exports.ElayerType=e.ElayerType;exports.EmitEventType=e.EmitEventType;exports.EventMessageType=e.EventMessageType;exports.EvevtWorkState=e.EvevtWorkState;exports.EvevtWorkType=e.EvevtWorkType;exports.InternalMsgEmitterType=e.InternalMsgEmitterType;exports.Plugin=e.Plugin;exports.ShapeType=e.ShapeType;exports.fullWorkerUrl=e.fullWorker;exports.subWorkerUrl=e.subWorker;
@@ -1,4 +1,4 @@
1
- import { z as s, A as p, w as r, v as l, u as t, N as i, B as n, b as y, j as E, l as T, K as o, c as g, L as u, H as v, x as c, a as A, G as S, h as P, F as k, E as m, J as M, I as W, P as h, y as w, r as x, s as I } from "./index-0fBM84zK.mjs";
1
+ import { z as s, A as p, w as r, v as l, u as t, N as i, B as n, b as y, j as E, l as T, K as o, c as g, L as u, H as v, x as c, a as A, G as S, h as P, F as k, E as m, J as M, I as W, P as h, y as w, r as x, s as I } from "./index-DFl78uPi.mjs";
2
2
  export {
3
3
  s as ActiveContainerType,
4
4
  p as ApplianceMultiPlugin,
@@ -105,7 +105,7 @@ export declare class MasterControlForWorker extends MasterController {
105
105
  private zIndexNodeMethod?;
106
106
  /** master\fullwoker\subworker 三者高频绘制时队列化参数 */
107
107
  private subWorkerDrawCount;
108
- private wokerDrawCount;
108
+ private fullWorkerDrawCount;
109
109
  private maxDrawCount;
110
110
  private _consumeCount;
111
111
  private _postCount;
@@ -152,6 +152,7 @@ export declare class MasterControlForWorker extends MasterController {
152
152
  private get isCanRecordUndoRedo();
153
153
  private get isCanSentCursor();
154
154
  private get isPostCountType();
155
+ private get isCanPostDraw();
155
156
  private get isCanStartEventConsum();
156
157
  init(): Promise<void>;
157
158
  private useMainThread;
@@ -162,10 +163,8 @@ export declare class MasterControlForWorker extends MasterController {
162
163
  setLockSentEventCursor(bol: boolean): void;
163
164
  getTasksqueueState(): EvevtWorkState.Doing | EvevtWorkState.Done;
164
165
  setMaxDrawCount(num: number): void;
165
- getWorkDrawCount(): number;
166
- getSubWorkerDrawCount(): number;
166
+ getFullWorkDrawCount(): number;
167
167
  getMaxDrawCount(): number;
168
- setWorkDrawCount(num: number): void;
169
168
  setSubWorkerDrawCount(num: number): void;
170
169
  setConsumeCount(num: number): void;
171
170
  setWorkerTasksqueueCount(num: number): void;
@@ -52,7 +52,7 @@ export interface SubLocalThread {
52
52
  }): Promise<IMainMessage | undefined>;
53
53
  createLocalWork(data: IWorkerMessage): void;
54
54
  }
55
- export declare class SubLocalThreadImpl implements SubLocalThread {
55
+ export declare class SubLocalMainThreadImpl implements SubLocalThread {
56
56
  readonly vNodes: VNodeManager;
57
57
  readonly thread: MainThreadEngineImpl;
58
58
  workShapes: Map<string, BaseShapeTool>;
@@ -61,7 +61,7 @@ export declare class SubLocalThreadImpl implements SubLocalThread {
61
61
  private batchEraserWorks;
62
62
  private tmpOpt?;
63
63
  private syncUnitTime;
64
- private drawCount;
64
+ private fullWorkerDrawCount;
65
65
  private drawWorkActiveId?;
66
66
  private consumeCount;
67
67
  constructor(opt: ISubThreadInitOption);
@@ -98,7 +98,6 @@ export declare class SubLocalThreadImpl implements SubLocalThread {
98
98
  reRenderSelector(willSyncService?: boolean): Promise<void> | undefined;
99
99
  blurSelector(data?: IWorkerMessage): Promise<void>;
100
100
  clearWorkShapeNodeCache(workId: string): void;
101
- private drawBitMapEraser;
102
101
  private drawBitMapEraserFull;
103
102
  private drawPencilEraser;
104
103
  private drawEraser;
@@ -12,7 +12,7 @@ export interface SubServiceThread {
12
12
  removeWork(data: IWorkerMessage): void;
13
13
  runSelectWork(data: IWorkerMessage): void;
14
14
  }
15
- export declare class SubServiceThreadImpl implements SubServiceThread {
15
+ export declare class SubServiceMainThreadImpl implements SubServiceThread {
16
16
  readonly vNodes: VNodeManager;
17
17
  readonly thread: MainThreadEngineImpl;
18
18
  workShapes: Map<string, IServiceWorkItem>;
@@ -77,7 +77,7 @@ export declare class SubMainThreadWorkerImpl implements SubMainThreadWorker {
77
77
  workShapes: Map<string, BaseShapeTool>;
78
78
  private tmpOpt?;
79
79
  private syncUnitTime;
80
- private drawCount;
80
+ private subWorkerDrawCount;
81
81
  constructor(subThreadOpt: {
82
82
  thread: MainThreadWorkerImpl;
83
83
  });
@@ -6,6 +6,8 @@ import { VNodeManager } from "../vNodeManager";
6
6
  import { ShapeNodes, ShapeOptions } from "./utils";
7
7
  import { TextOptions } from "../../component/textEditor/types";
8
8
  import { SerializerEraserLines } from "./pencilEraserBitMap";
9
+ import type { LocalWorkForFullWorker } from "../worker/fullWorkerLocal";
10
+ import type { SubLocalMainThreadImpl } from "../mainThread/subLocalThread";
9
11
  export interface BaseShapeOptions {
10
12
  isOpacity?: boolean;
11
13
  fontColor?: string;
@@ -49,6 +51,7 @@ export declare abstract class BaseShapeTool {
49
51
  protected fullLayer: Group;
50
52
  protected workId: string;
51
53
  protected abstract workOptions: ShapeOptions;
54
+ isDelete: boolean;
52
55
  constructor(props: BaseShapeToolProps);
53
56
  get baseConsumeResult(): {
54
57
  workId: string;
@@ -62,10 +65,12 @@ export declare abstract class BaseShapeTool {
62
65
  isSubWorker?: boolean;
63
66
  drawCount?: number;
64
67
  isMainThread?: boolean;
68
+ removeDrawCount?: number;
65
69
  }): BaseConsumeResultType;
66
70
  /** 消费本地完整数据,返回绘制结果 */
67
71
  abstract consumeAll(props: {
68
72
  data?: IWorkerMessage;
73
+ workerEngine?: LocalWorkForFullWorker | SubLocalMainThreadImpl;
69
74
  }): BaseConsumeResultType;
70
75
  /** 消费服务端数据,返回绘制结果 */
71
76
  abstract consumeService(props: {
@@ -90,12 +95,15 @@ export declare abstract class BaseShapeTool {
90
95
  eraserlines: SerializerEraserLines;
91
96
  pos: [number, number];
92
97
  layer: Group;
93
- isClear?: boolean;
94
98
  }): void;
99
+ private createVmRenderNode;
100
+ private addEraserlines;
101
+ private isTransparentRectByCanvas;
95
102
  protected computEraserPoints(points: number[], thickness: number): Point2d[];
96
103
  private computDot;
97
104
  private computLine;
98
- replace(layer: Group, replaceId: string, newNode?: ShapeNodes): void;
105
+ replace(layer: Group, replaceId?: string, newNode?: ShapeNodes): void;
106
+ removeDrawCountNodes(layer: Group, removeDrawCount: number): void;
99
107
  static updateNodeOpt(param: {
100
108
  node: ShapeNodes;
101
109
  opt: IUpdateNodeOpt;
@@ -5,9 +5,9 @@ import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
5
5
  import { VNodeManager } from "../vNodeManager";
6
6
  import { ShapeNodes } from "./utils";
7
7
  import type { LocalWorkForFullWorker } from "../worker/fullWorkerLocal";
8
- import type { SubLocalThreadImpl } from "../mainThread/subLocalThread";
8
+ import type { SubLocalMainThreadImpl } from "../mainThread/subLocalThread";
9
9
  import type { SnapshotThreadImpl } from "../mainThread/snapshotThread";
10
- import type { SubServiceThreadImpl } from "../mainThread/subServiceThread";
10
+ import type { SubServiceMainThreadImpl } from "../mainThread/subServiceThread";
11
11
  import { type WorkThreadEngineForFullWorker, WorkThreadEngineForSubWorker } from "../worker/workerManager";
12
12
  export interface ImageOptions extends BaseShapeOptions {
13
13
  /** 图片地址 */
@@ -49,7 +49,7 @@ export declare class ImageShape extends BaseShapeTool {
49
49
  consumeService(): IRectType | undefined;
50
50
  consumeServiceAsync(props: {
51
51
  isFullWork: boolean;
52
- worker: LocalWorkForFullWorker | WorkThreadEngineForFullWorker | WorkThreadEngineForSubWorker | SubLocalThreadImpl | SnapshotThreadImpl | SubServiceThreadImpl;
52
+ worker: LocalWorkForFullWorker | WorkThreadEngineForFullWorker | WorkThreadEngineForSubWorker | SubLocalMainThreadImpl | SnapshotThreadImpl | SubServiceMainThreadImpl;
53
53
  replaceId?: string;
54
54
  }): Promise<IRectType | undefined>;
55
55
  clearTmpPoints(): void;
@@ -32,7 +32,7 @@ export declare class PencilShape extends BaseShapeTool {
32
32
  isSubWorker?: boolean;
33
33
  drawCount?: number;
34
34
  isMainThread?: boolean;
35
- replaceId?: string;
35
+ removeDrawCount?: number;
36
36
  }): {
37
37
  rect: IRectType | undefined;
38
38
  type: EPostMessageType;
@@ -1,9 +1,10 @@
1
1
  import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
2
2
  import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
3
3
  import { IWorkerMessage, IRectType, BaseNodeMapItem } from "../types";
4
+ import type { IMainMessage } from "../types";
4
5
  import { Point2d } from "../utils/primitives/Point2d";
5
6
  import type { LocalWorkForFullWorker } from "../worker/fullWorkerLocal";
6
- import type { SubLocalThreadImpl } from "../mainThread/subLocalThread";
7
+ import type { SubLocalMainThreadImpl } from "../mainThread/subLocalThread";
7
8
  export type SerializerEraserLines = Array<SerializerEraserItem>;
8
9
  export interface SerializerEraserItem {
9
10
  op: number[][];
@@ -27,24 +28,33 @@ export declare class BitMapEraserShape extends BaseShapeTool {
27
28
  private syncIndex;
28
29
  private syncTimestamp;
29
30
  constructor(props: BaseShapeToolProps);
31
+ /** 批量合并消费本地数据,返回绘制结果 */
32
+ combineConsume(): IMainMessage | undefined;
30
33
  consumeService(params: {
31
34
  op: number[];
32
35
  isFullWork?: boolean;
36
+ replaceId?: string;
33
37
  }): IRectType | undefined;
34
38
  private updateTempPoints;
35
39
  private getChangeNodes;
36
- reRenderEffectNodes(props: {
37
- willDeleteNodes?: Set<string>;
38
- willUpdateNodes?: Map<string, BaseNodeMapItem>;
39
- worker: LocalWorkForFullWorker | SubLocalThreadImpl;
40
- }): Promise<IRectType | undefined>;
41
40
  consume(props: {
42
41
  data: IWorkerMessage;
42
+ isFullWork: boolean;
43
+ isSubWorker?: boolean;
44
+ isMainThread?: boolean;
45
+ drawCount?: number;
46
+ removeDrawCount?: number;
43
47
  }): {
44
48
  workId: string;
45
49
  toolsType: EToolsKey;
46
50
  opt: import("./utils").ShapeOptions;
47
51
  type: EPostMessageType;
52
+ rect?: undefined;
53
+ dataType?: undefined;
54
+ } | {
55
+ rect: IRectType | undefined;
56
+ type: EPostMessageType;
57
+ dataType: EDataType;
48
58
  } | {
49
59
  type: EPostMessageType;
50
60
  dataType: EDataType;
@@ -59,10 +69,10 @@ export declare class BitMapEraserShape extends BaseShapeTool {
59
69
  opt: import("./utils").ShapeOptions;
60
70
  };
61
71
  private draw;
62
- private isTransparentRectByGL;
63
- private isTransparentRectByCanvas;
64
- private isTransparentRect;
65
- consumeAll(): {
72
+ private computEraserPointLines;
73
+ consumeAll(props: {
74
+ workerEngine?: LocalWorkForFullWorker | SubLocalMainThreadImpl;
75
+ }): {
66
76
  workId: string;
67
77
  toolsType: EToolsKey;
68
78
  opt: import("./utils").ShapeOptions;
@@ -6,7 +6,7 @@ import type { VNodeManager } from "../vNodeManager";
6
6
  import { TextOptions } from "../../component/textEditor/types";
7
7
  import { LocalWorkForFullWorker } from "../worker/fullWorkerLocal";
8
8
  import { ShapeOptType } from "../../displayer/types";
9
- import type { SubLocalThreadImpl } from "../mainThread/subLocalThread";
9
+ import type { SubLocalMainThreadImpl } from "../mainThread/subLocalThread";
10
10
  import { EStrokeType } from "../../plugin";
11
11
  export interface SelectorOptions extends BaseShapeOptions {
12
12
  }
@@ -111,7 +111,7 @@ export declare class SelectorShape extends BaseShapeTool {
111
111
  vNodes: VNodeManager;
112
112
  selectIds?: string[];
113
113
  willSerializeData?: boolean;
114
- worker?: LocalWorkForFullWorker | SubLocalThreadImpl;
114
+ worker?: LocalWorkForFullWorker | SubLocalMainThreadImpl;
115
115
  offset?: [number, number];
116
116
  }): Promise<IMainMessage | undefined>;
117
117
  blurSelector(): {
@@ -109,7 +109,6 @@ export type IWorkerMessage = Omit<Partial<BaseCollectorReducerAction>, 'op'> & {
109
109
  currentToolsData?: IActiveToolsDataType;
110
110
  updateNodeOpt?: IUpdateNodeOpt;
111
111
  layerOpt?: ILayerOptionType;
112
- drawCount?: number;
113
112
  useAnimation?: boolean;
114
113
  willRefreshSelector?: boolean;
115
114
  willSyncService?: boolean;
@@ -149,7 +148,6 @@ export interface IMainMessage extends INormalPushMsg {
149
148
  removeIds?: Array<string>;
150
149
  /** 是否是完整的一次任务 */
151
150
  isFullWork?: boolean;
152
- drawCount?: number;
153
151
  selectIds?: Array<string>;
154
152
  padding?: number;
155
153
  selectRect?: IRectType;
@@ -209,11 +207,12 @@ export interface IBatchMainMessage {
209
207
  render?: Array<IMainMessageRenderData>;
210
208
  /** 同步服务端数据 */
211
209
  sp?: Array<IMainMessage>;
212
- drawCount?: number;
213
210
  workerTasksqueueCount?: number;
214
211
  workIds?: Set<string>;
215
212
  viewId?: string;
216
213
  consumeCount?: number;
214
+ subWorkerDrawCount?: number;
215
+ fullWorkerDrawCount?: number;
217
216
  }
218
217
  export interface ICameraOpt {
219
218
  centerX: number;
@@ -98,6 +98,7 @@ export declare abstract class LocalWork {
98
98
  protected tmpOpt?: IActiveToolsDataType;
99
99
  workShapes: Map<string, BaseShapeTool>;
100
100
  protected drawCount: number;
101
+ protected consumeCount: number;
101
102
  protected syncUnitTime: number;
102
103
  constructor(opt: ISubWorkerInitOption);
103
104
  destroy(): void;
@@ -1,4 +1,4 @@
1
- import { IWorkerMessage, IMainMessage, EToolsKey, IBatchMainMessage, IUpdateSelectorPropsType } from "..";
1
+ import { IWorkerMessage, IMainMessage, IRectType, EToolsKey, IBatchMainMessage, IUpdateSelectorPropsType } from "..";
2
2
  import { BaseShapeOptions, SelectorShape } from "../tools";
3
3
  import { ISubWorkerInitOption, LocalWork } from "./base";
4
4
  import { ServiceWorkForFullWorker } from "./fullWorkerService";
@@ -8,7 +8,6 @@ export declare class LocalWorkForFullWorker extends LocalWork {
8
8
  private combineTimerId?;
9
9
  private combineDrawResolve?;
10
10
  private combineDrawActiveId?;
11
- private consumeCount;
12
11
  protected drawWorkActiveId?: string;
13
12
  private effectSelectNodeData;
14
13
  private batchEraserWorks;
@@ -22,7 +21,10 @@ export declare class LocalWorkForFullWorker extends LocalWork {
22
21
  private commandDeleteText;
23
22
  removeSelector(data: IWorkerMessage, workEngine?: WorkThreadEngineForFullWorker): Promise<void>;
24
23
  removeWork(data: IWorkerMessage): Promise<void>;
25
- private removeNode;
24
+ removeNode(key: string): {
25
+ fullRect: IRectType | undefined;
26
+ drawRect: IRectType | undefined;
27
+ };
26
28
  private _removeWork;
27
29
  checkTextActive(data: IWorkerMessage): Promise<void>;
28
30
  colloctEffectSelectWork(data: IWorkerMessage): Promise<IWorkerMessage | undefined>;
@@ -47,6 +49,7 @@ export declare class LocalWorkForFullWorker extends LocalWork {
47
49
  destroy(): void;
48
50
  private drawBitMapEraser;
49
51
  private drawBitMapEraserFull;
52
+ private drawBitMapCombine;
50
53
  private drawPencilCombine;
51
54
  private drawSelector;
52
55
  private drawPencilEraser;