dockview-core 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-core
3
- * @version 8.0.0
3
+ * @version 8.1.0
4
4
  * @link https://github.com/dockview/dockview
5
5
  * @license MIT
6
6
  */
@@ -13,7 +13,9 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
13
13
 
14
14
  //#region src/dnd/dataTransfer.ts
15
15
  var _LocalSelectionTransfer;
16
- var TransferObject = class {};
16
+ var TransferObject = class {
17
+ constructor() {}
18
+ };
17
19
  var PanelTransfer = class extends TransferObject {
18
20
  constructor(viewId, groupId, panelId, tabGroupId) {
19
21
  super();
@@ -206,7 +208,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
206
208
  this.options = options;
207
209
  this._listeners = [];
208
210
  this._disposed = false;
209
- this._pauseTokens = /* @__PURE__ */ new Set();
210
211
  }
211
212
  get event() {
212
213
  if (!this._event) {
@@ -227,14 +228,26 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
227
228
  }
228
229
  fire(e) {
229
230
  var _this$options2;
230
- if (this._pauseTokens.size > 0) return;
231
+ if (this._pauseTokens !== void 0 && this._pauseTokens.size > 0) return;
231
232
  if ((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.replay) this._last = e;
232
- for (const listener of this._listeners.slice()) listener.callback(e);
233
+ const listeners = this._listeners;
234
+ const length = listeners.length;
235
+ if (length === 0) return;
236
+ if (length === 1) {
237
+ listeners[0].callback(e);
238
+ return;
239
+ }
240
+ for (const listener of listeners.slice()) listener.callback(e);
233
241
  }
234
242
  pause() {
243
+ var _this$_pauseTokens;
235
244
  const token = {};
245
+ (_this$_pauseTokens = this._pauseTokens) !== null && _this$_pauseTokens !== void 0 || (this._pauseTokens = /* @__PURE__ */ new Set());
236
246
  this._pauseTokens.add(token);
237
- return Disposable.from(() => this._pauseTokens.delete(token));
247
+ return Disposable.from(() => {
248
+ var _this$_pauseTokens2;
249
+ return (_this$_pauseTokens2 = this._pauseTokens) === null || _this$_pauseTokens2 === void 0 ? void 0 : _this$_pauseTokens2.delete(token);
250
+ });
238
251
  }
239
252
  dispose() {
240
253
  if (!this._disposed) {
@@ -537,8 +550,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
537
550
  let previousScreenX = window.screenX;
538
551
  let previousScreenY = window.screenY;
539
552
  let timeout;
553
+ let rafHandle = 0;
554
+ let stopped = false;
540
555
  const checkMovement = () => {
541
- if (window.closed) return;
556
+ if (stopped || window.closed) return;
542
557
  const currentScreenX = window.screenX;
543
558
  const currentScreenY = window.screenY;
544
559
  if (currentScreenX !== previousScreenX || currentScreenY !== previousScreenY) {
@@ -549,9 +564,18 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
549
564
  previousScreenX = currentScreenX;
550
565
  previousScreenY = currentScreenY;
551
566
  }
552
- requestAnimationFrame(checkMovement);
567
+ rafHandle = requestAnimationFrame(checkMovement);
553
568
  };
554
569
  checkMovement();
570
+ const disposeEmitter = emitter.dispose.bind(emitter);
571
+ emitter.dispose = () => {
572
+ if (!stopped) {
573
+ stopped = true;
574
+ cancelAnimationFrame(rafHandle);
575
+ clearTimeout(timeout);
576
+ }
577
+ disposeEmitter();
578
+ };
555
579
  return emitter;
556
580
  }
557
581
  function onDidWindowResizeEnd(element, cb) {
@@ -687,6 +711,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
687
711
  set size(size) {
688
712
  this._size = size;
689
713
  }
714
+ setContainerGeometry(prop, value) {
715
+ if (this._appliedStyles[prop] === value) return;
716
+ this._appliedStyles[prop] = value;
717
+ this.container.style[prop] = value;
718
+ }
690
719
  get size() {
691
720
  return this._size;
692
721
  }
@@ -722,6 +751,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
722
751
  this.view = view;
723
752
  this.disposable = disposable;
724
753
  this._cachedVisibleSize = void 0;
754
+ this._appliedStyles = {};
725
755
  if (typeof size === "number") {
726
756
  this._size = size;
727
757
  this._cachedVisibleSize = void 0;
@@ -770,6 +800,16 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
770
800
  LayoutPriority["Normal"] = "normal";
771
801
  return LayoutPriority;
772
802
  }({});
803
+ function setSashPosition(sash, left, top) {
804
+ if (sash.appliedLeft !== left) {
805
+ sash.appliedLeft = left;
806
+ sash.container.style.left = left;
807
+ }
808
+ if (sash.appliedTop !== top) {
809
+ sash.appliedTop = top;
810
+ sash.container.style.top = top;
811
+ }
812
+ }
773
813
  let Sizing;
774
814
  (function(_Sizing) {
775
815
  _Sizing.Distribute = { type: "distribute" };
@@ -888,10 +928,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
888
928
  pushToEnd(upIndexes, i);
889
929
  pushToEnd(downIndexes, i);
890
930
  }
891
- const upItems = upIndexes.map((i) => this.viewItems[i]);
892
- const upSizes = upIndexes.map((i) => sizes[i]);
893
- const downItems = downIndexes.map((i) => this.viewItems[i]);
894
- const downSizes = downIndexes.map((i) => sizes[i]);
895
931
  const minDeltaUp = upIndexes.reduce((_, i) => _ + this.viewItems[i].minimumSize - sizes[i], 0);
896
932
  const maxDeltaUp = upIndexes.reduce((_, i) => _ + this.viewItems[i].maximumSize - sizes[i], 0);
897
933
  const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((_, i) => _ + sizes[i] - this.viewItems[i].minimumSize, 0);
@@ -915,19 +951,21 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
915
951
  const tentativeDelta = clamp(delta, minDelta, maxDelta);
916
952
  let actualDelta = 0;
917
953
  let deltaUp = tentativeDelta;
918
- for (let i = 0; i < upItems.length; i++) {
919
- const item = upItems[i];
920
- const size = clamp(upSizes[i] + deltaUp, item.minimumSize, item.maximumSize);
921
- const viewDelta = size - upSizes[i];
954
+ for (const upIndex of upIndexes) {
955
+ const item = this.viewItems[upIndex];
956
+ const priorSize = sizes[upIndex];
957
+ const size = clamp(priorSize + deltaUp, item.minimumSize, item.maximumSize);
958
+ const viewDelta = size - priorSize;
922
959
  actualDelta += viewDelta;
923
960
  deltaUp -= viewDelta;
924
961
  item.size = size;
925
962
  }
926
963
  let deltaDown = actualDelta;
927
- for (let i = 0; i < downItems.length; i++) {
928
- const item = downItems[i];
929
- const size = clamp(downSizes[i] - deltaDown, item.minimumSize, item.maximumSize);
930
- const viewDelta = size - downSizes[i];
964
+ for (const downIndex of downIndexes) {
965
+ const item = this.viewItems[downIndex];
966
+ const priorSize = sizes[downIndex];
967
+ const size = clamp(priorSize - deltaDown, item.minimumSize, item.maximumSize);
968
+ const viewDelta = size - priorSize;
931
969
  deltaDown += viewDelta;
932
970
  item.size = size;
933
971
  }
@@ -1175,13 +1213,22 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1175
1213
  this.saveProportions();
1176
1214
  }
1177
1215
  distributeEmptySpace(lowPriorityIndex) {
1178
- const contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);
1216
+ let contentSize = 0;
1217
+ for (const item of this.viewItems) contentSize += item.size;
1179
1218
  let emptyDelta = this.size - contentSize;
1219
+ if (emptyDelta === 0) return;
1180
1220
  const indexes = range(this.viewItems.length - 1, -1);
1181
- const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "low");
1182
- const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "high");
1183
- for (const index of highPriorityIndexes) pushToStart(indexes, index);
1184
- for (const index of lowPriorityIndexes) pushToEnd(indexes, index);
1221
+ let hasPriority = false;
1222
+ for (const item of this.viewItems) if (item.priority === "low" || item.priority === "high") {
1223
+ hasPriority = true;
1224
+ break;
1225
+ }
1226
+ if (hasPriority) {
1227
+ const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "low");
1228
+ const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "high");
1229
+ for (const index of highPriorityIndexes) pushToStart(indexes, index);
1230
+ for (const index of lowPriorityIndexes) pushToEnd(indexes, index);
1231
+ }
1185
1232
  if (typeof lowPriorityIndex === "number") pushToEnd(indexes, lowPriorityIndex);
1186
1233
  for (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) {
1187
1234
  const item = this.viewItems[indexes[i]];
@@ -1204,49 +1251,45 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1204
1251
  * For each view `i` the offet must be adjusted by `m * i/(n - 1)`.
1205
1252
  */
1206
1253
  layoutViews() {
1207
- this._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);
1254
+ let contentSize = 0;
1255
+ let visibleViewCount = 0;
1256
+ for (const item of this.viewItems) {
1257
+ contentSize += item.size;
1258
+ if (item.visible) visibleViewCount++;
1259
+ }
1260
+ this._contentSize = contentSize;
1208
1261
  this.updateSashEnablement();
1209
1262
  if (this.viewItems.length === 0) return;
1210
- const visibleViewItems = this.viewItems.filter((i) => i.visible);
1211
- const sashCount = Math.max(0, visibleViewItems.length - 1);
1212
- const marginReducedSize = this.margin * sashCount / Math.max(1, visibleViewItems.length);
1263
+ const sashCount = Math.max(0, visibleViewCount - 1);
1264
+ const marginReducedSize = this.margin * sashCount / Math.max(1, visibleViewCount);
1213
1265
  let totalLeftOffset = 0;
1214
1266
  const viewLeftOffsets = [];
1215
1267
  const sashWidth = 4;
1216
- const runningVisiblePanelCount = this.viewItems.reduce((arr, viewItem, i) => {
1217
- const flag = viewItem.visible ? 1 : 0;
1218
- if (i === 0) arr.push(flag);
1219
- else arr.push(arr[i - 1] + flag);
1220
- return arr;
1221
- }, []);
1268
+ let runningVisiblePanelCount = 0;
1222
1269
  this.viewItems.forEach((view, i) => {
1223
1270
  totalLeftOffset += this.viewItems[i].size;
1224
1271
  viewLeftOffsets.push(totalLeftOffset);
1272
+ runningVisiblePanelCount += view.visible ? 1 : 0;
1225
1273
  const size = view.visible ? view.size - marginReducedSize : 0;
1226
- const visiblePanelsBeforeThisView = Math.max(0, runningVisiblePanelCount[i] - 1);
1274
+ const visiblePanelsBeforeThisView = Math.max(0, runningVisiblePanelCount - 1);
1227
1275
  const offset = i === 0 || visiblePanelsBeforeThisView === 0 ? 0 : viewLeftOffsets[i - 1] + visiblePanelsBeforeThisView / sashCount * marginReducedSize;
1228
1276
  if (i < this.viewItems.length - 1) {
1229
1277
  const newSize = view.visible ? offset + size - sashWidth / 2 + this.margin / 2 : offset;
1230
- if (this._orientation === "HORIZONTAL") {
1231
- this.sashes[i].container.style.left = `${newSize}px`;
1232
- this.sashes[i].container.style.top = `0px`;
1233
- }
1234
- if (this._orientation === "VERTICAL") {
1235
- this.sashes[i].container.style.left = `0px`;
1236
- this.sashes[i].container.style.top = `${newSize}px`;
1237
- }
1278
+ const sash = this.sashes[i];
1279
+ if (this._orientation === "HORIZONTAL") setSashPosition(sash, `${newSize}px`, `0px`);
1280
+ if (this._orientation === "VERTICAL") setSashPosition(sash, `0px`, `${newSize}px`);
1238
1281
  }
1239
1282
  if (this._orientation === "HORIZONTAL") {
1240
- view.container.style.width = `${size}px`;
1241
- view.container.style.left = `${offset}px`;
1242
- view.container.style.top = "";
1243
- view.container.style.height = "";
1283
+ view.setContainerGeometry("width", `${size}px`);
1284
+ view.setContainerGeometry("left", `${offset}px`);
1285
+ view.setContainerGeometry("top", "");
1286
+ view.setContainerGeometry("height", "");
1244
1287
  }
1245
1288
  if (this._orientation === "VERTICAL") {
1246
- view.container.style.height = `${size}px`;
1247
- view.container.style.top = `${offset}px`;
1248
- view.container.style.width = "";
1249
- view.container.style.left = "";
1289
+ view.setContainerGeometry("height", `${size}px`);
1290
+ view.setContainerGeometry("top", `${offset}px`);
1291
+ view.setContainerGeometry("width", "");
1292
+ view.setContainerGeometry("left", "");
1250
1293
  }
1251
1294
  view.view.layout(view.size - marginReducedSize, this._orthogonalSize);
1252
1295
  });
@@ -1264,6 +1307,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1264
1307
  }
1265
1308
  }
1266
1309
  updateSashEnablement() {
1310
+ if (this.sashes.length === 0) return;
1267
1311
  let previous = false;
1268
1312
  const collapsesDown = this.viewItems.map((i) => previous = i.size - i.minimumSize > 0 || previous);
1269
1313
  previous = false;
@@ -1570,10 +1614,20 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1570
1614
  return this.orientation === "HORIZONTAL" ? this.orthogonalSize : this.size;
1571
1615
  }
1572
1616
  get minimumSize() {
1573
- return this.children.length === 0 ? 0 : Math.max(...this.children.map((c, index) => this.splitview.isViewVisible(index) ? c.minimumOrthogonalSize : 0));
1617
+ if (this._cachedMinimumSize === void 0) {
1618
+ let value = 0;
1619
+ for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.max(value, this.children[index].minimumOrthogonalSize);
1620
+ this._cachedMinimumSize = value;
1621
+ }
1622
+ return this._cachedMinimumSize;
1574
1623
  }
1575
1624
  get maximumSize() {
1576
- return Math.min(...this.children.map((c, index) => this.splitview.isViewVisible(index) ? c.maximumOrthogonalSize : Number.POSITIVE_INFINITY));
1625
+ if (this._cachedMaximumSize === void 0) {
1626
+ let value = Number.POSITIVE_INFINITY;
1627
+ for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.min(value, this.children[index].maximumOrthogonalSize);
1628
+ this._cachedMaximumSize = value;
1629
+ }
1630
+ return this._cachedMaximumSize;
1577
1631
  }
1578
1632
  get minimumOrthogonalSize() {
1579
1633
  return this.splitview.minimumSize;
@@ -1600,15 +1654,29 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1600
1654
  return this.orientation === "HORIZONTAL" ? this.maximumSize : this.maximumOrthogonalSize;
1601
1655
  }
1602
1656
  get priority() {
1657
+ var _this$_cachedPriority;
1658
+ (_this$_cachedPriority = this._cachedPriority) !== null && _this$_cachedPriority !== void 0 || (this._cachedPriority = this.computePriority());
1659
+ return this._cachedPriority;
1660
+ }
1661
+ computePriority() {
1603
1662
  if (this.children.length === 0) return "normal";
1604
- const priorities = new Set(this.children.map((c) => {
1605
- var _c$priority;
1606
- return (_c$priority = c.priority) !== null && _c$priority !== void 0 ? _c$priority : "normal";
1607
- }));
1608
- if (priorities.has("high")) return "high";
1609
- else if (priorities.has("low")) return "low";
1663
+ let hasHigh = false;
1664
+ let hasLow = false;
1665
+ for (const child of this.children) {
1666
+ var _child$priority;
1667
+ const priority = (_child$priority = child.priority) !== null && _child$priority !== void 0 ? _child$priority : "normal";
1668
+ if (priority === "high") hasHigh = true;
1669
+ else if (priority === "low") hasLow = true;
1670
+ }
1671
+ if (hasHigh) return "high";
1672
+ else if (hasLow) return "low";
1610
1673
  return "normal";
1611
1674
  }
1675
+ invalidateCachedSizes() {
1676
+ this._cachedMinimumSize = void 0;
1677
+ this._cachedMaximumSize = void 0;
1678
+ this._cachedPriority = void 0;
1679
+ }
1612
1680
  get disabled() {
1613
1681
  return this.splitview.disabled;
1614
1682
  }
@@ -1684,6 +1752,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1684
1752
  if (this.splitview.isViewVisible(index) === visible) return;
1685
1753
  const wereAllChildrenHidden = this.splitview.contentSize === 0;
1686
1754
  this.splitview.setViewVisible(index, visible);
1755
+ this.invalidateCachedSizes();
1687
1756
  const areAllChildrenHidden = this.splitview.contentSize === 0;
1688
1757
  if (visible && wereAllChildrenHidden || !visible && areAllChildrenHidden) this._onDidVisibilityChange.fire({ visible });
1689
1758
  }
@@ -1732,12 +1801,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1732
1801
  return child;
1733
1802
  }
1734
1803
  setupChildrenEvents() {
1804
+ this.invalidateCachedSizes();
1735
1805
  this._childrenDisposable.dispose();
1736
1806
  this._childrenDisposable = new CompositeDisposable(Event.any(...this.children.map((c) => c.onDidChange))((e) => {
1737
1807
  /**
1738
1808
  * indicate a change has occured to allows any re-rendering but don't bubble
1739
1809
  * event because that was specific to this branch
1740
1810
  */
1811
+ this.invalidateCachedSizes();
1741
1812
  this._onDidChange.fire({ size: e.orthogonalSize });
1742
1813
  }), ...this.children.map((c, i) => {
1743
1814
  if (c instanceof BranchNode) return c.onDidVisibilityChange(({ visible }) => {
@@ -3414,7 +3485,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3414
3485
  * Add a group and return the created object.
3415
3486
  */
3416
3487
  addGroup(options) {
3417
- return this.component.addGroup(options);
3488
+ return this.component.withOrigin("api", () => this.component.addGroup(options));
3418
3489
  }
3419
3490
  /**
3420
3491
  * Close all groups and panels.
@@ -3552,13 +3623,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3552
3623
  this.activatePrevious(options);
3553
3624
  }
3554
3625
  maximizeGroup(panel) {
3555
- this.component.maximizeGroup(panel.group);
3626
+ this.component.withOrigin("api", () => this.component.maximizeGroup(panel.group));
3556
3627
  }
3557
3628
  hasMaximizedGroup() {
3558
3629
  return this.component.hasMaximizedGroup();
3559
3630
  }
3560
3631
  exitMaximizedGroup() {
3561
- this.component.exitMaximizedGroup();
3632
+ this.component.withOrigin("api", () => this.component.exitMaximizedGroup());
3562
3633
  }
3563
3634
  get onDidMaximizedGroupChange() {
3564
3635
  return this.component.onDidMaximizedGroupChange;
@@ -5513,9 +5584,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
5513
5584
  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);
5514
5585
  if (((_this$panel = this.panel) === null || _this$panel === void 0 ? void 0 : _this$panel.view.content.element.parentElement) === this._element) {
5515
5586
  var _this$panel$view$cont, _this$panel$view$cont2;
5516
- /**
5517
- * If the currently attached panel is mounted directly to the content then remove it
5518
- */
5519
5587
  this.panel.view.content.element.remove();
5520
5588
  (_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);
5521
5589
  }
@@ -6256,7 +6324,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
6256
6324
  this.element.appendChild(this._scrollbar);
6257
6325
  this.addDisposables(addDisposableListener(this.element, "wheel", (event) => {
6258
6326
  this._scrollOffset += event.deltaY * Scrollbar.MouseWheelSpeed;
6259
- this.calculateScrollbarStyles();
6327
+ this.scheduleStyleUpdate();
6260
6328
  }), addDisposableListener(this._scrollbar, "pointerdown", (event) => {
6261
6329
  var _this$_scrollbar$owne;
6262
6330
  event.preventDefault();
@@ -6268,7 +6336,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
6268
6336
  const delta = this._orientation === "horizontal" ? event.clientX - originalClient : event.clientY - originalClient;
6269
6337
  const p = (this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight) / (this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight);
6270
6338
  this._scrollOffset = originalScrollOffset + delta / p;
6271
- this.calculateScrollbarStyles();
6339
+ this.scheduleStyleUpdate();
6272
6340
  };
6273
6341
  const onEnd = () => {
6274
6342
  toggleClass(this.element, "dv-scrollable-scrolling", false);
@@ -6280,10 +6348,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
6280
6348
  doc.addEventListener("pointerup", onEnd);
6281
6349
  doc.addEventListener("pointercancel", onEnd);
6282
6350
  }), addDisposableListener(this.element, "scroll", () => {
6283
- this.calculateScrollbarStyles();
6351
+ this.scheduleStyleUpdate();
6284
6352
  }), addDisposableListener(this.scrollableElement, "scroll", () => {
6285
6353
  this._scrollOffset = this._orientation === "horizontal" ? this.scrollableElement.scrollLeft : this.scrollableElement.scrollTop;
6286
- this.calculateScrollbarStyles();
6354
+ this.scheduleStyleUpdate();
6287
6355
  }), watchElementResize(this.element, () => {
6288
6356
  toggleClass(this.element, "dv-scrollable-resizing", true);
6289
6357
  if (this._animationTimer) clearTimeout(this._animationTimer);
@@ -6291,9 +6359,29 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
6291
6359
  clearTimeout(this._animationTimer);
6292
6360
  toggleClass(this.element, "dv-scrollable-resizing", false);
6293
6361
  }, 500);
6294
- this.calculateScrollbarStyles();
6362
+ this.scheduleStyleUpdate();
6363
+ }), Disposable.from(() => {
6364
+ if (this._pendingStyleFrame !== void 0) {
6365
+ cancelAnimationFrame(this._pendingStyleFrame);
6366
+ this._pendingStyleFrame = void 0;
6367
+ }
6295
6368
  }));
6296
6369
  }
6370
+ /**
6371
+ * Coalesce the scrollbar restyle to one pass per animation frame. The
6372
+ * wheel / scroll / pointermove handlers can each fire many times per frame,
6373
+ * and `calculateScrollbarStyles` both reads layout (`clientWidth`/
6374
+ * `scrollWidth`) and writes styles + `scrollLeft`/`scrollTop`; running it
6375
+ * synchronously per event caused repeated read→write→read reflow. Batching
6376
+ * to a frame keeps a burst of events to a single measure+write.
6377
+ */
6378
+ scheduleStyleUpdate() {
6379
+ if (this._pendingStyleFrame !== void 0) return;
6380
+ this._pendingStyleFrame = requestAnimationFrame(() => {
6381
+ this._pendingStyleFrame = void 0;
6382
+ this.calculateScrollbarStyles();
6383
+ });
6384
+ }
6297
6385
  calculateScrollbarStyles() {
6298
6386
  const clientSize = this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight;
6299
6387
  const scrollSize = this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight;
@@ -8754,8 +8842,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
8754
8842
  }, true), addDisposableListener(this._tabsList, "dragend", () => {
8755
8843
  this._reorder.resetDragAnimation();
8756
8844
  }), addDisposableListener(this._tabsList, "drop", (event) => {
8757
- var _this$accessor$option, _this$group$model$dro;
8758
- if (!this._animState || this._animState.currentInsertionIndex === null) return;
8845
+ var _this$_animState3, _this$accessor$option, _this$group$model$dro;
8846
+ if (((_this$_animState3 = this._animState) === null || _this$_animState3 === void 0 ? void 0 : _this$_animState3.currentInsertionIndex) == null) return;
8759
8847
  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;
8760
8848
  event.stopPropagation();
8761
8849
  event.preventDefault();
@@ -8960,7 +9048,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
8960
9048
  };
8961
9049
  this._pendingCollapse = true;
8962
9050
  requestAnimationFrame(() => {
8963
- var _this$_animState3, _this$_animState3$cur;
9051
+ var _this$_animState4, _this$_animState4$cur;
8964
9052
  this._pendingCollapse = false;
8965
9053
  if (!this._animState) return;
8966
9054
  if (!this._tabsList.classList.contains("dv-tabs-container--wrap")) {
@@ -8968,7 +9056,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
8968
9056
  toggleClass(tab.element, "dv-tab--dragging", true);
8969
9057
  tab.element.offsetHeight;
8970
9058
  }
8971
- (_this$_animState3$cur = (_this$_animState3 = this._animState).currentInsertionIndex) !== null && _this$_animState3$cur !== void 0 || (_this$_animState3.currentInsertionIndex = sourceIndex);
9059
+ (_this$_animState4$cur = (_this$_animState4 = this._animState).currentInsertionIndex) !== null && _this$_animState4$cur !== void 0 || (_this$_animState4.currentInsertionIndex = sourceIndex);
8972
9060
  this.applyDragOverTransforms(true);
8973
9061
  tab.element.style.removeProperty("transition");
8974
9062
  });
@@ -9057,8 +9145,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
9057
9145
  }
9058
9146
  }
9059
9147
  delete(id) {
9060
- var _this$_animState4;
9061
- if (((_this$_animState4 = this._animState) === null || _this$_animState4 === void 0 ? void 0 : _this$_animState4.sourceTabId) === id) {
9148
+ var _this$_animState5;
9149
+ if (((_this$_animState5 = this._animState) === null || _this$_animState5 === void 0 ? void 0 : _this$_animState5.sourceTabId) === id) {
9062
9150
  this.resetTabTransforms();
9063
9151
  this._animState = null;
9064
9152
  }
@@ -9175,7 +9263,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
9175
9263
  const groupPanelIds = new Set(tabGroup.panelIds);
9176
9264
  this._pendingCollapse = true;
9177
9265
  requestAnimationFrame(() => {
9178
- var _this$_animState5, _this$_animState5$cur;
9266
+ var _this$_animState6, _this$_animState6$cur;
9179
9267
  this._pendingCollapse = false;
9180
9268
  if (!this._animState) return;
9181
9269
  for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) {
@@ -9190,7 +9278,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
9190
9278
  this._tabsList.offsetHeight;
9191
9279
  const underline = this._tabGroupManager.groupUnderlines.get(tabGroup.id);
9192
9280
  if (underline) underline.style.display = "none";
9193
- (_this$_animState5$cur = (_this$_animState5 = this._animState).currentInsertionIndex) !== null && _this$_animState5$cur !== void 0 || (_this$_animState5.currentInsertionIndex = firstIdx);
9281
+ (_this$_animState6$cur = (_this$_animState6 = this._animState).currentInsertionIndex) !== null && _this$_animState6$cur !== void 0 || (_this$_animState6.currentInsertionIndex = firstIdx);
9194
9282
  this.applyDragOverTransforms(true);
9195
9283
  for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) t.value.element.style.removeProperty("transition");
9196
9284
  if (chipEntry) chipEntry.chip.element.style.removeProperty("transition");
@@ -9925,6 +10013,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
9925
10013
  set headerPosition(value) {
9926
10014
  var _this$_activePanel;
9927
10015
  this._headerPosition = value;
10016
+ this.invalidateHeaderSize();
9928
10017
  removeClasses(this.container, "dv-groupview-header-top", "dv-groupview-header-bottom", "dv-groupview-header-left", "dv-groupview-header-right");
9929
10018
  addClasses(this.container, `dv-groupview-header-${value}`);
9930
10019
  const direction = value === "top" || value === "bottom" ? "horizontal" : "vertical";
@@ -10066,7 +10155,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
10066
10155
  this.header.hidden = !!options.hideHeader;
10067
10156
  this.locked = (_options$locked = options.locked) !== null && _options$locked !== void 0 ? _options$locked : false;
10068
10157
  this.headerPosition = (_options$headerPositi = options.headerPosition) !== null && _options$headerPositi !== void 0 ? _options$headerPositi : accessor.defaultHeaderPosition;
10069
- this.addDisposables(this._onDidPanelTitleChange.event(() => this.updateAccessibleLabel()), this._onTabDragStart, this._onGroupDragStart, this._onWillShowOverlay, this.tabsContainer.onTabDragStart((event) => {
10158
+ this.addDisposables(watchElementResize(this.tabsContainer.element, () => {
10159
+ if (this.isDisposed) return;
10160
+ const size = this.measureHeaderSize();
10161
+ if (size !== this._cachedHeaderSize) {
10162
+ this._cachedHeaderSize = size;
10163
+ this.layout(this._width, this._height);
10164
+ }
10165
+ }), this._onDidPanelTitleChange.event(() => this.updateAccessibleLabel()), this._onTabDragStart, this._onGroupDragStart, this._onWillShowOverlay, this.tabsContainer.onTabDragStart((event) => {
10070
10166
  this._onTabDragStart.fire(event);
10071
10167
  }), this.tabsContainer.onGroupDragStart((event) => {
10072
10168
  this._onGroupDragStart.fire(event);
@@ -10523,16 +10619,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
10523
10619
  (_this$_activePanel3 = this._activePanel) === null || _this$_activePanel3 === void 0 || _this$_activePanel3.focus();
10524
10620
  }
10525
10621
  openPanel(panel, options = {}) {
10526
- /**
10527
- * set the panel group
10528
- * add the panel
10529
- * check if group active
10530
- * check if panel active
10531
- */
10532
10622
  if (typeof options.index !== "number" || options.index > this.panels.length) options.index = this.panels.length;
10533
10623
  const skipSetActive = !!options.skipSetActive;
10534
10624
  panel.updateParentGroup(this.groupPanel, { skipSetActive: options.skipSetActive });
10535
10625
  this.doAddPanel(panel, options.index, { skipSetActive });
10626
+ this.invalidateHeaderSize();
10536
10627
  if (this._activePanel === panel) {
10537
10628
  this.contentContainer.renderPanel(panel, { asActive: true });
10538
10629
  return;
@@ -10595,6 +10686,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
10595
10686
  * changing) down to the content + active panel.
10596
10687
  */
10597
10688
  relayout() {
10689
+ this.invalidateHeaderSize();
10598
10690
  this.layout(this._width, this._height);
10599
10691
  }
10600
10692
  /**
@@ -10604,17 +10696,32 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
10604
10696
  * width); a hidden header has `display:none` so its `offset*` is 0 and
10605
10697
  * nothing is subtracted.
10606
10698
  */
10607
- contentDimensions() {
10699
+ /**
10700
+ * Measure the header's extent along its occupied axis. This is the single
10701
+ * forced-reflow read; it now runs only on a cache miss (first layout after
10702
+ * a header change) and inside the header's ResizeObserver — not on every
10703
+ * layout frame.
10704
+ */
10705
+ measureHeaderSize() {
10608
10706
  const headerEl = this.tabsContainer.element;
10707
+ return this.headerPosition === "top" || this.headerPosition === "bottom" ? headerEl.offsetHeight : headerEl.offsetWidth;
10708
+ }
10709
+ invalidateHeaderSize() {
10710
+ this._cachedHeaderSize = void 0;
10711
+ }
10712
+ contentDimensions() {
10713
+ var _this$_cachedHeaderSi;
10609
10714
  const horizontal = this.headerPosition === "top" || this.headerPosition === "bottom";
10715
+ const headerSize = (_this$_cachedHeaderSi = this._cachedHeaderSize) !== null && _this$_cachedHeaderSi !== void 0 ? _this$_cachedHeaderSi : this._cachedHeaderSize = this.measureHeaderSize();
10610
10716
  return {
10611
- width: horizontal ? this._width : Math.max(0, this._width - headerEl.offsetWidth),
10612
- height: horizontal ? Math.max(0, this._height - headerEl.offsetHeight) : this._height
10717
+ width: horizontal ? this._width : Math.max(0, this._width - headerSize),
10718
+ height: horizontal ? Math.max(0, this._height - headerSize) : this._height
10613
10719
  };
10614
10720
  }
10615
10721
  _removePanel(panel, options) {
10616
10722
  const isActivePanel = this._activePanel === panel;
10617
10723
  this.doRemovePanel(panel);
10724
+ this.invalidateHeaderSize();
10618
10725
  if (isActivePanel && this.panels.length > 0) {
10619
10726
  const nextPanel = this.mostRecentlyUsed[0];
10620
10727
  this.openPanel(nextPanel, {
@@ -10940,6 +11047,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
10940
11047
  if (typeof event.minimumHeight === "number" || typeof event.minimumHeight === "function") this._minimumHeight = event.minimumHeight;
10941
11048
  if (typeof event.maximumWidth === "number" || typeof event.maximumWidth === "function") this._maximumWidth = event.maximumWidth;
10942
11049
  if (typeof event.maximumHeight === "number" || typeof event.maximumHeight === "function") this._maximumHeight = event.maximumHeight;
11050
+ this._onDidChange.fire(void 0);
10943
11051
  }), this.api.onDidSizeChange((event) => {
10944
11052
  this._onDidChange.fire({
10945
11053
  height: event.height,
@@ -11059,20 +11167,22 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
11059
11167
  return this._group.model.headerPosition;
11060
11168
  }
11061
11169
  moveTo(options) {
11062
- var _options$group, _options$position, _options$skipSetActiv, _options$position2;
11063
11170
  if (!this._group) throw new Error(NOT_INITIALIZED_MESSAGE);
11064
- const group = (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this.accessor.addGroup({
11065
- direction: positionToDirection((_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "right"),
11066
- skipSetActive: (_options$skipSetActiv = options.skipSetActive) !== null && _options$skipSetActiv !== void 0 ? _options$skipSetActiv : false
11067
- });
11068
- this.accessor.moveGroupOrPanel({
11069
- from: { groupId: this._group.id },
11070
- to: {
11071
- group,
11072
- position: options.group ? (_options$position2 = options.position) !== null && _options$position2 !== void 0 ? _options$position2 : "center" : "center",
11073
- index: options.index
11074
- },
11075
- skipSetActive: options.skipSetActive
11171
+ this.accessor.withOrigin("api", () => {
11172
+ var _options$group, _options$position, _options$skipSetActiv, _options$position2;
11173
+ const group = (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this.accessor.addGroup({
11174
+ direction: positionToDirection((_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "right"),
11175
+ skipSetActive: (_options$skipSetActiv = options.skipSetActive) !== null && _options$skipSetActiv !== void 0 ? _options$skipSetActiv : false
11176
+ });
11177
+ this.accessor.moveGroupOrPanel({
11178
+ from: { groupId: this._group.id },
11179
+ to: {
11180
+ group,
11181
+ position: options.group ? (_options$position2 = options.position) !== null && _options$position2 !== void 0 ? _options$position2 : "center" : "center",
11182
+ index: options.index
11183
+ },
11184
+ skipSetActive: options.skipSetActive
11185
+ });
11076
11186
  });
11077
11187
  }
11078
11188
  maximize() {
@@ -11421,18 +11531,20 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
11421
11531
  this.accessor.withOrigin("api", () => super.setActive());
11422
11532
  }
11423
11533
  moveTo(options) {
11424
- var _options$group, _options$position;
11425
- this.accessor.moveGroupOrPanel({
11426
- from: {
11427
- groupId: this._group.id,
11428
- panelId: this.panel.id
11429
- },
11430
- to: {
11431
- group: (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this._group,
11432
- position: options.group ? (_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "center" : "center",
11433
- index: options.index
11434
- },
11435
- skipSetActive: options.skipSetActive
11534
+ this.accessor.withOrigin("api", () => {
11535
+ var _options$group, _options$position;
11536
+ return this.accessor.moveGroupOrPanel({
11537
+ from: {
11538
+ groupId: this._group.id,
11539
+ panelId: this.panel.id
11540
+ },
11541
+ to: {
11542
+ group: (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this._group,
11543
+ position: options.group ? (_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "center" : "center",
11544
+ index: options.index
11545
+ },
11546
+ skipSetActive: options.skipSetActive
11547
+ });
11436
11548
  });
11437
11549
  }
11438
11550
  setTitle(title) {
@@ -12542,12 +12654,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
12542
12654
  moduleName: "ContextMenu",
12543
12655
  when: (o) => o.getTabGroupChipContextMenuItems != null
12544
12656
  },
12545
- {
12546
- optionKey: "createContextMenuItemComponent",
12547
- reason: "createContextMenuItemComponent",
12548
- moduleName: "ContextMenu",
12549
- when: (o) => o.createContextMenuItemComponent != null
12550
- },
12551
12657
  {
12552
12658
  optionKey: "dndCompass",
12553
12659
  reason: "dndCompass",
@@ -13276,7 +13382,18 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
13276
13382
  prev = next;
13277
13383
  const panel = group.activePanel;
13278
13384
  if (!panel) return;
13279
- const kind = next === "floating" ? "float" : next === "popout" ? "popout" : "dock";
13385
+ let kind;
13386
+ switch (next) {
13387
+ case "floating":
13388
+ kind = "float";
13389
+ break;
13390
+ case "popout":
13391
+ kind = "popout";
13392
+ break;
13393
+ default:
13394
+ kind = "dock";
13395
+ break;
13396
+ }
13280
13397
  this._announce(panel, kind);
13281
13398
  });
13282
13399
  this._locationSubs.set(group.id, sub);
@@ -13328,29 +13445,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
13328
13445
 
13329
13446
  //#endregion
13330
13447
  //#region src/dockview/advancedDnDService.ts
13331
- /** Cursor offset of the group drag ghost, matched to the long-shipped default. */
13448
+ /** Cursor offset of the group drag ghost. */
13332
13449
  const GROUP_DRAG_GHOST_OFFSET_X = 30;
13333
13450
  const GROUP_DRAG_GHOST_OFFSET_Y = -10;
13334
13451
  /**
13335
- * The narrow surface the {@link AdvancedDnDService} needs from the host
13336
- * (the `DockviewComponent`).
13337
- *
13338
- * The `onWill*` emitters stay on the component so the public event shape is
13339
- * unchanged whether or not this module is registered; the service is only the
13340
- * dispatch point those fires are routed through. Engine policy (e.g. the
13341
- * `disableDnd` guard) stays on the component, ahead of the dispatch.
13342
- */
13343
- /**
13344
13452
  * Owns the dispatch of the advanced drag-and-drop hooks: `onWillDragPanel`,
13345
- * `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay`.
13346
- *
13347
- * At this stage the service is a thin dispatcher that forwards to the host's
13348
- * emitters; the customisation surface it gates (custom drop overlays, custom
13349
- * group drag ghosts, hook veto/transform behaviour) is currently inlined in
13350
- * core and is extracted into this service in later phases. Routing the
13351
- * dispatch through a module slot is what lets that customisation layer move
13352
- * into a separately-distributed package in a future major version without
13353
- * changing the public event surface.
13453
+ * `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay`, forwarding each to
13454
+ * the host's emitters so the public event shape is unchanged whether or not
13455
+ * this module is registered.
13354
13456
  *
13355
13457
  * The service holds no drag state of its own. The gesture is driven by the
13356
13458
  * DnD backends, and the per-group subscriptions live on the component's group
@@ -13476,7 +13578,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
13476
13578
  //#region src/overlay/overlayRenderContainer.ts
13477
13579
  var PositionCache = class {
13478
13580
  constructor() {
13479
- this.cache = /* @__PURE__ */ new Map();
13581
+ this.cache = /* @__PURE__ */ new WeakMap();
13480
13582
  this.currentFrameId = 0;
13481
13583
  this.rafId = null;
13482
13584
  }
@@ -15145,7 +15247,22 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
15145
15247
  const rect = candidate.element.getBoundingClientRect();
15146
15248
  const dx = rect.left + rect.width / 2 - fromX;
15147
15249
  const dy = rect.top + rect.height / 2 - fromY;
15148
- 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;
15250
+ let inDirection;
15251
+ switch (direction) {
15252
+ case "left":
15253
+ inDirection = dx < 0 && Math.abs(dx) >= Math.abs(dy);
15254
+ break;
15255
+ case "right":
15256
+ inDirection = dx > 0 && Math.abs(dx) >= Math.abs(dy);
15257
+ break;
15258
+ case "up":
15259
+ inDirection = dy < 0 && Math.abs(dy) >= Math.abs(dx);
15260
+ break;
15261
+ default:
15262
+ inDirection = dy > 0 && Math.abs(dy) >= Math.abs(dx);
15263
+ break;
15264
+ }
15265
+ if (!inDirection) continue;
15149
15266
  const distance = dx * dx + dy * dy;
15150
15267
  if (distance < bestDistance) {
15151
15268
  bestDistance = distance;
@@ -15993,11 +16110,15 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
15993
16110
  /**
15994
16111
  * Reveal (create-or-fill) the edge group at `position` and move the dragged
15995
16112
  * item described by `data` into it. A newly created edge group is created
15996
- * collapsed and flagged `autoReveal` so it tears down to zero footprint when
15997
- * later emptied. If an edge group already exists there it is reused: the
15998
- * panel is added to its tabs and its collapsed/toggled state is left as-is
15999
- * (never re-created; `addEdgeGroup` throws on a duplicate position). No-op if
16000
- * the EdgeGroup module is absent.
16113
+ * collapsed, flagged `autoReveal` so it tears down to zero footprint when
16114
+ * later emptied, and takes its auto-hide state from `options.autoHide`. If an
16115
+ * edge group already exists there it is reused: the panel is added to its
16116
+ * tabs and its collapsed/toggled *and auto-hide* state are left as-is (never
16117
+ * re-created; `addEdgeGroup` throws on a duplicate position). This keeps a
16118
+ * drag-reveal from silently converting a static edge group into an
16119
+ * auto-hiding one; to change an existing group's auto-hide, call
16120
+ * `api.getEdgeGroup(position)?.setAutoHide(...)` directly. No-op if the
16121
+ * EdgeGroup module is absent.
16001
16122
  *
16002
16123
  * This is the primitive behind the dock-to-edge groups: the two-band
16003
16124
  * drag-reveal affordance routes its outer-band drops here.
@@ -16016,7 +16137,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
16016
16137
  collapsed: true
16017
16138
  });
16018
16139
  group = service.get(position);
16019
- } else if ((options === null || options === void 0 ? void 0 : options.autoHide) !== void 0) this.setEdgeGroupAutoHide(group, options.autoHide);
16140
+ }
16020
16141
  if (!group) return;
16021
16142
  this.moveGroupOrPanel({
16022
16143
  from: {
@@ -16547,6 +16668,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
16547
16668
  height: options.initialHeight
16548
16669
  };
16549
16670
  let index;
16671
+ const shouldSkipSetActive = (group) => !!options.inactive && group.model.size > 0;
16550
16672
  if (options.position) if (isPanelOptionsWithPanel(options.position)) {
16551
16673
  const referencePanel = typeof options.position.referencePanel === "string" ? this.getGroupPanel(options.position.referencePanel) : options.position.referencePanel;
16552
16674
  index = options.position.index;
@@ -16569,7 +16691,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
16569
16691
  const group = this.orthogonalize(directionToPosition(options.position.direction));
16570
16692
  const panel = this.createPanel(options, group);
16571
16693
  group.model.openPanel(panel, {
16572
- skipSetActive: options.inactive,
16694
+ skipSetActive: shouldSkipSetActive(group),
16573
16695
  skipSetGroupActive: options.inactive,
16574
16696
  index
16575
16697
  });
@@ -16596,14 +16718,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
16596
16718
  }));
16597
16719
  panel = this.createPanel(options, group);
16598
16720
  group.model.openPanel(panel, {
16599
- skipSetActive: options.inactive,
16721
+ skipSetActive: shouldSkipSetActive(group),
16600
16722
  skipSetGroupActive: options.inactive,
16601
16723
  index
16602
16724
  });
16603
16725
  } else if (referenceGroup.api.location.type === "floating" || referenceGroup.api.location.type === "edge" || target === "center") {
16604
16726
  panel = this.createPanel(options, referenceGroup);
16605
16727
  referenceGroup.model.openPanel(panel, {
16606
- skipSetActive: options.inactive,
16728
+ skipSetActive: shouldSkipSetActive(referenceGroup),
16607
16729
  skipSetGroupActive: options.inactive,
16608
16730
  index
16609
16731
  });
@@ -16618,7 +16740,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
16618
16740
  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);
16619
16741
  panel = this.createPanel(options, group);
16620
16742
  group.model.openPanel(panel, {
16621
- skipSetActive: options.inactive,
16743
+ skipSetActive: shouldSkipSetActive(group),
16622
16744
  skipSetGroupActive: options.inactive,
16623
16745
  index
16624
16746
  });
@@ -16635,7 +16757,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
16635
16757
  }));
16636
16758
  panel = this.createPanel(options, group);
16637
16759
  group.model.openPanel(panel, {
16638
- skipSetActive: options.inactive,
16760
+ skipSetActive: shouldSkipSetActive(group),
16639
16761
  skipSetGroupActive: options.inactive,
16640
16762
  index
16641
16763
  });
@@ -16643,7 +16765,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
16643
16765
  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);
16644
16766
  panel = this.createPanel(options, group);
16645
16767
  group.model.openPanel(panel, {
16646
- skipSetActive: options.inactive,
16768
+ skipSetActive: shouldSkipSetActive(group),
16647
16769
  skipSetGroupActive: options.inactive,
16648
16770
  index
16649
16771
  });