@netless/window-manager 1.0.9 → 1.0.10-beta.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/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/App/AppProxy.ts +3 -0
- package/src/AppManager.ts +10 -6
- package/src/BoxManager.ts +3 -1
package/package.json
CHANGED
package/src/App/AppProxy.ts
CHANGED
|
@@ -282,13 +282,16 @@ export class AppProxy implements PageRemoveService {
|
|
|
282
282
|
await this.destroy(true, false, true);
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
|
+
console.log('onReconnected====>', this.id);
|
|
285
286
|
this.appEmitter.emit("reconnected", undefined);
|
|
286
287
|
const currentAppState = this.getAppInitState(this.id);
|
|
288
|
+
console.log('onReconnected====>0000', currentAppState?.boxStatus);
|
|
287
289
|
await this.destroy(true, false, true);
|
|
288
290
|
const params = this.params;
|
|
289
291
|
const AppProxyClass = getExtendClass(AppProxy, WindowManager.extendClass);
|
|
290
292
|
const appProxy = new AppProxyClass(params, this.manager, this.id, this.isAddApp);
|
|
291
293
|
await appProxy.baseInsertApp(true);
|
|
294
|
+
console.log('onReconnected====>', currentAppState?.boxStatus);
|
|
292
295
|
this.boxManager?.updateBoxState(currentAppState);
|
|
293
296
|
}
|
|
294
297
|
|
package/src/AppManager.ts
CHANGED
|
@@ -202,7 +202,7 @@ export class AppManager {
|
|
|
202
202
|
};
|
|
203
203
|
|
|
204
204
|
private onPlayerSeekDone = async (time: number) => {
|
|
205
|
-
await this.
|
|
205
|
+
await this._attributesUpdateCallback(this.attributes.apps);
|
|
206
206
|
this.appProxies.forEach(appProxy => {
|
|
207
207
|
appProxy.onSeek(time);
|
|
208
208
|
});
|
|
@@ -351,11 +351,12 @@ export class AppManager {
|
|
|
351
351
|
resolve(this.appProxies.get(this._focusAppId || ""));
|
|
352
352
|
}, 500);
|
|
353
353
|
}).then(() => {
|
|
354
|
+
this._resolveTimer = undefined;
|
|
355
|
+
this._focusAppCreatedResolve = undefined;
|
|
354
356
|
this.focusByAttributes(this.attributes.apps);
|
|
355
357
|
});
|
|
356
358
|
}
|
|
357
|
-
await this.
|
|
358
|
-
this.focusByAttributes(this.attributes.apps);
|
|
359
|
+
await this._attributesUpdateCallback(this.attributes.apps);
|
|
359
360
|
internalEmitter.emit("updateManagerRect");
|
|
360
361
|
boxEmitter.on("move", this.onBoxMove);
|
|
361
362
|
boxEmitter.on("resize", this.onBoxResize);
|
|
@@ -404,6 +405,7 @@ export class AppManager {
|
|
|
404
405
|
}
|
|
405
406
|
this.displayerWritableListener(!this.room?.isWritable);
|
|
406
407
|
this.displayer.callbacks.on("onEnableWriteNowChanged", this.displayerWritableListener);
|
|
408
|
+
this.focusByAttributes(this.attributes.apps);
|
|
407
409
|
this._prevFocused = this.attributes.focus;
|
|
408
410
|
|
|
409
411
|
if (!WindowManager.supportAppliancePlugin) {
|
|
@@ -465,6 +467,8 @@ export class AppManager {
|
|
|
465
467
|
};
|
|
466
468
|
|
|
467
469
|
private notifyBoxesStatusChange = debounce(() => {
|
|
470
|
+
console.log('setBoxesStatus====>', this.attributes.boxesStatus);
|
|
471
|
+
this.boxManager?.setBoxesStatus(this.attributes.boxesStatus);
|
|
468
472
|
const entries = Object.entries(this.attributes.boxesStatus);
|
|
469
473
|
if (entries.length > 0) {
|
|
470
474
|
entries.forEach(([appId, status]) => {
|
|
@@ -474,14 +478,14 @@ export class AppManager {
|
|
|
474
478
|
}
|
|
475
479
|
});
|
|
476
480
|
}
|
|
477
|
-
},
|
|
481
|
+
}, 100);
|
|
478
482
|
|
|
479
483
|
public addBoxesStatusChangeListener = () => {
|
|
480
484
|
this.refresher.add("boxesStatus", () => {
|
|
481
485
|
return safeListenPropsUpdated(
|
|
482
486
|
() => this.attributes.boxesStatus,
|
|
483
487
|
() => {
|
|
484
|
-
|
|
488
|
+
console.log('setBoxesStatus====>000', this.attributes.boxesStatus);
|
|
485
489
|
this.notifyBoxesStatusChange();
|
|
486
490
|
}
|
|
487
491
|
);
|
|
@@ -908,7 +912,7 @@ export class AppManager {
|
|
|
908
912
|
}
|
|
909
913
|
|
|
910
914
|
public async onReconnected() {
|
|
911
|
-
this.
|
|
915
|
+
await this._attributesUpdateCallback(this.attributes.apps);
|
|
912
916
|
const appProxies = Array.from(this.appProxies.values());
|
|
913
917
|
const reconnected = appProxies.map(appProxy => {
|
|
914
918
|
return appProxy.onReconnected();
|
package/src/BoxManager.ts
CHANGED
|
@@ -410,7 +410,9 @@ export class BoxManager {
|
|
|
410
410
|
this.teleBoxManager.setMinimized(Boolean(state.minimized), true);
|
|
411
411
|
}
|
|
412
412
|
}, 50);
|
|
413
|
-
|
|
413
|
+
if (!state.boxStatus) {
|
|
414
|
+
this.context.callbacks.emit("boxStateChange", this.teleBoxManager.state);
|
|
415
|
+
}
|
|
414
416
|
}
|
|
415
417
|
}
|
|
416
418
|
|