dockview-angular 4.12.0 → 4.13.0

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-angular
3
- * @version 4.12.0
3
+ * @version 4.13.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -1294,11 +1294,13 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
1294
1294
  document.removeEventListener('pointermove', onPointerMove);
1295
1295
  document.removeEventListener('pointerup', end);
1296
1296
  document.removeEventListener('pointercancel', end);
1297
+ document.removeEventListener('contextmenu', end);
1297
1298
  this._onDidSashEnd.fire(undefined);
1298
1299
  };
1299
1300
  document.addEventListener('pointermove', onPointerMove);
1300
1301
  document.addEventListener('pointerup', end);
1301
1302
  document.addEventListener('pointercancel', end);
1303
+ document.addEventListener('contextmenu', end);
1302
1304
  };
1303
1305
  sash.addEventListener('pointerdown', onPointerStart);
1304
1306
  const sashItem = {
@@ -5160,7 +5162,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
5160
5162
  }
5161
5163
  }
5162
5164
 
5163
- class WillShowOverlayLocationEvent {
5165
+ class DockviewWillShowOverlayLocationEvent {
5164
5166
  get kind() {
5165
5167
  return this.options.kind;
5166
5168
  }
@@ -5508,7 +5510,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
5508
5510
  index: this._tabs.findIndex((x) => x.value === tab),
5509
5511
  });
5510
5512
  }), tab.onWillShowOverlay((event) => {
5511
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
5513
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
5512
5514
  kind: 'tab',
5513
5515
  panel: this.group.activePanel,
5514
5516
  api: this.accessor.api,
@@ -5672,7 +5674,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
5672
5674
  index: this.tabs.size,
5673
5675
  });
5674
5676
  }), this.voidContainer.onWillShowOverlay((event) => {
5675
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
5677
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
5676
5678
  kind: 'header_space',
5677
5679
  panel: this.group.activePanel,
5678
5680
  api: this.accessor.api,
@@ -6066,7 +6068,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
6066
6068
  }), this.tabsContainer.onWillShowOverlay((event) => {
6067
6069
  this._onWillShowOverlay.fire(event);
6068
6070
  }), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
6069
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
6071
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
6070
6072
  kind: 'content',
6071
6073
  panel: this.activePanel,
6072
6074
  api: this._api,
@@ -6742,7 +6744,19 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
6742
6744
  this.onDidLocationChange = this._onDidLocationChange.event;
6743
6745
  this._onDidActivePanelChange = new Emitter();
6744
6746
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
6745
- this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange);
6747
+ this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
6748
+ // When becoming visible, apply any pending size change
6749
+ if (event.isVisible && this._pendingSize) {
6750
+ super.setSize(this._pendingSize);
6751
+ this._pendingSize = undefined;
6752
+ }
6753
+ }));
6754
+ }
6755
+ setSize(event) {
6756
+ // Always store the requested size
6757
+ this._pendingSize = Object.assign({}, event);
6758
+ // Apply the size change immediately
6759
+ super.setSize(event);
6746
6760
  }
6747
6761
  close() {
6748
6762
  if (!this._group) {
@@ -7694,13 +7708,16 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
7694
7708
  let right = undefined;
7695
7709
  let width = undefined;
7696
7710
  const moveTop = () => {
7697
- top = clamp(y, -Number.MAX_VALUE, startPosition.originalY +
7711
+ // When dragging top handle, constrain top position to prevent oversizing
7712
+ const maxTop = startPosition.originalY +
7698
7713
  startPosition.originalHeight >
7699
7714
  containerRect.height
7700
- ? this.getMinimumHeight(containerRect.height)
7715
+ ? Math.max(0, containerRect.height -
7716
+ Overlay.MINIMUM_HEIGHT)
7701
7717
  : Math.max(0, startPosition.originalY +
7702
7718
  startPosition.originalHeight -
7703
- Overlay.MINIMUM_HEIGHT));
7719
+ Overlay.MINIMUM_HEIGHT);
7720
+ top = clamp(y, 0, maxTop);
7704
7721
  height =
7705
7722
  startPosition.originalY +
7706
7723
  startPosition.originalHeight -
@@ -7711,22 +7728,27 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
7711
7728
  top =
7712
7729
  startPosition.originalY -
7713
7730
  startPosition.originalHeight;
7714
- height = clamp(y - top, top < 0 &&
7715
- typeof this.options
7716
- .minimumInViewportHeight === 'number'
7731
+ // When dragging bottom handle, constrain height to container height
7732
+ const minHeight = top < 0 &&
7733
+ typeof this.options.minimumInViewportHeight ===
7734
+ 'number'
7717
7735
  ? -top +
7718
7736
  this.options.minimumInViewportHeight
7719
- : Overlay.MINIMUM_HEIGHT, Number.MAX_VALUE);
7737
+ : Overlay.MINIMUM_HEIGHT;
7738
+ const maxHeight = containerRect.height - Math.max(0, top);
7739
+ height = clamp(y - top, minHeight, maxHeight);
7720
7740
  bottom = containerRect.height - top - height;
7721
7741
  };
7722
7742
  const moveLeft = () => {
7723
- left = clamp(x, -Number.MAX_VALUE, startPosition.originalX +
7743
+ const maxLeft = startPosition.originalX +
7724
7744
  startPosition.originalWidth >
7725
7745
  containerRect.width
7726
- ? this.getMinimumWidth(containerRect.width)
7746
+ ? Math.max(0, containerRect.width -
7747
+ Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
7727
7748
  : Math.max(0, startPosition.originalX +
7728
7749
  startPosition.originalWidth -
7729
- Overlay.MINIMUM_WIDTH));
7750
+ Overlay.MINIMUM_WIDTH);
7751
+ left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
7730
7752
  width =
7731
7753
  startPosition.originalX +
7732
7754
  startPosition.originalWidth -
@@ -7737,12 +7759,15 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
7737
7759
  left =
7738
7760
  startPosition.originalX -
7739
7761
  startPosition.originalWidth;
7740
- width = clamp(x - left, left < 0 &&
7741
- typeof this.options
7742
- .minimumInViewportWidth === 'number'
7762
+ // When dragging right handle, constrain width to container width
7763
+ const minWidth = left < 0 &&
7764
+ typeof this.options.minimumInViewportWidth ===
7765
+ 'number'
7743
7766
  ? -left +
7744
7767
  this.options.minimumInViewportWidth
7745
- : Overlay.MINIMUM_WIDTH, Number.MAX_VALUE);
7768
+ : Overlay.MINIMUM_WIDTH;
7769
+ const maxWidth = containerRect.width - Math.max(0, left);
7770
+ width = clamp(x - left, minWidth, maxWidth);
7746
7771
  right = containerRect.width - left - width;
7747
7772
  };
7748
7773
  switch (direction) {
@@ -8572,7 +8597,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
8572
8597
  // option only available when no panels in primary grid
8573
8598
  return;
8574
8599
  }
8575
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
8600
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
8576
8601
  kind: 'edge',
8577
8602
  panel: undefined,
8578
8603
  api: this._api,
@@ -9809,6 +9834,13 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
9809
9834
  panel: removedPanel,
9810
9835
  from: sourceGroup,
9811
9836
  });
9837
+ /**
9838
+ * Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
9839
+ * With defaultRenderer="always" this results in panel content not showing after move operations.
9840
+ */
9841
+ requestAnimationFrame(() => {
9842
+ this.overlayRenderContainer.updateAllPositions();
9843
+ });
9812
9844
  }
9813
9845
  else {
9814
9846
  /**
@@ -13112,6 +13144,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
13112
13144
  exports.DockviewPanel = DockviewPanel;
13113
13145
  exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
13114
13146
  exports.DockviewWillDropEvent = DockviewWillDropEvent;
13147
+ exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
13115
13148
  exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
13116
13149
  exports.Gridview = Gridview;
13117
13150
  exports.GridviewApi = GridviewApi;