dockview-react 4.13.0 → 4.13.1

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-react
3
- * @version 4.13.0
3
+ * @version 4.13.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -8561,7 +8561,14 @@ class DockviewComponent extends BaseGrid {
8561
8561
  if (options.debug) {
8562
8562
  this.addDisposables(new StrictEventsSequencing(this));
8563
8563
  }
8564
- 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(() => {
8564
+ 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(() => {
8565
+ /**
8566
+ * Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
8567
+ * With defaultRenderer="always" this results in panel content not showing after move operations.
8568
+ * Debounced to avoid multiple calls when moving groups with multiple panels.
8569
+ */
8570
+ this.debouncedUpdateAllPositions();
8571
+ }), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
8565
8572
  this.updateWatermark();
8566
8573
  }), this.onDidAdd((event) => {
8567
8574
  if (!this._moving) {
@@ -9427,9 +9434,7 @@ class DockviewComponent extends BaseGrid {
9427
9434
  }
9428
9435
  this.updateWatermark();
9429
9436
  // Force position updates for always visible panels after DOM layout is complete
9430
- requestAnimationFrame(() => {
9431
- this.overlayRenderContainer.updateAllPositions();
9432
- });
9437
+ this.debouncedUpdateAllPositions();
9433
9438
  this._onDidLayoutFromJSON.fire();
9434
9439
  }
9435
9440
  clear() {
@@ -9765,6 +9770,15 @@ class DockviewComponent extends BaseGrid {
9765
9770
  }
9766
9771
  return re;
9767
9772
  }
9773
+ debouncedUpdateAllPositions() {
9774
+ if (this._updatePositionsFrameId !== undefined) {
9775
+ cancelAnimationFrame(this._updatePositionsFrameId);
9776
+ }
9777
+ this._updatePositionsFrameId = requestAnimationFrame(() => {
9778
+ this._updatePositionsFrameId = undefined;
9779
+ this.overlayRenderContainer.updateAllPositions();
9780
+ });
9781
+ }
9768
9782
  movingLock(func) {
9769
9783
  const isMoving = this._moving;
9770
9784
  try {
@@ -9835,13 +9849,6 @@ class DockviewComponent extends BaseGrid {
9835
9849
  panel: removedPanel,
9836
9850
  from: sourceGroup,
9837
9851
  });
9838
- /**
9839
- * Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
9840
- * With defaultRenderer="always" this results in panel content not showing after move operations.
9841
- */
9842
- requestAnimationFrame(() => {
9843
- this.overlayRenderContainer.updateAllPositions();
9844
- });
9845
9852
  }
9846
9853
  else {
9847
9854
  /**
@@ -10082,6 +10089,7 @@ class DockviewComponent extends BaseGrid {
10082
10089
  from.panels.forEach((panel) => {
10083
10090
  this._onDidMovePanel.fire({ panel, from });
10084
10091
  });
10092
+ this.debouncedUpdateAllPositions();
10085
10093
  // Ensure group becomes active after move
10086
10094
  if (options.skipSetActive === false) {
10087
10095
  // Only activate when explicitly requested (skipSetActive: false)