dockview-core 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.
- package/dist/cjs/api/component.api.d.ts +2 -2
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +3 -1
- package/dist/cjs/api/dockviewGroupPanelApi.js +24 -1
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +2 -2
- package/dist/cjs/dockview/components/titlebar/tabs.js +1 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +3 -3
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +5 -3
- package/dist/cjs/dockview/dockviewComponent.js +21 -5
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +2 -2
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +1 -1
- package/dist/cjs/dockview/events.d.ts +4 -4
- package/dist/cjs/dockview/events.js +14 -14
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +7 -2
- package/dist/cjs/overlay/overlay.js +25 -14
- package/dist/cjs/splitview/splitview.js +2 -0
- package/dist/dockview-core.amd.js +66 -25
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +66 -25
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +66 -25
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +66 -26
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +66 -25
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +66 -25
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +2 -2
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +3 -1
- package/dist/esm/api/dockviewGroupPanelApi.js +13 -1
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +2 -2
- package/dist/esm/dockview/components/titlebar/tabs.js +2 -2
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +3 -3
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +2 -2
- package/dist/esm/dockview/dockviewComponent.d.ts +5 -3
- package/dist/esm/dockview/dockviewComponent.js +21 -6
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +2 -2
- package/dist/esm/dockview/dockviewGroupPanelModel.js +2 -2
- package/dist/esm/dockview/events.d.ts +4 -4
- package/dist/esm/dockview/events.js +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/overlay/overlay.js +26 -15
- package/dist/esm/splitview/splitview.js +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.13.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -1294,11 +1294,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
5160
5162
|
}
|
|
5161
5163
|
}
|
|
5162
5164
|
|
|
5163
|
-
class
|
|
5165
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5164
5166
|
get kind() {
|
|
5165
5167
|
return this.options.kind;
|
|
5166
5168
|
}
|
|
@@ -5508,7 +5510,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5508
5510
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5509
5511
|
});
|
|
5510
5512
|
}), tab.onWillShowOverlay((event) => {
|
|
5511
|
-
this._onWillShowOverlay.fire(new
|
|
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'], (function (exports) { 'use strict';
|
|
|
5672
5674
|
index: this.tabs.size,
|
|
5673
5675
|
});
|
|
5674
5676
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5675
|
-
this._onWillShowOverlay.fire(new
|
|
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'], (function (exports) { 'use strict';
|
|
|
6066
6068
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6067
6069
|
this._onWillShowOverlay.fire(event);
|
|
6068
6070
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6069
|
-
this._onWillShowOverlay.fire(new
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
7694
7708
|
let right = undefined;
|
|
7695
7709
|
let width = undefined;
|
|
7696
7710
|
const moveTop = () => {
|
|
7697
|
-
|
|
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
|
-
?
|
|
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'], (function (exports) { 'use strict';
|
|
|
7711
7728
|
top =
|
|
7712
7729
|
startPosition.originalY -
|
|
7713
7730
|
startPosition.originalHeight;
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
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
|
|
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
|
-
|
|
7743
|
+
const maxLeft = startPosition.originalX +
|
|
7724
7744
|
startPosition.originalWidth >
|
|
7725
7745
|
containerRect.width
|
|
7726
|
-
?
|
|
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'], (function (exports) { 'use strict';
|
|
|
7737
7759
|
left =
|
|
7738
7760
|
startPosition.originalX -
|
|
7739
7761
|
startPosition.originalWidth;
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
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
|
|
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) {
|
|
@@ -8558,7 +8583,14 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8558
8583
|
if (options.debug) {
|
|
8559
8584
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8560
8585
|
}
|
|
8561
|
-
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.
|
|
8586
|
+
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(() => {
|
|
8587
|
+
/**
|
|
8588
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
8589
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
8590
|
+
* Debounced to avoid multiple calls when moving groups with multiple panels.
|
|
8591
|
+
*/
|
|
8592
|
+
this.debouncedUpdateAllPositions();
|
|
8593
|
+
}), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8562
8594
|
this.updateWatermark();
|
|
8563
8595
|
}), this.onDidAdd((event) => {
|
|
8564
8596
|
if (!this._moving) {
|
|
@@ -8595,7 +8627,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8595
8627
|
// option only available when no panels in primary grid
|
|
8596
8628
|
return;
|
|
8597
8629
|
}
|
|
8598
|
-
this._onWillShowOverlay.fire(new
|
|
8630
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8599
8631
|
kind: 'edge',
|
|
8600
8632
|
panel: undefined,
|
|
8601
8633
|
api: this._api,
|
|
@@ -9424,9 +9456,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9424
9456
|
}
|
|
9425
9457
|
this.updateWatermark();
|
|
9426
9458
|
// Force position updates for always visible panels after DOM layout is complete
|
|
9427
|
-
|
|
9428
|
-
this.overlayRenderContainer.updateAllPositions();
|
|
9429
|
-
});
|
|
9459
|
+
this.debouncedUpdateAllPositions();
|
|
9430
9460
|
this._onDidLayoutFromJSON.fire();
|
|
9431
9461
|
}
|
|
9432
9462
|
clear() {
|
|
@@ -9762,6 +9792,15 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9762
9792
|
}
|
|
9763
9793
|
return re;
|
|
9764
9794
|
}
|
|
9795
|
+
debouncedUpdateAllPositions() {
|
|
9796
|
+
if (this._updatePositionsFrameId !== undefined) {
|
|
9797
|
+
cancelAnimationFrame(this._updatePositionsFrameId);
|
|
9798
|
+
}
|
|
9799
|
+
this._updatePositionsFrameId = requestAnimationFrame(() => {
|
|
9800
|
+
this._updatePositionsFrameId = undefined;
|
|
9801
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9802
|
+
});
|
|
9803
|
+
}
|
|
9765
9804
|
movingLock(func) {
|
|
9766
9805
|
const isMoving = this._moving;
|
|
9767
9806
|
try {
|
|
@@ -10072,6 +10111,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
10072
10111
|
from.panels.forEach((panel) => {
|
|
10073
10112
|
this._onDidMovePanel.fire({ panel, from });
|
|
10074
10113
|
});
|
|
10114
|
+
this.debouncedUpdateAllPositions();
|
|
10075
10115
|
// Ensure group becomes active after move
|
|
10076
10116
|
if (options.skipSetActive === false) {
|
|
10077
10117
|
// Only activate when explicitly requested (skipSetActive: false)
|
|
@@ -11277,6 +11317,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
11277
11317
|
exports.DockviewPanel = DockviewPanel;
|
|
11278
11318
|
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
11279
11319
|
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
11320
|
+
exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
|
|
11280
11321
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
11281
11322
|
exports.Gridview = Gridview;
|
|
11282
11323
|
exports.GridviewApi = GridviewApi;
|