dockview-angular 0.0.0-experimental-e3d91d1-20251227 → 0.0.0-experimental-9b12ca8-20251228

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 0.0.0-experimental-e3d91d1-20251227
3
+ * @version 0.0.0-experimental-9b12ca8-20251228
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -5162,7 +5162,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
5162
5162
  }
5163
5163
  }
5164
5164
 
5165
- class WillShowOverlayLocationEvent {
5165
+ class DockviewWillShowOverlayLocationEvent {
5166
5166
  get kind() {
5167
5167
  return this.options.kind;
5168
5168
  }
@@ -5510,7 +5510,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
5510
5510
  index: this._tabs.findIndex((x) => x.value === tab),
5511
5511
  });
5512
5512
  }), tab.onWillShowOverlay((event) => {
5513
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
5513
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
5514
5514
  kind: 'tab',
5515
5515
  panel: this.group.activePanel,
5516
5516
  api: this.accessor.api,
@@ -5674,7 +5674,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
5674
5674
  index: this.tabs.size,
5675
5675
  });
5676
5676
  }), this.voidContainer.onWillShowOverlay((event) => {
5677
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
5677
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
5678
5678
  kind: 'header_space',
5679
5679
  panel: this.group.activePanel,
5680
5680
  api: this.accessor.api,
@@ -6068,7 +6068,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
6068
6068
  }), this.tabsContainer.onWillShowOverlay((event) => {
6069
6069
  this._onWillShowOverlay.fire(event);
6070
6070
  }), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
6071
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
6071
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
6072
6072
  kind: 'content',
6073
6073
  panel: this.activePanel,
6074
6074
  api: this._api,
@@ -6744,7 +6744,19 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
6744
6744
  this.onDidLocationChange = this._onDidLocationChange.event;
6745
6745
  this._onDidActivePanelChange = new Emitter();
6746
6746
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
6747
- 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);
6748
6760
  }
6749
6761
  close() {
6750
6762
  if (!this._group) {
@@ -7696,13 +7708,16 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
7696
7708
  let right = undefined;
7697
7709
  let width = undefined;
7698
7710
  const moveTop = () => {
7699
- top = clamp(y, -Number.MAX_VALUE, startPosition.originalY +
7711
+ // When dragging top handle, constrain top position to prevent oversizing
7712
+ const maxTop = startPosition.originalY +
7700
7713
  startPosition.originalHeight >
7701
7714
  containerRect.height
7702
- ? this.getMinimumHeight(containerRect.height)
7715
+ ? Math.max(0, containerRect.height -
7716
+ Overlay.MINIMUM_HEIGHT)
7703
7717
  : Math.max(0, startPosition.originalY +
7704
7718
  startPosition.originalHeight -
7705
- Overlay.MINIMUM_HEIGHT));
7719
+ Overlay.MINIMUM_HEIGHT);
7720
+ top = clamp(y, 0, maxTop);
7706
7721
  height =
7707
7722
  startPosition.originalY +
7708
7723
  startPosition.originalHeight -
@@ -7713,22 +7728,27 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
7713
7728
  top =
7714
7729
  startPosition.originalY -
7715
7730
  startPosition.originalHeight;
7716
- height = clamp(y - top, top < 0 &&
7717
- typeof this.options
7718
- .minimumInViewportHeight === 'number'
7731
+ // When dragging bottom handle, constrain height to container height
7732
+ const minHeight = top < 0 &&
7733
+ typeof this.options.minimumInViewportHeight ===
7734
+ 'number'
7719
7735
  ? -top +
7720
7736
  this.options.minimumInViewportHeight
7721
- : 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);
7722
7740
  bottom = containerRect.height - top - height;
7723
7741
  };
7724
7742
  const moveLeft = () => {
7725
- left = clamp(x, -Number.MAX_VALUE, startPosition.originalX +
7743
+ const maxLeft = startPosition.originalX +
7726
7744
  startPosition.originalWidth >
7727
7745
  containerRect.width
7728
- ? this.getMinimumWidth(containerRect.width)
7746
+ ? Math.max(0, containerRect.width -
7747
+ Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
7729
7748
  : Math.max(0, startPosition.originalX +
7730
7749
  startPosition.originalWidth -
7731
- Overlay.MINIMUM_WIDTH));
7750
+ Overlay.MINIMUM_WIDTH);
7751
+ left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
7732
7752
  width =
7733
7753
  startPosition.originalX +
7734
7754
  startPosition.originalWidth -
@@ -7739,12 +7759,15 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
7739
7759
  left =
7740
7760
  startPosition.originalX -
7741
7761
  startPosition.originalWidth;
7742
- width = clamp(x - left, left < 0 &&
7743
- typeof this.options
7744
- .minimumInViewportWidth === 'number'
7762
+ // When dragging right handle, constrain width to container width
7763
+ const minWidth = left < 0 &&
7764
+ typeof this.options.minimumInViewportWidth ===
7765
+ 'number'
7745
7766
  ? -left +
7746
7767
  this.options.minimumInViewportWidth
7747
- : 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);
7748
7771
  right = containerRect.width - left - width;
7749
7772
  };
7750
7773
  switch (direction) {
@@ -8537,7 +8560,14 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
8537
8560
  if (options.debug) {
8538
8561
  this.addDisposables(new StrictEventsSequencing(this));
8539
8562
  }
8540
- this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
8563
+ this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidMovePanel.event(() => {
8564
+ /**
8565
+ * Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
8566
+ * With defaultRenderer="always" this results in panel content not showing after move operations.
8567
+ * Debounced to avoid multiple calls when moving groups with multiple panels.
8568
+ */
8569
+ this.debouncedUpdateAllPositions();
8570
+ }), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
8541
8571
  this.updateWatermark();
8542
8572
  }), this.onDidAdd((event) => {
8543
8573
  if (!this._moving) {
@@ -8574,7 +8604,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
8574
8604
  // option only available when no panels in primary grid
8575
8605
  return;
8576
8606
  }
8577
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
8607
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
8578
8608
  kind: 'edge',
8579
8609
  panel: undefined,
8580
8610
  api: this._api,
@@ -9741,6 +9771,15 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
9741
9771
  }
9742
9772
  return re;
9743
9773
  }
9774
+ debouncedUpdateAllPositions() {
9775
+ if (this._updatePositionsFrameId !== undefined) {
9776
+ cancelAnimationFrame(this._updatePositionsFrameId);
9777
+ }
9778
+ this._updatePositionsFrameId = requestAnimationFrame(() => {
9779
+ this._updatePositionsFrameId = undefined;
9780
+ this.overlayRenderContainer.updateAllPositions();
9781
+ });
9782
+ }
9744
9783
  movingLock(func) {
9745
9784
  const isMoving = this._moving;
9746
9785
  try {
@@ -13114,6 +13153,7 @@ define(['exports', '@angular/core', '@angular/common', 'rxjs'], (function (expor
13114
13153
  exports.DockviewPanel = DockviewPanel;
13115
13154
  exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
13116
13155
  exports.DockviewWillDropEvent = DockviewWillDropEvent;
13156
+ exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
13117
13157
  exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
13118
13158
  exports.Gridview = Gridview;
13119
13159
  exports.GridviewApi = GridviewApi;