@netless/appliance-plugin 1.1.18 → 1.1.19-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.
- package/README.md +318 -260
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-XyhFxc.js +439 -0
- package/cdn/subWorker-BpFYAC.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/collector.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/manager.d.ts +2 -1
- package/dist/component/textEditor/types.d.ts +4 -3
- package/dist/component/textEditor/view.d.ts +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/mainEngine.d.ts +20 -5
- 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 +13 -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/arrow.d.ts +4 -0
- package/dist/core/tools/base.d.ts +4 -3
- package/dist/core/tools/ellipse.d.ts +4 -0
- 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/polygon.d.ts +4 -0
- package/dist/core/tools/rectangle.d.ts +4 -0
- package/dist/core/tools/selector.d.ts +1 -1
- package/dist/core/tools/speechBalloon.d.ts +4 -0
- package/dist/core/tools/star.d.ts +4 -0
- package/dist/core/tools/straight.d.ts +4 -0
- package/dist/core/types.d.ts +20 -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 +6 -11
- package/dist/cursors/index.d.ts +6 -4
- package/dist/displayer/cursor/index.d.ts +1 -0
- package/dist/fullWorker.js +142 -203
- package/dist/{index-BRQCDzgF.mjs → index-BJkvFhzU.mjs} +9239 -5525
- package/dist/index-BXV0vpe1.js +1 -0
- package/dist/index-D2qjaZgV.js +1 -0
- package/dist/index-DM5jr5_3.mjs +2776 -0
- package/dist/plugin/applianceMultiPlugin.d.ts +2 -3
- package/dist/plugin/applianceSinglePlugin.d.ts +3 -4
- package/dist/plugin/baseApplianceManager.d.ts +4 -4
- package/dist/plugin/baseViewContainerManager.d.ts +7 -3
- package/dist/plugin/const.d.ts +2 -34
- package/dist/plugin/multi/containerManager.d.ts +1 -1
- package/dist/plugin/types.d.ts +61 -25
- package/dist/style.css +1 -1
- package/dist/subWorker.js +142 -203
- package/dist/undo/index.d.ts +1 -1
- package/package.json +8 -2
- package/cdn/fullWorker-D_Qymn.js +0 -500
- package/cdn/subWorker-am2Vr9.js +0 -500
- package/dist/index-BmM-scQu.mjs +0 -2502
- 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-BXV0vpe1.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-BJkvFhzU.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 };
|
|
@@ -11,7 +11,6 @@ export declare class Collector extends BaseCollector<ISerializableStorageViewDat
|
|
|
11
11
|
protected namespace: string;
|
|
12
12
|
static namespace: string;
|
|
13
13
|
static authSpace: string;
|
|
14
|
-
static syncInterval: number;
|
|
15
14
|
static componentsLimits: number[];
|
|
16
15
|
serviceStorage: ISerializableStorageViewData;
|
|
17
16
|
storage: ISerializableStorageViewData;
|
|
@@ -20,7 +19,8 @@ export declare class Collector extends BaseCollector<ISerializableStorageViewDat
|
|
|
20
19
|
private authDisposer;
|
|
21
20
|
private asyncClockState;
|
|
22
21
|
private limitNums;
|
|
23
|
-
|
|
22
|
+
private syncInterval;
|
|
23
|
+
constructor(control: BaseApplianceManager, plugin: AppliancePluginLike, syncInterval: number);
|
|
24
24
|
private getLimitNum;
|
|
25
25
|
private getLimitNums;
|
|
26
26
|
getViewIdBySecenPath(scenePath: string): string | undefined;
|
|
@@ -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";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextEditorInfo, TextOptions } from "./types";
|
|
2
2
|
import { BaseSubWorkModuleProps } from "../../plugin/types";
|
|
3
|
-
import { ICameraOpt, IWorkerMessage } from "../../core";
|
|
3
|
+
import { ICameraOpt, IUpdateNodeOpt, IWorkerMessage } from "../../core";
|
|
4
4
|
import type EventEmitter2 from "eventemitter2";
|
|
5
5
|
import { BaseApplianceManager } from "../../plugin/baseApplianceManager";
|
|
6
6
|
import { WorkId } from "../../collector/types";
|
|
@@ -51,6 +51,7 @@ export interface TextEditorManager {
|
|
|
51
51
|
viewId: string;
|
|
52
52
|
canWorker: boolean;
|
|
53
53
|
canSync: boolean;
|
|
54
|
+
updateNodeOpt?: IUpdateNodeOpt;
|
|
54
55
|
}, undoTickerId?: number): void;
|
|
55
56
|
/** 编辑文本 */
|
|
56
57
|
/** 获取组建信息 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EDataType, EvevtWorkState } from "../../core";
|
|
1
|
+
import { EDataType, EvevtWorkState, IUpdateNodeOpt } from "../../core";
|
|
2
2
|
import { BaseShapeOptions } from "../../core/tools";
|
|
3
3
|
export declare enum ETextEditorType {
|
|
4
4
|
Text = 1,
|
|
@@ -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;
|
|
@@ -47,4 +47,5 @@ export type TextEditorInfo = {
|
|
|
47
47
|
dataType?: EDataType;
|
|
48
48
|
translate?: [number, number];
|
|
49
49
|
justLocal?: boolean;
|
|
50
|
+
updateNodeOpt?: IUpdateNodeOpt;
|
|
50
51
|
};
|
|
@@ -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";
|
|
@@ -9,13 +9,17 @@ import { EvevtWorkState } from "./enum";
|
|
|
9
9
|
import { BaseShapeOptions } from "./tools";
|
|
10
10
|
export declare abstract class MasterController {
|
|
11
11
|
/** 异步同步时间间隔 */
|
|
12
|
-
maxLastSyncTime: number;
|
|
12
|
+
abstract readonly maxLastSyncTime: number;
|
|
13
13
|
/** 合并绘制时间间隔 */
|
|
14
|
-
combineUnitTime: number;
|
|
14
|
+
abstract readonly combineUnitTime: number;
|
|
15
|
+
/** 最大合并橡皮擦处理时间 */
|
|
16
|
+
abstract readonly maxCombineEraserTime: number;
|
|
17
|
+
/** 平滑同步 */
|
|
18
|
+
abstract readonly smoothSync: boolean;
|
|
15
19
|
/** 插件管理器 */
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
20
|
+
abstract readonly control: BaseApplianceManager;
|
|
21
|
+
abstract readonly internalMsgEmitter: EventEmitter2;
|
|
22
|
+
abstract readonly publicMsgEmitter: EventEmitter2;
|
|
19
23
|
/** worker线程管理器 */
|
|
20
24
|
/** 本地原始点数据批任务数据池 */
|
|
21
25
|
protected abstract localPointsBatchData: Map<IworkId, {
|
|
@@ -34,6 +38,8 @@ export declare abstract class MasterController {
|
|
|
34
38
|
abstract currentToolsData?: IActiveToolsDataType;
|
|
35
39
|
/** 当前工作任务数据 */
|
|
36
40
|
protected abstract currentLocalWorkData: IActiveWorkDataType;
|
|
41
|
+
get now(): number;
|
|
42
|
+
get newWorkId(): string;
|
|
37
43
|
/** 设置当前选中的工具配置数据 */
|
|
38
44
|
setCurrentToolsData(currentToolsData: IActiveToolsDataType): void;
|
|
39
45
|
getCurrentToolsData(): IActiveToolsDataType | undefined;
|
|
@@ -94,6 +100,14 @@ export declare abstract class MasterController {
|
|
|
94
100
|
abstract checkDrawingWork(viewId: string): void;
|
|
95
101
|
}
|
|
96
102
|
export declare class MasterControlForWorker extends MasterController {
|
|
103
|
+
/** 异步同步时间间隔 */
|
|
104
|
+
readonly maxLastSyncTime: number;
|
|
105
|
+
/** 合并绘制时间间隔 */
|
|
106
|
+
readonly combineUnitTime: number;
|
|
107
|
+
/** 最大合并橡皮擦处理时间 */
|
|
108
|
+
readonly maxCombineEraserTime: number;
|
|
109
|
+
/** 平滑同步 */
|
|
110
|
+
readonly smoothSync: boolean;
|
|
97
111
|
isActive: boolean;
|
|
98
112
|
currentToolsData?: IActiveToolsDataType;
|
|
99
113
|
protected currentLocalWorkData: IActiveWorkDataType;
|
|
@@ -144,6 +158,7 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
144
158
|
private getVNodeInfoResolveMap;
|
|
145
159
|
private isLocalWorkActive;
|
|
146
160
|
constructor(props: BaseSubWorkModuleProps);
|
|
161
|
+
get isBezier(): boolean;
|
|
147
162
|
destroy(): void;
|
|
148
163
|
private get consumeCount();
|
|
149
164
|
private set consumeCount(value);
|
|
@@ -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,13 +43,14 @@ 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;
|
|
49
50
|
toolsType: EToolsKey;
|
|
50
51
|
ops?: string;
|
|
51
52
|
}>;
|
|
53
|
+
smoothSync?: boolean;
|
|
52
54
|
}) => void;
|
|
53
55
|
}): Promise<IMainMessage | undefined>;
|
|
54
56
|
createLocalWork(data: IWorkerMessage): void;
|
|
@@ -65,8 +67,11 @@ export declare class SubLocalMainThreadImpl implements SubLocalThread {
|
|
|
65
67
|
private fullWorkerDrawCount;
|
|
66
68
|
private drawWorkActiveId?;
|
|
67
69
|
private consumeCount;
|
|
70
|
+
private combineTimerId?;
|
|
71
|
+
private combineDrawResolve?;
|
|
72
|
+
private combineDrawActiveId?;
|
|
68
73
|
constructor(opt: ISubThreadInitOption);
|
|
69
|
-
loadImageBitMap(msg: Pick<IWorkerMessage,
|
|
74
|
+
loadImageBitMap(msg: Pick<IWorkerMessage, "toolsType" | "opt" | "workId">): Promise<ImageBitmap | undefined>;
|
|
70
75
|
createLocalWork(data: IWorkerMessage): void;
|
|
71
76
|
updateSelector(params: IUpdateSelectorPropsType & {
|
|
72
77
|
callback?: ((props: {
|
|
@@ -79,6 +84,7 @@ export declare class SubLocalMainThreadImpl implements SubLocalThread {
|
|
|
79
84
|
toolsType: EToolsKey;
|
|
80
85
|
ops?: string | undefined;
|
|
81
86
|
}>;
|
|
87
|
+
smoothSync?: boolean;
|
|
82
88
|
}) => void) | undefined;
|
|
83
89
|
}): Promise<IMainMessage | undefined>;
|
|
84
90
|
destroy(): void;
|
|
@@ -91,7 +97,7 @@ export declare class SubLocalMainThreadImpl implements SubLocalThread {
|
|
|
91
97
|
removeSelector(data: IWorkerMessage): Promise<void>;
|
|
92
98
|
removeWork(data: IWorkerMessage): void;
|
|
93
99
|
removeNode(key: string): void;
|
|
94
|
-
setFullWork(data: Pick<IWorkerMessage,
|
|
100
|
+
setFullWork(data: Pick<IWorkerMessage, "workId" | "opt" | "toolsType">): BaseShapeTool | undefined;
|
|
95
101
|
consumeFull(data: IWorkerMessage): Promise<void>;
|
|
96
102
|
colloctEffectSelectWork(data: IWorkerMessage): Promise<IWorkerMessage | undefined>;
|
|
97
103
|
private runEffectSelectWork;
|
|
@@ -106,11 +112,12 @@ export declare class SubLocalMainThreadImpl implements SubLocalThread {
|
|
|
106
112
|
getWorkShape(workId: string): BaseShapeTool | undefined;
|
|
107
113
|
getWorkShapes(): Map<string, BaseShapeTool>;
|
|
108
114
|
consumeDraw(data: IWorkerMessage, serviceWork: SubServiceThread): void;
|
|
115
|
+
private drawEraserCombine;
|
|
109
116
|
consumeDrawAll(data: IWorkerMessage, serviceWork: SubServiceThread): void;
|
|
110
117
|
getToolsOpt(): IActiveToolsDataType | undefined;
|
|
111
118
|
setToolsOpt(opt: IActiveToolsDataType): void;
|
|
112
119
|
setWorkOptions(workId: string, opt: BaseShapeOptions): void;
|
|
113
120
|
createWorkShapeNode(opt: IActiveToolsDataType & {
|
|
114
121
|
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 |
|
|
122
|
+
}): 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
123
|
}
|
|
@@ -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 {
|
|
@@ -25,6 +25,7 @@ export declare class ArrowShape extends BaseShapeTool {
|
|
|
25
25
|
isFullWork?: boolean;
|
|
26
26
|
isSubWorker?: boolean;
|
|
27
27
|
isMainThread?: boolean;
|
|
28
|
+
smoothSync?: boolean;
|
|
28
29
|
}): {
|
|
29
30
|
type: EPostMessageType;
|
|
30
31
|
} | {
|
|
@@ -52,6 +53,9 @@ export declare class ArrowShape extends BaseShapeTool {
|
|
|
52
53
|
dataType: EDataType;
|
|
53
54
|
ops: string;
|
|
54
55
|
isSync: boolean;
|
|
56
|
+
updateNodeOpt: {
|
|
57
|
+
useAnimation: boolean;
|
|
58
|
+
};
|
|
55
59
|
workId: string;
|
|
56
60
|
toolsType: EToolsKey;
|
|
57
61
|
opt: import("./utils").ShapeOptions;
|
|
@@ -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;
|
|
@@ -68,6 +68,7 @@ export declare abstract class BaseShapeTool {
|
|
|
68
68
|
drawCount?: number;
|
|
69
69
|
isMainThread?: boolean;
|
|
70
70
|
removeDrawCount?: number;
|
|
71
|
+
smoothSync?: boolean;
|
|
71
72
|
}): BaseConsumeResultType;
|
|
72
73
|
/** 消费本地完整数据,返回绘制结果 */
|
|
73
74
|
abstract consumeAll(props: {
|
|
@@ -25,6 +25,7 @@ export declare class EllipseShape extends BaseShapeTool {
|
|
|
25
25
|
isFullWork?: boolean;
|
|
26
26
|
isSubWorker?: boolean;
|
|
27
27
|
isMainThread?: boolean;
|
|
28
|
+
smoothSync?: boolean;
|
|
28
29
|
}): {
|
|
29
30
|
type: EPostMessageType;
|
|
30
31
|
} | {
|
|
@@ -50,6 +51,9 @@ export declare class EllipseShape extends BaseShapeTool {
|
|
|
50
51
|
} | {
|
|
51
52
|
ops: string;
|
|
52
53
|
isSync: boolean;
|
|
54
|
+
updateNodeOpt: {
|
|
55
|
+
useAnimation: boolean;
|
|
56
|
+
};
|
|
53
57
|
workId: string;
|
|
54
58
|
toolsType: EToolsKey;
|
|
55
59
|
opt: import("./utils").ShapeOptions;
|
|
@@ -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;
|