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
|
*/
|
|
@@ -1264,11 +1264,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1264
1264
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1265
1265
|
document.removeEventListener('pointerup', end);
|
|
1266
1266
|
document.removeEventListener('pointercancel', end);
|
|
1267
|
+
document.removeEventListener('contextmenu', end);
|
|
1267
1268
|
this._onDidSashEnd.fire(undefined);
|
|
1268
1269
|
};
|
|
1269
1270
|
document.addEventListener('pointermove', onPointerMove);
|
|
1270
1271
|
document.addEventListener('pointerup', end);
|
|
1271
1272
|
document.addEventListener('pointercancel', end);
|
|
1273
|
+
document.addEventListener('contextmenu', end);
|
|
1272
1274
|
};
|
|
1273
1275
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1274
1276
|
const sashItem = {
|
|
@@ -5130,7 +5132,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5130
5132
|
}
|
|
5131
5133
|
}
|
|
5132
5134
|
|
|
5133
|
-
class
|
|
5135
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5134
5136
|
get kind() {
|
|
5135
5137
|
return this.options.kind;
|
|
5136
5138
|
}
|
|
@@ -5478,7 +5480,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5478
5480
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5479
5481
|
});
|
|
5480
5482
|
}), tab.onWillShowOverlay((event) => {
|
|
5481
|
-
this._onWillShowOverlay.fire(new
|
|
5483
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5482
5484
|
kind: 'tab',
|
|
5483
5485
|
panel: this.group.activePanel,
|
|
5484
5486
|
api: this.accessor.api,
|
|
@@ -5642,7 +5644,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5642
5644
|
index: this.tabs.size,
|
|
5643
5645
|
});
|
|
5644
5646
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5645
|
-
this._onWillShowOverlay.fire(new
|
|
5647
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5646
5648
|
kind: 'header_space',
|
|
5647
5649
|
panel: this.group.activePanel,
|
|
5648
5650
|
api: this.accessor.api,
|
|
@@ -6036,7 +6038,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6036
6038
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6037
6039
|
this._onWillShowOverlay.fire(event);
|
|
6038
6040
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6039
|
-
this._onWillShowOverlay.fire(new
|
|
6041
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6040
6042
|
kind: 'content',
|
|
6041
6043
|
panel: this.activePanel,
|
|
6042
6044
|
api: this._api,
|
|
@@ -6712,7 +6714,19 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6712
6714
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6713
6715
|
this._onDidActivePanelChange = new Emitter();
|
|
6714
6716
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6715
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6717
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6718
|
+
// When becoming visible, apply any pending size change
|
|
6719
|
+
if (event.isVisible && this._pendingSize) {
|
|
6720
|
+
super.setSize(this._pendingSize);
|
|
6721
|
+
this._pendingSize = undefined;
|
|
6722
|
+
}
|
|
6723
|
+
}));
|
|
6724
|
+
}
|
|
6725
|
+
setSize(event) {
|
|
6726
|
+
// Always store the requested size
|
|
6727
|
+
this._pendingSize = Object.assign({}, event);
|
|
6728
|
+
// Apply the size change immediately
|
|
6729
|
+
super.setSize(event);
|
|
6716
6730
|
}
|
|
6717
6731
|
close() {
|
|
6718
6732
|
if (!this._group) {
|
|
@@ -7664,13 +7678,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7664
7678
|
let right = undefined;
|
|
7665
7679
|
let width = undefined;
|
|
7666
7680
|
const moveTop = () => {
|
|
7667
|
-
|
|
7681
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7682
|
+
const maxTop = startPosition.originalY +
|
|
7668
7683
|
startPosition.originalHeight >
|
|
7669
7684
|
containerRect.height
|
|
7670
|
-
?
|
|
7685
|
+
? Math.max(0, containerRect.height -
|
|
7686
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7671
7687
|
: Math.max(0, startPosition.originalY +
|
|
7672
7688
|
startPosition.originalHeight -
|
|
7673
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7689
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7690
|
+
top = clamp(y, 0, maxTop);
|
|
7674
7691
|
height =
|
|
7675
7692
|
startPosition.originalY +
|
|
7676
7693
|
startPosition.originalHeight -
|
|
@@ -7681,22 +7698,27 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7681
7698
|
top =
|
|
7682
7699
|
startPosition.originalY -
|
|
7683
7700
|
startPosition.originalHeight;
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7701
|
+
// When dragging bottom handle, constrain height to container height
|
|
7702
|
+
const minHeight = top < 0 &&
|
|
7703
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7704
|
+
'number'
|
|
7687
7705
|
? -top +
|
|
7688
7706
|
this.options.minimumInViewportHeight
|
|
7689
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7707
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7708
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7709
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7690
7710
|
bottom = containerRect.height - top - height;
|
|
7691
7711
|
};
|
|
7692
7712
|
const moveLeft = () => {
|
|
7693
|
-
|
|
7713
|
+
const maxLeft = startPosition.originalX +
|
|
7694
7714
|
startPosition.originalWidth >
|
|
7695
7715
|
containerRect.width
|
|
7696
|
-
?
|
|
7716
|
+
? Math.max(0, containerRect.width -
|
|
7717
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7697
7718
|
: Math.max(0, startPosition.originalX +
|
|
7698
7719
|
startPosition.originalWidth -
|
|
7699
|
-
Overlay.MINIMUM_WIDTH)
|
|
7720
|
+
Overlay.MINIMUM_WIDTH);
|
|
7721
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7700
7722
|
width =
|
|
7701
7723
|
startPosition.originalX +
|
|
7702
7724
|
startPosition.originalWidth -
|
|
@@ -7707,12 +7729,15 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7707
7729
|
left =
|
|
7708
7730
|
startPosition.originalX -
|
|
7709
7731
|
startPosition.originalWidth;
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7732
|
+
// When dragging right handle, constrain width to container width
|
|
7733
|
+
const minWidth = left < 0 &&
|
|
7734
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7735
|
+
'number'
|
|
7713
7736
|
? -left +
|
|
7714
7737
|
this.options.minimumInViewportWidth
|
|
7715
|
-
: Overlay.MINIMUM_WIDTH
|
|
7738
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7739
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7740
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7716
7741
|
right = containerRect.width - left - width;
|
|
7717
7742
|
};
|
|
7718
7743
|
switch (direction) {
|
|
@@ -8528,7 +8553,14 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8528
8553
|
if (options.debug) {
|
|
8529
8554
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8530
8555
|
}
|
|
8531
|
-
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.
|
|
8556
|
+
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(() => {
|
|
8557
|
+
/**
|
|
8558
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
8559
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
8560
|
+
* Debounced to avoid multiple calls when moving groups with multiple panels.
|
|
8561
|
+
*/
|
|
8562
|
+
this.debouncedUpdateAllPositions();
|
|
8563
|
+
}), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8532
8564
|
this.updateWatermark();
|
|
8533
8565
|
}), this.onDidAdd((event) => {
|
|
8534
8566
|
if (!this._moving) {
|
|
@@ -8565,7 +8597,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8565
8597
|
// option only available when no panels in primary grid
|
|
8566
8598
|
return;
|
|
8567
8599
|
}
|
|
8568
|
-
this._onWillShowOverlay.fire(new
|
|
8600
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8569
8601
|
kind: 'edge',
|
|
8570
8602
|
panel: undefined,
|
|
8571
8603
|
api: this._api,
|
|
@@ -9394,9 +9426,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9394
9426
|
}
|
|
9395
9427
|
this.updateWatermark();
|
|
9396
9428
|
// Force position updates for always visible panels after DOM layout is complete
|
|
9397
|
-
|
|
9398
|
-
this.overlayRenderContainer.updateAllPositions();
|
|
9399
|
-
});
|
|
9429
|
+
this.debouncedUpdateAllPositions();
|
|
9400
9430
|
this._onDidLayoutFromJSON.fire();
|
|
9401
9431
|
}
|
|
9402
9432
|
clear() {
|
|
@@ -9732,6 +9762,15 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9732
9762
|
}
|
|
9733
9763
|
return re;
|
|
9734
9764
|
}
|
|
9765
|
+
debouncedUpdateAllPositions() {
|
|
9766
|
+
if (this._updatePositionsFrameId !== undefined) {
|
|
9767
|
+
cancelAnimationFrame(this._updatePositionsFrameId);
|
|
9768
|
+
}
|
|
9769
|
+
this._updatePositionsFrameId = requestAnimationFrame(() => {
|
|
9770
|
+
this._updatePositionsFrameId = undefined;
|
|
9771
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9772
|
+
});
|
|
9773
|
+
}
|
|
9735
9774
|
movingLock(func) {
|
|
9736
9775
|
const isMoving = this._moving;
|
|
9737
9776
|
try {
|
|
@@ -10042,6 +10081,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
10042
10081
|
from.panels.forEach((panel) => {
|
|
10043
10082
|
this._onDidMovePanel.fire({ panel, from });
|
|
10044
10083
|
});
|
|
10084
|
+
this.debouncedUpdateAllPositions();
|
|
10045
10085
|
// Ensure group becomes active after move
|
|
10046
10086
|
if (options.skipSetActive === false) {
|
|
10047
10087
|
// Only activate when explicitly requested (skipSetActive: false)
|
|
@@ -11247,6 +11287,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
11247
11287
|
exports.DockviewPanel = DockviewPanel;
|
|
11248
11288
|
exports.DockviewUnhandledDragOverEvent = DockviewUnhandledDragOverEvent;
|
|
11249
11289
|
exports.DockviewWillDropEvent = DockviewWillDropEvent;
|
|
11290
|
+
exports.DockviewWillShowOverlayLocationEvent = DockviewWillShowOverlayLocationEvent;
|
|
11250
11291
|
exports.DraggablePaneviewPanel = DraggablePaneviewPanel;
|
|
11251
11292
|
exports.Gridview = Gridview;
|
|
11252
11293
|
exports.GridviewApi = GridviewApi;
|