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
  */
@@ -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) {
@@ -8574,7 +8599,7 @@ class DockviewComponent extends BaseGrid {
8574
8599
  // option only available when no panels in primary grid
8575
8600
  return;
8576
8601
  }
8577
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
8602
+ this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
8578
8603
  kind: 'edge',
8579
8604
  panel: undefined,
8580
8605
  api: this._api,
@@ -9811,6 +9836,13 @@ class DockviewComponent extends BaseGrid {
9811
9836
  panel: removedPanel,
9812
9837
  from: sourceGroup,
9813
9838
  });
9839
+ /**
9840
+ * Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
9841
+ * With defaultRenderer="always" this results in panel content not showing after move operations.
9842
+ */
9843
+ requestAnimationFrame(() => {
9844
+ this.overlayRenderContainer.updateAllPositions();
9845
+ });
9814
9846
  }
9815
9847
  else {
9816
9848
  /**
@@ -13095,5 +13127,5 @@ DockviewAngularModule = __decorate([
13095
13127
  })
13096
13128
  ], DockviewAngularModule);
13097
13129
 
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 };
13130
+ 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
13131
  //# sourceMappingURL=dockview-angular.esm.js.map