@netless/telebox-insider 0.3.0-beta.8 → 0.3.0-beta.9

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.
@@ -3234,7 +3234,7 @@ class TeleBoxManager {
3234
3234
  const box = this.getBox(targetBox.id);
3235
3235
  if (box) {
3236
3236
  let isFocusChanged = false;
3237
- if (this.topBox === box) {
3237
+ if (box.focus) {
3238
3238
  this.blurBox(box);
3239
3239
  isFocusChanged = true;
3240
3240
  }
@@ -3264,7 +3264,7 @@ class TeleBoxManager {
3264
3264
  const box = this.getBox(targetBox.id);
3265
3265
  if (box) {
3266
3266
  let isFocusChanged = false;
3267
- if (this.topBox === box) {
3267
+ if (box.focus) {
3268
3268
  this.blurBox(box);
3269
3269
  isFocusChanged = true;
3270
3270
  }
@@ -3410,13 +3410,12 @@ class TeleBoxManager {
3410
3410
  }
3411
3411
  });
3412
3412
  this.effectBoxStatusChange();
3413
+ console.log("effectBoxesStatusTimerFunc===>newTopBox", newTopBox, curTopBox);
3413
3414
  if (newTopBox && curTopBox !== newTopBox) {
3414
3415
  this.topBox$.setValue(newTopBox);
3415
- this.focusBox(newTopBox, skipUpdate);
3416
3416
  }
3417
3417
  if (!newTopBox && curTopBox) {
3418
3418
  this.topBox$.setValue(void 0);
3419
- this.blurBox(curTopBox, skipUpdate);
3420
3419
  }
3421
3420
  }
3422
3421
  async effectBoxesStatusChange(skipUpdate = false) {
@@ -3672,12 +3671,9 @@ class TeleBoxManager {
3672
3671
  }
3673
3672
  });
3674
3673
  box._delegateEvents.on(TELE_BOX_DELEGATE_EVENT.Minimize, () => {
3675
- var _a2;
3676
3674
  if (box.boxStatus && this.useBoxesStatus) {
3677
- if (this.topBox === box) {
3678
- if ((_a2 = this.topBox) == null ? void 0 : _a2.focus) {
3679
- this.blurBox(this.topBox);
3680
- }
3675
+ if (box.focus) {
3676
+ this.blurBox(box);
3681
3677
  }
3682
3678
  this.setBox(box, {
3683
3679
  status: TELE_BOX_STATE.Minimized,
@@ -3690,6 +3686,9 @@ class TeleBoxManager {
3690
3686
  }
3691
3687
  });
3692
3688
  box._delegateEvents.on(TELE_BOX_DELEGATE_EVENT.Close, () => {
3689
+ if (this.useBoxesStatus && box.focus) {
3690
+ this.blurBox(box);
3691
+ }
3693
3692
  this.remove(box);
3694
3693
  this.focusTopBox();
3695
3694
  });