@netless/window-manager 0.4.9 → 0.4.11-canary.1
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/CHANGELOG.md +17 -0
- package/dist/AppManager.d.ts +7 -0
- package/dist/AttributesDelegate.d.ts +2 -1
- package/dist/InternalEmitter.d.ts +2 -0
- package/dist/PageState.d.ts +12 -0
- package/dist/Register/index.d.ts +10 -0
- package/dist/callback.d.ts +2 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.es.js +5 -5
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/docs/advanced.md +24 -0
- package/docs/api.md +9 -0
- package/docs/develop-app.md +60 -22
- package/package.json +2 -2
- package/src/AppContext.ts +12 -3
- package/src/AppManager.ts +90 -37
- package/src/AttributesDelegate.ts +1 -0
- package/src/InternalEmitter.ts +2 -0
- package/src/PageState.ts +31 -0
- package/src/Register/index.ts +28 -1
- package/src/Utils/Common.ts +2 -1
- package/src/callback.ts +2 -0
- package/src/index.ts +24 -0
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
## 0.3.27
|
2
|
+
|
3
|
+
1. 修复在同时调用多次 `addApp` 时, 先添加的课件不显示的问题
|
4
|
+
|
5
|
+
## 0.4.11 (canary)
|
6
|
+
|
7
|
+
1. 升级 `@netless/app-docs-viewer` 到 `0.2.8`
|
8
|
+
2. 同步注册的 url 的 src 到远端
|
9
|
+
|
10
|
+
## 0.4.10
|
11
|
+
|
12
|
+
1. 修复 `PublicEvent` 类型没有导出的问题
|
13
|
+
|
14
|
+
## 0.3.26
|
15
|
+
|
16
|
+
1. 修复多次调用 `setWritable` 和 `setReadonly` 导致的状态错误
|
17
|
+
|
1
18
|
## 0.4.9
|
2
19
|
|
3
20
|
1. 添加 `sceneState` 属性和 `sceneStateChange` 事件
|
package/dist/AppManager.d.ts
CHANGED
@@ -27,13 +27,17 @@ export declare class AppManager {
|
|
27
27
|
private sideEffectManager;
|
28
28
|
sceneState: SceneState | null;
|
29
29
|
constructor(windowManger: WindowManager);
|
30
|
+
private onRemoveScenes;
|
30
31
|
/**
|
31
32
|
* 根目录被删除时所有的 scene 都会被删除.
|
32
33
|
* 所以需要关掉所有开启了 view 的 app
|
33
34
|
*/
|
34
35
|
private onRootDirRemoved;
|
36
|
+
private onReadonlyChanged;
|
37
|
+
private onPlayerSeek;
|
35
38
|
private createRootDirScenesCallback;
|
36
39
|
private onSceneChange;
|
40
|
+
private emitMainViewScenesChange;
|
37
41
|
private updateSceneState;
|
38
42
|
private get eventName();
|
39
43
|
get attributes(): import("./index").WindowMangerAttributes;
|
@@ -51,6 +55,8 @@ export declare class AppManager {
|
|
51
55
|
* @memberof WindowManager
|
52
56
|
*/
|
53
57
|
attributesUpdateCallback(apps: any): Promise<void>;
|
58
|
+
private onRegisteredChange;
|
59
|
+
private onMinimized;
|
54
60
|
refresh(): void;
|
55
61
|
setBoxManager(boxManager: BoxManager): void;
|
56
62
|
resetMaximized(): void;
|
@@ -58,6 +64,7 @@ export declare class AppManager {
|
|
58
64
|
private onAppDelete;
|
59
65
|
bindMainView(divElement: HTMLDivElement, disableCameraTransform: boolean): void;
|
60
66
|
setMainViewFocusPath(scenePath?: string): boolean | undefined;
|
67
|
+
private resetScenePath;
|
61
68
|
addApp(params: AddAppParams, isDynamicPPT: boolean): Promise<string | undefined>;
|
62
69
|
private beforeAddApp;
|
63
70
|
private afterAddApp;
|
@@ -13,7 +13,8 @@ export declare enum Fields {
|
|
13
13
|
Cursors = "cursors",
|
14
14
|
Position = "position",
|
15
15
|
CursorState = "cursorState",
|
16
|
-
FullPath = "fullPath"
|
16
|
+
FullPath = "fullPath",
|
17
|
+
Registered = "registered"
|
17
18
|
}
|
18
19
|
export declare type Apps = {
|
19
20
|
[key: string]: AppSyncAttributes;
|
@@ -36,6 +36,8 @@ export declare type EmitterEvent = {
|
|
36
36
|
prev: string | undefined;
|
37
37
|
};
|
38
38
|
rootDirRemoved: undefined;
|
39
|
+
setReadonly: boolean;
|
40
|
+
changePageState: undefined;
|
39
41
|
};
|
40
42
|
export declare type EmitterType = Emittery<EmitterEvent>;
|
41
43
|
export declare const emitter: EmitterType;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { AppManager } from "./AppManager";
|
2
|
+
export declare type PageState = {
|
3
|
+
index: number;
|
4
|
+
length: number;
|
5
|
+
};
|
6
|
+
export declare class PageStateImpl {
|
7
|
+
private manager;
|
8
|
+
constructor(manager: AppManager);
|
9
|
+
get index(): number;
|
10
|
+
get length(): number;
|
11
|
+
toObject(): PageState;
|
12
|
+
}
|
package/dist/Register/index.d.ts
CHANGED
@@ -5,12 +5,22 @@ export declare type LoadAppEvent = {
|
|
5
5
|
status: "start" | "success" | "failed";
|
6
6
|
reason?: string;
|
7
7
|
};
|
8
|
+
export declare type SyncRegisterAppPayload = {
|
9
|
+
kind: string;
|
10
|
+
src: string;
|
11
|
+
name: string | undefined;
|
12
|
+
};
|
13
|
+
export declare type SyncRegisterApp = (payload: SyncRegisterAppPayload) => void;
|
8
14
|
declare class AppRegister {
|
9
15
|
kindEmitters: Map<string, Emittery<RegisterEvents>>;
|
10
16
|
registered: Map<string, RegisterParams>;
|
11
17
|
appClassesCache: Map<string, Promise<NetlessApp>>;
|
12
18
|
appClasses: Map<string, () => Promise<NetlessApp>>;
|
19
|
+
private syncRegisterApp;
|
20
|
+
setSyncRegisterApp(fn: SyncRegisterApp): void;
|
21
|
+
onSyncRegisterAppChange: (payload: SyncRegisterAppPayload) => void;
|
13
22
|
register(params: RegisterParams): Promise<void>;
|
23
|
+
unregister(kind: string): void;
|
14
24
|
notifyApp<T extends keyof RegisterEvents>(kind: string, event: T, payload: RegisterEvents[T]): Promise<void>;
|
15
25
|
private createKindEmitter;
|
16
26
|
}
|
package/dist/callback.d.ts
CHANGED
@@ -2,6 +2,7 @@ import Emittery from "emittery";
|
|
2
2
|
import type { TeleBoxColorScheme, TELE_BOX_STATE } from "@netless/telebox-insider";
|
3
3
|
import type { CameraState, SceneState, ViewVisionMode } from "white-web-sdk";
|
4
4
|
import type { LoadAppEvent } from "./Register";
|
5
|
+
import type { PageState } from "./PageState";
|
5
6
|
export declare type PublicEvent = {
|
6
7
|
mainViewModeChange: ViewVisionMode;
|
7
8
|
boxStateChange: `${TELE_BOX_STATE}`;
|
@@ -17,6 +18,7 @@ export declare type PublicEvent = {
|
|
17
18
|
loadApp: LoadAppEvent;
|
18
19
|
ready: undefined;
|
19
20
|
sceneStateChange: SceneState;
|
21
|
+
pageStateChange: PageState;
|
20
22
|
};
|
21
23
|
export declare type CallbacksType = Emittery<PublicEvent>;
|
22
24
|
export declare const callbacks: CallbacksType;
|
package/dist/index.d.ts
CHANGED
@@ -14,6 +14,7 @@ import type { TeleBoxColorScheme, TeleBoxState } from "@netless/telebox-insider"
|
|
14
14
|
import type { AppProxy } from "./AppProxy";
|
15
15
|
import type { PublicEvent } from "./Callback";
|
16
16
|
import type Emittery from "emittery";
|
17
|
+
import type { PageState } from "./PageState";
|
17
18
|
export declare type WindowMangerAttributes = {
|
18
19
|
modelValue?: string;
|
19
20
|
boxState: TELE_BOX_STATE;
|
@@ -110,6 +111,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
110
111
|
cursorManager?: CursorManager;
|
111
112
|
viewMode: ViewMode;
|
112
113
|
isReplay: boolean;
|
114
|
+
private _pageState?;
|
113
115
|
private boxManager?;
|
114
116
|
private static params?;
|
115
117
|
private containerResizeObserver?;
|
@@ -124,6 +126,10 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
124
126
|
* 注册插件
|
125
127
|
*/
|
126
128
|
static register<AppOptions = any, SetupResult = any, Attributes = any>(params: RegisterParams<AppOptions, SetupResult, Attributes>): Promise<void>;
|
129
|
+
/**
|
130
|
+
* 注销插件
|
131
|
+
*/
|
132
|
+
static unregister(kind: string): void;
|
127
133
|
/**
|
128
134
|
* 创建一个 app 至白板
|
129
135
|
*/
|
@@ -183,6 +189,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
183
189
|
get canRedoSteps(): number;
|
184
190
|
get canUndoSteps(): number;
|
185
191
|
get sceneState(): SceneState;
|
192
|
+
get pageState(): PageState;
|
186
193
|
/**
|
187
194
|
* 查询所有的 App
|
188
195
|
*/
|
@@ -229,3 +236,4 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
229
236
|
}
|
230
237
|
export * from "./typings";
|
231
238
|
export { BuiltinApps } from "./BuiltinApps";
|
239
|
+
export type { PublicEvent } from "./callback";
|