@netless/appliance-plugin 1.1.18 → 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.
- package/README.md +318 -260
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-3k30fq.js +439 -0
- package/cdn/subWorker-rWfN0e.js +439 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +7 -7
- package/dist/cdn.d.ts +2 -2
- package/dist/collector/index.d.ts +4 -4
- package/dist/collector/types.d.ts +2 -2
- package/dist/component/miniMap/index.d.ts +1 -1
- package/dist/component/miniMap/manager.d.ts +2 -2
- package/dist/component/miniMap/view.d.ts +1 -1
- package/dist/component/textEditor/index.d.ts +2 -2
- package/dist/component/textEditor/types.d.ts +2 -2
- package/dist/component/textEditor/view.d.ts +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/mainEngine.d.ts +7 -3
- package/dist/core/mainThread/base.d.ts +4 -4
- package/dist/core/mainThread/index.d.ts +2 -2
- package/dist/core/mainThread/snapshotThread.d.ts +3 -3
- package/dist/core/mainThread/subLocalThread.d.ts +11 -6
- package/dist/core/mainThread/subServiceThread.d.ts +1 -1
- package/dist/core/mainThread/workerMainThread.d.ts +2 -2
- package/dist/core/msgEvent/copyNode/forMain.d.ts +2 -2
- package/dist/core/msgEvent/forMainThread.d.ts +4 -4
- package/dist/core/msgEvent/forWorker.d.ts +4 -4
- package/dist/core/msgEvent/index.d.ts +4 -4
- package/dist/core/tools/base.d.ts +3 -3
- package/dist/core/tools/index.d.ts +14 -14
- package/dist/core/tools/laserPen.d.ts +1 -1
- package/dist/core/tools/pencilEraser.d.ts +4 -34
- package/dist/core/tools/pencilEraserBitMap.d.ts +7 -30
- package/dist/core/tools/selector.d.ts +1 -1
- package/dist/core/types.d.ts +11 -9
- package/dist/core/utils/clipper.d.ts +1 -1
- package/dist/core/utils/getSvgPathFromPoints.d.ts +1 -1
- package/dist/core/utils/index.d.ts +4 -4
- package/dist/core/utils/primitives/Box2d.d.ts +4 -4
- package/dist/core/utils/proxy.d.ts +3 -4
- package/dist/core/worker/base.d.ts +5 -2
- package/dist/core/worker/fullWorkerLocal.d.ts +5 -11
- package/dist/cursors/index.d.ts +1 -1
- package/dist/fullWorker.js +142 -203
- package/dist/index-B4Ld7AM5.js +1 -0
- package/dist/index-BS5_t4VL.mjs +21267 -0
- package/dist/index-CG1H4AUQ.js +1 -0
- package/dist/{index-BmM-scQu.mjs → index-yLOzxVyY.mjs} +901 -658
- package/dist/plugin/baseViewContainerManager.d.ts +3 -3
- package/dist/plugin/const.d.ts +1 -0
- package/dist/plugin/multi/containerManager.d.ts +1 -1
- package/dist/plugin/types.d.ts +20 -11
- package/dist/style.css +1 -1
- package/dist/subWorker.js +142 -203
- package/dist/undo/index.d.ts +1 -1
- package/package.json +7 -1
- package/cdn/fullWorker-D_Qymn.js +0 -500
- package/cdn/subWorker-am2Vr9.js +0 -500
- package/dist/index-BRQCDzgF.mjs +0 -17608
- package/dist/index-C9F49Gge.js +0 -1
- package/dist/index-DUGXE2hv.js +0 -1
package/dist/appliance-plugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-B4Ld7AM5.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.EForceStopReason=e.EForceStopReason;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 {
|
|
1
|
+
import { G as s, A as p, z as r, y as t, x as l, R as n, j as i, b as y, H as E, l as o, n as T, O as g, c as v, P as c, L as u, B as S, a as A, K as k, k as P, J as m, E as M, N as W, I as R, Q as w, F as x, v as F, w as I } from "./index-BS5_t4VL.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as ActiveContainerType,
|
|
4
4
|
p as ApplianceMultiPlugin,
|
|
@@ -12,17 +12,17 @@ export {
|
|
|
12
12
|
o as EImageType,
|
|
13
13
|
T as EMatrixrRelationType,
|
|
14
14
|
g as EOperationType,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
v as EPostMessageType,
|
|
16
|
+
c as ERenderFilterType,
|
|
17
|
+
u as EScaleType,
|
|
18
18
|
S as EStrokeType,
|
|
19
19
|
A as EToolsKey,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
k as ElayerType,
|
|
21
|
+
P as EmitEventType,
|
|
22
22
|
m as EventMessageType,
|
|
23
23
|
M as EvevtWorkState,
|
|
24
24
|
W as EvevtWorkType,
|
|
25
|
-
|
|
25
|
+
R as InternalMsgEmitterType,
|
|
26
26
|
w as Plugin,
|
|
27
27
|
x as ShapeType,
|
|
28
28
|
F as fullWorkerUrl,
|
package/dist/cdn.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import fullWorkerUrl from
|
|
2
|
-
import subWorkerUrl from
|
|
1
|
+
import fullWorkerUrl from "./core/worker/fullWorker.ts?worker&url";
|
|
2
|
+
import subWorkerUrl from "./core/worker/subWorker.ts?worker&url";
|
|
3
3
|
export { fullWorkerUrl, subWorkerUrl };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./const";
|
|
2
|
+
export * from "./base";
|
|
3
|
+
export * from "./collector";
|
|
4
|
+
export * from "./types";
|
|
@@ -58,7 +58,7 @@ export interface INormalPushMsg {
|
|
|
58
58
|
export interface INormalStorageData {
|
|
59
59
|
[key: string]: IStorageValueItem | undefined;
|
|
60
60
|
}
|
|
61
|
-
export type BaseCollectorReducerAction = INormalPushMsg & Pick<INormalPushMsg,
|
|
61
|
+
export type BaseCollectorReducerAction = INormalPushMsg & Pick<INormalPushMsg, "type">;
|
|
62
62
|
export interface ISerializableStorageData {
|
|
63
63
|
[key: string]: BaseCollectorReducerAction | undefined;
|
|
64
64
|
}
|
|
@@ -66,7 +66,7 @@ export type PageId = string;
|
|
|
66
66
|
export type ViewId = string;
|
|
67
67
|
export type WorkId = string;
|
|
68
68
|
export type ScenePath = string;
|
|
69
|
-
export type Uid = string |
|
|
69
|
+
export type Uid = string | "localSelf";
|
|
70
70
|
export interface BaseEventCollectorReducerAction {
|
|
71
71
|
type?: EventMessageType;
|
|
72
72
|
uid?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./manager";
|
|
@@ -2,8 +2,8 @@ import type EventEmitter2 from "eventemitter2";
|
|
|
2
2
|
import { ViewId } from "../../collector";
|
|
3
3
|
import { BaseApplianceManager } from "../../plugin/baseApplianceManager";
|
|
4
4
|
import type { BaseSubWorkModuleProps } from "../../plugin/types";
|
|
5
|
-
import React from
|
|
6
|
-
import { ICameraOpt } from
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { ICameraOpt } from "../../core";
|
|
7
7
|
export interface MiniMapsState {
|
|
8
8
|
contianer: HTMLElement;
|
|
9
9
|
miniMapCanvas: React.RefObject<HTMLCanvasElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MiniMapManagerImpl, MiniMapsState } from "./manager";
|
|
3
|
-
export type MapViewProps = Omit<MiniMapsState,
|
|
3
|
+
export type MapViewProps = Omit<MiniMapsState, "viewCamera" | "miniMapCamera"> & {
|
|
4
4
|
viewId: string;
|
|
5
5
|
highlightColor: string;
|
|
6
6
|
miniMapManager: MiniMapManagerImpl;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./types";
|
|
2
|
+
export * from "./manager";
|
|
@@ -6,8 +6,8 @@ export declare enum ETextEditorType {
|
|
|
6
6
|
}
|
|
7
7
|
export type VerticalAlignType = "top" | "middle" | "bottom";
|
|
8
8
|
export type TextAlignType = "left" | "center" | "right";
|
|
9
|
-
export type FontWeightType =
|
|
10
|
-
export type FontStyleType =
|
|
9
|
+
export type FontWeightType = "bold" | "normal";
|
|
10
|
+
export type FontStyleType = "italic" | "normal";
|
|
11
11
|
export interface TextOptions extends BaseShapeOptions {
|
|
12
12
|
fontColor: string;
|
|
13
13
|
fontSize: number;
|
|
@@ -27,7 +27,7 @@ export interface TextSelectorViewProps extends TextViewProps {
|
|
|
27
27
|
updateOptInfo: (param: {
|
|
28
28
|
activeTextId: string;
|
|
29
29
|
update: Partial<TextOptions>;
|
|
30
|
-
syncData?: Pick<TextEditorInfo,
|
|
30
|
+
syncData?: Pick<TextEditorInfo, "canSync" | "canWorker">;
|
|
31
31
|
}) => void;
|
|
32
32
|
handlePointerDown: (workId: string) => void;
|
|
33
33
|
handlePointerUp: () => void;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./enum";
|
|
2
|
+
export * from "./types";
|
|
3
|
+
export * from "./const";
|
|
@@ -12,10 +12,12 @@ export declare abstract class MasterController {
|
|
|
12
12
|
maxLastSyncTime: number;
|
|
13
13
|
/** 合并绘制时间间隔 */
|
|
14
14
|
combineUnitTime: number;
|
|
15
|
+
/** 最大合并橡皮擦处理时间 */
|
|
16
|
+
maxCombineEraserTime: number;
|
|
15
17
|
/** 插件管理器 */
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
18
|
+
abstract readonly control: BaseApplianceManager;
|
|
19
|
+
abstract readonly internalMsgEmitter: EventEmitter2;
|
|
20
|
+
abstract readonly publicMsgEmitter: EventEmitter2;
|
|
19
21
|
/** worker线程管理器 */
|
|
20
22
|
/** 本地原始点数据批任务数据池 */
|
|
21
23
|
protected abstract localPointsBatchData: Map<IworkId, {
|
|
@@ -34,6 +36,8 @@ export declare abstract class MasterController {
|
|
|
34
36
|
abstract currentToolsData?: IActiveToolsDataType;
|
|
35
37
|
/** 当前工作任务数据 */
|
|
36
38
|
protected abstract currentLocalWorkData: IActiveWorkDataType;
|
|
39
|
+
get now(): number;
|
|
40
|
+
get newWorkId(): string;
|
|
37
41
|
/** 设置当前选中的工具配置数据 */
|
|
38
42
|
setCurrentToolsData(currentToolsData: IActiveToolsDataType): void;
|
|
39
43
|
getCurrentToolsData(): IActiveToolsDataType | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Group } from "spritejs";
|
|
2
2
|
import { IBatchMainMessage, ICameraOpt, ILayerOptionType, IMainMessage, IOffscreenCanvasOptionType, IWorkerMessage } from "../types";
|
|
3
3
|
import { VNodeManager } from "../vNodeManager";
|
|
4
|
-
import type { MasterControlForWorker } from
|
|
4
|
+
import type { MasterControlForWorker } from "../mainEngine";
|
|
5
5
|
import type { AppViewDisplayerManager, MainViewDisplayerManager } from "../../plugin/baseViewContainerManager";
|
|
6
6
|
import { EDataType } from "../enum";
|
|
7
7
|
import { SubTopThread } from "./subTopThread";
|
|
@@ -14,7 +14,7 @@ export interface IMainThreadInitOption {
|
|
|
14
14
|
layerOpt: ILayerOptionType;
|
|
15
15
|
master: MasterControlForWorker;
|
|
16
16
|
displayer: MainViewDisplayerManager | AppViewDisplayerManager;
|
|
17
|
-
post(sp: Omit<IBatchMainMessage,
|
|
17
|
+
post(sp: Omit<IBatchMainMessage, "render">): void;
|
|
18
18
|
}
|
|
19
19
|
export interface ISubThreadInitOption {
|
|
20
20
|
thread: MainThreadEngineImpl;
|
|
@@ -71,11 +71,11 @@ export declare class MainThreadEngineImpl implements MainThreadEngine {
|
|
|
71
71
|
deleteCachedImagesByWorkId(workId: string): void;
|
|
72
72
|
clearCacheImages(): void;
|
|
73
73
|
clearImageResolveMap(): void;
|
|
74
|
-
post(msg: Omit<IBatchMainMessage,
|
|
74
|
+
post(msg: Omit<IBatchMainMessage, "render">): void;
|
|
75
75
|
updateDpr(dpr: number): void;
|
|
76
76
|
on(msg: IWorkerMessage): Promise<void>;
|
|
77
77
|
private getIconSize;
|
|
78
|
-
loadImageBitMap(msg: Pick<IWorkerMessage,
|
|
78
|
+
loadImageBitMap(msg: Pick<IWorkerMessage, "toolsType" | "opt" | "workId">): Promise<ImageBitmap | undefined>;
|
|
79
79
|
private removeNode;
|
|
80
80
|
consumeFull(type: EDataType, data: IWorkerMessage): Promise<void>;
|
|
81
81
|
setCameraOpt(cameraOpt: ICameraOpt): void;
|
|
@@ -7,7 +7,7 @@ export interface MainThreadManager {
|
|
|
7
7
|
mainThreadMap: Map<string, MainThreadEngineImpl>;
|
|
8
8
|
createMainThread(viewId: string, opt: IMainThreadInitOption): MainThreadEngineImpl;
|
|
9
9
|
consume(msg: Set<IWorkerMessage>): Promise<void>;
|
|
10
|
-
post(sp: Omit<IBatchMainMessage,
|
|
10
|
+
post(sp: Omit<IBatchMainMessage, "render">): void;
|
|
11
11
|
destroy(): void;
|
|
12
12
|
}
|
|
13
13
|
export declare class MainThreadManagerImpl implements MainThreadManager {
|
|
@@ -15,7 +15,7 @@ export declare class MainThreadManagerImpl implements MainThreadManager {
|
|
|
15
15
|
private snapshotThread?;
|
|
16
16
|
master: MasterControlForWorker;
|
|
17
17
|
constructor(master: MasterControlForWorker);
|
|
18
|
-
post(msg: Omit<IBatchMainMessage,
|
|
18
|
+
post(msg: Omit<IBatchMainMessage, "render">): void;
|
|
19
19
|
destroy(): void;
|
|
20
20
|
createMainThread(viewId: string, opt: IMainThreadInitOption): MainThreadEngineImpl;
|
|
21
21
|
createSnapshotThread(viewId: string, opt: IMainThreadInitOption): SnapshotThreadImpl;
|
|
@@ -22,14 +22,14 @@ export declare class SnapshotThreadImpl {
|
|
|
22
22
|
deleteCachedImagesByWorkId(workId: string): void;
|
|
23
23
|
clearCacheImages(): void;
|
|
24
24
|
clearImageResolveMap(): void;
|
|
25
|
-
post(msg: Omit<IBatchMainMessage,
|
|
25
|
+
post(msg: Omit<IBatchMainMessage, "render">): void;
|
|
26
26
|
on(msg: IWorkerMessage): Promise<void>;
|
|
27
27
|
private getIconSize;
|
|
28
|
-
loadImageBitMap(msg: Pick<IWorkerMessage,
|
|
28
|
+
loadImageBitMap(msg: Pick<IWorkerMessage, "toolsType" | "opt" | "workId">): Promise<ImageBitmap | undefined>;
|
|
29
29
|
createWorkShapeNode(opt: IActiveToolsDataType & {
|
|
30
30
|
workId: string;
|
|
31
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").BitMapEraserShape | import("../tools").SelectorShape | ImageShape | undefined;
|
|
32
|
-
setFullWork(data: Pick<IWorkerMessage,
|
|
32
|
+
setFullWork(data: Pick<IWorkerMessage, "workId" | "opt" | "toolsType">): BaseShapeTool | undefined;
|
|
33
33
|
runFullWork(data: IWorkerMessage): Promise<IRectType | undefined>;
|
|
34
34
|
private getSnapshot;
|
|
35
35
|
private getSceneRect;
|
|
@@ -5,7 +5,8 @@ import { VNodeManager } from "../vNodeManager";
|
|
|
5
5
|
import { EToolsKey } from "../enum";
|
|
6
6
|
import { SubServiceThread } from "./subServiceThread";
|
|
7
7
|
import { TextShape } from "../tools/text";
|
|
8
|
-
import { BitMapEraserShape } from "../tools/pencilEraserBitMap";
|
|
8
|
+
import type { BitMapEraserShape } from "../tools/pencilEraserBitMap";
|
|
9
|
+
import type { PencilEraserShape } from "../tools/pencilEraser";
|
|
9
10
|
export interface SubLocalThread {
|
|
10
11
|
readonly vNodes: VNodeManager;
|
|
11
12
|
readonly thread: MainThreadEngineImpl;
|
|
@@ -29,7 +30,7 @@ export interface SubLocalThread {
|
|
|
29
30
|
blurSelector(data?: IWorkerMessage): Promise<void>;
|
|
30
31
|
getWorkShape(workId: string): BaseShapeTool | undefined;
|
|
31
32
|
getWorkShapes(): Map<string, BaseShapeTool>;
|
|
32
|
-
setFullWork(data: Pick<IWorkerMessage,
|
|
33
|
+
setFullWork(data: Pick<IWorkerMessage, "workId" | "opt" | "toolsType">): ShapeToolsClass | undefined;
|
|
33
34
|
consumeFull(data: IWorkerMessage): Promise<void>;
|
|
34
35
|
removeWork(data: IWorkerMessage): void;
|
|
35
36
|
removeSelector(data: IWorkerMessage): Promise<void>;
|
|
@@ -42,7 +43,7 @@ export interface SubLocalThread {
|
|
|
42
43
|
callback?: (props: {
|
|
43
44
|
res?: IMainMessage;
|
|
44
45
|
param: IUpdateSelectorPropsType;
|
|
45
|
-
postData: Pick<IBatchMainMessage,
|
|
46
|
+
postData: Pick<IBatchMainMessage, "sp" | "render">;
|
|
46
47
|
workShapeNode: SelectorShape;
|
|
47
48
|
newServiceStore: Map<string, {
|
|
48
49
|
opt: BaseShapeOptions;
|
|
@@ -65,8 +66,11 @@ export declare class SubLocalMainThreadImpl implements SubLocalThread {
|
|
|
65
66
|
private fullWorkerDrawCount;
|
|
66
67
|
private drawWorkActiveId?;
|
|
67
68
|
private consumeCount;
|
|
69
|
+
private combineTimerId?;
|
|
70
|
+
private combineDrawResolve?;
|
|
71
|
+
private combineDrawActiveId?;
|
|
68
72
|
constructor(opt: ISubThreadInitOption);
|
|
69
|
-
loadImageBitMap(msg: Pick<IWorkerMessage,
|
|
73
|
+
loadImageBitMap(msg: Pick<IWorkerMessage, "toolsType" | "opt" | "workId">): Promise<ImageBitmap | undefined>;
|
|
70
74
|
createLocalWork(data: IWorkerMessage): void;
|
|
71
75
|
updateSelector(params: IUpdateSelectorPropsType & {
|
|
72
76
|
callback?: ((props: {
|
|
@@ -91,7 +95,7 @@ export declare class SubLocalMainThreadImpl implements SubLocalThread {
|
|
|
91
95
|
removeSelector(data: IWorkerMessage): Promise<void>;
|
|
92
96
|
removeWork(data: IWorkerMessage): void;
|
|
93
97
|
removeNode(key: string): void;
|
|
94
|
-
setFullWork(data: Pick<IWorkerMessage,
|
|
98
|
+
setFullWork(data: Pick<IWorkerMessage, "workId" | "opt" | "toolsType">): BaseShapeTool | undefined;
|
|
95
99
|
consumeFull(data: IWorkerMessage): Promise<void>;
|
|
96
100
|
colloctEffectSelectWork(data: IWorkerMessage): Promise<IWorkerMessage | undefined>;
|
|
97
101
|
private runEffectSelectWork;
|
|
@@ -106,11 +110,12 @@ export declare class SubLocalMainThreadImpl implements SubLocalThread {
|
|
|
106
110
|
getWorkShape(workId: string): BaseShapeTool | undefined;
|
|
107
111
|
getWorkShapes(): Map<string, BaseShapeTool>;
|
|
108
112
|
consumeDraw(data: IWorkerMessage, serviceWork: SubServiceThread): void;
|
|
113
|
+
private drawEraserCombine;
|
|
109
114
|
consumeDrawAll(data: IWorkerMessage, serviceWork: SubServiceThread): void;
|
|
110
115
|
getToolsOpt(): IActiveToolsDataType | undefined;
|
|
111
116
|
setToolsOpt(opt: IActiveToolsDataType): void;
|
|
112
117
|
setWorkOptions(workId: string, opt: BaseShapeOptions): void;
|
|
113
118
|
createWorkShapeNode(opt: IActiveToolsDataType & {
|
|
114
119
|
workId: string;
|
|
115
|
-
}): 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 |
|
|
120
|
+
}): 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 | PencilEraserShape | BitMapEraserShape | SelectorShape | ImageShape | undefined;
|
|
116
121
|
}
|
|
@@ -22,7 +22,7 @@ export declare class SubServiceMainThreadImpl implements SubServiceThread {
|
|
|
22
22
|
private animationId?;
|
|
23
23
|
private syncUnitTime;
|
|
24
24
|
constructor(opt: ISubThreadInitOption);
|
|
25
|
-
loadImageBitMap(msg: Pick<IWorkerMessage,
|
|
25
|
+
loadImageBitMap(msg: Pick<IWorkerMessage, "toolsType" | "opt" | "workId">): Promise<ImageBitmap | undefined>;
|
|
26
26
|
destroy(): void;
|
|
27
27
|
clearAll(): void;
|
|
28
28
|
private runEffect;
|
|
@@ -10,7 +10,7 @@ interface MainThreadWorkerManager {
|
|
|
10
10
|
mainThreadWorkerMap: Map<string, MainThreadWorkerImpl>;
|
|
11
11
|
createMainThreadWorker(viewId: string, opt: IMainThreadInitOption): MainThreadWorkerImpl;
|
|
12
12
|
consume(msg: Set<IWorkerMessage>): void;
|
|
13
|
-
post(sp: Omit<IBatchMainMessage,
|
|
13
|
+
post(sp: Omit<IBatchMainMessage, "render">): void;
|
|
14
14
|
clearDrawCount(viewId: string): void;
|
|
15
15
|
notifyDrawCount(viewId: string): void;
|
|
16
16
|
active(): void;
|
|
@@ -26,7 +26,7 @@ export declare class MainThreadWorkerManagerImpl implements MainThreadWorkerMana
|
|
|
26
26
|
clearDrawCount(viewId: string): void;
|
|
27
27
|
createMainThreadWorker(viewId: string, opt: IMainThreadInitOption): MainThreadWorkerImpl;
|
|
28
28
|
consume(msg: Set<IWorkerMessage>): void;
|
|
29
|
-
post(msg: Omit<IBatchMainMessage,
|
|
29
|
+
post(msg: Omit<IBatchMainMessage, "render">): void;
|
|
30
30
|
destroy(): void;
|
|
31
31
|
active(): void;
|
|
32
32
|
}
|
|
@@ -34,7 +34,7 @@ export declare class CopyNodeMethod extends BaseMsgMethod {
|
|
|
34
34
|
copyStores: Map<string, BaseCollectorReducerAction>;
|
|
35
35
|
copyCoordInfo: {
|
|
36
36
|
offset: Point;
|
|
37
|
-
cameraOpt: Pick<ICameraOpt,
|
|
37
|
+
cameraOpt: Pick<ICameraOpt, "centerX" | "centerY" | "scale">;
|
|
38
38
|
};
|
|
39
39
|
} | undefined;
|
|
40
40
|
pasteSelector(param: {
|
|
@@ -43,7 +43,7 @@ export declare class CopyNodeMethod extends BaseMsgMethod {
|
|
|
43
43
|
copyStores: Map<string, BaseCollectorReducerAction>;
|
|
44
44
|
copyCoordInfo: {
|
|
45
45
|
offset: Point;
|
|
46
|
-
cameraOpt: Pick<ICameraOpt,
|
|
46
|
+
cameraOpt: Pick<ICameraOpt, "centerX" | "centerY" | "scale">;
|
|
47
47
|
};
|
|
48
48
|
undoTickerId?: number;
|
|
49
49
|
}): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EmitEventType } from
|
|
2
|
-
import { BaseMsgMethodForMainThread } from
|
|
3
|
-
import { IWorkerMessage } from
|
|
4
|
-
import { MainThreadEngineImpl } from
|
|
1
|
+
import { EmitEventType } from "../../plugin/types";
|
|
2
|
+
import { BaseMsgMethodForMainThread } from "./baseForMainThread";
|
|
3
|
+
import { IWorkerMessage } from "../types";
|
|
4
|
+
import { MainThreadEngineImpl } from "../mainThread/base";
|
|
5
5
|
export type MsgMethodForMainThread<T extends BaseMsgMethodForMainThread> = T;
|
|
6
6
|
export declare class MethodBuilderWorker {
|
|
7
7
|
builders: Map<EmitEventType, MsgMethodForMainThread<BaseMsgMethodForMainThread> | undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EmitEventType } from
|
|
2
|
-
import { BaseMsgMethodForWorker } from
|
|
3
|
-
import { IWorkerMessage } from
|
|
4
|
-
import type { WorkThreadEngineForFullWorker } from
|
|
1
|
+
import { EmitEventType } from "../../plugin/types";
|
|
2
|
+
import { BaseMsgMethodForWorker } from "./baseForWorker";
|
|
3
|
+
import { IWorkerMessage } from "../types";
|
|
4
|
+
import type { WorkThreadEngineForFullWorker } from "../worker/workerManager";
|
|
5
5
|
export type MsgMethodForWorker<T extends BaseMsgMethodForWorker> = T;
|
|
6
6
|
export declare class MethodBuilderWorker {
|
|
7
7
|
builders: Map<EmitEventType, MsgMethodForWorker<BaseMsgMethodForWorker> | undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EmitEventType, InternalMsgEmitterType } from
|
|
2
|
-
import { BaseMsgMethod } from
|
|
3
|
-
import { ZIndexNodeMethod } from
|
|
4
|
-
import { BaseApplianceManager } from
|
|
1
|
+
import { EmitEventType, InternalMsgEmitterType } from "../../plugin/types";
|
|
2
|
+
import { BaseMsgMethod } from "./base";
|
|
3
|
+
import { ZIndexNodeMethod } from "./setZIndex/forMain";
|
|
4
|
+
import { BaseApplianceManager } from "../../plugin/baseApplianceManager";
|
|
5
5
|
export { ZIndexNodeMethod };
|
|
6
6
|
export type MsgMethod<T extends BaseMsgMethod> = T;
|
|
7
7
|
export declare class MethodBuilderMain {
|
|
@@ -42,9 +42,9 @@ export type BaseConsumeResultType = {
|
|
|
42
42
|
export declare abstract class BaseShapeTool {
|
|
43
43
|
static SafeBorderPadding: number;
|
|
44
44
|
protected abstract tmpPoints: Array<Point2d | number>;
|
|
45
|
-
readonly
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
45
|
+
abstract readonly toolsType: EToolsKey;
|
|
46
|
+
abstract readonly canRotate: boolean;
|
|
47
|
+
abstract readonly scaleType: EScaleType;
|
|
48
48
|
readonly maxImageWidth: number;
|
|
49
49
|
readonly maxImageHeight: number;
|
|
50
50
|
syncUnitTime: number;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
1
|
+
export * from "./base";
|
|
2
|
+
export * from "./pencil";
|
|
3
|
+
export * from "./laserPen";
|
|
4
|
+
export * from "./eraser";
|
|
5
|
+
export * from "./selector";
|
|
6
|
+
export * from "./arrow";
|
|
7
|
+
export * from "./ellipse";
|
|
8
|
+
export * from "./rectangle";
|
|
9
|
+
export * from "./star";
|
|
10
|
+
export * from "./polygon";
|
|
11
|
+
export * from "./speechBalloon";
|
|
12
|
+
export * from "./image";
|
|
13
|
+
export * from "./utils";
|
|
14
|
+
export * from "./pencilEraserBitMap";
|
|
@@ -7,7 +7,7 @@ export interface LaserPenOptions extends BaseShapeOptions {
|
|
|
7
7
|
thickness: number;
|
|
8
8
|
duration: number;
|
|
9
9
|
strokeColor: string;
|
|
10
|
-
strokeType: Omit<EStrokeType,
|
|
10
|
+
strokeType: Omit<EStrokeType, "Stroke">;
|
|
11
11
|
}
|
|
12
12
|
export declare class LaserPenShape extends BaseShapeTool {
|
|
13
13
|
readonly toolsType: EToolsKey;
|
|
@@ -5,14 +5,8 @@ import type { IMainMessage } from "../types";
|
|
|
5
5
|
import { Point2d } from "../utils/primitives/Point2d";
|
|
6
6
|
import type { LocalWorkForFullWorker } from "../worker/fullWorkerLocal";
|
|
7
7
|
import type { SubLocalMainThreadImpl } from "../mainThread/subLocalThread";
|
|
8
|
-
export type SerializerEraserLines = Array<SerializerEraserItem>;
|
|
9
|
-
export interface SerializerEraserItem {
|
|
10
|
-
op: number[][];
|
|
11
|
-
thickness: number;
|
|
12
|
-
}
|
|
13
8
|
export interface PencilEraserOptions extends BaseShapeOptions {
|
|
14
9
|
thickness: number;
|
|
15
|
-
eraserColor: string;
|
|
16
10
|
}
|
|
17
11
|
export declare class PencilEraserShape extends BaseShapeTool {
|
|
18
12
|
readonly canRotate: boolean;
|
|
@@ -25,17 +19,12 @@ export declare class PencilEraserShape extends BaseShapeTool {
|
|
|
25
19
|
worldScaling: [number, number];
|
|
26
20
|
eraserRect: IRectType | undefined;
|
|
27
21
|
eraserPolyline?: [number, number, number, number];
|
|
28
|
-
syncUnitTime: number;
|
|
29
|
-
private syncIndex;
|
|
30
|
-
private syncTimestamp;
|
|
31
22
|
constructor(props: BaseShapeToolProps);
|
|
32
23
|
/** 批量合并消费本地数据,返回绘制结果 */
|
|
33
|
-
combineConsume(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
replaceId?: string;
|
|
38
|
-
}): IRectType | undefined;
|
|
24
|
+
combineConsume(props: {
|
|
25
|
+
workerEngine?: LocalWorkForFullWorker | SubLocalMainThreadImpl;
|
|
26
|
+
}): IMainMessage | undefined;
|
|
27
|
+
consumeService(): undefined;
|
|
39
28
|
private updateTempPoints;
|
|
40
29
|
private getChangeNodes;
|
|
41
30
|
consume(props: {
|
|
@@ -50,26 +39,7 @@ export declare class PencilEraserShape extends BaseShapeTool {
|
|
|
50
39
|
toolsType: EToolsKey;
|
|
51
40
|
opt: import("./utils").ShapeOptions;
|
|
52
41
|
type: EPostMessageType;
|
|
53
|
-
rect?: undefined;
|
|
54
|
-
dataType?: undefined;
|
|
55
|
-
} | {
|
|
56
|
-
rect: IRectType | undefined;
|
|
57
|
-
type: EPostMessageType;
|
|
58
|
-
dataType: EDataType;
|
|
59
|
-
} | {
|
|
60
|
-
type: EPostMessageType;
|
|
61
|
-
dataType: EDataType;
|
|
62
|
-
rect: IRectType | undefined;
|
|
63
|
-
op: number[] | undefined;
|
|
64
|
-
index: number | undefined;
|
|
65
|
-
updateNodeOpt: {
|
|
66
|
-
useAnimation: boolean;
|
|
67
|
-
};
|
|
68
|
-
workId: string;
|
|
69
|
-
toolsType: EToolsKey;
|
|
70
|
-
opt: import("./utils").ShapeOptions;
|
|
71
42
|
};
|
|
72
|
-
private draw;
|
|
73
43
|
private computEraserPointLines;
|
|
74
44
|
consumeAll(props: {
|
|
75
45
|
workerEngine?: LocalWorkForFullWorker | SubLocalMainThreadImpl;
|
|
@@ -5,14 +5,14 @@ import type { IMainMessage } from "../types";
|
|
|
5
5
|
import { Point2d } from "../utils/primitives/Point2d";
|
|
6
6
|
import type { LocalWorkForFullWorker } from "../worker/fullWorkerLocal";
|
|
7
7
|
import type { SubLocalMainThreadImpl } from "../mainThread/subLocalThread";
|
|
8
|
-
export type SerializerEraserLines = Array<SerializerEraserItem>;
|
|
9
8
|
export interface SerializerEraserItem {
|
|
10
9
|
op: number[][];
|
|
11
10
|
thickness: number;
|
|
11
|
+
workId: string;
|
|
12
12
|
}
|
|
13
|
+
export type SerializerEraserLines = Array<SerializerEraserItem>;
|
|
13
14
|
export interface BitMapEraserOptions extends BaseShapeOptions {
|
|
14
15
|
thickness: number;
|
|
15
|
-
eraserColor: string;
|
|
16
16
|
}
|
|
17
17
|
export declare class BitMapEraserShape extends BaseShapeTool {
|
|
18
18
|
readonly canRotate: boolean;
|
|
@@ -25,17 +25,13 @@ export declare class BitMapEraserShape extends BaseShapeTool {
|
|
|
25
25
|
worldScaling: [number, number];
|
|
26
26
|
eraserRect: IRectType | undefined;
|
|
27
27
|
eraserPolyline?: [number, number, number, number];
|
|
28
|
-
|
|
29
|
-
private syncIndex;
|
|
30
|
-
private syncTimestamp;
|
|
28
|
+
oldRect: IRectType | undefined;
|
|
31
29
|
constructor(props: BaseShapeToolProps);
|
|
32
30
|
/** 批量合并消费本地数据,返回绘制结果 */
|
|
33
|
-
combineConsume(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
replaceId?: string;
|
|
38
|
-
}): IRectType | undefined;
|
|
31
|
+
combineConsume(props: {
|
|
32
|
+
workerEngine?: LocalWorkForFullWorker | SubLocalMainThreadImpl;
|
|
33
|
+
}): IMainMessage | undefined;
|
|
34
|
+
consumeService(): undefined;
|
|
39
35
|
private updateTempPoints;
|
|
40
36
|
private getChangeNodes;
|
|
41
37
|
consume(props: {
|
|
@@ -50,26 +46,7 @@ export declare class BitMapEraserShape extends BaseShapeTool {
|
|
|
50
46
|
toolsType: EToolsKey;
|
|
51
47
|
opt: import("./utils").ShapeOptions;
|
|
52
48
|
type: EPostMessageType;
|
|
53
|
-
rect?: undefined;
|
|
54
|
-
dataType?: undefined;
|
|
55
|
-
} | {
|
|
56
|
-
rect: IRectType | undefined;
|
|
57
|
-
type: EPostMessageType;
|
|
58
|
-
dataType: EDataType;
|
|
59
|
-
} | {
|
|
60
|
-
type: EPostMessageType;
|
|
61
|
-
dataType: EDataType;
|
|
62
|
-
rect: IRectType | undefined;
|
|
63
|
-
op: number[] | undefined;
|
|
64
|
-
index: number | undefined;
|
|
65
|
-
updateNodeOpt: {
|
|
66
|
-
useAnimation: boolean;
|
|
67
|
-
};
|
|
68
|
-
workId: string;
|
|
69
|
-
toolsType: EToolsKey;
|
|
70
|
-
opt: import("./utils").ShapeOptions;
|
|
71
49
|
};
|
|
72
|
-
private draw;
|
|
73
50
|
private computEraserPointLines;
|
|
74
51
|
consumeAll(props: {
|
|
75
52
|
workerEngine?: LocalWorkForFullWorker | SubLocalMainThreadImpl;
|
|
@@ -151,7 +151,7 @@ export declare class SelectorShape extends BaseShapeTool {
|
|
|
151
151
|
willSyncService: boolean;
|
|
152
152
|
};
|
|
153
153
|
getRightServiceId(serviceWorkId: string): string;
|
|
154
|
-
selectServiceNode(workId: string, workItem: Pick<IServiceWorkItem,
|
|
154
|
+
selectServiceNode(workId: string, workItem: Pick<IServiceWorkItem, "selectIds">, isService: boolean): IRectType | undefined;
|
|
155
155
|
reRenderSelector(): IRectType | undefined;
|
|
156
156
|
updateSelectIds(nextSelectIds: string[]): {
|
|
157
157
|
bgRect: IRectType | undefined;
|