@netless/appliance-plugin 1.1.15-beta.1 → 1.1.15-beta.2

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 (37) hide show
  1. package/cdn/cdn.js +1 -1
  2. package/cdn/fullWorker-BLBicx.js +459 -0
  3. package/cdn/subWorker-BWE2Rk.js +459 -0
  4. package/dist/appliance-plugin.js +1 -1
  5. package/dist/appliance-plugin.mjs +10 -10
  6. package/dist/core/enum.d.ts +3 -0
  7. package/dist/core/mainThread/snapshotThread.d.ts +1 -1
  8. package/dist/core/mainThread/subLocalThread.d.ts +1 -1
  9. package/dist/core/mainThread/subTopThread.d.ts +2 -2
  10. package/dist/core/mainThread/workerMainThread.d.ts +1 -1
  11. package/dist/core/tools/arrow.d.ts +2 -1
  12. package/dist/core/tools/base.d.ts +29 -3
  13. package/dist/core/tools/ellipse.d.ts +2 -1
  14. package/dist/core/tools/pencil.d.ts +2 -1
  15. package/dist/core/tools/polygon.d.ts +2 -1
  16. package/dist/core/tools/rectangle.d.ts +2 -1
  17. package/dist/core/tools/speechBalloon.d.ts +2 -1
  18. package/dist/core/tools/star.d.ts +2 -1
  19. package/dist/core/tools/straight.d.ts +2 -1
  20. package/dist/core/tools/utils.d.ts +4 -3
  21. package/dist/core/types.d.ts +0 -1
  22. package/dist/core/utils/spriteNode.d.ts +7 -1
  23. package/dist/core/worker/base.d.ts +3 -1
  24. package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
  25. package/dist/core/worker/workerManager.d.ts +0 -2
  26. package/dist/fullWorker.js +143 -129
  27. package/dist/{index-BZMch2Ky.mjs → index-7Ny1Gedj.mjs} +6634 -6663
  28. package/dist/index-CtT1W9YT.js +1 -0
  29. package/dist/index-DZB9amqH.js +1 -0
  30. package/dist/{index-BY6CrjXe.mjs → index-D_0O2awx.mjs} +143 -143
  31. package/dist/plugin/const.d.ts +2 -0
  32. package/dist/subWorker.js +143 -129
  33. package/package.json +1 -1
  34. package/cdn/fullWorker-wywIMW.js +0 -445
  35. package/cdn/subWorker-Drm8g9.js +0 -445
  36. package/dist/index-BxwDnRsj.js +0 -1
  37. package/dist/index-CeIk1a6W.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CeIk1a6W.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-DZB9amqH.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,10 +1,10 @@
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-BZMch2Ky.mjs";
1
+ import { F as s, A as p, y as r, x as t, w as l, Q as i, G as n, b as y, k as E, m as T, N as o, c as g, O as u, K as v, z as c, a as A, J as S, j as k, H as m, E as P, L as M, I as W, P as w, B as x, u as I, v as b } from "./index-7Ny1Gedj.mjs";
2
2
  export {
3
3
  s as ActiveContainerType,
4
4
  p as ApplianceMultiPlugin,
5
5
  r as ApplianceNames,
6
- l as ApplianceSigleWrapper,
7
- t as ApplianceSinglePlugin,
6
+ t as ApplianceSigleWrapper,
7
+ l as ApplianceSinglePlugin,
8
8
  i as AutoDrawPlugin,
9
9
  n as ECanvasShowType,
10
10
  y as EDataType,
@@ -17,13 +17,13 @@ export {
17
17
  c as EStrokeType,
18
18
  A as EToolsKey,
19
19
  S as ElayerType,
20
- P as EmitEventType,
21
- k as EventMessageType,
22
- m as EvevtWorkState,
20
+ k as EmitEventType,
21
+ m as EventMessageType,
22
+ P as EvevtWorkState,
23
23
  M as EvevtWorkType,
24
24
  W as InternalMsgEmitterType,
25
- h as Plugin,
26
- w as ShapeType,
27
- x as fullWorkerUrl,
28
- I as subWorkerUrl
25
+ w as Plugin,
26
+ x as ShapeType,
27
+ I as fullWorkerUrl,
28
+ b as subWorkerUrl
29
29
  };
@@ -160,8 +160,11 @@ export declare enum EvevtWorkType {
160
160
  Unwritable = 4
161
161
  }
162
162
  export declare enum EMatrixrRelationType {
163
+ /** 在内部, 无边界碰撞 */
163
164
  inside = 0,
165
+ /** 在外部 */
164
166
  outside = 1,
167
+ /** 有边界碰撞 */
165
168
  intersect = 2
166
169
  }
167
170
  /**
@@ -28,7 +28,7 @@ export declare class SnapshotThreadImpl {
28
28
  loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId'>): Promise<ImageBitmap | undefined>;
29
29
  createWorkShapeNode(opt: IActiveToolsDataType & {
30
30
  workId: string;
31
- }): import("../tools").SelectorShape | import("../tools").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | TextShape | ImageShape | import("../tools").ArrowShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | undefined;
31
+ }): import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools").SelectorShape | ImageShape | undefined;
32
32
  setFullWork(data: Pick<IWorkerMessage, 'workId' | 'opt' | 'toolsType'>): BaseShapeTool | undefined;
33
33
  runFullWork(data: IWorkerMessage): Promise<IRectType | undefined>;
34
34
  private getSnapshot;
@@ -112,5 +112,5 @@ export declare class SubLocalMainThreadImpl implements SubLocalThread {
112
112
  setWorkOptions(workId: string, opt: BaseShapeOptions): void;
113
113
  createWorkShapeNode(opt: IActiveToolsDataType & {
114
114
  workId: string;
115
- }): SelectorShape | PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | TextShape | ImageShape | import("../tools").ArrowShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | undefined;
115
+ }): import("../tools").ArrowShape | PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | BitMapEraserShape | SelectorShape | ImageShape | undefined;
116
116
  }
@@ -33,7 +33,7 @@ export declare class SubTopThreadImpl implements SubTopThread {
33
33
  constructor(opt: ISubThreadInitOption);
34
34
  createLocalWork(data: IWorkerMessage): void;
35
35
  getLocalWorkShape(workId: string): ILocalWorkItem | undefined;
36
- createLocalWorkShape(workId: string, opt?: BaseShapeOptions): import("../tools").SelectorShape | import("../tools").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | import("../tools/text").TextShape | import("../tools").ImageShape | import("../tools").ArrowShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | undefined;
36
+ createLocalWorkShape(workId: string, opt?: BaseShapeOptions): import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/text").TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools").SelectorShape | import("../tools").ImageShape | undefined;
37
37
  canUseTopLayer(toolsType: EToolsKey): toolsType is EToolsKey.LaserPen;
38
38
  destroy(): void;
39
39
  clearAll(): void;
@@ -42,7 +42,7 @@ export declare class SubTopThreadImpl implements SubTopThread {
42
42
  getToolsOpt(): IActiveToolsDataType | undefined;
43
43
  createWorkShapeNode(opt: IActiveToolsDataType & {
44
44
  workId: string;
45
- }): import("../tools").SelectorShape | import("../tools").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | import("../tools/text").TextShape | import("../tools").ImageShape | import("../tools").ArrowShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | undefined;
45
+ }): import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/text").TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools").SelectorShape | import("../tools").ImageShape | undefined;
46
46
  private setNodeKey;
47
47
  private activeServiceWorkShape;
48
48
  private computNextAnimationIndex;
@@ -93,7 +93,7 @@ export declare class SubMainThreadWorkerImpl implements SubMainThreadWorker {
93
93
  setToolsOpt(opt: IActiveToolsDataType): void;
94
94
  createWorkShapeNode(opt: IActiveToolsDataType & {
95
95
  workId: string;
96
- }): import("../tools").SelectorShape | import("../tools").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | import("../tools/text").TextShape | import("../tools").ImageShape | import("../tools").ArrowShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | undefined;
96
+ }): import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/text").TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools").SelectorShape | import("../tools").ImageShape | undefined;
97
97
  clearWorkShapeNodeCache(workId: string): void;
98
98
  getWorkShape(workId: string): BaseShapeTool | undefined;
99
99
  }
@@ -1,5 +1,5 @@
1
1
  import { IWorkerMessage, IRectType, IUpdateNodeOpt } from "../types";
2
- import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
2
+ import { EDataType, EPostMessageType, EScaleType, EToolsKey, EvevtWorkState } from "../enum";
3
3
  import { Point2d } from "../utils/primitives/Point2d";
4
4
  import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
5
5
  import { VNodeManager } from "../vNodeManager";
@@ -66,6 +66,7 @@ export declare class ArrowShape extends BaseShapeTool {
66
66
  consumeService(props: {
67
67
  op: number[];
68
68
  isFullWork: boolean;
69
+ workState?: EvevtWorkState;
69
70
  }): IRectType | undefined;
70
71
  clearTmpPoints(): void;
71
72
  static updateNodeOpt(param: {
@@ -1,9 +1,9 @@
1
1
  import { Point2d } from "../utils/primitives/Point2d";
2
- import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
2
+ import { EDataType, EPostMessageType, EScaleType, EToolsKey, EvevtWorkState } from "../enum";
3
3
  import { BaseNodeMapItem, IMainMessage, IRectType, IUpdateNodeOpt, IWorkerMessage } from "../types";
4
4
  import { Group } from "spritejs";
5
5
  import { VNodeManager } from "../vNodeManager";
6
- import { ShapeNodes, ShapeOptions } from "./utils";
6
+ import { ShapeNodes, ShapeOptions, ShapeOptionsType } from "./utils";
7
7
  import { TextOptions } from "../../component/textEditor/types";
8
8
  import { SerializerEraserLines } from "./pencilEraserBitMap";
9
9
  import type { LocalWorkForFullWorker } from "../worker/fullWorkerLocal";
@@ -45,6 +45,8 @@ export declare abstract class BaseShapeTool {
45
45
  readonly abstract toolsType: EToolsKey;
46
46
  readonly abstract canRotate: boolean;
47
47
  readonly abstract scaleType: EScaleType;
48
+ readonly maxImageWidth: number;
49
+ readonly maxImageHeight: number;
48
50
  syncUnitTime: number;
49
51
  vNodes?: VNodeManager;
50
52
  protected drawLayer?: Group;
@@ -77,6 +79,7 @@ export declare abstract class BaseShapeTool {
77
79
  op: number[];
78
80
  isFullWork: boolean;
79
81
  replaceId?: string;
82
+ workState?: EvevtWorkState;
80
83
  }): IRectType | undefined;
81
84
  protected filterSamePoints(points: Point2d[], tolerance?: number): Point2d[];
82
85
  /** 清除临时数据 */
@@ -95,10 +98,12 @@ export declare abstract class BaseShapeTool {
95
98
  eraserlines: SerializerEraserLines;
96
99
  pos: [number, number];
97
100
  layer: Group;
98
- }): void;
101
+ }, isDrawEraserlines?: boolean): false | undefined;
99
102
  private createVmRenderNode;
103
+ private getGroupRect;
100
104
  private addEraserlines;
101
105
  private isTransparentRectByCanvas;
106
+ private createSpriteNode;
102
107
  protected computEraserPoints(points: number[], thickness: number): Point2d[];
103
108
  private computDot;
104
109
  private computLine;
@@ -113,4 +118,25 @@ export declare abstract class BaseShapeTool {
113
118
  }): IRectType | undefined;
114
119
  static getCenterPos(r: IRectType, layer: Group): [number, number];
115
120
  static getRectFromLayer(layer: Group, name: string): IRectType | undefined;
121
+ static isWillRefresh(params: {
122
+ toolsType: EToolsKey;
123
+ opt: ShapeOptionsType<any>;
124
+ node: ShapeNodes;
125
+ updateOpt: IUpdateNodeOpt;
126
+ vNodes: VNodeManager;
127
+ willSerializeData?: boolean;
128
+ }): boolean;
116
129
  }
130
+ export declare const eraserSizes: readonly (Readonly<{
131
+ width: 18;
132
+ height: 26;
133
+ }> | Readonly<{
134
+ width: 26;
135
+ height: 34;
136
+ }> | Readonly<{
137
+ width: 34;
138
+ height: 50;
139
+ }> | Readonly<{
140
+ width: 48;
141
+ height: 74;
142
+ }>)[];
@@ -1,5 +1,5 @@
1
1
  import { IWorkerMessage, IRectType, IUpdateNodeOpt } from "../types";
2
- import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
2
+ import { EDataType, EPostMessageType, EScaleType, EToolsKey, EvevtWorkState } from "../enum";
3
3
  import { Point2d } from "../utils/primitives/Point2d";
4
4
  import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
5
5
  import { VNodeManager } from "../vNodeManager";
@@ -64,6 +64,7 @@ export declare class EllipseShape extends BaseShapeTool {
64
64
  consumeService(props: {
65
65
  op: number[];
66
66
  isFullWork: boolean;
67
+ workState?: EvevtWorkState;
67
68
  }): IRectType | undefined;
68
69
  clearTmpPoints(): void;
69
70
  static updateNodeOpt(param: {
@@ -1,5 +1,5 @@
1
1
  import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
2
- import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
2
+ import { EDataType, EPostMessageType, EScaleType, EToolsKey, EvevtWorkState } from "../enum";
3
3
  import { Point2d } from "../utils/primitives/Point2d";
4
4
  import { IWorkerMessage, IMainMessage, IRectType, IUpdateNodeOpt } from "../types";
5
5
  import { EStrokeType } from "../../plugin/types";
@@ -75,6 +75,7 @@ export declare class PencilShape extends BaseShapeTool {
75
75
  op: number[];
76
76
  isFullWork?: boolean;
77
77
  replaceId?: string;
78
+ workState?: EvevtWorkState;
78
79
  }): IRectType | undefined;
79
80
  private transformDataAll;
80
81
  private draw;
@@ -1,5 +1,5 @@
1
1
  import { IWorkerMessage, IRectType, IUpdateNodeOpt } from "../types";
2
- import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
2
+ import { EDataType, EPostMessageType, EScaleType, EToolsKey, EvevtWorkState } from "../enum";
3
3
  import { Point2d } from "../utils/primitives/Point2d";
4
4
  import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
5
5
  import { VNodeManager } from "../vNodeManager";
@@ -66,6 +66,7 @@ export declare class PolygonShape extends BaseShapeTool {
66
66
  consumeService(props: {
67
67
  op: number[];
68
68
  isFullWork: boolean;
69
+ workState?: EvevtWorkState;
69
70
  }): IRectType | undefined;
70
71
  clearTmpPoints(): void;
71
72
  static updateNodeOpt(param: {
@@ -1,5 +1,5 @@
1
1
  import { IWorkerMessage, IRectType, IUpdateNodeOpt } from "../types";
2
- import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
2
+ import { EDataType, EPostMessageType, EScaleType, EToolsKey, EvevtWorkState } from "../enum";
3
3
  import { Point2d } from "../utils/primitives/Point2d";
4
4
  import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
5
5
  import { VNodeManager } from "../vNodeManager";
@@ -67,6 +67,7 @@ export declare class RectangleShape extends BaseShapeTool {
67
67
  op: number[];
68
68
  isFullWork: boolean;
69
69
  replaceId?: string;
70
+ workState?: EvevtWorkState;
70
71
  }): IRectType | undefined;
71
72
  clearTmpPoints(): void;
72
73
  static updateNodeOpt(param: {
@@ -1,5 +1,5 @@
1
1
  import { IWorkerMessage, IRectType, IUpdateNodeOpt } from "../types";
2
- import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
2
+ import { EDataType, EPostMessageType, EScaleType, EToolsKey, EvevtWorkState } from "../enum";
3
3
  import { Point2d } from "../utils/primitives/Point2d";
4
4
  import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
5
5
  import { VNodeManager } from "../vNodeManager";
@@ -68,6 +68,7 @@ export declare class SpeechBalloonShape extends BaseShapeTool {
68
68
  consumeService(props: {
69
69
  op: number[];
70
70
  isFullWork: boolean;
71
+ workState?: EvevtWorkState;
71
72
  }): IRectType | undefined;
72
73
  clearTmpPoints(): void;
73
74
  static updateNodeOpt(param: {
@@ -1,5 +1,5 @@
1
1
  import { IWorkerMessage, IRectType, IUpdateNodeOpt } from "../types";
2
- import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
2
+ import { EDataType, EPostMessageType, EScaleType, EToolsKey, EvevtWorkState } from "../enum";
3
3
  import { Point2d } from "../utils/primitives/Point2d";
4
4
  import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
5
5
  import { VNodeManager } from "../vNodeManager";
@@ -67,6 +67,7 @@ export declare class StarShape extends BaseShapeTool {
67
67
  consumeService(props: {
68
68
  op: number[];
69
69
  isFullWork: boolean;
70
+ workState?: EvevtWorkState;
70
71
  }): IRectType | undefined;
71
72
  clearTmpPoints(): void;
72
73
  static updateNodeOpt(param: {
@@ -1,5 +1,5 @@
1
1
  import { IWorkerMessage, IRectType, IUpdateNodeOpt } from "../types";
2
- import { EDataType, EPostMessageType, EScaleType, EToolsKey } from "../enum";
2
+ import { EDataType, EPostMessageType, EScaleType, EToolsKey, EvevtWorkState } from "../enum";
3
3
  import { Point2d } from "../utils/primitives/Point2d";
4
4
  import { BaseShapeOptions, BaseShapeTool, BaseShapeToolProps } from "./base";
5
5
  import { VNodeManager } from "../vNodeManager";
@@ -67,6 +67,7 @@ export declare class StraightShape extends BaseShapeTool {
67
67
  consumeService(props: {
68
68
  op: number[];
69
69
  isFullWork: boolean;
70
+ workState?: EvevtWorkState;
70
71
  }): IRectType | undefined;
71
72
  clearTmpPoints(): void;
72
73
  static updateNodeOpt(param: {
@@ -18,7 +18,7 @@ import { TextOptions } from "../../component/textEditor";
18
18
  import { ImageOptions, ImageShape } from "./image";
19
19
  import type { ServiceWorkForFullWorker } from "../worker/fullWorkerService";
20
20
  import type { SubServiceThread } from "../mainThread/subServiceThread";
21
- import { BaseShapeTool } from "./base";
21
+ import { BaseShapeOptions, BaseShapeTool } from "./base";
22
22
  import { PencilEraserOptions, PencilEraserShape } from "./pencilEraser";
23
23
  import { BitMapEraserOptions, BitMapEraserShape } from "./pencilEraserBitMap";
24
24
  export type ShapeTools = typeof PencilShape | typeof LaserPenShape | typeof PencilEraserShape | typeof BitMapEraserShape | typeof EraserShape | typeof StarShape | typeof SelectorShape | typeof ArrowShape | typeof EllipseShape | typeof RectangleShape | typeof StarShape | typeof PolygonShape | typeof TextShape | typeof SpeechBalloonShape | typeof ImageShape;
@@ -26,6 +26,7 @@ export type ShapeToolsClass = BaseShapeTool | PencilShape | LaserPenShape | Penc
26
26
  export type ShapeOptions = PencilOptions | LaserPenOptions | PencilEraserOptions | BitMapEraserOptions | EraserOptions | StarOptions | SelectorOptions | ArrowOptions | EllipseOptions | RectangleOptions | StarOptions | PolygonOptions | StraightOptions | TextOptions | SpeechBalloonOptions | ImageOptions;
27
27
  export type ShapeNodes = Group | Path | Polyline | Rect | Ellipse | Sprite | Label;
28
28
  export type ServiceThreadSubWork = SubServiceThread | ServiceWorkForFullWorker;
29
+ export type ShapeOptionsType<E extends BaseShapeOptions> = E;
29
30
  export interface CombineConsumeResult {
30
31
  type: EPostMessageType;
31
32
  rect: IRectType | undefined;
@@ -34,7 +35,7 @@ export interface CombineConsumeResult {
34
35
  export interface ShapeStateInfo {
35
36
  willClear: boolean;
36
37
  }
37
- export declare function getShapeTools(toolsType: EToolsKey): typeof PencilShape | typeof LaserPenShape | typeof EraserShape | typeof StarShape | typeof TextShape | typeof ArrowShape | typeof StraightShape | typeof EllipseShape | typeof PolygonShape | typeof RectangleShape | typeof SpeechBalloonShape | typeof BitMapEraserShape | typeof PencilEraserShape | typeof SelectorShape | typeof ImageShape | undefined;
38
+ export declare function getShapeTools(toolsType: EToolsKey): typeof ArrowShape | typeof PencilShape | typeof StraightShape | typeof EllipseShape | typeof PolygonShape | typeof StarShape | typeof RectangleShape | typeof SpeechBalloonShape | typeof TextShape | typeof LaserPenShape | typeof EraserShape | typeof PencilEraserShape | typeof BitMapEraserShape | typeof SelectorShape | typeof ImageShape | undefined;
38
39
  export declare function getShapeInstance(param: {
39
40
  workId: string;
40
41
  toolsType: EToolsKey;
@@ -42,5 +43,5 @@ export declare function getShapeInstance(param: {
42
43
  vNodes?: VNodeManager;
43
44
  fullLayer: Group;
44
45
  drawLayer?: Group;
45
- }, serviceWork?: ServiceThreadSubWork): SelectorShape | PencilShape | LaserPenShape | EraserShape | StarShape | TextShape | ImageShape | ArrowShape | StraightShape | EllipseShape | PolygonShape | RectangleShape | SpeechBalloonShape | BitMapEraserShape | PencilEraserShape | undefined;
46
+ }, serviceWork?: ServiceThreadSubWork): ArrowShape | PencilShape | StraightShape | EllipseShape | PolygonShape | StarShape | RectangleShape | SpeechBalloonShape | TextShape | LaserPenShape | EraserShape | PencilEraserShape | BitMapEraserShape | SelectorShape | ImageShape | undefined;
46
47
  export declare function findShapeBody(nodes: ShapeNodes[]): ShapeNodes[];
@@ -290,7 +290,6 @@ export type BaseNodeMapItem = {
290
290
  scaleType: EScaleType;
291
291
  /** 是否被框选中,框选中的元素不能被其它人操作 */
292
292
  isSelected: boolean;
293
- eraserlines?: Map<string, Pick<BaseNodeMapItem, 'op' | 'opt'>>;
294
293
  };
295
294
  export type Size = {
296
295
  /**
@@ -1,2 +1,8 @@
1
- import { Group, Node, Path } from "spritejs";
1
+ import type { Group, Node, Path, Layer } from "spritejs";
2
+ import { ShapeNodes } from "../tools/utils";
2
3
  export declare const isSealedGroup: (group: Group | Path | Node) => boolean;
4
+ export declare const removeTexture: (node: any, layer: Layer) => void;
5
+ export declare const removeAllChildren: (group: Group, layer: Layer) => void;
6
+ export declare const replaceNode: (newNode: ShapeNodes, deleteNode: any, layer: Group) => void;
7
+ export declare const hideOriginNodes: (group: Group, layer: Layer) => void;
8
+ export declare const showOriginNodes: (group: Group, layer: Layer) => void;
@@ -52,6 +52,8 @@ export declare abstract class WorkThreadEngineBase {
52
52
  timer?: number;
53
53
  resolve?: (src: string) => void;
54
54
  }>;
55
+ protected taskUpdateCameraId?: number;
56
+ protected debounceUpdateCameraId?: number;
55
57
  constructor(viewId: string, opt: IWorkerInitOption, workerType: EWorkThreadType);
56
58
  private createRenderLayer;
57
59
  updateDpr(dpr: number): Promise<void>;
@@ -108,7 +110,7 @@ export declare abstract class LocalWork {
108
110
  setWorkOptions(workId: string, opt: BaseShapeOptions): void;
109
111
  createWorkShapeNode(opt: IActiveToolsDataType & {
110
112
  workId: string;
111
- }): import("../tools").SelectorShape | import("../tools").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | import("../tools/text").TextShape | import("../tools").ImageShape | import("../tools").ArrowShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | undefined;
113
+ }): import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/text").TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools").SelectorShape | import("../tools").ImageShape | undefined;
112
114
  setToolsOpt(opt: IActiveToolsDataType): void;
113
115
  getToolsOpt(): IActiveToolsDataType | undefined;
114
116
  clearWorkShapeNodeCache(workId: string): void;
@@ -28,11 +28,11 @@ export declare class TopLayerWorkForSubWorker implements TopLayerWork {
28
28
  constructor(opt: ISubWorkerInitOption);
29
29
  canUseTopLayer(toolsType: EToolsKey): toolsType is EToolsKey.LaserPen;
30
30
  getWorkShape(workId: string): ILocalWorkItem | undefined;
31
- createWorkShape(workId: string, opt?: BaseShapeOptions): import("../tools").SelectorShape | import("../tools").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | import("../tools/text").TextShape | import("../tools").ImageShape | import("../tools").ArrowShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | undefined;
31
+ createWorkShape(workId: string, opt?: BaseShapeOptions): import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/text").TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools").SelectorShape | import("../tools").ImageShape | undefined;
32
32
  setWorkOptions(workId: string, opt: BaseShapeOptions): void;
33
33
  createWorkShapeNode(opt: IActiveToolsDataType & {
34
34
  workId: string;
35
- }): import("../tools").SelectorShape | import("../tools").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | import("../tools/text").TextShape | import("../tools").ImageShape | import("../tools").ArrowShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | undefined;
35
+ }): import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/text").TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools").SelectorShape | import("../tools").ImageShape | undefined;
36
36
  clearAllWorkShapesCache(): void;
37
37
  setToolsOpt(opt: IActiveToolsDataType): void;
38
38
  getToolsOpt(): IActiveToolsDataType | undefined;
@@ -31,8 +31,6 @@ export declare class WorkThreadEngineForFullWorker extends WorkThreadEngineBase
31
31
  localWork: LocalWorkForFullWorker;
32
32
  serviceWork: ServiceWorkForFullWorker;
33
33
  protected _post: (msg: IBatchMainMessage, transfer?: Transferable[] | undefined) => void;
34
- private taskUpdateCameraId?;
35
- private debounceUpdateCameraId?;
36
34
  private debounceUpdateCache;
37
35
  constructor(viewId: string, opt: IWorkerInitOption, _post: (msg: IBatchMainMessage, transfer?: Transferable[]) => void);
38
36
  combinePost(): Promise<void>;