dockview-core 7.0.2 → 7.0.3

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.
Files changed (98) hide show
  1. package/dist/cjs/api/dockviewGroupPanelApi.js +1 -1
  2. package/dist/cjs/dnd/dropTargetAnchorContainer.js +1 -2
  3. package/dist/cjs/dnd/pointer/longPress.js +1 -1
  4. package/dist/cjs/dnd/pointer/pointerDragController.js +9 -7
  5. package/dist/cjs/dnd/pointer/pointerDragSource.js +4 -2
  6. package/dist/cjs/dockview/components/panel/content.js +6 -6
  7. package/dist/cjs/dockview/components/popupService.js +1 -1
  8. package/dist/cjs/dockview/components/tab/tab.js +2 -2
  9. package/dist/cjs/dockview/components/titlebar/floatingTitleBar.d.ts +1 -2
  10. package/dist/cjs/dockview/components/titlebar/groupDragSource.d.ts +1 -2
  11. package/dist/cjs/dockview/components/titlebar/groupDragSource.js +1 -1
  12. package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.js +5 -6
  13. package/dist/cjs/dockview/components/titlebar/tabGroups.d.ts +27 -5
  14. package/dist/cjs/dockview/components/titlebar/tabGroups.js +104 -54
  15. package/dist/cjs/dockview/components/titlebar/tabs.js +16 -23
  16. package/dist/cjs/dockview/components/titlebar/voidContainer.js +1 -1
  17. package/dist/cjs/dockview/dndCapabilities.js +3 -3
  18. package/dist/cjs/dockview/dockviewComponent.d.ts +5 -5
  19. package/dist/cjs/dockview/dockviewComponent.js +140 -122
  20. package/dist/cjs/dockview/dockviewGroupPanel.d.ts +1 -1
  21. package/dist/cjs/dockview/dockviewGroupPanelModel.js +19 -25
  22. package/dist/cjs/dockview/dockviewPanel.js +4 -5
  23. package/dist/cjs/dockview/dockviewShell.d.ts +29 -7
  24. package/dist/cjs/dockview/dockviewShell.js +94 -36
  25. package/dist/cjs/dockview/strictEventsSequencing.js +6 -6
  26. package/dist/cjs/dockview/tabGroup.js +3 -3
  27. package/dist/cjs/dockview/tabGroupAccent.js +1 -3
  28. package/dist/cjs/dom.js +1 -1
  29. package/dist/cjs/events.js +1 -1
  30. package/dist/cjs/gridview/baseComponentGridview.js +3 -8
  31. package/dist/cjs/gridview/branchNode.js +13 -17
  32. package/dist/cjs/gridview/gridview.js +8 -8
  33. package/dist/cjs/gridview/gridviewComponent.js +1 -6
  34. package/dist/cjs/overlay/overlay.js +25 -28
  35. package/dist/cjs/overlay/overlayRenderContainer.js +3 -4
  36. package/dist/cjs/paneview/draggablePaneviewPanel.js +1 -1
  37. package/dist/cjs/paneview/paneviewComponent.js +2 -6
  38. package/dist/cjs/popoutWindow.js +4 -4
  39. package/dist/cjs/scrollbar.d.ts +1 -1
  40. package/dist/cjs/scrollbar.js +7 -6
  41. package/dist/cjs/splitview/splitview.d.ts +1 -1
  42. package/dist/cjs/splitview/splitview.js +21 -20
  43. package/dist/cjs/splitview/viewItem.js +1 -1
  44. package/dist/dockview-core.js +413 -330
  45. package/dist/dockview-core.min.js +2 -2
  46. package/dist/dockview-core.min.js.map +1 -1
  47. package/dist/dockview-core.min.noStyle.js +2 -2
  48. package/dist/dockview-core.min.noStyle.js.map +1 -1
  49. package/dist/dockview-core.noStyle.js +412 -329
  50. package/dist/esm/api/dockviewGroupPanelApi.js +1 -1
  51. package/dist/esm/dnd/dropTargetAnchorContainer.js +1 -2
  52. package/dist/esm/dnd/pointer/longPress.js +1 -1
  53. package/dist/esm/dnd/pointer/pointerDragController.js +9 -7
  54. package/dist/esm/dnd/pointer/pointerDragSource.js +4 -2
  55. package/dist/esm/dockview/components/panel/content.js +6 -6
  56. package/dist/esm/dockview/components/popupService.js +1 -1
  57. package/dist/esm/dockview/components/tab/tab.js +2 -2
  58. package/dist/esm/dockview/components/titlebar/floatingTitleBar.d.ts +1 -2
  59. package/dist/esm/dockview/components/titlebar/groupDragSource.d.ts +1 -2
  60. package/dist/esm/dockview/components/titlebar/groupDragSource.js +1 -1
  61. package/dist/esm/dockview/components/titlebar/tabGroupIndicator.js +5 -6
  62. package/dist/esm/dockview/components/titlebar/tabGroups.d.ts +27 -5
  63. package/dist/esm/dockview/components/titlebar/tabGroups.js +91 -42
  64. package/dist/esm/dockview/components/titlebar/tabs.js +17 -24
  65. package/dist/esm/dockview/components/titlebar/voidContainer.js +1 -1
  66. package/dist/esm/dockview/dndCapabilities.js +3 -3
  67. package/dist/esm/dockview/dockviewComponent.d.ts +5 -5
  68. package/dist/esm/dockview/dockviewComponent.js +61 -51
  69. package/dist/esm/dockview/dockviewGroupPanel.d.ts +1 -1
  70. package/dist/esm/dockview/dockviewGroupPanelModel.js +19 -25
  71. package/dist/esm/dockview/dockviewPanel.js +1 -2
  72. package/dist/esm/dockview/dockviewShell.d.ts +29 -7
  73. package/dist/esm/dockview/dockviewShell.js +89 -37
  74. package/dist/esm/dockview/strictEventsSequencing.js +6 -6
  75. package/dist/esm/dockview/tabGroup.js +3 -3
  76. package/dist/esm/dockview/tabGroupAccent.js +1 -3
  77. package/dist/esm/dom.js +1 -1
  78. package/dist/esm/events.js +1 -1
  79. package/dist/esm/gridview/baseComponentGridview.js +3 -8
  80. package/dist/esm/gridview/branchNode.js +13 -15
  81. package/dist/esm/gridview/gridview.js +8 -8
  82. package/dist/esm/gridview/gridviewComponent.js +1 -6
  83. package/dist/esm/overlay/overlay.js +25 -28
  84. package/dist/esm/overlay/overlayRenderContainer.js +3 -4
  85. package/dist/esm/paneview/draggablePaneviewPanel.js +1 -1
  86. package/dist/esm/paneview/paneviewComponent.js +2 -6
  87. package/dist/esm/popoutWindow.js +4 -4
  88. package/dist/esm/scrollbar.d.ts +1 -1
  89. package/dist/esm/scrollbar.js +7 -6
  90. package/dist/esm/splitview/splitview.d.ts +1 -1
  91. package/dist/esm/splitview/splitview.js +21 -20
  92. package/dist/esm/splitview/viewItem.js +1 -1
  93. package/dist/package/main.cjs.js +412 -329
  94. package/dist/package/main.cjs.min.js +2 -2
  95. package/dist/package/main.esm.min.mjs +2 -2
  96. package/dist/package/main.esm.mjs +412 -329
  97. package/dist/styles/dockview.css +8 -8
  98. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 7.0.2
3
+ * @version 7.0.3
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -186,7 +186,7 @@ class LeakageMonitor {
186
186
  class Stacktrace {
187
187
  static create() {
188
188
  var _a;
189
- return new Stacktrace((_a = new Error().stack) !== null && _a !== void 0 ? _a : '');
189
+ return new Stacktrace((_a = new Error('listener stacktrace').stack) !== null && _a !== void 0 ? _a : '');
190
190
  }
191
191
  constructor(value) {
192
192
  this.value = value;
@@ -435,7 +435,7 @@ class FocusTracker extends CompositeDisposable {
435
435
  const onBlur = () => {
436
436
  if (hasFocus) {
437
437
  loosingFocus = true;
438
- window.setTimeout(() => {
438
+ globalThis.setTimeout(() => {
439
439
  if (loosingFocus) {
440
440
  loosingFocus = false;
441
441
  hasFocus = false;
@@ -813,7 +813,7 @@ class ViewItem {
813
813
  return this._cachedVisibleSize;
814
814
  }
815
815
  get visible() {
816
- return typeof this._cachedVisibleSize === 'undefined';
816
+ return this._cachedVisibleSize === undefined;
817
817
  }
818
818
  get minimumSize() {
819
819
  return this.visible ? this.view.minimumSize : 0;
@@ -1215,7 +1215,7 @@ class Splitview {
1215
1215
  const viewItem = new ViewItem(container, view, viewSize, {
1216
1216
  dispose: () => {
1217
1217
  disposable.dispose();
1218
- this.viewContainer.removeChild(container);
1218
+ container.remove();
1219
1219
  },
1220
1220
  });
1221
1221
  if (index === this.viewItems.length) {
@@ -1291,29 +1291,30 @@ class Splitview {
1291
1291
  this.distributeEmptySpace();
1292
1292
  this.layoutViews();
1293
1293
  };
1294
+ const doc = sash.ownerDocument;
1294
1295
  const end = () => {
1295
1296
  for (const item of this.viewItems) {
1296
1297
  item.enabled = true;
1297
1298
  }
1298
1299
  iframes.release();
1299
1300
  this.saveProportions();
1300
- document.removeEventListener('pointermove', onPointerMove);
1301
- document.removeEventListener('pointerup', end);
1302
- document.removeEventListener('pointercancel', end);
1303
- document.removeEventListener('contextmenu', end);
1301
+ doc.removeEventListener('pointermove', onPointerMove);
1302
+ doc.removeEventListener('pointerup', end);
1303
+ doc.removeEventListener('pointercancel', end);
1304
+ doc.removeEventListener('contextmenu', end);
1304
1305
  this._onDidSashEnd.fire(undefined);
1305
1306
  };
1306
- document.addEventListener('pointermove', onPointerMove);
1307
- document.addEventListener('pointerup', end);
1308
- document.addEventListener('pointercancel', end);
1309
- document.addEventListener('contextmenu', end);
1307
+ doc.addEventListener('pointermove', onPointerMove);
1308
+ doc.addEventListener('pointerup', end);
1309
+ doc.addEventListener('pointercancel', end);
1310
+ doc.addEventListener('contextmenu', end);
1310
1311
  };
1311
1312
  sash.addEventListener('pointerdown', onPointerStart);
1312
1313
  const sashItem = {
1313
1314
  container: sash,
1314
1315
  disposable: () => {
1315
1316
  sash.removeEventListener('pointerdown', onPointerStart);
1316
- this.sashContainer.removeChild(sash);
1317
+ sash.remove();
1317
1318
  },
1318
1319
  };
1319
1320
  this.sashContainer.appendChild(sash);
@@ -1360,7 +1361,7 @@ class Splitview {
1360
1361
  if (!skipLayout) {
1361
1362
  this.relayout();
1362
1363
  }
1363
- if (sizing && sizing.type === 'distribute') {
1364
+ if ((sizing === null || sizing === void 0 ? void 0 : sizing.type) === 'distribute') {
1364
1365
  this.distributeViewSizes();
1365
1366
  }
1366
1367
  this._onDidRemoveView.fire(viewItem.view);
@@ -1375,7 +1376,7 @@ class Splitview {
1375
1376
  }
1376
1377
  moveView(from, to) {
1377
1378
  const cachedVisibleSize = this.getViewCachedVisibleSize(from);
1378
- const sizing = typeof cachedVisibleSize === 'undefined'
1379
+ const sizing = cachedVisibleSize === undefined
1379
1380
  ? this.getViewSize(from)
1380
1381
  : Sizing.Invisible(cachedVisibleSize);
1381
1382
  const view = this.removeView(from, undefined, true);
@@ -1385,13 +1386,7 @@ class Splitview {
1385
1386
  const previousSize = Math.max(this.size, this._contentSize);
1386
1387
  this.size = size;
1387
1388
  this.orthogonalSize = orthogonalSize;
1388
- if (!this.proportions) {
1389
- const indexes = range(this.viewItems.length);
1390
- const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.Low);
1391
- const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.High);
1392
- this.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);
1393
- }
1394
- else {
1389
+ if (this.proportions) {
1395
1390
  let total = 0;
1396
1391
  for (let i = 0; i < this.viewItems.length; i++) {
1397
1392
  const item = this.viewItems[i];
@@ -1411,6 +1406,12 @@ class Splitview {
1411
1406
  }
1412
1407
  }
1413
1408
  }
1409
+ else {
1410
+ const indexes = range(this.viewItems.length);
1411
+ const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.Low);
1412
+ const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.High);
1413
+ this.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);
1414
+ }
1414
1415
  this.distributeEmptySpace();
1415
1416
  this.layoutViews();
1416
1417
  }
@@ -1630,7 +1631,7 @@ class Splitview {
1630
1631
  this._onDidRemoveView.dispose();
1631
1632
  for (let i = 0; i < this.element.children.length; i++) {
1632
1633
  if (this.element.children.item(i) === this.element) {
1633
- this.element.removeChild(this.element);
1634
+ this.element.remove();
1634
1635
  break;
1635
1636
  }
1636
1637
  }
@@ -1967,13 +1968,11 @@ class BranchNode extends CompositeDisposable {
1967
1968
  if (this.children.length === 0) {
1968
1969
  return LayoutPriority.Normal;
1969
1970
  }
1970
- const priorities = this.children.map((c) => typeof c.priority === 'undefined'
1971
- ? LayoutPriority.Normal
1972
- : c.priority);
1973
- if (priorities.some((p) => p === LayoutPriority.High)) {
1971
+ const priorities = new Set(this.children.map((c) => { var _a; return (_a = c.priority) !== null && _a !== void 0 ? _a : LayoutPriority.Normal; }));
1972
+ if (priorities.has(LayoutPriority.High)) {
1974
1973
  return LayoutPriority.High;
1975
1974
  }
1976
- else if (priorities.some((p) => p === LayoutPriority.Low)) {
1975
+ else if (priorities.has(LayoutPriority.Low)) {
1977
1976
  return LayoutPriority.Low;
1978
1977
  }
1979
1978
  return LayoutPriority.Normal;
@@ -2010,16 +2009,7 @@ class BranchNode extends CompositeDisposable {
2010
2009
  this._size = size;
2011
2010
  this.element = document.createElement('div');
2012
2011
  this.element.className = 'dv-branch-node';
2013
- if (!childDescriptors) {
2014
- this.splitview = new Splitview(this.element, {
2015
- orientation: this.orientation,
2016
- proportionalLayout,
2017
- styles,
2018
- margin,
2019
- });
2020
- this.splitview.layout(this.size, this.orthogonalSize);
2021
- }
2022
- else {
2012
+ if (childDescriptors) {
2023
2013
  const descriptor = {
2024
2014
  views: childDescriptors.map((childDescriptor) => {
2025
2015
  return {
@@ -2042,6 +2032,15 @@ class BranchNode extends CompositeDisposable {
2042
2032
  margin,
2043
2033
  });
2044
2034
  }
2035
+ else {
2036
+ this.splitview = new Splitview(this.element, {
2037
+ orientation: this.orientation,
2038
+ proportionalLayout,
2039
+ styles,
2040
+ margin,
2041
+ });
2042
+ this.splitview.layout(this.size, this.orthogonalSize);
2043
+ }
2045
2044
  this.disabled = disabled;
2046
2045
  this.addDisposables(this._onDidChange, this._onDidVisibilityChange, this.splitview.onDidSashEnd(() => {
2047
2046
  this._onDidChange.fire({});
@@ -2539,7 +2538,7 @@ class Gridview {
2539
2538
  if (oldRoot) {
2540
2539
  oldRoot.dispose();
2541
2540
  this._maximizedNode = undefined;
2542
- this.element.removeChild(oldRoot.element);
2541
+ oldRoot.element.remove();
2543
2542
  }
2544
2543
  this._root = root;
2545
2544
  this.element.appendChild(this._root.element);
@@ -2631,7 +2630,7 @@ class Gridview {
2631
2630
  progmaticSelect(location, reverse = false) {
2632
2631
  const [path, node] = this.getNode(location);
2633
2632
  if (!(node instanceof LeafNode)) {
2634
- throw new Error('invalid location');
2633
+ throw new TypeError('invalid location');
2635
2634
  }
2636
2635
  for (let i = path.length - 1; i > -1; i--) {
2637
2636
  const n = path[i];
@@ -2668,7 +2667,7 @@ class Gridview {
2668
2667
  const [rest, index] = tail(location);
2669
2668
  const [, parent] = this.getNode(rest);
2670
2669
  if (!(parent instanceof BranchNode)) {
2671
- throw new Error('Invalid from location');
2670
+ throw new TypeError('Invalid from location');
2672
2671
  }
2673
2672
  return parent.isChildVisible(index);
2674
2673
  }
@@ -2679,7 +2678,7 @@ class Gridview {
2679
2678
  const [rest, index] = tail(location);
2680
2679
  const [, parent] = this.getNode(rest);
2681
2680
  if (!(parent instanceof BranchNode)) {
2682
- throw new Error('Invalid from location');
2681
+ throw new TypeError('Invalid from location');
2683
2682
  }
2684
2683
  this._onDidViewVisibilityChange.fire();
2685
2684
  parent.setChildVisible(index, visible);
@@ -2690,7 +2689,7 @@ class Gridview {
2690
2689
  }
2691
2690
  const [, parent] = this.getNode(parentLocation);
2692
2691
  if (!(parent instanceof BranchNode)) {
2693
- throw new Error('Invalid location');
2692
+ throw new TypeError('Invalid location');
2694
2693
  }
2695
2694
  parent.moveChild(from, to);
2696
2695
  }
@@ -2736,11 +2735,11 @@ class Gridview {
2736
2735
  const [rest, index] = tail(location);
2737
2736
  const [pathToParent, parent] = this.getNode(rest);
2738
2737
  if (!(parent instanceof BranchNode)) {
2739
- throw new Error('Invalid location');
2738
+ throw new TypeError('Invalid location');
2740
2739
  }
2741
2740
  const nodeToRemove = parent.children[index];
2742
2741
  if (!(nodeToRemove instanceof LeafNode)) {
2743
- throw new Error('Invalid location');
2742
+ throw new TypeError('Invalid location');
2744
2743
  }
2745
2744
  parent.removeChild(index, sizing);
2746
2745
  nodeToRemove.dispose();
@@ -2822,7 +2821,7 @@ class Gridview {
2822
2821
  return [path, node];
2823
2822
  }
2824
2823
  if (!(node instanceof BranchNode)) {
2825
- throw new Error('Invalid location');
2824
+ throw new TypeError('Invalid location');
2826
2825
  }
2827
2826
  const [index, ...rest] = location;
2828
2827
  if (index < 0 || index >= node.children.length) {
@@ -3002,8 +3001,7 @@ class BaseGrid extends Resizable {
3002
3001
  }), this.gridview.onDidViewVisibilityChange(() => this._onDidViewVisibilityChangeMicroTaskQueue.fire()), this.onDidViewVisibilityChangeMicroTaskQueue(() => {
3003
3002
  this.forceRelayout();
3004
3003
  }), Disposable.from(() => {
3005
- var _a;
3006
- (_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.element);
3004
+ this.element.remove();
3007
3005
  }), this.gridview.onDidChange(() => {
3008
3006
  this._bufferOnDidLayoutChange.fire();
3009
3007
  }), Event.any(this.onDidAdd, this.onDidRemove, this.onDidActiveChange)(() => {
@@ -3093,9 +3091,7 @@ class BaseGrid extends Resizable {
3093
3091
  }
3094
3092
  moveToNext(options) {
3095
3093
  var _a;
3096
- if (!options) {
3097
- options = {};
3098
- }
3094
+ options !== null && options !== void 0 ? options : (options = {});
3099
3095
  if (!options.group) {
3100
3096
  if (!this.activeGroup) {
3101
3097
  return;
@@ -3108,9 +3104,7 @@ class BaseGrid extends Resizable {
3108
3104
  }
3109
3105
  moveToPrevious(options) {
3110
3106
  var _a;
3111
- if (!options) {
3112
- options = {};
3113
- }
3107
+ options !== null && options !== void 0 ? options : (options = {});
3114
3108
  if (!options.group) {
3115
3109
  if (!this.activeGroup) {
3116
3110
  return;
@@ -4612,9 +4606,8 @@ function addGhostImage(dataTransfer, ghostElement, options) {
4612
4606
  */
4613
4607
  class PointerDragController extends CompositeDisposable {
4614
4608
  static getInstance() {
4615
- if (!PointerDragController._instance) {
4616
- PointerDragController._instance = new PointerDragController();
4617
- }
4609
+ var _a;
4610
+ (_a = PointerDragController._instance) !== null && _a !== void 0 ? _a : (PointerDragController._instance = new PointerDragController());
4618
4611
  return PointerDragController._instance;
4619
4612
  }
4620
4613
  constructor() {
@@ -4679,21 +4672,24 @@ class PointerDragController extends CompositeDisposable {
4679
4672
  this._onDragStart.fire(startEvent);
4680
4673
  // Source's owning window — popout drags fire on their own window,
4681
4674
  // not the main one.
4682
- const targetWindow = (_c = (_b = source.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) !== null && _c !== void 0 ? _c : window;
4675
+ const targetWindow = (_c = (_b = source.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) !== null && _c !== void 0 ? _c : globalThis.window;
4683
4676
  this._moveListener = addDisposableListener(targetWindow, 'pointermove', (e) => {
4684
- if (!this._active || e.pointerId !== this._active.pointerId) {
4677
+ var _a;
4678
+ if (e.pointerId !== ((_a = this._active) === null || _a === void 0 ? void 0 : _a.pointerId)) {
4685
4679
  return;
4686
4680
  }
4687
4681
  this._handleMove(e);
4688
4682
  });
4689
4683
  this._upListener = addDisposableListener(targetWindow, 'pointerup', (e) => {
4690
- if (!this._active || e.pointerId !== this._active.pointerId) {
4684
+ var _a;
4685
+ if (e.pointerId !== ((_a = this._active) === null || _a === void 0 ? void 0 : _a.pointerId)) {
4691
4686
  return;
4692
4687
  }
4693
4688
  this._handleEnd(e, true);
4694
4689
  });
4695
4690
  this._cancelListener = addDisposableListener(targetWindow, 'pointercancel', (e) => {
4696
- if (!this._active || e.pointerId !== this._active.pointerId) {
4691
+ var _a;
4692
+ if (e.pointerId !== ((_a = this._active) === null || _a === void 0 ? void 0 : _a.pointerId)) {
4697
4693
  return;
4698
4694
  }
4699
4695
  this._handleEnd(e, false);
@@ -5033,7 +5029,9 @@ class PointerDragSource extends CompositeDisposable {
5033
5029
  ? initiationDelayOpt()
5034
5030
  : initiationDelayOpt)) !== null && _a !== void 0 ? _a : DEFAULT_TOUCH_INITIATION_DELAY;
5035
5031
  this._armed = !isTouch || initiationDelay <= 0;
5036
- if (isTouch && initiationDelay > 0 && isFinite(initiationDelay)) {
5032
+ if (isTouch &&
5033
+ initiationDelay > 0 &&
5034
+ Number.isFinite(initiationDelay)) {
5037
5035
  this._armTimer = setTimeout(() => {
5038
5036
  this._armTimer = undefined;
5039
5037
  this._armed = true;
@@ -5045,7 +5043,7 @@ class PointerDragSource extends CompositeDisposable {
5045
5043
  ? pressToleranceOpt()
5046
5044
  : pressToleranceOpt)) !== null && _c !== void 0 ? _c : DEFAULT_PRESS_TOLERANCE;
5047
5045
  // Source's owning window — popout drags fire on their own window.
5048
- const targetWindow = (_e = (_d = this.element.ownerDocument) === null || _d === void 0 ? void 0 : _d.defaultView) !== null && _e !== void 0 ? _e : window;
5046
+ const targetWindow = (_e = (_d = this.element.ownerDocument) === null || _d === void 0 ? void 0 : _d.defaultView) !== null && _e !== void 0 ? _e : globalThis.window;
5049
5047
  this._pendingMoveListener = addDisposableListener(targetWindow, 'pointermove', (moveEvent) => {
5050
5048
  if (moveEvent.pointerId !== this._pendingPointerId) {
5051
5049
  return;
@@ -5808,7 +5806,7 @@ class DraggablePaneviewPanel extends PaneviewPanel {
5808
5806
  }
5809
5807
  onDrop(event) {
5810
5808
  const data = getPaneData();
5811
- if (!data || data.viewId !== this.accessor.id) {
5809
+ if ((data === null || data === void 0 ? void 0 : data.viewId) !== this.accessor.id) {
5812
5810
  // if there is no local drag event for this panel
5813
5811
  // or if the drag event was creating by another Paneview instance
5814
5812
  this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, api: new PaneviewApi(this.accessor), getData: getPaneData }));
@@ -5881,7 +5879,7 @@ class ContentContainer extends CompositeDisposable {
5881
5879
  this.group.location.type !== 'floating') {
5882
5880
  return false;
5883
5881
  }
5884
- if (data && data.viewId === this.accessor.id) {
5882
+ if ((data === null || data === void 0 ? void 0 : data.viewId) === this.accessor.id) {
5885
5883
  return true;
5886
5884
  }
5887
5885
  return this.group.canDisplayOverlay(event, position, 'content');
@@ -5948,7 +5946,7 @@ class ContentContainer extends CompositeDisposable {
5948
5946
  /**
5949
5947
  * If the currently attached panel is mounted directly to the content then remove it
5950
5948
  */
5951
- this._element.removeChild(this.panel.view.content.element);
5949
+ this.panel.view.content.element.remove();
5952
5950
  (_b = (_a = this.panel.view.content).onHide) === null || _b === void 0 ? void 0 : _b.call(_a);
5953
5951
  }
5954
5952
  this.panel = panel;
@@ -5966,7 +5964,7 @@ class ContentContainer extends CompositeDisposable {
5966
5964
  break;
5967
5965
  case 'always':
5968
5966
  if (panel.view.content.element.parentElement === this._element) {
5969
- this._element.removeChild(panel.view.content.element);
5967
+ panel.view.content.element.remove();
5970
5968
  }
5971
5969
  container = this.group.renderContainer.attach({
5972
5970
  panel,
@@ -5994,11 +5992,11 @@ class ContentContainer extends CompositeDisposable {
5994
5992
  // noop
5995
5993
  }
5996
5994
  closePanel() {
5997
- var _a, _b, _c;
5995
+ var _a, _b;
5998
5996
  if (this.panel) {
5999
5997
  if (this.panel.api.renderer === 'onlyWhenVisible') {
6000
- (_a = this.panel.view.content.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.panel.view.content.element);
6001
- (_c = (_b = this.panel.view.content).onHide) === null || _c === void 0 ? void 0 : _c.call(_b);
5998
+ this.panel.view.content.element.remove();
5999
+ (_b = (_a = this.panel.view.content).onHide) === null || _b === void 0 ? void 0 : _b.call(_a);
6002
6000
  }
6003
6001
  }
6004
6002
  this.panel = undefined;
@@ -6052,7 +6050,7 @@ class LongPressDetector extends CompositeDisposable {
6052
6050
  const delay = (_b = this.options.delay) !== null && _b !== void 0 ? _b : DEFAULT_DELAY;
6053
6051
  const tolerance = (_c = this.options.tolerance) !== null && _c !== void 0 ? _c : DEFAULT_TOLERANCE;
6054
6052
  // Source's owning window — popout drags fire on their own window.
6055
- const targetWindow = (_e = (_d = this.element.ownerDocument) === null || _d === void 0 ? void 0 : _d.defaultView) !== null && _e !== void 0 ? _e : window;
6053
+ const targetWindow = (_e = (_d = this.element.ownerDocument) === null || _d === void 0 ? void 0 : _d.defaultView) !== null && _e !== void 0 ? _e : globalThis.window;
6056
6054
  this._timer = setTimeout(() => {
6057
6055
  this._timer = undefined;
6058
6056
  this._cancelPending();
@@ -6171,14 +6169,14 @@ function resolveDndCapabilities(options) {
6171
6169
  }
6172
6170
  }
6173
6171
  function isCoarsePrimaryInput$1() {
6174
- if (typeof window === 'undefined' || !window.matchMedia) {
6172
+ if (globalThis.window === undefined || !globalThis.matchMedia) {
6175
6173
  return false;
6176
6174
  }
6177
6175
  // Coarse pointer without any fine pointer = phone-class device. A laptop
6178
6176
  // touchscreen reports both, and we want HTML5 to remain available there
6179
6177
  // because a real mouse is also plugged in.
6180
- const coarse = window.matchMedia('(pointer: coarse)').matches;
6181
- const fine = window.matchMedia('(pointer: fine)').matches;
6178
+ const coarse = globalThis.matchMedia('(pointer: coarse)').matches;
6179
+ const fine = globalThis.matchMedia('(pointer: fine)').matches;
6182
6180
  return coarse && !fine;
6183
6181
  }
6184
6182
 
@@ -6232,7 +6230,7 @@ class Tab extends CompositeDisposable {
6232
6230
  return false;
6233
6231
  }
6234
6232
  const data = getPanelData();
6235
- if (data && this.accessor.id === data.viewId) {
6233
+ if (this.accessor.id === (data === null || data === void 0 ? void 0 : data.viewId)) {
6236
6234
  // Smooth-reorder takes over the in-flight visual when active,
6237
6235
  // so individual tab overlays are suppressed for internal drags.
6238
6236
  if (((_a = this.accessor.options.theme) === null || _a === void 0 ? void 0 : _a.tabAnimation) === 'smooth') {
@@ -6333,7 +6331,7 @@ class Tab extends CompositeDisposable {
6333
6331
  }
6334
6332
  setContent(part) {
6335
6333
  if (this.content) {
6336
- this._element.removeChild(this.content.element);
6334
+ this.content.element.remove();
6337
6335
  }
6338
6336
  this.content = part;
6339
6337
  this._element.appendChild(this.content.element);
@@ -6491,7 +6489,7 @@ class GroupDragSource extends CompositeDisposable {
6491
6489
  this.addDisposables(this._onDragStart);
6492
6490
  const buildMultiPanelsGhost = () => {
6493
6491
  const ghostEl = document.createElement('div');
6494
- const style = window.getComputedStyle(this._element);
6492
+ const style = globalThis.getComputedStyle(this._element);
6495
6493
  const bgColor = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-background-color');
6496
6494
  const color = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-color');
6497
6495
  ghostEl.style.backgroundColor = bgColor;
@@ -6673,7 +6671,7 @@ class VoidContainer extends CompositeDisposable {
6673
6671
  return false;
6674
6672
  }
6675
6673
  const data = getPanelData();
6676
- if (data && this.accessor.id === data.viewId) {
6674
+ if (this.accessor.id === (data === null || data === void 0 ? void 0 : data.viewId)) {
6677
6675
  return true;
6678
6676
  }
6679
6677
  return group.model.canDisplayOverlay(event, position, 'header_space');
@@ -6768,15 +6766,16 @@ class Scrollbar extends CompositeDisposable {
6768
6766
  this._scrollOffset = originalScrollOffset + delta / p;
6769
6767
  this.calculateScrollbarStyles();
6770
6768
  };
6769
+ const doc = this.element.ownerDocument;
6771
6770
  const onEnd = () => {
6772
6771
  toggleClass(this.element, 'dv-scrollable-scrolling', false);
6773
- document.removeEventListener('pointermove', onPointerMove);
6774
- document.removeEventListener('pointerup', onEnd);
6775
- document.removeEventListener('pointercancel', onEnd);
6772
+ doc.removeEventListener('pointermove', onPointerMove);
6773
+ doc.removeEventListener('pointerup', onEnd);
6774
+ doc.removeEventListener('pointercancel', onEnd);
6776
6775
  };
6777
- document.addEventListener('pointermove', onPointerMove);
6778
- document.addEventListener('pointerup', onEnd);
6779
- document.addEventListener('pointercancel', onEnd);
6776
+ doc.addEventListener('pointermove', onPointerMove);
6777
+ doc.addEventListener('pointerup', onEnd);
6778
+ doc.addEventListener('pointercancel', onEnd);
6780
6779
  }), addDisposableListener(this.element, 'scroll', () => {
6781
6780
  this.calculateScrollbarStyles();
6782
6781
  }), addDisposableListener(this.scrollableElement, 'scroll', () => {
@@ -6936,9 +6935,7 @@ let _fallbackPalette;
6936
6935
  * palette through.
6937
6936
  */
6938
6937
  function getFallbackPalette() {
6939
- if (!_fallbackPalette) {
6940
- _fallbackPalette = new TabGroupColorPalette(DEFAULT_TAB_GROUP_COLORS, true);
6941
- }
6938
+ _fallbackPalette !== null && _fallbackPalette !== void 0 ? _fallbackPalette : (_fallbackPalette = new TabGroupColorPalette(DEFAULT_TAB_GROUP_COLORS, true));
6942
6939
  return _fallbackPalette;
6943
6940
  }
6944
6941
  /**
@@ -7180,8 +7177,7 @@ class BaseTabGroupIndicator {
7180
7177
  const isAnimating = tg.collapsed ||
7181
7178
  tg.panelIds.some((pid) => {
7182
7179
  const te = tabMap.get(pid);
7183
- return (te &&
7184
- te.value.element.classList.contains('dv-tab--group-expanding'));
7180
+ return te === null || te === void 0 ? void 0 : te.value.element.classList.contains('dv-tab--group-expanding');
7185
7181
  });
7186
7182
  if (isAnimating && chipEl) {
7187
7183
  const chipRect = chipEl.getBoundingClientRect();
@@ -7278,7 +7274,10 @@ class WrapTabGroupIndicator extends BaseTabGroupIndicator {
7278
7274
  // Ensure SVG + path child exists (created once, reused)
7279
7275
  let svg = underline.firstElementChild;
7280
7276
  let path;
7281
- if (!svg || svg.tagName !== 'svg') {
7277
+ if ((svg === null || svg === void 0 ? void 0 : svg.tagName) === 'svg') {
7278
+ path = svg.firstElementChild;
7279
+ }
7280
+ else {
7282
7281
  underline.replaceChildren();
7283
7282
  svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
7284
7283
  svg.style.display = 'block';
@@ -7287,9 +7286,6 @@ class WrapTabGroupIndicator extends BaseTabGroupIndicator {
7287
7286
  svg.appendChild(path);
7288
7287
  underline.appendChild(svg);
7289
7288
  }
7290
- else {
7291
- path = svg.firstElementChild;
7292
- }
7293
7289
  path.setAttribute('stroke', color);
7294
7290
  path.setAttribute('stroke-width', String(t));
7295
7291
  if (!activeTabEntry) {
@@ -7426,6 +7422,7 @@ class TabGroupManager {
7426
7422
  * in the parent group model. Call after any tab group mutation.
7427
7423
  */
7428
7424
  update() {
7425
+ var _a;
7429
7426
  const model = this._ctx.group.model;
7430
7427
  const tabGroups = model.getTabGroups();
7431
7428
  // Track which group IDs are still active
@@ -7440,6 +7437,7 @@ class TabGroupManager {
7440
7437
  if (!activeGroupIds.has(groupId)) {
7441
7438
  entry.chip.element.remove();
7442
7439
  entry.chip.dispose();
7440
+ (_a = entry.dragSourcesDisposable) === null || _a === void 0 ? void 0 : _a.dispose();
7443
7441
  entry.disposable.dispose();
7444
7442
  this._chipRenderers.delete(groupId);
7445
7443
  }
@@ -7568,12 +7566,13 @@ class TabGroupManager {
7568
7566
  this._pendingTransitionCleanups.delete(panelId);
7569
7567
  }
7570
7568
  updateDragAndDropState() {
7569
+ var _a, _b, _c;
7571
7570
  const caps = resolveDndCapabilities(this._ctx.accessor.options);
7572
7571
  for (const entry of this._chipRenderers.values()) {
7573
7572
  entry.chip.element.draggable = caps.html5;
7574
- entry.html5DragSource.setDisabled(!caps.html5);
7575
- entry.pointerDragSource.setDisabled(!caps.pointer);
7576
- entry.pointerDragSource.setTouchOnly(!caps.pointerHandlesMouse);
7573
+ (_a = entry.html5DragSource) === null || _a === void 0 ? void 0 : _a.setDisabled(!caps.html5);
7574
+ (_b = entry.pointerDragSource) === null || _b === void 0 ? void 0 : _b.setDisabled(!caps.pointer);
7575
+ (_c = entry.pointerDragSource) === null || _c === void 0 ? void 0 : _c.setTouchOnly(!caps.pointerHandlesMouse);
7577
7576
  }
7578
7577
  }
7579
7578
  /**
@@ -7582,19 +7581,28 @@ class TabGroupManager {
7582
7581
  * iframe shield are released BEFORE the cross-group move detaches
7583
7582
  * the chip (chip dispose is scheduled on a microtask via
7584
7583
  * `_scheduleTabGroupUpdate`, which is too late for callers that read
7585
- * `getPanelData()` synchronously after the move). Idempotent — the
7586
- * subsequent `update()` will also dispose the sources.
7584
+ * `getPanelData()` synchronously after the move).
7585
+ *
7586
+ * A cross-group move dissolves the source chip entirely, but a
7587
+ * within-group reorder keeps the same chip element — so the sources are
7588
+ * cleared to `undefined` here and the subsequent `update()` re-arms them
7589
+ * via `_ensureChipForGroup`. Without that re-arm the chip would fire a
7590
+ * native `dragstart` (the element keeps `draggable=true`) but never set
7591
+ * a transfer payload, leaving the group permanently undraggable after
7592
+ * its first move. (#1410)
7587
7593
  */
7588
7594
  disposeChipDrag(tabGroupId) {
7589
- var _a, _b;
7595
+ var _a;
7590
7596
  const entry = this._chipRenderers.get(tabGroupId);
7591
7597
  if (!entry) {
7592
7598
  return;
7593
7599
  }
7594
7600
  // Optional-chained because tests may inject minimal entries
7595
7601
  // that skip the manager's normal `_ensureChipForGroup` flow.
7596
- (_a = entry.html5DragSource) === null || _a === void 0 ? void 0 : _a.dispose();
7597
- (_b = entry.pointerDragSource) === null || _b === void 0 ? void 0 : _b.dispose();
7602
+ (_a = entry.dragSourcesDisposable) === null || _a === void 0 ? void 0 : _a.dispose();
7603
+ entry.html5DragSource = undefined;
7604
+ entry.pointerDragSource = undefined;
7605
+ entry.dragSourcesDisposable = undefined;
7598
7606
  }
7599
7607
  /** Cloned chip rect used as the pointer follow-finger ghost. */
7600
7608
  _buildChipGhostElement(chipEl) {
@@ -7607,7 +7615,7 @@ class TabGroupManager {
7607
7615
  return clone;
7608
7616
  }
7609
7617
  disposeAll() {
7610
- var _a;
7618
+ var _a, _b;
7611
7619
  (_a = this._indicator) === null || _a === void 0 ? void 0 : _a.dispose();
7612
7620
  this._indicator = null;
7613
7621
  for (const [, cleanup] of this._pendingTransitionCleanups) {
@@ -7617,12 +7625,13 @@ class TabGroupManager {
7617
7625
  for (const [, entry] of this._chipRenderers) {
7618
7626
  entry.chip.element.remove();
7619
7627
  entry.chip.dispose();
7628
+ (_b = entry.dragSourcesDisposable) === null || _b === void 0 ? void 0 : _b.dispose();
7620
7629
  entry.disposable.dispose();
7621
7630
  }
7622
7631
  this._chipRenderers.clear();
7623
7632
  }
7624
7633
  _ensureIndicator() {
7625
- var _a, _b;
7634
+ var _a, _b, _c;
7626
7635
  const mode = (_b = (_a = this._ctx.accessor.options.theme) === null || _a === void 0 ? void 0 : _a.tabGroupIndicator) !== null && _b !== void 0 ? _b : 'wrap';
7627
7636
  const Ctor = mode === 'none' ? NoneTabGroupIndicator : WrapTabGroupIndicator;
7628
7637
  // Re-create if the indicator type changed (e.g. theme switch)
@@ -7630,28 +7639,24 @@ class TabGroupManager {
7630
7639
  this._indicator.dispose();
7631
7640
  this._indicator = null;
7632
7641
  }
7633
- if (!this._indicator) {
7634
- this._indicator = new Ctor({
7635
- tabsList: this._ctx.tabsList,
7636
- getTabGroups: () => this._ctx.group.model.getTabGroups(),
7637
- getActivePanelId: () => { var _a; return (_a = this._ctx.group.activePanel) === null || _a === void 0 ? void 0 : _a.id; },
7638
- getTabMap: () => this._ctx.getTabMap(),
7639
- getChipElement: (id) => { var _a; return (_a = this._chipRenderers.get(id)) === null || _a === void 0 ? void 0 : _a.chip.element; },
7640
- getDirection: () => this._ctx.getDirection(),
7641
- getHeaderPosition: () => this._ctx.group.model.headerPosition,
7642
- getColorPalette: () => this._ctx.accessor.tabGroupColorPalette,
7643
- });
7644
- }
7642
+ (_c = this._indicator) !== null && _c !== void 0 ? _c : (this._indicator = new Ctor({
7643
+ tabsList: this._ctx.tabsList,
7644
+ getTabGroups: () => this._ctx.group.model.getTabGroups(),
7645
+ getActivePanelId: () => { var _a; return (_a = this._ctx.group.activePanel) === null || _a === void 0 ? void 0 : _a.id; },
7646
+ getTabMap: () => this._ctx.getTabMap(),
7647
+ getChipElement: (id) => { var _a; return (_a = this._chipRenderers.get(id)) === null || _a === void 0 ? void 0 : _a.chip.element; },
7648
+ getDirection: () => this._ctx.getDirection(),
7649
+ getHeaderPosition: () => this._ctx.group.model.headerPosition,
7650
+ getColorPalette: () => this._ctx.accessor.tabGroupColorPalette,
7651
+ }));
7645
7652
  }
7646
- _ensureChipForGroup(tabGroup) {
7647
- if (this._chipRenderers.has(tabGroup.id)) {
7648
- return;
7649
- }
7650
- const createChip = this._ctx.accessor.options.createTabGroupChipComponent;
7651
- const chip = createChip
7652
- ? createChip(tabGroup)
7653
- : new TabGroupChip(this._ctx.accessor.tabGroupColorPalette);
7654
- chip.init({ tabGroup, api: this._ctx.accessor.api });
7653
+ /**
7654
+ * Create the HTML5 + pointer drag sources for a chip (and the direct
7655
+ * dragend listener that clears the transfer synchronously). Extracted so
7656
+ * both the initial chip build and the post-move re-arm in
7657
+ * `_ensureChipForGroup` share one wiring path. (#1410)
7658
+ */
7659
+ _createChipDragSources(chip, tabGroup) {
7655
7660
  const caps = resolveDndCapabilities(this._ctx.accessor.options);
7656
7661
  chip.element.draggable = caps.html5;
7657
7662
  const panelTransfer = LocalSelectionTransfer.getInstance();
@@ -7703,9 +7708,12 @@ class TabGroupManager {
7703
7708
  // the listener survives chip disposal in the detach-then-dragend
7704
7709
  // cross-group path; `once: true` auto-removes after the single
7705
7710
  // dragend that we care about. (#1254)
7706
- chip.element.addEventListener('dragend', () => {
7711
+ const onDragEndClear = () => {
7707
7712
  panelTransfer.clearData(PanelTransfer.prototype);
7708
- }, { once: true });
7713
+ };
7714
+ chip.element.addEventListener('dragend', onDragEndClear, {
7715
+ once: true,
7716
+ });
7709
7717
  const pointerDragSource = pointerBackend.createDragSource(chip.element, {
7710
7718
  getData,
7711
7719
  disabled: !caps.pointer,
@@ -7720,6 +7728,41 @@ class TabGroupManager {
7720
7728
  this._callbacks.onChipDragStart(tabGroup, chip, event);
7721
7729
  },
7722
7730
  });
7731
+ return {
7732
+ html5DragSource,
7733
+ pointerDragSource,
7734
+ disposable: {
7735
+ dispose: () => {
7736
+ html5DragSource.dispose();
7737
+ pointerDragSource.dispose();
7738
+ chip.element.removeEventListener('dragend', onDragEndClear);
7739
+ },
7740
+ },
7741
+ };
7742
+ }
7743
+ _ensureChipForGroup(tabGroup) {
7744
+ const existing = this._chipRenderers.get(tabGroup.id);
7745
+ if (existing) {
7746
+ // A committed group move tears down the chip's drag sources via
7747
+ // `disposeChipDrag`, but a within-group reorder keeps the same
7748
+ // chip element alive. Re-arm the sources so the group stays
7749
+ // draggable; without this the chip is stuck after its first
7750
+ // move — `dragstart` still fires (the element keeps
7751
+ // `draggable=true`) but no transfer payload is set. (#1410)
7752
+ if (!existing.html5DragSource) {
7753
+ const sources = this._createChipDragSources(existing.chip, tabGroup);
7754
+ existing.html5DragSource = sources.html5DragSource;
7755
+ existing.pointerDragSource = sources.pointerDragSource;
7756
+ existing.dragSourcesDisposable = sources.disposable;
7757
+ }
7758
+ return;
7759
+ }
7760
+ const createChip = this._ctx.accessor.options.createTabGroupChipComponent;
7761
+ const chip = createChip
7762
+ ? createChip(tabGroup)
7763
+ : new TabGroupChip(this._ctx.accessor.tabGroupColorPalette);
7764
+ chip.init({ tabGroup, api: this._ctx.accessor.api });
7765
+ const dragSources = this._createChipDragSources(chip, tabGroup);
7723
7766
  const disposables = [
7724
7767
  tabGroup.onDidChange(() => {
7725
7768
  var _a;
@@ -7733,17 +7776,19 @@ class TabGroupManager {
7733
7776
  tabGroup.onDidCollapseChange(() => {
7734
7777
  this._updateTabGroupClasses();
7735
7778
  }),
7736
- html5DragSource,
7737
- pointerDragSource,
7738
7779
  ];
7739
7780
  // Context menu: built-in TabGroupChip already aggregates right-click
7740
7781
  // + touch long-press into `onContextMenu`. Custom chip renderers
7741
7782
  // don't, so attach a long-press detector and contextmenu listener
7742
7783
  // directly on their element.
7743
7784
  const onContextMenu = (event) => {
7785
+ var _a, _b;
7744
7786
  // A long-press on a chip should preempt the in-flight pointer
7745
- // drag and open the menu instead.
7746
- pointerDragSource.cancelPending();
7787
+ // drag and open the menu instead. Resolve the source from the
7788
+ // entry so a post-move re-armed source is cancelled, not the
7789
+ // stale one captured at build time. (#1410)
7790
+ (_b = (_a = this._chipRenderers
7791
+ .get(tabGroup.id)) === null || _a === void 0 ? void 0 : _a.pointerDragSource) === null || _b === void 0 ? void 0 : _b.cancelPending();
7747
7792
  this._callbacks.onChipContextMenu(tabGroup, event);
7748
7793
  };
7749
7794
  if (chip instanceof TabGroupChip) {
@@ -7776,7 +7821,7 @@ class TabGroupManager {
7776
7821
  return false;
7777
7822
  }
7778
7823
  const data = getPanelData();
7779
- if (data && this._ctx.accessor.id === data.viewId) {
7824
+ if (this._ctx.accessor.id === (data === null || data === void 0 ? void 0 : data.viewId)) {
7780
7825
  if (((_a = this._ctx.accessor.options.theme) === null || _a === void 0 ? void 0 : _a.tabAnimation) ===
7781
7826
  'smooth') {
7782
7827
  return false;
@@ -7792,8 +7837,9 @@ class TabGroupManager {
7792
7837
  const disposable = new CompositeDisposable(...disposables);
7793
7838
  this._chipRenderers.set(tabGroup.id, {
7794
7839
  chip,
7795
- html5DragSource,
7796
- pointerDragSource,
7840
+ html5DragSource: dragSources.html5DragSource,
7841
+ pointerDragSource: dragSources.pointerDragSource,
7842
+ dragSourcesDisposable: dragSources.disposable,
7797
7843
  disposable,
7798
7844
  dropTarget,
7799
7845
  });
@@ -8397,12 +8443,10 @@ class Tabs extends CompositeDisposable {
8397
8443
  parentElement.scrollTop = running;
8398
8444
  }
8399
8445
  }
8400
- else {
8401
- if (running < parentElement.scrollLeft ||
8402
- running + element.clientWidth >
8403
- parentElement.scrollLeft + parentElement.clientWidth) {
8404
- parentElement.scrollLeft = running;
8405
- }
8446
+ else if (running < parentElement.scrollLeft ||
8447
+ running + element.clientWidth >
8448
+ parentElement.scrollLeft + parentElement.clientWidth) {
8449
+ parentElement.scrollLeft = running;
8406
8450
  }
8407
8451
  }
8408
8452
  running += isVertical
@@ -8514,15 +8558,13 @@ class Tabs extends CompositeDisposable {
8514
8558
  });
8515
8559
  return;
8516
8560
  }
8517
- switch (event.button) {
8518
- case 0:
8519
- if (this.group.api.location.type === 'edge') ;
8520
- else {
8521
- if (this.group.activePanel !== panel) {
8522
- this.group.model.openPanel(panel);
8523
- }
8524
- }
8525
- break;
8561
+ // Edge groups are skipped here: all their tab interaction
8562
+ // is handled by onTabClick to avoid race conditions with
8563
+ // active panel state.
8564
+ if (event.button === 0 &&
8565
+ this.group.api.location.type !== 'edge' &&
8566
+ this.group.activePanel !== panel) {
8567
+ this.group.model.openPanel(panel);
8526
8568
  }
8527
8569
  }), tab.onDrop((event) => {
8528
8570
  var _a, _b, _c, _d;
@@ -8545,12 +8587,12 @@ class Tabs extends CompositeDisposable {
8545
8587
  targetTabGroupId: animState.targetTabGroupId,
8546
8588
  });
8547
8589
  if (((_b = this.accessor.options.theme) === null || _b === void 0 ? void 0 : _b.tabAnimation) === 'smooth') {
8548
- this.runFlipAnimation(firstPositions, animState.sourceTabId, animState.sourceIndex === -1, animState.sourceIndex !== -1
8549
- ? {
8590
+ this.runFlipAnimation(firstPositions, animState.sourceTabId, animState.sourceIndex === -1, animState.sourceIndex === -1
8591
+ ? undefined
8592
+ : {
8550
8593
  from: Math.min(animState.sourceIndex, dropIndex),
8551
8594
  to: Math.max(animState.sourceIndex, dropIndex),
8552
- }
8553
- : undefined);
8595
+ });
8554
8596
  }
8555
8597
  }
8556
8598
  else {
@@ -8800,7 +8842,7 @@ class Tabs extends CompositeDisposable {
8800
8842
  return;
8801
8843
  }
8802
8844
  const data = getPanelData();
8803
- const sourceIndex = data && data.groupId === this.group.id && data.panelId
8845
+ const sourceIndex = (data === null || data === void 0 ? void 0 : data.groupId) === this.group.id && (data === null || data === void 0 ? void 0 : data.panelId)
8804
8846
  ? this._tabs.findIndex((x) => x.value.panel.id === data.panelId)
8805
8847
  : -1;
8806
8848
  const adjustedIndex = insertionIndex -
@@ -10158,9 +10200,9 @@ class TabGroup extends CompositeDisposable {
10158
10200
  if (this._panelIds.includes(panelId)) {
10159
10201
  return;
10160
10202
  }
10161
- const insertIndex = index !== undefined
10162
- ? Math.max(0, Math.min(index, this._panelIds.length))
10163
- : this._panelIds.length;
10203
+ const insertIndex = index === undefined
10204
+ ? this._panelIds.length
10205
+ : Math.max(0, Math.min(index, this._panelIds.length));
10164
10206
  this._panelIds.splice(insertIndex, 0, panelId);
10165
10207
  this._onDidPanelChange.fire({ panelId, type: 'add' });
10166
10208
  }
@@ -10608,7 +10650,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10608
10650
  }
10609
10651
  // Remove from any existing group first
10610
10652
  const existingGroup = this.getTabGroupForPanel(panelId);
10611
- if (existingGroup && existingGroup.id === tabGroupId) {
10653
+ if ((existingGroup === null || existingGroup === void 0 ? void 0 : existingGroup.id) === tabGroupId) {
10612
10654
  return; // already in this group — no mutation
10613
10655
  }
10614
10656
  this._bracketTabGroupMutation(() => {
@@ -10629,7 +10671,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10629
10671
  */
10630
10672
  movePanelWithinGroup(tabGroupId, panelId, newIndex) {
10631
10673
  const tabGroup = this._tabGroupMap.get(tabGroupId);
10632
- if (!tabGroup || !tabGroup.containsPanel(panelId)) {
10674
+ if (!(tabGroup === null || tabGroup === void 0 ? void 0 : tabGroup.containsPanel(panelId))) {
10633
10675
  return;
10634
10676
  }
10635
10677
  // Remove and re-add at new index within the group
@@ -10842,7 +10884,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10842
10884
  for (let i = activePanelIndex + 1; i < this._panels.length; i++) {
10843
10885
  const candidate = this._panels[i];
10844
10886
  const candidateGroup = this._findTabGroupForPanel(candidate.id);
10845
- if (!candidateGroup || !candidateGroup.collapsed) {
10887
+ if (!(candidateGroup === null || candidateGroup === void 0 ? void 0 : candidateGroup.collapsed)) {
10846
10888
  this.doSetActivePanel(candidate);
10847
10889
  this.updateContainer();
10848
10890
  return;
@@ -10851,7 +10893,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10851
10893
  for (let i = activePanelIndex - 1; i >= 0; i--) {
10852
10894
  const candidate = this._panels[i];
10853
10895
  const candidateGroup = this._findTabGroupForPanel(candidate.id);
10854
- if (!candidateGroup || !candidateGroup.collapsed) {
10896
+ if (!(candidateGroup === null || candidateGroup === void 0 ? void 0 : candidateGroup.collapsed)) {
10855
10897
  this.doSetActivePanel(candidate);
10856
10898
  this.updateContainer();
10857
10899
  return;
@@ -10881,9 +10923,9 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10881
10923
  restoreTabGroups(serializedGroups) {
10882
10924
  // Bump counter past any restored numeric suffixes to avoid ID collisions
10883
10925
  for (const data of serializedGroups) {
10884
- const match = data.id.match(/-(\d+)$/);
10926
+ const match = /-(\d+)$/.exec(data.id);
10885
10927
  if (match) {
10886
- const num = parseInt(match[1], 10) + 1;
10928
+ const num = Number.parseInt(match[1], 10) + 1;
10887
10929
  if (num > this._tabGroupIdCounter) {
10888
10930
  this._tabGroupIdCounter = num;
10889
10931
  }
@@ -11000,32 +11042,26 @@ class DockviewGroupPanelModel extends CompositeDisposable {
11000
11042
  return result;
11001
11043
  }
11002
11044
  moveToNext(options) {
11003
- if (!options) {
11004
- options = {};
11005
- }
11006
- if (!options.panel) {
11007
- options.panel = this.activePanel;
11008
- }
11045
+ var _a;
11046
+ options !== null && options !== void 0 ? options : (options = {});
11047
+ (_a = options.panel) !== null && _a !== void 0 ? _a : (options.panel = this.activePanel);
11009
11048
  const index = options.panel ? this.panels.indexOf(options.panel) : -1;
11010
11049
  let normalizedIndex;
11011
11050
  if (index < this.panels.length - 1) {
11012
11051
  normalizedIndex = index + 1;
11013
11052
  }
11014
- else if (!options.suppressRoll) {
11015
- normalizedIndex = 0;
11053
+ else if (options.suppressRoll) {
11054
+ return;
11016
11055
  }
11017
11056
  else {
11018
- return;
11057
+ normalizedIndex = 0;
11019
11058
  }
11020
11059
  this.openPanel(this.panels[normalizedIndex]);
11021
11060
  }
11022
11061
  moveToPrevious(options) {
11023
- if (!options) {
11024
- options = {};
11025
- }
11026
- if (!options.panel) {
11027
- options.panel = this.activePanel;
11028
- }
11062
+ var _a;
11063
+ options !== null && options !== void 0 ? options : (options = {});
11064
+ (_a = options.panel) !== null && _a !== void 0 ? _a : (options.panel = this.activePanel);
11029
11065
  if (!options.panel) {
11030
11066
  return;
11031
11067
  }
@@ -11034,11 +11070,11 @@ class DockviewGroupPanelModel extends CompositeDisposable {
11034
11070
  if (index > 0) {
11035
11071
  normalizedIndex = index - 1;
11036
11072
  }
11037
- else if (!options.suppressRoll) {
11038
- normalizedIndex = this.panels.length - 1;
11073
+ else if (options.suppressRoll) {
11074
+ return;
11039
11075
  }
11040
11076
  else {
11041
- return;
11077
+ normalizedIndex = this.panels.length - 1;
11042
11078
  }
11043
11079
  this.openPanel(this.panels[normalizedIndex]);
11044
11080
  }
@@ -11138,7 +11174,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
11138
11174
  if (!this._activePanel && this.panels.length > 0) {
11139
11175
  const candidate = this._panels.find((p) => {
11140
11176
  const tg = this._findTabGroupForPanel(p.id);
11141
- return !tg || !tg.collapsed;
11177
+ return !(tg === null || tg === void 0 ? void 0 : tg.collapsed);
11142
11178
  });
11143
11179
  if (candidate) {
11144
11180
  this.doSetActivePanel(candidate);
@@ -11677,7 +11713,7 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
11677
11713
  getWindow() {
11678
11714
  return this.location.type === 'popout'
11679
11715
  ? this.location.getWindow()
11680
- : window;
11716
+ : globalThis.window;
11681
11717
  }
11682
11718
  setHeaderPosition(position) {
11683
11719
  if (!this._group) {
@@ -12260,9 +12296,8 @@ class DockviewPanel extends CompositeDisposable {
12260
12296
  }
12261
12297
  }
12262
12298
  update(event) {
12263
- var _a;
12264
12299
  // merge the new parameters with the existing parameters
12265
- this._params = Object.assign(Object.assign({}, ((_a = this._params) !== null && _a !== void 0 ? _a : {})), event.params);
12300
+ this._params = Object.assign(Object.assign({}, this._params), event.params);
12266
12301
  /**
12267
12302
  * delete new keys that have a value of undefined,
12268
12303
  * allow values of null
@@ -12659,19 +12694,19 @@ class Overlay extends CompositeDisposable {
12659
12694
  const element = this._element.getBoundingClientRect();
12660
12695
  const result = {};
12661
12696
  if (this.verticalAlignment === 'top') {
12662
- result.top = parseFloat(this._element.style.top);
12697
+ result.top = Number.parseFloat(this._element.style.top);
12663
12698
  }
12664
12699
  else if (this.verticalAlignment === 'bottom') {
12665
- result.bottom = parseFloat(this._element.style.bottom);
12700
+ result.bottom = Number.parseFloat(this._element.style.bottom);
12666
12701
  }
12667
12702
  else {
12668
12703
  result.top = element.top - container.top;
12669
12704
  }
12670
12705
  if (this.horiziontalAlignment === 'left') {
12671
- result.left = parseFloat(this._element.style.left);
12706
+ result.left = Number.parseFloat(this._element.style.left);
12672
12707
  }
12673
12708
  else if (this.horiziontalAlignment === 'right') {
12674
- result.right = parseFloat(this._element.style.right);
12709
+ result.right = Number.parseFloat(this._element.style.right);
12675
12710
  }
12676
12711
  else {
12677
12712
  result.left = element.left - container.left;
@@ -12735,7 +12770,7 @@ class Overlay extends CompositeDisposable {
12735
12770
  }
12736
12771
  }
12737
12772
  },
12738
- }, addDisposableListener(window, 'pointermove', (e) => {
12773
+ }, addDisposableListener(globalThis.window, 'pointermove', (e) => {
12739
12774
  if (this._dragCancelled) {
12740
12775
  return;
12741
12776
  }
@@ -12744,12 +12779,10 @@ class Overlay extends CompositeDisposable {
12744
12779
  const y = e.clientY - containerRect.top;
12745
12780
  toggleClass(this._element, 'dv-resize-container-dragging', true);
12746
12781
  const overlayRect = this._element.getBoundingClientRect();
12747
- if (offset === null) {
12748
- offset = {
12749
- x: e.clientX - overlayRect.left,
12750
- y: e.clientY - overlayRect.top,
12751
- };
12752
- }
12782
+ offset !== null && offset !== void 0 ? offset : (offset = {
12783
+ x: e.clientX - overlayRect.left,
12784
+ y: e.clientY - overlayRect.top,
12785
+ });
12753
12786
  const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
12754
12787
  const yOffset = Math.max(0, this.getMinimumHeight(overlayRect.height));
12755
12788
  let proposedTop = y - offset.y;
@@ -12801,7 +12834,7 @@ class Overlay extends CompositeDisposable {
12801
12834
  hasMoved = true;
12802
12835
  this._onDidStartMoving.fire();
12803
12836
  }
12804
- }), addDisposableListener(window, 'pointerup', end), addDisposableListener(window, 'pointercancel', end));
12837
+ }), addDisposableListener(globalThis.window, 'pointerup', end), addDisposableListener(globalThis.window, 'pointercancel', end));
12805
12838
  };
12806
12839
  this.addDisposables(addDisposableListener(dragTarget, 'pointerdown', (event) => {
12807
12840
  if (event.defaultPrevented) {
@@ -12855,20 +12888,18 @@ class Overlay extends CompositeDisposable {
12855
12888
  move.dispose();
12856
12889
  this._onDidChangeEnd.fire();
12857
12890
  };
12858
- move.value = new CompositeDisposable(addDisposableListener(window, 'pointermove', (e) => {
12891
+ move.value = new CompositeDisposable(addDisposableListener(globalThis.window, 'pointermove', (e) => {
12859
12892
  const containerRect = this.options.container.getBoundingClientRect();
12860
12893
  const overlayRect = this._element.getBoundingClientRect();
12861
12894
  const y = e.clientY - containerRect.top;
12862
12895
  const x = e.clientX - containerRect.left;
12863
- if (startPosition === null) {
12864
- // record the initial dimensions since as all subsequence moves are relative to this
12865
- startPosition = {
12866
- originalY: y,
12867
- originalHeight: overlayRect.height,
12868
- originalX: x,
12869
- originalWidth: overlayRect.width,
12870
- };
12871
- }
12896
+ // record the initial dimensions since as all subsequence moves are relative to this
12897
+ startPosition !== null && startPosition !== void 0 ? startPosition : (startPosition = {
12898
+ originalY: y,
12899
+ originalHeight: overlayRect.height,
12900
+ originalX: x,
12901
+ originalWidth: overlayRect.width,
12902
+ });
12872
12903
  let top = undefined;
12873
12904
  let bottom = undefined;
12874
12905
  let height = undefined;
@@ -12883,7 +12914,8 @@ class Overlay extends CompositeDisposable {
12883
12914
  ? Math.max(0, containerRect.height -
12884
12915
  Overlay.MINIMUM_HEIGHT)
12885
12916
  : Math.max(0, startPosition.originalY +
12886
- startPosition.originalHeight -
12917
+ startPosition
12918
+ .originalHeight -
12887
12919
  Overlay.MINIMUM_HEIGHT);
12888
12920
  top = clamp(y, 0, maxTop);
12889
12921
  height =
@@ -12898,8 +12930,8 @@ class Overlay extends CompositeDisposable {
12898
12930
  startPosition.originalHeight;
12899
12931
  // When dragging bottom handle, constrain height to container height
12900
12932
  const minHeight = top < 0 &&
12901
- typeof this.options.minimumInViewportHeight ===
12902
- 'number'
12933
+ typeof this.options
12934
+ .minimumInViewportHeight === 'number'
12903
12935
  ? -top +
12904
12936
  this.options.minimumInViewportHeight
12905
12937
  : Overlay.MINIMUM_HEIGHT;
@@ -12929,8 +12961,8 @@ class Overlay extends CompositeDisposable {
12929
12961
  startPosition.originalWidth;
12930
12962
  // When dragging right handle, constrain width to container width
12931
12963
  const minWidth = left < 0 &&
12932
- typeof this.options.minimumInViewportWidth ===
12933
- 'number'
12964
+ typeof this.options
12965
+ .minimumInViewportWidth === 'number'
12934
12966
  ? -left +
12935
12967
  this.options.minimumInViewportWidth
12936
12968
  : Overlay.MINIMUM_WIDTH;
@@ -12999,7 +13031,7 @@ class Overlay extends CompositeDisposable {
12999
13031
  }
13000
13032
  }
13001
13033
  },
13002
- }, addDisposableListener(window, 'pointerup', end), addDisposableListener(window, 'pointercancel', end));
13034
+ }, addDisposableListener(globalThis.window, 'pointerup', end), addDisposableListener(globalThis.window, 'pointercancel', end));
13003
13035
  }));
13004
13036
  }
13005
13037
  getMinimumWidth(width) {
@@ -14113,7 +14145,7 @@ class PositionCache {
14113
14145
  }
14114
14146
  getPosition(element) {
14115
14147
  const cached = this.cache.get(element);
14116
- if (cached && cached.frameId === this.currentFrameId) {
14148
+ if ((cached === null || cached === void 0 ? void 0 : cached.frameId) === this.currentFrameId) {
14117
14149
  return cached.rect;
14118
14150
  }
14119
14151
  this.scheduleFrameUpdate();
@@ -14325,11 +14357,10 @@ class OverlayRenderContainer extends CompositeDisposable {
14325
14357
  correctLayerPosition();
14326
14358
  }));
14327
14359
  this.map[panel.api.id].destroy = Disposable.from(() => {
14328
- var _a;
14329
14360
  if (contentElement.parentElement === focusContainer) {
14330
- focusContainer.removeChild(contentElement);
14361
+ contentElement.remove();
14331
14362
  }
14332
- (_a = focusContainer.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(focusContainer);
14363
+ focusContainer.remove();
14333
14364
  });
14334
14365
  correctLayerPosition();
14335
14366
  queueMicrotask(() => {
@@ -14394,13 +14425,13 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
14394
14425
  function assertSameOriginPopoutUrl(url) {
14395
14426
  let resolved;
14396
14427
  try {
14397
- resolved = new URL(url, window.location.href);
14428
+ resolved = new URL(url, globalThis.location.href);
14398
14429
  }
14399
14430
  catch (_a) {
14400
14431
  throw new Error(`dockview: invalid popout URL: ${url}`);
14401
14432
  }
14402
14433
  const protocolOk = resolved.protocol === 'http:' || resolved.protocol === 'https:';
14403
- if (!protocolOk || resolved.origin !== window.location.origin) {
14434
+ if (!protocolOk || resolved.origin !== globalThis.location.origin) {
14404
14435
  throw new Error(`dockview: popout URL must be same-origin http(s); got: ${url}`);
14405
14436
  }
14406
14437
  }
@@ -14478,7 +14509,7 @@ class PopoutWindow extends CompositeDisposable {
14478
14509
  this._window = { value: externalWindow, disposable };
14479
14510
  disposable.addDisposables(Disposable.from(() => {
14480
14511
  externalWindow.close();
14481
- }), addDisposableListener(window, 'beforeunload', () => {
14512
+ }), addDisposableListener(globalThis.window, 'beforeunload', () => {
14482
14513
  /**
14483
14514
  * before the main window closes we should close this popup too
14484
14515
  * to be good citizens
@@ -14508,7 +14539,7 @@ class PopoutWindow extends CompositeDisposable {
14508
14539
  const externalDocument = externalWindow.document;
14509
14540
  externalDocument.title = document.title;
14510
14541
  externalDocument.body.appendChild(container);
14511
- addStyles(externalDocument, window.document.styleSheets, {
14542
+ addStyles(externalDocument, globalThis.document.styleSheets, {
14512
14543
  nonce: this.options.nonce,
14513
14544
  });
14514
14545
  /**
@@ -14561,11 +14592,11 @@ class StrictEventsSequencing extends CompositeDisposable {
14561
14592
  panels.add(panel.api.id);
14562
14593
  }
14563
14594
  }), this.accessor.onDidRemovePanel((panel) => {
14564
- if (!panels.has(panel.api.id)) {
14565
- throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${panel.api.id} but panel does not exists`);
14595
+ if (panels.has(panel.api.id)) {
14596
+ panels.delete(panel.api.id);
14566
14597
  }
14567
14598
  else {
14568
- panels.delete(panel.api.id);
14599
+ throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${panel.api.id} but panel does not exists`);
14569
14600
  }
14570
14601
  }), this.accessor.onDidAddGroup((group) => {
14571
14602
  if (groups.has(group.api.id)) {
@@ -14575,11 +14606,11 @@ class StrictEventsSequencing extends CompositeDisposable {
14575
14606
  groups.add(group.api.id);
14576
14607
  }
14577
14608
  }), this.accessor.onDidRemoveGroup((group) => {
14578
- if (!groups.has(group.api.id)) {
14579
- throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${group.api.id} but group does not exists`);
14609
+ if (groups.has(group.api.id)) {
14610
+ groups.delete(group.api.id);
14580
14611
  }
14581
14612
  else {
14582
- groups.delete(group.api.id);
14613
+ throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${group.api.id} but group does not exists`);
14583
14614
  }
14584
14615
  }));
14585
14616
  }
@@ -14594,7 +14625,7 @@ function isCoarsePrimaryInput(win) {
14594
14625
  return coarse && !fine;
14595
14626
  }
14596
14627
  class PopupService extends CompositeDisposable {
14597
- constructor(root, win = window) {
14628
+ constructor(root, win = globalThis.window) {
14598
14629
  super();
14599
14630
  this._active = null;
14600
14631
  this._activeDisposable = new MutableDisposable();
@@ -14711,9 +14742,8 @@ class DropTargetAnchorContainer extends CompositeDisposable {
14711
14742
  }
14712
14743
  return {
14713
14744
  clear: () => {
14714
- var _a;
14715
14745
  if (this._model) {
14716
- (_a = this._model.root.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this._model.root);
14746
+ this._model.root.remove();
14717
14747
  }
14718
14748
  this._model = undefined;
14719
14749
  },
@@ -14766,16 +14796,30 @@ class DropTargetAnchorContainer extends CompositeDisposable {
14766
14796
  }
14767
14797
 
14768
14798
  class EdgeGroupView {
14799
+ /**
14800
+ * The effective (pre-gap) collapsed size: the measured tab-strip size when
14801
+ * available, otherwise the configured/theme base.
14802
+ */
14803
+ get _effectiveBaseCollapsed() {
14804
+ var _a;
14805
+ return (_a = this._measuredTabSize) !== null && _a !== void 0 ? _a : this._baseCollapsedSize;
14806
+ }
14769
14807
  get minimumSize() {
14770
14808
  // When collapsed, lock size to collapsedSize so sash can't drag it open
14771
- return this._isCollapsed
14772
- ? this._collapsedSize
14773
- : this._expandedMinimumSize;
14809
+ if (this._isCollapsed) {
14810
+ return this.collapsedSize;
14811
+ }
14812
+ // If the caller explicitly provides a minimumSize, respect it.
14813
+ // Otherwise fall back to collapsedSize + 50 so the expanded state is
14814
+ // visually distinguishable from the collapsed state.
14815
+ return this._baseMinimumSize !== undefined
14816
+ ? this._baseMinimumSize + this._gapAdd
14817
+ : this._effectiveBaseCollapsed + 50 + this._gapAdd;
14774
14818
  }
14775
14819
  get maximumSize() {
14776
14820
  // When collapsed, lock size to collapsedSize so sash can't drag it open
14777
14821
  return this._isCollapsed
14778
- ? this._collapsedSize
14822
+ ? this.collapsedSize
14779
14823
  : this._expandedMaximumSize;
14780
14824
  }
14781
14825
  get element() {
@@ -14788,34 +14832,62 @@ class EdgeGroupView {
14788
14832
  return this._lastExpandedSize;
14789
14833
  }
14790
14834
  get collapsedSize() {
14791
- return this._collapsedSize;
14835
+ return this._effectiveBaseCollapsed + this._gapAdd;
14792
14836
  }
14793
- constructor(options, group, orientation) {
14837
+ constructor(options, group, orientation, gapAdd = 0) {
14794
14838
  var _a, _b, _c;
14795
14839
  this._onDidChange = new Emitter();
14796
14840
  this.onDidChange = this._onDidChange.event;
14797
14841
  this.snap = false;
14798
14842
  this.priority = LayoutPriority.Low;
14799
14843
  this._isCollapsed = false;
14844
+ this._tabSizeDisposables = new CompositeDisposable();
14800
14845
  this._group = group;
14801
14846
  this._orientation = orientation;
14802
14847
  group.element.classList.add('dv-edge-group');
14803
14848
  group.element.dataset.testid = `dv-edge-group-${options.id}`;
14804
- this._collapsedSize = (_a = options.collapsedSize) !== null && _a !== void 0 ? _a : 35;
14849
+ this._baseCollapsedSize = (_a = options.collapsedSize) !== null && _a !== void 0 ? _a : 35;
14850
+ this._baseMinimumSize = options.minimumSize;
14851
+ this._gapAdd = gapAdd;
14805
14852
  this._expandedMaximumSize =
14806
14853
  (_b = options.maximumSize) !== null && _b !== void 0 ? _b : Number.POSITIVE_INFINITY;
14807
- // If the caller explicitly provides a minimumSize, respect it.
14808
- // Otherwise fall back to collapsedSize + 50 so the expanded state is
14809
- // visually distinguishable from the collapsed state.
14810
- this._expandedMinimumSize =
14811
- options.minimumSize !== undefined
14812
- ? options.minimumSize
14813
- : this._collapsedSize + 50;
14814
14854
  this._lastExpandedSize = (_c = options.initialSize) !== null && _c !== void 0 ? _c : 200;
14815
14855
  if (options.collapsed) {
14816
14856
  this._isCollapsed = true;
14817
14857
  group.element.classList.add('dv-edge-collapsed');
14818
14858
  }
14859
+ this._observeTabStrip();
14860
+ }
14861
+ /**
14862
+ * Watch the group's tab strip so the collapsed size follows the live tab
14863
+ * height. The strip's cross-axis size (height for top/bottom, width for
14864
+ * left/right) is exactly what a collapsed edge group should occupy; a
14865
+ * ResizeObserver keeps them in sync when the tab height changes at runtime.
14866
+ */
14867
+ _observeTabStrip() {
14868
+ const strip = this._group.element.querySelector('.dv-tabs-and-actions-container');
14869
+ if (!strip) {
14870
+ return;
14871
+ }
14872
+ this._tabSizeDisposables.addDisposables(watchElementResize(strip, () => {
14873
+ this._applyMeasuredTabSize(this._orientation === 'vertical'
14874
+ ? strip.offsetHeight
14875
+ : strip.offsetWidth);
14876
+ }));
14877
+ }
14878
+ /**
14879
+ * Apply a freshly-measured tab-strip cross size. When the group is
14880
+ * collapsed this resizes it in the parent splitview so the collapsed strip
14881
+ * always shows the full tab height.
14882
+ */
14883
+ _applyMeasuredTabSize(size) {
14884
+ if (size <= 0 || size === this._measuredTabSize) {
14885
+ return;
14886
+ }
14887
+ this._measuredTabSize = size;
14888
+ if (this._isCollapsed) {
14889
+ this._onDidChange.fire({ size: this.collapsedSize });
14890
+ }
14819
14891
  }
14820
14892
  layout(size, orthogonalSize) {
14821
14893
  // Track the last expanded size so we can restore it after collapsing
@@ -14851,15 +14923,18 @@ class EdgeGroupView {
14851
14923
  this._lastExpandedSize = size;
14852
14924
  }
14853
14925
  /**
14854
- * Apply new effective collapsed and expanded-minimum sizes after a theme
14855
- * or gap change. The caller (ShellManager) is responsible for computing
14856
- * the correct values from the original config and the new gap.
14926
+ * Apply a new base (pre-gap) collapsed size, base minimum size and gap
14927
+ * contribution after a theme or gap change. Base values come from the
14928
+ * original config; the ShellManager owns the gap arithmetic. A live
14929
+ * measured tab size (if any) continues to win over the base collapsed size.
14857
14930
  */
14858
- updateCollapsedSize(newCollapsedSize, newExpandedMinimumSize) {
14859
- this._collapsedSize = newCollapsedSize;
14860
- this._expandedMinimumSize = newExpandedMinimumSize;
14931
+ updateSizing(baseCollapsedSize, baseMinimumSize, gapAdd) {
14932
+ this._baseCollapsedSize = baseCollapsedSize;
14933
+ this._baseMinimumSize = baseMinimumSize;
14934
+ this._gapAdd = gapAdd;
14861
14935
  }
14862
14936
  dispose() {
14937
+ this._tabSizeDisposables.dispose();
14863
14938
  this._onDidChange.dispose();
14864
14939
  }
14865
14940
  }
@@ -14991,15 +15066,6 @@ class MiddleColumnView {
14991
15066
  this._splitview.dispose();
14992
15067
  }
14993
15068
  }
14994
- function adjustedOpts(base, defaultCollapsed, gapAdd) {
14995
- var _a;
14996
- const effectiveCollapsed = ((_a = base.collapsedSize) !== null && _a !== void 0 ? _a : defaultCollapsed) + gapAdd;
14997
- const result = Object.assign(Object.assign({}, base), { collapsedSize: effectiveCollapsed });
14998
- if (base.minimumSize !== undefined) {
14999
- result.minimumSize = base.minimumSize + gapAdd;
15000
- }
15001
- return result;
15002
- }
15003
15069
  class ShellManager {
15004
15070
  constructor(container, dockviewElement, layoutGrid, gap = 0, defaultCollapsedSize = 35) {
15005
15071
  this._disposables = new CompositeDisposable();
@@ -15025,6 +15091,26 @@ class ShellManager {
15025
15091
  this._middleIndex = 0;
15026
15092
  this._outerSplitview.addView(this._middleColumn, { type: 'distribute' }, 0);
15027
15093
  this._disposables.addDisposables(watchElementResize(this._shellElement, (entry) => {
15094
+ /**
15095
+ * When the shell (or an ancestor) becomes hidden — e.g. a
15096
+ * nested dockview whose `onlyWhenVisible` host panel is
15097
+ * deactivated — the element collapses to (0, 0) or is detached
15098
+ * from the DOM. Propagating that zero size would relayout the
15099
+ * edge-group splitview at 0, clamping the low-priority edge
15100
+ * groups down to their minimum size and destroying the user's
15101
+ * sizing. Skip these cases so sizes are preserved while hidden;
15102
+ * mirrors the guard in the `Resizable` base class. See #1495.
15103
+ *
15104
+ * offsetParent === null is equivalent to display: none on the
15105
+ * element or one of its ancestors.
15106
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
15107
+ */
15108
+ if (!this._shellElement.offsetParent) {
15109
+ return;
15110
+ }
15111
+ if (!isInDocument(this._shellElement)) {
15112
+ return;
15113
+ }
15028
15114
  const width = Math.round(entry.contentRect.width);
15029
15115
  const height = Math.round(entry.contentRect.height);
15030
15116
  if (width === this._currentWidth &&
@@ -15061,7 +15147,7 @@ class ShellManager {
15061
15147
  const isHorizontal = position === 'left' || position === 'right';
15062
15148
  const gapAdd = isHorizontal ? outerGapAdd : innerGapAdd;
15063
15149
  const orientation = isHorizontal ? 'horizontal' : 'vertical';
15064
- const view = new EdgeGroupView(adjustedOpts(Object.assign({ collapsedSize: this._defaultCollapsedSize }, options), this._defaultCollapsedSize, gapAdd), group, orientation);
15150
+ const view = new EdgeGroupView(Object.assign({ collapsedSize: this._defaultCollapsedSize }, options), group, orientation, gapAdd);
15065
15151
  const initialSize = view.isCollapsed
15066
15152
  ? view.collapsedSize
15067
15153
  : view.lastExpandedSize;
@@ -15128,10 +15214,7 @@ class ShellManager {
15128
15214
  const updateView = (view, baseCfg, gapAdd) => {
15129
15215
  var _a;
15130
15216
  const baseCS = (_a = baseCfg.collapsedSize) !== null && _a !== void 0 ? _a : defaultCollapsedSize;
15131
- const newCS = baseCS + gapAdd;
15132
- const baseMS = baseCfg.minimumSize;
15133
- const newMS = baseMS !== undefined ? baseMS + gapAdd : newCS + 50;
15134
- view.updateCollapsedSize(newCS, newMS);
15217
+ view.updateSizing(baseCS, baseCfg.minimumSize, gapAdd);
15135
15218
  };
15136
15219
  const topCfg = this._viewConfigs.get('top');
15137
15220
  if (this._topView && topCfg) {
@@ -15382,9 +15465,8 @@ class ShellManager {
15382
15465
  }
15383
15466
  }
15384
15467
  dispose() {
15385
- var _a;
15386
15468
  this._disposables.dispose();
15387
- (_a = this._shellElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this._shellElement);
15469
+ this._shellElement.remove();
15388
15470
  }
15389
15471
  }
15390
15472
 
@@ -15421,9 +15503,9 @@ let _hasWarnedUsingCoreDirectly = false;
15421
15503
  * `process` is undefined.
15422
15504
  */
15423
15505
  function warnIfUsingCoreDirectly() {
15506
+ var _a;
15424
15507
  if (typeof process !== 'undefined' &&
15425
- process.env &&
15426
- process.env.NODE_ENV === 'production') {
15508
+ ((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'production') {
15427
15509
  return;
15428
15510
  }
15429
15511
  if (_hasWarnedUsingCoreDirectly || isDockviewPackageLoaded()) {
@@ -15814,7 +15896,7 @@ class DockviewComponent extends BaseGrid {
15814
15896
  // The shell always wraps the dockview element so edge groups can be
15815
15897
  // added at any time via addEdgeGroup() without re-parenting the DOM.
15816
15898
  this.disableResizing = true;
15817
- container.removeChild(this.element);
15899
+ this.element.remove();
15818
15900
  this._shellManager = new ShellManager(container, this.element, (w, h) => this._layoutFromShell(w, h), (_d = (_c = options.theme) === null || _c === void 0 ? void 0 : _c.gap) !== null && _d !== void 0 ? _d : 0, (_e = options.theme) === null || _e === void 0 ? void 0 : _e.edgeGroupCollapsedSize);
15819
15901
  // The shell wraps the dockview element, so move the popup anchor
15820
15902
  // into the shell so overflow dropdowns in edge groups position correctly
@@ -16036,15 +16118,13 @@ class DockviewComponent extends BaseGrid {
16036
16118
  return _window
16037
16119
  .open()
16038
16120
  .then((popoutContainer) => {
16039
- var _a, _b, _c;
16121
+ var _a, _b, _c, _d;
16040
16122
  if (_window.isDisposed) {
16041
16123
  return false;
16042
16124
  }
16043
- const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
16044
- ? options.referenceGroup
16045
- : itemToPopout instanceof DockviewPanel
16046
- ? itemToPopout.group
16047
- : itemToPopout;
16125
+ const referenceGroup = (_a = options === null || options === void 0 ? void 0 : options.referenceGroup) !== null && _a !== void 0 ? _a : (itemToPopout instanceof DockviewPanel
16126
+ ? itemToPopout.group
16127
+ : itemToPopout);
16048
16128
  const referenceLocation = itemToPopout.api.location.type;
16049
16129
  /**
16050
16130
  * The group that is being added doesn't already exist within the DOM, the most likely occurrence
@@ -16055,7 +16135,7 @@ class DockviewComponent extends BaseGrid {
16055
16135
  if (options === null || options === void 0 ? void 0 : options.overridePopoutGridview) {
16056
16136
  // Restoring a multi-group window: the anchor group is
16057
16137
  // already built inside the supplied gridview.
16058
- group = (_a = options.overridePopoutGroup) !== null && _a !== void 0 ? _a : referenceGroup;
16138
+ group = (_b = options.overridePopoutGroup) !== null && _b !== void 0 ? _b : referenceGroup;
16059
16139
  }
16060
16140
  else if (!isGroupAddedToDom) {
16061
16141
  group = referenceGroup;
@@ -16086,7 +16166,7 @@ class DockviewComponent extends BaseGrid {
16086
16166
  // a nested splitview layout. The window starts with the single
16087
16167
  // anchor group; further groups arrive via drag-and-drop. On
16088
16168
  // restore a pre-populated gridview is supplied instead.
16089
- const popoutGridview = (_b = options === null || options === void 0 ? void 0 : options.overridePopoutGridview) !== null && _b !== void 0 ? _b : this.createNestedGridview();
16169
+ const popoutGridview = (_c = options === null || options === void 0 ? void 0 : options.overridePopoutGridview) !== null && _c !== void 0 ? _c : this.createNestedGridview();
16090
16170
  if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGridview)) {
16091
16171
  popoutGridview.addView(group, Sizing.Distribute, [0]);
16092
16172
  }
@@ -16127,9 +16207,9 @@ class DockviewComponent extends BaseGrid {
16127
16207
  break;
16128
16208
  case 'floating':
16129
16209
  case 'popout':
16130
- floatingBox = (_c = this.floatingGroups
16210
+ floatingBox = (_d = this.floatingGroups
16131
16211
  .find((value) => value.group.api.id ===
16132
- itemToPopout.api.id)) === null || _c === void 0 ? void 0 : _c.overlay.toJSON();
16212
+ itemToPopout.api.id)) === null || _d === void 0 ? void 0 : _d.overlay.toJSON();
16133
16213
  this.removeGroup(referenceGroup);
16134
16214
  break;
16135
16215
  }
@@ -16970,7 +17050,7 @@ class DockviewComponent extends BaseGrid {
16970
17050
  const createGroupFromSerializedState = (data) => {
16971
17051
  const { id, locked, hideHeader, headerPosition, views, activeView, } = data;
16972
17052
  if (typeof id !== 'string') {
16973
- throw new Error('dockview: group id must be of type string');
17053
+ throw new TypeError('dockview: group id must be of type string');
16974
17054
  }
16975
17055
  const group = this.createGroup({
16976
17056
  id,
@@ -17144,8 +17224,7 @@ class DockviewComponent extends BaseGrid {
17144
17224
  createdPanels.push(panel);
17145
17225
  }
17146
17226
  }
17147
- for (let i = 0; i < createdPanels.length; i++) {
17148
- const panel = createdPanels[i];
17227
+ for (const panel of createdPanels) {
17149
17228
  const isActive = activeView === panel.id;
17150
17229
  edgeGroup.model.openPanel(panel, {
17151
17230
  skipSetActive: !isActive,
@@ -17290,8 +17369,8 @@ class DockviewComponent extends BaseGrid {
17290
17369
  return this.mutation('add', () => this._doAddPanel(options));
17291
17370
  }
17292
17371
  _doAddPanel(options) {
17293
- var _a, _b;
17294
- if (this.panels.find((_) => _.id === options.id)) {
17372
+ var _a, _b, _c, _d;
17373
+ if (this.panels.some((_) => _.id === options.id)) {
17295
17374
  throw new Error(`dockview: panel with id ${options.id} already exists`);
17296
17375
  }
17297
17376
  let referenceGroup;
@@ -17310,18 +17389,24 @@ class DockviewComponent extends BaseGrid {
17310
17389
  : options.position.referencePanel;
17311
17390
  index = options.position.index;
17312
17391
  if (!referencePanel) {
17313
- throw new Error(`dockview: referencePanel '${options.position.referencePanel}' does not exist`);
17392
+ const referenceId = typeof options.position.referencePanel === 'string'
17393
+ ? options.position.referencePanel
17394
+ : (_a = options.position.referencePanel) === null || _a === void 0 ? void 0 : _a.id;
17395
+ throw new Error(`dockview: referencePanel '${referenceId}' does not exist`);
17314
17396
  }
17315
17397
  referenceGroup = this.findGroup(referencePanel);
17316
17398
  }
17317
17399
  else if (isPanelOptionsWithGroup(options.position)) {
17318
17400
  referenceGroup =
17319
17401
  typeof options.position.referenceGroup === 'string'
17320
- ? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
17402
+ ? (_b = this._groups.get(options.position.referenceGroup)) === null || _b === void 0 ? void 0 : _b.value
17321
17403
  : options.position.referenceGroup;
17322
17404
  index = options.position.index;
17323
17405
  if (!referenceGroup) {
17324
- throw new Error(`dockview: referenceGroup '${options.position.referenceGroup}' does not exist`);
17406
+ const referenceId = typeof options.position.referenceGroup === 'string'
17407
+ ? options.position.referenceGroup
17408
+ : (_c = options.position.referenceGroup) === null || _c === void 0 ? void 0 : _c.id;
17409
+ throw new Error(`dockview: referenceGroup '${referenceId}' does not exist`);
17325
17410
  }
17326
17411
  }
17327
17412
  else {
@@ -17347,7 +17432,7 @@ class DockviewComponent extends BaseGrid {
17347
17432
  }
17348
17433
  let panel;
17349
17434
  if (referenceGroup) {
17350
- const target = toTarget(((_b = options.position) === null || _b === void 0 ? void 0 : _b.direction) || 'within');
17435
+ const target = toTarget(((_d = options.position) === null || _d === void 0 ? void 0 : _d.direction) || 'within');
17351
17436
  if (options.floating) {
17352
17437
  const group = this.createGroup();
17353
17438
  this._onDidAddGroup.fire(group);
@@ -17429,14 +17514,17 @@ class DockviewComponent extends BaseGrid {
17429
17514
  }
17430
17515
  return panel;
17431
17516
  }
17432
- removePanel(panel, options = {
17433
- removeEmptyGroup: true,
17434
- }) {
17435
- this.mutation('remove', () => this._doRemovePanel(panel, options));
17517
+ removePanel(panel, options) {
17518
+ this.mutation('remove', () => {
17519
+ var _a;
17520
+ return this._doRemovePanel(panel, {
17521
+ removeEmptyGroup: (_a = options === null || options === void 0 ? void 0 : options.removeEmptyGroup) !== null && _a !== void 0 ? _a : true,
17522
+ skipDispose: options === null || options === void 0 ? void 0 : options.skipDispose,
17523
+ skipSetActiveGroup: options === null || options === void 0 ? void 0 : options.skipSetActiveGroup,
17524
+ });
17525
+ });
17436
17526
  }
17437
- _doRemovePanel(panel, options = {
17438
- removeEmptyGroup: true,
17439
- }) {
17527
+ _doRemovePanel(panel, options) {
17440
17528
  const group = panel.group;
17441
17529
  if (!group) {
17442
17530
  throw new Error(`dockview: cannot remove panel ${panel.id}. it's missing a group.`);
@@ -17462,28 +17550,34 @@ class DockviewComponent extends BaseGrid {
17462
17550
  return this.mutation('add', () => this._doAddGroup(options));
17463
17551
  }
17464
17552
  _doAddGroup(options) {
17465
- var _a;
17553
+ var _a, _b, _c;
17466
17554
  if (options) {
17467
17555
  let referenceGroup;
17468
17556
  if (isGroupOptionsWithPanel(options)) {
17469
17557
  const referencePanel = typeof options.referencePanel === 'string'
17470
17558
  ? this.panels.find((panel) => panel.id === options.referencePanel)
17471
17559
  : options.referencePanel;
17560
+ const referencePanelId = typeof options.referencePanel === 'string'
17561
+ ? options.referencePanel
17562
+ : (_a = options.referencePanel) === null || _a === void 0 ? void 0 : _a.id;
17472
17563
  if (!referencePanel) {
17473
- throw new Error(`dockview: reference panel ${options.referencePanel} does not exist`);
17564
+ throw new Error(`dockview: reference panel ${referencePanelId} does not exist`);
17474
17565
  }
17475
17566
  referenceGroup = this.findGroup(referencePanel);
17476
17567
  if (!referenceGroup) {
17477
- throw new Error(`dockview: reference group for reference panel ${options.referencePanel} does not exist`);
17568
+ throw new Error(`dockview: reference group for reference panel ${referencePanelId} does not exist`);
17478
17569
  }
17479
17570
  }
17480
17571
  else if (isGroupOptionsWithGroup(options)) {
17481
17572
  referenceGroup =
17482
17573
  typeof options.referenceGroup === 'string'
17483
- ? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
17574
+ ? (_b = this._groups.get(options.referenceGroup)) === null || _b === void 0 ? void 0 : _b.value
17484
17575
  : options.referenceGroup;
17485
17576
  if (!referenceGroup) {
17486
- throw new Error(`dockview: reference group ${options.referenceGroup} does not exist`);
17577
+ const referenceId = typeof options.referenceGroup === 'string'
17578
+ ? options.referenceGroup
17579
+ : (_c = options.referenceGroup) === null || _c === void 0 ? void 0 : _c.id;
17580
+ throw new Error(`dockview: reference group ${referenceId} does not exist`);
17487
17581
  }
17488
17582
  }
17489
17583
  else {
@@ -17606,14 +17700,14 @@ class DockviewComponent extends BaseGrid {
17606
17700
  if (this.detachFromNestedWindow(group)) {
17607
17701
  // The floating window hosts other groups and stays alive —
17608
17702
  // finalize just this group.
17609
- if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
17610
- this.disposeGroupRecord(group);
17611
- }
17612
- else {
17703
+ if (options === null || options === void 0 ? void 0 : options.skipDispose) {
17613
17704
  // Relocation: reset location so the destination root can
17614
17705
  // re-tag it.
17615
17706
  group.model.location = { type: 'grid' };
17616
17707
  }
17708
+ else {
17709
+ this.disposeGroupRecord(group);
17710
+ }
17617
17711
  this.activateFallbackGroupIfRemoved(group, options === null || options === void 0 ? void 0 : options.skipActive);
17618
17712
  return group;
17619
17713
  }
@@ -17634,14 +17728,14 @@ class DockviewComponent extends BaseGrid {
17634
17728
  if (this.detachFromNestedWindow(group)) {
17635
17729
  // The popout window hosts other groups and stays alive —
17636
17730
  // finalize just this group.
17637
- if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
17638
- this.disposeGroupRecord(group);
17639
- }
17640
- else {
17731
+ if (options === null || options === void 0 ? void 0 : options.skipDispose) {
17641
17732
  // Relocation: reset location so the destination root can
17642
17733
  // re-tag it.
17643
17734
  group.model.location = { type: 'grid' };
17644
17735
  }
17736
+ else {
17737
+ this.disposeGroupRecord(group);
17738
+ }
17645
17739
  this.activateFallbackGroupIfRemoved(group, options === null || options === void 0 ? void 0 : options.skipActive);
17646
17740
  return group;
17647
17741
  }
@@ -17651,7 +17745,7 @@ class DockviewComponent extends BaseGrid {
17651
17745
  const refGroup = selectedGroup.referenceGroup
17652
17746
  ? this.getPanel(selectedGroup.referenceGroup)
17653
17747
  : undefined;
17654
- if (refGroup && refGroup.panels.length === 0) {
17748
+ if ((refGroup === null || refGroup === void 0 ? void 0 : refGroup.panels.length) === 0) {
17655
17749
  this.removeGroup(refGroup);
17656
17750
  }
17657
17751
  }
@@ -18327,9 +18421,7 @@ class DockviewComponent extends BaseGrid {
18327
18421
  return id;
18328
18422
  }
18329
18423
  createGroup(options) {
18330
- if (!options) {
18331
- options = {};
18332
- }
18424
+ options !== null && options !== void 0 ? options : (options = {});
18333
18425
  let id = options === null || options === void 0 ? void 0 : options.id;
18334
18426
  if (id && this._groups.has(options.id)) {
18335
18427
  console.warn(`dockview: Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
@@ -18525,13 +18617,13 @@ class DockviewComponent extends BaseGrid {
18525
18617
  entry.gridview.margin = gap;
18526
18618
  }
18527
18619
  (_f = this._shellManager) === null || _f === void 0 ? void 0 : _f.updateTheme(gap, (_g = theme.edgeGroupCollapsedSize) !== null && _g !== void 0 ? _g : 35);
18528
- if (theme.dndOverlayBorder !== undefined) {
18529
- this.element.style.setProperty('--dv-drag-over-border', theme.dndOverlayBorder);
18530
- (_h = this._shellManager) === null || _h === void 0 ? void 0 : _h.element.style.setProperty('--dv-drag-over-border', theme.dndOverlayBorder);
18620
+ if (theme.dndOverlayBorder === undefined) {
18621
+ this.element.style.removeProperty('--dv-drag-over-border');
18622
+ (_h = this._shellManager) === null || _h === void 0 ? void 0 : _h.element.style.removeProperty('--dv-drag-over-border');
18531
18623
  }
18532
18624
  else {
18533
- this.element.style.removeProperty('--dv-drag-over-border');
18534
- (_j = this._shellManager) === null || _j === void 0 ? void 0 : _j.element.style.removeProperty('--dv-drag-over-border');
18625
+ this.element.style.setProperty('--dv-drag-over-border', theme.dndOverlayBorder);
18626
+ (_j = this._shellManager) === null || _j === void 0 ? void 0 : _j.element.style.setProperty('--dv-drag-over-border', theme.dndOverlayBorder);
18535
18627
  }
18536
18628
  switch (theme.dndOverlayMounting) {
18537
18629
  case 'absolute':
@@ -18773,12 +18865,7 @@ class GridviewComponent extends BaseGrid {
18773
18865
  }
18774
18866
  this._groups.forEach((groupItem) => {
18775
18867
  const group = groupItem.value;
18776
- if (group !== panel) {
18777
- group.setActive(false);
18778
- }
18779
- else {
18780
- group.setActive(true);
18781
- }
18868
+ group.setActive(group === panel);
18782
18869
  });
18783
18870
  }));
18784
18871
  this._groups.set(panel.id, {
@@ -19271,9 +19358,7 @@ class PaneviewComponent extends Resizable {
19271
19358
  name: options.headerComponent,
19272
19359
  });
19273
19360
  }
19274
- if (!header) {
19275
- header = new DefaultHeader();
19276
- }
19361
+ header !== null && header !== void 0 ? header : (header = new DefaultHeader());
19277
19362
  const view = new PaneFramework({
19278
19363
  id: options.id,
19279
19364
  component: options.component,
@@ -19372,9 +19457,7 @@ class PaneviewComponent extends Resizable {
19372
19457
  name: data.headerComponent,
19373
19458
  });
19374
19459
  }
19375
- if (!header) {
19376
- header = new DefaultHeader();
19377
- }
19460
+ header !== null && header !== void 0 ? header : (header = new DefaultHeader());
19378
19461
  const panel = new PaneFramework({
19379
19462
  id: data.id,
19380
19463
  component: data.component,