dockview-react 8.6.2 → 8.7.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.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version 8.
|
|
3
|
+
* @version 8.7.1
|
|
4
4
|
* @link https://github.com/dockview/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -51,7 +51,7 @@ react_dom = __toESM(react_dom);
|
|
|
51
51
|
//#region ../dockview-core/dist/package/main.esm.mjs
|
|
52
52
|
/**
|
|
53
53
|
* dockview-core
|
|
54
|
-
* @version 8.
|
|
54
|
+
* @version 8.7.1
|
|
55
55
|
* @link https://github.com/dockview/dockview
|
|
56
56
|
* @license MIT
|
|
57
57
|
*/
|
|
@@ -6964,6 +6964,7 @@ react_dom = __toESM(react_dom);
|
|
|
6964
6964
|
dndEdges: void 0,
|
|
6965
6965
|
dropPositionResolver: void 0,
|
|
6966
6966
|
dndCompass: void 0,
|
|
6967
|
+
dropSizing: void 0,
|
|
6967
6968
|
theme: void 0,
|
|
6968
6969
|
disableTabsOverflowList: void 0,
|
|
6969
6970
|
overflow: void 0,
|
|
@@ -15120,6 +15121,8 @@ react_dom = __toESM(react_dom);
|
|
|
15120
15121
|
const strip = this._group.element.querySelector(".dv-tabs-and-actions-container");
|
|
15121
15122
|
if (!strip) return;
|
|
15122
15123
|
this._tabSizeDisposables.addDisposables(watchElementResize(strip, () => {
|
|
15124
|
+
const { headerPosition } = this._group;
|
|
15125
|
+
if ((headerPosition === "left" || headerPosition === "right") !== (this._orientation === "horizontal")) return;
|
|
15123
15126
|
this._applyMeasuredTabSize(this._orientation === "vertical" ? strip.offsetHeight : strip.offsetWidth);
|
|
15124
15127
|
}));
|
|
15125
15128
|
}
|
|
@@ -17145,7 +17148,14 @@ react_dom = __toESM(react_dom);
|
|
|
17145
17148
|
if (options.autoHide !== void 0) service.setAutoHide(group, options.autoHide);
|
|
17146
17149
|
if (options.autoReveal !== void 0) service.setAutoReveal(group, options.autoReveal);
|
|
17147
17150
|
this._onDidAddGroup.fire(group);
|
|
17148
|
-
|
|
17151
|
+
const host = {
|
|
17152
|
+
element: group.element,
|
|
17153
|
+
get headerPosition() {
|
|
17154
|
+
return group.model.headerPosition;
|
|
17155
|
+
},
|
|
17156
|
+
layout: (width, height) => group.layout(width, height)
|
|
17157
|
+
};
|
|
17158
|
+
this._shellManager.addEdgeView(position, options, host);
|
|
17149
17159
|
return group.api;
|
|
17150
17160
|
});
|
|
17151
17161
|
}
|
|
@@ -18555,7 +18565,7 @@ react_dom = __toESM(react_dom);
|
|
|
18555
18565
|
const [targetParentLocation, to] = tail(targetLocation);
|
|
18556
18566
|
if (sourceGroup.api.location.type === "grid" && destinationGridview === this.gridview) {
|
|
18557
18567
|
const [sourceParentLocation, from] = tail(getGridLocation(sourceGroup.element));
|
|
18558
|
-
if (sequenceEquals(sourceParentLocation, targetParentLocation)) {
|
|
18568
|
+
if ((this.options.dropSizing !== "distribute" || sourceGroup === destinationGroup) && sequenceEquals(sourceParentLocation, targetParentLocation)) {
|
|
18559
18569
|
this.gridview.moveView(sourceParentLocation, from, to);
|
|
18560
18570
|
this.fireDidMovePanel(this.getGroupPanel(sourceItemId), sourceGroup);
|
|
18561
18571
|
return;
|
|
@@ -18585,7 +18595,7 @@ react_dom = __toESM(react_dom);
|
|
|
18585
18595
|
}));
|
|
18586
18596
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18587
18597
|
const updatedTargetLocation = getRelativeLocation(destinationGridview.orientation, getGridLocation(destinationGroup.element), destinationTarget);
|
|
18588
|
-
const newGroup = this.createGroupAtLocation(updatedTargetLocation, this.
|
|
18598
|
+
const newGroup = this.createGroupAtLocation(updatedTargetLocation, this.sizingForDrop(getGridLocation(destinationGroup.element)), void 0, destinationGridview);
|
|
18589
18599
|
this.movingLock(() => newGroup.model.openPanel(removedPanel, { skipSetActive: true }));
|
|
18590
18600
|
this.doSetGroupAndPanelActive(newGroup);
|
|
18591
18601
|
this.fireDidMovePanel(this.getGroupPanel(sourceItemId), sourceGroup);
|
|
@@ -18602,7 +18612,7 @@ react_dom = __toESM(react_dom);
|
|
|
18602
18612
|
skipSetActiveGroup: true
|
|
18603
18613
|
}));
|
|
18604
18614
|
if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
18605
|
-
const newGroup = this.createGroupAtLocation(targetLocation, this.
|
|
18615
|
+
const newGroup = this.createGroupAtLocation(targetLocation, this.sizingForDrop(referenceLocation), void 0, destinationGridview);
|
|
18606
18616
|
this.movingLock(() => newGroup.model.openPanel(removedPanel, { skipSetGroupActive: true }));
|
|
18607
18617
|
this.doSetGroupAndPanelActive(newGroup);
|
|
18608
18618
|
this.fireDidMovePanel(removedPanel, sourceGroup);
|
|
@@ -18614,7 +18624,7 @@ react_dom = __toESM(react_dom);
|
|
|
18614
18624
|
}));
|
|
18615
18625
|
const updatedReferenceLocation = getGridLocation(destinationGroup.element);
|
|
18616
18626
|
const location = getRelativeLocation(destinationGridview.orientation, updatedReferenceLocation, destinationTarget);
|
|
18617
|
-
this.movingLock(() => this.doAddGroup(targetGroup, location, this.
|
|
18627
|
+
this.movingLock(() => this.doAddGroup(targetGroup, location, this.sizingForDrop(updatedReferenceLocation), destinationGridview));
|
|
18618
18628
|
this.setGroupLocationForRoot(targetGroup, destinationGridview);
|
|
18619
18629
|
this.doSetGroupAndPanelActive(targetGroup);
|
|
18620
18630
|
this.fireDidMovePanel(this.getGroupPanel(sourceItemId), sourceGroup);
|
|
@@ -18629,7 +18639,7 @@ react_dom = __toESM(react_dom);
|
|
|
18629
18639
|
}));
|
|
18630
18640
|
if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
18631
18641
|
const dropLocation = getRelativeLocation(destinationGridview.orientation, referenceLocation, destinationTarget);
|
|
18632
|
-
const group = this.createGroupAtLocation(dropLocation, this.
|
|
18642
|
+
const group = this.createGroupAtLocation(dropLocation, this.sizingForDrop(referenceLocation), void 0, destinationGridview);
|
|
18633
18643
|
this.movingLock(() => group.model.openPanel(removedPanel, { skipSetGroupActive: true }));
|
|
18634
18644
|
this.doSetGroupAndPanelActive(group);
|
|
18635
18645
|
this.fireDidMovePanel(removedPanel, sourceGroup);
|
|
@@ -18673,7 +18683,7 @@ react_dom = __toESM(react_dom);
|
|
|
18673
18683
|
if (!destinationTarget || destinationTarget === "center" || !referenceLocation) targetGroup = destinationGroup;
|
|
18674
18684
|
else {
|
|
18675
18685
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
18676
|
-
targetGroup = this.createGroupAtLocation(dropLocation, this.
|
|
18686
|
+
targetGroup = this.createGroupAtLocation(dropLocation, this.sizingForDrop(referenceLocation));
|
|
18677
18687
|
}
|
|
18678
18688
|
if (!this.keepEmptyGroups(options) && sourceGroup.model.size === 0 && sourceGroup !== targetGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18679
18689
|
addPanelsToGroup(targetGroup);
|
|
@@ -18805,11 +18815,8 @@ react_dom = __toESM(react_dom);
|
|
|
18805
18815
|
const referenceLocation = getGridLocation(to.element);
|
|
18806
18816
|
const dropLocation = getRelativeLocation(destGridview.orientation, referenceLocation, target);
|
|
18807
18817
|
let size;
|
|
18808
|
-
if (isReorderWithinBranch) size = getDirectionOrientation(target) === "HORIZONTAL" ? from.api.width : from.api.height;
|
|
18809
|
-
else
|
|
18810
|
-
var _referenceLocation;
|
|
18811
|
-
size = Sizing.Split((_referenceLocation = referenceLocation[referenceLocation.length - 1]) !== null && _referenceLocation !== void 0 ? _referenceLocation : 0);
|
|
18812
|
-
}
|
|
18818
|
+
if (isReorderWithinBranch && this.options.dropSizing !== "distribute") size = getDirectionOrientation(target) === "HORIZONTAL" ? from.api.width : from.api.height;
|
|
18819
|
+
else size = this.sizingForDrop(referenceLocation);
|
|
18813
18820
|
destGridview.addView(source, size, dropLocation);
|
|
18814
18821
|
this.setGroupLocationForRoot(source, destGridview);
|
|
18815
18822
|
}
|
|
@@ -18947,13 +18954,12 @@ react_dom = __toESM(react_dom);
|
|
|
18947
18954
|
return panel;
|
|
18948
18955
|
}
|
|
18949
18956
|
/**
|
|
18950
|
-
* Sizing for a group created by a drop next to `referenceLocation
|
|
18951
|
-
*
|
|
18952
|
-
*
|
|
18953
|
-
* rewrites the index to 0 when a cross-axis drop wraps the reference in a
|
|
18954
|
-
* new branch, so one value serves both paths.
|
|
18957
|
+
* Sizing for a group created by a drop next to `referenceLocation`.
|
|
18958
|
+
* Gridview rewrites the index to 0 when a cross-axis drop wraps the
|
|
18959
|
+
* reference in a new branch, so one split index serves both paths.
|
|
18955
18960
|
*/
|
|
18956
|
-
|
|
18961
|
+
sizingForDrop(referenceLocation) {
|
|
18962
|
+
if (this.options.dropSizing === "distribute") return Sizing.Distribute;
|
|
18957
18963
|
return Sizing.Split(referenceLocation.length === 0 ? 0 : referenceLocation[referenceLocation.length - 1]);
|
|
18958
18964
|
}
|
|
18959
18965
|
createGroupAtLocation(location, size, options, gridview = this.gridview) {
|