@netless/window-manager 0.3.16-canary.2 → 0.3.16-canary.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "0.3.16-canary.2",
3
+ "version": "0.3.16-canary.3",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",
package/src/AppManager.ts CHANGED
@@ -395,6 +395,9 @@ export class AppManager {
395
395
  if (appProxy) {
396
396
  appProxy.destroy(false, true, payload.error);
397
397
  }
398
+ if (this.boxManager.maximized) {
399
+ this.boxManager.focusTopBox();
400
+ }
398
401
  break;
399
402
  }
400
403
  case "boxStateChange": {
package/src/BoxManager.ts CHANGED
@@ -268,8 +268,8 @@ export class BoxManager {
268
268
  this.teleBoxManager.update(appId, { x, y }, true);
269
269
  }
270
270
 
271
- public focusBox({ appId }: AppId): void {
272
- this.teleBoxManager.update(appId, { focus: true }, true);
271
+ public focusBox({ appId }: AppId, skipUpdate = true): void {
272
+ this.teleBoxManager.update(appId, { focus: true }, skipUpdate);
273
273
  }
274
274
 
275
275
  public resizeBox({ appId, width, height, skipUpdate }: ResizeBoxParams): void {
@@ -315,6 +315,16 @@ export class BoxManager {
315
315
  this.teleBoxManager.setMinimized(minimized, skipUpdate);
316
316
  }
317
317
 
318
+ public focusTopBox(): void {
319
+ const boxes = this.teleBoxManager.query();
320
+ if (boxes.length >= 1) {
321
+ const box = this.getTopBox();
322
+ if (box) {
323
+ this.focusBox({ appId: box.id }, false);
324
+ }
325
+ }
326
+ }
327
+
318
328
  public setReadonly(readonly: boolean) {
319
329
  this.teleBoxManager.setReadonly(readonly);
320
330
  }
package/src/index.ts CHANGED
@@ -176,7 +176,7 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
176
176
  public static containerSizeRatio = DEFAULT_CONTAINER_RATIO;
177
177
  private static isCreated = false;
178
178
 
179
- public version = "0.3.16-canary.2";
179
+ public version = "0.3.16-canary.3";
180
180
 
181
181
  public appListeners?: AppListeners;
182
182