dockview 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/dockview.amd.js +66 -25
- package/dist/dockview.amd.js.map +1 -1
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.js.map +1 -1
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.min.noStyle.js.map +1 -1
- package/dist/dockview.amd.noStyle.js +66 -25
- package/dist/dockview.amd.noStyle.js.map +1 -1
- package/dist/dockview.cjs.js +66 -25
- package/dist/dockview.cjs.js.map +1 -1
- package/dist/dockview.esm.js +66 -26
- package/dist/dockview.esm.js.map +1 -1
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.esm.min.js.map +1 -1
- package/dist/dockview.js +66 -25
- package/dist/dockview.js.map +1 -1
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.js.map +1 -1
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.min.noStyle.js.map +1 -1
- package/dist/dockview.noStyle.js +66 -25
- package/dist/dockview.noStyle.js.map +1 -1
- package/package.json +2 -2
package/dist/dockview.amd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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) {
|
|
@@ -8535,7 +8560,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8535
8560
|
if (options.debug) {
|
|
8536
8561
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8537
8562
|
}
|
|
8538
|
-
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.
|
|
8563
|
+
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(() => {
|
|
8564
|
+
/**
|
|
8565
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
8566
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
8567
|
+
* Debounced to avoid multiple calls when moving groups with multiple panels.
|
|
8568
|
+
*/
|
|
8569
|
+
this.debouncedUpdateAllPositions();
|
|
8570
|
+
}), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8539
8571
|
this.updateWatermark();
|
|
8540
8572
|
}), this.onDidAdd((event) => {
|
|
8541
8573
|
if (!this._moving) {
|
|
@@ -8572,7 +8604,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8572
8604
|
// option only available when no panels in primary grid
|
|
8573
8605
|
return;
|
|
8574
8606
|
}
|
|
8575
|
-
this._onWillShowOverlay.fire(new
|
|
8607
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8576
8608
|
kind: 'edge',
|
|
8577
8609
|
panel: undefined,
|
|
8578
8610
|
api: this._api,
|
|
@@ -9401,9 +9433,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9401
9433
|
}
|
|
9402
9434
|
this.updateWatermark();
|
|
9403
9435
|
// Force position updates for always visible panels after DOM layout is complete
|
|
9404
|
-
|
|
9405
|
-
this.overlayRenderContainer.updateAllPositions();
|
|
9406
|
-
});
|
|
9436
|
+
this.debouncedUpdateAllPositions();
|
|
9407
9437
|
this._onDidLayoutFromJSON.fire();
|
|
9408
9438
|
}
|
|
9409
9439
|
clear() {
|
|
@@ -9739,6 +9769,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9739
9769
|
}
|
|
9740
9770
|
return re;
|
|
9741
9771
|
}
|
|
9772
|
+
debouncedUpdateAllPositions() {
|
|
9773
|
+
if (this._updatePositionsFrameId !== undefined) {
|
|
9774
|
+
cancelAnimationFrame(this._updatePositionsFrameId);
|
|
9775
|
+
}
|
|
9776
|
+
this._updatePositionsFrameId = requestAnimationFrame(() => {
|
|
9777
|
+
this._updatePositionsFrameId = undefined;
|
|
9778
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9779
|
+
});
|
|
9780
|
+
}
|
|
9742
9781
|
movingLock(func) {
|
|
9743
9782
|
const isMoving = this._moving;
|
|
9744
9783
|
try {
|
|
@@ -10049,6 +10088,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10049
10088
|
from.panels.forEach((panel) => {
|
|
10050
10089
|
this._onDidMovePanel.fire({ panel, from });
|
|
10051
10090
|
});
|
|
10091
|
+
this.debouncedUpdateAllPositions();
|
|
10052
10092
|
// Ensure group becomes active after move
|
|
10053
10093
|
if (options.skipSetActive === false) {
|
|
10054
10094
|
// Only activate when explicitly requested (skipSetActive: false)
|
|
@@ -12143,6 +12183,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
12143
12183
|
exports.DockviewReact = DockviewReact;
|
|
12144
12184
|
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
12145
12185
|
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
12186
|
+
exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
|
|
12146
12187
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
12147
12188
|
exports.Gridview = Gridview;
|
|
12148
12189
|
exports.GridviewApi = GridviewApi;
|