@netless/appliance-plugin 1.1.17-beta.9 → 1.1.18-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +192 -54
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-BXw0UY.js +500 -0
- package/cdn/subWorker-CQwRsl.js +500 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/collector/collector.d.ts +1 -0
- package/dist/component/textEditor/manager.d.ts +8 -0
- package/dist/component/textEditor/view.d.ts +27 -47
- package/dist/core/mainEngine.d.ts +3 -1
- package/dist/core/tools/selector.d.ts +29 -0
- package/dist/core/types.d.ts +1 -0
- package/dist/core/worker/base.d.ts +5 -0
- package/dist/core/worker/fullWorkerLocal.d.ts +0 -1
- package/dist/core/worker/subWorkerLocal.d.ts +1 -0
- package/dist/cursors/index.d.ts +0 -4
- package/dist/displayer/const.d.ts +1 -0
- package/dist/displayer/floatBar/dragBox/index.d.ts +7 -1
- package/dist/displayer/floatBar/index.d.ts +1 -1
- package/dist/displayer/utils.d.ts +1 -0
- package/dist/fullWorker.js +120 -122
- package/dist/index-BCsxqk2v.js +1 -0
- package/dist/{index-BianYC4r.mjs → index-C5FDT_Kb.mjs} +10 -3
- package/dist/{index-CZ7SSEYU.mjs → index-CR2nlCh1.mjs} +7392 -7063
- package/dist/index-DNughIC2.js +1 -0
- package/dist/plugin/baseApplianceManager.d.ts +8 -5
- package/dist/plugin/baseViewContainerManager.d.ts +6 -2
- package/dist/plugin/const.d.ts +5 -0
- package/dist/plugin/displayerView.d.ts +9 -2
- package/dist/plugin/types.d.ts +39 -6
- package/dist/style.css +1 -1
- package/dist/subWorker.js +120 -122
- package/package.json +5 -4
- package/cdn/fullWorker-p8Ghqw.js +0 -502
- package/cdn/subWorker-C1Gs0N.js +0 -502
- package/dist/collector/eventCollector.d.ts +0 -31
- package/dist/collector/magixEventCollector.d.ts +0 -31
- package/dist/index-BSGcWUci.js +0 -1
- package/dist/index-DDtbIS6S.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-DNughIC2.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 { B as s, A as p, x as r, w as t, v as l, Q as n, G as i, b as y, F as E, j as o, l as T, N as g, c as u, O as v, K as c, y as S, a as A, J as P, h as k, H as m, E as M, L as W, I as h, P as w, z as x, s as F, u as I } from "./index-
|
|
1
|
+
import { B as s, A as p, x as r, w as t, v as l, Q as n, G as i, b as y, F as E, j as o, l as T, N as g, c as u, O as v, K as c, y as S, a as A, J as P, h as k, H as m, E as M, L as W, I as h, P as w, z as x, s as F, u as I } from "./index-CR2nlCh1.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as ActiveContainerType,
|
|
4
4
|
p as ApplianceMultiPlugin,
|
|
@@ -27,6 +27,7 @@ export declare class Collector extends BaseCollector<ISerializableStorageViewDat
|
|
|
27
27
|
getScenePathData(scenePath: string): ISerializableStorageData | undefined;
|
|
28
28
|
getStorageData(viewId: string, scenePath: string): ISerializableStorageData | undefined;
|
|
29
29
|
hasSelector(viewId: string, scenePath: string): boolean;
|
|
30
|
+
hasIncludeSelector(targetKey: string, targetViewId?: string, targetScenePath?: string): boolean;
|
|
30
31
|
addStorageStateListener(callBack: (diff: Diff) => void): void;
|
|
31
32
|
removeStorageStateListener(): void;
|
|
32
33
|
private diffFunByView;
|
|
@@ -3,11 +3,13 @@ import { BaseSubWorkModuleProps } from "../../plugin/types";
|
|
|
3
3
|
import { ICameraOpt, IWorkerMessage } from "../../core";
|
|
4
4
|
import type EventEmitter2 from "eventemitter2";
|
|
5
5
|
import { BaseApplianceManager } from "../../plugin/baseApplianceManager";
|
|
6
|
+
import { WorkId } from "../../collector/types";
|
|
6
7
|
export interface TextEditorManager {
|
|
7
8
|
readonly internalMsgEmitter: EventEmitter2;
|
|
8
9
|
readonly publicMsgEmitter: EventEmitter2;
|
|
9
10
|
readonly control: BaseApplianceManager;
|
|
10
11
|
editors: Map<string, TextEditorInfo>;
|
|
12
|
+
/** 当前激活的文本编辑器 */
|
|
11
13
|
activeId?: string;
|
|
12
14
|
/** 通过view组建中更新文本 */
|
|
13
15
|
updateForViewEdited(activeId?: string, info?: TextEditorInfo): void;
|
|
@@ -65,6 +67,10 @@ export interface TextEditorManager {
|
|
|
65
67
|
onServiceDerive(data: IWorkerMessage): void;
|
|
66
68
|
/** 监听camera变化 */
|
|
67
69
|
onCameraChange(cameraOpt: ICameraOpt, viewId: string): void;
|
|
70
|
+
/** 插入文本 */
|
|
71
|
+
insertText(viewId: string, x: number, y: number, textContent: string): WorkId | undefined;
|
|
72
|
+
/** 更新指定文本 */
|
|
73
|
+
updateText(workId: WorkId, textContent: string): void;
|
|
68
74
|
}
|
|
69
75
|
export declare class TextEditorManagerImpl implements TextEditorManager {
|
|
70
76
|
readonly internalMsgEmitter: EventEmitter2;
|
|
@@ -116,4 +122,6 @@ export declare class TextEditorManagerImpl implements TextEditorManager {
|
|
|
116
122
|
deleteBatch(workIds: string[], canSync?: boolean | undefined, canWorker?: boolean | undefined): void;
|
|
117
123
|
clear(viewId: string, justLocal?: boolean): void;
|
|
118
124
|
destory(): void;
|
|
125
|
+
insertText(viewId: string, x: number, y: number, textContent: string): WorkId | undefined;
|
|
126
|
+
updateText(workId: WorkId, textContent: string): void;
|
|
119
127
|
}
|
|
@@ -1,73 +1,53 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { TextEditorInfo, TextOptions } from "./types";
|
|
3
|
-
import {
|
|
4
|
-
export
|
|
5
|
-
export interface TextSelectorManagerProps {
|
|
6
|
-
selectIds: string[];
|
|
3
|
+
import { EmitEventType } from "../../plugin/types";
|
|
4
|
+
export interface TextManagerProps {
|
|
7
5
|
className?: string;
|
|
8
6
|
editors?: Map<string, TextEditorInfo>;
|
|
9
|
-
|
|
7
|
+
selectIds?: string[];
|
|
10
8
|
box?: {
|
|
11
9
|
x: number;
|
|
12
10
|
y: number;
|
|
13
11
|
w: number;
|
|
14
12
|
h: number;
|
|
15
13
|
};
|
|
16
|
-
manager: ApplianceViewManagerLike;
|
|
17
14
|
showFloatBtns?: boolean;
|
|
18
15
|
operationType?: EmitEventType;
|
|
16
|
+
rightBoundBreak?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface TextSelectorManagerProps extends TextManagerProps {
|
|
19
|
+
handleTextEditorPointerDown: (workId: string) => void;
|
|
20
|
+
handleTextEditorPointerUp: () => void;
|
|
19
21
|
}
|
|
20
22
|
export interface TextViewProps {
|
|
21
23
|
workId: string;
|
|
22
24
|
data: TextEditorInfo;
|
|
23
|
-
isSelect?: boolean;
|
|
24
|
-
isActive?: boolean;
|
|
25
|
-
manager: ApplianceViewManagerLike;
|
|
26
25
|
}
|
|
27
26
|
export interface TextSelectorViewProps extends TextViewProps {
|
|
28
|
-
left: string;
|
|
29
|
-
top: string;
|
|
30
|
-
selectIds?: string[];
|
|
31
27
|
updateOptInfo: (param: {
|
|
32
28
|
activeTextId: string;
|
|
33
29
|
update: Partial<TextOptions>;
|
|
34
30
|
syncData?: Pick<TextEditorInfo, 'canSync' | 'canWorker'>;
|
|
35
31
|
}) => void;
|
|
32
|
+
handlePointerDown: (workId: string) => void;
|
|
33
|
+
handlePointerUp: () => void;
|
|
36
34
|
}
|
|
37
35
|
export interface TextEditorProps extends TextViewProps {
|
|
38
36
|
showFloatBtns: boolean;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
update: Partial<TextOptions>;
|
|
45
|
-
syncData?: Pick<TextEditorInfo, 'canSync' | 'canWorker'>;
|
|
46
|
-
}) => void;
|
|
47
|
-
}
|
|
48
|
-
export declare const TextView: (props: TextViewProps) => React.JSX.Element;
|
|
49
|
-
export declare const TextSelectorView: React.MemoExoticComponent<(props: TextSelectorViewProps) => React.JSX.Element>;
|
|
50
|
-
export declare const TextEditor: (props: TextEditorProps) => React.JSX.Element;
|
|
51
|
-
export declare class TextViewInSelector extends React.Component<TextSelectorManagerProps, {
|
|
52
|
-
hasEditor: boolean;
|
|
53
|
-
}> {
|
|
54
|
-
constructor(props: TextSelectorManagerProps);
|
|
55
|
-
getInnerText(target: HTMLDivElement): string[];
|
|
56
|
-
updateOptInfo(param: {
|
|
57
|
-
activeTextId: string;
|
|
58
|
-
update: Partial<TextOptions>;
|
|
59
|
-
syncData?: Pick<TextEditorInfo, 'canSync' | 'canWorker'>;
|
|
60
|
-
}): void;
|
|
61
|
-
get editorUI(): JSX.Element[] | null;
|
|
62
|
-
render(): React.JSX.Element;
|
|
63
|
-
}
|
|
64
|
-
export declare class TextEditorContainer extends TextViewInSelector {
|
|
65
|
-
ref: React.RefObject<HTMLDivElement> | undefined;
|
|
66
|
-
isRunAnimation?: number;
|
|
67
|
-
constructor(props: TextSelectorManagerProps);
|
|
68
|
-
runAnimation(): void;
|
|
69
|
-
handleKeyUp(e: any): void;
|
|
70
|
-
handleFocus(e: any): void;
|
|
71
|
-
get editorUI(): JSX.Element[] | null;
|
|
72
|
-
render(): React.JSX.Element;
|
|
37
|
+
rightBoundBreak: boolean;
|
|
38
|
+
handleKeyUp: (div: HTMLDivElement) => void;
|
|
39
|
+
handleFocus: (div: HTMLDivElement) => void;
|
|
40
|
+
runAnimation: (callback?: () => void) => void;
|
|
41
|
+
updateSize: (updateId: string, boxSize: [number, number]) => void;
|
|
73
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* 文本编辑器类型
|
|
45
|
+
* hover: 当前文本被当前用户获焦中
|
|
46
|
+
* editing: 当前文本编辑中(被其他用户编辑中)
|
|
47
|
+
* active: 当前文本可编辑状态被激活(暂无用户编辑)
|
|
48
|
+
* none: 无状态
|
|
49
|
+
*/
|
|
50
|
+
export type TextEditorType = "hover" | "editing" | "active" | "none";
|
|
51
|
+
export declare const TextSelectorView: (props: TextSelectorViewProps) => React.JSX.Element;
|
|
52
|
+
export declare const TextViewInSelector: (props: TextSelectorManagerProps) => React.JSX.Element;
|
|
53
|
+
export declare const TextEditorContainer: (props: TextManagerProps) => React.JSX.Element;
|
|
@@ -10,6 +10,8 @@ import { BaseShapeOptions } from "./tools";
|
|
|
10
10
|
export declare abstract class MasterController {
|
|
11
11
|
/** 异步同步时间间隔 */
|
|
12
12
|
maxLastSyncTime: number;
|
|
13
|
+
/** 合并绘制时间间隔 */
|
|
14
|
+
combineUnitTime: number;
|
|
13
15
|
/** 插件管理器 */
|
|
14
16
|
readonly abstract control: BaseApplianceManager;
|
|
15
17
|
readonly abstract internalMsgEmitter: EventEmitter2;
|
|
@@ -40,7 +42,7 @@ export declare abstract class MasterController {
|
|
|
40
42
|
/** 获取当前激活的工作任务id */
|
|
41
43
|
protected getWorkId(): IworkId | undefined;
|
|
42
44
|
/** 获取当前work的工作状态 */
|
|
43
|
-
|
|
45
|
+
get workState(): EvevtWorkState;
|
|
44
46
|
/** 用于接收服务端同步的数据 */
|
|
45
47
|
abstract onServiceDerive(key: string, data: DiffOneData<BaseCollectorReducerAction | undefined>): void;
|
|
46
48
|
/** 消费批处理池数据 */
|
|
@@ -41,6 +41,7 @@ export declare class SelectorShape extends BaseShapeTool {
|
|
|
41
41
|
getChildrenPoints(): [number, number][] | undefined;
|
|
42
42
|
consume(props: {
|
|
43
43
|
data: IWorkerMessage;
|
|
44
|
+
isSubWorker?: boolean;
|
|
44
45
|
}): {
|
|
45
46
|
type: EPostMessageType;
|
|
46
47
|
} | {
|
|
@@ -98,6 +99,34 @@ export declare class SelectorShape extends BaseShapeTool {
|
|
|
98
99
|
type: EPostMessageType;
|
|
99
100
|
};
|
|
100
101
|
consumeService(): undefined;
|
|
102
|
+
private updateTempPointsForSubWorker;
|
|
103
|
+
private computDrawPoints;
|
|
104
|
+
private drawForSubWorker;
|
|
105
|
+
private transformData;
|
|
106
|
+
subWorkerConsume(props: {
|
|
107
|
+
data: IWorkerMessage;
|
|
108
|
+
isFullWork?: boolean;
|
|
109
|
+
}): {
|
|
110
|
+
type: EPostMessageType;
|
|
111
|
+
} | {
|
|
112
|
+
workId: string;
|
|
113
|
+
toolsType: EToolsKey;
|
|
114
|
+
opt: import("./utils").ShapeOptions;
|
|
115
|
+
rect: IRectType | undefined;
|
|
116
|
+
type: EPostMessageType;
|
|
117
|
+
dataType: EDataType;
|
|
118
|
+
};
|
|
119
|
+
subWorkerConsumeAll(props: {
|
|
120
|
+
data: IWorkerMessage;
|
|
121
|
+
isFullWork?: boolean;
|
|
122
|
+
}): {
|
|
123
|
+
workId: string;
|
|
124
|
+
toolsType: EToolsKey;
|
|
125
|
+
opt: import("./utils").ShapeOptions;
|
|
126
|
+
rect: IRectType | undefined;
|
|
127
|
+
type: EPostMessageType;
|
|
128
|
+
dataType: EDataType;
|
|
129
|
+
};
|
|
101
130
|
clearTmpPoints(): void;
|
|
102
131
|
clearSelectData(): void;
|
|
103
132
|
private selectSingleTool;
|
package/dist/core/types.d.ts
CHANGED
|
@@ -244,6 +244,7 @@ export interface IUpdateSelectorCallbackPropsType {
|
|
|
244
244
|
export interface IActiveToolsDataType {
|
|
245
245
|
toolsType: EToolsKey;
|
|
246
246
|
toolsOpt: ShapeOptions;
|
|
247
|
+
combineUnitTime?: number;
|
|
247
248
|
}
|
|
248
249
|
export interface IActiveWorkDataType {
|
|
249
250
|
workState: EvevtWorkState;
|
|
@@ -12,6 +12,8 @@ export interface IWorkerInitOption {
|
|
|
12
12
|
dpr: number;
|
|
13
13
|
offscreenCanvasOpt: IOffscreenCanvasOptionType;
|
|
14
14
|
layerOpt: ILayerOptionType;
|
|
15
|
+
combineUnitTime?: number;
|
|
16
|
+
syncUnitTime?: number;
|
|
15
17
|
}
|
|
16
18
|
export interface ISubWorkerInitOption {
|
|
17
19
|
thread: WorkThreadEngineForFullWorker | WorkThreadEngineForSubWorker;
|
|
@@ -101,6 +103,9 @@ export declare abstract class LocalWork {
|
|
|
101
103
|
protected drawCount: number;
|
|
102
104
|
protected consumeCount: number;
|
|
103
105
|
protected syncUnitTime: number;
|
|
106
|
+
protected combineUnitTime: number;
|
|
107
|
+
setCombineUnitTime(combineUnitTime: number): void;
|
|
108
|
+
setSyncUnitTime(syncUnitTime: number): void;
|
|
104
109
|
constructor(opt: ISubWorkerInitOption);
|
|
105
110
|
destroy(): void;
|
|
106
111
|
getWorkShapes(): Map<string, BaseShapeTool>;
|
|
@@ -4,7 +4,6 @@ import { ISubWorkerInitOption, LocalWork } from "./base";
|
|
|
4
4
|
import { ServiceWorkForFullWorker } from "./fullWorkerService";
|
|
5
5
|
import { WorkThreadEngineForFullWorker } from "./workerManager";
|
|
6
6
|
export declare class LocalWorkForFullWorker extends LocalWork {
|
|
7
|
-
private combineUnitTime;
|
|
8
7
|
private combineTimerId?;
|
|
9
8
|
private combineDrawResolve?;
|
|
10
9
|
private combineDrawActiveId?;
|
package/dist/cursors/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EventMessageType, EvevtWorkState, IMainMessage } from "../core";
|
|
2
|
-
import { EventCollector } from "../collector/eventCollector";
|
|
3
2
|
import { BaseSubWorkModuleProps, Displayer, RoomMember } from "../plugin/types";
|
|
4
3
|
import { MemberDiff, RoomMemberManager } from "../members";
|
|
5
4
|
import type { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
@@ -39,8 +38,6 @@ export declare abstract class CursorManager {
|
|
|
39
38
|
abstract readonly internalMsgEmitter: EventEmitter2;
|
|
40
39
|
/** 插件管理器 */
|
|
41
40
|
abstract readonly control: BaseApplianceManager;
|
|
42
|
-
/** 事件收集器 */
|
|
43
|
-
abstract eventCollector?: EventCollector;
|
|
44
41
|
/** 房间成员管理器 */
|
|
45
42
|
abstract readonly roomMember: RoomMemberManager;
|
|
46
43
|
/** 激活事件收集器 */
|
|
@@ -79,7 +76,6 @@ export declare class CursorManagerImpl implements CursorManager {
|
|
|
79
76
|
private cursorInfoMap;
|
|
80
77
|
private doneRenderCursorInfoMap;
|
|
81
78
|
constructor(props: BaseSubWorkModuleProps);
|
|
82
|
-
eventCollector?: EventCollector | undefined;
|
|
83
79
|
activeCollector(): void;
|
|
84
80
|
private mainMagixEventListener;
|
|
85
81
|
onFocusViewChange(): void;
|
|
@@ -9,3 +9,4 @@ export declare const BarPadding: Margin;
|
|
|
9
9
|
export declare const BarMargin: Margin;
|
|
10
10
|
export declare const FontSizeList: readonly number[];
|
|
11
11
|
export declare const SpeechBalloonPlacements: SpeechBalloonPlacement[];
|
|
12
|
+
export declare const DefaultCursorIconMap: Map<string, string>;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { TextEditorInfo } from "../../../component/textEditor/types";
|
|
3
|
+
export type PositionType = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
2
7
|
export declare const DraggableBox: (props: {
|
|
3
|
-
|
|
8
|
+
editors?: Map<string, TextEditorInfo>;
|
|
9
|
+
canSelectorSwitch: boolean;
|
|
4
10
|
}) => React.JSX.Element;
|
|
@@ -3,5 +3,5 @@ import { TextEditorInfo } from "../../component/textEditor";
|
|
|
3
3
|
export declare const FloatBar: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
4
4
|
isHide: boolean;
|
|
5
5
|
editors?: Map<string, TextEditorInfo>;
|
|
6
|
-
|
|
6
|
+
canSelectorSwitch: boolean;
|
|
7
7
|
} & React.RefAttributes<HTMLDivElement>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stopPropagationFunc: (e: React.PointerEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>) => void;
|