@netless/appliance-plugin 1.1.0-beta.1 → 1.1.0-hotfix.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 +5 -5
- package/cdn/cdn.js +1 -1
- package/cdn/{fullWorker-CjGKnN.js → fullWorker-BHRyQO.js} +26 -26
- package/cdn/{subWorker-DUJqv_.js → subWorker-CLSA7o.js} +26 -26
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/collector/base.d.ts +3 -0
- package/dist/collector/collector.d.ts +18 -1
- package/dist/collector/enum.d.ts +0 -3
- package/dist/collector/eventCollector.d.ts +1 -0
- package/dist/collector/magixEventCollector.d.ts +1 -0
- package/dist/collector/types.d.ts +61 -12
- package/dist/core/enum.d.ts +9 -1
- package/dist/core/mainEngine.d.ts +11 -10
- package/dist/core/renderCotrol.d.ts +121 -0
- package/dist/core/tools/eraser.d.ts +1 -1
- package/dist/core/tools/pencilEraser.d.ts +1 -1
- package/dist/core/types.d.ts +3 -1
- package/dist/core/utils/spriteNode.d.ts +0 -2
- package/dist/core/vNodeManager.d.ts +11 -3
- package/dist/core/worker/base.d.ts +3 -2
- package/dist/fullWorker.js +26 -26
- package/dist/index-BWmduyVA.js +1 -0
- package/dist/index-CF4Y05EO.js +1 -0
- package/dist/{index-C4KNxHht.mjs → index-Cu_CC99v.mjs} +314 -283
- package/dist/index-o7o698HO.mjs +14959 -0
- package/dist/members/index.d.ts +1 -0
- package/dist/plugin/baseApplianceManager.d.ts +11 -2
- package/dist/plugin/const.d.ts +0 -4
- package/dist/plugin/types.d.ts +8 -1
- package/dist/style.css +1 -1
- package/dist/subWorker.js +26 -26
- package/package.json +2 -2
- package/dist/index-C29o_HLi.js +0 -1
- package/dist/index-CIJP6_Qj.mjs +0 -14190
- package/dist/index-DmfRoAiB.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-CF4Y05EO.js");exports.ActiveContainerType=e.ActiveContainerType;exports.ApplianceMultiPlugin=e.ApplianceMultiPlugin;exports.ApplianceNames=e.ApplianceNames;exports.ApplianceSigleWrapper=e.ApplianceSigleWrapper;exports.ApplianceSinglePlugin=e.ApplianceSinglePlugin;exports.ECanvasContextType=e.ECanvasContextType;exports.ECanvasShowType=e.ECanvasShowType;exports.EDataType=e.EDataType;exports.EMatrixrRelationType=e.EMatrixrRelationType;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.EvevtWorkType=e.EvevtWorkType;exports.InternalMsgEmitterType=e.InternalMsgEmitterType;exports.ShapeType=e.ShapeType;exports.fullWorkerUrl=e.fullWorker;exports.subWorkerUrl=e.subWorker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as s, A as p, F as t, B as r, z as l, s as n, K as y, h as E, r as i, k as T, O as o, G as v, E as g, N as S, p as c, L as k, a as A, P as u, I as M, H as W, x as m, y as x } from "./index-o7o698HO.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as ActiveContainerType,
|
|
4
4
|
p as ApplianceMultiPlugin,
|
package/dist/collector/base.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { AppliancePluginLike } from "../plugin/types";
|
|
2
2
|
import { IworkId } from "../core";
|
|
3
3
|
import { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
4
|
+
import { ISerializableAuthData } from "./types";
|
|
4
5
|
export declare abstract class BaseCollector<T> {
|
|
5
6
|
plugin: AppliancePluginLike;
|
|
6
7
|
uid: string;
|
|
7
8
|
abstract serviceStorage: T;
|
|
8
9
|
abstract storage: T;
|
|
9
10
|
protected abstract namespace: string;
|
|
11
|
+
protected abstract authSpace: string;
|
|
10
12
|
readonly control: BaseApplianceManager;
|
|
11
13
|
constructor(control: BaseApplianceManager, plugin: AppliancePluginLike);
|
|
12
14
|
getNamespaceData(): T;
|
|
15
|
+
getAuthSpaceData(): ISerializableAuthData;
|
|
13
16
|
getUidFromKey(key: string): string;
|
|
14
17
|
isLocalId(key: string): boolean;
|
|
15
18
|
getLocalId(key: string): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EPostMessageType } from "../core/enum";
|
|
2
|
+
import { AuthWriteData, BaseCollectorReducerAction, Diff, DiffAuthPage, DiffAuthRender, ISerializableAuthData, ISerializableAuthRenderItemType, ISerializableStorageData, ISerializableStorageRenderScenesData, ISerializableStorageViewData, ViewId } from "./types";
|
|
2
3
|
import { BaseCollector } from "./base";
|
|
3
4
|
import type { AppliancePluginLike } from "../plugin/types";
|
|
4
5
|
import { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
@@ -6,12 +7,16 @@ import { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
|
6
7
|
* 服务端事件/状态同步收集器
|
|
7
8
|
*/
|
|
8
9
|
export declare class Collector extends BaseCollector<ISerializableStorageViewData> {
|
|
10
|
+
protected authSpace: string;
|
|
9
11
|
protected namespace: string;
|
|
10
12
|
static namespace: string;
|
|
13
|
+
static authSpace: string;
|
|
11
14
|
static syncInterval: number;
|
|
12
15
|
serviceStorage: ISerializableStorageViewData;
|
|
13
16
|
storage: ISerializableStorageViewData;
|
|
17
|
+
authStorage: ISerializableAuthData;
|
|
14
18
|
private stateDisposer;
|
|
19
|
+
private authDisposer;
|
|
15
20
|
private asyncClockState;
|
|
16
21
|
constructor(control: BaseApplianceManager, plugin: AppliancePluginLike, syncInterval?: number);
|
|
17
22
|
getViewIdBySecenPath(scenePath: string): string | undefined;
|
|
@@ -51,4 +56,16 @@ export declare class Collector extends BaseCollector<ISerializableStorageViewDat
|
|
|
51
56
|
private syncStorageKey;
|
|
52
57
|
keyTransformWorkId(key: string): string;
|
|
53
58
|
destroy(): void;
|
|
59
|
+
setAuth(auth: Partial<ISerializableAuthData>, isSync: boolean): void;
|
|
60
|
+
dispatchAuth(action: {
|
|
61
|
+
type: EPostMessageType.AuthWriter | EPostMessageType.AuthReader | EPostMessageType.AuthPage;
|
|
62
|
+
viewId?: ViewId;
|
|
63
|
+
writeData?: AuthWriteData;
|
|
64
|
+
renderData?: ISerializableAuthRenderItemType;
|
|
65
|
+
pageData?: ISerializableStorageRenderScenesData;
|
|
66
|
+
}, isSync?: boolean): void;
|
|
67
|
+
addAuthStateListener(callBack: (diffAuthRender?: DiffAuthRender, diffAuthPage?: DiffAuthPage) => void): void;
|
|
68
|
+
removeAuthStateListener(): void;
|
|
69
|
+
private diffAuthFun;
|
|
70
|
+
private diffAuthPageFun;
|
|
54
71
|
}
|
package/dist/collector/enum.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
|
6
6
|
* 服务端事件/状态同步收集器
|
|
7
7
|
*/
|
|
8
8
|
export declare class EventCollector extends BaseCollector<ISerializableEventData> {
|
|
9
|
+
protected authSpace: string;
|
|
9
10
|
static syncInterval: number;
|
|
10
11
|
static namespace: string;
|
|
11
12
|
serviceStorage: ISerializableEventData;
|
|
@@ -6,6 +6,7 @@ import { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
|
6
6
|
* 服务端事件/状态同步收集器
|
|
7
7
|
*/
|
|
8
8
|
export declare class magixEventCollector extends BaseCollector<ISerializableEventData> {
|
|
9
|
+
protected authSpace: string;
|
|
9
10
|
static syncInterval: number;
|
|
10
11
|
static namespace: string;
|
|
11
12
|
serviceStorage: ISerializableEventData;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { EPostMessageType, EToolsKey, EventMessageType } from "../core/enum";
|
|
2
2
|
import { ShapeOptions } from "../core/tools";
|
|
3
3
|
import { IUpdateNodeOpt, IworkId } from "../core/types";
|
|
4
|
-
import { EmitEventType } from "../plugin/types";
|
|
5
|
-
import { EEventDataKey } from "./enum";
|
|
4
|
+
import { EmitEventType, _ArrayTrue } from "../plugin/types";
|
|
6
5
|
export declare type DiffOneView<ISerializableStorageViewData> = {
|
|
7
6
|
oldValue?: ISerializableStorageViewData;
|
|
8
7
|
newValue?: ISerializableStorageViewData;
|
|
@@ -32,12 +31,6 @@ export declare type Diff = {
|
|
|
32
31
|
diffScenePath?: DiffScenePath<ISerializableStorageScenePathData>;
|
|
33
32
|
diffView?: DiffView<ISerializableStorageViewData>;
|
|
34
33
|
};
|
|
35
|
-
export type SyncEventData = {
|
|
36
|
-
[key in EEventDataKey]: {
|
|
37
|
-
workId?: number;
|
|
38
|
-
key: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
34
|
export type IStorageValueItem = Partial<INormalPushMsg>;
|
|
42
35
|
export interface INormalPushMsg {
|
|
43
36
|
workId?: IworkId;
|
|
@@ -69,6 +62,11 @@ export type BaseCollectorReducerAction = INormalPushMsg & Pick<INormalPushMsg, '
|
|
|
69
62
|
export interface ISerializableStorageData {
|
|
70
63
|
[key: string]: BaseCollectorReducerAction | undefined;
|
|
71
64
|
}
|
|
65
|
+
export type PageId = string;
|
|
66
|
+
export type ViewId = string;
|
|
67
|
+
export type WorkId = string;
|
|
68
|
+
export type ScenePath = string;
|
|
69
|
+
export type Uid = string | 'localSelf';
|
|
72
70
|
export interface BaseEventCollectorReducerAction {
|
|
73
71
|
type?: EventMessageType;
|
|
74
72
|
uid?: string;
|
|
@@ -76,14 +74,65 @@ export interface BaseEventCollectorReducerAction {
|
|
|
76
74
|
op?: Array<number | undefined>;
|
|
77
75
|
isHide?: boolean;
|
|
78
76
|
isSync?: boolean;
|
|
79
|
-
viewId?:
|
|
77
|
+
viewId?: ViewId;
|
|
80
78
|
}
|
|
81
79
|
export interface ISerializableEventData {
|
|
82
|
-
[key:
|
|
80
|
+
[key: WorkId]: Array<BaseEventCollectorReducerAction | undefined> | undefined;
|
|
83
81
|
}
|
|
84
82
|
export interface ISerializableStorageViewData {
|
|
85
|
-
[key:
|
|
83
|
+
[key: ViewId]: ISerializableStorageScenePathData;
|
|
86
84
|
}
|
|
87
85
|
export interface ISerializableStorageScenePathData {
|
|
88
|
-
[key:
|
|
86
|
+
[key: ScenePath]: ISerializableStorageData;
|
|
89
87
|
}
|
|
88
|
+
export type ISerializableAuthRenderItemType = {
|
|
89
|
+
/** 可读用户组, 如果是true, 则为所有用户笔记可渲染 */
|
|
90
|
+
render?: _ArrayTrue<Uid>;
|
|
91
|
+
/** 可隐藏用户组 如果是true, 则为所有用户笔记可隐藏 */
|
|
92
|
+
hide?: _ArrayTrue<Uid>;
|
|
93
|
+
/** 可移除笔记用户组 如果是true, 则为所有用户笔记可移除 */
|
|
94
|
+
clear?: _ArrayTrue<Uid>;
|
|
95
|
+
};
|
|
96
|
+
export type ISerializableAuthRenderDataType = {
|
|
97
|
+
[key: ViewId]: ISerializableAuthRenderItemType;
|
|
98
|
+
};
|
|
99
|
+
export type ISerializableAuthData = {
|
|
100
|
+
/** 可写用户组, 如果是true, 则为所有用户可写 */
|
|
101
|
+
writable?: _ArrayTrue<Uid>;
|
|
102
|
+
/** 只读用户组, 如果是true, 则为所有用户可读 */
|
|
103
|
+
readOnly?: _ArrayTrue<Uid>;
|
|
104
|
+
/** viewid区分,用户显示笔记权限 */
|
|
105
|
+
renderAuth?: ISerializableAuthRenderDataType;
|
|
106
|
+
/** viewid区分,用户显示笔记权限 */
|
|
107
|
+
pageAuth?: ISerializableStorageRenderViewsData;
|
|
108
|
+
};
|
|
109
|
+
export type AuthWriteData = Pick<ISerializableAuthData, 'writable' | 'readOnly'>;
|
|
110
|
+
export type AuthWriteDatakey = keyof AuthWriteData;
|
|
111
|
+
export type ISerializableAuthRenderItemTypeKey = keyof ISerializableAuthRenderItemType;
|
|
112
|
+
export declare type DiffAuthRender = {
|
|
113
|
+
[K in keyof ISerializableAuthRenderDataType]?: DiffOneRender;
|
|
114
|
+
};
|
|
115
|
+
export declare type DiffOneRender = {
|
|
116
|
+
oldValue?: ISerializableAuthRenderItemType;
|
|
117
|
+
newValue?: ISerializableAuthRenderItemType;
|
|
118
|
+
};
|
|
119
|
+
export type ISerializableStorageRenderViewsData = {
|
|
120
|
+
[key: ViewId]: ISerializableStorageRenderScenesData;
|
|
121
|
+
};
|
|
122
|
+
export type ISerializableStorageRenderScenesData = {
|
|
123
|
+
[key: ScenePath]: ISerializableStorageRenderPagesData;
|
|
124
|
+
};
|
|
125
|
+
export type ISerializableStorageRenderPagesData = {
|
|
126
|
+
render: Uid;
|
|
127
|
+
pages: ISerializableStorageRenderElementIdsData;
|
|
128
|
+
};
|
|
129
|
+
export type ISerializableStorageRenderElementIdsData = {
|
|
130
|
+
[key: PageId]: Array<WorkId>;
|
|
131
|
+
};
|
|
132
|
+
export declare type DiffAuthPage = {
|
|
133
|
+
[K in keyof ISerializableStorageRenderViewsData]?: DiffOnePage;
|
|
134
|
+
};
|
|
135
|
+
export declare type DiffOnePage = {
|
|
136
|
+
oldValue?: ISerializableStorageRenderScenesData;
|
|
137
|
+
newValue?: ISerializableStorageRenderScenesData;
|
|
138
|
+
};
|
package/dist/core/enum.d.ts
CHANGED
|
@@ -105,7 +105,15 @@ export declare enum EPostMessageType {
|
|
|
105
105
|
/** 优先激活worker */
|
|
106
106
|
PriorityMainThreadWorker = 22,
|
|
107
107
|
/** 获取图片位图 */
|
|
108
|
-
GetImageBitMap = 23
|
|
108
|
+
GetImageBitMap = 23,
|
|
109
|
+
/** 授权可写权限 */
|
|
110
|
+
AuthWriter = 24,
|
|
111
|
+
/** 授权可显示笔记权限 */
|
|
112
|
+
AuthReader = 25,
|
|
113
|
+
/** 授权可以删除笔记权限 */
|
|
114
|
+
AuthClear = 26,
|
|
115
|
+
/** 授权可以操作page权限 */
|
|
116
|
+
AuthPage = 27
|
|
109
117
|
}
|
|
110
118
|
export declare enum ECanvasContextType {
|
|
111
119
|
Webgl2 = "webgl2",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import EventEmitter2 from "eventemitter2";
|
|
2
|
-
import { BaseCollectorReducerAction, DiffOneData } from "../collector";
|
|
2
|
+
import { BaseCollectorReducerAction, DiffOneData, Uid } from "../collector";
|
|
3
3
|
import { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
4
4
|
import { IActiveToolsDataType, IActiveWorkDataType, ICameraOpt, IMainMessage, IRectType, IUpdateNodeOpt, IWorkerMessage, IqueryTask, IworkId, ViewWorkerOptions } from "./types";
|
|
5
5
|
import { BaseSubWorkModuleProps } from "../plugin/types";
|
|
6
|
-
import type { ImageInformation, PriorityType } from "../plugin/types";
|
|
6
|
+
import type { ImageInformation, PriorityType, _SetTrue } from "../plugin/types";
|
|
7
7
|
import { MethodBuilderMain } from "./msgEvent";
|
|
8
8
|
import { EvevtWorkState } from "./enum";
|
|
9
9
|
import { BaseShapeOptions } from "./tools";
|
|
@@ -66,7 +66,7 @@ export declare abstract class MasterController {
|
|
|
66
66
|
/** 更新已有node配置 */
|
|
67
67
|
abstract updateNode(workId: IworkId, updateNodeOpt: IUpdateNodeOpt, viewId: string, scenePath: string): void;
|
|
68
68
|
/** 清空指定的view场景路径下的所有数据 */
|
|
69
|
-
abstract clearViewScenePath(viewId: string, justLocal?: boolean): Promise<void>;
|
|
69
|
+
abstract clearViewScenePath(viewId: string, justLocal?: boolean, isFiter?: boolean): Promise<void>;
|
|
70
70
|
/** 更新指定view场景路径下的相机参数 */
|
|
71
71
|
abstract updateCamera(viewId: string, cameraOpt: ICameraOpt): void;
|
|
72
72
|
/** 创建一个新的viewWorker */
|
|
@@ -78,9 +78,9 @@ export declare abstract class MasterController {
|
|
|
78
78
|
abstract getSnapshot(scenePath: string, width?: number, height?: number, camera?: Pick<ICameraOpt, "centerX" | "centerY" | "scale">): Promise<ImageBitmap> | undefined;
|
|
79
79
|
/** 根据查询条件查询事件任务处理批量池中任务 */
|
|
80
80
|
abstract queryTaskBatchData(query: IqueryTask): IWorkerMessage[];
|
|
81
|
-
abstract insertImage(imageInfo: ImageInformation): void;
|
|
82
|
-
abstract lockImage(uuid: string, locked: boolean): void;
|
|
83
|
-
abstract completeImageUpload(uuid: string, src: string): void;
|
|
81
|
+
abstract insertImage(viewId: string, imageInfo: ImageInformation): void;
|
|
82
|
+
abstract lockImage(viewId: string, uuid: string, locked: boolean): void;
|
|
83
|
+
abstract completeImageUpload(viewId: string, uuid: string, src: string): void;
|
|
84
84
|
abstract getImagesInformation(scenePath: string): ImageInformation[];
|
|
85
85
|
/** 移除正在绘制的流程 */
|
|
86
86
|
abstract removeDrawingWork(viewId: string): void;
|
|
@@ -198,7 +198,7 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
198
198
|
updateCamera(viewId: string, cameraOpt: ICameraOpt): void;
|
|
199
199
|
private updateCameraDone;
|
|
200
200
|
private consumeQueue;
|
|
201
|
-
clearViewScenePath(viewId: string, justLocal?: boolean | undefined): Promise<void>;
|
|
201
|
+
clearViewScenePath(viewId: string, justLocal?: boolean | undefined, isFiter?: boolean): Promise<void>;
|
|
202
202
|
private internalMsgEmitterListener;
|
|
203
203
|
private setZIndex;
|
|
204
204
|
checkDrawingWork(vId: string): void;
|
|
@@ -209,12 +209,13 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
209
209
|
getBoundingRect(scenePath: string): Promise<IRectType> | undefined;
|
|
210
210
|
getSnapshot(scenePath: string, width?: number, height?: number, camera?: Pick<ICameraOpt, "centerX" | "centerY" | "scale">): Promise<ImageBitmap> | undefined;
|
|
211
211
|
queryTaskBatchData(query: IqueryTask): IWorkerMessage[];
|
|
212
|
-
insertImage(imageInfo: ImageInformation): void;
|
|
213
|
-
lockImage(uuid: string, locked: boolean): void;
|
|
214
|
-
completeImageUpload(uuid: string, src: string): void;
|
|
212
|
+
insertImage(viewId: string, imageInfo: ImageInformation): void;
|
|
213
|
+
lockImage(viewId: string, uuid: string, locked: boolean): void;
|
|
214
|
+
completeImageUpload(viewId: string, uuid: string, src: string): void;
|
|
215
215
|
getImagesInformation(scenePath: string): ImageInformation[];
|
|
216
216
|
setShapeSelectorByWorkId(workId: string, viewId: string): void;
|
|
217
217
|
blurSelector(viewId: string, scenePath: string, workId?: string): void;
|
|
218
218
|
consoleWorkerInfo(): void;
|
|
219
219
|
setPriority(priority: PriorityType): void;
|
|
220
|
+
sendClearUids(viewId: string, clearUids?: _SetTrue<Uid>): void;
|
|
220
221
|
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { RoomMemberManager } from "../members";
|
|
2
|
+
import { ApplianceManagerLike, BaseSubWorkModuleProps, FilterPublishAutType, FilterRenderType, _ArrayTrue } from "../plugin/types";
|
|
3
|
+
import type { MasterControlForWorker } from "./mainEngine";
|
|
4
|
+
import { EPostMessageType } from "./enum";
|
|
5
|
+
import { ISerializableStorageRenderScenesData, PageId, ScenePath, Uid, ViewId, WorkId } from "../collector/types";
|
|
6
|
+
export interface RenderCotrol {
|
|
7
|
+
readonly roomMemberManager: RoomMemberManager;
|
|
8
|
+
readonly control: ApplianceManagerLike;
|
|
9
|
+
/** 监听本地可写权限变化 */
|
|
10
|
+
onSetWriteable(bool: boolean): void;
|
|
11
|
+
/** 发布可写权限到服务端 */
|
|
12
|
+
publishWriteAble(write: _ArrayTrue<Uid>, readOnly: _ArrayTrue<Uid>): void;
|
|
13
|
+
/** 发布当个用户可写权限到服务端 */
|
|
14
|
+
publishOneWriteAble(uid: Uid, type: FilterPublishAutType, isSync: boolean): void;
|
|
15
|
+
/** 本地发布可显示绘制权限到服务端 */
|
|
16
|
+
publishRender(param: {
|
|
17
|
+
viewId: Uid;
|
|
18
|
+
option: {
|
|
19
|
+
render?: _ArrayTrue<Uid>;
|
|
20
|
+
hide?: _ArrayTrue<Uid>;
|
|
21
|
+
clear?: _ArrayTrue<Uid>;
|
|
22
|
+
};
|
|
23
|
+
isSync: boolean;
|
|
24
|
+
}): void;
|
|
25
|
+
/** 发布当个用户显示绘制权限到服务端 */
|
|
26
|
+
publishOneRender(viewId: Uid, uid: Uid, type: FilterRenderType, isSync: boolean): void;
|
|
27
|
+
/** 发布当个用户删除笔记权限到服务端 */
|
|
28
|
+
publishOneClear(viewId: Uid, uid: Uid, isAdd: boolean, isSync: boolean): void;
|
|
29
|
+
/** 服务端同步可显示绘制权限 */
|
|
30
|
+
syncRenderUids(viewId: Uid, _render?: _ArrayTrue<Uid>, _hide?: _ArrayTrue<Uid>, _clear?: _ArrayTrue<Uid>): void;
|
|
31
|
+
/** 服务端同步可写权限 */
|
|
32
|
+
syncWriteable(writable?: _ArrayTrue<Uid>, readOnly?: _ArrayTrue<Uid>): void;
|
|
33
|
+
destoryByViewId(viewId: string): void;
|
|
34
|
+
}
|
|
35
|
+
export type AuthRenderViewsData = Map<ViewId, AuthRenderScenesData>;
|
|
36
|
+
export type AuthRenderScenesData = Map<ScenePath, AuthRenderSceneData>;
|
|
37
|
+
export type AuthRenderSceneData = {
|
|
38
|
+
render: Uid;
|
|
39
|
+
pages: AuthPagesData;
|
|
40
|
+
};
|
|
41
|
+
export type AuthPagesData = Map<PageId, Set<WorkId>>;
|
|
42
|
+
export declare class RenderCotrolImple implements RenderCotrol {
|
|
43
|
+
readonly control: ApplianceManagerLike;
|
|
44
|
+
readonly roomMemberManager: RoomMemberManager;
|
|
45
|
+
readonly worker: MasterControlForWorker;
|
|
46
|
+
private writeableUids;
|
|
47
|
+
private readonlyUids;
|
|
48
|
+
private renderUids;
|
|
49
|
+
private pageAuth;
|
|
50
|
+
private isCurWrite;
|
|
51
|
+
private isLocalRender;
|
|
52
|
+
constructor(props: BaseSubWorkModuleProps);
|
|
53
|
+
addPage(porps: {
|
|
54
|
+
viewId: ViewId;
|
|
55
|
+
pageId?: PageId;
|
|
56
|
+
render?: Uid;
|
|
57
|
+
elementIds?: Set<WorkId>;
|
|
58
|
+
}, isActive?: boolean): void;
|
|
59
|
+
delPage(pageId: string, viewId: string): void;
|
|
60
|
+
private delViewPage;
|
|
61
|
+
clearRenderPage(viewId: string, scenePath: string, isSync?: boolean): void;
|
|
62
|
+
hasPage(pageId: string, viewId: string, scenePath: string): boolean;
|
|
63
|
+
getPageInfo(pageId: string, viewId: string, scenePath: string): Set<string> | undefined;
|
|
64
|
+
addRenderPageElementId(porps: {
|
|
65
|
+
viewId: ViewId;
|
|
66
|
+
scenePath: string;
|
|
67
|
+
elementId: WorkId;
|
|
68
|
+
}, isSync?: boolean, isActive?: boolean): void;
|
|
69
|
+
delRenderPageElementId(porps: {
|
|
70
|
+
viewId: ViewId;
|
|
71
|
+
scenePath: string;
|
|
72
|
+
elementId: WorkId;
|
|
73
|
+
}, isSync?: boolean, isActive?: boolean): void;
|
|
74
|
+
setPageRender(viewId: string, scenePath: string, pageId: Uid, isSync?: boolean): void;
|
|
75
|
+
onSetWriteable(bool: boolean): void;
|
|
76
|
+
getCurWriteable(): boolean;
|
|
77
|
+
isWriteable(uid: Uid): boolean;
|
|
78
|
+
isRenderAble(param: {
|
|
79
|
+
uid: Uid;
|
|
80
|
+
viewId: string;
|
|
81
|
+
scenePath?: ScenePath;
|
|
82
|
+
filterLocalSelf?: boolean;
|
|
83
|
+
}): boolean;
|
|
84
|
+
isClearAble(param: {
|
|
85
|
+
uid: Uid;
|
|
86
|
+
viewId: Uid;
|
|
87
|
+
scenePath?: ScenePath;
|
|
88
|
+
filterLocalSelf?: boolean;
|
|
89
|
+
elementId?: WorkId;
|
|
90
|
+
}): boolean;
|
|
91
|
+
isFilterAble(param: {
|
|
92
|
+
viewId: string;
|
|
93
|
+
scenePath: ScenePath;
|
|
94
|
+
elementId: WorkId;
|
|
95
|
+
}, type?: EPostMessageType): boolean;
|
|
96
|
+
isFilterCursor(viewId: string): boolean;
|
|
97
|
+
isUsePageAuth(viewId: string): boolean;
|
|
98
|
+
publishWriteAble(writable?: _ArrayTrue<Uid>, readOnly?: _ArrayTrue<Uid>): void;
|
|
99
|
+
publishOneWriteAble(uid: Uid, type: FilterPublishAutType, isSync?: boolean): void;
|
|
100
|
+
publishRender(param: {
|
|
101
|
+
viewId: Uid;
|
|
102
|
+
option?: {
|
|
103
|
+
render?: _ArrayTrue<Uid>;
|
|
104
|
+
hide?: _ArrayTrue<Uid>;
|
|
105
|
+
clear?: _ArrayTrue<Uid>;
|
|
106
|
+
};
|
|
107
|
+
isSync: boolean;
|
|
108
|
+
}): void;
|
|
109
|
+
publishOneRender(viewId: Uid, uid: Uid, type: FilterRenderType, isSync?: boolean): void;
|
|
110
|
+
publishOneClear(viewId: Uid, uid: Uid, isAdd: boolean, isSync?: boolean): void;
|
|
111
|
+
syncRenderUids(viewId: Uid, _render?: _ArrayTrue<Uid>, _hide?: _ArrayTrue<Uid>, _clear?: _ArrayTrue<Uid>): void;
|
|
112
|
+
syncPageAuth(viewId: Uid, viewData?: ISerializableStorageRenderScenesData, forceUpdate?: boolean): void;
|
|
113
|
+
syncWriteable(writable?: _ArrayTrue<Uid>, readOnly?: _ArrayTrue<Uid>): void;
|
|
114
|
+
destoryByViewId(viewId: string, isLocal?: boolean): void;
|
|
115
|
+
private renderEffect;
|
|
116
|
+
private writeEffect;
|
|
117
|
+
private pageAuthEffect;
|
|
118
|
+
private serializablePageData;
|
|
119
|
+
private cloneElementIds;
|
|
120
|
+
private delElementIds;
|
|
121
|
+
}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ import { BaseShapeOptions, BaseShapeTool, ShapeOptions } from './tools';
|
|
|
6
6
|
import type { SelectorShape } from './tools';
|
|
7
7
|
import type { Direction } from "re-resizable/lib/resizer";
|
|
8
8
|
import { ShapeOptType } from '../displayer/types';
|
|
9
|
+
export type PickOne<T> = {
|
|
10
|
+
[P in keyof T]: Record<P, T[P]> & Partial<Record<Exclude<keyof T, P>, undefined>>;
|
|
11
|
+
}[keyof T];
|
|
9
12
|
export type IworkId = string | number;
|
|
10
13
|
export type IqueryTask = Partial<IWorkerMessage> | undefined;
|
|
11
14
|
export type ViewWorkerOptions = {
|
|
@@ -283,7 +286,6 @@ export type BaseNodeMapItem = {
|
|
|
283
286
|
scaleType: EScaleType;
|
|
284
287
|
/** 是否被框选中,框选中的元素不能被其它人操作 */
|
|
285
288
|
isSelected: boolean;
|
|
286
|
-
isHid?: boolean;
|
|
287
289
|
eraserlines?: Map<string, Pick<BaseNodeMapItem, 'op' | 'opt'>>;
|
|
288
290
|
};
|
|
289
291
|
export type Size = {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Group, Scene } from "spritejs";
|
|
2
2
|
import { BaseNodeMapItem, IRectType } from "./types";
|
|
3
3
|
import { EToolsKey } from ".";
|
|
4
|
+
import { _SetTrue } from "../plugin";
|
|
5
|
+
import type { Uid } from "../collector/types";
|
|
4
6
|
export declare class VNodeManager {
|
|
5
7
|
viewId: string;
|
|
6
8
|
scene: Scene;
|
|
@@ -8,10 +10,16 @@ export declare class VNodeManager {
|
|
|
8
10
|
curNodeMap: Map<string, BaseNodeMapItem>;
|
|
9
11
|
targetNodeMap: Map<string, BaseNodeMapItem>[];
|
|
10
12
|
private highLevelIds?;
|
|
13
|
+
private canClearUids?;
|
|
14
|
+
private localUid?;
|
|
11
15
|
constructor(viewId: string, scene: Scene);
|
|
12
16
|
init(fullLayer: Group): void;
|
|
13
17
|
get(name: string): BaseNodeMapItem | undefined;
|
|
14
|
-
|
|
18
|
+
setLocalUid(uid: string): void;
|
|
19
|
+
getLocalUid(): string | undefined;
|
|
20
|
+
setCanClearUids(clearUids?: _SetTrue<Uid>): void;
|
|
21
|
+
getCanClearUids(): _SetTrue<string> | undefined;
|
|
22
|
+
getCanEraserNodes(nodeMap: Map<string, BaseNodeMapItem>): Map<string, BaseNodeMapItem>;
|
|
15
23
|
getNodesByType(type: EToolsKey): Map<string, BaseNodeMapItem>;
|
|
16
24
|
hasRenderNodes(): boolean;
|
|
17
25
|
has(name: string): boolean;
|
|
@@ -20,7 +28,6 @@ export declare class VNodeManager {
|
|
|
20
28
|
unSelected(name: string): void;
|
|
21
29
|
delete(name: string): void;
|
|
22
30
|
clear(): void;
|
|
23
|
-
hasRectIntersectRange(rect: IRectType, filterLock?: boolean): boolean;
|
|
24
31
|
getRectIntersectRange(rect: IRectType, filterLock?: boolean, filterEditor?: boolean): {
|
|
25
32
|
rectRange: IRectType | undefined;
|
|
26
33
|
nodeRange: Map<string, BaseNodeMapItem>;
|
|
@@ -30,7 +37,6 @@ export declare class VNodeManager {
|
|
|
30
37
|
updateHighLevelNodesRect(highLevelIds: Set<string>): void;
|
|
31
38
|
updateLowLevelNodesRect(): void;
|
|
32
39
|
clearHighLevelIds(): void;
|
|
33
|
-
combineIntersectRect(rect: IRectType): IRectType;
|
|
34
40
|
setTargetAssignKeys(keys: Array<string>): number;
|
|
35
41
|
setTarget(): number;
|
|
36
42
|
getLastTarget(): Map<string, BaseNodeMapItem>;
|
|
@@ -38,4 +44,6 @@ export declare class VNodeManager {
|
|
|
38
44
|
getTarget(i: number): Map<string, BaseNodeMapItem>;
|
|
39
45
|
deleteTarget(i: number): void;
|
|
40
46
|
clearTarget(): void;
|
|
47
|
+
isLocalWorkId(workId: string): boolean;
|
|
48
|
+
isCanClearWorkId(workId: string): boolean;
|
|
41
49
|
}
|
|
@@ -23,14 +23,14 @@ export interface ISubWorkerInitOption {
|
|
|
23
23
|
}
|
|
24
24
|
export declare abstract class WorkThreadEngineBase {
|
|
25
25
|
readonly viewId: string;
|
|
26
|
-
|
|
26
|
+
scene: Scene;
|
|
27
|
+
fullLayer: Group;
|
|
27
28
|
readonly vNodes: VNodeManager;
|
|
28
29
|
readonly dpr: number;
|
|
29
30
|
readonly contextType?: ECanvasContextType;
|
|
30
31
|
abstract readonly type: EWorkThreadType;
|
|
31
32
|
protected opt: IWorkerInitOption;
|
|
32
33
|
protected cameraOpt?: ICameraOpt;
|
|
33
|
-
protected scene: Scene;
|
|
34
34
|
abstract localWork: LocalWorkForFullWorker | LocalWorkForSubWorker;
|
|
35
35
|
abstract serviceWork?: ServiceWorkForFullWorker;
|
|
36
36
|
protected isSafari: boolean;
|
|
@@ -50,6 +50,7 @@ export declare abstract class WorkThreadEngineBase {
|
|
|
50
50
|
resolve?: (workId: string) => void;
|
|
51
51
|
}>;
|
|
52
52
|
constructor(viewId: string, opt: IWorkerInitOption, workerType: EWorkThreadType);
|
|
53
|
+
private createRenderLayer;
|
|
53
54
|
getCachedImages(imageSrc: string): ImageBitmap | undefined;
|
|
54
55
|
clearCacheImages(): void;
|
|
55
56
|
clearImageResolveMap(): void;
|