@netless/appliance-plugin 1.1.2 → 1.1.3-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/dist/collector/collector.d.ts +24 -8
- package/dist/collector/types.d.ts +8 -5
- package/dist/core/enum.d.ts +35 -0
- package/dist/core/mainEngine.d.ts +2 -2
- package/dist/core/renderCotrol.d.ts +9 -10
- package/dist/core/vNodeManager.d.ts +3 -4
- package/dist/plugin/baseApplianceManager.d.ts +4 -4
- package/dist/plugin/types.d.ts +6 -9
- package/package.json +12 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BaseCollectorReducerAction, Diff, DiffAuthPage, DiffAuthRender, ISerializableAuthData,
|
|
1
|
+
import { EOperationType, ERenderFilterType } from "../core/enum";
|
|
2
|
+
import { BaseCollectorReducerAction, Diff, DiffAuthPage, DiffAuthRender, ISerializableAuthData, ISerializableStorageData, ISerializableStorageViewData, ScenePath, Uid, ViewId, WorkId } from "./types";
|
|
3
3
|
import { BaseCollector } from "./base";
|
|
4
|
-
import type { AppliancePluginLike } from "../plugin/types";
|
|
4
|
+
import type { _SetTrue, AppliancePluginLike } from "../plugin/types";
|
|
5
5
|
import { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
6
6
|
/**
|
|
7
7
|
* 服务端事件/状态同步收集器
|
|
@@ -57,11 +57,27 @@ export declare class Collector extends BaseCollector<ISerializableStorageViewDat
|
|
|
57
57
|
keyTransformWorkId(key: string): string;
|
|
58
58
|
destroy(): void;
|
|
59
59
|
setAuth(auth: Partial<ISerializableAuthData>, isSync: boolean): void;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
viewId
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
dispatchPageAuth(action: {
|
|
61
|
+
operation: EOperationType;
|
|
62
|
+
viewId: ViewId;
|
|
63
|
+
scenePath?: ScenePath;
|
|
64
|
+
pageId?: Uid;
|
|
65
|
+
pageData?: {
|
|
66
|
+
render?: Uid;
|
|
67
|
+
elementIds?: Set<WorkId>;
|
|
68
|
+
elementId?: WorkId;
|
|
69
|
+
};
|
|
70
|
+
}, isSync?: boolean): void;
|
|
71
|
+
dispatchRenderAuth(action: {
|
|
72
|
+
operation: ERenderFilterType;
|
|
73
|
+
viewId: ViewId;
|
|
74
|
+
uid?: Uid;
|
|
75
|
+
isClear?: boolean;
|
|
76
|
+
renderData?: {
|
|
77
|
+
render?: _SetTrue;
|
|
78
|
+
hide?: _SetTrue;
|
|
79
|
+
clear?: _SetTrue;
|
|
80
|
+
};
|
|
65
81
|
}, isSync?: boolean): void;
|
|
66
82
|
addAuthStateListener(callBack: (diffAuthRender?: DiffAuthRender, diffAuthPage?: DiffAuthPage) => void): void;
|
|
67
83
|
removeAuthStateListener(): void;
|
|
@@ -1,7 +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 {
|
|
4
|
+
import { _ObjectTrue, EmitEventType } from "../plugin/types";
|
|
5
5
|
export declare type DiffOneView<ISerializableStorageViewData> = {
|
|
6
6
|
oldValue?: ISerializableStorageViewData;
|
|
7
7
|
newValue?: ISerializableStorageViewData;
|
|
@@ -87,11 +87,11 @@ export interface ISerializableStorageScenePathData {
|
|
|
87
87
|
}
|
|
88
88
|
export type ISerializableAuthRenderItemType = {
|
|
89
89
|
/** 可读用户组, 如果是true, 则为所有用户笔记可渲染 */
|
|
90
|
-
render?:
|
|
90
|
+
render?: _ObjectTrue;
|
|
91
91
|
/** 可隐藏用户组 如果是true, 则为所有用户笔记可隐藏 */
|
|
92
|
-
hide?:
|
|
92
|
+
hide?: _ObjectTrue;
|
|
93
93
|
/** 可移除笔记用户组 如果是true, 则为所有用户笔记可移除 */
|
|
94
|
-
clear?:
|
|
94
|
+
clear?: _ObjectTrue;
|
|
95
95
|
};
|
|
96
96
|
export type ISerializableAuthRenderDataType = {
|
|
97
97
|
[key: ViewId]: ISerializableAuthRenderItemType;
|
|
@@ -121,7 +121,10 @@ export type ISerializableStorageRenderPagesData = {
|
|
|
121
121
|
pages: ISerializableStorageRenderElementIdsData;
|
|
122
122
|
};
|
|
123
123
|
export type ISerializableStorageRenderElementIdsData = {
|
|
124
|
-
[key: PageId]:
|
|
124
|
+
[key: PageId]: ISerializableStorageRenderElementIdData;
|
|
125
|
+
};
|
|
126
|
+
export type ISerializableStorageRenderElementIdData = {
|
|
127
|
+
[key: WorkId]: true;
|
|
125
128
|
};
|
|
126
129
|
export declare type DiffAuthPage = {
|
|
127
130
|
[K in keyof ISerializableStorageRenderViewsData]?: DiffOnePage;
|
package/dist/core/enum.d.ts
CHANGED
|
@@ -160,3 +160,38 @@ export declare enum EMatrixrRelationType {
|
|
|
160
160
|
outside = 1,
|
|
161
161
|
intersect = 2
|
|
162
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* 分屏 操作类型
|
|
165
|
+
* view => scenes => pages => elements
|
|
166
|
+
*/
|
|
167
|
+
export declare enum EOperationType {
|
|
168
|
+
/** 设置同步视口页面 */
|
|
169
|
+
renderPage = "renderPage",
|
|
170
|
+
/** 新增页面 */
|
|
171
|
+
addPage = "addPage",
|
|
172
|
+
/** 删除页面 */
|
|
173
|
+
deletePage = "deletePage",
|
|
174
|
+
/** 新增笔记 */
|
|
175
|
+
addElement = "addElement",
|
|
176
|
+
/** 删除笔记 */
|
|
177
|
+
deleteElement = "deleteElement",
|
|
178
|
+
/** 清空页面中的所有笔记 */
|
|
179
|
+
clearPage = "clearPage",
|
|
180
|
+
/** 清空场景下的所有页面*/
|
|
181
|
+
clearViewScenePath = "clearViewScenePath",
|
|
182
|
+
/** 清空view */
|
|
183
|
+
clearView = "clearView"
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* 笔记过滤 操作类型
|
|
187
|
+
*/
|
|
188
|
+
export declare enum ERenderFilterType {
|
|
189
|
+
/** 设置全量权限 */
|
|
190
|
+
setAuth = "setAuth",
|
|
191
|
+
/** 设置可显权限 */
|
|
192
|
+
setShow = "addShow",
|
|
193
|
+
/** 设置可隐藏权限 */
|
|
194
|
+
setHide = "setHide",
|
|
195
|
+
/** 设置可删除权限 */
|
|
196
|
+
setClear = "setClear"
|
|
197
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter2 from "eventemitter2";
|
|
2
|
-
import { BaseCollectorReducerAction, DiffOneData
|
|
2
|
+
import { BaseCollectorReducerAction, DiffOneData } 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";
|
|
@@ -217,5 +217,5 @@ export declare class MasterControlForWorker extends MasterController {
|
|
|
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
|
|
220
|
+
sendClearUids(viewId: string, clearUids?: _SetTrue): void;
|
|
221
221
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RoomMemberManager } from "../members";
|
|
2
|
-
import { ApplianceManagerLike, BaseSubWorkModuleProps, FilterRenderType, _ArrayTrue } from "../plugin/types";
|
|
2
|
+
import { ApplianceManagerLike, BaseSubWorkModuleProps, FilterRenderType, _ArrayTrue, _ObjectTrue } from "../plugin/types";
|
|
3
3
|
import type { MasterControlForWorker } from "./mainEngine";
|
|
4
4
|
import { EPostMessageType } from "./enum";
|
|
5
5
|
import { ISerializableStorageRenderScenesData, PageId, ScenePath, Uid, ViewId, WorkId } from "../collector/types";
|
|
@@ -10,9 +10,9 @@ export interface RenderCotrol {
|
|
|
10
10
|
publishRender(param: {
|
|
11
11
|
viewId: Uid;
|
|
12
12
|
option: {
|
|
13
|
-
render?: _ArrayTrue
|
|
14
|
-
hide?: _ArrayTrue
|
|
15
|
-
clear?: _ArrayTrue
|
|
13
|
+
render?: _ArrayTrue;
|
|
14
|
+
hide?: _ArrayTrue;
|
|
15
|
+
clear?: _ArrayTrue;
|
|
16
16
|
};
|
|
17
17
|
isSync: boolean;
|
|
18
18
|
}): void;
|
|
@@ -21,7 +21,7 @@ export interface RenderCotrol {
|
|
|
21
21
|
/** 发布当个用户删除笔记权限到服务端 */
|
|
22
22
|
publishOneClear(viewId: Uid, uid: Uid, isAdd: boolean, isSync: boolean): void;
|
|
23
23
|
/** 服务端同步可显示绘制权限 */
|
|
24
|
-
syncRenderUids(viewId: Uid, _render?:
|
|
24
|
+
syncRenderUids(viewId: Uid, _render?: _ObjectTrue, _hide?: _ObjectTrue, _clear?: _ObjectTrue): void;
|
|
25
25
|
/** 销毁view的render数据 */
|
|
26
26
|
destoryByViewId(viewId: string): void;
|
|
27
27
|
}
|
|
@@ -88,20 +88,19 @@ export declare class RenderCotrolImple implements RenderCotrol {
|
|
|
88
88
|
publishRender(param: {
|
|
89
89
|
viewId: Uid;
|
|
90
90
|
option?: {
|
|
91
|
-
render?: _ArrayTrue
|
|
92
|
-
hide?: _ArrayTrue
|
|
93
|
-
clear?: _ArrayTrue
|
|
91
|
+
render?: _ArrayTrue;
|
|
92
|
+
hide?: _ArrayTrue;
|
|
93
|
+
clear?: _ArrayTrue;
|
|
94
94
|
};
|
|
95
95
|
isSync: boolean;
|
|
96
96
|
}): void;
|
|
97
97
|
publishOneRender(viewId: Uid, uid: Uid, type: FilterRenderType, isSync?: boolean): void;
|
|
98
98
|
publishOneClear(viewId: Uid, uid: Uid, isAdd: boolean, isSync?: boolean): void;
|
|
99
|
-
syncRenderUids(viewId: Uid, _render?:
|
|
99
|
+
syncRenderUids(viewId: Uid, _render?: _ObjectTrue, _hide?: _ObjectTrue, _clear?: _ObjectTrue): void;
|
|
100
100
|
syncPageAuth(viewId: Uid, viewData?: ISerializableStorageRenderScenesData, forceUpdate?: boolean): void;
|
|
101
101
|
destoryByViewId(viewId: string, isLocal?: boolean): void;
|
|
102
102
|
private renderEffect;
|
|
103
103
|
private pageAuthEffect;
|
|
104
|
-
private serializablePageData;
|
|
105
104
|
private cloneElementIds;
|
|
106
105
|
private delElementIds;
|
|
107
106
|
}
|
|
@@ -2,7 +2,6 @@ import { Group, Scene } from "spritejs";
|
|
|
2
2
|
import { BaseNodeMapItem, IRectType } from "./types";
|
|
3
3
|
import { EToolsKey } from ".";
|
|
4
4
|
import { _SetTrue } from "../plugin";
|
|
5
|
-
import type { Uid } from "../collector/types";
|
|
6
5
|
export declare class VNodeManager {
|
|
7
6
|
viewId: string;
|
|
8
7
|
scene: Scene;
|
|
@@ -17,8 +16,8 @@ export declare class VNodeManager {
|
|
|
17
16
|
get(name: string): BaseNodeMapItem | undefined;
|
|
18
17
|
setLocalUid(uid: string): void;
|
|
19
18
|
getLocalUid(): string | undefined;
|
|
20
|
-
setCanClearUids(clearUids?: _SetTrue
|
|
21
|
-
getCanClearUids(): _SetTrue
|
|
19
|
+
setCanClearUids(clearUids?: _SetTrue): void;
|
|
20
|
+
getCanClearUids(): _SetTrue | undefined;
|
|
22
21
|
getCanEraserNodes(nodeMap: Map<string, BaseNodeMapItem>): Map<string, BaseNodeMapItem>;
|
|
23
22
|
getNodesByType(type: EToolsKey): Map<string, BaseNodeMapItem>;
|
|
24
23
|
hasRenderNodes(): boolean;
|
|
@@ -45,5 +44,5 @@ export declare class VNodeManager {
|
|
|
45
44
|
deleteTarget(i: number): void;
|
|
46
45
|
clearTarget(): void;
|
|
47
46
|
isLocalWorkId(workId: string): boolean;
|
|
48
|
-
isCanClearWorkId(workId: string): boolean;
|
|
47
|
+
isCanClearWorkId(workId: string): boolean | "" | undefined;
|
|
49
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import EventEmitter2 from "eventemitter2";
|
|
2
2
|
import { MemberState, AppliancePluginLike, AppliancePluginOptions } from "./types";
|
|
3
|
-
import { Collector,
|
|
3
|
+
import { Collector, ViewId } from "../collector";
|
|
4
4
|
import { RoomMemberManager } from "../members";
|
|
5
5
|
import { TextEditorManager } from "../component/textEditor";
|
|
6
6
|
import type { Camera, Displayer, DisplayerCallbacks, Player, PriorityType, Rectangle, Room, RoomMember, _ArrayTrue } from "./types";
|
|
@@ -90,9 +90,9 @@ export declare abstract class BaseApplianceManager {
|
|
|
90
90
|
useBitMapEraser(bol: boolean): void;
|
|
91
91
|
consoleWorkerInfo(): void;
|
|
92
92
|
filterRenderByUid(viewId: ViewId, option: {
|
|
93
|
-
render?: _ArrayTrue
|
|
94
|
-
hide?: _ArrayTrue
|
|
95
|
-
clear?: _ArrayTrue
|
|
93
|
+
render?: _ArrayTrue;
|
|
94
|
+
hide?: _ArrayTrue;
|
|
95
|
+
clear?: _ArrayTrue;
|
|
96
96
|
}, isSync?: boolean): void;
|
|
97
97
|
cancelFilterRender(viewId: ViewId, isSync?: boolean): void;
|
|
98
98
|
}
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISerializableEventData, ISerializableStorageViewData } from "../collector/types";
|
|
1
|
+
import { ISerializableEventData, ISerializableStorageViewData, Uid } from "../collector/types";
|
|
2
2
|
import type { Cursor, View, CameraState, DisplayerCallbacks, HotKeys, Player, Room, Point, RoomMember, RoomState, Size, Callbacks, Camera, Color, CursorAdapter, Displayer, ImageInformation, Rectangle, RenderEngine, MemberState as _MemberState } from "white-web-sdk";
|
|
3
3
|
import type EventEmitter2 from "eventemitter2";
|
|
4
4
|
import type { ApplianceSingleManager } from "./single/applianceSingleManager";
|
|
@@ -345,10 +345,6 @@ export declare enum InternalMsgEmitterType {
|
|
|
345
345
|
Cursor = "Cursor",
|
|
346
346
|
BindMainView = "BindMainView"
|
|
347
347
|
}
|
|
348
|
-
export type InternalEventValue = {
|
|
349
|
-
id: string;
|
|
350
|
-
value?: _ArrayBolean<number>;
|
|
351
|
-
};
|
|
352
348
|
export declare enum ActiveContainerType {
|
|
353
349
|
MainView = 0,
|
|
354
350
|
Plugin = 1,
|
|
@@ -360,7 +356,8 @@ export type PriorityType = 'ui' | 'cpu';
|
|
|
360
356
|
export type FilterRenderType = "show" | "hide";
|
|
361
357
|
export type FilterPublishAutType = "write" | "readOnly";
|
|
362
358
|
export type FilterRenderDataType = "page" | "uid";
|
|
363
|
-
export type
|
|
364
|
-
export type
|
|
365
|
-
|
|
366
|
-
|
|
359
|
+
export type _SetTrue = true | Set<Uid>;
|
|
360
|
+
export type _ObjectTrue = true | {
|
|
361
|
+
[key: Uid]: true;
|
|
362
|
+
};
|
|
363
|
+
export type _ArrayTrue = true | Uid[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/appliance-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3-beta.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"cdn"
|
|
@@ -8,15 +8,6 @@
|
|
|
8
8
|
"main": "./dist/appliance-plugin.js",
|
|
9
9
|
"module": "./dist/appliance-plugin.mjs",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"scripts": {
|
|
12
|
-
"dev": "vite --force",
|
|
13
|
-
"types:bundler": "tsc --emitDeclarationOnly",
|
|
14
|
-
"build:bundler": "vite build --config vite.config.bundler.js && yarn types:bundler",
|
|
15
|
-
"types:worker": "tsc --noEmit",
|
|
16
|
-
"build:worker": "vite build --config vite.config.worker.js",
|
|
17
|
-
"build": "cross-env NODE_ENV=production tsc && yarn build:worker && yarn build:bundler",
|
|
18
|
-
"preview": "vite preview"
|
|
19
|
-
},
|
|
20
11
|
"devDependencies": {
|
|
21
12
|
"@babel/core": "^7.24.7",
|
|
22
13
|
"@babel/preset-env": "^7.24.7",
|
|
@@ -51,5 +42,14 @@
|
|
|
51
42
|
"example": "example"
|
|
52
43
|
},
|
|
53
44
|
"author": "hqer",
|
|
54
|
-
"license": "ISC"
|
|
55
|
-
|
|
45
|
+
"license": "ISC",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"dev": "vite --force",
|
|
48
|
+
"types:bundler": "tsc --emitDeclarationOnly",
|
|
49
|
+
"build:bundler": "vite build --config vite.config.bundler.js && yarn types:bundler",
|
|
50
|
+
"types:worker": "tsc --noEmit",
|
|
51
|
+
"build:worker": "vite build --config vite.config.worker.js",
|
|
52
|
+
"build": "cross-env NODE_ENV=production tsc && yarn build:worker && yarn build:bundler",
|
|
53
|
+
"preview": "vite preview"
|
|
54
|
+
}
|
|
55
|
+
}
|