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
  */
@@ -190,7 +190,7 @@ class LeakageMonitor {
190
190
  class Stacktrace {
191
191
  static create() {
192
192
  var _a;
193
- return new Stacktrace((_a = new Error().stack) !== null && _a !== void 0 ? _a : '');
193
+ return new Stacktrace((_a = new Error('listener stacktrace').stack) !== null && _a !== void 0 ? _a : '');
194
194
  }
195
195
  constructor(value) {
196
196
  this.value = value;
@@ -439,7 +439,7 @@ class FocusTracker extends CompositeDisposable {
439
439
  const onBlur = () => {
440
440
  if (hasFocus) {
441
441
  loosingFocus = true;
442
- window.setTimeout(() => {
442
+ globalThis.setTimeout(() => {
443
443
  if (loosingFocus) {
444
444
  loosingFocus = false;
445
445
  hasFocus = false;
@@ -817,7 +817,7 @@ class ViewItem {
817
817
  return this._cachedVisibleSize;
818
818
  }
819
819
  get visible() {
820
- return typeof this._cachedVisibleSize === 'undefined';
820
+ return this._cachedVisibleSize === undefined;
821
821
  }
822
822
  get minimumSize() {
823
823
  return this.visible ? this.view.minimumSize : 0;
@@ -1219,7 +1219,7 @@ class Splitview {
1219
1219
  const viewItem = new ViewItem(container, view, viewSize, {
1220
1220
  dispose: () => {
1221
1221
  disposable.dispose();
1222
- this.viewContainer.removeChild(container);
1222
+ container.remove();
1223
1223
  },
1224
1224
  });
1225
1225
  if (index === this.viewItems.length) {
@@ -1295,29 +1295,30 @@ class Splitview {
1295
1295
  this.distributeEmptySpace();
1296
1296
  this.layoutViews();
1297
1297
  };
1298
+ const doc = sash.ownerDocument;
1298
1299
  const end = () => {
1299
1300
  for (const item of this.viewItems) {
1300
1301
  item.enabled = true;
1301
1302
  }
1302
1303
  iframes.release();
1303
1304
  this.saveProportions();
1304
- document.removeEventListener('pointermove', onPointerMove);
1305
- document.removeEventListener('pointerup', end);
1306
- document.removeEventListener('pointercancel', end);
1307
- document.removeEventListener('contextmenu', end);
1305
+ doc.removeEventListener('pointermove', onPointerMove);
1306
+ doc.removeEventListener('pointerup', end);
1307
+ doc.removeEventListener('pointercancel', end);
1308
+ doc.removeEventListener('contextmenu', end);
1308
1309
  this._onDidSashEnd.fire(undefined);
1309
1310
  };
1310
- document.addEventListener('pointermove', onPointerMove);
1311
- document.addEventListener('pointerup', end);
1312
- document.addEventListener('pointercancel', end);
1313
- document.addEventListener('contextmenu', end);
1311
+ doc.addEventListener('pointermove', onPointerMove);
1312
+ doc.addEventListener('pointerup', end);
1313
+ doc.addEventListener('pointercancel', end);
1314
+ doc.addEventListener('contextmenu', end);
1314
1315
  };
1315
1316
  sash.addEventListener('pointerdown', onPointerStart);
1316
1317
  const sashItem = {
1317
1318
  container: sash,
1318
1319
  disposable: () => {
1319
1320
  sash.removeEventListener('pointerdown', onPointerStart);
1320
- this.sashContainer.removeChild(sash);
1321
+ sash.remove();
1321
1322
  },
1322
1323
  };
1323
1324
  this.sashContainer.appendChild(sash);
@@ -1364,7 +1365,7 @@ class Splitview {
1364
1365
  if (!skipLayout) {
1365
1366
  this.relayout();
1366
1367
  }
1367
- if (sizing && sizing.type === 'distribute') {
1368
+ if ((sizing === null || sizing === void 0 ? void 0 : sizing.type) === 'distribute') {
1368
1369
  this.distributeViewSizes();
1369
1370
  }
1370
1371
  this._onDidRemoveView.fire(viewItem.view);
@@ -1379,7 +1380,7 @@ class Splitview {
1379
1380
  }
1380
1381
  moveView(from, to) {
1381
1382
  const cachedVisibleSize = this.getViewCachedVisibleSize(from);
1382
- const sizing = typeof cachedVisibleSize === 'undefined'
1383
+ const sizing = cachedVisibleSize === undefined
1383
1384
  ? this.getViewSize(from)
1384
1385
  : exports.Sizing.Invisible(cachedVisibleSize);
1385
1386
  const view = this.removeView(from, undefined, true);
@@ -1389,13 +1390,7 @@ class Splitview {
1389
1390
  const previousSize = Math.max(this.size, this._contentSize);
1390
1391
  this.size = size;
1391
1392
  this.orthogonalSize = orthogonalSize;
1392
- if (!this.proportions) {
1393
- const indexes = range(this.viewItems.length);
1394
- const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === exports.LayoutPriority.Low);
1395
- const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === exports.LayoutPriority.High);
1396
- this.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);
1397
- }
1398
- else {
1393
+ if (this.proportions) {
1399
1394
  let total = 0;
1400
1395
  for (let i = 0; i < this.viewItems.length; i++) {
1401
1396
  const item = this.viewItems[i];
@@ -1415,6 +1410,12 @@ class Splitview {
1415
1410
  }
1416
1411
  }
1417
1412
  }
1413
+ else {
1414
+ const indexes = range(this.viewItems.length);
1415
+ const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === exports.LayoutPriority.Low);
1416
+ const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === exports.LayoutPriority.High);
1417
+ this.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);
1418
+ }
1418
1419
  this.distributeEmptySpace();
1419
1420
  this.layoutViews();
1420
1421
  }
@@ -1634,7 +1635,7 @@ class Splitview {
1634
1635
  this._onDidRemoveView.dispose();
1635
1636
  for (let i = 0; i < this.element.children.length; i++) {
1636
1637
  if (this.element.children.item(i) === this.element) {
1637
- this.element.removeChild(this.element);
1638
+ this.element.remove();
1638
1639
  break;
1639
1640
  }
1640
1641
  }
@@ -1971,13 +1972,11 @@ class BranchNode extends CompositeDisposable {
1971
1972
  if (this.children.length === 0) {
1972
1973
  return exports.LayoutPriority.Normal;
1973
1974
  }
1974
- const priorities = this.children.map((c) => typeof c.priority === 'undefined'
1975
- ? exports.LayoutPriority.Normal
1976
- : c.priority);
1977
- if (priorities.some((p) => p === exports.LayoutPriority.High)) {
1975
+ const priorities = new Set(this.children.map((c) => { var _a; return (_a = c.priority) !== null && _a !== void 0 ? _a : exports.LayoutPriority.Normal; }));
1976
+ if (priorities.has(exports.LayoutPriority.High)) {
1978
1977
  return exports.LayoutPriority.High;
1979
1978
  }
1980
- else if (priorities.some((p) => p === exports.LayoutPriority.Low)) {
1979
+ else if (priorities.has(exports.LayoutPriority.Low)) {
1981
1980
  return exports.LayoutPriority.Low;
1982
1981
  }
1983
1982
  return exports.LayoutPriority.Normal;
@@ -2014,16 +2013,7 @@ class BranchNode extends CompositeDisposable {
2014
2013
  this._size = size;
2015
2014
  this.element = document.createElement('div');
2016
2015
  this.element.className = 'dv-branch-node';
2017
- if (!childDescriptors) {
2018
- this.splitview = new Splitview(this.element, {
2019
- orientation: this.orientation,
2020
- proportionalLayout,
2021
- styles,
2022
- margin,
2023
- });
2024
- this.splitview.layout(this.size, this.orthogonalSize);
2025
- }
2026
- else {
2016
+ if (childDescriptors) {
2027
2017
  const descriptor = {
2028
2018
  views: childDescriptors.map((childDescriptor) => {
2029
2019
  return {
@@ -2046,6 +2036,15 @@ class BranchNode extends CompositeDisposable {
2046
2036
  margin,
2047
2037
  });
2048
2038
  }
2039
+ else {
2040
+ this.splitview = new Splitview(this.element, {
2041
+ orientation: this.orientation,
2042
+ proportionalLayout,
2043
+ styles,
2044
+ margin,
2045
+ });
2046
+ this.splitview.layout(this.size, this.orthogonalSize);
2047
+ }
2049
2048
  this.disabled = disabled;
2050
2049
  this.addDisposables(this._onDidChange, this._onDidVisibilityChange, this.splitview.onDidSashEnd(() => {
2051
2050
  this._onDidChange.fire({});
@@ -2543,7 +2542,7 @@ class Gridview {
2543
2542
  if (oldRoot) {
2544
2543
  oldRoot.dispose();
2545
2544
  this._maximizedNode = undefined;
2546
- this.element.removeChild(oldRoot.element);
2545
+ oldRoot.element.remove();
2547
2546
  }
2548
2547
  this._root = root;
2549
2548
  this.element.appendChild(this._root.element);
@@ -2635,7 +2634,7 @@ class Gridview {
2635
2634
  progmaticSelect(location, reverse = false) {
2636
2635
  const [path, node] = this.getNode(location);
2637
2636
  if (!(node instanceof LeafNode)) {
2638
- throw new Error('invalid location');
2637
+ throw new TypeError('invalid location');
2639
2638
  }
2640
2639
  for (let i = path.length - 1; i > -1; i--) {
2641
2640
  const n = path[i];
@@ -2672,7 +2671,7 @@ class Gridview {
2672
2671
  const [rest, index] = tail(location);
2673
2672
  const [, parent] = this.getNode(rest);
2674
2673
  if (!(parent instanceof BranchNode)) {
2675
- throw new Error('Invalid from location');
2674
+ throw new TypeError('Invalid from location');
2676
2675
  }
2677
2676
  return parent.isChildVisible(index);
2678
2677
  }
@@ -2683,7 +2682,7 @@ class Gridview {
2683
2682
  const [rest, index] = tail(location);
2684
2683
  const [, parent] = this.getNode(rest);
2685
2684
  if (!(parent instanceof BranchNode)) {
2686
- throw new Error('Invalid from location');
2685
+ throw new TypeError('Invalid from location');
2687
2686
  }
2688
2687
  this._onDidViewVisibilityChange.fire();
2689
2688
  parent.setChildVisible(index, visible);
@@ -2694,7 +2693,7 @@ class Gridview {
2694
2693
  }
2695
2694
  const [, parent] = this.getNode(parentLocation);
2696
2695
  if (!(parent instanceof BranchNode)) {
2697
- throw new Error('Invalid location');
2696
+ throw new TypeError('Invalid location');
2698
2697
  }
2699
2698
  parent.moveChild(from, to);
2700
2699
  }
@@ -2740,11 +2739,11 @@ class Gridview {
2740
2739
  const [rest, index] = tail(location);
2741
2740
  const [pathToParent, parent] = this.getNode(rest);
2742
2741
  if (!(parent instanceof BranchNode)) {
2743
- throw new Error('Invalid location');
2742
+ throw new TypeError('Invalid location');
2744
2743
  }
2745
2744
  const nodeToRemove = parent.children[index];
2746
2745
  if (!(nodeToRemove instanceof LeafNode)) {
2747
- throw new Error('Invalid location');
2746
+ throw new TypeError('Invalid location');
2748
2747
  }
2749
2748
  parent.removeChild(index, sizing);
2750
2749
  nodeToRemove.dispose();
@@ -2826,7 +2825,7 @@ class Gridview {
2826
2825
  return [path, node];
2827
2826
  }
2828
2827
  if (!(node instanceof BranchNode)) {
2829
- throw new Error('Invalid location');
2828
+ throw new TypeError('Invalid location');
2830
2829
  }
2831
2830
  const [index, ...rest] = location;
2832
2831
  if (index < 0 || index >= node.children.length) {
@@ -3006,8 +3005,7 @@ class BaseGrid extends Resizable {
3006
3005
  }), this.gridview.onDidViewVisibilityChange(() => this._onDidViewVisibilityChangeMicroTaskQueue.fire()), this.onDidViewVisibilityChangeMicroTaskQueue(() => {
3007
3006
  this.forceRelayout();
3008
3007
  }), exports.DockviewDisposable.from(() => {
3009
- var _a;
3010
- (_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.element);
3008
+ this.element.remove();
3011
3009
  }), this.gridview.onDidChange(() => {
3012
3010
  this._bufferOnDidLayoutChange.fire();
3013
3011
  }), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove, this.onDidActiveChange)(() => {
@@ -3097,9 +3095,7 @@ class BaseGrid extends Resizable {
3097
3095
  }
3098
3096
  moveToNext(options) {
3099
3097
  var _a;
3100
- if (!options) {
3101
- options = {};
3102
- }
3098
+ options !== null && options !== void 0 ? options : (options = {});
3103
3099
  if (!options.group) {
3104
3100
  if (!this.activeGroup) {
3105
3101
  return;
@@ -3112,9 +3108,7 @@ class BaseGrid extends Resizable {
3112
3108
  }
3113
3109
  moveToPrevious(options) {
3114
3110
  var _a;
3115
- if (!options) {
3116
- options = {};
3117
- }
3111
+ options !== null && options !== void 0 ? options : (options = {});
3118
3112
  if (!options.group) {
3119
3113
  if (!this.activeGroup) {
3120
3114
  return;
@@ -4616,9 +4610,8 @@ function addGhostImage(dataTransfer, ghostElement, options) {
4616
4610
  */
4617
4611
  class PointerDragController extends CompositeDisposable {
4618
4612
  static getInstance() {
4619
- if (!PointerDragController._instance) {
4620
- PointerDragController._instance = new PointerDragController();
4621
- }
4613
+ var _a;
4614
+ (_a = PointerDragController._instance) !== null && _a !== void 0 ? _a : (PointerDragController._instance = new PointerDragController());
4622
4615
  return PointerDragController._instance;
4623
4616
  }
4624
4617
  constructor() {
@@ -4683,21 +4676,24 @@ class PointerDragController extends CompositeDisposable {
4683
4676
  this._onDragStart.fire(startEvent);
4684
4677
  // Source's owning window — popout drags fire on their own window,
4685
4678
  // not the main one.
4686
- const targetWindow = (_c = (_b = source.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) !== null && _c !== void 0 ? _c : window;
4679
+ const targetWindow = (_c = (_b = source.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) !== null && _c !== void 0 ? _c : globalThis.window;
4687
4680
  this._moveListener = addDisposableListener(targetWindow, 'pointermove', (e) => {
4688
- if (!this._active || e.pointerId !== this._active.pointerId) {
4681
+ var _a;
4682
+ if (e.pointerId !== ((_a = this._active) === null || _a === void 0 ? void 0 : _a.pointerId)) {
4689
4683
  return;
4690
4684
  }
4691
4685
  this._handleMove(e);
4692
4686
  });
4693
4687
  this._upListener = addDisposableListener(targetWindow, 'pointerup', (e) => {
4694
- if (!this._active || e.pointerId !== this._active.pointerId) {
4688
+ var _a;
4689
+ if (e.pointerId !== ((_a = this._active) === null || _a === void 0 ? void 0 : _a.pointerId)) {
4695
4690
  return;
4696
4691
  }
4697
4692
  this._handleEnd(e, true);
4698
4693
  });
4699
4694
  this._cancelListener = addDisposableListener(targetWindow, 'pointercancel', (e) => {
4700
- if (!this._active || e.pointerId !== this._active.pointerId) {
4695
+ var _a;
4696
+ if (e.pointerId !== ((_a = this._active) === null || _a === void 0 ? void 0 : _a.pointerId)) {
4701
4697
  return;
4702
4698
  }
4703
4699
  this._handleEnd(e, false);
@@ -5037,7 +5033,9 @@ class PointerDragSource extends CompositeDisposable {
5037
5033
  ? initiationDelayOpt()
5038
5034
  : initiationDelayOpt)) !== null && _a !== void 0 ? _a : DEFAULT_TOUCH_INITIATION_DELAY;
5039
5035
  this._armed = !isTouch || initiationDelay <= 0;
5040
- if (isTouch && initiationDelay > 0 && isFinite(initiationDelay)) {
5036
+ if (isTouch &&
5037
+ initiationDelay > 0 &&
5038
+ Number.isFinite(initiationDelay)) {
5041
5039
  this._armTimer = setTimeout(() => {
5042
5040
  this._armTimer = undefined;
5043
5041
  this._armed = true;
@@ -5049,7 +5047,7 @@ class PointerDragSource extends CompositeDisposable {
5049
5047
  ? pressToleranceOpt()
5050
5048
  : pressToleranceOpt)) !== null && _c !== void 0 ? _c : DEFAULT_PRESS_TOLERANCE;
5051
5049
  // Source's owning window — popout drags fire on their own window.
5052
- const targetWindow = (_e = (_d = this.element.ownerDocument) === null || _d === void 0 ? void 0 : _d.defaultView) !== null && _e !== void 0 ? _e : window;
5050
+ const targetWindow = (_e = (_d = this.element.ownerDocument) === null || _d === void 0 ? void 0 : _d.defaultView) !== null && _e !== void 0 ? _e : globalThis.window;
5053
5051
  this._pendingMoveListener = addDisposableListener(targetWindow, 'pointermove', (moveEvent) => {
5054
5052
  if (moveEvent.pointerId !== this._pendingPointerId) {
5055
5053
  return;
@@ -5812,7 +5810,7 @@ class DraggablePaneviewPanel extends PaneviewPanel {
5812
5810
  }
5813
5811
  onDrop(event) {
5814
5812
  const data = getPaneData();
5815
- if (!data || data.viewId !== this.accessor.id) {
5813
+ if ((data === null || data === void 0 ? void 0 : data.viewId) !== this.accessor.id) {
5816
5814
  // if there is no local drag event for this panel
5817
5815
  // or if the drag event was creating by another Paneview instance
5818
5816
  this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, api: new PaneviewApi(this.accessor), getData: getPaneData }));
@@ -5885,7 +5883,7 @@ class ContentContainer extends CompositeDisposable {
5885
5883
  this.group.location.type !== 'floating') {
5886
5884
  return false;
5887
5885
  }
5888
- if (data && data.viewId === this.accessor.id) {
5886
+ if ((data === null || data === void 0 ? void 0 : data.viewId) === this.accessor.id) {
5889
5887
  return true;
5890
5888
  }
5891
5889
  return this.group.canDisplayOverlay(event, position, 'content');
@@ -5952,7 +5950,7 @@ class ContentContainer extends CompositeDisposable {
5952
5950
  /**
5953
5951
  * If the currently attached panel is mounted directly to the content then remove it
5954
5952
  */
5955
- this._element.removeChild(this.panel.view.content.element);
5953
+ this.panel.view.content.element.remove();
5956
5954
  (_b = (_a = this.panel.view.content).onHide) === null || _b === void 0 ? void 0 : _b.call(_a);
5957
5955
  }
5958
5956
  this.panel = panel;
@@ -5970,7 +5968,7 @@ class ContentContainer extends CompositeDisposable {
5970
5968
  break;
5971
5969
  case 'always':
5972
5970
  if (panel.view.content.element.parentElement === this._element) {
5973
- this._element.removeChild(panel.view.content.element);
5971
+ panel.view.content.element.remove();
5974
5972
  }
5975
5973
  container = this.group.renderContainer.attach({
5976
5974
  panel,
@@ -5998,11 +5996,11 @@ class ContentContainer extends CompositeDisposable {
5998
5996
  // noop
5999
5997
  }
6000
5998
  closePanel() {
6001
- var _a, _b, _c;
5999
+ var _a, _b;
6002
6000
  if (this.panel) {
6003
6001
  if (this.panel.api.renderer === 'onlyWhenVisible') {
6004
- (_a = this.panel.view.content.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.panel.view.content.element);
6005
- (_c = (_b = this.panel.view.content).onHide) === null || _c === void 0 ? void 0 : _c.call(_b);
6002
+ this.panel.view.content.element.remove();
6003
+ (_b = (_a = this.panel.view.content).onHide) === null || _b === void 0 ? void 0 : _b.call(_a);
6006
6004
  }
6007
6005
  }
6008
6006
  this.panel = undefined;
@@ -6056,7 +6054,7 @@ class LongPressDetector extends CompositeDisposable {
6056
6054
  const delay = (_b = this.options.delay) !== null && _b !== void 0 ? _b : DEFAULT_DELAY;
6057
6055
  const tolerance = (_c = this.options.tolerance) !== null && _c !== void 0 ? _c : DEFAULT_TOLERANCE;
6058
6056
  // Source's owning window — popout drags fire on their own window.
6059
- const targetWindow = (_e = (_d = this.element.ownerDocument) === null || _d === void 0 ? void 0 : _d.defaultView) !== null && _e !== void 0 ? _e : window;
6057
+ const targetWindow = (_e = (_d = this.element.ownerDocument) === null || _d === void 0 ? void 0 : _d.defaultView) !== null && _e !== void 0 ? _e : globalThis.window;
6060
6058
  this._timer = setTimeout(() => {
6061
6059
  this._timer = undefined;
6062
6060
  this._cancelPending();
@@ -6175,14 +6173,14 @@ function resolveDndCapabilities(options) {
6175
6173
  }
6176
6174
  }
6177
6175
  function isCoarsePrimaryInput$1() {
6178
- if (typeof window === 'undefined' || !window.matchMedia) {
6176
+ if (globalThis.window === undefined || !globalThis.matchMedia) {
6179
6177
  return false;
6180
6178
  }
6181
6179
  // Coarse pointer without any fine pointer = phone-class device. A laptop
6182
6180
  // touchscreen reports both, and we want HTML5 to remain available there
6183
6181
  // because a real mouse is also plugged in.
6184
- const coarse = window.matchMedia('(pointer: coarse)').matches;
6185
- const fine = window.matchMedia('(pointer: fine)').matches;
6182
+ const coarse = globalThis.matchMedia('(pointer: coarse)').matches;
6183
+ const fine = globalThis.matchMedia('(pointer: fine)').matches;
6186
6184
  return coarse && !fine;
6187
6185
  }
6188
6186
 
@@ -6236,7 +6234,7 @@ class Tab extends CompositeDisposable {
6236
6234
  return false;
6237
6235
  }
6238
6236
  const data = getPanelData();
6239
- if (data && this.accessor.id === data.viewId) {
6237
+ if (this.accessor.id === (data === null || data === void 0 ? void 0 : data.viewId)) {
6240
6238
  // Smooth-reorder takes over the in-flight visual when active,
6241
6239
  // so individual tab overlays are suppressed for internal drags.
6242
6240
  if (((_a = this.accessor.options.theme) === null || _a === void 0 ? void 0 : _a.tabAnimation) === 'smooth') {
@@ -6337,7 +6335,7 @@ class Tab extends CompositeDisposable {
6337
6335
  }
6338
6336
  setContent(part) {
6339
6337
  if (this.content) {
6340
- this._element.removeChild(this.content.element);
6338
+ this.content.element.remove();
6341
6339
  }
6342
6340
  this.content = part;
6343
6341
  this._element.appendChild(this.content.element);
@@ -6495,7 +6493,7 @@ class GroupDragSource extends CompositeDisposable {
6495
6493
  this.addDisposables(this._onDragStart);
6496
6494
  const buildMultiPanelsGhost = () => {
6497
6495
  const ghostEl = document.createElement('div');
6498
- const style = window.getComputedStyle(this._element);
6496
+ const style = globalThis.getComputedStyle(this._element);
6499
6497
  const bgColor = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-background-color');
6500
6498
  const color = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-color');
6501
6499
  ghostEl.style.backgroundColor = bgColor;
@@ -6677,7 +6675,7 @@ class VoidContainer extends CompositeDisposable {
6677
6675
  return false;
6678
6676
  }
6679
6677
  const data = getPanelData();
6680
- if (data && this.accessor.id === data.viewId) {
6678
+ if (this.accessor.id === (data === null || data === void 0 ? void 0 : data.viewId)) {
6681
6679
  return true;
6682
6680
  }
6683
6681
  return group.model.canDisplayOverlay(event, position, 'header_space');
@@ -6772,15 +6770,16 @@ class Scrollbar extends CompositeDisposable {
6772
6770
  this._scrollOffset = originalScrollOffset + delta / p;
6773
6771
  this.calculateScrollbarStyles();
6774
6772
  };
6773
+ const doc = this.element.ownerDocument;
6775
6774
  const onEnd = () => {
6776
6775
  toggleClass(this.element, 'dv-scrollable-scrolling', false);
6777
- document.removeEventListener('pointermove', onPointerMove);
6778
- document.removeEventListener('pointerup', onEnd);
6779
- document.removeEventListener('pointercancel', onEnd);
6776
+ doc.removeEventListener('pointermove', onPointerMove);
6777
+ doc.removeEventListener('pointerup', onEnd);
6778
+ doc.removeEventListener('pointercancel', onEnd);
6780
6779
  };
6781
- document.addEventListener('pointermove', onPointerMove);
6782
- document.addEventListener('pointerup', onEnd);
6783
- document.addEventListener('pointercancel', onEnd);
6780
+ doc.addEventListener('pointermove', onPointerMove);
6781
+ doc.addEventListener('pointerup', onEnd);
6782
+ doc.addEventListener('pointercancel', onEnd);
6784
6783
  }), addDisposableListener(this.element, 'scroll', () => {
6785
6784
  this.calculateScrollbarStyles();
6786
6785
  }), addDisposableListener(this.scrollableElement, 'scroll', () => {
@@ -6940,9 +6939,7 @@ let _fallbackPalette;
6940
6939
  * palette through.
6941
6940
  */
6942
6941
  function getFallbackPalette() {
6943
- if (!_fallbackPalette) {
6944
- _fallbackPalette = new TabGroupColorPalette(DEFAULT_TAB_GROUP_COLORS, true);
6945
- }
6942
+ _fallbackPalette !== null && _fallbackPalette !== void 0 ? _fallbackPalette : (_fallbackPalette = new TabGroupColorPalette(DEFAULT_TAB_GROUP_COLORS, true));
6946
6943
  return _fallbackPalette;
6947
6944
  }
6948
6945
  /**
@@ -7184,8 +7181,7 @@ class BaseTabGroupIndicator {
7184
7181
  const isAnimating = tg.collapsed ||
7185
7182
  tg.panelIds.some((pid) => {
7186
7183
  const te = tabMap.get(pid);
7187
- return (te &&
7188
- te.value.element.classList.contains('dv-tab--group-expanding'));
7184
+ return te === null || te === void 0 ? void 0 : te.value.element.classList.contains('dv-tab--group-expanding');
7189
7185
  });
7190
7186
  if (isAnimating && chipEl) {
7191
7187
  const chipRect = chipEl.getBoundingClientRect();
@@ -7282,7 +7278,10 @@ class WrapTabGroupIndicator extends BaseTabGroupIndicator {
7282
7278
  // Ensure SVG + path child exists (created once, reused)
7283
7279
  let svg = underline.firstElementChild;
7284
7280
  let path;
7285
- if (!svg || svg.tagName !== 'svg') {
7281
+ if ((svg === null || svg === void 0 ? void 0 : svg.tagName) === 'svg') {
7282
+ path = svg.firstElementChild;
7283
+ }
7284
+ else {
7286
7285
  underline.replaceChildren();
7287
7286
  svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
7288
7287
  svg.style.display = 'block';
@@ -7291,9 +7290,6 @@ class WrapTabGroupIndicator extends BaseTabGroupIndicator {
7291
7290
  svg.appendChild(path);
7292
7291
  underline.appendChild(svg);
7293
7292
  }
7294
- else {
7295
- path = svg.firstElementChild;
7296
- }
7297
7293
  path.setAttribute('stroke', color);
7298
7294
  path.setAttribute('stroke-width', String(t));
7299
7295
  if (!activeTabEntry) {
@@ -7430,6 +7426,7 @@ class TabGroupManager {
7430
7426
  * in the parent group model. Call after any tab group mutation.
7431
7427
  */
7432
7428
  update() {
7429
+ var _a;
7433
7430
  const model = this._ctx.group.model;
7434
7431
  const tabGroups = model.getTabGroups();
7435
7432
  // Track which group IDs are still active
@@ -7444,6 +7441,7 @@ class TabGroupManager {
7444
7441
  if (!activeGroupIds.has(groupId)) {
7445
7442
  entry.chip.element.remove();
7446
7443
  entry.chip.dispose();
7444
+ (_a = entry.dragSourcesDisposable) === null || _a === void 0 ? void 0 : _a.dispose();
7447
7445
  entry.disposable.dispose();
7448
7446
  this._chipRenderers.delete(groupId);
7449
7447
  }
@@ -7572,12 +7570,13 @@ class TabGroupManager {
7572
7570
  this._pendingTransitionCleanups.delete(panelId);
7573
7571
  }
7574
7572
  updateDragAndDropState() {
7573
+ var _a, _b, _c;
7575
7574
  const caps = resolveDndCapabilities(this._ctx.accessor.options);
7576
7575
  for (const entry of this._chipRenderers.values()) {
7577
7576
  entry.chip.element.draggable = caps.html5;
7578
- entry.html5DragSource.setDisabled(!caps.html5);
7579
- entry.pointerDragSource.setDisabled(!caps.pointer);
7580
- entry.pointerDragSource.setTouchOnly(!caps.pointerHandlesMouse);
7577
+ (_a = entry.html5DragSource) === null || _a === void 0 ? void 0 : _a.setDisabled(!caps.html5);
7578
+ (_b = entry.pointerDragSource) === null || _b === void 0 ? void 0 : _b.setDisabled(!caps.pointer);
7579
+ (_c = entry.pointerDragSource) === null || _c === void 0 ? void 0 : _c.setTouchOnly(!caps.pointerHandlesMouse);
7581
7580
  }
7582
7581
  }
7583
7582
  /**
@@ -7586,19 +7585,28 @@ class TabGroupManager {
7586
7585
  * iframe shield are released BEFORE the cross-group move detaches
7587
7586
  * the chip (chip dispose is scheduled on a microtask via
7588
7587
  * `_scheduleTabGroupUpdate`, which is too late for callers that read
7589
- * `getPanelData()` synchronously after the move). Idempotent — the
7590
- * subsequent `update()` will also dispose the sources.
7588
+ * `getPanelData()` synchronously after the move).
7589
+ *
7590
+ * A cross-group move dissolves the source chip entirely, but a
7591
+ * within-group reorder keeps the same chip element — so the sources are
7592
+ * cleared to `undefined` here and the subsequent `update()` re-arms them
7593
+ * via `_ensureChipForGroup`. Without that re-arm the chip would fire a
7594
+ * native `dragstart` (the element keeps `draggable=true`) but never set
7595
+ * a transfer payload, leaving the group permanently undraggable after
7596
+ * its first move. (#1410)
7591
7597
  */
7592
7598
  disposeChipDrag(tabGroupId) {
7593
- var _a, _b;
7599
+ var _a;
7594
7600
  const entry = this._chipRenderers.get(tabGroupId);
7595
7601
  if (!entry) {
7596
7602
  return;
7597
7603
  }
7598
7604
  // Optional-chained because tests may inject minimal entries
7599
7605
  // that skip the manager's normal `_ensureChipForGroup` flow.
7600
- (_a = entry.html5DragSource) === null || _a === void 0 ? void 0 : _a.dispose();
7601
- (_b = entry.pointerDragSource) === null || _b === void 0 ? void 0 : _b.dispose();
7606
+ (_a = entry.dragSourcesDisposable) === null || _a === void 0 ? void 0 : _a.dispose();
7607
+ entry.html5DragSource = undefined;
7608
+ entry.pointerDragSource = undefined;
7609
+ entry.dragSourcesDisposable = undefined;
7602
7610
  }
7603
7611
  /** Cloned chip rect used as the pointer follow-finger ghost. */
7604
7612
  _buildChipGhostElement(chipEl) {
@@ -7611,7 +7619,7 @@ class TabGroupManager {
7611
7619
  return clone;
7612
7620
  }
7613
7621
  disposeAll() {
7614
- var _a;
7622
+ var _a, _b;
7615
7623
  (_a = this._indicator) === null || _a === void 0 ? void 0 : _a.dispose();
7616
7624
  this._indicator = null;
7617
7625
  for (const [, cleanup] of this._pendingTransitionCleanups) {
@@ -7621,12 +7629,13 @@ class TabGroupManager {
7621
7629
  for (const [, entry] of this._chipRenderers) {
7622
7630
  entry.chip.element.remove();
7623
7631
  entry.chip.dispose();
7632
+ (_b = entry.dragSourcesDisposable) === null || _b === void 0 ? void 0 : _b.dispose();
7624
7633
  entry.disposable.dispose();
7625
7634
  }
7626
7635
  this._chipRenderers.clear();
7627
7636
  }
7628
7637
  _ensureIndicator() {
7629
- var _a, _b;
7638
+ var _a, _b, _c;
7630
7639
  const mode = (_b = (_a = this._ctx.accessor.options.theme) === null || _a === void 0 ? void 0 : _a.tabGroupIndicator) !== null && _b !== void 0 ? _b : 'wrap';
7631
7640
  const Ctor = mode === 'none' ? NoneTabGroupIndicator : WrapTabGroupIndicator;
7632
7641
  // Re-create if the indicator type changed (e.g. theme switch)
@@ -7634,28 +7643,24 @@ class TabGroupManager {
7634
7643
  this._indicator.dispose();
7635
7644
  this._indicator = null;
7636
7645
  }
7637
- if (!this._indicator) {
7638
- this._indicator = new Ctor({
7639
- tabsList: this._ctx.tabsList,
7640
- getTabGroups: () => this._ctx.group.model.getTabGroups(),
7641
- getActivePanelId: () => { var _a; return (_a = this._ctx.group.activePanel) === null || _a === void 0 ? void 0 : _a.id; },
7642
- getTabMap: () => this._ctx.getTabMap(),
7643
- getChipElement: (id) => { var _a; return (_a = this._chipRenderers.get(id)) === null || _a === void 0 ? void 0 : _a.chip.element; },
7644
- getDirection: () => this._ctx.getDirection(),
7645
- getHeaderPosition: () => this._ctx.group.model.headerPosition,
7646
- getColorPalette: () => this._ctx.accessor.tabGroupColorPalette,
7647
- });
7648
- }
7646
+ (_c = this._indicator) !== null && _c !== void 0 ? _c : (this._indicator = new Ctor({
7647
+ tabsList: this._ctx.tabsList,
7648
+ getTabGroups: () => this._ctx.group.model.getTabGroups(),
7649
+ getActivePanelId: () => { var _a; return (_a = this._ctx.group.activePanel) === null || _a === void 0 ? void 0 : _a.id; },
7650
+ getTabMap: () => this._ctx.getTabMap(),
7651
+ getChipElement: (id) => { var _a; return (_a = this._chipRenderers.get(id)) === null || _a === void 0 ? void 0 : _a.chip.element; },
7652
+ getDirection: () => this._ctx.getDirection(),
7653
+ getHeaderPosition: () => this._ctx.group.model.headerPosition,
7654
+ getColorPalette: () => this._ctx.accessor.tabGroupColorPalette,
7655
+ }));
7649
7656
  }
7650
- _ensureChipForGroup(tabGroup) {
7651
- if (this._chipRenderers.has(tabGroup.id)) {
7652
- return;
7653
- }
7654
- const createChip = this._ctx.accessor.options.createTabGroupChipComponent;
7655
- const chip = createChip
7656
- ? createChip(tabGroup)
7657
- : new TabGroupChip(this._ctx.accessor.tabGroupColorPalette);
7658
- chip.init({ tabGroup, api: this._ctx.accessor.api });
7657
+ /**
7658
+ * Create the HTML5 + pointer drag sources for a chip (and the direct
7659
+ * dragend listener that clears the transfer synchronously). Extracted so
7660
+ * both the initial chip build and the post-move re-arm in
7661
+ * `_ensureChipForGroup` share one wiring path. (#1410)
7662
+ */
7663
+ _createChipDragSources(chip, tabGroup) {
7659
7664
  const caps = resolveDndCapabilities(this._ctx.accessor.options);
7660
7665
  chip.element.draggable = caps.html5;
7661
7666
  const panelTransfer = LocalSelectionTransfer.getInstance();
@@ -7707,9 +7712,12 @@ class TabGroupManager {
7707
7712
  // the listener survives chip disposal in the detach-then-dragend
7708
7713
  // cross-group path; `once: true` auto-removes after the single
7709
7714
  // dragend that we care about. (#1254)
7710
- chip.element.addEventListener('dragend', () => {
7715
+ const onDragEndClear = () => {
7711
7716
  panelTransfer.clearData(PanelTransfer.prototype);
7712
- }, { once: true });
7717
+ };
7718
+ chip.element.addEventListener('dragend', onDragEndClear, {
7719
+ once: true,
7720
+ });
7713
7721
  const pointerDragSource = pointerBackend.createDragSource(chip.element, {
7714
7722
  getData,
7715
7723
  disabled: !caps.pointer,
@@ -7724,6 +7732,41 @@ class TabGroupManager {
7724
7732
  this._callbacks.onChipDragStart(tabGroup, chip, event);
7725
7733
  },
7726
7734
  });
7735
+ return {
7736
+ html5DragSource,
7737
+ pointerDragSource,
7738
+ disposable: {
7739
+ dispose: () => {
7740
+ html5DragSource.dispose();
7741
+ pointerDragSource.dispose();
7742
+ chip.element.removeEventListener('dragend', onDragEndClear);
7743
+ },
7744
+ },
7745
+ };
7746
+ }
7747
+ _ensureChipForGroup(tabGroup) {
7748
+ const existing = this._chipRenderers.get(tabGroup.id);
7749
+ if (existing) {
7750
+ // A committed group move tears down the chip's drag sources via
7751
+ // `disposeChipDrag`, but a within-group reorder keeps the same
7752
+ // chip element alive. Re-arm the sources so the group stays
7753
+ // draggable; without this the chip is stuck after its first
7754
+ // move — `dragstart` still fires (the element keeps
7755
+ // `draggable=true`) but no transfer payload is set. (#1410)
7756
+ if (!existing.html5DragSource) {
7757
+ const sources = this._createChipDragSources(existing.chip, tabGroup);
7758
+ existing.html5DragSource = sources.html5DragSource;
7759
+ existing.pointerDragSource = sources.pointerDragSource;
7760
+ existing.dragSourcesDisposable = sources.disposable;
7761
+ }
7762
+ return;
7763
+ }
7764
+ const createChip = this._ctx.accessor.options.createTabGroupChipComponent;
7765
+ const chip = createChip
7766
+ ? createChip(tabGroup)
7767
+ : new TabGroupChip(this._ctx.accessor.tabGroupColorPalette);
7768
+ chip.init({ tabGroup, api: this._ctx.accessor.api });
7769
+ const dragSources = this._createChipDragSources(chip, tabGroup);
7727
7770
  const disposables = [
7728
7771
  tabGroup.onDidChange(() => {
7729
7772
  var _a;
@@ -7737,17 +7780,19 @@ class TabGroupManager {
7737
7780
  tabGroup.onDidCollapseChange(() => {
7738
7781
  this._updateTabGroupClasses();
7739
7782
  }),
7740
- html5DragSource,
7741
- pointerDragSource,
7742
7783
  ];
7743
7784
  // Context menu: built-in TabGroupChip already aggregates right-click
7744
7785
  // + touch long-press into `onContextMenu`. Custom chip renderers
7745
7786
  // don't, so attach a long-press detector and contextmenu listener
7746
7787
  // directly on their element.
7747
7788
  const onContextMenu = (event) => {
7789
+ var _a, _b;
7748
7790
  // A long-press on a chip should preempt the in-flight pointer
7749
- // drag and open the menu instead.
7750
- pointerDragSource.cancelPending();
7791
+ // drag and open the menu instead. Resolve the source from the
7792
+ // entry so a post-move re-armed source is cancelled, not the
7793
+ // stale one captured at build time. (#1410)
7794
+ (_b = (_a = this._chipRenderers
7795
+ .get(tabGroup.id)) === null || _a === void 0 ? void 0 : _a.pointerDragSource) === null || _b === void 0 ? void 0 : _b.cancelPending();
7751
7796
  this._callbacks.onChipContextMenu(tabGroup, event);
7752
7797
  };
7753
7798
  if (chip instanceof TabGroupChip) {
@@ -7780,7 +7825,7 @@ class TabGroupManager {
7780
7825
  return false;
7781
7826
  }
7782
7827
  const data = getPanelData();
7783
- if (data && this._ctx.accessor.id === data.viewId) {
7828
+ if (this._ctx.accessor.id === (data === null || data === void 0 ? void 0 : data.viewId)) {
7784
7829
  if (((_a = this._ctx.accessor.options.theme) === null || _a === void 0 ? void 0 : _a.tabAnimation) ===
7785
7830
  'smooth') {
7786
7831
  return false;
@@ -7796,8 +7841,9 @@ class TabGroupManager {
7796
7841
  const disposable = new CompositeDisposable(...disposables);
7797
7842
  this._chipRenderers.set(tabGroup.id, {
7798
7843
  chip,
7799
- html5DragSource,
7800
- pointerDragSource,
7844
+ html5DragSource: dragSources.html5DragSource,
7845
+ pointerDragSource: dragSources.pointerDragSource,
7846
+ dragSourcesDisposable: dragSources.disposable,
7801
7847
  disposable,
7802
7848
  dropTarget,
7803
7849
  });
@@ -8401,12 +8447,10 @@ class Tabs extends CompositeDisposable {
8401
8447
  parentElement.scrollTop = running;
8402
8448
  }
8403
8449
  }
8404
- else {
8405
- if (running < parentElement.scrollLeft ||
8406
- running + element.clientWidth >
8407
- parentElement.scrollLeft + parentElement.clientWidth) {
8408
- parentElement.scrollLeft = running;
8409
- }
8450
+ else if (running < parentElement.scrollLeft ||
8451
+ running + element.clientWidth >
8452
+ parentElement.scrollLeft + parentElement.clientWidth) {
8453
+ parentElement.scrollLeft = running;
8410
8454
  }
8411
8455
  }
8412
8456
  running += isVertical
@@ -8518,15 +8562,13 @@ class Tabs extends CompositeDisposable {
8518
8562
  });
8519
8563
  return;
8520
8564
  }
8521
- switch (event.button) {
8522
- case 0:
8523
- if (this.group.api.location.type === 'edge') ;
8524
- else {
8525
- if (this.group.activePanel !== panel) {
8526
- this.group.model.openPanel(panel);
8527
- }
8528
- }
8529
- break;
8565
+ // Edge groups are skipped here: all their tab interaction
8566
+ // is handled by onTabClick to avoid race conditions with
8567
+ // active panel state.
8568
+ if (event.button === 0 &&
8569
+ this.group.api.location.type !== 'edge' &&
8570
+ this.group.activePanel !== panel) {
8571
+ this.group.model.openPanel(panel);
8530
8572
  }
8531
8573
  }), tab.onDrop((event) => {
8532
8574
  var _a, _b, _c, _d;
@@ -8549,12 +8591,12 @@ class Tabs extends CompositeDisposable {
8549
8591
  targetTabGroupId: animState.targetTabGroupId,
8550
8592
  });
8551
8593
  if (((_b = this.accessor.options.theme) === null || _b === void 0 ? void 0 : _b.tabAnimation) === 'smooth') {
8552
- this.runFlipAnimation(firstPositions, animState.sourceTabId, animState.sourceIndex === -1, animState.sourceIndex !== -1
8553
- ? {
8594
+ this.runFlipAnimation(firstPositions, animState.sourceTabId, animState.sourceIndex === -1, animState.sourceIndex === -1
8595
+ ? undefined
8596
+ : {
8554
8597
  from: Math.min(animState.sourceIndex, dropIndex),
8555
8598
  to: Math.max(animState.sourceIndex, dropIndex),
8556
- }
8557
- : undefined);
8599
+ });
8558
8600
  }
8559
8601
  }
8560
8602
  else {
@@ -8804,7 +8846,7 @@ class Tabs extends CompositeDisposable {
8804
8846
  return;
8805
8847
  }
8806
8848
  const data = getPanelData();
8807
- const sourceIndex = data && data.groupId === this.group.id && data.panelId
8849
+ const sourceIndex = (data === null || data === void 0 ? void 0 : data.groupId) === this.group.id && (data === null || data === void 0 ? void 0 : data.panelId)
8808
8850
  ? this._tabs.findIndex((x) => x.value.panel.id === data.panelId)
8809
8851
  : -1;
8810
8852
  const adjustedIndex = insertionIndex -
@@ -10162,9 +10204,9 @@ class TabGroup extends CompositeDisposable {
10162
10204
  if (this._panelIds.includes(panelId)) {
10163
10205
  return;
10164
10206
  }
10165
- const insertIndex = index !== undefined
10166
- ? Math.max(0, Math.min(index, this._panelIds.length))
10167
- : this._panelIds.length;
10207
+ const insertIndex = index === undefined
10208
+ ? this._panelIds.length
10209
+ : Math.max(0, Math.min(index, this._panelIds.length));
10168
10210
  this._panelIds.splice(insertIndex, 0, panelId);
10169
10211
  this._onDidPanelChange.fire({ panelId, type: 'add' });
10170
10212
  }
@@ -10612,7 +10654,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10612
10654
  }
10613
10655
  // Remove from any existing group first
10614
10656
  const existingGroup = this.getTabGroupForPanel(panelId);
10615
- if (existingGroup && existingGroup.id === tabGroupId) {
10657
+ if ((existingGroup === null || existingGroup === void 0 ? void 0 : existingGroup.id) === tabGroupId) {
10616
10658
  return; // already in this group — no mutation
10617
10659
  }
10618
10660
  this._bracketTabGroupMutation(() => {
@@ -10633,7 +10675,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10633
10675
  */
10634
10676
  movePanelWithinGroup(tabGroupId, panelId, newIndex) {
10635
10677
  const tabGroup = this._tabGroupMap.get(tabGroupId);
10636
- if (!tabGroup || !tabGroup.containsPanel(panelId)) {
10678
+ if (!(tabGroup === null || tabGroup === void 0 ? void 0 : tabGroup.containsPanel(panelId))) {
10637
10679
  return;
10638
10680
  }
10639
10681
  // Remove and re-add at new index within the group
@@ -10846,7 +10888,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10846
10888
  for (let i = activePanelIndex + 1; i < this._panels.length; i++) {
10847
10889
  const candidate = this._panels[i];
10848
10890
  const candidateGroup = this._findTabGroupForPanel(candidate.id);
10849
- if (!candidateGroup || !candidateGroup.collapsed) {
10891
+ if (!(candidateGroup === null || candidateGroup === void 0 ? void 0 : candidateGroup.collapsed)) {
10850
10892
  this.doSetActivePanel(candidate);
10851
10893
  this.updateContainer();
10852
10894
  return;
@@ -10855,7 +10897,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10855
10897
  for (let i = activePanelIndex - 1; i >= 0; i--) {
10856
10898
  const candidate = this._panels[i];
10857
10899
  const candidateGroup = this._findTabGroupForPanel(candidate.id);
10858
- if (!candidateGroup || !candidateGroup.collapsed) {
10900
+ if (!(candidateGroup === null || candidateGroup === void 0 ? void 0 : candidateGroup.collapsed)) {
10859
10901
  this.doSetActivePanel(candidate);
10860
10902
  this.updateContainer();
10861
10903
  return;
@@ -10885,9 +10927,9 @@ class DockviewGroupPanelModel extends CompositeDisposable {
10885
10927
  restoreTabGroups(serializedGroups) {
10886
10928
  // Bump counter past any restored numeric suffixes to avoid ID collisions
10887
10929
  for (const data of serializedGroups) {
10888
- const match = data.id.match(/-(\d+)$/);
10930
+ const match = /-(\d+)$/.exec(data.id);
10889
10931
  if (match) {
10890
- const num = parseInt(match[1], 10) + 1;
10932
+ const num = Number.parseInt(match[1], 10) + 1;
10891
10933
  if (num > this._tabGroupIdCounter) {
10892
10934
  this._tabGroupIdCounter = num;
10893
10935
  }
@@ -11004,32 +11046,26 @@ class DockviewGroupPanelModel extends CompositeDisposable {
11004
11046
  return result;
11005
11047
  }
11006
11048
  moveToNext(options) {
11007
- if (!options) {
11008
- options = {};
11009
- }
11010
- if (!options.panel) {
11011
- options.panel = this.activePanel;
11012
- }
11049
+ var _a;
11050
+ options !== null && options !== void 0 ? options : (options = {});
11051
+ (_a = options.panel) !== null && _a !== void 0 ? _a : (options.panel = this.activePanel);
11013
11052
  const index = options.panel ? this.panels.indexOf(options.panel) : -1;
11014
11053
  let normalizedIndex;
11015
11054
  if (index < this.panels.length - 1) {
11016
11055
  normalizedIndex = index + 1;
11017
11056
  }
11018
- else if (!options.suppressRoll) {
11019
- normalizedIndex = 0;
11057
+ else if (options.suppressRoll) {
11058
+ return;
11020
11059
  }
11021
11060
  else {
11022
- return;
11061
+ normalizedIndex = 0;
11023
11062
  }
11024
11063
  this.openPanel(this.panels[normalizedIndex]);
11025
11064
  }
11026
11065
  moveToPrevious(options) {
11027
- if (!options) {
11028
- options = {};
11029
- }
11030
- if (!options.panel) {
11031
- options.panel = this.activePanel;
11032
- }
11066
+ var _a;
11067
+ options !== null && options !== void 0 ? options : (options = {});
11068
+ (_a = options.panel) !== null && _a !== void 0 ? _a : (options.panel = this.activePanel);
11033
11069
  if (!options.panel) {
11034
11070
  return;
11035
11071
  }
@@ -11038,11 +11074,11 @@ class DockviewGroupPanelModel extends CompositeDisposable {
11038
11074
  if (index > 0) {
11039
11075
  normalizedIndex = index - 1;
11040
11076
  }
11041
- else if (!options.suppressRoll) {
11042
- normalizedIndex = this.panels.length - 1;
11077
+ else if (options.suppressRoll) {
11078
+ return;
11043
11079
  }
11044
11080
  else {
11045
- return;
11081
+ normalizedIndex = this.panels.length - 1;
11046
11082
  }
11047
11083
  this.openPanel(this.panels[normalizedIndex]);
11048
11084
  }
@@ -11142,7 +11178,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
11142
11178
  if (!this._activePanel && this.panels.length > 0) {
11143
11179
  const candidate = this._panels.find((p) => {
11144
11180
  const tg = this._findTabGroupForPanel(p.id);
11145
- return !tg || !tg.collapsed;
11181
+ return !(tg === null || tg === void 0 ? void 0 : tg.collapsed);
11146
11182
  });
11147
11183
  if (candidate) {
11148
11184
  this.doSetActivePanel(candidate);
@@ -11681,7 +11717,7 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
11681
11717
  getWindow() {
11682
11718
  return this.location.type === 'popout'
11683
11719
  ? this.location.getWindow()
11684
- : window;
11720
+ : globalThis.window;
11685
11721
  }
11686
11722
  setHeaderPosition(position) {
11687
11723
  if (!this._group) {
@@ -12264,9 +12300,8 @@ class DockviewPanel extends CompositeDisposable {
12264
12300
  }
12265
12301
  }
12266
12302
  update(event) {
12267
- var _a;
12268
12303
  // merge the new parameters with the existing parameters
12269
- this._params = Object.assign(Object.assign({}, ((_a = this._params) !== null && _a !== void 0 ? _a : {})), event.params);
12304
+ this._params = Object.assign(Object.assign({}, this._params), event.params);
12270
12305
  /**
12271
12306
  * delete new keys that have a value of undefined,
12272
12307
  * allow values of null
@@ -12663,19 +12698,19 @@ class Overlay extends CompositeDisposable {
12663
12698
  const element = this._element.getBoundingClientRect();
12664
12699
  const result = {};
12665
12700
  if (this.verticalAlignment === 'top') {
12666
- result.top = parseFloat(this._element.style.top);
12701
+ result.top = Number.parseFloat(this._element.style.top);
12667
12702
  }
12668
12703
  else if (this.verticalAlignment === 'bottom') {
12669
- result.bottom = parseFloat(this._element.style.bottom);
12704
+ result.bottom = Number.parseFloat(this._element.style.bottom);
12670
12705
  }
12671
12706
  else {
12672
12707
  result.top = element.top - container.top;
12673
12708
  }
12674
12709
  if (this.horiziontalAlignment === 'left') {
12675
- result.left = parseFloat(this._element.style.left);
12710
+ result.left = Number.parseFloat(this._element.style.left);
12676
12711
  }
12677
12712
  else if (this.horiziontalAlignment === 'right') {
12678
- result.right = parseFloat(this._element.style.right);
12713
+ result.right = Number.parseFloat(this._element.style.right);
12679
12714
  }
12680
12715
  else {
12681
12716
  result.left = element.left - container.left;
@@ -12739,7 +12774,7 @@ class Overlay extends CompositeDisposable {
12739
12774
  }
12740
12775
  }
12741
12776
  },
12742
- }, addDisposableListener(window, 'pointermove', (e) => {
12777
+ }, addDisposableListener(globalThis.window, 'pointermove', (e) => {
12743
12778
  if (this._dragCancelled) {
12744
12779
  return;
12745
12780
  }
@@ -12748,12 +12783,10 @@ class Overlay extends CompositeDisposable {
12748
12783
  const y = e.clientY - containerRect.top;
12749
12784
  toggleClass(this._element, 'dv-resize-container-dragging', true);
12750
12785
  const overlayRect = this._element.getBoundingClientRect();
12751
- if (offset === null) {
12752
- offset = {
12753
- x: e.clientX - overlayRect.left,
12754
- y: e.clientY - overlayRect.top,
12755
- };
12756
- }
12786
+ offset !== null && offset !== void 0 ? offset : (offset = {
12787
+ x: e.clientX - overlayRect.left,
12788
+ y: e.clientY - overlayRect.top,
12789
+ });
12757
12790
  const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
12758
12791
  const yOffset = Math.max(0, this.getMinimumHeight(overlayRect.height));
12759
12792
  let proposedTop = y - offset.y;
@@ -12805,7 +12838,7 @@ class Overlay extends CompositeDisposable {
12805
12838
  hasMoved = true;
12806
12839
  this._onDidStartMoving.fire();
12807
12840
  }
12808
- }), addDisposableListener(window, 'pointerup', end), addDisposableListener(window, 'pointercancel', end));
12841
+ }), addDisposableListener(globalThis.window, 'pointerup', end), addDisposableListener(globalThis.window, 'pointercancel', end));
12809
12842
  };
12810
12843
  this.addDisposables(addDisposableListener(dragTarget, 'pointerdown', (event) => {
12811
12844
  if (event.defaultPrevented) {
@@ -12859,20 +12892,18 @@ class Overlay extends CompositeDisposable {
12859
12892
  move.dispose();
12860
12893
  this._onDidChangeEnd.fire();
12861
12894
  };
12862
- move.value = new CompositeDisposable(addDisposableListener(window, 'pointermove', (e) => {
12895
+ move.value = new CompositeDisposable(addDisposableListener(globalThis.window, 'pointermove', (e) => {
12863
12896
  const containerRect = this.options.container.getBoundingClientRect();
12864
12897
  const overlayRect = this._element.getBoundingClientRect();
12865
12898
  const y = e.clientY - containerRect.top;
12866
12899
  const x = e.clientX - containerRect.left;
12867
- if (startPosition === null) {
12868
- // record the initial dimensions since as all subsequence moves are relative to this
12869
- startPosition = {
12870
- originalY: y,
12871
- originalHeight: overlayRect.height,
12872
- originalX: x,
12873
- originalWidth: overlayRect.width,
12874
- };
12875
- }
12900
+ // record the initial dimensions since as all subsequence moves are relative to this
12901
+ startPosition !== null && startPosition !== void 0 ? startPosition : (startPosition = {
12902
+ originalY: y,
12903
+ originalHeight: overlayRect.height,
12904
+ originalX: x,
12905
+ originalWidth: overlayRect.width,
12906
+ });
12876
12907
  let top = undefined;
12877
12908
  let bottom = undefined;
12878
12909
  let height = undefined;
@@ -12887,7 +12918,8 @@ class Overlay extends CompositeDisposable {
12887
12918
  ? Math.max(0, containerRect.height -
12888
12919
  Overlay.MINIMUM_HEIGHT)
12889
12920
  : Math.max(0, startPosition.originalY +
12890
- startPosition.originalHeight -
12921
+ startPosition
12922
+ .originalHeight -
12891
12923
  Overlay.MINIMUM_HEIGHT);
12892
12924
  top = clamp(y, 0, maxTop);
12893
12925
  height =
@@ -12902,8 +12934,8 @@ class Overlay extends CompositeDisposable {
12902
12934
  startPosition.originalHeight;
12903
12935
  // When dragging bottom handle, constrain height to container height
12904
12936
  const minHeight = top < 0 &&
12905
- typeof this.options.minimumInViewportHeight ===
12906
- 'number'
12937
+ typeof this.options
12938
+ .minimumInViewportHeight === 'number'
12907
12939
  ? -top +
12908
12940
  this.options.minimumInViewportHeight
12909
12941
  : Overlay.MINIMUM_HEIGHT;
@@ -12933,8 +12965,8 @@ class Overlay extends CompositeDisposable {
12933
12965
  startPosition.originalWidth;
12934
12966
  // When dragging right handle, constrain width to container width
12935
12967
  const minWidth = left < 0 &&
12936
- typeof this.options.minimumInViewportWidth ===
12937
- 'number'
12968
+ typeof this.options
12969
+ .minimumInViewportWidth === 'number'
12938
12970
  ? -left +
12939
12971
  this.options.minimumInViewportWidth
12940
12972
  : Overlay.MINIMUM_WIDTH;
@@ -13003,7 +13035,7 @@ class Overlay extends CompositeDisposable {
13003
13035
  }
13004
13036
  }
13005
13037
  },
13006
- }, addDisposableListener(window, 'pointerup', end), addDisposableListener(window, 'pointercancel', end));
13038
+ }, addDisposableListener(globalThis.window, 'pointerup', end), addDisposableListener(globalThis.window, 'pointercancel', end));
13007
13039
  }));
13008
13040
  }
13009
13041
  getMinimumWidth(width) {
@@ -14117,7 +14149,7 @@ class PositionCache {
14117
14149
  }
14118
14150
  getPosition(element) {
14119
14151
  const cached = this.cache.get(element);
14120
- if (cached && cached.frameId === this.currentFrameId) {
14152
+ if ((cached === null || cached === void 0 ? void 0 : cached.frameId) === this.currentFrameId) {
14121
14153
  return cached.rect;
14122
14154
  }
14123
14155
  this.scheduleFrameUpdate();
@@ -14329,11 +14361,10 @@ class OverlayRenderContainer extends CompositeDisposable {
14329
14361
  correctLayerPosition();
14330
14362
  }));
14331
14363
  this.map[panel.api.id].destroy = exports.DockviewDisposable.from(() => {
14332
- var _a;
14333
14364
  if (contentElement.parentElement === focusContainer) {
14334
- focusContainer.removeChild(contentElement);
14365
+ contentElement.remove();
14335
14366
  }
14336
- (_a = focusContainer.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(focusContainer);
14367
+ focusContainer.remove();
14337
14368
  });
14338
14369
  correctLayerPosition();
14339
14370
  queueMicrotask(() => {
@@ -14398,13 +14429,13 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
14398
14429
  function assertSameOriginPopoutUrl(url) {
14399
14430
  let resolved;
14400
14431
  try {
14401
- resolved = new URL(url, window.location.href);
14432
+ resolved = new URL(url, globalThis.location.href);
14402
14433
  }
14403
14434
  catch (_a) {
14404
14435
  throw new Error(`dockview: invalid popout URL: ${url}`);
14405
14436
  }
14406
14437
  const protocolOk = resolved.protocol === 'http:' || resolved.protocol === 'https:';
14407
- if (!protocolOk || resolved.origin !== window.location.origin) {
14438
+ if (!protocolOk || resolved.origin !== globalThis.location.origin) {
14408
14439
  throw new Error(`dockview: popout URL must be same-origin http(s); got: ${url}`);
14409
14440
  }
14410
14441
  }
@@ -14482,7 +14513,7 @@ class PopoutWindow extends CompositeDisposable {
14482
14513
  this._window = { value: externalWindow, disposable };
14483
14514
  disposable.addDisposables(exports.DockviewDisposable.from(() => {
14484
14515
  externalWindow.close();
14485
- }), addDisposableListener(window, 'beforeunload', () => {
14516
+ }), addDisposableListener(globalThis.window, 'beforeunload', () => {
14486
14517
  /**
14487
14518
  * before the main window closes we should close this popup too
14488
14519
  * to be good citizens
@@ -14512,7 +14543,7 @@ class PopoutWindow extends CompositeDisposable {
14512
14543
  const externalDocument = externalWindow.document;
14513
14544
  externalDocument.title = document.title;
14514
14545
  externalDocument.body.appendChild(container);
14515
- addStyles(externalDocument, window.document.styleSheets, {
14546
+ addStyles(externalDocument, globalThis.document.styleSheets, {
14516
14547
  nonce: this.options.nonce,
14517
14548
  });
14518
14549
  /**
@@ -14565,11 +14596,11 @@ class StrictEventsSequencing extends CompositeDisposable {
14565
14596
  panels.add(panel.api.id);
14566
14597
  }
14567
14598
  }), this.accessor.onDidRemovePanel((panel) => {
14568
- if (!panels.has(panel.api.id)) {
14569
- throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${panel.api.id} but panel does not exists`);
14599
+ if (panels.has(panel.api.id)) {
14600
+ panels.delete(panel.api.id);
14570
14601
  }
14571
14602
  else {
14572
- panels.delete(panel.api.id);
14603
+ throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${panel.api.id} but panel does not exists`);
14573
14604
  }
14574
14605
  }), this.accessor.onDidAddGroup((group) => {
14575
14606
  if (groups.has(group.api.id)) {
@@ -14579,11 +14610,11 @@ class StrictEventsSequencing extends CompositeDisposable {
14579
14610
  groups.add(group.api.id);
14580
14611
  }
14581
14612
  }), this.accessor.onDidRemoveGroup((group) => {
14582
- if (!groups.has(group.api.id)) {
14583
- throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${group.api.id} but group does not exists`);
14613
+ if (groups.has(group.api.id)) {
14614
+ groups.delete(group.api.id);
14584
14615
  }
14585
14616
  else {
14586
- groups.delete(group.api.id);
14617
+ throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${group.api.id} but group does not exists`);
14587
14618
  }
14588
14619
  }));
14589
14620
  }
@@ -14598,7 +14629,7 @@ function isCoarsePrimaryInput(win) {
14598
14629
  return coarse && !fine;
14599
14630
  }
14600
14631
  class PopupService extends CompositeDisposable {
14601
- constructor(root, win = window) {
14632
+ constructor(root, win = globalThis.window) {
14602
14633
  super();
14603
14634
  this._active = null;
14604
14635
  this._activeDisposable = new MutableDisposable();
@@ -14715,9 +14746,8 @@ class DropTargetAnchorContainer extends CompositeDisposable {
14715
14746
  }
14716
14747
  return {
14717
14748
  clear: () => {
14718
- var _a;
14719
14749
  if (this._model) {
14720
- (_a = this._model.root.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this._model.root);
14750
+ this._model.root.remove();
14721
14751
  }
14722
14752
  this._model = undefined;
14723
14753
  },
@@ -14770,16 +14800,30 @@ class DropTargetAnchorContainer extends CompositeDisposable {
14770
14800
  }
14771
14801
 
14772
14802
  class EdgeGroupView {
14803
+ /**
14804
+ * The effective (pre-gap) collapsed size: the measured tab-strip size when
14805
+ * available, otherwise the configured/theme base.
14806
+ */
14807
+ get _effectiveBaseCollapsed() {
14808
+ var _a;
14809
+ return (_a = this._measuredTabSize) !== null && _a !== void 0 ? _a : this._baseCollapsedSize;
14810
+ }
14773
14811
  get minimumSize() {
14774
14812
  // When collapsed, lock size to collapsedSize so sash can't drag it open
14775
- return this._isCollapsed
14776
- ? this._collapsedSize
14777
- : this._expandedMinimumSize;
14813
+ if (this._isCollapsed) {
14814
+ return this.collapsedSize;
14815
+ }
14816
+ // If the caller explicitly provides a minimumSize, respect it.
14817
+ // Otherwise fall back to collapsedSize + 50 so the expanded state is
14818
+ // visually distinguishable from the collapsed state.
14819
+ return this._baseMinimumSize !== undefined
14820
+ ? this._baseMinimumSize + this._gapAdd
14821
+ : this._effectiveBaseCollapsed + 50 + this._gapAdd;
14778
14822
  }
14779
14823
  get maximumSize() {
14780
14824
  // When collapsed, lock size to collapsedSize so sash can't drag it open
14781
14825
  return this._isCollapsed
14782
- ? this._collapsedSize
14826
+ ? this.collapsedSize
14783
14827
  : this._expandedMaximumSize;
14784
14828
  }
14785
14829
  get element() {
@@ -14792,34 +14836,62 @@ class EdgeGroupView {
14792
14836
  return this._lastExpandedSize;
14793
14837
  }
14794
14838
  get collapsedSize() {
14795
- return this._collapsedSize;
14839
+ return this._effectiveBaseCollapsed + this._gapAdd;
14796
14840
  }
14797
- constructor(options, group, orientation) {
14841
+ constructor(options, group, orientation, gapAdd = 0) {
14798
14842
  var _a, _b, _c;
14799
14843
  this._onDidChange = new Emitter();
14800
14844
  this.onDidChange = this._onDidChange.event;
14801
14845
  this.snap = false;
14802
14846
  this.priority = exports.LayoutPriority.Low;
14803
14847
  this._isCollapsed = false;
14848
+ this._tabSizeDisposables = new CompositeDisposable();
14804
14849
  this._group = group;
14805
14850
  this._orientation = orientation;
14806
14851
  group.element.classList.add('dv-edge-group');
14807
14852
  group.element.dataset.testid = `dv-edge-group-${options.id}`;
14808
- this._collapsedSize = (_a = options.collapsedSize) !== null && _a !== void 0 ? _a : 35;
14853
+ this._baseCollapsedSize = (_a = options.collapsedSize) !== null && _a !== void 0 ? _a : 35;
14854
+ this._baseMinimumSize = options.minimumSize;
14855
+ this._gapAdd = gapAdd;
14809
14856
  this._expandedMaximumSize =
14810
14857
  (_b = options.maximumSize) !== null && _b !== void 0 ? _b : Number.POSITIVE_INFINITY;
14811
- // If the caller explicitly provides a minimumSize, respect it.
14812
- // Otherwise fall back to collapsedSize + 50 so the expanded state is
14813
- // visually distinguishable from the collapsed state.
14814
- this._expandedMinimumSize =
14815
- options.minimumSize !== undefined
14816
- ? options.minimumSize
14817
- : this._collapsedSize + 50;
14818
14858
  this._lastExpandedSize = (_c = options.initialSize) !== null && _c !== void 0 ? _c : 200;
14819
14859
  if (options.collapsed) {
14820
14860
  this._isCollapsed = true;
14821
14861
  group.element.classList.add('dv-edge-collapsed');
14822
14862
  }
14863
+ this._observeTabStrip();
14864
+ }
14865
+ /**
14866
+ * Watch the group's tab strip so the collapsed size follows the live tab
14867
+ * height. The strip's cross-axis size (height for top/bottom, width for
14868
+ * left/right) is exactly what a collapsed edge group should occupy; a
14869
+ * ResizeObserver keeps them in sync when the tab height changes at runtime.
14870
+ */
14871
+ _observeTabStrip() {
14872
+ const strip = this._group.element.querySelector('.dv-tabs-and-actions-container');
14873
+ if (!strip) {
14874
+ return;
14875
+ }
14876
+ this._tabSizeDisposables.addDisposables(watchElementResize(strip, () => {
14877
+ this._applyMeasuredTabSize(this._orientation === 'vertical'
14878
+ ? strip.offsetHeight
14879
+ : strip.offsetWidth);
14880
+ }));
14881
+ }
14882
+ /**
14883
+ * Apply a freshly-measured tab-strip cross size. When the group is
14884
+ * collapsed this resizes it in the parent splitview so the collapsed strip
14885
+ * always shows the full tab height.
14886
+ */
14887
+ _applyMeasuredTabSize(size) {
14888
+ if (size <= 0 || size === this._measuredTabSize) {
14889
+ return;
14890
+ }
14891
+ this._measuredTabSize = size;
14892
+ if (this._isCollapsed) {
14893
+ this._onDidChange.fire({ size: this.collapsedSize });
14894
+ }
14823
14895
  }
14824
14896
  layout(size, orthogonalSize) {
14825
14897
  // Track the last expanded size so we can restore it after collapsing
@@ -14855,15 +14927,18 @@ class EdgeGroupView {
14855
14927
  this._lastExpandedSize = size;
14856
14928
  }
14857
14929
  /**
14858
- * Apply new effective collapsed and expanded-minimum sizes after a theme
14859
- * or gap change. The caller (ShellManager) is responsible for computing
14860
- * the correct values from the original config and the new gap.
14930
+ * Apply a new base (pre-gap) collapsed size, base minimum size and gap
14931
+ * contribution after a theme or gap change. Base values come from the
14932
+ * original config; the ShellManager owns the gap arithmetic. A live
14933
+ * measured tab size (if any) continues to win over the base collapsed size.
14861
14934
  */
14862
- updateCollapsedSize(newCollapsedSize, newExpandedMinimumSize) {
14863
- this._collapsedSize = newCollapsedSize;
14864
- this._expandedMinimumSize = newExpandedMinimumSize;
14935
+ updateSizing(baseCollapsedSize, baseMinimumSize, gapAdd) {
14936
+ this._baseCollapsedSize = baseCollapsedSize;
14937
+ this._baseMinimumSize = baseMinimumSize;
14938
+ this._gapAdd = gapAdd;
14865
14939
  }
14866
14940
  dispose() {
14941
+ this._tabSizeDisposables.dispose();
14867
14942
  this._onDidChange.dispose();
14868
14943
  }
14869
14944
  }
@@ -14995,15 +15070,6 @@ class MiddleColumnView {
14995
15070
  this._splitview.dispose();
14996
15071
  }
14997
15072
  }
14998
- function adjustedOpts(base, defaultCollapsed, gapAdd) {
14999
- var _a;
15000
- const effectiveCollapsed = ((_a = base.collapsedSize) !== null && _a !== void 0 ? _a : defaultCollapsed) + gapAdd;
15001
- const result = Object.assign(Object.assign({}, base), { collapsedSize: effectiveCollapsed });
15002
- if (base.minimumSize !== undefined) {
15003
- result.minimumSize = base.minimumSize + gapAdd;
15004
- }
15005
- return result;
15006
- }
15007
15073
  class ShellManager {
15008
15074
  constructor(container, dockviewElement, layoutGrid, gap = 0, defaultCollapsedSize = 35) {
15009
15075
  this._disposables = new CompositeDisposable();
@@ -15029,6 +15095,26 @@ class ShellManager {
15029
15095
  this._middleIndex = 0;
15030
15096
  this._outerSplitview.addView(this._middleColumn, { type: 'distribute' }, 0);
15031
15097
  this._disposables.addDisposables(watchElementResize(this._shellElement, (entry) => {
15098
+ /**
15099
+ * When the shell (or an ancestor) becomes hidden — e.g. a
15100
+ * nested dockview whose `onlyWhenVisible` host panel is
15101
+ * deactivated — the element collapses to (0, 0) or is detached
15102
+ * from the DOM. Propagating that zero size would relayout the
15103
+ * edge-group splitview at 0, clamping the low-priority edge
15104
+ * groups down to their minimum size and destroying the user's
15105
+ * sizing. Skip these cases so sizes are preserved while hidden;
15106
+ * mirrors the guard in the `Resizable` base class. See #1495.
15107
+ *
15108
+ * offsetParent === null is equivalent to display: none on the
15109
+ * element or one of its ancestors.
15110
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
15111
+ */
15112
+ if (!this._shellElement.offsetParent) {
15113
+ return;
15114
+ }
15115
+ if (!isInDocument(this._shellElement)) {
15116
+ return;
15117
+ }
15032
15118
  const width = Math.round(entry.contentRect.width);
15033
15119
  const height = Math.round(entry.contentRect.height);
15034
15120
  if (width === this._currentWidth &&
@@ -15065,7 +15151,7 @@ class ShellManager {
15065
15151
  const isHorizontal = position === 'left' || position === 'right';
15066
15152
  const gapAdd = isHorizontal ? outerGapAdd : innerGapAdd;
15067
15153
  const orientation = isHorizontal ? 'horizontal' : 'vertical';
15068
- const view = new EdgeGroupView(adjustedOpts(Object.assign({ collapsedSize: this._defaultCollapsedSize }, options), this._defaultCollapsedSize, gapAdd), group, orientation);
15154
+ const view = new EdgeGroupView(Object.assign({ collapsedSize: this._defaultCollapsedSize }, options), group, orientation, gapAdd);
15069
15155
  const initialSize = view.isCollapsed
15070
15156
  ? view.collapsedSize
15071
15157
  : view.lastExpandedSize;
@@ -15132,10 +15218,7 @@ class ShellManager {
15132
15218
  const updateView = (view, baseCfg, gapAdd) => {
15133
15219
  var _a;
15134
15220
  const baseCS = (_a = baseCfg.collapsedSize) !== null && _a !== void 0 ? _a : defaultCollapsedSize;
15135
- const newCS = baseCS + gapAdd;
15136
- const baseMS = baseCfg.minimumSize;
15137
- const newMS = baseMS !== undefined ? baseMS + gapAdd : newCS + 50;
15138
- view.updateCollapsedSize(newCS, newMS);
15221
+ view.updateSizing(baseCS, baseCfg.minimumSize, gapAdd);
15139
15222
  };
15140
15223
  const topCfg = this._viewConfigs.get('top');
15141
15224
  if (this._topView && topCfg) {
@@ -15386,9 +15469,8 @@ class ShellManager {
15386
15469
  }
15387
15470
  }
15388
15471
  dispose() {
15389
- var _a;
15390
15472
  this._disposables.dispose();
15391
- (_a = this._shellElement.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this._shellElement);
15473
+ this._shellElement.remove();
15392
15474
  }
15393
15475
  }
15394
15476
 
@@ -15425,9 +15507,9 @@ let _hasWarnedUsingCoreDirectly = false;
15425
15507
  * `process` is undefined.
15426
15508
  */
15427
15509
  function warnIfUsingCoreDirectly() {
15510
+ var _a;
15428
15511
  if (typeof process !== 'undefined' &&
15429
- process.env &&
15430
- process.env.NODE_ENV === 'production') {
15512
+ ((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'production') {
15431
15513
  return;
15432
15514
  }
15433
15515
  if (_hasWarnedUsingCoreDirectly || isDockviewPackageLoaded()) {
@@ -15818,7 +15900,7 @@ class DockviewComponent extends BaseGrid {
15818
15900
  // The shell always wraps the dockview element so edge groups can be
15819
15901
  // added at any time via addEdgeGroup() without re-parenting the DOM.
15820
15902
  this.disableResizing = true;
15821
- container.removeChild(this.element);
15903
+ this.element.remove();
15822
15904
  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);
15823
15905
  // The shell wraps the dockview element, so move the popup anchor
15824
15906
  // into the shell so overflow dropdowns in edge groups position correctly
@@ -16040,15 +16122,13 @@ class DockviewComponent extends BaseGrid {
16040
16122
  return _window
16041
16123
  .open()
16042
16124
  .then((popoutContainer) => {
16043
- var _a, _b, _c;
16125
+ var _a, _b, _c, _d;
16044
16126
  if (_window.isDisposed) {
16045
16127
  return false;
16046
16128
  }
16047
- const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
16048
- ? options.referenceGroup
16049
- : itemToPopout instanceof DockviewPanel
16050
- ? itemToPopout.group
16051
- : itemToPopout;
16129
+ const referenceGroup = (_a = options === null || options === void 0 ? void 0 : options.referenceGroup) !== null && _a !== void 0 ? _a : (itemToPopout instanceof DockviewPanel
16130
+ ? itemToPopout.group
16131
+ : itemToPopout);
16052
16132
  const referenceLocation = itemToPopout.api.location.type;
16053
16133
  /**
16054
16134
  * The group that is being added doesn't already exist within the DOM, the most likely occurrence
@@ -16059,7 +16139,7 @@ class DockviewComponent extends BaseGrid {
16059
16139
  if (options === null || options === void 0 ? void 0 : options.overridePopoutGridview) {
16060
16140
  // Restoring a multi-group window: the anchor group is
16061
16141
  // already built inside the supplied gridview.
16062
- group = (_a = options.overridePopoutGroup) !== null && _a !== void 0 ? _a : referenceGroup;
16142
+ group = (_b = options.overridePopoutGroup) !== null && _b !== void 0 ? _b : referenceGroup;
16063
16143
  }
16064
16144
  else if (!isGroupAddedToDom) {
16065
16145
  group = referenceGroup;
@@ -16090,7 +16170,7 @@ class DockviewComponent extends BaseGrid {
16090
16170
  // a nested splitview layout. The window starts with the single
16091
16171
  // anchor group; further groups arrive via drag-and-drop. On
16092
16172
  // restore a pre-populated gridview is supplied instead.
16093
- const popoutGridview = (_b = options === null || options === void 0 ? void 0 : options.overridePopoutGridview) !== null && _b !== void 0 ? _b : this.createNestedGridview();
16173
+ const popoutGridview = (_c = options === null || options === void 0 ? void 0 : options.overridePopoutGridview) !== null && _c !== void 0 ? _c : this.createNestedGridview();
16094
16174
  if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGridview)) {
16095
16175
  popoutGridview.addView(group, exports.Sizing.Distribute, [0]);
16096
16176
  }
@@ -16131,9 +16211,9 @@ class DockviewComponent extends BaseGrid {
16131
16211
  break;
16132
16212
  case 'floating':
16133
16213
  case 'popout':
16134
- floatingBox = (_c = this.floatingGroups
16214
+ floatingBox = (_d = this.floatingGroups
16135
16215
  .find((value) => value.group.api.id ===
16136
- itemToPopout.api.id)) === null || _c === void 0 ? void 0 : _c.overlay.toJSON();
16216
+ itemToPopout.api.id)) === null || _d === void 0 ? void 0 : _d.overlay.toJSON();
16137
16217
  this.removeGroup(referenceGroup);
16138
16218
  break;
16139
16219
  }
@@ -16974,7 +17054,7 @@ class DockviewComponent extends BaseGrid {
16974
17054
  const createGroupFromSerializedState = (data) => {
16975
17055
  const { id, locked, hideHeader, headerPosition, views, activeView, } = data;
16976
17056
  if (typeof id !== 'string') {
16977
- throw new Error('dockview: group id must be of type string');
17057
+ throw new TypeError('dockview: group id must be of type string');
16978
17058
  }
16979
17059
  const group = this.createGroup({
16980
17060
  id,
@@ -17148,8 +17228,7 @@ class DockviewComponent extends BaseGrid {
17148
17228
  createdPanels.push(panel);
17149
17229
  }
17150
17230
  }
17151
- for (let i = 0; i < createdPanels.length; i++) {
17152
- const panel = createdPanels[i];
17231
+ for (const panel of createdPanels) {
17153
17232
  const isActive = activeView === panel.id;
17154
17233
  edgeGroup.model.openPanel(panel, {
17155
17234
  skipSetActive: !isActive,
@@ -17294,8 +17373,8 @@ class DockviewComponent extends BaseGrid {
17294
17373
  return this.mutation('add', () => this._doAddPanel(options));
17295
17374
  }
17296
17375
  _doAddPanel(options) {
17297
- var _a, _b;
17298
- if (this.panels.find((_) => _.id === options.id)) {
17376
+ var _a, _b, _c, _d;
17377
+ if (this.panels.some((_) => _.id === options.id)) {
17299
17378
  throw new Error(`dockview: panel with id ${options.id} already exists`);
17300
17379
  }
17301
17380
  let referenceGroup;
@@ -17314,18 +17393,24 @@ class DockviewComponent extends BaseGrid {
17314
17393
  : options.position.referencePanel;
17315
17394
  index = options.position.index;
17316
17395
  if (!referencePanel) {
17317
- throw new Error(`dockview: referencePanel '${options.position.referencePanel}' does not exist`);
17396
+ const referenceId = typeof options.position.referencePanel === 'string'
17397
+ ? options.position.referencePanel
17398
+ : (_a = options.position.referencePanel) === null || _a === void 0 ? void 0 : _a.id;
17399
+ throw new Error(`dockview: referencePanel '${referenceId}' does not exist`);
17318
17400
  }
17319
17401
  referenceGroup = this.findGroup(referencePanel);
17320
17402
  }
17321
17403
  else if (isPanelOptionsWithGroup(options.position)) {
17322
17404
  referenceGroup =
17323
17405
  typeof options.position.referenceGroup === 'string'
17324
- ? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
17406
+ ? (_b = this._groups.get(options.position.referenceGroup)) === null || _b === void 0 ? void 0 : _b.value
17325
17407
  : options.position.referenceGroup;
17326
17408
  index = options.position.index;
17327
17409
  if (!referenceGroup) {
17328
- throw new Error(`dockview: referenceGroup '${options.position.referenceGroup}' does not exist`);
17410
+ const referenceId = typeof options.position.referenceGroup === 'string'
17411
+ ? options.position.referenceGroup
17412
+ : (_c = options.position.referenceGroup) === null || _c === void 0 ? void 0 : _c.id;
17413
+ throw new Error(`dockview: referenceGroup '${referenceId}' does not exist`);
17329
17414
  }
17330
17415
  }
17331
17416
  else {
@@ -17351,7 +17436,7 @@ class DockviewComponent extends BaseGrid {
17351
17436
  }
17352
17437
  let panel;
17353
17438
  if (referenceGroup) {
17354
- const target = toTarget(((_b = options.position) === null || _b === void 0 ? void 0 : _b.direction) || 'within');
17439
+ const target = toTarget(((_d = options.position) === null || _d === void 0 ? void 0 : _d.direction) || 'within');
17355
17440
  if (options.floating) {
17356
17441
  const group = this.createGroup();
17357
17442
  this._onDidAddGroup.fire(group);
@@ -17433,14 +17518,17 @@ class DockviewComponent extends BaseGrid {
17433
17518
  }
17434
17519
  return panel;
17435
17520
  }
17436
- removePanel(panel, options = {
17437
- removeEmptyGroup: true,
17438
- }) {
17439
- this.mutation('remove', () => this._doRemovePanel(panel, options));
17521
+ removePanel(panel, options) {
17522
+ this.mutation('remove', () => {
17523
+ var _a;
17524
+ return this._doRemovePanel(panel, {
17525
+ removeEmptyGroup: (_a = options === null || options === void 0 ? void 0 : options.removeEmptyGroup) !== null && _a !== void 0 ? _a : true,
17526
+ skipDispose: options === null || options === void 0 ? void 0 : options.skipDispose,
17527
+ skipSetActiveGroup: options === null || options === void 0 ? void 0 : options.skipSetActiveGroup,
17528
+ });
17529
+ });
17440
17530
  }
17441
- _doRemovePanel(panel, options = {
17442
- removeEmptyGroup: true,
17443
- }) {
17531
+ _doRemovePanel(panel, options) {
17444
17532
  const group = panel.group;
17445
17533
  if (!group) {
17446
17534
  throw new Error(`dockview: cannot remove panel ${panel.id}. it's missing a group.`);
@@ -17466,28 +17554,34 @@ class DockviewComponent extends BaseGrid {
17466
17554
  return this.mutation('add', () => this._doAddGroup(options));
17467
17555
  }
17468
17556
  _doAddGroup(options) {
17469
- var _a;
17557
+ var _a, _b, _c;
17470
17558
  if (options) {
17471
17559
  let referenceGroup;
17472
17560
  if (isGroupOptionsWithPanel(options)) {
17473
17561
  const referencePanel = typeof options.referencePanel === 'string'
17474
17562
  ? this.panels.find((panel) => panel.id === options.referencePanel)
17475
17563
  : options.referencePanel;
17564
+ const referencePanelId = typeof options.referencePanel === 'string'
17565
+ ? options.referencePanel
17566
+ : (_a = options.referencePanel) === null || _a === void 0 ? void 0 : _a.id;
17476
17567
  if (!referencePanel) {
17477
- throw new Error(`dockview: reference panel ${options.referencePanel} does not exist`);
17568
+ throw new Error(`dockview: reference panel ${referencePanelId} does not exist`);
17478
17569
  }
17479
17570
  referenceGroup = this.findGroup(referencePanel);
17480
17571
  if (!referenceGroup) {
17481
- throw new Error(`dockview: reference group for reference panel ${options.referencePanel} does not exist`);
17572
+ throw new Error(`dockview: reference group for reference panel ${referencePanelId} does not exist`);
17482
17573
  }
17483
17574
  }
17484
17575
  else if (isGroupOptionsWithGroup(options)) {
17485
17576
  referenceGroup =
17486
17577
  typeof options.referenceGroup === 'string'
17487
- ? (_a = this._groups.get(options.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
17578
+ ? (_b = this._groups.get(options.referenceGroup)) === null || _b === void 0 ? void 0 : _b.value
17488
17579
  : options.referenceGroup;
17489
17580
  if (!referenceGroup) {
17490
- throw new Error(`dockview: reference group ${options.referenceGroup} does not exist`);
17581
+ const referenceId = typeof options.referenceGroup === 'string'
17582
+ ? options.referenceGroup
17583
+ : (_c = options.referenceGroup) === null || _c === void 0 ? void 0 : _c.id;
17584
+ throw new Error(`dockview: reference group ${referenceId} does not exist`);
17491
17585
  }
17492
17586
  }
17493
17587
  else {
@@ -17610,14 +17704,14 @@ class DockviewComponent extends BaseGrid {
17610
17704
  if (this.detachFromNestedWindow(group)) {
17611
17705
  // The floating window hosts other groups and stays alive —
17612
17706
  // finalize just this group.
17613
- if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
17614
- this.disposeGroupRecord(group);
17615
- }
17616
- else {
17707
+ if (options === null || options === void 0 ? void 0 : options.skipDispose) {
17617
17708
  // Relocation: reset location so the destination root can
17618
17709
  // re-tag it.
17619
17710
  group.model.location = { type: 'grid' };
17620
17711
  }
17712
+ else {
17713
+ this.disposeGroupRecord(group);
17714
+ }
17621
17715
  this.activateFallbackGroupIfRemoved(group, options === null || options === void 0 ? void 0 : options.skipActive);
17622
17716
  return group;
17623
17717
  }
@@ -17638,14 +17732,14 @@ class DockviewComponent extends BaseGrid {
17638
17732
  if (this.detachFromNestedWindow(group)) {
17639
17733
  // The popout window hosts other groups and stays alive —
17640
17734
  // finalize just this group.
17641
- if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
17642
- this.disposeGroupRecord(group);
17643
- }
17644
- else {
17735
+ if (options === null || options === void 0 ? void 0 : options.skipDispose) {
17645
17736
  // Relocation: reset location so the destination root can
17646
17737
  // re-tag it.
17647
17738
  group.model.location = { type: 'grid' };
17648
17739
  }
17740
+ else {
17741
+ this.disposeGroupRecord(group);
17742
+ }
17649
17743
  this.activateFallbackGroupIfRemoved(group, options === null || options === void 0 ? void 0 : options.skipActive);
17650
17744
  return group;
17651
17745
  }
@@ -17655,7 +17749,7 @@ class DockviewComponent extends BaseGrid {
17655
17749
  const refGroup = selectedGroup.referenceGroup
17656
17750
  ? this.getPanel(selectedGroup.referenceGroup)
17657
17751
  : undefined;
17658
- if (refGroup && refGroup.panels.length === 0) {
17752
+ if ((refGroup === null || refGroup === void 0 ? void 0 : refGroup.panels.length) === 0) {
17659
17753
  this.removeGroup(refGroup);
17660
17754
  }
17661
17755
  }
@@ -18331,9 +18425,7 @@ class DockviewComponent extends BaseGrid {
18331
18425
  return id;
18332
18426
  }
18333
18427
  createGroup(options) {
18334
- if (!options) {
18335
- options = {};
18336
- }
18428
+ options !== null && options !== void 0 ? options : (options = {});
18337
18429
  let id = options === null || options === void 0 ? void 0 : options.id;
18338
18430
  if (id && this._groups.has(options.id)) {
18339
18431
  console.warn(`dockview: Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
@@ -18529,13 +18621,13 @@ class DockviewComponent extends BaseGrid {
18529
18621
  entry.gridview.margin = gap;
18530
18622
  }
18531
18623
  (_f = this._shellManager) === null || _f === void 0 ? void 0 : _f.updateTheme(gap, (_g = theme.edgeGroupCollapsedSize) !== null && _g !== void 0 ? _g : 35);
18532
- if (theme.dndOverlayBorder !== undefined) {
18533
- this.element.style.setProperty('--dv-drag-over-border', theme.dndOverlayBorder);
18534
- (_h = this._shellManager) === null || _h === void 0 ? void 0 : _h.element.style.setProperty('--dv-drag-over-border', theme.dndOverlayBorder);
18624
+ if (theme.dndOverlayBorder === undefined) {
18625
+ this.element.style.removeProperty('--dv-drag-over-border');
18626
+ (_h = this._shellManager) === null || _h === void 0 ? void 0 : _h.element.style.removeProperty('--dv-drag-over-border');
18535
18627
  }
18536
18628
  else {
18537
- this.element.style.removeProperty('--dv-drag-over-border');
18538
- (_j = this._shellManager) === null || _j === void 0 ? void 0 : _j.element.style.removeProperty('--dv-drag-over-border');
18629
+ this.element.style.setProperty('--dv-drag-over-border', theme.dndOverlayBorder);
18630
+ (_j = this._shellManager) === null || _j === void 0 ? void 0 : _j.element.style.setProperty('--dv-drag-over-border', theme.dndOverlayBorder);
18539
18631
  }
18540
18632
  switch (theme.dndOverlayMounting) {
18541
18633
  case 'absolute':
@@ -18777,12 +18869,7 @@ class GridviewComponent extends BaseGrid {
18777
18869
  }
18778
18870
  this._groups.forEach((groupItem) => {
18779
18871
  const group = groupItem.value;
18780
- if (group !== panel) {
18781
- group.setActive(false);
18782
- }
18783
- else {
18784
- group.setActive(true);
18785
- }
18872
+ group.setActive(group === panel);
18786
18873
  });
18787
18874
  }));
18788
18875
  this._groups.set(panel.id, {
@@ -19275,9 +19362,7 @@ class PaneviewComponent extends Resizable {
19275
19362
  name: options.headerComponent,
19276
19363
  });
19277
19364
  }
19278
- if (!header) {
19279
- header = new DefaultHeader();
19280
- }
19365
+ header !== null && header !== void 0 ? header : (header = new DefaultHeader());
19281
19366
  const view = new PaneFramework({
19282
19367
  id: options.id,
19283
19368
  component: options.component,
@@ -19376,9 +19461,7 @@ class PaneviewComponent extends Resizable {
19376
19461
  name: data.headerComponent,
19377
19462
  });
19378
19463
  }
19379
- if (!header) {
19380
- header = new DefaultHeader();
19381
- }
19464
+ header !== null && header !== void 0 ? header : (header = new DefaultHeader());
19382
19465
  const panel = new PaneFramework({
19383
19466
  id: data.id,
19384
19467
  component: data.component,