dockview-angular 4.12.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-angular
3
- * @version 4.12.0
3
+ * @version 4.13.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -1296,11 +1296,13 @@ class Splitview {
1296
1296
  document.removeEventListener('pointermove', onPointerMove);
1297
1297
  document.removeEventListener('pointerup', end);
1298
1298
  document.removeEventListener('pointercancel', end);
1299
+ document.removeEventListener('contextmenu', end);
1299
1300
  this._onDidSashEnd.fire(undefined);
1300
1301
  };
1301
1302
  document.addEventListener('pointermove', onPointerMove);
1302
1303
  document.addEventListener('pointerup', end);
1303
1304
  document.addEventListener('pointercancel', end);
1305
+ document.addEventListener('contextmenu', end);
1304
1306
  };
1305
1307
  sash.addEventListener('pointerdown', onPointerStart);
1306
1308
  const sashItem = {
@@ -5162,7 +5164,7 @@ class Tab extends CompositeDisposable {
5162
5164
  }
5163
5165
  }
5164
5166
 
5165
- class WillShowOverlayLocationEvent {
5167
+ class DockviewWillShowOverlayLocationEvent {
5166
5168
  get kind() {
5167
5169
  return this.options.kind;
5168
5170
  }
@@ -5510,7 +5512,7 @@ class Tabs extends CompositeDisposable {
5510
5512
  index: this._tabs.findIndex((x) => x.value === tab),
5511
5513
  });
5512
5514
  }), tab.onWillShowOverlay((event) => {
5513
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
5515
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
5514
5516
  kind: 'tab',
5515
5517
  panel: this.group.activePanel,
5516
5518
  api: this.accessor.api,
@@ -5674,7 +5676,7 @@ class TabsContainer extends CompositeDisposable {
5674
5676
  index: this.tabs.size,
5675
5677
  });
5676
5678
  }), this.voidContainer.onWillShowOverlay((event) => {
5677
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
5679
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
5678
5680
  kind: 'header_space',
5679
5681
  panel: this.group.activePanel,
5680
5682
  api: this.accessor.api,
@@ -6068,7 +6070,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
6068
6070
  }), this.tabsContainer.onWillShowOverlay((event) => {
6069
6071
  this._onWillShowOverlay.fire(event);
6070
6072
  }), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
6071
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
6073
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
6072
6074
  kind: 'content',
6073
6075
  panel: this.activePanel,
6074
6076
  api: this._api,
@@ -6744,7 +6746,19 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
6744
6746
  this.onDidLocationChange = this._onDidLocationChange.event;
6745
6747
  this._onDidActivePanelChange = new Emitter();
6746
6748
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
6747
- this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange);
6749
+ this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
6750
+ // When becoming visible, apply any pending size change
6751
+ if (event.isVisible && this._pendingSize) {
6752
+ super.setSize(this._pendingSize);
6753
+ this._pendingSize = undefined;
6754
+ }
6755
+ }));
6756
+ }
6757
+ setSize(event) {
6758
+ // Always store the requested size
6759
+ this._pendingSize = Object.assign({}, event);
6760
+ // Apply the size change immediately
6761
+ super.setSize(event);
6748
6762
  }
6749
6763
  close() {
6750
6764
  if (!this._group) {
@@ -7696,13 +7710,16 @@ class Overlay extends CompositeDisposable {
7696
7710
  let right = undefined;
7697
7711
  let width = undefined;
7698
7712
  const moveTop = () => {
7699
- top = clamp(y, -Number.MAX_VALUE, startPosition.originalY +
7713
+ // When dragging top handle, constrain top position to prevent oversizing
7714
+ const maxTop = startPosition.originalY +
7700
7715
  startPosition.originalHeight >
7701
7716
  containerRect.height
7702
- ? this.getMinimumHeight(containerRect.height)
7717
+ ? Math.max(0, containerRect.height -
7718
+ Overlay.MINIMUM_HEIGHT)
7703
7719
  : Math.max(0, startPosition.originalY +
7704
7720
  startPosition.originalHeight -
7705
- Overlay.MINIMUM_HEIGHT));
7721
+ Overlay.MINIMUM_HEIGHT);
7722
+ top = clamp(y, 0, maxTop);
7706
7723
  height =
7707
7724
  startPosition.originalY +
7708
7725
  startPosition.originalHeight -
@@ -7713,22 +7730,27 @@ class Overlay extends CompositeDisposable {
7713
7730
  top =
7714
7731
  startPosition.originalY -
7715
7732
  startPosition.originalHeight;
7716
- height = clamp(y - top, top < 0 &&
7717
- typeof this.options
7718
- .minimumInViewportHeight === 'number'
7733
+ // When dragging bottom handle, constrain height to container height
7734
+ const minHeight = top < 0 &&
7735
+ typeof this.options.minimumInViewportHeight ===
7736
+ 'number'
7719
7737
  ? -top +
7720
7738
  this.options.minimumInViewportHeight
7721
- : Overlay.MINIMUM_HEIGHT, Number.MAX_VALUE);
7739
+ : Overlay.MINIMUM_HEIGHT;
7740
+ const maxHeight = containerRect.height - Math.max(0, top);
7741
+ height = clamp(y - top, minHeight, maxHeight);
7722
7742
  bottom = containerRect.height - top - height;
7723
7743
  };
7724
7744
  const moveLeft = () => {
7725
- left = clamp(x, -Number.MAX_VALUE, startPosition.originalX +
7745
+ const maxLeft = startPosition.originalX +
7726
7746
  startPosition.originalWidth >
7727
7747
  containerRect.width
7728
- ? this.getMinimumWidth(containerRect.width)
7748
+ ? Math.max(0, containerRect.width -
7749
+ Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
7729
7750
  : Math.max(0, startPosition.originalX +
7730
7751
  startPosition.originalWidth -
7731
- Overlay.MINIMUM_WIDTH));
7752
+ Overlay.MINIMUM_WIDTH);
7753
+ left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
7732
7754
  width =
7733
7755
  startPosition.originalX +
7734
7756
  startPosition.originalWidth -
@@ -7739,12 +7761,15 @@ class Overlay extends CompositeDisposable {
7739
7761
  left =
7740
7762
  startPosition.originalX -
7741
7763
  startPosition.originalWidth;
7742
- width = clamp(x - left, left < 0 &&
7743
- typeof this.options
7744
- .minimumInViewportWidth === 'number'
7764
+ // When dragging right handle, constrain width to container width
7765
+ const minWidth = left < 0 &&
7766
+ typeof this.options.minimumInViewportWidth ===
7767
+ 'number'
7745
7768
  ? -left +
7746
7769
  this.options.minimumInViewportWidth
7747
- : Overlay.MINIMUM_WIDTH, Number.MAX_VALUE);
7770
+ : Overlay.MINIMUM_WIDTH;
7771
+ const maxWidth = containerRect.width - Math.max(0, left);
7772
+ width = clamp(x - left, minWidth, maxWidth);
7748
7773
  right = containerRect.width - left - width;
7749
7774
  };
7750
7775
  switch (direction) {
@@ -8537,7 +8562,14 @@ class DockviewComponent extends BaseGrid {
8537
8562
  if (options.debug) {
8538
8563
  this.addDisposables(new StrictEventsSequencing(this));
8539
8564
  }
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(() => {
8565
+ 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(() => {
8566
+ /**
8567
+ * Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
8568
+ * With defaultRenderer="always" this results in panel content not showing after move operations.
8569
+ * Debounced to avoid multiple calls when moving groups with multiple panels.
8570
+ */
8571
+ this.debouncedUpdateAllPositions();
8572
+ }), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
8541
8573
  this.updateWatermark();
8542
8574
  }), this.onDidAdd((event) => {
8543
8575
  if (!this._moving) {
@@ -8574,7 +8606,7 @@ class DockviewComponent extends BaseGrid {
8574
8606
  // option only available when no panels in primary grid
8575
8607
  return;
8576
8608
  }
8577
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
8609
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
8578
8610
  kind: 'edge',
8579
8611
  panel: undefined,
8580
8612
  api: this._api,
@@ -9403,9 +9435,7 @@ class DockviewComponent extends BaseGrid {
9403
9435
  }
9404
9436
  this.updateWatermark();
9405
9437
  // Force position updates for always visible panels after DOM layout is complete
9406
- requestAnimationFrame(() => {
9407
- this.overlayRenderContainer.updateAllPositions();
9408
- });
9438
+ this.debouncedUpdateAllPositions();
9409
9439
  this._onDidLayoutFromJSON.fire();
9410
9440
  }
9411
9441
  clear() {
@@ -9741,6 +9771,15 @@ class DockviewComponent extends BaseGrid {
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 {
@@ -10051,6 +10090,7 @@ class DockviewComponent extends BaseGrid {
10051
10090
  from.panels.forEach((panel) => {
10052
10091
  this._onDidMovePanel.fire({ panel, from });
10053
10092
  });
10093
+ this.debouncedUpdateAllPositions();
10054
10094
  // Ensure group becomes active after move
10055
10095
  if (options.skipSetActive === false) {
10056
10096
  // Only activate when explicitly requested (skipSetActive: false)
@@ -13095,5 +13135,5 @@ DockviewAngularModule = __decorate([
13095
13135
  })
13096
13136
  ], DockviewAngularModule);
13097
13137
 
13098
- export { AngularDisposable, AngularFrameworkComponentFactory, AngularLifecycleManager, AngularRenderer, BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewAngularComponent, DockviewAngularModule, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DraggablePaneviewPanel, Gridview, GridviewAngularComponent, GridviewApi, GridviewComponent, GridviewPanel, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewAngularComponent, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewUnhandledDragOverEvent, SashState, Sizing, Splitview, SplitviewAngularComponent, SplitviewApi, SplitviewComponent, SplitviewPanel, Tab, createAngularDisposable, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget };
13138
+ export { AngularDisposable, AngularFrameworkComponentFactory, AngularLifecycleManager, AngularRenderer, BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewAngularComponent, DockviewAngularModule, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DockviewWillShowOverlayLocationEvent, DraggablePaneviewPanel, Gridview, GridviewAngularComponent, GridviewApi, GridviewComponent, GridviewPanel, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewAngularComponent, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewUnhandledDragOverEvent, SashState, Sizing, Splitview, SplitviewAngularComponent, SplitviewApi, SplitviewComponent, SplitviewPanel, Tab, createAngularDisposable, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget };
13099
13139
  //# sourceMappingURL=dockview-angular.esm.js.map