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
package/dist/dockview-core.js
CHANGED
|
@@ -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
|
*/
|
|
@@ -1298,11 +1298,13 @@
|
|
|
1298
1298
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1299
1299
|
document.removeEventListener('pointerup', end);
|
|
1300
1300
|
document.removeEventListener('pointercancel', end);
|
|
1301
|
+
document.removeEventListener('contextmenu', end);
|
|
1301
1302
|
this._onDidSashEnd.fire(undefined);
|
|
1302
1303
|
};
|
|
1303
1304
|
document.addEventListener('pointermove', onPointerMove);
|
|
1304
1305
|
document.addEventListener('pointerup', end);
|
|
1305
1306
|
document.addEventListener('pointercancel', end);
|
|
1307
|
+
document.addEventListener('contextmenu', end);
|
|
1306
1308
|
};
|
|
1307
1309
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1308
1310
|
const sashItem = {
|
|
@@ -5164,7 +5166,7 @@
|
|
|
5164
5166
|
}
|
|
5165
5167
|
}
|
|
5166
5168
|
|
|
5167
|
-
class
|
|
5169
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5168
5170
|
get kind() {
|
|
5169
5171
|
return this.options.kind;
|
|
5170
5172
|
}
|
|
@@ -5512,7 +5514,7 @@
|
|
|
5512
5514
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5513
5515
|
});
|
|
5514
5516
|
}), tab.onWillShowOverlay((event) => {
|
|
5515
|
-
this._onWillShowOverlay.fire(new
|
|
5517
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5516
5518
|
kind: 'tab',
|
|
5517
5519
|
panel: this.group.activePanel,
|
|
5518
5520
|
api: this.accessor.api,
|
|
@@ -5676,7 +5678,7 @@
|
|
|
5676
5678
|
index: this.tabs.size,
|
|
5677
5679
|
});
|
|
5678
5680
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5679
|
-
this._onWillShowOverlay.fire(new
|
|
5681
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5680
5682
|
kind: 'header_space',
|
|
5681
5683
|
panel: this.group.activePanel,
|
|
5682
5684
|
api: this.accessor.api,
|
|
@@ -6070,7 +6072,7 @@
|
|
|
6070
6072
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6071
6073
|
this._onWillShowOverlay.fire(event);
|
|
6072
6074
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6073
|
-
this._onWillShowOverlay.fire(new
|
|
6075
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6074
6076
|
kind: 'content',
|
|
6075
6077
|
panel: this.activePanel,
|
|
6076
6078
|
api: this._api,
|
|
@@ -6746,7 +6748,19 @@
|
|
|
6746
6748
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6747
6749
|
this._onDidActivePanelChange = new Emitter();
|
|
6748
6750
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6749
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6751
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6752
|
+
// When becoming visible, apply any pending size change
|
|
6753
|
+
if (event.isVisible && this._pendingSize) {
|
|
6754
|
+
super.setSize(this._pendingSize);
|
|
6755
|
+
this._pendingSize = undefined;
|
|
6756
|
+
}
|
|
6757
|
+
}));
|
|
6758
|
+
}
|
|
6759
|
+
setSize(event) {
|
|
6760
|
+
// Always store the requested size
|
|
6761
|
+
this._pendingSize = Object.assign({}, event);
|
|
6762
|
+
// Apply the size change immediately
|
|
6763
|
+
super.setSize(event);
|
|
6750
6764
|
}
|
|
6751
6765
|
close() {
|
|
6752
6766
|
if (!this._group) {
|
|
@@ -7698,13 +7712,16 @@
|
|
|
7698
7712
|
let right = undefined;
|
|
7699
7713
|
let width = undefined;
|
|
7700
7714
|
const moveTop = () => {
|
|
7701
|
-
|
|
7715
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7716
|
+
const maxTop = startPosition.originalY +
|
|
7702
7717
|
startPosition.originalHeight >
|
|
7703
7718
|
containerRect.height
|
|
7704
|
-
?
|
|
7719
|
+
? Math.max(0, containerRect.height -
|
|
7720
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7705
7721
|
: Math.max(0, startPosition.originalY +
|
|
7706
7722
|
startPosition.originalHeight -
|
|
7707
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7723
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7724
|
+
top = clamp(y, 0, maxTop);
|
|
7708
7725
|
height =
|
|
7709
7726
|
startPosition.originalY +
|
|
7710
7727
|
startPosition.originalHeight -
|
|
@@ -7715,22 +7732,27 @@
|
|
|
7715
7732
|
top =
|
|
7716
7733
|
startPosition.originalY -
|
|
7717
7734
|
startPosition.originalHeight;
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7735
|
+
// When dragging bottom handle, constrain height to container height
|
|
7736
|
+
const minHeight = top < 0 &&
|
|
7737
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7738
|
+
'number'
|
|
7721
7739
|
? -top +
|
|
7722
7740
|
this.options.minimumInViewportHeight
|
|
7723
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7741
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7742
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7743
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7724
7744
|
bottom = containerRect.height - top - height;
|
|
7725
7745
|
};
|
|
7726
7746
|
const moveLeft = () => {
|
|
7727
|
-
|
|
7747
|
+
const maxLeft = startPosition.originalX +
|
|
7728
7748
|
startPosition.originalWidth >
|
|
7729
7749
|
containerRect.width
|
|
7730
|
-
?
|
|
7750
|
+
? Math.max(0, containerRect.width -
|
|
7751
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7731
7752
|
: Math.max(0, startPosition.originalX +
|
|
7732
7753
|
startPosition.originalWidth -
|
|
7733
|
-
Overlay.MINIMUM_WIDTH)
|
|
7754
|
+
Overlay.MINIMUM_WIDTH);
|
|
7755
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7734
7756
|
width =
|
|
7735
7757
|
startPosition.originalX +
|
|
7736
7758
|
startPosition.originalWidth -
|
|
@@ -7741,12 +7763,15 @@
|
|
|
7741
7763
|
left =
|
|
7742
7764
|
startPosition.originalX -
|
|
7743
7765
|
startPosition.originalWidth;
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7766
|
+
// When dragging right handle, constrain width to container width
|
|
7767
|
+
const minWidth = left < 0 &&
|
|
7768
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7769
|
+
'number'
|
|
7747
7770
|
? -left +
|
|
7748
7771
|
this.options.minimumInViewportWidth
|
|
7749
|
-
: Overlay.MINIMUM_WIDTH
|
|
7772
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7773
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7774
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7750
7775
|
right = containerRect.width - left - width;
|
|
7751
7776
|
};
|
|
7752
7777
|
switch (direction) {
|
|
@@ -8562,7 +8587,14 @@
|
|
|
8562
8587
|
if (options.debug) {
|
|
8563
8588
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8564
8589
|
}
|
|
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.
|
|
8590
|
+
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(() => {
|
|
8591
|
+
/**
|
|
8592
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
8593
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
8594
|
+
* Debounced to avoid multiple calls when moving groups with multiple panels.
|
|
8595
|
+
*/
|
|
8596
|
+
this.debouncedUpdateAllPositions();
|
|
8597
|
+
}), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8566
8598
|
this.updateWatermark();
|
|
8567
8599
|
}), this.onDidAdd((event) => {
|
|
8568
8600
|
if (!this._moving) {
|
|
@@ -8599,7 +8631,7 @@
|
|
|
8599
8631
|
// option only available when no panels in primary grid
|
|
8600
8632
|
return;
|
|
8601
8633
|
}
|
|
8602
|
-
this._onWillShowOverlay.fire(new
|
|
8634
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8603
8635
|
kind: 'edge',
|
|
8604
8636
|
panel: undefined,
|
|
8605
8637
|
api: this._api,
|
|
@@ -9428,9 +9460,7 @@
|
|
|
9428
9460
|
}
|
|
9429
9461
|
this.updateWatermark();
|
|
9430
9462
|
// Force position updates for always visible panels after DOM layout is complete
|
|
9431
|
-
|
|
9432
|
-
this.overlayRenderContainer.updateAllPositions();
|
|
9433
|
-
});
|
|
9463
|
+
this.debouncedUpdateAllPositions();
|
|
9434
9464
|
this._onDidLayoutFromJSON.fire();
|
|
9435
9465
|
}
|
|
9436
9466
|
clear() {
|
|
@@ -9766,6 +9796,15 @@
|
|
|
9766
9796
|
}
|
|
9767
9797
|
return re;
|
|
9768
9798
|
}
|
|
9799
|
+
debouncedUpdateAllPositions() {
|
|
9800
|
+
if (this._updatePositionsFrameId !== undefined) {
|
|
9801
|
+
cancelAnimationFrame(this._updatePositionsFrameId);
|
|
9802
|
+
}
|
|
9803
|
+
this._updatePositionsFrameId = requestAnimationFrame(() => {
|
|
9804
|
+
this._updatePositionsFrameId = undefined;
|
|
9805
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9806
|
+
});
|
|
9807
|
+
}
|
|
9769
9808
|
movingLock(func) {
|
|
9770
9809
|
const isMoving = this._moving;
|
|
9771
9810
|
try {
|
|
@@ -10076,6 +10115,7 @@
|
|
|
10076
10115
|
from.panels.forEach((panel) => {
|
|
10077
10116
|
this._onDidMovePanel.fire({ panel, from });
|
|
10078
10117
|
});
|
|
10118
|
+
this.debouncedUpdateAllPositions();
|
|
10079
10119
|
// Ensure group becomes active after move
|
|
10080
10120
|
if (options.skipSetActive === false) {
|
|
10081
10121
|
// Only activate when explicitly requested (skipSetActive: false)
|
|
@@ -11281,6 +11321,7 @@
|
|
|
11281
11321
|
exports.DockviewPanel = DockviewPanel;
|
|
11282
11322
|
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
11283
11323
|
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
11324
|
+
exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
|
|
11284
11325
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
11285
11326
|
exports.Gridview = Gridview;
|
|
11286
11327
|
exports.GridviewApi = GridviewApi;
|