@netless/appliance-plugin 1.0.0-beta.5 → 1.0.0-beta.7
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/cdn/cdn.js +1 -1
- package/cdn/fullWorker-DWcTwv.js +566 -0
- package/cdn/subWorker-FlDrsS.js +566 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/collector/types.d.ts +0 -1
- package/dist/component/textEditor/manager.d.ts +2 -5
- package/dist/component/textEditor/view.d.ts +1 -1
- package/dist/core/enum.d.ts +1 -2
- package/dist/core/mainEngine.d.ts +25 -9
- package/dist/core/mainThread/snapshotThread.d.ts +4 -5
- package/dist/core/mainThread/subLocalThread.d.ts +3 -2
- package/dist/core/msgEvent/copyNode/forMain.d.ts +2 -0
- package/dist/core/msgEvent/rotateNode/forMain.d.ts +0 -1
- package/dist/core/msgEvent/scaleNode/forMain.d.ts +2 -1
- package/dist/core/msgEvent/setColor/forMain.d.ts +2 -1
- package/dist/core/tools/arrow.d.ts +0 -1
- package/dist/core/tools/base.d.ts +2 -2
- package/dist/core/tools/ellipse.d.ts +0 -1
- package/dist/core/tools/image.d.ts +1 -0
- package/dist/core/tools/pencil.d.ts +2 -2
- package/dist/core/tools/star.d.ts +0 -1
- package/dist/core/tools/text.d.ts +7 -4
- package/dist/core/types.d.ts +3 -3
- package/dist/core/utils/math.d.ts +3 -0
- package/dist/core/utils/spriteNode.d.ts +2 -2
- package/dist/core/worker/base.d.ts +1 -1
- package/dist/core/worker/subWorkerLocal.d.ts +1 -1
- package/dist/core/worker/workerManager.d.ts +0 -1
- package/dist/fullWorker.js +11 -11
- package/dist/index-AejjET4H.js +1 -0
- package/dist/index-BIIqscm6.js +1 -0
- package/dist/{index-BWnd02v8.mjs → index-CPErIqdS.mjs} +1107 -1094
- package/dist/index-_y5mc2yg.mjs +8845 -0
- package/dist/plugin/baseViewContainerManager.d.ts +0 -1
- package/dist/style.css +1 -1
- package/dist/subWorker.js +11 -11
- package/dist/undo/index.d.ts +1 -2
- package/package.json +1 -1
- package/cdn/fullWorker-wE6a5h.js +0 -566
- package/cdn/subWorker-C2CJhY.js +0 -566
- package/dist/index-BcB6iiXb.mjs +0 -8732
- package/dist/index-DidhBo_r.js +0 -1
- package/dist/index-TV2ydoa-.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-BIIqscm6.js");exports.ActiveContainerType=e.ActiveContainerType;exports.ApplianceMultiPlugin=e.ApplianceMultiPlugin;exports.ApplianceNames=e.ApplianceNames;exports.ApplianceSigleWrapper=e.ApplianceSigleWrapper;exports.ApplianceSinglePlugin=e.ApplianceSinglePlugin;exports.DisplayStateEnum=e.DisplayStateEnum;exports.ECanvasContextType=e.ECanvasContextType;exports.ECanvasShowType=e.ECanvasShowType;exports.EDataType=e.EDataType;exports.EPostMessageType=e.EPostMessageType;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.InternalMsgEmitterType=e.InternalMsgEmitterType;exports.ShapeType=e.ShapeType;exports.fullWorkerUrl=e.fullWorker;exports.subWorkerUrl=e.subWorker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Q as s, I as p, L as t, K as l, J as n, M as r, R as y, T as E, j as i, h as T, E as o, l as S, f as g, W as v, C as c, U as u, k, O as m, N as A, G as C, H as M } from "./index-_y5mc2yg.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as ActiveContainerType,
|
|
4
4
|
p as ApplianceMultiPlugin,
|
|
@@ -8,7 +8,6 @@ export interface TextEditorManager {
|
|
|
8
8
|
readonly control: BaseApplianceManager;
|
|
9
9
|
editors: Map<string, TextEditorInfo>;
|
|
10
10
|
activeId?: string;
|
|
11
|
-
undoTickerId?: number;
|
|
12
11
|
/** 通过view组建中更新文本 */
|
|
13
12
|
updateForViewEdited(activeId?: string, info?: TextEditorInfo): void;
|
|
14
13
|
/** 过滤文本编辑器 */
|
|
@@ -20,7 +19,7 @@ export interface TextEditorManager {
|
|
|
20
19
|
/** 激活文本编辑组件 */
|
|
21
20
|
active(workId: string): void;
|
|
22
21
|
/** 不激活文本编辑组件 */
|
|
23
|
-
unActive(): void;
|
|
22
|
+
unActive(blurId: string): void;
|
|
24
23
|
/** 创建文本来源于main */
|
|
25
24
|
createTextForMasterController(params: TextEditorInfo & {
|
|
26
25
|
workId: string;
|
|
@@ -71,7 +70,6 @@ export declare class TextEditorManagerImpl implements TextEditorManager {
|
|
|
71
70
|
readonly control: BaseApplianceManager;
|
|
72
71
|
editors: Map<string, TextEditorInfo>;
|
|
73
72
|
activeId?: string;
|
|
74
|
-
undoTickerId?: number;
|
|
75
73
|
private proxyMap;
|
|
76
74
|
private taskqueue;
|
|
77
75
|
constructor(props: BaseSubWorkModuleProps);
|
|
@@ -88,7 +86,7 @@ export declare class TextEditorManagerImpl implements TextEditorManager {
|
|
|
88
86
|
onServiceDerive(data: IWorkerMessage): void;
|
|
89
87
|
updateForViewEdited(activeId: string, info: TextEditorInfo): void;
|
|
90
88
|
active(workId: string): void;
|
|
91
|
-
unActive(): void;
|
|
89
|
+
unActive(blurId: string): void;
|
|
92
90
|
createTextForMasterController(params: TextEditorInfo & {
|
|
93
91
|
workId: string;
|
|
94
92
|
viewId: string;
|
|
@@ -116,5 +114,4 @@ export declare class TextEditorManagerImpl implements TextEditorManager {
|
|
|
116
114
|
deleteBatch(workIds: string[], canSync?: boolean | undefined, canWorker?: boolean | undefined): void;
|
|
117
115
|
clear(viewId: string, justLocal?: boolean): void;
|
|
118
116
|
destory(): void;
|
|
119
|
-
private getMaxZIndex;
|
|
120
117
|
}
|
|
@@ -37,7 +37,7 @@ export interface TextEditorProps extends TextViewProps {
|
|
|
37
37
|
showFloatBtns: boolean;
|
|
38
38
|
handleKeyUp: KeyboardEventHandler<HTMLDivElement>;
|
|
39
39
|
handleFocus: FocusEventHandler<HTMLDivElement>;
|
|
40
|
-
|
|
40
|
+
handleKeyDown: KeyboardEventHandler<HTMLDivElement>;
|
|
41
41
|
updateOptInfo: (param: {
|
|
42
42
|
activeTextId: string;
|
|
43
43
|
update: Partial<TextOptions>;
|
package/dist/core/enum.d.ts
CHANGED
|
@@ -14,7 +14,11 @@ export declare abstract class MasterController {
|
|
|
14
14
|
readonly abstract internalMsgEmitter: EventEmitter2;
|
|
15
15
|
/** worker线程管理器 */
|
|
16
16
|
/** 本地原始点数据批任务数据池 */
|
|
17
|
-
protected abstract localPointsBatchData:
|
|
17
|
+
protected abstract localPointsBatchData: Map<IworkId, {
|
|
18
|
+
state: EvevtWorkState;
|
|
19
|
+
points: number[];
|
|
20
|
+
isFullWork: boolean;
|
|
21
|
+
}>;
|
|
18
22
|
/** 事件任务处理批量池 */
|
|
19
23
|
abstract taskBatchData: Set<IWorkerMessage>;
|
|
20
24
|
/** 主线程和工作线程通信机 */
|
|
@@ -73,6 +77,8 @@ export declare abstract class MasterController {
|
|
|
73
77
|
abstract lockImage(uuid: string, locked: boolean): void;
|
|
74
78
|
abstract completeImageUpload(uuid: string, src: string): void;
|
|
75
79
|
abstract getImagesInformation(scenePath: string): ImageInformation[];
|
|
80
|
+
/** 移除正在绘制的流程 */
|
|
81
|
+
abstract removeDrawingWork(viewId: string): void;
|
|
76
82
|
}
|
|
77
83
|
export declare class MasterControlForWorker extends MasterController {
|
|
78
84
|
isActive: boolean;
|
|
@@ -91,10 +97,13 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
91
97
|
private subWorkerDrawCount;
|
|
92
98
|
private wokerDrawCount;
|
|
93
99
|
private maxDrawCount;
|
|
94
|
-
private cacheDrawCount;
|
|
95
100
|
private reRenders;
|
|
96
101
|
private localWorkViewId?;
|
|
97
|
-
protected localPointsBatchData:
|
|
102
|
+
protected localPointsBatchData: Map<IworkId, {
|
|
103
|
+
state: EvevtWorkState;
|
|
104
|
+
points: number[];
|
|
105
|
+
isFullWork: boolean;
|
|
106
|
+
}>;
|
|
98
107
|
/** end */
|
|
99
108
|
/** 是否任务队列化参数 */
|
|
100
109
|
private tasksqueue;
|
|
@@ -106,7 +115,6 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
106
115
|
private snapshotMap;
|
|
107
116
|
private boundingRectMap;
|
|
108
117
|
private clearAllResolve?;
|
|
109
|
-
private delayWorkStateToDone?;
|
|
110
118
|
private delayWorkStateToDoneResolve?;
|
|
111
119
|
private animationId;
|
|
112
120
|
private tmpImageConfigMap;
|
|
@@ -121,6 +129,7 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
121
129
|
private get isCanSentCursor();
|
|
122
130
|
init(): Promise<void>;
|
|
123
131
|
on(): Promise<void>;
|
|
132
|
+
private clearReRenders;
|
|
124
133
|
setMaxDrawCount(num: number): void;
|
|
125
134
|
setWorkerTasksqueueCount(num: number): void;
|
|
126
135
|
collectorSyncData(sp: IMainMessage[]): void;
|
|
@@ -128,13 +137,20 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
128
137
|
private onLocalEventEnd;
|
|
129
138
|
private onLocalEventDoing;
|
|
130
139
|
private onLocalEventStart;
|
|
131
|
-
private
|
|
140
|
+
private setLocalPointIsFullWork;
|
|
141
|
+
private pushLocalPoint;
|
|
142
|
+
private deleteLocalPoint;
|
|
143
|
+
private getLocalPointInfo;
|
|
144
|
+
getLocalPointsInfo(): Map<IworkId, {
|
|
145
|
+
state: EvevtWorkState;
|
|
146
|
+
points: number[];
|
|
147
|
+
isFullWork: boolean;
|
|
148
|
+
}>;
|
|
132
149
|
private correctStorage;
|
|
133
150
|
originalEventLintener(workState: EvevtWorkState, point: [number, number], viewId: string): Promise<void>;
|
|
134
151
|
getLocalWorkViewId(): string | undefined;
|
|
135
152
|
setLocalWorkViewId(viewId?: string): void;
|
|
136
153
|
setCurrentToolsData(currentToolsData: IActiveToolsDataType): void;
|
|
137
|
-
setCurrentLocalWorkData(currentLocalWorkData: IActiveWorkDataType): void;
|
|
138
154
|
prepareOnceWork(currentLocalWorkData: Required<Pick<IActiveWorkDataType, 'toolsOpt' | 'viewId' | 'workId'>>, toolsType: EToolsKey): void;
|
|
139
155
|
createViewWorker(viewId: string, options: ViewWorkerOptions): void;
|
|
140
156
|
destroyViewWorker(viewId: string, isLocal?: boolean): void;
|
|
@@ -153,7 +169,7 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
153
169
|
clearViewScenePath(viewId: string, justLocal?: boolean | undefined): Promise<void>;
|
|
154
170
|
private internalMsgEmitterListener;
|
|
155
171
|
private setZIndex;
|
|
156
|
-
|
|
172
|
+
removeDrawingWork(viewId: string): void;
|
|
157
173
|
hoverCursor(point: [number, number], viewId: string): void;
|
|
158
174
|
sendCursorEvent(p: [number | undefined, number | undefined], viewId: string): void;
|
|
159
175
|
getBoundingRect(scenePath: string): Promise<IRectType> | undefined;
|
|
@@ -163,6 +179,6 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
163
179
|
lockImage(uuid: string, locked: boolean): void;
|
|
164
180
|
completeImageUpload(uuid: string, src: string): void;
|
|
165
181
|
getImagesInformation(scenePath: string): ImageInformation[];
|
|
166
|
-
setShapeSelectorByWorkId(workId: string, viewId: string
|
|
167
|
-
blurSelector(viewId: string, scenePath: string
|
|
182
|
+
setShapeSelectorByWorkId(workId: string, viewId: string): void;
|
|
183
|
+
blurSelector(viewId: string, scenePath: string): void;
|
|
168
184
|
}
|
|
@@ -4,6 +4,7 @@ import { MasterControlForWorker } from "../mainEngine";
|
|
|
4
4
|
import { IActiveToolsDataType, IBatchMainMessage, ICameraOpt, IRectType, IWorkerMessage, IworkId } from "../types";
|
|
5
5
|
import type { BaseShapeTool } from "../tools/base";
|
|
6
6
|
import type { ImageShape } from "../tools/image";
|
|
7
|
+
import { TextShape } from "../tools/text";
|
|
7
8
|
export declare class SnapshotThreadImpl {
|
|
8
9
|
viewId: string;
|
|
9
10
|
fullLayer: Group;
|
|
@@ -18,12 +19,10 @@ export declare class SnapshotThreadImpl {
|
|
|
18
19
|
on(msg: IWorkerMessage): Promise<void>;
|
|
19
20
|
createWorkShapeNode(opt: IActiveToolsDataType & {
|
|
20
21
|
workId?: IworkId;
|
|
21
|
-
}): 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 |
|
|
22
|
-
setFullWork(data: Pick<IWorkerMessage, 'workId' | 'opt' | 'toolsType'>): BaseShapeTool | import("../tools/
|
|
23
|
-
runFullWork(data: IWorkerMessage
|
|
22
|
+
}): 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").SelectorShape | ImageShape | undefined;
|
|
23
|
+
setFullWork(data: Pick<IWorkerMessage, 'workId' | 'opt' | 'toolsType'>): BaseShapeTool | import("../tools/straight").StraightShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools").LaserPenShape | undefined;
|
|
24
|
+
runFullWork(data: IWorkerMessage): Promise<IRectType | undefined>;
|
|
24
25
|
private getSnapshot;
|
|
25
|
-
private updateLabels;
|
|
26
|
-
private willRenderSpecialLabel;
|
|
27
26
|
private getSceneRect;
|
|
28
27
|
private getRectImageBitmap;
|
|
29
28
|
private getSnapshotRender;
|
|
@@ -5,6 +5,7 @@ import { VNodeManager } from "./vNodeManager";
|
|
|
5
5
|
import { EToolsKey } from "../enum";
|
|
6
6
|
import { Scene } from "spritejs";
|
|
7
7
|
import { SubServiceThread } from "./subServiceThread";
|
|
8
|
+
import { TextShape } from "../tools/text";
|
|
8
9
|
export interface SubLocalThread {
|
|
9
10
|
readonly vNodes: VNodeManager;
|
|
10
11
|
readonly thread: MainThreadEngineImpl;
|
|
@@ -78,7 +79,7 @@ export declare class SubLocalThreadImpl implements SubLocalThread {
|
|
|
78
79
|
updateFullSelectWork(data: IWorkerMessage): void;
|
|
79
80
|
removeWork(data: IWorkerMessage): void;
|
|
80
81
|
removeNode(key: string): void;
|
|
81
|
-
setFullWork(data: Pick<IWorkerMessage, 'workId' | 'opt' | 'toolsType'>): BaseShapeTool | import("../tools/
|
|
82
|
+
setFullWork(data: Pick<IWorkerMessage, 'workId' | 'opt' | 'toolsType'>): BaseShapeTool | import("../tools/straight").StraightShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools").LaserPenShape | undefined;
|
|
82
83
|
consumeFull(data: IWorkerMessage, scene?: Scene): Promise<void>;
|
|
83
84
|
colloctEffectSelectWork(data: IWorkerMessage): Promise<IWorkerMessage | undefined>;
|
|
84
85
|
private runEffectSelectWork;
|
|
@@ -97,5 +98,5 @@ export declare class SubLocalThreadImpl implements SubLocalThread {
|
|
|
97
98
|
setWorkOptions(workId: IworkId, opt: BaseShapeOptions): void;
|
|
98
99
|
createWorkShapeNode(opt: IActiveToolsDataType & {
|
|
99
100
|
workId?: IworkId;
|
|
100
|
-
}): import("../tools").ArrowShape | PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape |
|
|
101
|
+
}): import("../tools").ArrowShape | PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | SelectorShape | ImageShape | undefined;
|
|
101
102
|
}
|
|
@@ -24,6 +24,7 @@ export declare class CopyNodeMethod extends BaseMsgMethod {
|
|
|
24
24
|
store: BaseCollectorReducerAction;
|
|
25
25
|
bgCenter?: [number, number];
|
|
26
26
|
textCenter?: [number, number];
|
|
27
|
+
undoTickerId?: number;
|
|
27
28
|
}): void;
|
|
28
29
|
copySelector(param: {
|
|
29
30
|
viewId: string;
|
|
@@ -43,5 +44,6 @@ export declare class CopyNodeMethod extends BaseMsgMethod {
|
|
|
43
44
|
offset: Point;
|
|
44
45
|
cameraOpt: Pick<ICameraOpt, 'centerX' | 'centerY' | 'scale'>;
|
|
45
46
|
};
|
|
47
|
+
undoTickerId?: number;
|
|
46
48
|
}): void;
|
|
47
49
|
}
|
|
@@ -9,10 +9,11 @@ export type ScaleNodeEmtData = {
|
|
|
9
9
|
box: IRectType;
|
|
10
10
|
viewId: string;
|
|
11
11
|
dir?: Direction;
|
|
12
|
+
reverseY?: boolean;
|
|
13
|
+
reverseX?: boolean;
|
|
12
14
|
};
|
|
13
15
|
export declare class ScaleNodeMethod extends BaseMsgMethod {
|
|
14
16
|
readonly emitEventType: EmitEventType;
|
|
15
|
-
private undoTickerId?;
|
|
16
17
|
private targetBox;
|
|
17
18
|
private targetText;
|
|
18
19
|
private cacheTextInfo;
|
|
@@ -8,11 +8,12 @@ export type SetColorNodeEmtData = {
|
|
|
8
8
|
fillColor?: string;
|
|
9
9
|
fontColor?: string;
|
|
10
10
|
fontBgColor?: string;
|
|
11
|
-
workState
|
|
11
|
+
workState: EvevtWorkState;
|
|
12
12
|
viewId: string;
|
|
13
13
|
};
|
|
14
14
|
export declare class SetColorNodeMethod extends BaseMsgMethod {
|
|
15
15
|
readonly emitEventType: EmitEventType;
|
|
16
|
+
private undoTickerId?;
|
|
16
17
|
private setTextColor;
|
|
17
18
|
collect(data: SetColorNodeEmtData): void;
|
|
18
19
|
}
|
|
@@ -44,8 +44,8 @@ export declare abstract class BaseShapeTool {
|
|
|
44
44
|
abstract consume(props: {
|
|
45
45
|
data: IWorkerMessage;
|
|
46
46
|
isFullWork?: boolean;
|
|
47
|
-
isClearAll?: boolean;
|
|
48
47
|
isSubWorker?: boolean;
|
|
48
|
+
drawCount?: number;
|
|
49
49
|
isMainThread?: boolean;
|
|
50
50
|
}): IMainMessage;
|
|
51
51
|
/** 消费本地完整数据,返回绘制结果 */
|
|
@@ -57,7 +57,6 @@ export declare abstract class BaseShapeTool {
|
|
|
57
57
|
op: number[];
|
|
58
58
|
isFullWork: boolean;
|
|
59
59
|
replaceId?: string;
|
|
60
|
-
isClearAll?: boolean;
|
|
61
60
|
}): IRectType | undefined;
|
|
62
61
|
/** 清除临时数据 */
|
|
63
62
|
abstract clearTmpPoints(): void;
|
|
@@ -70,6 +69,7 @@ export declare abstract class BaseShapeTool {
|
|
|
70
69
|
setWorkOptions(workOptions: BaseShapeOptions): void;
|
|
71
70
|
/** 更新服务端同步配置,返回绘制结果 */
|
|
72
71
|
updataOptService(opt?: IUpdateNodeOpt): IRectType | undefined;
|
|
72
|
+
replace(layer: Group, replaceId: string, newNode: ShapeNodes): void;
|
|
73
73
|
static updateNodeOpt(param: {
|
|
74
74
|
node: ShapeNodes;
|
|
75
75
|
opt: IUpdateNodeOpt;
|
|
@@ -44,6 +44,7 @@ export declare class ImageShape extends BaseShapeTool {
|
|
|
44
44
|
isMainThread?: boolean;
|
|
45
45
|
}): Promise<IRectType | undefined>;
|
|
46
46
|
clearTmpPoints(): void;
|
|
47
|
+
static getScaleType(opt: ImageOptions): EScaleType.all | EScaleType.proportional;
|
|
47
48
|
static updateNodeOpt(param: {
|
|
48
49
|
node: ShapeNodes;
|
|
49
50
|
opt: IUpdateNodeOpt;
|
|
@@ -29,9 +29,10 @@ export declare class PencilShape extends BaseShapeTool {
|
|
|
29
29
|
consume(props: {
|
|
30
30
|
data: IWorkerMessage;
|
|
31
31
|
isFullWork?: boolean;
|
|
32
|
-
isClearAll?: boolean;
|
|
33
32
|
isSubWorker?: boolean;
|
|
33
|
+
drawCount?: number;
|
|
34
34
|
isMainThread?: boolean;
|
|
35
|
+
replaceId?: string;
|
|
35
36
|
}): IMainMessage;
|
|
36
37
|
consumeAll(props: {
|
|
37
38
|
data?: IWorkerMessage;
|
|
@@ -41,7 +42,6 @@ export declare class PencilShape extends BaseShapeTool {
|
|
|
41
42
|
op: number[];
|
|
42
43
|
isFullWork?: boolean;
|
|
43
44
|
replaceId?: string;
|
|
44
|
-
isClearAll?: boolean;
|
|
45
45
|
}): IRectType | undefined;
|
|
46
46
|
private transformDataAll;
|
|
47
47
|
private draw;
|
|
@@ -16,13 +16,16 @@ export declare class TextShape extends BaseShapeTool {
|
|
|
16
16
|
constructor(props: BaseShapeToolProps);
|
|
17
17
|
consume(): IMainMessage;
|
|
18
18
|
consumeAll(): IMainMessage;
|
|
19
|
+
consumeService(): IRectType | undefined;
|
|
19
20
|
private draw;
|
|
20
|
-
|
|
21
|
+
consumeServiceAsync(props: {
|
|
21
22
|
isFullWork: boolean;
|
|
22
23
|
replaceId?: string;
|
|
23
|
-
isDrawLabel?:
|
|
24
|
-
}): IRectType | undefined
|
|
25
|
-
|
|
24
|
+
isDrawLabel?: true;
|
|
25
|
+
}): Promise<IRectType | undefined>;
|
|
26
|
+
updateLabelsWidth(node: Group): void;
|
|
27
|
+
updataOptService(): IRectType | undefined;
|
|
28
|
+
updataOptServiceAsync(updateNodeOpt: IUpdateNodeOpt): Promise<IRectType | undefined>;
|
|
26
29
|
clearTmpPoints(): void;
|
|
27
30
|
static getFontWidth(param: {
|
|
28
31
|
text: string;
|
package/dist/core/types.d.ts
CHANGED
|
@@ -120,7 +120,6 @@ export type IWorkerMessage = Omit<Partial<BaseCollectorReducerAction>, 'op'> & {
|
|
|
120
120
|
}>;
|
|
121
121
|
willSerializeData?: boolean;
|
|
122
122
|
isRunSubWork?: boolean;
|
|
123
|
-
undoTickerId?: number;
|
|
124
123
|
scenes?: ISerializableStorageData;
|
|
125
124
|
textType?: ETextEditorType;
|
|
126
125
|
mainTasksqueueCount?: number;
|
|
@@ -162,7 +161,6 @@ export interface IMainMessage extends INormalPushMsg {
|
|
|
162
161
|
workId: IworkId;
|
|
163
162
|
toolsType: EToolsKey;
|
|
164
163
|
}>;
|
|
165
|
-
undoTickerId?: number;
|
|
166
164
|
scenePath?: string;
|
|
167
165
|
canvasWidth?: number;
|
|
168
166
|
canvasHeight?: number;
|
|
@@ -198,6 +196,7 @@ export interface IMainMessageRenderData {
|
|
|
198
196
|
y: number;
|
|
199
197
|
};
|
|
200
198
|
translate?: [number, number];
|
|
199
|
+
workId?: string;
|
|
201
200
|
}
|
|
202
201
|
export interface IBatchMainMessage {
|
|
203
202
|
/** 绘制数据 */
|
|
@@ -206,6 +205,7 @@ export interface IBatchMainMessage {
|
|
|
206
205
|
sp?: Array<IMainMessage>;
|
|
207
206
|
drawCount?: number;
|
|
208
207
|
workerTasksqueueCount?: number;
|
|
208
|
+
workIds?: Set<string>;
|
|
209
209
|
}
|
|
210
210
|
export interface ICameraOpt {
|
|
211
211
|
centerX: number;
|
|
@@ -244,7 +244,6 @@ export interface IActiveWorkDataType {
|
|
|
244
244
|
toolsOpt?: ShapeOptions;
|
|
245
245
|
viewId?: string;
|
|
246
246
|
workId?: IworkId;
|
|
247
|
-
undoTickerId?: number;
|
|
248
247
|
}
|
|
249
248
|
export type IServiceWorkItem = {
|
|
250
249
|
toolsType: EToolsKey;
|
|
@@ -284,6 +283,7 @@ export type BaseNodeMapItem = {
|
|
|
284
283
|
scaleType: EScaleType;
|
|
285
284
|
/** 是否被框选中,框选中的元素不能被其它人操作 */
|
|
286
285
|
isSelected: boolean;
|
|
286
|
+
isHid?: boolean;
|
|
287
287
|
};
|
|
288
288
|
export type Size = {
|
|
289
289
|
/**
|
|
@@ -37,6 +37,7 @@ export declare function getRectTranslated(rect: IRectType, translate: [number, n
|
|
|
37
37
|
w: number;
|
|
38
38
|
h: number;
|
|
39
39
|
};
|
|
40
|
+
export declare function getRectRotatedPoints(rect: IRectType, angle: number): Vec2d[];
|
|
40
41
|
export declare function getRectRotated(rect: IRectType, angle: number): {
|
|
41
42
|
x: number;
|
|
42
43
|
y: number;
|
|
@@ -49,6 +50,8 @@ export declare function getRectScaleed(rect: IRectType, scale: [number, number])
|
|
|
49
50
|
w: number;
|
|
50
51
|
h: number;
|
|
51
52
|
};
|
|
53
|
+
export declare function getScalePoints(points: Vec2d[], originPos: Vec2d, scale: [number, number]): Vec2d[];
|
|
54
|
+
export declare function getRotatePoints(points: Vec2d[], originPos: Vec2d, angle: number): Vec2d[];
|
|
52
55
|
export declare function rotatePoints(points: number[], originPos: [number, number], angle: number): void;
|
|
53
56
|
export declare function scalePoints(points: number[], originPos: [number, number], scale: [number, number]): void;
|
|
54
57
|
export declare function getNodeRect(key: string, layer?: Group, safeBorderPadding?: number): IRectType | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Group, Node, Path } from "spritejs";
|
|
2
|
-
import {
|
|
2
|
+
import { BaseNodeMapItem } from "../types";
|
|
3
3
|
export declare const isSealedGroup: (group: Group | Path | Node) => boolean;
|
|
4
|
-
export declare const isRenderNode: (
|
|
4
|
+
export declare const isRenderNode: (param: Pick<BaseNodeMapItem, 'isHid'>) => boolean;
|
|
@@ -82,5 +82,5 @@ export declare abstract class LocalWork {
|
|
|
82
82
|
setToolsOpt(opt: IActiveToolsDataType): void;
|
|
83
83
|
clearWorkShapeNodeCache(workId: IworkId): void;
|
|
84
84
|
clearAllWorkShapesCache(): void;
|
|
85
|
-
setFullWork(data: Pick<IWorkerMessage, 'workId' | 'opt' | 'toolsType'>): BaseShapeTool | import("../tools/
|
|
85
|
+
setFullWork(data: Pick<IWorkerMessage, 'workId' | 'opt' | 'toolsType'>): BaseShapeTool | import("../tools/straight").StraightShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools").LaserPenShape | undefined;
|
|
86
86
|
}
|
|
@@ -5,7 +5,7 @@ import { LocalWork, ISubWorkerInitOption } from "./base";
|
|
|
5
5
|
export declare class LocalWorkForSubWorker extends LocalWork {
|
|
6
6
|
protected combineDrawTimer?: number;
|
|
7
7
|
constructor(opt: ISubWorkerInitOption);
|
|
8
|
-
runFullWork(data: IWorkerMessage
|
|
8
|
+
runFullWork(data: IWorkerMessage): Promise<IRectType | undefined>;
|
|
9
9
|
runSelectWork(data: IWorkerMessage): undefined;
|
|
10
10
|
consumeDraw(data: IWorkerMessage): IMainMessage | undefined;
|
|
11
11
|
consumeDrawAll(data: IWorkerMessage): undefined;
|
|
@@ -66,7 +66,6 @@ export declare class WorkThreadEngineForSubWorker extends WorkThreadEngineBase {
|
|
|
66
66
|
private updateCamera;
|
|
67
67
|
setCameraOpt(cameraOpt: ICameraOpt, layer?: Group): void;
|
|
68
68
|
private getSnapshot;
|
|
69
|
-
private willRenderSpecialLabel;
|
|
70
69
|
private getSnapshotRender;
|
|
71
70
|
private getBoundingRect;
|
|
72
71
|
}
|