dockview-core 4.12.0 → 4.13.0
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 +3 -3
- package/dist/cjs/dockview/dockviewComponent.js +8 -1
- 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 +54 -21
- 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 +54 -21
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +54 -21
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +54 -22
- 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 +54 -21
- 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 +54 -21
- 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 +3 -3
- package/dist/esm/dockview/dockviewComponent.js +9 -2
- 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.0
|
|
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) {
|
|
@@ -8593,7 +8618,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8593
8618
|
// option only available when no panels in primary grid
|
|
8594
8619
|
return;
|
|
8595
8620
|
}
|
|
8596
|
-
this._onWillShowOverlay.fire(new
|
|
8621
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8597
8622
|
kind: 'edge',
|
|
8598
8623
|
panel: undefined,
|
|
8599
8624
|
api: this._api,
|
|
@@ -9830,6 +9855,13 @@ class DockviewComponent extends BaseGrid {
|
|
|
9830
9855
|
panel: removedPanel,
|
|
9831
9856
|
from: sourceGroup,
|
|
9832
9857
|
});
|
|
9858
|
+
/**
|
|
9859
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
9860
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
9861
|
+
*/
|
|
9862
|
+
requestAnimationFrame(() => {
|
|
9863
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9864
|
+
});
|
|
9833
9865
|
}
|
|
9834
9866
|
else {
|
|
9835
9867
|
/**
|
|
@@ -11260,5 +11292,5 @@ function createPaneview(element, options) {
|
|
|
11260
11292
|
return new PaneviewApi(component);
|
|
11261
11293
|
}
|
|
11262
11294
|
|
|
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 };
|
|
11295
|
+
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
11296
|
//# sourceMappingURL=dockview-core.esm.js.map
|