@netless/appliance-plugin 1.1.18-beta.2 → 1.1.19-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.
Files changed (60) hide show
  1. package/README.md +318 -260
  2. package/cdn/cdn.js +1 -1
  3. package/cdn/fullWorker-3k30fq.js +439 -0
  4. package/cdn/subWorker-rWfN0e.js +439 -0
  5. package/dist/appliance-plugin.js +1 -1
  6. package/dist/appliance-plugin.mjs +7 -7
  7. package/dist/cdn.d.ts +2 -2
  8. package/dist/collector/index.d.ts +4 -4
  9. package/dist/collector/types.d.ts +2 -2
  10. package/dist/component/miniMap/index.d.ts +1 -1
  11. package/dist/component/miniMap/manager.d.ts +2 -2
  12. package/dist/component/miniMap/view.d.ts +1 -1
  13. package/dist/component/textEditor/index.d.ts +2 -2
  14. package/dist/component/textEditor/types.d.ts +2 -2
  15. package/dist/component/textEditor/view.d.ts +1 -1
  16. package/dist/core/index.d.ts +3 -3
  17. package/dist/core/mainEngine.d.ts +7 -3
  18. package/dist/core/mainThread/base.d.ts +4 -4
  19. package/dist/core/mainThread/index.d.ts +2 -2
  20. package/dist/core/mainThread/snapshotThread.d.ts +3 -3
  21. package/dist/core/mainThread/subLocalThread.d.ts +11 -6
  22. package/dist/core/mainThread/subServiceThread.d.ts +1 -1
  23. package/dist/core/mainThread/workerMainThread.d.ts +2 -2
  24. package/dist/core/msgEvent/copyNode/forMain.d.ts +2 -2
  25. package/dist/core/msgEvent/forMainThread.d.ts +4 -4
  26. package/dist/core/msgEvent/forWorker.d.ts +4 -4
  27. package/dist/core/msgEvent/index.d.ts +4 -4
  28. package/dist/core/tools/base.d.ts +3 -3
  29. package/dist/core/tools/index.d.ts +14 -14
  30. package/dist/core/tools/laserPen.d.ts +1 -1
  31. package/dist/core/tools/pencilEraser.d.ts +4 -34
  32. package/dist/core/tools/pencilEraserBitMap.d.ts +7 -30
  33. package/dist/core/tools/selector.d.ts +1 -1
  34. package/dist/core/types.d.ts +11 -9
  35. package/dist/core/utils/clipper.d.ts +1 -1
  36. package/dist/core/utils/getSvgPathFromPoints.d.ts +1 -1
  37. package/dist/core/utils/index.d.ts +4 -4
  38. package/dist/core/utils/primitives/Box2d.d.ts +4 -4
  39. package/dist/core/utils/proxy.d.ts +3 -4
  40. package/dist/core/worker/base.d.ts +5 -2
  41. package/dist/core/worker/fullWorkerLocal.d.ts +5 -11
  42. package/dist/cursors/index.d.ts +1 -1
  43. package/dist/fullWorker.js +142 -203
  44. package/dist/index-B4Ld7AM5.js +1 -0
  45. package/dist/index-BS5_t4VL.mjs +21267 -0
  46. package/dist/index-CG1H4AUQ.js +1 -0
  47. package/dist/{index-BL-uNbea.mjs → index-yLOzxVyY.mjs} +901 -658
  48. package/dist/plugin/baseViewContainerManager.d.ts +3 -3
  49. package/dist/plugin/const.d.ts +1 -0
  50. package/dist/plugin/multi/containerManager.d.ts +1 -1
  51. package/dist/plugin/types.d.ts +20 -11
  52. package/dist/style.css +1 -1
  53. package/dist/subWorker.js +142 -203
  54. package/dist/undo/index.d.ts +1 -1
  55. package/package.json +7 -1
  56. package/cdn/fullWorker-XdWoUM.js +0 -500
  57. package/cdn/subWorker-wI5N8T.js +0 -500
  58. package/dist/index-CKpm84e8.js +0 -1
  59. package/dist/index-DThrnC5D.mjs +0 -17608
  60. package/dist/index-D_HrD9jF.js +0 -1
@@ -1,11 +1,11 @@
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
- import type { SelectorShape } 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
+ import type { SelectorShape } from "./tools";
7
7
  import type { Direction } from "re-resizable/lib/resizer";
8
- import type { ShapeOptType } from '../displayer/types';
8
+ import type { ShapeOptType } from "../displayer/types";
9
9
  export type PickOne<T> = {
10
10
  [P in keyof T]: Record<P, T[P]> & Partial<Record<Exclude<keyof T, P>, undefined>>;
11
11
  }[keyof T];
@@ -88,7 +88,7 @@ export interface IUpdateNodeOpt {
88
88
  willRefresh?: boolean;
89
89
  [key: string]: any;
90
90
  }
91
- export type IWorkerMessage = Omit<Partial<BaseCollectorReducerAction>, 'op'> & {
91
+ export type IWorkerMessage = Omit<Partial<BaseCollectorReducerAction>, "op"> & {
92
92
  viewId: string;
93
93
  msgType: EPostMessageType;
94
94
  dataType: EDataType;
@@ -129,6 +129,7 @@ export type IWorkerMessage = Omit<Partial<BaseCollectorReducerAction>, 'op'> & {
129
129
  point?: [number, number];
130
130
  disableEraseImage?: boolean;
131
131
  disableEraseText?: boolean;
132
+ maxCombineEraserTime?: number;
132
133
  [key: string]: any;
133
134
  };
134
135
  export interface IRectType {
@@ -233,7 +234,7 @@ export interface IUpdateSelectorPropsType {
233
234
  export interface IUpdateSelectorCallbackPropsType {
234
235
  res?: IMainMessage;
235
236
  param: IUpdateSelectorPropsType;
236
- postData: Pick<IBatchMainMessage, 'sp' | 'render'>;
237
+ postData: Pick<IBatchMainMessage, "sp" | "render">;
237
238
  workShapeNode: SelectorShape;
238
239
  newServiceStore: Map<string, {
239
240
  opt: BaseShapeOptions;
@@ -245,6 +246,7 @@ export interface IActiveToolsDataType {
245
246
  toolsType: EToolsKey;
246
247
  toolsOpt: ShapeOptions;
247
248
  combineUnitTime?: number;
249
+ maxCombineEraserTime?: number;
248
250
  }
249
251
  export interface IActiveWorkDataType {
250
252
  workState: EvevtWorkState;
@@ -1,4 +1,4 @@
1
- import { Point2d } from './primitives/Point2d';
1
+ import { Point2d } from "./primitives/Point2d";
2
2
  /**
3
3
  * 折线减去多个多边形,返回差集片段(去除冗余点、近似闭环、孤点)
4
4
  * @param polyline 原始折线
@@ -1,4 +1,4 @@
1
- import { PointLike } from './primitives/Point2d';
1
+ import { PointLike } from "./primitives/Point2d";
2
2
  /**
3
3
  * Turn an array of points into a path of quadradic curves.
4
4
  *
@@ -1,7 +1,7 @@
1
- import { EMatrixrRelationType } from '../enum';
2
- import { IRectType } from '../types';
3
- import { Box2d } from './primitives/Box2d';
4
- import { Vec2d, VecLike } from './primitives/Vec2d';
1
+ import { EMatrixrRelationType } from "../enum";
2
+ import { IRectType } from "../types";
3
+ import { Box2d } from "./primitives/Box2d";
4
+ import { Vec2d, VecLike } from "./primitives/Vec2d";
5
5
  export * from "./math";
6
6
  export * from "./spriteNode";
7
7
  /** @public */
@@ -1,4 +1,4 @@
1
- import { Vec2d, VecLike } from './Vec2d';
1
+ import { Vec2d, VecLike } from "./Vec2d";
2
2
  /**
3
3
  * A serializable model for 2D boxes.
4
4
  *
@@ -10,13 +10,13 @@ export interface Box2dModel {
10
10
  h: number;
11
11
  }
12
12
  /** @public */
13
- export type SelectionEdge = 'top' | 'right' | 'bottom' | 'left';
13
+ export type SelectionEdge = "top" | "right" | "bottom" | "left";
14
14
  /** @public */
15
- export type SelectionCorner = 'top_left' | 'top_right' | 'bottom_right' | 'bottom_left';
15
+ export type SelectionCorner = "top_left" | "top_right" | "bottom_right" | "bottom_left";
16
16
  /** @public */
17
17
  export type SelectionHandle = SelectionEdge | SelectionCorner;
18
18
  /** @public */
19
- export type RotateCorner = 'top_left_rotate' | 'top_right_rotate' | 'bottom_right_rotate' | 'bottom_left_rotate' | 'mobile_rotate';
19
+ export type RotateCorner = "top_left_rotate" | "top_right_rotate" | "bottom_right_rotate" | "bottom_left_rotate" | "mobile_rotate";
20
20
  /** @public */
21
21
  export declare class Box2d {
22
22
  constructor(x?: number, y?: number, w?: number, h?: number);
@@ -1,4 +1,3 @@
1
- import { EDataType } from "../enum";
2
1
  export type InterceptorsType<T, K> = {
3
2
  get(key: T): K;
4
3
  set(key: T, value: K): void;
@@ -12,9 +11,9 @@ export declare class ProxyMap<T, K> {
12
11
  entries(...arg: any[]): any;
13
12
  forEach(...arg: any[]): any;
14
13
  size(): any;
15
- get(key: unknown): any;
16
- set(key: unknown, value: unknown): any;
17
- delete(key: unknown, _dataType?: EDataType): any;
14
+ get(key: any): any;
15
+ set(key: any, value: any): any;
16
+ delete(key: any): any;
18
17
  clear(): any;
19
18
  };
20
19
  createProxy(map: Map<T, K>): Map<T, K>;
@@ -14,6 +14,7 @@ export interface IWorkerInitOption {
14
14
  layerOpt: ILayerOptionType;
15
15
  combineUnitTime?: number;
16
16
  syncUnitTime?: number;
17
+ maxCombineEraserTime?: number;
17
18
  }
18
19
  export interface ISubWorkerInitOption {
19
20
  thread: WorkThreadEngineForFullWorker | WorkThreadEngineForSubWorker;
@@ -69,7 +70,7 @@ export declare abstract class WorkThreadEngineBase {
69
70
  setIsSafari(isSafari: boolean): void;
70
71
  on(msg: IWorkerMessage): Promise<void>;
71
72
  private getIconSize;
72
- loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId' | 'isSubWorker'>): Promise<ImageBitmap | undefined>;
73
+ loadImageBitMap(msg: Pick<IWorkerMessage, "toolsType" | "opt" | "workId" | "isSubWorker">): Promise<ImageBitmap | undefined>;
73
74
  protected createLocalWork(data: IWorkerMessage): void;
74
75
  protected updateScene(offscreenCanvasOpt: IOffscreenCanvasOptionType): void;
75
76
  protected updateLayer(layerOpt: ILayerOptionType): void;
@@ -104,6 +105,8 @@ export declare abstract class LocalWork {
104
105
  protected consumeCount: number;
105
106
  protected syncUnitTime: number;
106
107
  protected combineUnitTime: number;
108
+ protected maxCombineEraserTime: number;
109
+ setmaxCombineEraserTime(maxCombineEraserTime: number): void;
107
110
  setCombineUnitTime(combineUnitTime: number): void;
108
111
  setSyncUnitTime(syncUnitTime: number): void;
109
112
  constructor(opt: ISubWorkerInitOption);
@@ -119,5 +122,5 @@ export declare abstract class LocalWork {
119
122
  getToolsOpt(): IActiveToolsDataType | undefined;
120
123
  clearWorkShapeNodeCache(workId: string): void;
121
124
  clearAllWorkShapesCache(): void;
122
- setFullWork(data: Pick<IWorkerMessage, 'workId' | 'opt' | 'toolsType'>): BaseShapeTool | undefined;
125
+ setFullWork(data: Pick<IWorkerMessage, "workId" | "opt" | "toolsType">): BaseShapeTool | undefined;
123
126
  }
@@ -9,10 +9,8 @@ export declare class LocalWorkForFullWorker extends LocalWork {
9
9
  private combineDrawActiveId?;
10
10
  protected drawWorkActiveId?: string;
11
11
  private effectSelectNodeData;
12
- private batchEraserWorks;
13
- private batchEraserRemoveNodes;
14
12
  constructor(opt: ISubWorkerInitOption);
15
- loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId' | 'isSubWorker'>): Promise<ImageBitmap | undefined>;
13
+ loadImageBitMap(msg: Pick<IWorkerMessage, "toolsType" | "opt" | "workId" | "isSubWorker">): Promise<ImageBitmap | undefined>;
16
14
  consumeDraw(data: IWorkerMessage, serviceWork: ServiceWorkForFullWorker): Promise<void>;
17
15
  consumeDrawAll(data: IWorkerMessage, serviceWork: ServiceWorkForFullWorker): Promise<void>;
18
16
  workShapesDone(scenePath: string, serviceWork: ServiceWorkForFullWorker): Promise<void>;
@@ -31,7 +29,7 @@ export declare class LocalWorkForFullWorker extends LocalWork {
31
29
  callback?: (props: {
32
30
  res?: IMainMessage;
33
31
  param: IUpdateSelectorPropsType;
34
- postData: Pick<IBatchMainMessage, 'sp' | 'render'>;
32
+ postData: Pick<IBatchMainMessage, "sp" | "render">;
35
33
  workShapeNode: SelectorShape;
36
34
  newServiceStore: Map<string, {
37
35
  opt: BaseShapeOptions;
@@ -46,18 +44,14 @@ export declare class LocalWorkForFullWorker extends LocalWork {
46
44
  reRenderSelector(willSyncService?: boolean): Promise<void>;
47
45
  updateFullSelectWork(data: IWorkerMessage): Promise<void>;
48
46
  destroy(): void;
49
- private drawBitMapEraser;
50
- private drawBitMapEraserFull;
51
- private drawBitMapCombine;
47
+ private drawEraserCombine;
52
48
  private drawPencilCombine;
53
49
  private drawSelector;
54
- private drawPencilEraserCombine;
55
- private drawPencilEraser;
56
- private drawPencilEraserFull;
50
+ private drawPencilFull;
51
+ private drawEraserFull;
57
52
  private drawEraser;
58
53
  private drawShape;
59
54
  private drawPencil;
60
- private drawPencilFull;
61
55
  private runEffectSelectWork;
62
56
  cursorHover(msg: IWorkerMessage): Promise<void>;
63
57
  cursorBlur(): Promise<void>;
@@ -20,7 +20,7 @@ export type IServiceEventWorkItem = {
20
20
  };
21
21
  export type IMagixEventType = {
22
22
  type: EventMessageType;
23
- op: Pick<IServiceEventWorkItem, 'consumPoint' | 'viewId'>[];
23
+ op: Pick<IServiceEventWorkItem, "consumPoint" | "viewId">[];
24
24
  uid: string;
25
25
  };
26
26
  export type CursorInfo = {