@netless/telebox-insider 0.2.18 → 0.2.19

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/telebox-insider",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "private": false,
5
5
  "description": "Window widget for Whiteboard",
6
6
  "license": "MIT",
@@ -432,25 +432,38 @@ export class TeleBoxManager {
432
432
  this.remove(box);
433
433
  this.focusTopBox();
434
434
  });
435
- box.events.on(TELE_BOX_EVENT.Move, () => {
436
- this.events.emit(TELE_BOX_MANAGER_EVENT.Move, box);
435
+ box._coord$.reaction((_, __, skipUpdate) => {
436
+ if (!skipUpdate) {
437
+ this.events.emit(TELE_BOX_MANAGER_EVENT.Move, box);
438
+ }
437
439
  });
438
- box.events.on(TELE_BOX_EVENT.Resize, () => {
439
- this.events.emit(TELE_BOX_MANAGER_EVENT.Resize, box);
440
+ box._size$.reaction((_, __, skipUpdate) => {
441
+ if (!skipUpdate) {
442
+ this.events.emit(TELE_BOX_MANAGER_EVENT.Resize, box);
443
+ }
440
444
  });
441
- box.events.on(TELE_BOX_EVENT.IntrinsicMove, () => {
442
- this.events.emit(TELE_BOX_MANAGER_EVENT.IntrinsicMove, box);
445
+ box._intrinsicCoord$.reaction((_, __, skipUpdate) => {
446
+ if (!skipUpdate) {
447
+ this.events.emit(TELE_BOX_MANAGER_EVENT.IntrinsicMove, box);
448
+ }
443
449
  });
444
- box.events.on(TELE_BOX_EVENT.IntrinsicResize, () => {
445
- this.events.emit(TELE_BOX_MANAGER_EVENT.IntrinsicResize, box);
450
+ box._intrinsicSize$.reaction((_, __, skipUpdate) => {
451
+ if (!skipUpdate) {
452
+ this.events.emit(TELE_BOX_MANAGER_EVENT.IntrinsicResize, box);
453
+ }
446
454
  });
447
- box.events.on(TELE_BOX_EVENT.VisualResize, () => {
448
- this.events.emit(TELE_BOX_MANAGER_EVENT.VisualResize, box);
455
+ box._visualSize$.reaction((_, __, skipUpdate) => {
456
+ if (!skipUpdate) {
457
+ this.events.emit(TELE_BOX_MANAGER_EVENT.VisualResize, box);
458
+ }
449
459
  });
450
- box.events.on(TELE_BOX_EVENT.ZIndex, () => {
460
+ box._zIndex$.reaction((_, __, skipUpdate) => {
451
461
  if (this.topBox && box.zIndex > this.topBox.zIndex) {
452
462
  this.topBox$.setValue(box);
453
463
  }
464
+ if (!skipUpdate) {
465
+ this.events.emit(TELE_BOX_MANAGER_EVENT.ZIndex, box);
466
+ }
454
467
  });
455
468
  this.events.emit(TELE_BOX_MANAGER_EVENT.Created, box);
456
469
 
@@ -658,16 +671,16 @@ export class TeleBoxManager {
658
671
  box.setMinWidth(config.minWidth, skipUpdate);
659
672
  }
660
673
  if (config.resizable != null) {
661
- box.setResizable(config.resizable);
674
+ box.setResizable(config.resizable, skipUpdate);
662
675
  }
663
676
  if (config.draggable != null) {
664
- box.setDraggable(config.draggable);
677
+ box.setDraggable(config.draggable, skipUpdate);
665
678
  }
666
679
  if (config.fixRatio != null) {
667
680
  box.setFixRatio(config.fixRatio, skipUpdate);
668
681
  }
669
682
  if (config.zIndex != null) {
670
- box.setZIndex(config.zIndex);
683
+ box.setZIndex(config.zIndex, skipUpdate);
671
684
  }
672
685
  if (config.content != null) {
673
686
  box.mountContent(config.content);
@@ -722,9 +735,6 @@ export class TeleBoxManager {
722
735
  if (box !== this.topBox) {
723
736
  box.setZIndex(this.topBox.zIndex + 1, skipUpdate);
724
737
  this.topBox$.setValue(box);
725
- if (!skipUpdate) {
726
- this.events.emit(TELE_BOX_MANAGER_EVENT.ZIndex, box);
727
- }
728
738
  }
729
739
  }
730
740
  }