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
|
*/
|
|
@@ -1292,11 +1292,13 @@ class Splitview {
|
|
|
1292
1292
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1293
1293
|
document.removeEventListener('pointerup', end);
|
|
1294
1294
|
document.removeEventListener('pointercancel', end);
|
|
1295
|
+
document.removeEventListener('contextmenu', end);
|
|
1295
1296
|
this._onDidSashEnd.fire(undefined);
|
|
1296
1297
|
};
|
|
1297
1298
|
document.addEventListener('pointermove', onPointerMove);
|
|
1298
1299
|
document.addEventListener('pointerup', end);
|
|
1299
1300
|
document.addEventListener('pointercancel', end);
|
|
1301
|
+
document.addEventListener('contextmenu', end);
|
|
1300
1302
|
};
|
|
1301
1303
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1302
1304
|
const sashItem = {
|
|
@@ -5158,7 +5160,7 @@ class Tab extends CompositeDisposable {
|
|
|
5158
5160
|
}
|
|
5159
5161
|
}
|
|
5160
5162
|
|
|
5161
|
-
class
|
|
5163
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5162
5164
|
get kind() {
|
|
5163
5165
|
return this.options.kind;
|
|
5164
5166
|
}
|
|
@@ -5506,7 +5508,7 @@ class Tabs extends CompositeDisposable {
|
|
|
5506
5508
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5507
5509
|
});
|
|
5508
5510
|
}), tab.onWillShowOverlay((event) => {
|
|
5509
|
-
this._onWillShowOverlay.fire(new
|
|
5511
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5510
5512
|
kind: 'tab',
|
|
5511
5513
|
panel: this.group.activePanel,
|
|
5512
5514
|
api: this.accessor.api,
|
|
@@ -5670,7 +5672,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5670
5672
|
index: this.tabs.size,
|
|
5671
5673
|
});
|
|
5672
5674
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5673
|
-
this._onWillShowOverlay.fire(new
|
|
5675
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5674
5676
|
kind: 'header_space',
|
|
5675
5677
|
panel: this.group.activePanel,
|
|
5676
5678
|
api: this.accessor.api,
|
|
@@ -6064,7 +6066,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
6064
6066
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6065
6067
|
this._onWillShowOverlay.fire(event);
|
|
6066
6068
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6067
|
-
this._onWillShowOverlay.fire(new
|
|
6069
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6068
6070
|
kind: 'content',
|
|
6069
6071
|
panel: this.activePanel,
|
|
6070
6072
|
api: this._api,
|
|
@@ -6740,7 +6742,19 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
6740
6742
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6741
6743
|
this._onDidActivePanelChange = new Emitter();
|
|
6742
6744
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6743
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6745
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6746
|
+
// When becoming visible, apply any pending size change
|
|
6747
|
+
if (event.isVisible && this._pendingSize) {
|
|
6748
|
+
super.setSize(this._pendingSize);
|
|
6749
|
+
this._pendingSize = undefined;
|
|
6750
|
+
}
|
|
6751
|
+
}));
|
|
6752
|
+
}
|
|
6753
|
+
setSize(event) {
|
|
6754
|
+
// Always store the requested size
|
|
6755
|
+
this._pendingSize = Object.assign({}, event);
|
|
6756
|
+
// Apply the size change immediately
|
|
6757
|
+
super.setSize(event);
|
|
6744
6758
|
}
|
|
6745
6759
|
close() {
|
|
6746
6760
|
if (!this._group) {
|
|
@@ -7692,13 +7706,16 @@ class Overlay extends CompositeDisposable {
|
|
|
7692
7706
|
let right = undefined;
|
|
7693
7707
|
let width = undefined;
|
|
7694
7708
|
const moveTop = () => {
|
|
7695
|
-
|
|
7709
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7710
|
+
const maxTop = startPosition.originalY +
|
|
7696
7711
|
startPosition.originalHeight >
|
|
7697
7712
|
containerRect.height
|
|
7698
|
-
?
|
|
7713
|
+
? Math.max(0, containerRect.height -
|
|
7714
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7699
7715
|
: Math.max(0, startPosition.originalY +
|
|
7700
7716
|
startPosition.originalHeight -
|
|
7701
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7717
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7718
|
+
top = clamp(y, 0, maxTop);
|
|
7702
7719
|
height =
|
|
7703
7720
|
startPosition.originalY +
|
|
7704
7721
|
startPosition.originalHeight -
|
|
@@ -7709,22 +7726,27 @@ class Overlay extends CompositeDisposable {
|
|
|
7709
7726
|
top =
|
|
7710
7727
|
startPosition.originalY -
|
|
7711
7728
|
startPosition.originalHeight;
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7729
|
+
// When dragging bottom handle, constrain height to container height
|
|
7730
|
+
const minHeight = top < 0 &&
|
|
7731
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7732
|
+
'number'
|
|
7715
7733
|
? -top +
|
|
7716
7734
|
this.options.minimumInViewportHeight
|
|
7717
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7735
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7736
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7737
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7718
7738
|
bottom = containerRect.height - top - height;
|
|
7719
7739
|
};
|
|
7720
7740
|
const moveLeft = () => {
|
|
7721
|
-
|
|
7741
|
+
const maxLeft = startPosition.originalX +
|
|
7722
7742
|
startPosition.originalWidth >
|
|
7723
7743
|
containerRect.width
|
|
7724
|
-
?
|
|
7744
|
+
? Math.max(0, containerRect.width -
|
|
7745
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7725
7746
|
: Math.max(0, startPosition.originalX +
|
|
7726
7747
|
startPosition.originalWidth -
|
|
7727
|
-
Overlay.MINIMUM_WIDTH)
|
|
7748
|
+
Overlay.MINIMUM_WIDTH);
|
|
7749
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7728
7750
|
width =
|
|
7729
7751
|
startPosition.originalX +
|
|
7730
7752
|
startPosition.originalWidth -
|
|
@@ -7735,12 +7757,15 @@ class Overlay extends CompositeDisposable {
|
|
|
7735
7757
|
left =
|
|
7736
7758
|
startPosition.originalX -
|
|
7737
7759
|
startPosition.originalWidth;
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7760
|
+
// When dragging right handle, constrain width to container width
|
|
7761
|
+
const minWidth = left < 0 &&
|
|
7762
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7763
|
+
'number'
|
|
7741
7764
|
? -left +
|
|
7742
7765
|
this.options.minimumInViewportWidth
|
|
7743
|
-
: Overlay.MINIMUM_WIDTH
|
|
7766
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7767
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7768
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7744
7769
|
right = containerRect.width - left - width;
|
|
7745
7770
|
};
|
|
7746
7771
|
switch (direction) {
|
|
@@ -8556,7 +8581,14 @@ class DockviewComponent extends BaseGrid {
|
|
|
8556
8581
|
if (options.debug) {
|
|
8557
8582
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8558
8583
|
}
|
|
8559
|
-
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.
|
|
8584
|
+
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(() => {
|
|
8585
|
+
/**
|
|
8586
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
8587
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
8588
|
+
* Debounced to avoid multiple calls when moving groups with multiple panels.
|
|
8589
|
+
*/
|
|
8590
|
+
this.debouncedUpdateAllPositions();
|
|
8591
|
+
}), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8560
8592
|
this.updateWatermark();
|
|
8561
8593
|
}), this.onDidAdd((event) => {
|
|
8562
8594
|
if (!this._moving) {
|
|
@@ -8593,7 +8625,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8593
8625
|
// option only available when no panels in primary grid
|
|
8594
8626
|
return;
|
|
8595
8627
|
}
|
|
8596
|
-
this._onWillShowOverlay.fire(new
|
|
8628
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8597
8629
|
kind: 'edge',
|
|
8598
8630
|
panel: undefined,
|
|
8599
8631
|
api: this._api,
|
|
@@ -9422,9 +9454,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9422
9454
|
}
|
|
9423
9455
|
this.updateWatermark();
|
|
9424
9456
|
// Force position updates for always visible panels after DOM layout is complete
|
|
9425
|
-
|
|
9426
|
-
this.overlayRenderContainer.updateAllPositions();
|
|
9427
|
-
});
|
|
9457
|
+
this.debouncedUpdateAllPositions();
|
|
9428
9458
|
this._onDidLayoutFromJSON.fire();
|
|
9429
9459
|
}
|
|
9430
9460
|
clear() {
|
|
@@ -9760,6 +9790,15 @@ class DockviewComponent extends BaseGrid {
|
|
|
9760
9790
|
}
|
|
9761
9791
|
return re;
|
|
9762
9792
|
}
|
|
9793
|
+
debouncedUpdateAllPositions() {
|
|
9794
|
+
if (this._updatePositionsFrameId !== undefined) {
|
|
9795
|
+
cancelAnimationFrame(this._updatePositionsFrameId);
|
|
9796
|
+
}
|
|
9797
|
+
this._updatePositionsFrameId = requestAnimationFrame(() => {
|
|
9798
|
+
this._updatePositionsFrameId = undefined;
|
|
9799
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9800
|
+
});
|
|
9801
|
+
}
|
|
9763
9802
|
movingLock(func) {
|
|
9764
9803
|
const isMoving = this._moving;
|
|
9765
9804
|
try {
|
|
@@ -10070,6 +10109,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
10070
10109
|
from.panels.forEach((panel) => {
|
|
10071
10110
|
this._onDidMovePanel.fire({ panel, from });
|
|
10072
10111
|
});
|
|
10112
|
+
this.debouncedUpdateAllPositions();
|
|
10073
10113
|
// Ensure group becomes active after move
|
|
10074
10114
|
if (options.skipSetActive === false) {
|
|
10075
10115
|
// Only activate when explicitly requested (skipSetActive: false)
|
|
@@ -11260,5 +11300,5 @@ function createPaneview(element, options) {
|
|
|
11260
11300
|
return new PaneviewApi(component);
|
|
11261
11301
|
}
|
|
11262
11302
|
|
|
11263
|
-
export { BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DraggablePaneviewPanel, Gridview, GridviewApi, GridviewComponent, GridviewPanel, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewUnhandledDragOverEvent, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, Tab, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget };
|
|
11303
|
+
export { BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DockviewWillShowOverlayLocationEvent, DraggablePaneviewPanel, Gridview, GridviewApi, GridviewComponent, GridviewPanel, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewUnhandledDragOverEvent, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, Tab, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget };
|
|
11264
11304
|
//# sourceMappingURL=dockview-core.esm.js.map
|