dockview-core 1.17.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/cjs/api/component.api.d.ts +1 -1
  2. package/dist/cjs/api/dockviewGroupPanelApi.d.ts +10 -8
  3. package/dist/cjs/api/dockviewGroupPanelApi.js +1 -0
  4. package/dist/cjs/api/dockviewPanelApi.d.ts +6 -14
  5. package/dist/cjs/api/dockviewPanelApi.js +5 -3
  6. package/dist/cjs/dnd/abstractDragHandler.js +1 -1
  7. package/dist/cjs/dnd/dnd.d.ts +2 -2
  8. package/dist/cjs/dnd/droptarget.js +4 -4
  9. package/dist/cjs/dockview/components/panel/content.d.ts +2 -2
  10. package/dist/cjs/dockview/components/panel/content.js +3 -1
  11. package/dist/cjs/dockview/components/tab/defaultTab.d.ts +3 -3
  12. package/dist/cjs/dockview/components/tab/tab.js +4 -4
  13. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +5 -9
  14. package/dist/cjs/dockview/components/titlebar/voidContainer.js +1 -1
  15. package/dist/cjs/dockview/components/watermark/watermark.d.ts +1 -1
  16. package/dist/cjs/dockview/components/watermark/watermark.js +6 -6
  17. package/dist/cjs/dockview/dockviewComponent.d.ts +2 -3
  18. package/dist/cjs/dockview/dockviewComponent.js +66 -35
  19. package/dist/cjs/dockview/dockviewGroupPanel.js +16 -12
  20. package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +3 -3
  21. package/dist/cjs/dockview/dockviewGroupPanelModel.js +7 -7
  22. package/dist/cjs/dockview/dockviewPanel.d.ts +4 -4
  23. package/dist/cjs/dockview/dockviewPanelModel.d.ts +1 -1
  24. package/dist/cjs/dockview/options.d.ts +8 -0
  25. package/dist/cjs/dom.d.ts +11 -1
  26. package/dist/cjs/dom.js +19 -1
  27. package/dist/cjs/gridview/basePanelView.d.ts +1 -1
  28. package/dist/cjs/gridview/branchNode.d.ts +1 -1
  29. package/dist/cjs/gridview/branchNode.js +1 -1
  30. package/dist/cjs/gridview/gridview.js +2 -2
  31. package/dist/cjs/gridview/gridviewPanel.d.ts +4 -0
  32. package/dist/cjs/gridview/gridviewPanel.js +60 -32
  33. package/dist/cjs/gridview/leafNode.d.ts +1 -1
  34. package/dist/cjs/index.d.ts +8 -9
  35. package/dist/cjs/index.js +14 -7
  36. package/dist/cjs/overlay/overlay.d.ts +3 -3
  37. package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +1 -1
  38. package/dist/cjs/paneview/defaultPaneviewHeader.js +5 -3
  39. package/dist/cjs/paneview/paneview.d.ts +3 -3
  40. package/dist/cjs/paneview/paneview.js +3 -3
  41. package/dist/cjs/paneview/paneviewComponent.d.ts +2 -2
  42. package/dist/cjs/paneview/paneviewPanel.d.ts +2 -2
  43. package/dist/cjs/paneview/paneviewPanel.js +3 -3
  44. package/dist/cjs/popoutWindow.js +23 -16
  45. package/dist/cjs/splitview/splitview.d.ts +6 -6
  46. package/dist/cjs/splitview/splitview.js +18 -17
  47. package/dist/cjs/splitview/splitviewComponent.d.ts +2 -2
  48. package/dist/cjs/splitview/viewItem.d.ts +1 -1
  49. package/dist/cjs/svg.js +1 -1
  50. package/dist/dockview-core.amd.js +241 -169
  51. package/dist/dockview-core.amd.js.map +1 -1
  52. package/dist/dockview-core.amd.min.js +2 -2
  53. package/dist/dockview-core.amd.min.js.map +1 -1
  54. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  55. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  56. package/dist/dockview-core.amd.noStyle.js +240 -168
  57. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  58. package/dist/dockview-core.cjs.js +241 -169
  59. package/dist/dockview-core.cjs.js.map +1 -1
  60. package/dist/dockview-core.esm.js +242 -168
  61. package/dist/dockview-core.esm.js.map +1 -1
  62. package/dist/dockview-core.esm.min.js +2 -2
  63. package/dist/dockview-core.esm.min.js.map +1 -1
  64. package/dist/dockview-core.js +241 -169
  65. package/dist/dockview-core.js.map +1 -1
  66. package/dist/dockview-core.min.js +2 -2
  67. package/dist/dockview-core.min.js.map +1 -1
  68. package/dist/dockview-core.min.noStyle.js +2 -2
  69. package/dist/dockview-core.min.noStyle.js.map +1 -1
  70. package/dist/dockview-core.noStyle.js +240 -168
  71. package/dist/dockview-core.noStyle.js.map +1 -1
  72. package/dist/esm/api/component.api.d.ts +1 -1
  73. package/dist/esm/api/dockviewGroupPanelApi.d.ts +10 -8
  74. package/dist/esm/api/dockviewGroupPanelApi.js +1 -0
  75. package/dist/esm/api/dockviewPanelApi.d.ts +6 -14
  76. package/dist/esm/api/dockviewPanelApi.js +5 -3
  77. package/dist/esm/dnd/abstractDragHandler.js +1 -1
  78. package/dist/esm/dnd/dnd.d.ts +2 -2
  79. package/dist/esm/dnd/droptarget.js +4 -4
  80. package/dist/esm/dockview/components/panel/content.d.ts +2 -2
  81. package/dist/esm/dockview/components/panel/content.js +4 -2
  82. package/dist/esm/dockview/components/tab/defaultTab.d.ts +3 -3
  83. package/dist/esm/dockview/components/tab/tab.js +4 -4
  84. package/dist/esm/dockview/components/titlebar/tabsContainer.js +5 -9
  85. package/dist/esm/dockview/components/titlebar/voidContainer.js +1 -1
  86. package/dist/esm/dockview/components/watermark/watermark.d.ts +1 -1
  87. package/dist/esm/dockview/components/watermark/watermark.js +6 -6
  88. package/dist/esm/dockview/dockviewComponent.d.ts +2 -3
  89. package/dist/esm/dockview/dockviewComponent.js +65 -34
  90. package/dist/esm/dockview/dockviewGroupPanel.js +16 -12
  91. package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +3 -3
  92. package/dist/esm/dockview/dockviewGroupPanelModel.js +7 -7
  93. package/dist/esm/dockview/dockviewPanel.d.ts +4 -4
  94. package/dist/esm/dockview/dockviewPanelModel.d.ts +1 -1
  95. package/dist/esm/dockview/options.d.ts +8 -0
  96. package/dist/esm/dom.d.ts +11 -1
  97. package/dist/esm/dom.js +14 -0
  98. package/dist/esm/gridview/basePanelView.d.ts +1 -1
  99. package/dist/esm/gridview/branchNode.d.ts +1 -1
  100. package/dist/esm/gridview/branchNode.js +1 -1
  101. package/dist/esm/gridview/gridview.js +2 -2
  102. package/dist/esm/gridview/gridviewPanel.d.ts +4 -0
  103. package/dist/esm/gridview/gridviewPanel.js +40 -12
  104. package/dist/esm/gridview/leafNode.d.ts +1 -1
  105. package/dist/esm/index.d.ts +8 -9
  106. package/dist/esm/index.js +5 -6
  107. package/dist/esm/overlay/overlay.d.ts +3 -3
  108. package/dist/esm/paneview/defaultPaneviewHeader.d.ts +1 -1
  109. package/dist/esm/paneview/defaultPaneviewHeader.js +5 -3
  110. package/dist/esm/paneview/paneview.d.ts +3 -3
  111. package/dist/esm/paneview/paneview.js +3 -3
  112. package/dist/esm/paneview/paneviewComponent.d.ts +2 -2
  113. package/dist/esm/paneview/paneviewPanel.d.ts +2 -2
  114. package/dist/esm/paneview/paneviewPanel.js +3 -3
  115. package/dist/esm/popoutWindow.js +24 -17
  116. package/dist/esm/splitview/splitview.d.ts +6 -6
  117. package/dist/esm/splitview/splitview.js +18 -17
  118. package/dist/esm/splitview/splitviewComponent.d.ts +2 -2
  119. package/dist/esm/splitview/viewItem.d.ts +1 -1
  120. package/dist/esm/svg.js +1 -1
  121. package/dist/styles/dockview.css +114 -125
  122. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 1.17.2
3
+ * @version 2.0.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -328,31 +328,6 @@
328
328
  }
329
329
  }
330
330
 
331
- function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
332
- const Component = typeof componentName === 'string'
333
- ? components[componentName]
334
- : undefined;
335
- const FrameworkComponent = typeof componentName === 'string'
336
- ? frameworkComponents[componentName]
337
- : undefined;
338
- if (Component && FrameworkComponent) {
339
- throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
340
- }
341
- if (FrameworkComponent) {
342
- if (!createFrameworkComponent) {
343
- throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
344
- }
345
- return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
346
- }
347
- if (!Component) {
348
- if (fallback) {
349
- return fallback();
350
- }
351
- throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
352
- }
353
- return new Component(id, componentName);
354
- }
355
-
356
331
  function watchElementResize(element, cb) {
357
332
  const observer = new ResizeObserver((entires) => {
358
333
  /**
@@ -821,10 +796,10 @@
821
796
  const tmp = this.size;
822
797
  this.size = this.orthogonalSize;
823
798
  this.orthogonalSize = tmp;
824
- removeClasses(this.element, 'horizontal', 'vertical');
799
+ removeClasses(this.element, 'dv-horizontal', 'dv-vertical');
825
800
  this.element.classList.add(this.orientation == exports.Orientation.HORIZONTAL
826
- ? 'horizontal'
827
- : 'vertical');
801
+ ? 'dv-horizontal'
802
+ : 'dv-vertical');
828
803
  }
829
804
  get minimumSize() {
830
805
  return this.viewItems.reduce((r, item) => r + item.minimumSize, 0);
@@ -1002,11 +977,11 @@
1002
977
  }
1003
978
  style(styles) {
1004
979
  if ((styles === null || styles === void 0 ? void 0 : styles.separatorBorder) === 'transparent') {
1005
- removeClasses(this.element, 'separator-border');
980
+ removeClasses(this.element, 'dv-separator-border');
1006
981
  this.element.style.removeProperty('--dv-separator-border');
1007
982
  }
1008
983
  else {
1009
- addClasses(this.element, 'separator-border');
984
+ addClasses(this.element, 'dv-separator-border');
1010
985
  if (styles === null || styles === void 0 ? void 0 : styles.separatorBorder) {
1011
986
  this.element.style.setProperty('--dv-separator-border', styles.separatorBorder);
1012
987
  }
@@ -1076,7 +1051,7 @@
1076
1051
  }
1077
1052
  addView(view, size = { type: 'distribute' }, index = this.viewItems.length, skipLayout) {
1078
1053
  const container = document.createElement('div');
1079
- container.className = 'view';
1054
+ container.className = 'dv-view';
1080
1055
  container.appendChild(view.element);
1081
1056
  let viewSize;
1082
1057
  if (typeof size === 'number') {
@@ -1108,7 +1083,7 @@
1108
1083
  if (this.viewItems.length > 1) {
1109
1084
  //add sash
1110
1085
  const sash = document.createElement('div');
1111
- sash.className = 'sash';
1086
+ sash.className = 'dv-sash';
1112
1087
  const onPointerStart = (event) => {
1113
1088
  for (const item of this.viewItems) {
1114
1089
  item.enabled = false;
@@ -1367,7 +1342,8 @@
1367
1342
  const offset = i === 0 || visiblePanelsBeforeThisView === 0
1368
1343
  ? 0
1369
1344
  : viewLeftOffsets[i - 1] +
1370
- (visiblePanelsBeforeThisView / sashCount) * marginReducedSize;
1345
+ (visiblePanelsBeforeThisView / sashCount) *
1346
+ marginReducedSize;
1371
1347
  if (i < this.viewItems.length - 1) {
1372
1348
  // calculate sash position
1373
1349
  const newSize = view.visible
@@ -1478,27 +1454,27 @@
1478
1454
  }
1479
1455
  }
1480
1456
  updateSash(sash, state) {
1481
- toggleClass(sash.container, 'disabled', state === exports.SashState.DISABLED);
1482
- toggleClass(sash.container, 'enabled', state === exports.SashState.ENABLED);
1483
- toggleClass(sash.container, 'maximum', state === exports.SashState.MAXIMUM);
1484
- toggleClass(sash.container, 'minimum', state === exports.SashState.MINIMUM);
1457
+ toggleClass(sash.container, 'dv-disabled', state === exports.SashState.DISABLED);
1458
+ toggleClass(sash.container, 'dv-enabled', state === exports.SashState.ENABLED);
1459
+ toggleClass(sash.container, 'dv-maximum', state === exports.SashState.MAXIMUM);
1460
+ toggleClass(sash.container, 'dv-minimum', state === exports.SashState.MINIMUM);
1485
1461
  }
1486
1462
  createViewContainer() {
1487
1463
  const element = document.createElement('div');
1488
- element.className = 'view-container';
1464
+ element.className = 'dv-view-container';
1489
1465
  return element;
1490
1466
  }
1491
1467
  createSashContainer() {
1492
1468
  const element = document.createElement('div');
1493
- element.className = 'sash-container';
1469
+ element.className = 'dv-sash-container';
1494
1470
  return element;
1495
1471
  }
1496
1472
  createContainer() {
1497
1473
  const element = document.createElement('div');
1498
1474
  const orientationClassname = this._orientation === exports.Orientation.HORIZONTAL
1499
- ? 'horizontal'
1500
- : 'vertical';
1501
- element.className = `split-view-container ${orientationClassname}`;
1475
+ ? 'dv-horizontal'
1476
+ : 'dv-vertical';
1477
+ element.className = `dv-split-view-container ${orientationClassname}`;
1502
1478
  return element;
1503
1479
  }
1504
1480
  dispose() {
@@ -1549,7 +1525,7 @@
1549
1525
  this.onDidChange = this._onDidChange.event;
1550
1526
  this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.VERTICAL;
1551
1527
  this.element = document.createElement('div');
1552
- this.element.className = 'pane-container';
1528
+ this.element.className = 'dv-pane-container';
1553
1529
  container.appendChild(this.element);
1554
1530
  this.splitview = new Splitview(this.element, {
1555
1531
  orientation: this._orientation,
@@ -1641,10 +1617,10 @@
1641
1617
  clearTimeout(this.animationTimer);
1642
1618
  this.animationTimer = undefined;
1643
1619
  }
1644
- addClasses(this.element, 'animated');
1620
+ addClasses(this.element, 'dv-animated');
1645
1621
  this.animationTimer = setTimeout(() => {
1646
1622
  this.animationTimer = undefined;
1647
- removeClasses(this.element, 'animated');
1623
+ removeClasses(this.element, 'dv-animated');
1648
1624
  }, 200);
1649
1625
  }
1650
1626
  dispose() {
@@ -1869,7 +1845,7 @@
1869
1845
  this._orthogonalSize = orthogonalSize;
1870
1846
  this._size = size;
1871
1847
  this.element = document.createElement('div');
1872
- this.element.className = 'branch-node';
1848
+ this.element.className = 'dv-branch-node';
1873
1849
  if (!childDescriptors) {
1874
1850
  this.splitview = new Splitview(this.element, {
1875
1851
  orientation: this.orientation,
@@ -2080,7 +2056,7 @@
2080
2056
  if (!parentElement) {
2081
2057
  throw new Error('Invalid grid element');
2082
2058
  }
2083
- if (/\bgrid-view\b/.test(parentElement.className)) {
2059
+ if (/\bdv-grid-view\b/.test(parentElement.className)) {
2084
2060
  return [];
2085
2061
  }
2086
2062
  const index = indexInParent(parentElement);
@@ -2428,7 +2404,7 @@
2428
2404
  this._onDidMaximizedNodeChange = new Emitter();
2429
2405
  this.onDidMaximizedNodeChange = this._onDidMaximizedNodeChange.event;
2430
2406
  this.element = document.createElement('div');
2431
- this.element.className = 'grid-view';
2407
+ this.element.className = 'dv-grid-view';
2432
2408
  this._locked = locked !== null && locked !== void 0 ? locked : false;
2433
2409
  this._margin = margin !== null && margin !== void 0 ? margin : 0;
2434
2410
  this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0, this.locked, this.margin);
@@ -3650,7 +3626,7 @@
3650
3626
  * dnd logic. You can see the code at
3651
3627
  * https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
3652
3628
  */
3653
- event.dataTransfer.setData('text/plain', '__dockview_internal_drag_event__');
3629
+ event.dataTransfer.setData('text/plain', '');
3654
3630
  }
3655
3631
  }
3656
3632
  }), addDisposableListener(this.el, 'dragend', () => {
@@ -3824,12 +3800,12 @@
3824
3800
  this.markAsUsed(e);
3825
3801
  if (!this.targetElement) {
3826
3802
  this.targetElement = document.createElement('div');
3827
- this.targetElement.className = 'drop-target-dropzone';
3803
+ this.targetElement.className = 'dv-drop-target-dropzone';
3828
3804
  this.overlayElement = document.createElement('div');
3829
- this.overlayElement.className = 'drop-target-selection';
3805
+ this.overlayElement.className = 'dv-drop-target-selection';
3830
3806
  this._state = 'center';
3831
3807
  this.targetElement.appendChild(this.overlayElement);
3832
- this.element.classList.add('drop-target');
3808
+ this.element.classList.add('dv-drop-target');
3833
3809
  this.element.append(this.targetElement);
3834
3810
  }
3835
3811
  this.toggleClasses(quadrant, width, height);
@@ -3967,7 +3943,7 @@
3967
3943
  this.element.removeChild(this.targetElement);
3968
3944
  this.targetElement = undefined;
3969
3945
  this.overlayElement = undefined;
3970
- this.element.classList.remove('drop-target');
3946
+ this.element.classList.remove('dv-drop-target');
3971
3947
  }
3972
3948
  }
3973
3949
  }
@@ -4304,7 +4280,7 @@
4304
4280
  this._headerVisible = isHeaderVisible;
4305
4281
  this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
4306
4282
  this._orientation = orientation;
4307
- this.element.classList.add('pane');
4283
+ this.element.classList.add('dv-pane');
4308
4284
  this.addDisposables(this.api.onWillVisibilityChange((event) => {
4309
4285
  const { isVisible } = event;
4310
4286
  const { accessor } = this._params;
@@ -4401,14 +4377,14 @@
4401
4377
  renderOnce() {
4402
4378
  this.header = document.createElement('div');
4403
4379
  this.header.tabIndex = 0;
4404
- this.header.className = 'pane-header';
4380
+ this.header.className = 'dv-pane-header';
4405
4381
  this.header.style.height = `${this.headerSize}px`;
4406
4382
  this.header.style.lineHeight = `${this.headerSize}px`;
4407
4383
  this.header.style.minHeight = `${this.headerSize}px`;
4408
4384
  this.header.style.maxHeight = `${this.headerSize}px`;
4409
4385
  this.element.appendChild(this.header);
4410
4386
  this.body = document.createElement('div');
4411
- this.body.className = 'pane-body';
4387
+ this.body.className = 'dv-pane-body';
4412
4388
  this.element.appendChild(this.body);
4413
4389
  }
4414
4390
  // TODO slightly hacky by-pass of the component to create a body and header component
@@ -4529,7 +4505,7 @@
4529
4505
  this._onDidBlur = new Emitter();
4530
4506
  this.onDidBlur = this._onDidBlur.event;
4531
4507
  this._element = document.createElement('div');
4532
- this._element.className = 'content-container';
4508
+ this._element.className = 'dv-content-container';
4533
4509
  this._element.tabIndex = -1;
4534
4510
  this.addDisposables(this._onDidFocus, this._onDidBlur);
4535
4511
  this.dropTarget = new Droptarget(this.element, {
@@ -4602,6 +4578,8 @@
4602
4578
  referenceContainer: this,
4603
4579
  });
4604
4580
  break;
4581
+ default:
4582
+ throw new Error(`dockview: invalid renderer type '${panel.api.renderer}'`);
4605
4583
  }
4606
4584
  if (doRender) {
4607
4585
  const focusTracker = trackFocus(container);
@@ -4668,10 +4646,10 @@
4668
4646
  this._onDragStart = new Emitter();
4669
4647
  this.onDragStart = this._onDragStart.event;
4670
4648
  this._element = document.createElement('div');
4671
- this._element.className = 'tab';
4649
+ this._element.className = 'dv-tab';
4672
4650
  this._element.tabIndex = 0;
4673
4651
  this._element.draggable = true;
4674
- toggleClass(this.element, 'inactive-tab', true);
4652
+ toggleClass(this.element, 'dv-inactive-tab', true);
4675
4653
  const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
4676
4654
  this.dropTarget = new Droptarget(this._element, {
4677
4655
  acceptedTargetZones: ['center'],
@@ -4704,8 +4682,8 @@
4704
4682
  }), this.dropTarget);
4705
4683
  }
4706
4684
  setActive(isActive) {
4707
- toggleClass(this.element, 'active-tab', isActive);
4708
- toggleClass(this.element, 'inactive-tab', !isActive);
4685
+ toggleClass(this.element, 'dv-active-tab', isActive);
4686
+ toggleClass(this.element, 'dv-inactive-tab', !isActive);
4709
4687
  }
4710
4688
  setContent(part) {
4711
4689
  if (this.content) {
@@ -4793,7 +4771,7 @@
4793
4771
  this._onDragStart = new Emitter();
4794
4772
  this.onDragStart = this._onDragStart.event;
4795
4773
  this._element = document.createElement('div');
4796
- this._element.className = 'void-container';
4774
+ this._element.className = 'dv-void-container';
4797
4775
  this._element.tabIndex = 0;
4798
4776
  this._element.draggable = true;
4799
4777
  this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
@@ -4913,16 +4891,16 @@
4913
4891
  this._onWillShowOverlay = new Emitter();
4914
4892
  this.onWillShowOverlay = this._onWillShowOverlay.event;
4915
4893
  this._element = document.createElement('div');
4916
- this._element.className = 'tabs-and-actions-container';
4894
+ this._element.className = 'dv-tabs-and-actions-container';
4917
4895
  toggleClass(this._element, 'dv-full-width-single-tab', this.accessor.options.singleTabMode === 'fullwidth');
4918
4896
  this.rightActionsContainer = document.createElement('div');
4919
- this.rightActionsContainer.className = 'right-actions-container';
4897
+ this.rightActionsContainer.className = 'dv-right-actions-container';
4920
4898
  this.leftActionsContainer = document.createElement('div');
4921
- this.leftActionsContainer.className = 'left-actions-container';
4899
+ this.leftActionsContainer.className = 'dv-left-actions-container';
4922
4900
  this.preActionsContainer = document.createElement('div');
4923
- this.preActionsContainer.className = 'pre-actions-container';
4901
+ this.preActionsContainer.className = 'dv-pre-actions-container';
4924
4902
  this.tabContainer = document.createElement('div');
4925
- this.tabContainer.className = 'tabs-container';
4903
+ this.tabContainer.className = 'dv-tabs-container';
4926
4904
  this.voidContainer = new VoidContainer(this.accessor, this.group);
4927
4905
  this._element.appendChild(this.preActionsContainer);
4928
4906
  this._element.appendChild(this.tabContainer);
@@ -5011,14 +4989,10 @@
5011
4989
  });
5012
4990
  }
5013
4991
  openPanel(panel, index = this.tabs.length) {
5014
- var _a;
5015
4992
  if (this.tabs.find((tab) => tab.value.panel.id === panel.id)) {
5016
4993
  return;
5017
4994
  }
5018
4995
  const tab = new Tab(panel, this.accessor, this.group);
5019
- if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
5020
- throw new Error('invalid header component');
5021
- }
5022
4996
  tab.setContent(panel.view.tab);
5023
4997
  const disposable = new CompositeDisposable(tab.onDragStart((event) => {
5024
4998
  this._onTabDragStart.fire({ nativeEvent: event, panel });
@@ -5208,7 +5182,7 @@
5208
5182
  }
5209
5183
  class DockviewGroupPanelModel extends CompositeDisposable {
5210
5184
  get element() {
5211
- throw new Error('not supported');
5185
+ throw new Error('dockview: not supported');
5212
5186
  }
5213
5187
  get activePanel() {
5214
5188
  return this._activePanel;
@@ -5218,7 +5192,7 @@
5218
5192
  }
5219
5193
  set locked(value) {
5220
5194
  this._locked = value;
5221
- toggleClass(this.container, 'locked-groupview', value === 'no-drop-target' || value);
5195
+ toggleClass(this.container, 'dv-locked-groupview', value === 'no-drop-target' || value);
5222
5196
  }
5223
5197
  get isActive() {
5224
5198
  return this._isGroupActive;
@@ -5289,6 +5263,7 @@
5289
5263
  this._locked = false;
5290
5264
  this._location = { type: 'grid' };
5291
5265
  this.mostRecentlyUsed = [];
5266
+ this._overwriteRenderContainer = null;
5292
5267
  this._onDidChange = new Emitter();
5293
5268
  this.onDidChange = this._onDidChange.event;
5294
5269
  this._width = 0;
@@ -5319,8 +5294,7 @@
5319
5294
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
5320
5295
  this._onUnhandledDragOverEvent = new Emitter();
5321
5296
  this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
5322
- this._overwriteRenderContainer = null;
5323
- toggleClass(this.container, 'groupview', true);
5297
+ toggleClass(this.container, 'dv-groupview', true);
5324
5298
  this._api = new DockviewApi(this.accessor);
5325
5299
  this.tabsContainer = new TabsContainer(this.accessor, this.groupPanel);
5326
5300
  this.contentContainer = new ContentContainer(this.accessor, this);
@@ -5565,8 +5539,8 @@
5565
5539
  return;
5566
5540
  }
5567
5541
  this._isGroupActive = isGroupActive;
5568
- toggleClass(this.container, 'active-group', isGroupActive);
5569
- toggleClass(this.container, 'inactive-group', !isGroupActive);
5542
+ toggleClass(this.container, 'dv-active-group', isGroupActive);
5543
+ toggleClass(this.container, 'dv-inactive-group', !isGroupActive);
5570
5544
  this.tabsContainer.setActive(this.isActive);
5571
5545
  if (!this._activePanel && this.panels.length > 0) {
5572
5546
  this.doSetActivePanel(this.panels[0]);
@@ -5658,7 +5632,7 @@
5658
5632
  }
5659
5633
  updateContainer() {
5660
5634
  var _a, _b;
5661
- toggleClass(this.container, 'empty', this.isEmpty);
5635
+ toggleClass(this.container, 'dv-empty', this.isEmpty);
5662
5636
  this.panels.forEach((panel) => panel.runEvents());
5663
5637
  if (this.isEmpty && !this.watermark) {
5664
5638
  const watermark = this.accessor.createWatermarkComponent();
@@ -5799,6 +5773,34 @@
5799
5773
  return this._snap;
5800
5774
  }
5801
5775
  get minimumWidth() {
5776
+ /**
5777
+ * defer to protected function to allow subclasses to override easily.
5778
+ * see https://github.com/microsoft/TypeScript/issues/338
5779
+ */
5780
+ return this.__minimumWidth();
5781
+ }
5782
+ get minimumHeight() {
5783
+ /**
5784
+ * defer to protected function to allow subclasses to override easily.
5785
+ * see https://github.com/microsoft/TypeScript/issues/338
5786
+ */
5787
+ return this.__minimumHeight();
5788
+ }
5789
+ get maximumHeight() {
5790
+ /**
5791
+ * defer to protected function to allow subclasses to override easily.
5792
+ * see https://github.com/microsoft/TypeScript/issues/338
5793
+ */
5794
+ return this.__maximumHeight();
5795
+ }
5796
+ get maximumWidth() {
5797
+ /**
5798
+ * defer to protected function to allow subclasses to override easily.
5799
+ * see https://github.com/microsoft/TypeScript/issues/338
5800
+ */
5801
+ return this.__maximumWidth();
5802
+ }
5803
+ __minimumWidth() {
5802
5804
  const width = typeof this._minimumWidth === 'function'
5803
5805
  ? this._minimumWidth()
5804
5806
  : this._minimumWidth;
@@ -5808,7 +5810,17 @@
5808
5810
  }
5809
5811
  return width;
5810
5812
  }
5811
- get minimumHeight() {
5813
+ __maximumWidth() {
5814
+ const width = typeof this._maximumWidth === 'function'
5815
+ ? this._maximumWidth()
5816
+ : this._maximumWidth;
5817
+ if (width !== this._evaluatedMaximumWidth) {
5818
+ this._evaluatedMaximumWidth = width;
5819
+ this.updateConstraints();
5820
+ }
5821
+ return width;
5822
+ }
5823
+ __minimumHeight() {
5812
5824
  const height = typeof this._minimumHeight === 'function'
5813
5825
  ? this._minimumHeight()
5814
5826
  : this._minimumHeight;
@@ -5818,7 +5830,7 @@
5818
5830
  }
5819
5831
  return height;
5820
5832
  }
5821
- get maximumHeight() {
5833
+ __maximumHeight() {
5822
5834
  const height = typeof this._maximumHeight === 'function'
5823
5835
  ? this._maximumHeight()
5824
5836
  : this._maximumHeight;
@@ -5828,16 +5840,6 @@
5828
5840
  }
5829
5841
  return height;
5830
5842
  }
5831
- get maximumWidth() {
5832
- const width = typeof this._maximumWidth === 'function'
5833
- ? this._maximumWidth()
5834
- : this._maximumWidth;
5835
- if (width !== this._evaluatedMaximumWidth) {
5836
- this._evaluatedMaximumWidth = width;
5837
- this.updateConstraints();
5838
- }
5839
- return width;
5840
- }
5841
5843
  get isActive() {
5842
5844
  return this.api.isActive;
5843
5845
  }
@@ -5988,6 +5990,7 @@
5988
5990
  position: options.group
5989
5991
  ? (_c = options.position) !== null && _c !== void 0 ? _c : 'center'
5990
5992
  : 'center',
5993
+ index: options.index,
5991
5994
  },
5992
5995
  });
5993
5996
  }
@@ -6039,30 +6042,34 @@
6039
6042
  get minimumWidth() {
6040
6043
  var _a;
6041
6044
  const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
6042
- return typeof activePanelMinimumWidth === 'number'
6043
- ? activePanelMinimumWidth
6044
- : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH;
6045
+ if (typeof activePanelMinimumWidth === 'number') {
6046
+ return activePanelMinimumWidth;
6047
+ }
6048
+ return super.__minimumWidth();
6045
6049
  }
6046
6050
  get minimumHeight() {
6047
6051
  var _a;
6048
6052
  const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
6049
- return typeof activePanelMinimumHeight === 'number'
6050
- ? activePanelMinimumHeight
6051
- : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT;
6053
+ if (typeof activePanelMinimumHeight === 'number') {
6054
+ return activePanelMinimumHeight;
6055
+ }
6056
+ return super.__minimumHeight();
6052
6057
  }
6053
6058
  get maximumWidth() {
6054
6059
  var _a;
6055
6060
  const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
6056
- return typeof activePanelMaximumWidth === 'number'
6057
- ? activePanelMaximumWidth
6058
- : Number.MAX_SAFE_INTEGER;
6061
+ if (typeof activePanelMaximumWidth === 'number') {
6062
+ return activePanelMaximumWidth;
6063
+ }
6064
+ return super.__maximumWidth();
6059
6065
  }
6060
6066
  get maximumHeight() {
6061
6067
  var _a;
6062
6068
  const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
6063
- return typeof activePanelMaximumHeight === 'number'
6064
- ? activePanelMaximumHeight
6065
- : Number.MAX_SAFE_INTEGER;
6069
+ if (typeof activePanelMaximumHeight === 'number') {
6070
+ return activePanelMaximumHeight;
6071
+ }
6072
+ return super.__maximumHeight();
6066
6073
  }
6067
6074
  get panels() {
6068
6075
  return this._model.panels;
@@ -6176,12 +6183,14 @@
6176
6183
  return this.group.api.getWindow();
6177
6184
  }
6178
6185
  moveTo(options) {
6179
- var _a;
6186
+ var _a, _b;
6180
6187
  this.accessor.moveGroupOrPanel({
6181
6188
  from: { groupId: this._group.id, panelId: this.panel.id },
6182
6189
  to: {
6183
- group: options.group,
6184
- position: (_a = options.position) !== null && _a !== void 0 ? _a : 'center',
6190
+ group: (_a = options.group) !== null && _a !== void 0 ? _a : this._group,
6191
+ position: options.group
6192
+ ? (_b = options.position) !== null && _b !== void 0 ? _b : 'center'
6193
+ : 'center',
6185
6194
  index: options.index,
6186
6195
  },
6187
6196
  });
@@ -6400,7 +6409,7 @@
6400
6409
  svg.setAttributeNS(null, 'viewBox', params.viewbox);
6401
6410
  svg.setAttributeNS(null, 'aria-hidden', 'false');
6402
6411
  svg.setAttributeNS(null, 'focusable', 'false');
6403
- svg.classList.add('dockview-svg');
6412
+ svg.classList.add('dv-svg');
6404
6413
  const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
6405
6414
  path.setAttributeNS(null, 'd', params.path);
6406
6415
  svg.appendChild(path);
@@ -6571,19 +6580,19 @@
6571
6580
  constructor() {
6572
6581
  super();
6573
6582
  this._element = document.createElement('div');
6574
- this._element.className = 'watermark';
6583
+ this._element.className = 'dv-watermark';
6575
6584
  const title = document.createElement('div');
6576
- title.className = 'watermark-title';
6585
+ title.className = 'dv-watermark-title';
6577
6586
  const emptySpace = document.createElement('span');
6578
6587
  emptySpace.style.flexGrow = '1';
6579
6588
  const content = document.createElement('div');
6580
- content.className = 'watermark-content';
6589
+ content.className = 'dv-watermark-content';
6581
6590
  this._element.appendChild(title);
6582
6591
  this._element.appendChild(content);
6583
6592
  const actionsContainer = document.createElement('div');
6584
- actionsContainer.className = 'actions-container';
6593
+ actionsContainer.className = 'dv-actions-container';
6585
6594
  const closeAnchor = document.createElement('div');
6586
- closeAnchor.className = 'close-action';
6595
+ closeAnchor.className = 'dv-close-action';
6587
6596
  closeAnchor.appendChild(createCloseButton());
6588
6597
  actionsContainer.appendChild(closeAnchor);
6589
6598
  title.appendChild(emptySpace);
@@ -6603,7 +6612,7 @@
6603
6612
  }
6604
6613
  render() {
6605
6614
  const isOneGroup = !!(this._api && this._api.size <= 1);
6606
- toggleClass(this.element, 'has-actions', isOneGroup);
6615
+ toggleClass(this.element, 'dv-has-actions', isOneGroup);
6607
6616
  }
6608
6617
  }
6609
6618
 
@@ -7237,7 +7246,6 @@
7237
7246
  window: this._window.value,
7238
7247
  });
7239
7248
  this._window.disposable.dispose();
7240
- this._window.value.close();
7241
7249
  this._window = null;
7242
7250
  this._onDidClose.fire();
7243
7251
  }
@@ -7269,7 +7277,9 @@
7269
7277
  }
7270
7278
  const disposable = new CompositeDisposable();
7271
7279
  this._window = { value: externalWindow, disposable };
7272
- disposable.addDisposables(addDisposableWindowListener(window, 'beforeunload', () => {
7280
+ disposable.addDisposables(exports.DockviewDisposable.from(() => {
7281
+ externalWindow.close();
7282
+ }), addDisposableWindowListener(window, 'beforeunload', () => {
7273
7283
  /**
7274
7284
  * before the main window closes we should close this popup too
7275
7285
  * to be good citizens
@@ -7286,7 +7296,7 @@
7286
7296
  id: this.target,
7287
7297
  window: externalWindow,
7288
7298
  });
7289
- return new Promise((resolve) => {
7299
+ return new Promise((resolve, reject) => {
7290
7300
  externalWindow.addEventListener('unload', (e) => {
7291
7301
  // if page fails to load before unloading
7292
7302
  // this.close();
@@ -7295,21 +7305,27 @@
7295
7305
  /**
7296
7306
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
7297
7307
  */
7298
- const externalDocument = externalWindow.document;
7299
- externalDocument.title = document.title;
7300
- externalDocument.body.appendChild(container);
7301
- addStyles(externalDocument, window.document.styleSheets);
7302
- /**
7303
- * beforeunload must be registered after load for reasons I could not determine
7304
- * otherwise the beforeunload event will not fire when the window is closed
7305
- */
7306
- addDisposableWindowListener(externalWindow, 'beforeunload', () => {
7308
+ try {
7309
+ const externalDocument = externalWindow.document;
7310
+ externalDocument.title = document.title;
7311
+ externalDocument.body.appendChild(container);
7312
+ addStyles(externalDocument, window.document.styleSheets);
7307
7313
  /**
7308
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
7314
+ * beforeunload must be registered after load for reasons I could not determine
7315
+ * otherwise the beforeunload event will not fire when the window is closed
7309
7316
  */
7310
- this.close();
7311
- });
7312
- resolve(container);
7317
+ addDisposableWindowListener(externalWindow, 'beforeunload', () => {
7318
+ /**
7319
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
7320
+ */
7321
+ this.close();
7322
+ });
7323
+ resolve(container);
7324
+ }
7325
+ catch (err) {
7326
+ // only except this is the DOM isn't setup. e.g. in a in correctly configured test
7327
+ reject(err);
7328
+ }
7313
7329
  });
7314
7330
  });
7315
7331
  });
@@ -7562,9 +7578,6 @@
7562
7578
  }
7563
7579
  const box = getBox();
7564
7580
  const groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId();
7565
- if (itemToPopout.api.location.type === 'grid') {
7566
- itemToPopout.api.setVisible(false);
7567
- }
7568
7581
  const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
7569
7582
  theme !== null && theme !== void 0 ? theme : '', {
7570
7583
  url: (_c = options === null || options === void 0 ? void 0 : options.popoutUrl) !== null && _c !== void 0 ? _c : '/popout.html',
@@ -7583,11 +7596,11 @@
7583
7596
  .then((popoutContainer) => {
7584
7597
  var _a;
7585
7598
  if (_window.isDisposed) {
7586
- return;
7599
+ return false;
7587
7600
  }
7588
7601
  if (popoutContainer === null) {
7589
7602
  popoutWindowDisposable.dispose();
7590
- return;
7603
+ return false;
7591
7604
  }
7592
7605
  const gready = document.createElement('div');
7593
7606
  gready.className = 'dv-overlay-render-container';
@@ -7596,30 +7609,40 @@
7596
7609
  ? itemToPopout.group
7597
7610
  : itemToPopout;
7598
7611
  const referenceLocation = itemToPopout.api.location.type;
7599
- const group = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) !== null && _a !== void 0 ? _a : this.createGroup({ id: groupId });
7612
+ /**
7613
+ * The group that is being added doesn't already exist within the DOM, the most likely occurance
7614
+ * of this case is when being called from the `fromJSON(...)` method
7615
+ */
7616
+ const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
7617
+ const group = !isGroupAddedToDom
7618
+ ? referenceGroup
7619
+ : (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) !== null && _a !== void 0 ? _a : this.createGroup({ id: groupId });
7600
7620
  group.model.renderContainer = overlayRenderContainer;
7601
- if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGroup)) {
7621
+ group.layout(_window.window.innerWidth, _window.window.innerHeight);
7622
+ if (!this._groups.has(group.api.id)) {
7602
7623
  this._onDidAddGroup.fire(group);
7603
7624
  }
7604
- if (itemToPopout instanceof DockviewPanel) {
7605
- this.movingLock(() => {
7606
- const panel = referenceGroup.model.removePanel(itemToPopout);
7607
- group.model.openPanel(panel);
7608
- });
7609
- }
7610
- else {
7611
- this.movingLock(() => moveGroupWithoutDestroying({
7612
- from: referenceGroup,
7613
- to: group,
7614
- }));
7615
- switch (referenceLocation) {
7616
- case 'grid':
7617
- referenceGroup.api.setVisible(false);
7618
- break;
7619
- case 'floating':
7620
- case 'popout':
7621
- this.removeGroup(referenceGroup);
7622
- break;
7625
+ if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGroup) && isGroupAddedToDom) {
7626
+ if (itemToPopout instanceof DockviewPanel) {
7627
+ this.movingLock(() => {
7628
+ const panel = referenceGroup.model.removePanel(itemToPopout);
7629
+ group.model.openPanel(panel);
7630
+ });
7631
+ }
7632
+ else {
7633
+ this.movingLock(() => moveGroupWithoutDestroying({
7634
+ from: referenceGroup,
7635
+ to: group,
7636
+ }));
7637
+ switch (referenceLocation) {
7638
+ case 'grid':
7639
+ referenceGroup.api.setVisible(false);
7640
+ break;
7641
+ case 'floating':
7642
+ case 'popout':
7643
+ this.removeGroup(referenceGroup);
7644
+ break;
7645
+ }
7623
7646
  }
7624
7647
  }
7625
7648
  popoutContainer.classList.add('dv-dockview');
@@ -7630,6 +7653,10 @@
7630
7653
  type: 'popout',
7631
7654
  getWindow: () => _window.window,
7632
7655
  };
7656
+ if (isGroupAddedToDom &&
7657
+ itemToPopout.api.location.type === 'grid') {
7658
+ itemToPopout.api.setVisible(false);
7659
+ }
7633
7660
  this.doSetGroupAndPanelActive(group);
7634
7661
  popoutWindowDisposable.addDisposables(group.api.onDidActiveChange((event) => {
7635
7662
  var _a;
@@ -7644,9 +7671,13 @@
7644
7671
  const value = {
7645
7672
  window: _window,
7646
7673
  popoutGroup: group,
7647
- referenceGroup: this.getPanel(referenceGroup.id)
7648
- ? referenceGroup.id
7649
- : undefined,
7674
+ referenceGroup: !isGroupAddedToDom
7675
+ ? undefined
7676
+ : referenceGroup
7677
+ ? this.getPanel(referenceGroup.id)
7678
+ ? referenceGroup.id
7679
+ : undefined
7680
+ : undefined,
7650
7681
  disposable: {
7651
7682
  dispose: () => {
7652
7683
  popoutWindowDisposable.dispose();
@@ -7661,9 +7692,10 @@
7661
7692
  * window dimensions
7662
7693
  */
7663
7694
  addDisposableWindowListener(_window.window, 'resize', () => {
7664
- group.layout(window.innerWidth, window.innerHeight);
7695
+ group.layout(_window.window.innerWidth, _window.window.innerHeight);
7665
7696
  }), overlayRenderContainer, exports.DockviewDisposable.from(() => {
7666
- if (this.getPanel(referenceGroup.id)) {
7697
+ if (isGroupAddedToDom &&
7698
+ this.getPanel(referenceGroup.id)) {
7667
7699
  this.movingLock(() => moveGroupWithoutDestroying({
7668
7700
  from: group,
7669
7701
  to: referenceGroup,
@@ -7678,21 +7710,27 @@
7678
7710
  }
7679
7711
  }
7680
7712
  else if (this.getPanel(group.id)) {
7681
- const removedGroup = this.doRemoveGroup(group, {
7713
+ this.doRemoveGroup(group, {
7682
7714
  skipDispose: true,
7683
7715
  skipActive: true,
7716
+ skipPopoutReturn: true,
7684
7717
  });
7718
+ const removedGroup = group;
7685
7719
  removedGroup.model.renderContainer =
7686
7720
  this.overlayRenderContainer;
7687
7721
  removedGroup.model.location = { type: 'grid' };
7688
7722
  returnedGroup = removedGroup;
7723
+ this.doAddGroup(removedGroup, [0]);
7724
+ this.doSetGroupAndPanelActive(removedGroup);
7689
7725
  }
7690
7726
  }));
7691
7727
  this._popoutGroups.push(value);
7692
7728
  this.updateWatermark();
7729
+ return true;
7693
7730
  })
7694
7731
  .catch((err) => {
7695
7732
  console.error('dockview: failed to create popout window', err);
7733
+ return false;
7696
7734
  });
7697
7735
  }
7698
7736
  addFloatingGroup(item, options) {
@@ -7796,7 +7834,7 @@
7796
7834
  : (_c = (_b = this.options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport) !== null && _c !== void 0 ? _c : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE, minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
7797
7835
  ? undefined
7798
7836
  : (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
7799
- const el = group.element.querySelector('.void-container');
7837
+ const el = group.element.querySelector('.dv-void-container');
7800
7838
  if (!el) {
7801
7839
  throw new Error('failed to find drag handle');
7802
7840
  }
@@ -8079,7 +8117,6 @@
8079
8117
  this.addPopoutGroup((_c = (gridReferenceGroup
8080
8118
  ? this.getPanel(gridReferenceGroup)
8081
8119
  : undefined)) !== null && _c !== void 0 ? _c : group, {
8082
- skipRemoveGroup: true,
8083
8120
  position: position !== null && position !== void 0 ? position : undefined,
8084
8121
  overridePopoutGroup: gridReferenceGroup
8085
8122
  ? group
@@ -8097,6 +8134,7 @@
8097
8134
  }
8098
8135
  }
8099
8136
  catch (err) {
8137
+ console.error('dockview: failed to deserialize layout. Reverting changes', err);
8100
8138
  /**
8101
8139
  * Takes all the successfully created groups and remove all of their panels.
8102
8140
  */
@@ -8164,11 +8202,13 @@
8164
8202
  width: options.initialWidth,
8165
8203
  height: options.initialHeight,
8166
8204
  };
8205
+ let index;
8167
8206
  if (options.position) {
8168
8207
  if (isPanelOptionsWithPanel(options.position)) {
8169
8208
  const referencePanel = typeof options.position.referencePanel === 'string'
8170
8209
  ? this.getGroupPanel(options.position.referencePanel)
8171
8210
  : options.position.referencePanel;
8211
+ index = options.position.index;
8172
8212
  if (!referencePanel) {
8173
8213
  throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
8174
8214
  }
@@ -8179,6 +8219,7 @@
8179
8219
  typeof options.position.referenceGroup === 'string'
8180
8220
  ? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
8181
8221
  : options.position.referenceGroup;
8222
+ index = options.position.index;
8182
8223
  if (!referenceGroup) {
8183
8224
  throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
8184
8225
  }
@@ -8189,6 +8230,7 @@
8189
8230
  group.model.openPanel(panel, {
8190
8231
  skipSetActive: options.inactive,
8191
8232
  skipSetGroupActive: options.inactive,
8233
+ index,
8192
8234
  });
8193
8235
  if (!options.inactive) {
8194
8236
  this.doSetGroupAndPanelActive(group);
@@ -8218,6 +8260,7 @@
8218
8260
  group.model.openPanel(panel, {
8219
8261
  skipSetActive: options.inactive,
8220
8262
  skipSetGroupActive: options.inactive,
8263
+ index,
8221
8264
  });
8222
8265
  }
8223
8266
  else if (referenceGroup.api.location.type === 'floating' ||
@@ -8226,6 +8269,7 @@
8226
8269
  referenceGroup.model.openPanel(panel, {
8227
8270
  skipSetActive: options.inactive,
8228
8271
  skipSetGroupActive: options.inactive,
8272
+ index,
8229
8273
  });
8230
8274
  referenceGroup.api.setSize({
8231
8275
  width: initial === null || initial === void 0 ? void 0 : initial.width,
@@ -8246,6 +8290,7 @@
8246
8290
  group.model.openPanel(panel, {
8247
8291
  skipSetActive: options.inactive,
8248
8292
  skipSetGroupActive: options.inactive,
8293
+ index,
8249
8294
  });
8250
8295
  if (!options.inactive) {
8251
8296
  this.doSetGroupAndPanelActive(group);
@@ -8264,6 +8309,7 @@
8264
8309
  group.model.openPanel(panel, {
8265
8310
  skipSetActive: options.inactive,
8266
8311
  skipSetGroupActive: options.inactive,
8312
+ index,
8267
8313
  });
8268
8314
  }
8269
8315
  else {
@@ -8274,6 +8320,7 @@
8274
8320
  group.model.openPanel(panel, {
8275
8321
  skipSetActive: options.inactive,
8276
8322
  skipSetGroupActive: options.inactive,
8323
+ index,
8277
8324
  });
8278
8325
  if (!options.inactive) {
8279
8326
  this.doSetGroupAndPanelActive(group);
@@ -8814,6 +8861,31 @@
8814
8861
  }
8815
8862
  }
8816
8863
 
8864
+ function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
8865
+ const Component = typeof componentName === 'string'
8866
+ ? components[componentName]
8867
+ : undefined;
8868
+ const FrameworkComponent = typeof componentName === 'string'
8869
+ ? frameworkComponents[componentName]
8870
+ : undefined;
8871
+ if (Component && FrameworkComponent) {
8872
+ throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
8873
+ }
8874
+ if (FrameworkComponent) {
8875
+ if (!createFrameworkComponent) {
8876
+ throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
8877
+ }
8878
+ return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
8879
+ }
8880
+ if (!Component) {
8881
+ if (fallback) {
8882
+ return fallback();
8883
+ }
8884
+ throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
8885
+ }
8886
+ return new Component(id, componentName);
8887
+ }
8888
+
8817
8889
  class GridviewComponent extends BaseGrid {
8818
8890
  get orientation() {
8819
8891
  return this.gridview.orientation;
@@ -9362,12 +9434,14 @@
9362
9434
  this._expandedIcon = createExpandMoreButton();
9363
9435
  this._collapsedIcon = createChevronRightButton();
9364
9436
  this.disposable = new MutableDisposable();
9365
- this.apiRef = { api: null };
9437
+ this.apiRef = {
9438
+ api: null,
9439
+ };
9366
9440
  this._element = document.createElement('div');
9367
- this.element.className = 'default-header';
9441
+ this.element.className = 'dv-default-header';
9368
9442
  this._content = document.createElement('span');
9369
9443
  this._expander = document.createElement('div');
9370
- this._expander.className = 'dockview-pane-header-icon';
9444
+ this._expander.className = 'dv-pane-header-icon';
9371
9445
  this.element.appendChild(this._expander);
9372
9446
  this.element.appendChild(this._content);
9373
9447
  this.addDisposables(addDisposableListener(this._element, 'click', () => {
@@ -9838,7 +9912,6 @@
9838
9912
  exports.GridviewApi = GridviewApi;
9839
9913
  exports.GridviewComponent = GridviewComponent;
9840
9914
  exports.GridviewPanel = GridviewPanel;
9841
- exports.LocalSelectionTransfer = LocalSelectionTransfer;
9842
9915
  exports.PROPERTY_KEYS = PROPERTY_KEYS;
9843
9916
  exports.PaneFramework = PaneFramework;
9844
9917
  exports.PaneTransfer = PaneTransfer;
@@ -9853,7 +9926,6 @@
9853
9926
  exports.SplitviewPanel = SplitviewPanel;
9854
9927
  exports.Tab = Tab;
9855
9928
  exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
9856
- exports.createComponent = createComponent;
9857
9929
  exports.createDockview = createDockview;
9858
9930
  exports.createGridview = createGridview;
9859
9931
  exports.createPaneview = createPaneview;