@netless/window-manager 1.0.0-canary.13 → 1.0.0-canary.14
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/App/WhiteboardView.d.ts +1 -0
- package/dist/AppManager.d.ts +2 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +14 -6
- package/dist/index.umd.js +4 -4
- package/package.json +1 -1
- package/src/App/WhiteboardView.ts +9 -0
- package/src/AppManager.ts +8 -8
- package/src/PageState.ts +1 -1
- package/src/View/CameraSynchronizer.ts +1 -1
package/package.json
CHANGED
@@ -10,6 +10,7 @@ import type { TeleBoxRect } from "@netless/telebox-insider";
|
|
10
10
|
|
11
11
|
export class WhiteBoardView implements PageController {
|
12
12
|
public readonly pageState$: ReadonlyVal<PageState>;
|
13
|
+
public readonly camera$: ReadonlyVal<Camera>;
|
13
14
|
|
14
15
|
constructor(
|
15
16
|
public view: View,
|
@@ -23,6 +24,13 @@ export class WhiteBoardView implements PageController {
|
|
23
24
|
appProxy.appEmitter.on("pageStateChange", pageState => {
|
24
25
|
pageState$.setValue(pageState);
|
25
26
|
});
|
27
|
+
const camera$ = new Val<Camera, boolean>(this.view.camera);
|
28
|
+
this.camera$ = camera$
|
29
|
+
appProxy.camera$.subscribe(camera => {
|
30
|
+
if (camera) {
|
31
|
+
camera$.setValue(camera, true);
|
32
|
+
}
|
33
|
+
});
|
26
34
|
view.disableCameraTransform = true;
|
27
35
|
}
|
28
36
|
|
@@ -85,6 +93,7 @@ export class WhiteBoardView implements PageController {
|
|
85
93
|
|
86
94
|
public destroy() {
|
87
95
|
this.pageState$.destroy();
|
96
|
+
this.camera$.destroy();
|
88
97
|
this.removeViewWrapper();
|
89
98
|
}
|
90
99
|
}
|
package/src/AppManager.ts
CHANGED
@@ -138,7 +138,7 @@ export class AppManager {
|
|
138
138
|
sceneName = this.callbacksNode?.scenes[nextIndex];
|
139
139
|
}
|
140
140
|
if (sceneName) {
|
141
|
-
this.setMainViewScenePath(`${ROOT_DIR}${sceneName}`);
|
141
|
+
await this.setMainViewScenePath(`${ROOT_DIR}${sceneName}`);
|
142
142
|
}
|
143
143
|
await this.setMainViewSceneIndex(nextIndex);
|
144
144
|
} else {
|
@@ -153,7 +153,7 @@ export class AppManager {
|
|
153
153
|
* 所以需要关掉所有开启了 view 的 app
|
154
154
|
*/
|
155
155
|
public async onRootDirRemoved(needClose = true) {
|
156
|
-
this.setMainViewScenePath(INIT_DIR);
|
156
|
+
await this.setMainViewScenePath(INIT_DIR);
|
157
157
|
this.createRootDirScenesCallback();
|
158
158
|
|
159
159
|
for (const [id, appProxy] of this.appProxies.entries()) {
|
@@ -161,9 +161,9 @@ export class AppManager {
|
|
161
161
|
await this.closeApp(id, needClose);
|
162
162
|
}
|
163
163
|
}
|
164
|
-
// 删除了根目录的 scenes 之后
|
164
|
+
// 删除了根目录的 scenes 之后 main-view 需要重新绑定, 否则主白板会不能渲染
|
165
165
|
this.mainViewProxy.rebind();
|
166
|
-
emitter.emit("rootDirRemoved");
|
166
|
+
await emitter.emit("rootDirRemoved");
|
167
167
|
this.updateRootDirRemoving(false);
|
168
168
|
}
|
169
169
|
|
@@ -462,9 +462,9 @@ export class AppManager {
|
|
462
462
|
);
|
463
463
|
|
464
464
|
/**
|
465
|
-
* 插件更新
|
465
|
+
* 插件更新 apps 时的回调
|
466
466
|
*
|
467
|
-
* @param {*}
|
467
|
+
* @param {*} apps
|
468
468
|
* @memberof WindowManager
|
469
469
|
*/
|
470
470
|
public async _attributesUpdateCallback(apps: any) {
|
@@ -680,7 +680,7 @@ export class AppManager {
|
|
680
680
|
public displayerWritableListener = (isReadonly: boolean) => {
|
681
681
|
const isWritable = !isReadonly;
|
682
682
|
const isManualWritable =
|
683
|
-
this.windowManger.readonly === undefined || this.windowManger.readonly
|
683
|
+
this.windowManger.readonly === undefined || !this.windowManger.readonly;
|
684
684
|
if (this.windowManger.readonly === undefined) {
|
685
685
|
this.boxManager?.setReadonly(isReadonly);
|
686
686
|
} else {
|
@@ -689,7 +689,7 @@ export class AppManager {
|
|
689
689
|
this.appProxies.forEach(appProxy => {
|
690
690
|
appProxy.emitAppIsWritableChange();
|
691
691
|
});
|
692
|
-
if (isWritable
|
692
|
+
if (isWritable) {
|
693
693
|
if (this.room && this.room.disableSerialization === true) {
|
694
694
|
this.room.disableSerialization = false;
|
695
695
|
}
|
package/src/PageState.ts
CHANGED
@@ -6,7 +6,7 @@ import type { PageState } from "./Page";
|
|
6
6
|
export class PageStateImpl {
|
7
7
|
constructor(private manager: AppManager) {
|
8
8
|
emitter.on("changePageState", () => {
|
9
|
-
|
9
|
+
callbacks.emit("pageStateChange", this.toObject());
|
10
10
|
});
|
11
11
|
}
|
12
12
|
|