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
|
*/
|
|
@@ -1268,11 +1268,13 @@
|
|
|
1268
1268
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1269
1269
|
document.removeEventListener('pointerup', end);
|
|
1270
1270
|
document.removeEventListener('pointercancel', end);
|
|
1271
|
+
document.removeEventListener('contextmenu', end);
|
|
1271
1272
|
this._onDidSashEnd.fire(undefined);
|
|
1272
1273
|
};
|
|
1273
1274
|
document.addEventListener('pointermove', onPointerMove);
|
|
1274
1275
|
document.addEventListener('pointerup', end);
|
|
1275
1276
|
document.addEventListener('pointercancel', end);
|
|
1277
|
+
document.addEventListener('contextmenu', end);
|
|
1276
1278
|
};
|
|
1277
1279
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1278
1280
|
const sashItem = {
|
|
@@ -5134,7 +5136,7 @@
|
|
|
5134
5136
|
}
|
|
5135
5137
|
}
|
|
5136
5138
|
|
|
5137
|
-
class
|
|
5139
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5138
5140
|
get kind() {
|
|
5139
5141
|
return this.options.kind;
|
|
5140
5142
|
}
|
|
@@ -5482,7 +5484,7 @@
|
|
|
5482
5484
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5483
5485
|
});
|
|
5484
5486
|
}), tab.onWillShowOverlay((event) => {
|
|
5485
|
-
this._onWillShowOverlay.fire(new
|
|
5487
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5486
5488
|
kind: 'tab',
|
|
5487
5489
|
panel: this.group.activePanel,
|
|
5488
5490
|
api: this.accessor.api,
|
|
@@ -5646,7 +5648,7 @@
|
|
|
5646
5648
|
index: this.tabs.size,
|
|
5647
5649
|
});
|
|
5648
5650
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5649
|
-
this._onWillShowOverlay.fire(new
|
|
5651
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5650
5652
|
kind: 'header_space',
|
|
5651
5653
|
panel: this.group.activePanel,
|
|
5652
5654
|
api: this.accessor.api,
|
|
@@ -6040,7 +6042,7 @@
|
|
|
6040
6042
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6041
6043
|
this._onWillShowOverlay.fire(event);
|
|
6042
6044
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6043
|
-
this._onWillShowOverlay.fire(new
|
|
6045
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6044
6046
|
kind: 'content',
|
|
6045
6047
|
panel: this.activePanel,
|
|
6046
6048
|
api: this._api,
|
|
@@ -6716,7 +6718,19 @@
|
|
|
6716
6718
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6717
6719
|
this._onDidActivePanelChange = new Emitter();
|
|
6718
6720
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6719
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6721
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6722
|
+
// When becoming visible, apply any pending size change
|
|
6723
|
+
if (event.isVisible && this._pendingSize) {
|
|
6724
|
+
super.setSize(this._pendingSize);
|
|
6725
|
+
this._pendingSize = undefined;
|
|
6726
|
+
}
|
|
6727
|
+
}));
|
|
6728
|
+
}
|
|
6729
|
+
setSize(event) {
|
|
6730
|
+
// Always store the requested size
|
|
6731
|
+
this._pendingSize = Object.assign({}, event);
|
|
6732
|
+
// Apply the size change immediately
|
|
6733
|
+
super.setSize(event);
|
|
6720
6734
|
}
|
|
6721
6735
|
close() {
|
|
6722
6736
|
if (!this._group) {
|
|
@@ -7668,13 +7682,16 @@
|
|
|
7668
7682
|
let right = undefined;
|
|
7669
7683
|
let width = undefined;
|
|
7670
7684
|
const moveTop = () => {
|
|
7671
|
-
|
|
7685
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7686
|
+
const maxTop = startPosition.originalY +
|
|
7672
7687
|
startPosition.originalHeight >
|
|
7673
7688
|
containerRect.height
|
|
7674
|
-
?
|
|
7689
|
+
? Math.max(0, containerRect.height -
|
|
7690
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7675
7691
|
: Math.max(0, startPosition.originalY +
|
|
7676
7692
|
startPosition.originalHeight -
|
|
7677
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7693
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7694
|
+
top = clamp(y, 0, maxTop);
|
|
7678
7695
|
height =
|
|
7679
7696
|
startPosition.originalY +
|
|
7680
7697
|
startPosition.originalHeight -
|
|
@@ -7685,22 +7702,27 @@
|
|
|
7685
7702
|
top =
|
|
7686
7703
|
startPosition.originalY -
|
|
7687
7704
|
startPosition.originalHeight;
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7705
|
+
// When dragging bottom handle, constrain height to container height
|
|
7706
|
+
const minHeight = top < 0 &&
|
|
7707
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7708
|
+
'number'
|
|
7691
7709
|
? -top +
|
|
7692
7710
|
this.options.minimumInViewportHeight
|
|
7693
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7711
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7712
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7713
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7694
7714
|
bottom = containerRect.height - top - height;
|
|
7695
7715
|
};
|
|
7696
7716
|
const moveLeft = () => {
|
|
7697
|
-
|
|
7717
|
+
const maxLeft = startPosition.originalX +
|
|
7698
7718
|
startPosition.originalWidth >
|
|
7699
7719
|
containerRect.width
|
|
7700
|
-
?
|
|
7720
|
+
? Math.max(0, containerRect.width -
|
|
7721
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7701
7722
|
: Math.max(0, startPosition.originalX +
|
|
7702
7723
|
startPosition.originalWidth -
|
|
7703
|
-
Overlay.MINIMUM_WIDTH)
|
|
7724
|
+
Overlay.MINIMUM_WIDTH);
|
|
7725
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7704
7726
|
width =
|
|
7705
7727
|
startPosition.originalX +
|
|
7706
7728
|
startPosition.originalWidth -
|
|
@@ -7711,12 +7733,15 @@
|
|
|
7711
7733
|
left =
|
|
7712
7734
|
startPosition.originalX -
|
|
7713
7735
|
startPosition.originalWidth;
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7736
|
+
// When dragging right handle, constrain width to container width
|
|
7737
|
+
const minWidth = left < 0 &&
|
|
7738
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7739
|
+
'number'
|
|
7717
7740
|
? -left +
|
|
7718
7741
|
this.options.minimumInViewportWidth
|
|
7719
|
-
: Overlay.MINIMUM_WIDTH
|
|
7742
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7743
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7744
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7720
7745
|
right = containerRect.width - left - width;
|
|
7721
7746
|
};
|
|
7722
7747
|
switch (direction) {
|
|
@@ -8532,7 +8557,14 @@
|
|
|
8532
8557
|
if (options.debug) {
|
|
8533
8558
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8534
8559
|
}
|
|
8535
|
-
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.
|
|
8560
|
+
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(() => {
|
|
8561
|
+
/**
|
|
8562
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
8563
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
8564
|
+
* Debounced to avoid multiple calls when moving groups with multiple panels.
|
|
8565
|
+
*/
|
|
8566
|
+
this.debouncedUpdateAllPositions();
|
|
8567
|
+
}), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8536
8568
|
this.updateWatermark();
|
|
8537
8569
|
}), this.onDidAdd((event) => {
|
|
8538
8570
|
if (!this._moving) {
|
|
@@ -8569,7 +8601,7 @@
|
|
|
8569
8601
|
// option only available when no panels in primary grid
|
|
8570
8602
|
return;
|
|
8571
8603
|
}
|
|
8572
|
-
this._onWillShowOverlay.fire(new
|
|
8604
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8573
8605
|
kind: 'edge',
|
|
8574
8606
|
panel: undefined,
|
|
8575
8607
|
api: this._api,
|
|
@@ -9398,9 +9430,7 @@
|
|
|
9398
9430
|
}
|
|
9399
9431
|
this.updateWatermark();
|
|
9400
9432
|
// Force position updates for always visible panels after DOM layout is complete
|
|
9401
|
-
|
|
9402
|
-
this.overlayRenderContainer.updateAllPositions();
|
|
9403
|
-
});
|
|
9433
|
+
this.debouncedUpdateAllPositions();
|
|
9404
9434
|
this._onDidLayoutFromJSON.fire();
|
|
9405
9435
|
}
|
|
9406
9436
|
clear() {
|
|
@@ -9736,6 +9766,15 @@
|
|
|
9736
9766
|
}
|
|
9737
9767
|
return re;
|
|
9738
9768
|
}
|
|
9769
|
+
debouncedUpdateAllPositions() {
|
|
9770
|
+
if (this._updatePositionsFrameId !== undefined) {
|
|
9771
|
+
cancelAnimationFrame(this._updatePositionsFrameId);
|
|
9772
|
+
}
|
|
9773
|
+
this._updatePositionsFrameId = requestAnimationFrame(() => {
|
|
9774
|
+
this._updatePositionsFrameId = undefined;
|
|
9775
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9776
|
+
});
|
|
9777
|
+
}
|
|
9739
9778
|
movingLock(func) {
|
|
9740
9779
|
const isMoving = this._moving;
|
|
9741
9780
|
try {
|
|
@@ -10046,6 +10085,7 @@
|
|
|
10046
10085
|
from.panels.forEach((panel) => {
|
|
10047
10086
|
this._onDidMovePanel.fire({ panel, from });
|
|
10048
10087
|
});
|
|
10088
|
+
this.debouncedUpdateAllPositions();
|
|
10049
10089
|
// Ensure group becomes active after move
|
|
10050
10090
|
if (options.skipSetActive === false) {
|
|
10051
10091
|
// Only activate when explicitly requested (skipSetActive: false)
|
|
@@ -11251,6 +11291,7 @@
|
|
|
11251
11291
|
exports.DockviewPanel = DockviewPanel;
|
|
11252
11292
|
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
11253
11293
|
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
11294
|
+
exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
|
|
11254
11295
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
11255
11296
|
exports.Gridview = Gridview;
|
|
11256
11297
|
exports.GridviewApi = GridviewApi;
|