dockview-react 8.6.2 → 8.7.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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-react
3
- * @version 8.6.2
3
+ * @version 8.7.0
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.6.2
54
+ * @version 8.7.0
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,
@@ -18555,7 +18556,7 @@ react_dom = __toESM(react_dom);
18555
18556
  const [targetParentLocation, to] = tail(targetLocation);
18556
18557
  if (sourceGroup.api.location.type === "grid" && destinationGridview === this.gridview) {
18557
18558
  const [sourceParentLocation, from] = tail(getGridLocation(sourceGroup.element));
18558
- if (sequenceEquals(sourceParentLocation, targetParentLocation)) {
18559
+ if ((this.options.dropSizing !== "distribute" || sourceGroup === destinationGroup) && sequenceEquals(sourceParentLocation, targetParentLocation)) {
18559
18560
  this.gridview.moveView(sourceParentLocation, from, to);
18560
18561
  this.fireDidMovePanel(this.getGroupPanel(sourceItemId), sourceGroup);
18561
18562
  return;
@@ -18585,7 +18586,7 @@ react_dom = __toESM(react_dom);
18585
18586
  }));
18586
18587
  this.doRemoveGroup(sourceGroup, { skipActive: true });
18587
18588
  const updatedTargetLocation = getRelativeLocation(destinationGridview.orientation, getGridLocation(destinationGroup.element), destinationTarget);
18588
- const newGroup = this.createGroupAtLocation(updatedTargetLocation, this.dropSizing(getGridLocation(destinationGroup.element)), void 0, destinationGridview);
18589
+ const newGroup = this.createGroupAtLocation(updatedTargetLocation, this.sizingForDrop(getGridLocation(destinationGroup.element)), void 0, destinationGridview);
18589
18590
  this.movingLock(() => newGroup.model.openPanel(removedPanel, { skipSetActive: true }));
18590
18591
  this.doSetGroupAndPanelActive(newGroup);
18591
18592
  this.fireDidMovePanel(this.getGroupPanel(sourceItemId), sourceGroup);
@@ -18602,7 +18603,7 @@ react_dom = __toESM(react_dom);
18602
18603
  skipSetActiveGroup: true
18603
18604
  }));
18604
18605
  if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
18605
- const newGroup = this.createGroupAtLocation(targetLocation, this.dropSizing(referenceLocation), void 0, destinationGridview);
18606
+ const newGroup = this.createGroupAtLocation(targetLocation, this.sizingForDrop(referenceLocation), void 0, destinationGridview);
18606
18607
  this.movingLock(() => newGroup.model.openPanel(removedPanel, { skipSetGroupActive: true }));
18607
18608
  this.doSetGroupAndPanelActive(newGroup);
18608
18609
  this.fireDidMovePanel(removedPanel, sourceGroup);
@@ -18614,7 +18615,7 @@ react_dom = __toESM(react_dom);
18614
18615
  }));
18615
18616
  const updatedReferenceLocation = getGridLocation(destinationGroup.element);
18616
18617
  const location = getRelativeLocation(destinationGridview.orientation, updatedReferenceLocation, destinationTarget);
18617
- this.movingLock(() => this.doAddGroup(targetGroup, location, this.dropSizing(updatedReferenceLocation), destinationGridview));
18618
+ this.movingLock(() => this.doAddGroup(targetGroup, location, this.sizingForDrop(updatedReferenceLocation), destinationGridview));
18618
18619
  this.setGroupLocationForRoot(targetGroup, destinationGridview);
18619
18620
  this.doSetGroupAndPanelActive(targetGroup);
18620
18621
  this.fireDidMovePanel(this.getGroupPanel(sourceItemId), sourceGroup);
@@ -18629,7 +18630,7 @@ react_dom = __toESM(react_dom);
18629
18630
  }));
18630
18631
  if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
18631
18632
  const dropLocation = getRelativeLocation(destinationGridview.orientation, referenceLocation, destinationTarget);
18632
- const group = this.createGroupAtLocation(dropLocation, this.dropSizing(referenceLocation), void 0, destinationGridview);
18633
+ const group = this.createGroupAtLocation(dropLocation, this.sizingForDrop(referenceLocation), void 0, destinationGridview);
18633
18634
  this.movingLock(() => group.model.openPanel(removedPanel, { skipSetGroupActive: true }));
18634
18635
  this.doSetGroupAndPanelActive(group);
18635
18636
  this.fireDidMovePanel(removedPanel, sourceGroup);
@@ -18673,7 +18674,7 @@ react_dom = __toESM(react_dom);
18673
18674
  if (!destinationTarget || destinationTarget === "center" || !referenceLocation) targetGroup = destinationGroup;
18674
18675
  else {
18675
18676
  const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
18676
- targetGroup = this.createGroupAtLocation(dropLocation, this.dropSizing(referenceLocation));
18677
+ targetGroup = this.createGroupAtLocation(dropLocation, this.sizingForDrop(referenceLocation));
18677
18678
  }
18678
18679
  if (!this.keepEmptyGroups(options) && sourceGroup.model.size === 0 && sourceGroup !== targetGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
18679
18680
  addPanelsToGroup(targetGroup);
@@ -18805,11 +18806,8 @@ react_dom = __toESM(react_dom);
18805
18806
  const referenceLocation = getGridLocation(to.element);
18806
18807
  const dropLocation = getRelativeLocation(destGridview.orientation, referenceLocation, target);
18807
18808
  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
- }
18809
+ if (isReorderWithinBranch && this.options.dropSizing !== "distribute") size = getDirectionOrientation(target) === "HORIZONTAL" ? from.api.width : from.api.height;
18810
+ else size = this.sizingForDrop(referenceLocation);
18813
18811
  destGridview.addView(source, size, dropLocation);
18814
18812
  this.setGroupLocationForRoot(source, destGridview);
18815
18813
  }
@@ -18947,13 +18945,12 @@ react_dom = __toESM(react_dom);
18947
18945
  return panel;
18948
18946
  }
18949
18947
  /**
18950
- * Sizing for a group created by a drop next to `referenceLocation`: half
18951
- * of the group the overlay was drawn over, leaving its siblings alone, so
18952
- * the panel lands in the region the overlay indicated (#1612). Gridview
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.
18948
+ * Sizing for a group created by a drop next to `referenceLocation`.
18949
+ * Gridview rewrites the index to 0 when a cross-axis drop wraps the
18950
+ * reference in a new branch, so one split index serves both paths.
18955
18951
  */
18956
- dropSizing(referenceLocation) {
18952
+ sizingForDrop(referenceLocation) {
18953
+ if (this.options.dropSizing === "distribute") return Sizing.Distribute;
18957
18954
  return Sizing.Split(referenceLocation.length === 0 ? 0 : referenceLocation[referenceLocation.length - 1]);
18958
18955
  }
18959
18956
  createGroupAtLocation(location, size, options, gridview = this.gridview) {