@netless/appliance-plugin 1.1.0 → 1.1.1-7.beta.0

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 (73) hide show
  1. package/README.md +107 -9
  2. package/cdn/cdn.js +1 -1
  3. package/cdn/fullWorker-DXT06v.js +441 -0
  4. package/cdn/subWorker-caziyz.js +441 -0
  5. package/dist/appliance-plugin.js +1 -1
  6. package/dist/appliance-plugin.mjs +23 -19
  7. package/dist/collector/base.d.ts +3 -0
  8. package/dist/collector/collector.d.ts +40 -3
  9. package/dist/collector/enum.d.ts +0 -3
  10. package/dist/collector/eventCollector.d.ts +1 -0
  11. package/dist/collector/magixEventCollector.d.ts +1 -0
  12. package/dist/collector/types.d.ts +61 -15
  13. package/dist/component/autoDraw/index.d.ts +54 -0
  14. package/dist/component/miniMap/index.d.ts +1 -0
  15. package/dist/component/miniMap/manager.d.ts +37 -0
  16. package/dist/component/miniMap/view.d.ts +14 -0
  17. package/dist/core/enum.d.ts +56 -6
  18. package/dist/core/mainEngine.d.ts +36 -15
  19. package/dist/core/mainThread/base.d.ts +4 -0
  20. package/dist/core/mainThread/snapshotThread.d.ts +4 -1
  21. package/dist/core/mainThread/subLocalThread.d.ts +6 -6
  22. package/dist/core/mainThread/subServiceThread.d.ts +1 -1
  23. package/dist/core/mainThread/subTopThread.d.ts +2 -2
  24. package/dist/core/mainThread/workerMainThread.d.ts +3 -2
  25. package/dist/core/plugin.d.ts +49 -0
  26. package/dist/core/renderCotrol.d.ts +108 -0
  27. package/dist/core/tools/arrow.d.ts +3 -2
  28. package/dist/core/tools/base.d.ts +39 -5
  29. package/dist/core/tools/ellipse.d.ts +3 -2
  30. package/dist/core/tools/eraser.d.ts +1 -1
  31. package/dist/core/tools/image.d.ts +9 -7
  32. package/dist/core/tools/pencil.d.ts +4 -3
  33. package/dist/core/tools/pencilEraser.d.ts +1 -1
  34. package/dist/core/tools/pencilEraserBitMap.d.ts +21 -6
  35. package/dist/core/tools/polygon.d.ts +3 -2
  36. package/dist/core/tools/rectangle.d.ts +3 -2
  37. package/dist/core/tools/selector.d.ts +2 -2
  38. package/dist/core/tools/speechBalloon.d.ts +3 -2
  39. package/dist/core/tools/star.d.ts +3 -2
  40. package/dist/core/tools/straight.d.ts +3 -2
  41. package/dist/core/tools/utils.d.ts +4 -3
  42. package/dist/core/types.d.ts +16 -11
  43. package/dist/core/utils/math.d.ts +1 -0
  44. package/dist/core/utils/spriteNode.d.ts +9 -3
  45. package/dist/core/vNodeManager.d.ts +14 -3
  46. package/dist/core/worker/base.d.ts +19 -9
  47. package/dist/core/worker/fullWorkerLocal.d.ts +9 -4
  48. package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
  49. package/dist/core/worker/workerManager.d.ts +2 -2
  50. package/dist/displayer/floatBar/index.d.ts +1 -0
  51. package/dist/extend.d.ts +2 -0
  52. package/dist/fullWorker.js +158 -156
  53. package/dist/{index-C4KNxHht.mjs → index-16eeAu4_.mjs} +874 -862
  54. package/dist/index-BgMemNid.mjs +16918 -0
  55. package/dist/index-Bpx1RNLY.js +1 -0
  56. package/dist/index-D0mDu2PZ.js +1 -0
  57. package/dist/index.d.ts +1 -0
  58. package/dist/members/index.d.ts +1 -0
  59. package/dist/plugin/baseApplianceManager.d.ts +29 -2
  60. package/dist/plugin/baseViewContainerManager.d.ts +3 -2
  61. package/dist/plugin/const.d.ts +6 -4
  62. package/dist/plugin/displayerView.d.ts +2 -0
  63. package/dist/plugin/multi/applianceMultiManager.d.ts +0 -1
  64. package/dist/plugin/types.d.ts +116 -7
  65. package/dist/style.css +1 -1
  66. package/dist/subWorker.js +158 -156
  67. package/dist/undo/index.d.ts +2 -2
  68. package/package.json +6 -7
  69. package/cdn/fullWorker-CjGKnN.js +0 -439
  70. package/cdn/subWorker-DUJqv_.js +0 -439
  71. package/dist/index-C29o_HLi.js +0 -1
  72. package/dist/index-CIJP6_Qj.mjs +0 -14190
  73. package/dist/index-DmfRoAiB.js +0 -1
@@ -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";
@@ -14,7 +14,7 @@ export interface SpeechBalloonOptions extends BaseShapeOptions {
14
14
  }
15
15
  export declare class SpeechBalloonShape extends BaseShapeTool {
16
16
  readonly canRotate: boolean;
17
- readonly scaleType: EScaleType;
17
+ scaleType: EScaleType;
18
18
  readonly toolsType: EToolsKey;
19
19
  readonly ratio: number;
20
20
  protected tmpPoints: Array<Point2d>;
@@ -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";
@@ -16,7 +16,7 @@ export interface StarOptions extends BaseShapeOptions {
16
16
  }
17
17
  export declare class StarShape extends BaseShapeTool {
18
18
  readonly canRotate: boolean;
19
- readonly scaleType: EScaleType;
19
+ scaleType: EScaleType;
20
20
  readonly toolsType: EToolsKey;
21
21
  protected tmpPoints: Array<Point2d>;
22
22
  protected workOptions: StarOptions;
@@ -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";
@@ -12,7 +12,7 @@ export interface StraightOptions extends BaseShapeOptions {
12
12
  }
13
13
  export declare class StraightShape extends BaseShapeTool {
14
14
  readonly canRotate: boolean;
15
- readonly scaleType: EScaleType;
15
+ scaleType: EScaleType;
16
16
  readonly toolsType: EToolsKey;
17
17
  protected tmpPoints: Array<Point2d>;
18
18
  protected workOptions: StraightOptions;
@@ -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): PencilShape | LaserPenShape | EraserShape | StarShape | TextShape | SelectorShape | 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[];
@@ -1,11 +1,14 @@
1
- import { BaseCollectorReducerAction, INormalPushMsg, ISerializableStorageData } from '../collector/types';
2
- import { ETextEditorType, FontStyleType, FontWeightType, TextOptions } from '../component/textEditor/types';
3
- import { EmitEventType } from '../plugin/types';
4
- import { ECanvasContextType, ECanvasShowType, EDataType, EPostMessageType, EScaleType, EToolsKey, ElayerType, EvevtWorkState } from './enum';
5
- import { BaseShapeOptions, BaseShapeTool, ShapeOptions } from './tools';
1
+ import type { BaseCollectorReducerAction, INormalPushMsg, ISerializableStorageData } from '../collector/types';
2
+ import type { ETextEditorType, FontStyleType, FontWeightType, TextOptions } from '../component/textEditor/types';
3
+ import type { EmitEventType } from '../plugin/types';
4
+ import type { ECanvasContextType, ECanvasShowType, EDataType, EPostMessageType, EScaleType, EToolsKey, ElayerType, EvevtWorkState } from './enum';
5
+ import type { BaseShapeOptions, BaseShapeTool, ShapeOptions } from './tools';
6
6
  import type { SelectorShape } from './tools';
7
7
  import type { Direction } from "re-resizable/lib/resizer";
8
- import { ShapeOptType } from '../displayer/types';
8
+ import type { ShapeOptType } from '../displayer/types';
9
+ export type PickOne<T> = {
10
+ [P in keyof T]: Record<P, T[P]> & Partial<Record<Exclude<keyof T, P>, undefined>>;
11
+ }[keyof T];
9
12
  export type IworkId = string | number;
10
13
  export type IqueryTask = Partial<IWorkerMessage> | undefined;
11
14
  export type ViewWorkerOptions = {
@@ -44,6 +47,8 @@ export interface ILayerOptionType {
44
47
  width: number;
45
48
  height: number;
46
49
  bufferSize?: number;
50
+ contextType?: ECanvasContextType;
51
+ [key: string]: any;
47
52
  }
48
53
  export interface IUpdateNodeOpt {
49
54
  scale?: [number, number];
@@ -104,7 +109,6 @@ export type IWorkerMessage = Omit<Partial<BaseCollectorReducerAction>, 'op'> & {
104
109
  currentToolsData?: IActiveToolsDataType;
105
110
  updateNodeOpt?: IUpdateNodeOpt;
106
111
  layerOpt?: ILayerOptionType;
107
- drawCount?: number;
108
112
  useAnimation?: boolean;
109
113
  willRefreshSelector?: boolean;
110
114
  willSyncService?: boolean;
@@ -123,6 +127,8 @@ export type IWorkerMessage = Omit<Partial<BaseCollectorReducerAction>, 'op'> & {
123
127
  textUpdateForWoker?: boolean;
124
128
  tasksqueue?: Map<string, IWorkerMessage>;
125
129
  point?: [number, number];
130
+ disableEraseImage?: boolean;
131
+ disableEraseText?: boolean;
126
132
  [key: string]: any;
127
133
  };
128
134
  export interface IRectType {
@@ -142,7 +148,6 @@ export interface IMainMessage extends INormalPushMsg {
142
148
  removeIds?: Array<string>;
143
149
  /** 是否是完整的一次任务 */
144
150
  isFullWork?: boolean;
145
- drawCount?: number;
146
151
  selectIds?: Array<string>;
147
152
  padding?: number;
148
153
  selectRect?: IRectType;
@@ -202,10 +207,12 @@ export interface IBatchMainMessage {
202
207
  render?: Array<IMainMessageRenderData>;
203
208
  /** 同步服务端数据 */
204
209
  sp?: Array<IMainMessage>;
205
- drawCount?: number;
206
210
  workerTasksqueueCount?: number;
207
211
  workIds?: Set<string>;
208
212
  viewId?: string;
213
+ consumeCount?: number;
214
+ subWorkerDrawCount?: number;
215
+ fullWorkerDrawCount?: number;
209
216
  }
210
217
  export interface ICameraOpt {
211
218
  centerX: number;
@@ -283,8 +290,6 @@ export type BaseNodeMapItem = {
283
290
  scaleType: EScaleType;
284
291
  /** 是否被框选中,框选中的元素不能被其它人操作 */
285
292
  isSelected: boolean;
286
- isHid?: boolean;
287
- eraserlines?: Map<string, Pick<BaseNodeMapItem, 'op' | 'opt'>>;
288
293
  };
289
294
  export type Size = {
290
295
  /**
@@ -3,6 +3,7 @@ import { IRectType } from "../types";
3
3
  import { Point2d } from "./primitives/Point2d";
4
4
  import { Vec2d } from "./primitives/Vec2d";
5
5
  import type { Rectangle } from "../types";
6
+ export declare function getDprIntNumber(num: number, dpr: number): number;
6
7
  export declare function outerRect(rect: IRectType, offset: number): {
7
8
  x: number;
8
9
  y: number;
@@ -1,4 +1,10 @@
1
- import { Group, Node, Path } from "spritejs";
2
- import { BaseNodeMapItem } from "../types";
1
+ import type { Group, Node, Path, Layer, Scene } from "spritejs";
2
+ import { ShapeNodes } from "../tools/utils";
3
+ import { IRectType } from "..";
3
4
  export declare const isSealedGroup: (group: Group | Path | Node) => boolean;
4
- export declare const isRenderNode: (param: Pick<BaseNodeMapItem, "isHid">) => boolean;
5
+ export declare const removeTexture: (node: any, layer: Layer) => void;
6
+ export declare const removeAllChildren: (group: Group, layer: Layer) => void;
7
+ export declare const replaceNode: (newNode: ShapeNodes, deleteNode: any, layer: Group) => void;
8
+ export declare const hideOriginNodes: (group: Group, layer: Layer) => void;
9
+ export declare const showOriginNodes: (group: Group, layer: Layer) => void;
10
+ export declare const safariFixRect: (rect: IRectType, scene: Scene, dpr: number) => IRectType | undefined;
@@ -1,6 +1,7 @@
1
1
  import { Group, Scene } from "spritejs";
2
2
  import { BaseNodeMapItem, IRectType } from "./types";
3
3
  import { EToolsKey } from ".";
4
+ import { _SetTrue } from "../plugin";
4
5
  export declare class VNodeManager {
5
6
  viewId: string;
6
7
  scene: Scene;
@@ -8,11 +9,21 @@ export declare class VNodeManager {
8
9
  curNodeMap: Map<string, BaseNodeMapItem>;
9
10
  targetNodeMap: Map<string, BaseNodeMapItem>[];
10
11
  private highLevelIds?;
12
+ private canClearUids?;
13
+ private localUid?;
11
14
  constructor(viewId: string, scene: Scene);
12
15
  init(fullLayer: Group): void;
13
16
  get(name: string): BaseNodeMapItem | undefined;
14
- getUnLockNodes(): Map<string, BaseNodeMapItem>;
17
+ setLocalUid(uid: string): void;
18
+ getLocalUid(): string | undefined;
19
+ setCanClearUids(clearUids?: _SetTrue): void;
20
+ getCanClearUids(): _SetTrue | undefined;
21
+ getCanEraserNodes(nodeMap: Map<string, BaseNodeMapItem>, disableErase: {
22
+ disableEraseImage?: boolean;
23
+ disableEraseText?: boolean;
24
+ }): Map<string, BaseNodeMapItem>;
15
25
  getNodesByType(type: EToolsKey): Map<string, BaseNodeMapItem>;
26
+ gethasEraserNodes(): Map<string, BaseNodeMapItem>;
16
27
  hasRenderNodes(): boolean;
17
28
  has(name: string): boolean;
18
29
  setInfo(name: string, info: Partial<BaseNodeMapItem>): void;
@@ -20,7 +31,6 @@ export declare class VNodeManager {
20
31
  unSelected(name: string): void;
21
32
  delete(name: string): void;
22
33
  clear(): void;
23
- hasRectIntersectRange(rect: IRectType, filterLock?: boolean): boolean;
24
34
  getRectIntersectRange(rect: IRectType, filterLock?: boolean, filterEditor?: boolean): {
25
35
  rectRange: IRectType | undefined;
26
36
  nodeRange: Map<string, BaseNodeMapItem>;
@@ -30,7 +40,6 @@ export declare class VNodeManager {
30
40
  updateHighLevelNodesRect(highLevelIds: Set<string>): void;
31
41
  updateLowLevelNodesRect(): void;
32
42
  clearHighLevelIds(): void;
33
- combineIntersectRect(rect: IRectType): IRectType;
34
43
  setTargetAssignKeys(keys: Array<string>): number;
35
44
  setTarget(): number;
36
45
  getLastTarget(): Map<string, BaseNodeMapItem>;
@@ -38,4 +47,6 @@ export declare class VNodeManager {
38
47
  getTarget(i: number): Map<string, BaseNodeMapItem>;
39
48
  deleteTarget(i: number): void;
40
49
  clearTarget(): void;
50
+ isLocalWorkId(workId: string): boolean;
51
+ isCanClearWorkId(workId: string): boolean | "" | undefined;
41
52
  }
@@ -1,7 +1,7 @@
1
1
  import { Group, Scene } from "spritejs";
2
2
  import { IActiveToolsDataType, IActiveWorkDataType, IBatchMainMessage, ICameraOpt, ILayerOptionType, IOffscreenCanvasOptionType, IRectType, IWorkerMessage } from "../types";
3
3
  import { VNodeManager } from "../vNodeManager";
4
- import { ECanvasContextType, ECanvasShowType, EDataType, EvevtWorkState } from "../enum";
4
+ import { type ECanvasContextType, ECanvasShowType, EDataType, EvevtWorkState } from "../enum";
5
5
  import { BaseShapeOptions, BaseShapeTool } from "../tools/base";
6
6
  import { ServiceWorkForFullWorker } from "./fullWorkerService";
7
7
  import { LocalWorkForFullWorker } from "./fullWorkerLocal";
@@ -23,14 +23,14 @@ export interface ISubWorkerInitOption {
23
23
  }
24
24
  export declare abstract class WorkThreadEngineBase {
25
25
  readonly viewId: string;
26
- readonly fullLayer: Group;
26
+ scene: Scene;
27
+ fullLayer: Group;
27
28
  readonly vNodes: VNodeManager;
28
- readonly dpr: number;
29
+ dpr: number;
29
30
  readonly contextType?: ECanvasContextType;
30
31
  abstract readonly type: EWorkThreadType;
31
32
  protected opt: IWorkerInitOption;
32
33
  protected cameraOpt?: ICameraOpt;
33
- protected scene: Scene;
34
34
  abstract localWork: LocalWorkForFullWorker | LocalWorkForSubWorker;
35
35
  abstract serviceWork?: ServiceWorkForFullWorker;
36
36
  protected isSafari: boolean;
@@ -44,20 +44,30 @@ export declare abstract class WorkThreadEngineBase {
44
44
  };
45
45
  protected hasPriorityDraw: boolean;
46
46
  protected delayPostDoneResolve?: (bol: boolean) => void;
47
- protected cacheImages: Map<string, ImageBitmap>;
47
+ protected cacheImages: Map<string, {
48
+ imageBitmap: ImageBitmap;
49
+ workId: string;
50
+ }>;
48
51
  protected imageResolveMap: Map<string, {
49
52
  timer?: number;
50
- resolve?: (workId: string) => void;
53
+ resolve?: (src: string) => void;
51
54
  }>;
55
+ protected taskUpdateCameraId?: number;
56
+ protected debounceUpdateCameraId?: number;
52
57
  constructor(viewId: string, opt: IWorkerInitOption, workerType: EWorkThreadType);
58
+ private createRenderLayer;
59
+ updateDpr(dpr: number): Promise<void>;
53
60
  getCachedImages(imageSrc: string): ImageBitmap | undefined;
61
+ getCachedImagesByWorkId(workId: string): ImageBitmap | undefined;
62
+ deleteCachedImagesByWorkId(workId: string, filter?: string): void;
54
63
  clearCacheImages(): void;
55
64
  clearImageResolveMap(): void;
56
65
  setHasPriorityDraw(bol: boolean): void;
57
66
  getPriorityDraw(): boolean;
58
67
  setIsSafari(isSafari: boolean): void;
59
68
  on(msg: IWorkerMessage): Promise<void>;
60
- loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId'>): Promise<ImageBitmap | undefined>;
69
+ private getIconSize;
70
+ loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId' | 'isSubWorker'>): Promise<ImageBitmap | undefined>;
61
71
  protected createLocalWork(data: IWorkerMessage): void;
62
72
  protected updateScene(offscreenCanvasOpt: IOffscreenCanvasOptionType): void;
63
73
  protected updateLayer(layerOpt: ILayerOptionType): void;
@@ -71,7 +81,6 @@ export declare abstract class WorkThreadEngineBase {
71
81
  post(msg: IBatchMainMessage): Promise<void>;
72
82
  private runBatchPostData;
73
83
  protected combinePostData(): IBatchMainMessage;
74
- protected safariFixRect(rect: IRectType, dpr: number): IRectType | undefined;
75
84
  getSceneRect(): IRectType;
76
85
  abstract combinePost(): Promise<void>;
77
86
  protected abstract getLayer(workLayer: ECanvasShowType): Group | undefined;
@@ -90,6 +99,7 @@ export declare abstract class LocalWork {
90
99
  protected tmpOpt?: IActiveToolsDataType;
91
100
  workShapes: Map<string, BaseShapeTool>;
92
101
  protected drawCount: number;
102
+ protected consumeCount: number;
93
103
  protected syncUnitTime: number;
94
104
  constructor(opt: ISubWorkerInitOption);
95
105
  destroy(): void;
@@ -99,7 +109,7 @@ export declare abstract class LocalWork {
99
109
  setWorkOptions(workId: string, opt: BaseShapeOptions): void;
100
110
  createWorkShapeNode(opt: IActiveToolsDataType & {
101
111
  workId: string;
102
- }): import("../tools").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | import("../tools/text").TextShape | import("../tools").SelectorShape | import("../tools/image").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;
112
+ }): 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;
103
113
  setToolsOpt(opt: IActiveToolsDataType): void;
104
114
  getToolsOpt(): IActiveToolsDataType | undefined;
105
115
  clearWorkShapeNodeCache(workId: string): void;
@@ -1,7 +1,8 @@
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";
5
+ import { WorkThreadEngineForFullWorker } from "./workerManager";
5
6
  export declare class LocalWorkForFullWorker extends LocalWork {
6
7
  private combineUnitTime;
7
8
  private combineTimerId?;
@@ -12,15 +13,18 @@ export declare class LocalWorkForFullWorker extends LocalWork {
12
13
  private batchEraserWorks;
13
14
  private batchEraserRemoveNodes;
14
15
  constructor(opt: ISubWorkerInitOption);
15
- loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId'>): Promise<ImageBitmap | undefined>;
16
+ loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId' | 'isSubWorker'>): Promise<ImageBitmap | undefined>;
16
17
  consumeDraw(data: IWorkerMessage, serviceWork: ServiceWorkForFullWorker): Promise<void>;
17
18
  consumeDrawAll(data: IWorkerMessage, serviceWork: ServiceWorkForFullWorker): Promise<void>;
18
19
  workShapesDone(scenePath: string, serviceWork: ServiceWorkForFullWorker): Promise<void>;
19
20
  consumeFull(data: IWorkerMessage): Promise<void>;
20
21
  private commandDeleteText;
21
- removeSelector(data: IWorkerMessage): Promise<void>;
22
+ removeSelector(data: IWorkerMessage, workEngine?: WorkThreadEngineForFullWorker): Promise<void>;
22
23
  removeWork(data: IWorkerMessage): Promise<void>;
23
- private removeNode;
24
+ removeNode(key: string): {
25
+ fullRect: IRectType | undefined;
26
+ drawRect: IRectType | undefined;
27
+ };
24
28
  private _removeWork;
25
29
  checkTextActive(data: IWorkerMessage): Promise<void>;
26
30
  colloctEffectSelectWork(data: IWorkerMessage): Promise<IWorkerMessage | undefined>;
@@ -45,6 +49,7 @@ export declare class LocalWorkForFullWorker extends LocalWork {
45
49
  destroy(): void;
46
50
  private drawBitMapEraser;
47
51
  private drawBitMapEraserFull;
52
+ private drawBitMapCombine;
48
53
  private drawPencilCombine;
49
54
  private drawSelector;
50
55
  private drawPencilEraser;
@@ -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").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | import("../tools/text").TextShape | import("../tools").SelectorShape | 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").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | import("../tools/text").TextShape | import("../tools").SelectorShape | 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>;
@@ -47,6 +45,7 @@ export declare class WorkThreadEngineForFullWorker extends WorkThreadEngineBase
47
45
  consumeFull(type: EDataType, data: IWorkerMessage): Promise<void>;
48
46
  consumeDraw(type: EDataType, data: IWorkerMessage): Promise<void>;
49
47
  consumeDrawAll(type: EDataType, data: IWorkerMessage): Promise<void>;
48
+ updateDpr(dpr: number): Promise<void>;
50
49
  updateCamera(msg: IWorkerMessage): Promise<void>;
51
50
  private getRectImageBitmap;
52
51
  private cursorHover;
@@ -74,6 +73,7 @@ export declare class WorkThreadEngineForSubWorker extends WorkThreadEngineBase {
74
73
  clearAll(): Promise<void>;
75
74
  private getRectImageBitmap;
76
75
  protected updateLayer(layerOpt: ILayerOptionType): void;
76
+ updateDpr(dpr: number): Promise<void>;
77
77
  updateCamera(msg: IWorkerMessage): Promise<void>;
78
78
  setCameraOpt(cameraOpt: ICameraOpt, layer?: Group): void;
79
79
  private getSnapshot;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { TextEditorInfo } from "../../component/textEditor";
3
3
  export declare const FloatBar: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
4
+ isHide: boolean;
4
5
  editors?: Map<string, TextEditorInfo>;
5
6
  activeTextId?: string;
6
7
  } & React.RefAttributes<HTMLDivElement>>>;
@@ -0,0 +1,2 @@
1
+ export { Plugin } from "./core/plugin";
2
+ export { AutoDrawPlugin } from "./component/autoDraw";