dockview-react 8.0.0 → 8.1.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.0.0
3
+ * @version 8.1.0
4
4
  * @link https://github.com/dockview/dockview
5
5
  * @license MIT
6
6
  */
@@ -51,12 +51,14 @@ react_dom = __toESM(react_dom);
51
51
  //#region ../dockview-core/dist/package/main.esm.mjs
52
52
  /**
53
53
  * dockview-core
54
- * @version 8.0.0
54
+ * @version 8.1.0
55
55
  * @link https://github.com/dockview/dockview
56
56
  * @license MIT
57
57
  */
58
58
  var _LocalSelectionTransfer;
59
- var TransferObject = class {};
59
+ var TransferObject = class {
60
+ constructor() {}
61
+ };
60
62
  var PanelTransfer = class extends TransferObject {
61
63
  constructor(viewId, groupId, panelId, tabGroupId) {
62
64
  super();
@@ -243,7 +245,6 @@ react_dom = __toESM(react_dom);
243
245
  this.options = options;
244
246
  this._listeners = [];
245
247
  this._disposed = false;
246
- this._pauseTokens = /* @__PURE__ */ new Set();
247
248
  }
248
249
  get event() {
249
250
  if (!this._event) {
@@ -264,14 +265,26 @@ react_dom = __toESM(react_dom);
264
265
  }
265
266
  fire(e) {
266
267
  var _this$options2;
267
- if (this._pauseTokens.size > 0) return;
268
+ if (this._pauseTokens !== void 0 && this._pauseTokens.size > 0) return;
268
269
  if ((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.replay) this._last = e;
269
- for (const listener of this._listeners.slice()) listener.callback(e);
270
+ const listeners = this._listeners;
271
+ const length = listeners.length;
272
+ if (length === 0) return;
273
+ if (length === 1) {
274
+ listeners[0].callback(e);
275
+ return;
276
+ }
277
+ for (const listener of listeners.slice()) listener.callback(e);
270
278
  }
271
279
  pause() {
280
+ var _this$_pauseTokens;
272
281
  const token = {};
282
+ (_this$_pauseTokens = this._pauseTokens) !== null && _this$_pauseTokens !== void 0 || (this._pauseTokens = /* @__PURE__ */ new Set());
273
283
  this._pauseTokens.add(token);
274
- return Disposable.from(() => this._pauseTokens.delete(token));
284
+ return Disposable.from(() => {
285
+ var _this$_pauseTokens2;
286
+ return (_this$_pauseTokens2 = this._pauseTokens) === null || _this$_pauseTokens2 === void 0 ? void 0 : _this$_pauseTokens2.delete(token);
287
+ });
275
288
  }
276
289
  dispose() {
277
290
  if (!this._disposed) {
@@ -571,8 +584,10 @@ react_dom = __toESM(react_dom);
571
584
  let previousScreenX = window.screenX;
572
585
  let previousScreenY = window.screenY;
573
586
  let timeout;
587
+ let rafHandle = 0;
588
+ let stopped = false;
574
589
  const checkMovement = () => {
575
- if (window.closed) return;
590
+ if (stopped || window.closed) return;
576
591
  const currentScreenX = window.screenX;
577
592
  const currentScreenY = window.screenY;
578
593
  if (currentScreenX !== previousScreenX || currentScreenY !== previousScreenY) {
@@ -583,9 +598,18 @@ react_dom = __toESM(react_dom);
583
598
  previousScreenX = currentScreenX;
584
599
  previousScreenY = currentScreenY;
585
600
  }
586
- requestAnimationFrame(checkMovement);
601
+ rafHandle = requestAnimationFrame(checkMovement);
587
602
  };
588
603
  checkMovement();
604
+ const disposeEmitter = emitter.dispose.bind(emitter);
605
+ emitter.dispose = () => {
606
+ if (!stopped) {
607
+ stopped = true;
608
+ cancelAnimationFrame(rafHandle);
609
+ clearTimeout(timeout);
610
+ }
611
+ disposeEmitter();
612
+ };
589
613
  return emitter;
590
614
  }
591
615
  function onDidWindowResizeEnd(element, cb) {
@@ -712,6 +736,11 @@ react_dom = __toESM(react_dom);
712
736
  set size(size) {
713
737
  this._size = size;
714
738
  }
739
+ setContainerGeometry(prop, value) {
740
+ if (this._appliedStyles[prop] === value) return;
741
+ this._appliedStyles[prop] = value;
742
+ this.container.style[prop] = value;
743
+ }
715
744
  get size() {
716
745
  return this._size;
717
746
  }
@@ -747,6 +776,7 @@ react_dom = __toESM(react_dom);
747
776
  this.view = view;
748
777
  this.disposable = disposable;
749
778
  this._cachedVisibleSize = void 0;
779
+ this._appliedStyles = {};
750
780
  if (typeof size === "number") {
751
781
  this._size = size;
752
782
  this._cachedVisibleSize = void 0;
@@ -792,6 +822,16 @@ react_dom = __toESM(react_dom);
792
822
  LayoutPriority["Normal"] = "normal";
793
823
  return LayoutPriority;
794
824
  }({});
825
+ function setSashPosition(sash, left, top) {
826
+ if (sash.appliedLeft !== left) {
827
+ sash.appliedLeft = left;
828
+ sash.container.style.left = left;
829
+ }
830
+ if (sash.appliedTop !== top) {
831
+ sash.appliedTop = top;
832
+ sash.container.style.top = top;
833
+ }
834
+ }
795
835
  let Sizing;
796
836
  (function(_Sizing) {
797
837
  _Sizing.Distribute = { type: "distribute" };
@@ -910,10 +950,6 @@ react_dom = __toESM(react_dom);
910
950
  pushToEnd(upIndexes, i);
911
951
  pushToEnd(downIndexes, i);
912
952
  }
913
- const upItems = upIndexes.map((i) => this.viewItems[i]);
914
- const upSizes = upIndexes.map((i) => sizes[i]);
915
- const downItems = downIndexes.map((i) => this.viewItems[i]);
916
- const downSizes = downIndexes.map((i) => sizes[i]);
917
953
  const minDeltaUp = upIndexes.reduce((_, i) => _ + this.viewItems[i].minimumSize - sizes[i], 0);
918
954
  const maxDeltaUp = upIndexes.reduce((_, i) => _ + this.viewItems[i].maximumSize - sizes[i], 0);
919
955
  const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((_, i) => _ + sizes[i] - this.viewItems[i].minimumSize, 0);
@@ -937,19 +973,21 @@ react_dom = __toESM(react_dom);
937
973
  const tentativeDelta = clamp(delta, minDelta, maxDelta);
938
974
  let actualDelta = 0;
939
975
  let deltaUp = tentativeDelta;
940
- for (let i = 0; i < upItems.length; i++) {
941
- const item = upItems[i];
942
- const size = clamp(upSizes[i] + deltaUp, item.minimumSize, item.maximumSize);
943
- const viewDelta = size - upSizes[i];
976
+ for (const upIndex of upIndexes) {
977
+ const item = this.viewItems[upIndex];
978
+ const priorSize = sizes[upIndex];
979
+ const size = clamp(priorSize + deltaUp, item.minimumSize, item.maximumSize);
980
+ const viewDelta = size - priorSize;
944
981
  actualDelta += viewDelta;
945
982
  deltaUp -= viewDelta;
946
983
  item.size = size;
947
984
  }
948
985
  let deltaDown = actualDelta;
949
- for (let i = 0; i < downItems.length; i++) {
950
- const item = downItems[i];
951
- const size = clamp(downSizes[i] - deltaDown, item.minimumSize, item.maximumSize);
952
- const viewDelta = size - downSizes[i];
986
+ for (const downIndex of downIndexes) {
987
+ const item = this.viewItems[downIndex];
988
+ const priorSize = sizes[downIndex];
989
+ const size = clamp(priorSize - deltaDown, item.minimumSize, item.maximumSize);
990
+ const viewDelta = size - priorSize;
953
991
  deltaDown += viewDelta;
954
992
  item.size = size;
955
993
  }
@@ -1197,13 +1235,22 @@ react_dom = __toESM(react_dom);
1197
1235
  this.saveProportions();
1198
1236
  }
1199
1237
  distributeEmptySpace(lowPriorityIndex) {
1200
- const contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);
1238
+ let contentSize = 0;
1239
+ for (const item of this.viewItems) contentSize += item.size;
1201
1240
  let emptyDelta = this.size - contentSize;
1241
+ if (emptyDelta === 0) return;
1202
1242
  const indexes = range(this.viewItems.length - 1, -1);
1203
- const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "low");
1204
- const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "high");
1205
- for (const index of highPriorityIndexes) pushToStart(indexes, index);
1206
- for (const index of lowPriorityIndexes) pushToEnd(indexes, index);
1243
+ let hasPriority = false;
1244
+ for (const item of this.viewItems) if (item.priority === "low" || item.priority === "high") {
1245
+ hasPriority = true;
1246
+ break;
1247
+ }
1248
+ if (hasPriority) {
1249
+ const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "low");
1250
+ const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "high");
1251
+ for (const index of highPriorityIndexes) pushToStart(indexes, index);
1252
+ for (const index of lowPriorityIndexes) pushToEnd(indexes, index);
1253
+ }
1207
1254
  if (typeof lowPriorityIndex === "number") pushToEnd(indexes, lowPriorityIndex);
1208
1255
  for (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) {
1209
1256
  const item = this.viewItems[indexes[i]];
@@ -1226,49 +1273,45 @@ react_dom = __toESM(react_dom);
1226
1273
  * For each view `i` the offet must be adjusted by `m * i/(n - 1)`.
1227
1274
  */
1228
1275
  layoutViews() {
1229
- this._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);
1276
+ let contentSize = 0;
1277
+ let visibleViewCount = 0;
1278
+ for (const item of this.viewItems) {
1279
+ contentSize += item.size;
1280
+ if (item.visible) visibleViewCount++;
1281
+ }
1282
+ this._contentSize = contentSize;
1230
1283
  this.updateSashEnablement();
1231
1284
  if (this.viewItems.length === 0) return;
1232
- const visibleViewItems = this.viewItems.filter((i) => i.visible);
1233
- const sashCount = Math.max(0, visibleViewItems.length - 1);
1234
- const marginReducedSize = this.margin * sashCount / Math.max(1, visibleViewItems.length);
1285
+ const sashCount = Math.max(0, visibleViewCount - 1);
1286
+ const marginReducedSize = this.margin * sashCount / Math.max(1, visibleViewCount);
1235
1287
  let totalLeftOffset = 0;
1236
1288
  const viewLeftOffsets = [];
1237
1289
  const sashWidth = 4;
1238
- const runningVisiblePanelCount = this.viewItems.reduce((arr, viewItem, i) => {
1239
- const flag = viewItem.visible ? 1 : 0;
1240
- if (i === 0) arr.push(flag);
1241
- else arr.push(arr[i - 1] + flag);
1242
- return arr;
1243
- }, []);
1290
+ let runningVisiblePanelCount = 0;
1244
1291
  this.viewItems.forEach((view, i) => {
1245
1292
  totalLeftOffset += this.viewItems[i].size;
1246
1293
  viewLeftOffsets.push(totalLeftOffset);
1294
+ runningVisiblePanelCount += view.visible ? 1 : 0;
1247
1295
  const size = view.visible ? view.size - marginReducedSize : 0;
1248
- const visiblePanelsBeforeThisView = Math.max(0, runningVisiblePanelCount[i] - 1);
1296
+ const visiblePanelsBeforeThisView = Math.max(0, runningVisiblePanelCount - 1);
1249
1297
  const offset = i === 0 || visiblePanelsBeforeThisView === 0 ? 0 : viewLeftOffsets[i - 1] + visiblePanelsBeforeThisView / sashCount * marginReducedSize;
1250
1298
  if (i < this.viewItems.length - 1) {
1251
1299
  const newSize = view.visible ? offset + size - sashWidth / 2 + this.margin / 2 : offset;
1252
- if (this._orientation === "HORIZONTAL") {
1253
- this.sashes[i].container.style.left = `${newSize}px`;
1254
- this.sashes[i].container.style.top = `0px`;
1255
- }
1256
- if (this._orientation === "VERTICAL") {
1257
- this.sashes[i].container.style.left = `0px`;
1258
- this.sashes[i].container.style.top = `${newSize}px`;
1259
- }
1300
+ const sash = this.sashes[i];
1301
+ if (this._orientation === "HORIZONTAL") setSashPosition(sash, `${newSize}px`, `0px`);
1302
+ if (this._orientation === "VERTICAL") setSashPosition(sash, `0px`, `${newSize}px`);
1260
1303
  }
1261
1304
  if (this._orientation === "HORIZONTAL") {
1262
- view.container.style.width = `${size}px`;
1263
- view.container.style.left = `${offset}px`;
1264
- view.container.style.top = "";
1265
- view.container.style.height = "";
1305
+ view.setContainerGeometry("width", `${size}px`);
1306
+ view.setContainerGeometry("left", `${offset}px`);
1307
+ view.setContainerGeometry("top", "");
1308
+ view.setContainerGeometry("height", "");
1266
1309
  }
1267
1310
  if (this._orientation === "VERTICAL") {
1268
- view.container.style.height = `${size}px`;
1269
- view.container.style.top = `${offset}px`;
1270
- view.container.style.width = "";
1271
- view.container.style.left = "";
1311
+ view.setContainerGeometry("height", `${size}px`);
1312
+ view.setContainerGeometry("top", `${offset}px`);
1313
+ view.setContainerGeometry("width", "");
1314
+ view.setContainerGeometry("left", "");
1272
1315
  }
1273
1316
  view.view.layout(view.size - marginReducedSize, this._orthogonalSize);
1274
1317
  });
@@ -1286,6 +1329,7 @@ react_dom = __toESM(react_dom);
1286
1329
  }
1287
1330
  }
1288
1331
  updateSashEnablement() {
1332
+ if (this.sashes.length === 0) return;
1289
1333
  let previous = false;
1290
1334
  const collapsesDown = this.viewItems.map((i) => previous = i.size - i.minimumSize > 0 || previous);
1291
1335
  previous = false;
@@ -1580,10 +1624,20 @@ react_dom = __toESM(react_dom);
1580
1624
  return this.orientation === "HORIZONTAL" ? this.orthogonalSize : this.size;
1581
1625
  }
1582
1626
  get minimumSize() {
1583
- return this.children.length === 0 ? 0 : Math.max(...this.children.map((c, index) => this.splitview.isViewVisible(index) ? c.minimumOrthogonalSize : 0));
1627
+ if (this._cachedMinimumSize === void 0) {
1628
+ let value = 0;
1629
+ for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.max(value, this.children[index].minimumOrthogonalSize);
1630
+ this._cachedMinimumSize = value;
1631
+ }
1632
+ return this._cachedMinimumSize;
1584
1633
  }
1585
1634
  get maximumSize() {
1586
- return Math.min(...this.children.map((c, index) => this.splitview.isViewVisible(index) ? c.maximumOrthogonalSize : Number.POSITIVE_INFINITY));
1635
+ if (this._cachedMaximumSize === void 0) {
1636
+ let value = Number.POSITIVE_INFINITY;
1637
+ for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.min(value, this.children[index].maximumOrthogonalSize);
1638
+ this._cachedMaximumSize = value;
1639
+ }
1640
+ return this._cachedMaximumSize;
1587
1641
  }
1588
1642
  get minimumOrthogonalSize() {
1589
1643
  return this.splitview.minimumSize;
@@ -1610,15 +1664,29 @@ react_dom = __toESM(react_dom);
1610
1664
  return this.orientation === "HORIZONTAL" ? this.maximumSize : this.maximumOrthogonalSize;
1611
1665
  }
1612
1666
  get priority() {
1667
+ var _this$_cachedPriority;
1668
+ (_this$_cachedPriority = this._cachedPriority) !== null && _this$_cachedPriority !== void 0 || (this._cachedPriority = this.computePriority());
1669
+ return this._cachedPriority;
1670
+ }
1671
+ computePriority() {
1613
1672
  if (this.children.length === 0) return "normal";
1614
- const priorities = new Set(this.children.map((c) => {
1615
- var _c$priority;
1616
- return (_c$priority = c.priority) !== null && _c$priority !== void 0 ? _c$priority : "normal";
1617
- }));
1618
- if (priorities.has("high")) return "high";
1619
- else if (priorities.has("low")) return "low";
1673
+ let hasHigh = false;
1674
+ let hasLow = false;
1675
+ for (const child of this.children) {
1676
+ var _child$priority;
1677
+ const priority = (_child$priority = child.priority) !== null && _child$priority !== void 0 ? _child$priority : "normal";
1678
+ if (priority === "high") hasHigh = true;
1679
+ else if (priority === "low") hasLow = true;
1680
+ }
1681
+ if (hasHigh) return "high";
1682
+ else if (hasLow) return "low";
1620
1683
  return "normal";
1621
1684
  }
1685
+ invalidateCachedSizes() {
1686
+ this._cachedMinimumSize = void 0;
1687
+ this._cachedMaximumSize = void 0;
1688
+ this._cachedPriority = void 0;
1689
+ }
1622
1690
  get disabled() {
1623
1691
  return this.splitview.disabled;
1624
1692
  }
@@ -1694,6 +1762,7 @@ react_dom = __toESM(react_dom);
1694
1762
  if (this.splitview.isViewVisible(index) === visible) return;
1695
1763
  const wereAllChildrenHidden = this.splitview.contentSize === 0;
1696
1764
  this.splitview.setViewVisible(index, visible);
1765
+ this.invalidateCachedSizes();
1697
1766
  const areAllChildrenHidden = this.splitview.contentSize === 0;
1698
1767
  if (visible && wereAllChildrenHidden || !visible && areAllChildrenHidden) this._onDidVisibilityChange.fire({ visible });
1699
1768
  }
@@ -1742,12 +1811,14 @@ react_dom = __toESM(react_dom);
1742
1811
  return child;
1743
1812
  }
1744
1813
  setupChildrenEvents() {
1814
+ this.invalidateCachedSizes();
1745
1815
  this._childrenDisposable.dispose();
1746
1816
  this._childrenDisposable = new CompositeDisposable(Event.any(...this.children.map((c) => c.onDidChange))((e) => {
1747
1817
  /**
1748
1818
  * indicate a change has occured to allows any re-rendering but don't bubble
1749
1819
  * event because that was specific to this branch
1750
1820
  */
1821
+ this.invalidateCachedSizes();
1751
1822
  this._onDidChange.fire({ size: e.orthogonalSize });
1752
1823
  }), ...this.children.map((c, i) => {
1753
1824
  if (c instanceof BranchNode) return c.onDidVisibilityChange(({ visible }) => {
@@ -3391,7 +3462,7 @@ react_dom = __toESM(react_dom);
3391
3462
  * Add a group and return the created object.
3392
3463
  */
3393
3464
  addGroup(options) {
3394
- return this.component.addGroup(options);
3465
+ return this.component.withOrigin("api", () => this.component.addGroup(options));
3395
3466
  }
3396
3467
  /**
3397
3468
  * Close all groups and panels.
@@ -3529,13 +3600,13 @@ react_dom = __toESM(react_dom);
3529
3600
  this.activatePrevious(options);
3530
3601
  }
3531
3602
  maximizeGroup(panel) {
3532
- this.component.maximizeGroup(panel.group);
3603
+ this.component.withOrigin("api", () => this.component.maximizeGroup(panel.group));
3533
3604
  }
3534
3605
  hasMaximizedGroup() {
3535
3606
  return this.component.hasMaximizedGroup();
3536
3607
  }
3537
3608
  exitMaximizedGroup() {
3538
- this.component.exitMaximizedGroup();
3609
+ this.component.withOrigin("api", () => this.component.exitMaximizedGroup());
3539
3610
  }
3540
3611
  get onDidMaximizedGroupChange() {
3541
3612
  return this.component.onDidMaximizedGroupChange;
@@ -5439,9 +5510,6 @@ react_dom = __toESM(react_dom);
5439
5510
  const doRender = ((_options$asActive = options === null || options === void 0 ? void 0 : options.asActive) !== null && _options$asActive !== void 0 ? _options$asActive : true) || this.panel && this.group.isPanelActive(this.panel);
5440
5511
  if (((_this$panel = this.panel) === null || _this$panel === void 0 ? void 0 : _this$panel.view.content.element.parentElement) === this._element) {
5441
5512
  var _this$panel$view$cont, _this$panel$view$cont2;
5442
- /**
5443
- * If the currently attached panel is mounted directly to the content then remove it
5444
- */
5445
5513
  this.panel.view.content.element.remove();
5446
5514
  (_this$panel$view$cont = (_this$panel$view$cont2 = this.panel.view.content).onHide) === null || _this$panel$view$cont === void 0 || _this$panel$view$cont.call(_this$panel$view$cont2);
5447
5515
  }
@@ -6157,7 +6225,7 @@ react_dom = __toESM(react_dom);
6157
6225
  this.element.appendChild(this._scrollbar);
6158
6226
  this.addDisposables(addDisposableListener(this.element, "wheel", (event) => {
6159
6227
  this._scrollOffset += event.deltaY * Scrollbar.MouseWheelSpeed;
6160
- this.calculateScrollbarStyles();
6228
+ this.scheduleStyleUpdate();
6161
6229
  }), addDisposableListener(this._scrollbar, "pointerdown", (event) => {
6162
6230
  var _this$_scrollbar$owne;
6163
6231
  event.preventDefault();
@@ -6169,7 +6237,7 @@ react_dom = __toESM(react_dom);
6169
6237
  const delta = this._orientation === "horizontal" ? event.clientX - originalClient : event.clientY - originalClient;
6170
6238
  const p = (this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight) / (this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight);
6171
6239
  this._scrollOffset = originalScrollOffset + delta / p;
6172
- this.calculateScrollbarStyles();
6240
+ this.scheduleStyleUpdate();
6173
6241
  };
6174
6242
  const onEnd = () => {
6175
6243
  toggleClass(this.element, "dv-scrollable-scrolling", false);
@@ -6181,10 +6249,10 @@ react_dom = __toESM(react_dom);
6181
6249
  doc.addEventListener("pointerup", onEnd);
6182
6250
  doc.addEventListener("pointercancel", onEnd);
6183
6251
  }), addDisposableListener(this.element, "scroll", () => {
6184
- this.calculateScrollbarStyles();
6252
+ this.scheduleStyleUpdate();
6185
6253
  }), addDisposableListener(this.scrollableElement, "scroll", () => {
6186
6254
  this._scrollOffset = this._orientation === "horizontal" ? this.scrollableElement.scrollLeft : this.scrollableElement.scrollTop;
6187
- this.calculateScrollbarStyles();
6255
+ this.scheduleStyleUpdate();
6188
6256
  }), watchElementResize(this.element, () => {
6189
6257
  toggleClass(this.element, "dv-scrollable-resizing", true);
6190
6258
  if (this._animationTimer) clearTimeout(this._animationTimer);
@@ -6192,9 +6260,29 @@ react_dom = __toESM(react_dom);
6192
6260
  clearTimeout(this._animationTimer);
6193
6261
  toggleClass(this.element, "dv-scrollable-resizing", false);
6194
6262
  }, 500);
6195
- this.calculateScrollbarStyles();
6263
+ this.scheduleStyleUpdate();
6264
+ }), Disposable.from(() => {
6265
+ if (this._pendingStyleFrame !== void 0) {
6266
+ cancelAnimationFrame(this._pendingStyleFrame);
6267
+ this._pendingStyleFrame = void 0;
6268
+ }
6196
6269
  }));
6197
6270
  }
6271
+ /**
6272
+ * Coalesce the scrollbar restyle to one pass per animation frame. The
6273
+ * wheel / scroll / pointermove handlers can each fire many times per frame,
6274
+ * and `calculateScrollbarStyles` both reads layout (`clientWidth`/
6275
+ * `scrollWidth`) and writes styles + `scrollLeft`/`scrollTop`; running it
6276
+ * synchronously per event caused repeated read→write→read reflow. Batching
6277
+ * to a frame keeps a burst of events to a single measure+write.
6278
+ */
6279
+ scheduleStyleUpdate() {
6280
+ if (this._pendingStyleFrame !== void 0) return;
6281
+ this._pendingStyleFrame = requestAnimationFrame(() => {
6282
+ this._pendingStyleFrame = void 0;
6283
+ this.calculateScrollbarStyles();
6284
+ });
6285
+ }
6198
6286
  calculateScrollbarStyles() {
6199
6287
  const clientSize = this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight;
6200
6288
  const scrollSize = this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight;
@@ -8634,8 +8722,8 @@ react_dom = __toESM(react_dom);
8634
8722
  }, true), addDisposableListener(this._tabsList, "dragend", () => {
8635
8723
  this._reorder.resetDragAnimation();
8636
8724
  }), addDisposableListener(this._tabsList, "drop", (event) => {
8637
- var _this$accessor$option, _this$group$model$dro;
8638
- if (!this._animState || this._animState.currentInsertionIndex === null) return;
8725
+ var _this$_animState3, _this$accessor$option, _this$group$model$dro;
8726
+ if (((_this$_animState3 = this._animState) === null || _this$_animState3 === void 0 ? void 0 : _this$_animState3.currentInsertionIndex) == null) return;
8639
8727
  if (((_this$accessor$option = this.accessor.options.theme) === null || _this$accessor$option === void 0 ? void 0 : _this$accessor$option.tabAnimation) !== "smooth" && !this._animState.sourceTabGroupId) return;
8640
8728
  event.stopPropagation();
8641
8729
  event.preventDefault();
@@ -8840,7 +8928,7 @@ react_dom = __toESM(react_dom);
8840
8928
  };
8841
8929
  this._pendingCollapse = true;
8842
8930
  requestAnimationFrame(() => {
8843
- var _this$_animState3, _this$_animState3$cur;
8931
+ var _this$_animState4, _this$_animState4$cur;
8844
8932
  this._pendingCollapse = false;
8845
8933
  if (!this._animState) return;
8846
8934
  if (!this._tabsList.classList.contains("dv-tabs-container--wrap")) {
@@ -8848,7 +8936,7 @@ react_dom = __toESM(react_dom);
8848
8936
  toggleClass(tab.element, "dv-tab--dragging", true);
8849
8937
  tab.element.offsetHeight;
8850
8938
  }
8851
- (_this$_animState3$cur = (_this$_animState3 = this._animState).currentInsertionIndex) !== null && _this$_animState3$cur !== void 0 || (_this$_animState3.currentInsertionIndex = sourceIndex);
8939
+ (_this$_animState4$cur = (_this$_animState4 = this._animState).currentInsertionIndex) !== null && _this$_animState4$cur !== void 0 || (_this$_animState4.currentInsertionIndex = sourceIndex);
8852
8940
  this.applyDragOverTransforms(true);
8853
8941
  tab.element.style.removeProperty("transition");
8854
8942
  });
@@ -8937,8 +9025,8 @@ react_dom = __toESM(react_dom);
8937
9025
  }
8938
9026
  }
8939
9027
  delete(id) {
8940
- var _this$_animState4;
8941
- if (((_this$_animState4 = this._animState) === null || _this$_animState4 === void 0 ? void 0 : _this$_animState4.sourceTabId) === id) {
9028
+ var _this$_animState5;
9029
+ if (((_this$_animState5 = this._animState) === null || _this$_animState5 === void 0 ? void 0 : _this$_animState5.sourceTabId) === id) {
8942
9030
  this.resetTabTransforms();
8943
9031
  this._animState = null;
8944
9032
  }
@@ -9055,7 +9143,7 @@ react_dom = __toESM(react_dom);
9055
9143
  const groupPanelIds = new Set(tabGroup.panelIds);
9056
9144
  this._pendingCollapse = true;
9057
9145
  requestAnimationFrame(() => {
9058
- var _this$_animState5, _this$_animState5$cur;
9146
+ var _this$_animState6, _this$_animState6$cur;
9059
9147
  this._pendingCollapse = false;
9060
9148
  if (!this._animState) return;
9061
9149
  for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) {
@@ -9070,7 +9158,7 @@ react_dom = __toESM(react_dom);
9070
9158
  this._tabsList.offsetHeight;
9071
9159
  const underline = this._tabGroupManager.groupUnderlines.get(tabGroup.id);
9072
9160
  if (underline) underline.style.display = "none";
9073
- (_this$_animState5$cur = (_this$_animState5 = this._animState).currentInsertionIndex) !== null && _this$_animState5$cur !== void 0 || (_this$_animState5.currentInsertionIndex = firstIdx);
9161
+ (_this$_animState6$cur = (_this$_animState6 = this._animState).currentInsertionIndex) !== null && _this$_animState6$cur !== void 0 || (_this$_animState6.currentInsertionIndex = firstIdx);
9074
9162
  this.applyDragOverTransforms(true);
9075
9163
  for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) t.value.element.style.removeProperty("transition");
9076
9164
  if (chipEntry) chipEntry.chip.element.style.removeProperty("transition");
@@ -9793,6 +9881,7 @@ react_dom = __toESM(react_dom);
9793
9881
  set headerPosition(value) {
9794
9882
  var _this$_activePanel;
9795
9883
  this._headerPosition = value;
9884
+ this.invalidateHeaderSize();
9796
9885
  removeClasses(this.container, "dv-groupview-header-top", "dv-groupview-header-bottom", "dv-groupview-header-left", "dv-groupview-header-right");
9797
9886
  addClasses(this.container, `dv-groupview-header-${value}`);
9798
9887
  const direction = value === "top" || value === "bottom" ? "horizontal" : "vertical";
@@ -9934,7 +10023,14 @@ react_dom = __toESM(react_dom);
9934
10023
  this.header.hidden = !!options.hideHeader;
9935
10024
  this.locked = (_options$locked = options.locked) !== null && _options$locked !== void 0 ? _options$locked : false;
9936
10025
  this.headerPosition = (_options$headerPositi = options.headerPosition) !== null && _options$headerPositi !== void 0 ? _options$headerPositi : accessor.defaultHeaderPosition;
9937
- this.addDisposables(this._onDidPanelTitleChange.event(() => this.updateAccessibleLabel()), this._onTabDragStart, this._onGroupDragStart, this._onWillShowOverlay, this.tabsContainer.onTabDragStart((event) => {
10026
+ this.addDisposables(watchElementResize(this.tabsContainer.element, () => {
10027
+ if (this.isDisposed) return;
10028
+ const size = this.measureHeaderSize();
10029
+ if (size !== this._cachedHeaderSize) {
10030
+ this._cachedHeaderSize = size;
10031
+ this.layout(this._width, this._height);
10032
+ }
10033
+ }), this._onDidPanelTitleChange.event(() => this.updateAccessibleLabel()), this._onTabDragStart, this._onGroupDragStart, this._onWillShowOverlay, this.tabsContainer.onTabDragStart((event) => {
9938
10034
  this._onTabDragStart.fire(event);
9939
10035
  }), this.tabsContainer.onGroupDragStart((event) => {
9940
10036
  this._onGroupDragStart.fire(event);
@@ -10391,16 +10487,11 @@ react_dom = __toESM(react_dom);
10391
10487
  (_this$_activePanel3 = this._activePanel) === null || _this$_activePanel3 === void 0 || _this$_activePanel3.focus();
10392
10488
  }
10393
10489
  openPanel(panel, options = {}) {
10394
- /**
10395
- * set the panel group
10396
- * add the panel
10397
- * check if group active
10398
- * check if panel active
10399
- */
10400
10490
  if (typeof options.index !== "number" || options.index > this.panels.length) options.index = this.panels.length;
10401
10491
  const skipSetActive = !!options.skipSetActive;
10402
10492
  panel.updateParentGroup(this.groupPanel, { skipSetActive: options.skipSetActive });
10403
10493
  this.doAddPanel(panel, options.index, { skipSetActive });
10494
+ this.invalidateHeaderSize();
10404
10495
  if (this._activePanel === panel) {
10405
10496
  this.contentContainer.renderPanel(panel, { asActive: true });
10406
10497
  return;
@@ -10463,6 +10554,7 @@ react_dom = __toESM(react_dom);
10463
10554
  * changing) down to the content + active panel.
10464
10555
  */
10465
10556
  relayout() {
10557
+ this.invalidateHeaderSize();
10466
10558
  this.layout(this._width, this._height);
10467
10559
  }
10468
10560
  /**
@@ -10472,17 +10564,32 @@ react_dom = __toESM(react_dom);
10472
10564
  * width); a hidden header has `display:none` so its `offset*` is 0 and
10473
10565
  * nothing is subtracted.
10474
10566
  */
10475
- contentDimensions() {
10567
+ /**
10568
+ * Measure the header's extent along its occupied axis. This is the single
10569
+ * forced-reflow read; it now runs only on a cache miss (first layout after
10570
+ * a header change) and inside the header's ResizeObserver — not on every
10571
+ * layout frame.
10572
+ */
10573
+ measureHeaderSize() {
10476
10574
  const headerEl = this.tabsContainer.element;
10575
+ return this.headerPosition === "top" || this.headerPosition === "bottom" ? headerEl.offsetHeight : headerEl.offsetWidth;
10576
+ }
10577
+ invalidateHeaderSize() {
10578
+ this._cachedHeaderSize = void 0;
10579
+ }
10580
+ contentDimensions() {
10581
+ var _this$_cachedHeaderSi;
10477
10582
  const horizontal = this.headerPosition === "top" || this.headerPosition === "bottom";
10583
+ const headerSize = (_this$_cachedHeaderSi = this._cachedHeaderSize) !== null && _this$_cachedHeaderSi !== void 0 ? _this$_cachedHeaderSi : this._cachedHeaderSize = this.measureHeaderSize();
10478
10584
  return {
10479
- width: horizontal ? this._width : Math.max(0, this._width - headerEl.offsetWidth),
10480
- height: horizontal ? Math.max(0, this._height - headerEl.offsetHeight) : this._height
10585
+ width: horizontal ? this._width : Math.max(0, this._width - headerSize),
10586
+ height: horizontal ? Math.max(0, this._height - headerSize) : this._height
10481
10587
  };
10482
10588
  }
10483
10589
  _removePanel(panel, options) {
10484
10590
  const isActivePanel = this._activePanel === panel;
10485
10591
  this.doRemovePanel(panel);
10592
+ this.invalidateHeaderSize();
10486
10593
  if (isActivePanel && this.panels.length > 0) {
10487
10594
  const nextPanel = this.mostRecentlyUsed[0];
10488
10595
  this.openPanel(nextPanel, {
@@ -10802,6 +10909,7 @@ react_dom = __toESM(react_dom);
10802
10909
  if (typeof event.minimumHeight === "number" || typeof event.minimumHeight === "function") this._minimumHeight = event.minimumHeight;
10803
10910
  if (typeof event.maximumWidth === "number" || typeof event.maximumWidth === "function") this._maximumWidth = event.maximumWidth;
10804
10911
  if (typeof event.maximumHeight === "number" || typeof event.maximumHeight === "function") this._maximumHeight = event.maximumHeight;
10912
+ this._onDidChange.fire(void 0);
10805
10913
  }), this.api.onDidSizeChange((event) => {
10806
10914
  this._onDidChange.fire({
10807
10915
  height: event.height,
@@ -10918,20 +11026,22 @@ react_dom = __toESM(react_dom);
10918
11026
  return this._group.model.headerPosition;
10919
11027
  }
10920
11028
  moveTo(options) {
10921
- var _options$group, _options$position, _options$skipSetActiv, _options$position2;
10922
11029
  if (!this._group) throw new Error(NOT_INITIALIZED_MESSAGE);
10923
- const group = (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this.accessor.addGroup({
10924
- direction: positionToDirection((_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "right"),
10925
- skipSetActive: (_options$skipSetActiv = options.skipSetActive) !== null && _options$skipSetActiv !== void 0 ? _options$skipSetActiv : false
10926
- });
10927
- this.accessor.moveGroupOrPanel({
10928
- from: { groupId: this._group.id },
10929
- to: {
10930
- group,
10931
- position: options.group ? (_options$position2 = options.position) !== null && _options$position2 !== void 0 ? _options$position2 : "center" : "center",
10932
- index: options.index
10933
- },
10934
- skipSetActive: options.skipSetActive
11030
+ this.accessor.withOrigin("api", () => {
11031
+ var _options$group, _options$position, _options$skipSetActiv, _options$position2;
11032
+ const group = (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this.accessor.addGroup({
11033
+ direction: positionToDirection((_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "right"),
11034
+ skipSetActive: (_options$skipSetActiv = options.skipSetActive) !== null && _options$skipSetActiv !== void 0 ? _options$skipSetActiv : false
11035
+ });
11036
+ this.accessor.moveGroupOrPanel({
11037
+ from: { groupId: this._group.id },
11038
+ to: {
11039
+ group,
11040
+ position: options.group ? (_options$position2 = options.position) !== null && _options$position2 !== void 0 ? _options$position2 : "center" : "center",
11041
+ index: options.index
11042
+ },
11043
+ skipSetActive: options.skipSetActive
11044
+ });
10935
11045
  });
10936
11046
  }
10937
11047
  maximize() {
@@ -11271,18 +11381,20 @@ react_dom = __toESM(react_dom);
11271
11381
  this.accessor.withOrigin("api", () => super.setActive());
11272
11382
  }
11273
11383
  moveTo(options) {
11274
- var _options$group, _options$position;
11275
- this.accessor.moveGroupOrPanel({
11276
- from: {
11277
- groupId: this._group.id,
11278
- panelId: this.panel.id
11279
- },
11280
- to: {
11281
- group: (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this._group,
11282
- position: options.group ? (_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "center" : "center",
11283
- index: options.index
11284
- },
11285
- skipSetActive: options.skipSetActive
11384
+ this.accessor.withOrigin("api", () => {
11385
+ var _options$group, _options$position;
11386
+ return this.accessor.moveGroupOrPanel({
11387
+ from: {
11388
+ groupId: this._group.id,
11389
+ panelId: this.panel.id
11390
+ },
11391
+ to: {
11392
+ group: (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this._group,
11393
+ position: options.group ? (_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "center" : "center",
11394
+ index: options.index
11395
+ },
11396
+ skipSetActive: options.skipSetActive
11397
+ });
11286
11398
  });
11287
11399
  }
11288
11400
  setTitle(title) {
@@ -12365,12 +12477,6 @@ react_dom = __toESM(react_dom);
12365
12477
  moduleName: "ContextMenu",
12366
12478
  when: (o) => o.getTabGroupChipContextMenuItems != null
12367
12479
  },
12368
- {
12369
- optionKey: "createContextMenuItemComponent",
12370
- reason: "createContextMenuItemComponent",
12371
- moduleName: "ContextMenu",
12372
- when: (o) => o.createContextMenuItemComponent != null
12373
- },
12374
12480
  {
12375
12481
  optionKey: "dndCompass",
12376
12482
  reason: "dndCompass",
@@ -13072,7 +13178,18 @@ react_dom = __toESM(react_dom);
13072
13178
  prev = next;
13073
13179
  const panel = group.activePanel;
13074
13180
  if (!panel) return;
13075
- const kind = next === "floating" ? "float" : next === "popout" ? "popout" : "dock";
13181
+ let kind;
13182
+ switch (next) {
13183
+ case "floating":
13184
+ kind = "float";
13185
+ break;
13186
+ case "popout":
13187
+ kind = "popout";
13188
+ break;
13189
+ default:
13190
+ kind = "dock";
13191
+ break;
13192
+ }
13076
13193
  this._announce(panel, kind);
13077
13194
  });
13078
13195
  this._locationSubs.set(group.id, sub);
@@ -13121,29 +13238,14 @@ react_dom = __toESM(react_dom);
13121
13238
  serviceKey: "liveRegionService",
13122
13239
  create: (host) => new LiveRegionService(host)
13123
13240
  });
13124
- /** Cursor offset of the group drag ghost, matched to the long-shipped default. */
13241
+ /** Cursor offset of the group drag ghost. */
13125
13242
  const GROUP_DRAG_GHOST_OFFSET_X = 30;
13126
13243
  const GROUP_DRAG_GHOST_OFFSET_Y = -10;
13127
13244
  /**
13128
- * The narrow surface the {@link AdvancedDnDService} needs from the host
13129
- * (the `DockviewComponent`).
13130
- *
13131
- * The `onWill*` emitters stay on the component so the public event shape is
13132
- * unchanged whether or not this module is registered; the service is only the
13133
- * dispatch point those fires are routed through. Engine policy (e.g. the
13134
- * `disableDnd` guard) stays on the component, ahead of the dispatch.
13135
- */
13136
- /**
13137
13245
  * Owns the dispatch of the advanced drag-and-drop hooks: `onWillDragPanel`,
13138
- * `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay`.
13139
- *
13140
- * At this stage the service is a thin dispatcher that forwards to the host's
13141
- * emitters; the customisation surface it gates (custom drop overlays, custom
13142
- * group drag ghosts, hook veto/transform behaviour) is currently inlined in
13143
- * core and is extracted into this service in later phases. Routing the
13144
- * dispatch through a module slot is what lets that customisation layer move
13145
- * into a separately-distributed package in a future major version without
13146
- * changing the public event surface.
13246
+ * `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay`, forwarding each to
13247
+ * the host's emitters so the public event shape is unchanged whether or not
13248
+ * this module is registered.
13147
13249
  *
13148
13250
  * The service holds no drag state of its own. The gesture is driven by the
13149
13251
  * DnD backends, and the per-group subscriptions live on the component's group
@@ -13260,7 +13362,7 @@ react_dom = __toESM(react_dom);
13260
13362
  ];
13261
13363
  var PositionCache = class {
13262
13364
  constructor() {
13263
- this.cache = /* @__PURE__ */ new Map();
13365
+ this.cache = /* @__PURE__ */ new WeakMap();
13264
13366
  this.currentFrameId = 0;
13265
13367
  this.rafId = null;
13266
13368
  }
@@ -14905,7 +15007,22 @@ react_dom = __toESM(react_dom);
14905
15007
  const rect = candidate.element.getBoundingClientRect();
14906
15008
  const dx = rect.left + rect.width / 2 - fromX;
14907
15009
  const dy = rect.top + rect.height / 2 - fromY;
14908
- if (!(direction === "left" ? dx < 0 && Math.abs(dx) >= Math.abs(dy) : direction === "right" ? dx > 0 && Math.abs(dx) >= Math.abs(dy) : direction === "up" ? dy < 0 && Math.abs(dy) >= Math.abs(dx) : dy > 0 && Math.abs(dy) >= Math.abs(dx))) continue;
15010
+ let inDirection;
15011
+ switch (direction) {
15012
+ case "left":
15013
+ inDirection = dx < 0 && Math.abs(dx) >= Math.abs(dy);
15014
+ break;
15015
+ case "right":
15016
+ inDirection = dx > 0 && Math.abs(dx) >= Math.abs(dy);
15017
+ break;
15018
+ case "up":
15019
+ inDirection = dy < 0 && Math.abs(dy) >= Math.abs(dx);
15020
+ break;
15021
+ default:
15022
+ inDirection = dy > 0 && Math.abs(dy) >= Math.abs(dx);
15023
+ break;
15024
+ }
15025
+ if (!inDirection) continue;
14909
15026
  const distance = dx * dx + dy * dy;
14910
15027
  if (distance < bestDistance) {
14911
15028
  bestDistance = distance;
@@ -15753,11 +15870,15 @@ react_dom = __toESM(react_dom);
15753
15870
  /**
15754
15871
  * Reveal (create-or-fill) the edge group at `position` and move the dragged
15755
15872
  * item described by `data` into it. A newly created edge group is created
15756
- * collapsed and flagged `autoReveal` so it tears down to zero footprint when
15757
- * later emptied. If an edge group already exists there it is reused: the
15758
- * panel is added to its tabs and its collapsed/toggled state is left as-is
15759
- * (never re-created; `addEdgeGroup` throws on a duplicate position). No-op if
15760
- * the EdgeGroup module is absent.
15873
+ * collapsed, flagged `autoReveal` so it tears down to zero footprint when
15874
+ * later emptied, and takes its auto-hide state from `options.autoHide`. If an
15875
+ * edge group already exists there it is reused: the panel is added to its
15876
+ * tabs and its collapsed/toggled *and auto-hide* state are left as-is (never
15877
+ * re-created; `addEdgeGroup` throws on a duplicate position). This keeps a
15878
+ * drag-reveal from silently converting a static edge group into an
15879
+ * auto-hiding one; to change an existing group's auto-hide, call
15880
+ * `api.getEdgeGroup(position)?.setAutoHide(...)` directly. No-op if the
15881
+ * EdgeGroup module is absent.
15761
15882
  *
15762
15883
  * This is the primitive behind the dock-to-edge groups: the two-band
15763
15884
  * drag-reveal affordance routes its outer-band drops here.
@@ -15776,7 +15897,7 @@ react_dom = __toESM(react_dom);
15776
15897
  collapsed: true
15777
15898
  });
15778
15899
  group = service.get(position);
15779
- } else if ((options === null || options === void 0 ? void 0 : options.autoHide) !== void 0) this.setEdgeGroupAutoHide(group, options.autoHide);
15900
+ }
15780
15901
  if (!group) return;
15781
15902
  this.moveGroupOrPanel({
15782
15903
  from: {
@@ -16307,6 +16428,7 @@ react_dom = __toESM(react_dom);
16307
16428
  height: options.initialHeight
16308
16429
  };
16309
16430
  let index;
16431
+ const shouldSkipSetActive = (group) => !!options.inactive && group.model.size > 0;
16310
16432
  if (options.position) if (isPanelOptionsWithPanel(options.position)) {
16311
16433
  const referencePanel = typeof options.position.referencePanel === "string" ? this.getGroupPanel(options.position.referencePanel) : options.position.referencePanel;
16312
16434
  index = options.position.index;
@@ -16329,7 +16451,7 @@ react_dom = __toESM(react_dom);
16329
16451
  const group = this.orthogonalize(directionToPosition(options.position.direction));
16330
16452
  const panel = this.createPanel(options, group);
16331
16453
  group.model.openPanel(panel, {
16332
- skipSetActive: options.inactive,
16454
+ skipSetActive: shouldSkipSetActive(group),
16333
16455
  skipSetGroupActive: options.inactive,
16334
16456
  index
16335
16457
  });
@@ -16356,14 +16478,14 @@ react_dom = __toESM(react_dom);
16356
16478
  }));
16357
16479
  panel = this.createPanel(options, group);
16358
16480
  group.model.openPanel(panel, {
16359
- skipSetActive: options.inactive,
16481
+ skipSetActive: shouldSkipSetActive(group),
16360
16482
  skipSetGroupActive: options.inactive,
16361
16483
  index
16362
16484
  });
16363
16485
  } else if (referenceGroup.api.location.type === "floating" || referenceGroup.api.location.type === "edge" || target === "center") {
16364
16486
  panel = this.createPanel(options, referenceGroup);
16365
16487
  referenceGroup.model.openPanel(panel, {
16366
- skipSetActive: options.inactive,
16488
+ skipSetActive: shouldSkipSetActive(referenceGroup),
16367
16489
  skipSetGroupActive: options.inactive,
16368
16490
  index
16369
16491
  });
@@ -16378,7 +16500,7 @@ react_dom = __toESM(react_dom);
16378
16500
  const group = this.createGroupAtLocation(relativeLocation, this.orientationAtLocation(relativeLocation) === "VERTICAL" ? initial === null || initial === void 0 ? void 0 : initial.height : initial === null || initial === void 0 ? void 0 : initial.width);
16379
16501
  panel = this.createPanel(options, group);
16380
16502
  group.model.openPanel(panel, {
16381
- skipSetActive: options.inactive,
16503
+ skipSetActive: shouldSkipSetActive(group),
16382
16504
  skipSetGroupActive: options.inactive,
16383
16505
  index
16384
16506
  });
@@ -16395,7 +16517,7 @@ react_dom = __toESM(react_dom);
16395
16517
  }));
16396
16518
  panel = this.createPanel(options, group);
16397
16519
  group.model.openPanel(panel, {
16398
- skipSetActive: options.inactive,
16520
+ skipSetActive: shouldSkipSetActive(group),
16399
16521
  skipSetGroupActive: options.inactive,
16400
16522
  index
16401
16523
  });
@@ -16403,7 +16525,7 @@ react_dom = __toESM(react_dom);
16403
16525
  const group = this.createGroupAtLocation([0], this.gridview.orientation === "VERTICAL" ? initial === null || initial === void 0 ? void 0 : initial.height : initial === null || initial === void 0 ? void 0 : initial.width);
16404
16526
  panel = this.createPanel(options, group);
16405
16527
  group.model.openPanel(panel, {
16406
- skipSetActive: options.inactive,
16528
+ skipSetActive: shouldSkipSetActive(group),
16407
16529
  skipSetGroupActive: options.inactive,
16408
16530
  index
16409
16531
  });