dockview-react 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-react.amd.js +66 -25
- package/dist/dockview-react.amd.js.map +1 -1
- package/dist/dockview-react.amd.min.js +2 -2
- package/dist/dockview-react.amd.min.js.map +1 -1
- package/dist/dockview-react.amd.min.noStyle.js +2 -2
- package/dist/dockview-react.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-react.amd.noStyle.js +66 -25
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +66 -25
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +66 -26
- package/dist/dockview-react.esm.js.map +1 -1
- package/dist/dockview-react.esm.min.js +2 -2
- package/dist/dockview-react.esm.min.js.map +1 -1
- package/dist/dockview-react.js +66 -25
- package/dist/dockview-react.js.map +1 -1
- package/dist/dockview-react.min.js +2 -2
- package/dist/dockview-react.min.js.map +1 -1
- package/dist/dockview-react.min.noStyle.js +2 -2
- package/dist/dockview-react.min.noStyle.js.map +1 -1
- package/dist/dockview-react.noStyle.js +66 -25
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.13.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -1295,11 +1295,13 @@ class Splitview {
|
|
|
1295
1295
|
document.removeEventListener('pointermove', onPointerMove);
|
|
1296
1296
|
document.removeEventListener('pointerup', end);
|
|
1297
1297
|
document.removeEventListener('pointercancel', end);
|
|
1298
|
+
document.removeEventListener('contextmenu', end);
|
|
1298
1299
|
this._onDidSashEnd.fire(undefined);
|
|
1299
1300
|
};
|
|
1300
1301
|
document.addEventListener('pointermove', onPointerMove);
|
|
1301
1302
|
document.addEventListener('pointerup', end);
|
|
1302
1303
|
document.addEventListener('pointercancel', end);
|
|
1304
|
+
document.addEventListener('contextmenu', end);
|
|
1303
1305
|
};
|
|
1304
1306
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
1305
1307
|
const sashItem = {
|
|
@@ -5161,7 +5163,7 @@ class Tab extends CompositeDisposable {
|
|
|
5161
5163
|
}
|
|
5162
5164
|
}
|
|
5163
5165
|
|
|
5164
|
-
class
|
|
5166
|
+
class DockviewWillShowOverlayLocationEvent {
|
|
5165
5167
|
get kind() {
|
|
5166
5168
|
return this.options.kind;
|
|
5167
5169
|
}
|
|
@@ -5509,7 +5511,7 @@ class Tabs extends CompositeDisposable {
|
|
|
5509
5511
|
index: this._tabs.findIndex((x) => x.value === tab),
|
|
5510
5512
|
});
|
|
5511
5513
|
}), tab.onWillShowOverlay((event) => {
|
|
5512
|
-
this._onWillShowOverlay.fire(new
|
|
5514
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5513
5515
|
kind: 'tab',
|
|
5514
5516
|
panel: this.group.activePanel,
|
|
5515
5517
|
api: this.accessor.api,
|
|
@@ -5673,7 +5675,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5673
5675
|
index: this.tabs.size,
|
|
5674
5676
|
});
|
|
5675
5677
|
}), this.voidContainer.onWillShowOverlay((event) => {
|
|
5676
|
-
this._onWillShowOverlay.fire(new
|
|
5678
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
5677
5679
|
kind: 'header_space',
|
|
5678
5680
|
panel: this.group.activePanel,
|
|
5679
5681
|
api: this.accessor.api,
|
|
@@ -6067,7 +6069,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
6067
6069
|
}), this.tabsContainer.onWillShowOverlay((event) => {
|
|
6068
6070
|
this._onWillShowOverlay.fire(event);
|
|
6069
6071
|
}), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
|
|
6070
|
-
this._onWillShowOverlay.fire(new
|
|
6072
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
6071
6073
|
kind: 'content',
|
|
6072
6074
|
panel: this.activePanel,
|
|
6073
6075
|
api: this._api,
|
|
@@ -6743,7 +6745,19 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
6743
6745
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6744
6746
|
this._onDidActivePanelChange = new Emitter();
|
|
6745
6747
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6746
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange)
|
|
6748
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidVisibilityChange.event((event) => {
|
|
6749
|
+
// When becoming visible, apply any pending size change
|
|
6750
|
+
if (event.isVisible && this._pendingSize) {
|
|
6751
|
+
super.setSize(this._pendingSize);
|
|
6752
|
+
this._pendingSize = undefined;
|
|
6753
|
+
}
|
|
6754
|
+
}));
|
|
6755
|
+
}
|
|
6756
|
+
setSize(event) {
|
|
6757
|
+
// Always store the requested size
|
|
6758
|
+
this._pendingSize = Object.assign({}, event);
|
|
6759
|
+
// Apply the size change immediately
|
|
6760
|
+
super.setSize(event);
|
|
6747
6761
|
}
|
|
6748
6762
|
close() {
|
|
6749
6763
|
if (!this._group) {
|
|
@@ -7695,13 +7709,16 @@ class Overlay extends CompositeDisposable {
|
|
|
7695
7709
|
let right = undefined;
|
|
7696
7710
|
let width = undefined;
|
|
7697
7711
|
const moveTop = () => {
|
|
7698
|
-
|
|
7712
|
+
// When dragging top handle, constrain top position to prevent oversizing
|
|
7713
|
+
const maxTop = startPosition.originalY +
|
|
7699
7714
|
startPosition.originalHeight >
|
|
7700
7715
|
containerRect.height
|
|
7701
|
-
?
|
|
7716
|
+
? Math.max(0, containerRect.height -
|
|
7717
|
+
Overlay.MINIMUM_HEIGHT)
|
|
7702
7718
|
: Math.max(0, startPosition.originalY +
|
|
7703
7719
|
startPosition.originalHeight -
|
|
7704
|
-
Overlay.MINIMUM_HEIGHT)
|
|
7720
|
+
Overlay.MINIMUM_HEIGHT);
|
|
7721
|
+
top = clamp(y, 0, maxTop);
|
|
7705
7722
|
height =
|
|
7706
7723
|
startPosition.originalY +
|
|
7707
7724
|
startPosition.originalHeight -
|
|
@@ -7712,22 +7729,27 @@ class Overlay extends CompositeDisposable {
|
|
|
7712
7729
|
top =
|
|
7713
7730
|
startPosition.originalY -
|
|
7714
7731
|
startPosition.originalHeight;
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7732
|
+
// When dragging bottom handle, constrain height to container height
|
|
7733
|
+
const minHeight = top < 0 &&
|
|
7734
|
+
typeof this.options.minimumInViewportHeight ===
|
|
7735
|
+
'number'
|
|
7718
7736
|
? -top +
|
|
7719
7737
|
this.options.minimumInViewportHeight
|
|
7720
|
-
: Overlay.MINIMUM_HEIGHT
|
|
7738
|
+
: Overlay.MINIMUM_HEIGHT;
|
|
7739
|
+
const maxHeight = containerRect.height - Math.max(0, top);
|
|
7740
|
+
height = clamp(y - top, minHeight, maxHeight);
|
|
7721
7741
|
bottom = containerRect.height - top - height;
|
|
7722
7742
|
};
|
|
7723
7743
|
const moveLeft = () => {
|
|
7724
|
-
|
|
7744
|
+
const maxLeft = startPosition.originalX +
|
|
7725
7745
|
startPosition.originalWidth >
|
|
7726
7746
|
containerRect.width
|
|
7727
|
-
?
|
|
7747
|
+
? Math.max(0, containerRect.width -
|
|
7748
|
+
Overlay.MINIMUM_WIDTH) // Prevent extending beyong right edge
|
|
7728
7749
|
: Math.max(0, startPosition.originalX +
|
|
7729
7750
|
startPosition.originalWidth -
|
|
7730
|
-
Overlay.MINIMUM_WIDTH)
|
|
7751
|
+
Overlay.MINIMUM_WIDTH);
|
|
7752
|
+
left = clamp(x, 0, maxLeft); // min is 0 (Not -Infinity) to prevent dragging beyond left edge
|
|
7731
7753
|
width =
|
|
7732
7754
|
startPosition.originalX +
|
|
7733
7755
|
startPosition.originalWidth -
|
|
@@ -7738,12 +7760,15 @@ class Overlay extends CompositeDisposable {
|
|
|
7738
7760
|
left =
|
|
7739
7761
|
startPosition.originalX -
|
|
7740
7762
|
startPosition.originalWidth;
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7763
|
+
// When dragging right handle, constrain width to container width
|
|
7764
|
+
const minWidth = left < 0 &&
|
|
7765
|
+
typeof this.options.minimumInViewportWidth ===
|
|
7766
|
+
'number'
|
|
7744
7767
|
? -left +
|
|
7745
7768
|
this.options.minimumInViewportWidth
|
|
7746
|
-
: Overlay.MINIMUM_WIDTH
|
|
7769
|
+
: Overlay.MINIMUM_WIDTH;
|
|
7770
|
+
const maxWidth = containerRect.width - Math.max(0, left);
|
|
7771
|
+
width = clamp(x - left, minWidth, maxWidth);
|
|
7747
7772
|
right = containerRect.width - left - width;
|
|
7748
7773
|
};
|
|
7749
7774
|
switch (direction) {
|
|
@@ -8536,7 +8561,14 @@ class DockviewComponent extends BaseGrid {
|
|
|
8536
8561
|
if (options.debug) {
|
|
8537
8562
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8538
8563
|
}
|
|
8539
|
-
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.
|
|
8564
|
+
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(() => {
|
|
8565
|
+
/**
|
|
8566
|
+
* Update overlay positions after DOM layout completes to prevent 0×0 dimensions.
|
|
8567
|
+
* With defaultRenderer="always" this results in panel content not showing after move operations.
|
|
8568
|
+
* Debounced to avoid multiple calls when moving groups with multiple panels.
|
|
8569
|
+
*/
|
|
8570
|
+
this.debouncedUpdateAllPositions();
|
|
8571
|
+
}), this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8540
8572
|
this.updateWatermark();
|
|
8541
8573
|
}), this.onDidAdd((event) => {
|
|
8542
8574
|
if (!this._moving) {
|
|
@@ -8573,7 +8605,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8573
8605
|
// option only available when no panels in primary grid
|
|
8574
8606
|
return;
|
|
8575
8607
|
}
|
|
8576
|
-
this._onWillShowOverlay.fire(new
|
|
8608
|
+
this._onWillShowOverlay.fire(new DockviewWillShowOverlayLocationEvent(event, {
|
|
8577
8609
|
kind: 'edge',
|
|
8578
8610
|
panel: undefined,
|
|
8579
8611
|
api: this._api,
|
|
@@ -9402,9 +9434,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9402
9434
|
}
|
|
9403
9435
|
this.updateWatermark();
|
|
9404
9436
|
// Force position updates for always visible panels after DOM layout is complete
|
|
9405
|
-
|
|
9406
|
-
this.overlayRenderContainer.updateAllPositions();
|
|
9407
|
-
});
|
|
9437
|
+
this.debouncedUpdateAllPositions();
|
|
9408
9438
|
this._onDidLayoutFromJSON.fire();
|
|
9409
9439
|
}
|
|
9410
9440
|
clear() {
|
|
@@ -9740,6 +9770,15 @@ class DockviewComponent extends BaseGrid {
|
|
|
9740
9770
|
}
|
|
9741
9771
|
return re;
|
|
9742
9772
|
}
|
|
9773
|
+
debouncedUpdateAllPositions() {
|
|
9774
|
+
if (this._updatePositionsFrameId !== undefined) {
|
|
9775
|
+
cancelAnimationFrame(this._updatePositionsFrameId);
|
|
9776
|
+
}
|
|
9777
|
+
this._updatePositionsFrameId = requestAnimationFrame(() => {
|
|
9778
|
+
this._updatePositionsFrameId = undefined;
|
|
9779
|
+
this.overlayRenderContainer.updateAllPositions();
|
|
9780
|
+
});
|
|
9781
|
+
}
|
|
9743
9782
|
movingLock(func) {
|
|
9744
9783
|
const isMoving = this._moving;
|
|
9745
9784
|
try {
|
|
@@ -10050,6 +10089,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
10050
10089
|
from.panels.forEach((panel) => {
|
|
10051
10090
|
this._onDidMovePanel.fire({ panel, from });
|
|
10052
10091
|
});
|
|
10092
|
+
this.debouncedUpdateAllPositions();
|
|
10053
10093
|
// Ensure group becomes active after move
|
|
10054
10094
|
if (options.skipSetActive === false) {
|
|
10055
10095
|
// Only activate when explicitly requested (skipSetActive: false)
|
|
@@ -12104,5 +12144,5 @@ const PaneviewReact = React.forwardRef((props, ref) => {
|
|
|
12104
12144
|
});
|
|
12105
12145
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
12106
12146
|
|
|
12107
|
-
export { BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDefaultTab, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewReact, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DraggablePaneviewPanel, Gridview, GridviewApi, GridviewComponent, GridviewPanel, GridviewReact, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewReact, PaneviewUnhandledDragOverEvent, ReactPart, ReactPartContext, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, SplitviewReact, Tab, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, isReactComponent, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget, usePortalsLifecycle };
|
|
12147
|
+
export { BaseGrid, ContentContainer, DefaultDockviewDeserialzier, DefaultTab, DockviewApi, DockviewComponent, CompositeDisposable as DockviewCompositeDisposable, DockviewDefaultTab, DockviewDidDropEvent, Disposable as DockviewDisposable, Emitter as DockviewEmitter, Event as DockviewEvent, DockviewGroupPanel, DockviewGroupPanelModel, MutableDisposable as DockviewMutableDisposable, DockviewPanel, DockviewReact, DockviewUnhandledDragOverEvent, DockviewWillDropEvent, DockviewWillShowOverlayLocationEvent, DraggablePaneviewPanel, Gridview, GridviewApi, GridviewComponent, GridviewPanel, GridviewReact, LayoutPriority, Orientation, PROPERTY_KEYS_DOCKVIEW, PROPERTY_KEYS_GRIDVIEW, PROPERTY_KEYS_PANEVIEW, PROPERTY_KEYS_SPLITVIEW, PaneFramework, PaneTransfer, PanelTransfer, Paneview, PaneviewApi, PaneviewComponent, PaneviewPanel, PaneviewReact, PaneviewUnhandledDragOverEvent, ReactPart, ReactPartContext, SashState, Sizing, Splitview, SplitviewApi, SplitviewComponent, SplitviewPanel, SplitviewReact, Tab, createDockview, createGridview, createPaneview, createSplitview, directionToPosition, getDirectionOrientation, getGridLocation, getLocationOrientation, getPaneData, getPanelData, getRelativeLocation, indexInParent, isGridBranchNode, isGroupOptionsWithGroup, isGroupOptionsWithPanel, isPanelOptionsWithGroup, isPanelOptionsWithPanel, isReactComponent, orthogonal, positionToDirection, themeAbyss, themeAbyssSpaced, themeDark, themeDracula, themeLight, themeLightSpaced, themeReplit, themeVisualStudio, toTarget, usePortalsLifecycle };
|
|
12108
12148
|
//# sourceMappingURL=dockview-react.esm.js.map
|