dockview-react 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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-react
3
- * @version 1.17.2
3
+ * @version 2.0.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -324,31 +324,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
324
324
  }
325
325
  }
326
326
 
327
- function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
328
- const Component = typeof componentName === 'string'
329
- ? components[componentName]
330
- : undefined;
331
- const FrameworkComponent = typeof componentName === 'string'
332
- ? frameworkComponents[componentName]
333
- : undefined;
334
- if (Component && FrameworkComponent) {
335
- throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
336
- }
337
- if (FrameworkComponent) {
338
- if (!createFrameworkComponent) {
339
- throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
340
- }
341
- return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
342
- }
343
- if (!Component) {
344
- if (fallback) {
345
- return fallback();
346
- }
347
- throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
348
- }
349
- return new Component(id, componentName);
350
- }
351
-
352
327
  function watchElementResize(element, cb) {
353
328
  const observer = new ResizeObserver((entires) => {
354
329
  /**
@@ -817,10 +792,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
817
792
  const tmp = this.size;
818
793
  this.size = this.orthogonalSize;
819
794
  this.orthogonalSize = tmp;
820
- removeClasses(this.element, 'horizontal', 'vertical');
795
+ removeClasses(this.element, 'dv-horizontal', 'dv-vertical');
821
796
  this.element.classList.add(this.orientation == exports.Orientation.HORIZONTAL
822
- ? 'horizontal'
823
- : 'vertical');
797
+ ? 'dv-horizontal'
798
+ : 'dv-vertical');
824
799
  }
825
800
  get minimumSize() {
826
801
  return this.viewItems.reduce((r, item) => r + item.minimumSize, 0);
@@ -998,11 +973,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
998
973
  }
999
974
  style(styles) {
1000
975
  if ((styles === null || styles === void 0 ? void 0 : styles.separatorBorder) === 'transparent') {
1001
- removeClasses(this.element, 'separator-border');
976
+ removeClasses(this.element, 'dv-separator-border');
1002
977
  this.element.style.removeProperty('--dv-separator-border');
1003
978
  }
1004
979
  else {
1005
- addClasses(this.element, 'separator-border');
980
+ addClasses(this.element, 'dv-separator-border');
1006
981
  if (styles === null || styles === void 0 ? void 0 : styles.separatorBorder) {
1007
982
  this.element.style.setProperty('--dv-separator-border', styles.separatorBorder);
1008
983
  }
@@ -1072,7 +1047,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1072
1047
  }
1073
1048
  addView(view, size = { type: 'distribute' }, index = this.viewItems.length, skipLayout) {
1074
1049
  const container = document.createElement('div');
1075
- container.className = 'view';
1050
+ container.className = 'dv-view';
1076
1051
  container.appendChild(view.element);
1077
1052
  let viewSize;
1078
1053
  if (typeof size === 'number') {
@@ -1104,7 +1079,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1104
1079
  if (this.viewItems.length > 1) {
1105
1080
  //add sash
1106
1081
  const sash = document.createElement('div');
1107
- sash.className = 'sash';
1082
+ sash.className = 'dv-sash';
1108
1083
  const onPointerStart = (event) => {
1109
1084
  for (const item of this.viewItems) {
1110
1085
  item.enabled = false;
@@ -1363,7 +1338,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1363
1338
  const offset = i === 0 || visiblePanelsBeforeThisView === 0
1364
1339
  ? 0
1365
1340
  : viewLeftOffsets[i - 1] +
1366
- (visiblePanelsBeforeThisView / sashCount) * marginReducedSize;
1341
+ (visiblePanelsBeforeThisView / sashCount) *
1342
+ marginReducedSize;
1367
1343
  if (i < this.viewItems.length - 1) {
1368
1344
  // calculate sash position
1369
1345
  const newSize = view.visible
@@ -1474,27 +1450,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1474
1450
  }
1475
1451
  }
1476
1452
  updateSash(sash, state) {
1477
- toggleClass(sash.container, 'disabled', state === exports.SashState.DISABLED);
1478
- toggleClass(sash.container, 'enabled', state === exports.SashState.ENABLED);
1479
- toggleClass(sash.container, 'maximum', state === exports.SashState.MAXIMUM);
1480
- toggleClass(sash.container, 'minimum', state === exports.SashState.MINIMUM);
1453
+ toggleClass(sash.container, 'dv-disabled', state === exports.SashState.DISABLED);
1454
+ toggleClass(sash.container, 'dv-enabled', state === exports.SashState.ENABLED);
1455
+ toggleClass(sash.container, 'dv-maximum', state === exports.SashState.MAXIMUM);
1456
+ toggleClass(sash.container, 'dv-minimum', state === exports.SashState.MINIMUM);
1481
1457
  }
1482
1458
  createViewContainer() {
1483
1459
  const element = document.createElement('div');
1484
- element.className = 'view-container';
1460
+ element.className = 'dv-view-container';
1485
1461
  return element;
1486
1462
  }
1487
1463
  createSashContainer() {
1488
1464
  const element = document.createElement('div');
1489
- element.className = 'sash-container';
1465
+ element.className = 'dv-sash-container';
1490
1466
  return element;
1491
1467
  }
1492
1468
  createContainer() {
1493
1469
  const element = document.createElement('div');
1494
1470
  const orientationClassname = this._orientation === exports.Orientation.HORIZONTAL
1495
- ? 'horizontal'
1496
- : 'vertical';
1497
- element.className = `split-view-container ${orientationClassname}`;
1471
+ ? 'dv-horizontal'
1472
+ : 'dv-vertical';
1473
+ element.className = `dv-split-view-container ${orientationClassname}`;
1498
1474
  return element;
1499
1475
  }
1500
1476
  dispose() {
@@ -1545,7 +1521,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1545
1521
  this.onDidChange = this._onDidChange.event;
1546
1522
  this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.VERTICAL;
1547
1523
  this.element = document.createElement('div');
1548
- this.element.className = 'pane-container';
1524
+ this.element.className = 'dv-pane-container';
1549
1525
  container.appendChild(this.element);
1550
1526
  this.splitview = new Splitview(this.element, {
1551
1527
  orientation: this._orientation,
@@ -1637,10 +1613,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1637
1613
  clearTimeout(this.animationTimer);
1638
1614
  this.animationTimer = undefined;
1639
1615
  }
1640
- addClasses(this.element, 'animated');
1616
+ addClasses(this.element, 'dv-animated');
1641
1617
  this.animationTimer = setTimeout(() => {
1642
1618
  this.animationTimer = undefined;
1643
- removeClasses(this.element, 'animated');
1619
+ removeClasses(this.element, 'dv-animated');
1644
1620
  }, 200);
1645
1621
  }
1646
1622
  dispose() {
@@ -1865,7 +1841,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1865
1841
  this._orthogonalSize = orthogonalSize;
1866
1842
  this._size = size;
1867
1843
  this.element = document.createElement('div');
1868
- this.element.className = 'branch-node';
1844
+ this.element.className = 'dv-branch-node';
1869
1845
  if (!childDescriptors) {
1870
1846
  this.splitview = new Splitview(this.element, {
1871
1847
  orientation: this.orientation,
@@ -2076,7 +2052,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2076
2052
  if (!parentElement) {
2077
2053
  throw new Error('Invalid grid element');
2078
2054
  }
2079
- if (/\bgrid-view\b/.test(parentElement.className)) {
2055
+ if (/\bdv-grid-view\b/.test(parentElement.className)) {
2080
2056
  return [];
2081
2057
  }
2082
2058
  const index = indexInParent(parentElement);
@@ -2424,7 +2400,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2424
2400
  this._onDidMaximizedNodeChange = new Emitter();
2425
2401
  this.onDidMaximizedNodeChange = this._onDidMaximizedNodeChange.event;
2426
2402
  this.element = document.createElement('div');
2427
- this.element.className = 'grid-view';
2403
+ this.element.className = 'dv-grid-view';
2428
2404
  this._locked = locked !== null && locked !== void 0 ? locked : false;
2429
2405
  this._margin = margin !== null && margin !== void 0 ? margin : 0;
2430
2406
  this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0, this.locked, this.margin);
@@ -3646,7 +3622,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3646
3622
  * dnd logic. You can see the code at
3647
3623
  * https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
3648
3624
  */
3649
- event.dataTransfer.setData('text/plain', '__dockview_internal_drag_event__');
3625
+ event.dataTransfer.setData('text/plain', '');
3650
3626
  }
3651
3627
  }
3652
3628
  }), addDisposableListener(this.el, 'dragend', () => {
@@ -3820,12 +3796,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3820
3796
  this.markAsUsed(e);
3821
3797
  if (!this.targetElement) {
3822
3798
  this.targetElement = document.createElement('div');
3823
- this.targetElement.className = 'drop-target-dropzone';
3799
+ this.targetElement.className = 'dv-drop-target-dropzone';
3824
3800
  this.overlayElement = document.createElement('div');
3825
- this.overlayElement.className = 'drop-target-selection';
3801
+ this.overlayElement.className = 'dv-drop-target-selection';
3826
3802
  this._state = 'center';
3827
3803
  this.targetElement.appendChild(this.overlayElement);
3828
- this.element.classList.add('drop-target');
3804
+ this.element.classList.add('dv-drop-target');
3829
3805
  this.element.append(this.targetElement);
3830
3806
  }
3831
3807
  this.toggleClasses(quadrant, width, height);
@@ -3963,7 +3939,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3963
3939
  this.element.removeChild(this.targetElement);
3964
3940
  this.targetElement = undefined;
3965
3941
  this.overlayElement = undefined;
3966
- this.element.classList.remove('drop-target');
3942
+ this.element.classList.remove('dv-drop-target');
3967
3943
  }
3968
3944
  }
3969
3945
  }
@@ -4300,7 +4276,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4300
4276
  this._headerVisible = isHeaderVisible;
4301
4277
  this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
4302
4278
  this._orientation = orientation;
4303
- this.element.classList.add('pane');
4279
+ this.element.classList.add('dv-pane');
4304
4280
  this.addDisposables(this.api.onWillVisibilityChange((event) => {
4305
4281
  const { isVisible } = event;
4306
4282
  const { accessor } = this._params;
@@ -4397,14 +4373,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4397
4373
  renderOnce() {
4398
4374
  this.header = document.createElement('div');
4399
4375
  this.header.tabIndex = 0;
4400
- this.header.className = 'pane-header';
4376
+ this.header.className = 'dv-pane-header';
4401
4377
  this.header.style.height = `${this.headerSize}px`;
4402
4378
  this.header.style.lineHeight = `${this.headerSize}px`;
4403
4379
  this.header.style.minHeight = `${this.headerSize}px`;
4404
4380
  this.header.style.maxHeight = `${this.headerSize}px`;
4405
4381
  this.element.appendChild(this.header);
4406
4382
  this.body = document.createElement('div');
4407
- this.body.className = 'pane-body';
4383
+ this.body.className = 'dv-pane-body';
4408
4384
  this.element.appendChild(this.body);
4409
4385
  }
4410
4386
  // TODO slightly hacky by-pass of the component to create a body and header component
@@ -4525,7 +4501,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4525
4501
  this._onDidBlur = new Emitter();
4526
4502
  this.onDidBlur = this._onDidBlur.event;
4527
4503
  this._element = document.createElement('div');
4528
- this._element.className = 'content-container';
4504
+ this._element.className = 'dv-content-container';
4529
4505
  this._element.tabIndex = -1;
4530
4506
  this.addDisposables(this._onDidFocus, this._onDidBlur);
4531
4507
  this.dropTarget = new Droptarget(this.element, {
@@ -4598,6 +4574,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4598
4574
  referenceContainer: this,
4599
4575
  });
4600
4576
  break;
4577
+ default:
4578
+ throw new Error(`dockview: invalid renderer type '${panel.api.renderer}'`);
4601
4579
  }
4602
4580
  if (doRender) {
4603
4581
  const focusTracker = trackFocus(container);
@@ -4664,10 +4642,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4664
4642
  this._onDragStart = new Emitter();
4665
4643
  this.onDragStart = this._onDragStart.event;
4666
4644
  this._element = document.createElement('div');
4667
- this._element.className = 'tab';
4645
+ this._element.className = 'dv-tab';
4668
4646
  this._element.tabIndex = 0;
4669
4647
  this._element.draggable = true;
4670
- toggleClass(this.element, 'inactive-tab', true);
4648
+ toggleClass(this.element, 'dv-inactive-tab', true);
4671
4649
  const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
4672
4650
  this.dropTarget = new Droptarget(this._element, {
4673
4651
  acceptedTargetZones: ['center'],
@@ -4700,8 +4678,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4700
4678
  }), this.dropTarget);
4701
4679
  }
4702
4680
  setActive(isActive) {
4703
- toggleClass(this.element, 'active-tab', isActive);
4704
- toggleClass(this.element, 'inactive-tab', !isActive);
4681
+ toggleClass(this.element, 'dv-active-tab', isActive);
4682
+ toggleClass(this.element, 'dv-inactive-tab', !isActive);
4705
4683
  }
4706
4684
  setContent(part) {
4707
4685
  if (this.content) {
@@ -4789,7 +4767,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4789
4767
  this._onDragStart = new Emitter();
4790
4768
  this.onDragStart = this._onDragStart.event;
4791
4769
  this._element = document.createElement('div');
4792
- this._element.className = 'void-container';
4770
+ this._element.className = 'dv-void-container';
4793
4771
  this._element.tabIndex = 0;
4794
4772
  this._element.draggable = true;
4795
4773
  this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
@@ -4909,16 +4887,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4909
4887
  this._onWillShowOverlay = new Emitter();
4910
4888
  this.onWillShowOverlay = this._onWillShowOverlay.event;
4911
4889
  this._element = document.createElement('div');
4912
- this._element.className = 'tabs-and-actions-container';
4890
+ this._element.className = 'dv-tabs-and-actions-container';
4913
4891
  toggleClass(this._element, 'dv-full-width-single-tab', this.accessor.options.singleTabMode === 'fullwidth');
4914
4892
  this.rightActionsContainer = document.createElement('div');
4915
- this.rightActionsContainer.className = 'right-actions-container';
4893
+ this.rightActionsContainer.className = 'dv-right-actions-container';
4916
4894
  this.leftActionsContainer = document.createElement('div');
4917
- this.leftActionsContainer.className = 'left-actions-container';
4895
+ this.leftActionsContainer.className = 'dv-left-actions-container';
4918
4896
  this.preActionsContainer = document.createElement('div');
4919
- this.preActionsContainer.className = 'pre-actions-container';
4897
+ this.preActionsContainer.className = 'dv-pre-actions-container';
4920
4898
  this.tabContainer = document.createElement('div');
4921
- this.tabContainer.className = 'tabs-container';
4899
+ this.tabContainer.className = 'dv-tabs-container';
4922
4900
  this.voidContainer = new VoidContainer(this.accessor, this.group);
4923
4901
  this._element.appendChild(this.preActionsContainer);
4924
4902
  this._element.appendChild(this.tabContainer);
@@ -5007,14 +4985,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5007
4985
  });
5008
4986
  }
5009
4987
  openPanel(panel, index = this.tabs.length) {
5010
- var _a;
5011
4988
  if (this.tabs.find((tab) => tab.value.panel.id === panel.id)) {
5012
4989
  return;
5013
4990
  }
5014
4991
  const tab = new Tab(panel, this.accessor, this.group);
5015
- if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
5016
- throw new Error('invalid header component');
5017
- }
5018
4992
  tab.setContent(panel.view.tab);
5019
4993
  const disposable = new CompositeDisposable(tab.onDragStart((event) => {
5020
4994
  this._onTabDragStart.fire({ nativeEvent: event, panel });
@@ -5204,7 +5178,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5204
5178
  }
5205
5179
  class DockviewGroupPanelModel extends CompositeDisposable {
5206
5180
  get element() {
5207
- throw new Error('not supported');
5181
+ throw new Error('dockview: not supported');
5208
5182
  }
5209
5183
  get activePanel() {
5210
5184
  return this._activePanel;
@@ -5214,7 +5188,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5214
5188
  }
5215
5189
  set locked(value) {
5216
5190
  this._locked = value;
5217
- toggleClass(this.container, 'locked-groupview', value === 'no-drop-target' || value);
5191
+ toggleClass(this.container, 'dv-locked-groupview', value === 'no-drop-target' || value);
5218
5192
  }
5219
5193
  get isActive() {
5220
5194
  return this._isGroupActive;
@@ -5285,6 +5259,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5285
5259
  this._locked = false;
5286
5260
  this._location = { type: 'grid' };
5287
5261
  this.mostRecentlyUsed = [];
5262
+ this._overwriteRenderContainer = null;
5288
5263
  this._onDidChange = new Emitter();
5289
5264
  this.onDidChange = this._onDidChange.event;
5290
5265
  this._width = 0;
@@ -5315,8 +5290,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5315
5290
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
5316
5291
  this._onUnhandledDragOverEvent = new Emitter();
5317
5292
  this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
5318
- this._overwriteRenderContainer = null;
5319
- toggleClass(this.container, 'groupview', true);
5293
+ toggleClass(this.container, 'dv-groupview', true);
5320
5294
  this._api = new DockviewApi(this.accessor);
5321
5295
  this.tabsContainer = new TabsContainer(this.accessor, this.groupPanel);
5322
5296
  this.contentContainer = new ContentContainer(this.accessor, this);
@@ -5561,8 +5535,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5561
5535
  return;
5562
5536
  }
5563
5537
  this._isGroupActive = isGroupActive;
5564
- toggleClass(this.container, 'active-group', isGroupActive);
5565
- toggleClass(this.container, 'inactive-group', !isGroupActive);
5538
+ toggleClass(this.container, 'dv-active-group', isGroupActive);
5539
+ toggleClass(this.container, 'dv-inactive-group', !isGroupActive);
5566
5540
  this.tabsContainer.setActive(this.isActive);
5567
5541
  if (!this._activePanel && this.panels.length > 0) {
5568
5542
  this.doSetActivePanel(this.panels[0]);
@@ -5654,7 +5628,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5654
5628
  }
5655
5629
  updateContainer() {
5656
5630
  var _a, _b;
5657
- toggleClass(this.container, 'empty', this.isEmpty);
5631
+ toggleClass(this.container, 'dv-empty', this.isEmpty);
5658
5632
  this.panels.forEach((panel) => panel.runEvents());
5659
5633
  if (this.isEmpty && !this.watermark) {
5660
5634
  const watermark = this.accessor.createWatermarkComponent();
@@ -5795,6 +5769,34 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5795
5769
  return this._snap;
5796
5770
  }
5797
5771
  get minimumWidth() {
5772
+ /**
5773
+ * defer to protected function to allow subclasses to override easily.
5774
+ * see https://github.com/microsoft/TypeScript/issues/338
5775
+ */
5776
+ return this.__minimumWidth();
5777
+ }
5778
+ get minimumHeight() {
5779
+ /**
5780
+ * defer to protected function to allow subclasses to override easily.
5781
+ * see https://github.com/microsoft/TypeScript/issues/338
5782
+ */
5783
+ return this.__minimumHeight();
5784
+ }
5785
+ get maximumHeight() {
5786
+ /**
5787
+ * defer to protected function to allow subclasses to override easily.
5788
+ * see https://github.com/microsoft/TypeScript/issues/338
5789
+ */
5790
+ return this.__maximumHeight();
5791
+ }
5792
+ get maximumWidth() {
5793
+ /**
5794
+ * defer to protected function to allow subclasses to override easily.
5795
+ * see https://github.com/microsoft/TypeScript/issues/338
5796
+ */
5797
+ return this.__maximumWidth();
5798
+ }
5799
+ __minimumWidth() {
5798
5800
  const width = typeof this._minimumWidth === 'function'
5799
5801
  ? this._minimumWidth()
5800
5802
  : this._minimumWidth;
@@ -5804,7 +5806,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5804
5806
  }
5805
5807
  return width;
5806
5808
  }
5807
- get minimumHeight() {
5809
+ __maximumWidth() {
5810
+ const width = typeof this._maximumWidth === 'function'
5811
+ ? this._maximumWidth()
5812
+ : this._maximumWidth;
5813
+ if (width !== this._evaluatedMaximumWidth) {
5814
+ this._evaluatedMaximumWidth = width;
5815
+ this.updateConstraints();
5816
+ }
5817
+ return width;
5818
+ }
5819
+ __minimumHeight() {
5808
5820
  const height = typeof this._minimumHeight === 'function'
5809
5821
  ? this._minimumHeight()
5810
5822
  : this._minimumHeight;
@@ -5814,7 +5826,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5814
5826
  }
5815
5827
  return height;
5816
5828
  }
5817
- get maximumHeight() {
5829
+ __maximumHeight() {
5818
5830
  const height = typeof this._maximumHeight === 'function'
5819
5831
  ? this._maximumHeight()
5820
5832
  : this._maximumHeight;
@@ -5824,16 +5836,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5824
5836
  }
5825
5837
  return height;
5826
5838
  }
5827
- get maximumWidth() {
5828
- const width = typeof this._maximumWidth === 'function'
5829
- ? this._maximumWidth()
5830
- : this._maximumWidth;
5831
- if (width !== this._evaluatedMaximumWidth) {
5832
- this._evaluatedMaximumWidth = width;
5833
- this.updateConstraints();
5834
- }
5835
- return width;
5836
- }
5837
5839
  get isActive() {
5838
5840
  return this.api.isActive;
5839
5841
  }
@@ -5984,6 +5986,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5984
5986
  position: options.group
5985
5987
  ? (_c = options.position) !== null && _c !== void 0 ? _c : 'center'
5986
5988
  : 'center',
5989
+ index: options.index,
5987
5990
  },
5988
5991
  });
5989
5992
  }
@@ -6035,30 +6038,34 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6035
6038
  get minimumWidth() {
6036
6039
  var _a;
6037
6040
  const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
6038
- return typeof activePanelMinimumWidth === 'number'
6039
- ? activePanelMinimumWidth
6040
- : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH;
6041
+ if (typeof activePanelMinimumWidth === 'number') {
6042
+ return activePanelMinimumWidth;
6043
+ }
6044
+ return super.__minimumWidth();
6041
6045
  }
6042
6046
  get minimumHeight() {
6043
6047
  var _a;
6044
6048
  const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
6045
- return typeof activePanelMinimumHeight === 'number'
6046
- ? activePanelMinimumHeight
6047
- : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT;
6049
+ if (typeof activePanelMinimumHeight === 'number') {
6050
+ return activePanelMinimumHeight;
6051
+ }
6052
+ return super.__minimumHeight();
6048
6053
  }
6049
6054
  get maximumWidth() {
6050
6055
  var _a;
6051
6056
  const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
6052
- return typeof activePanelMaximumWidth === 'number'
6053
- ? activePanelMaximumWidth
6054
- : Number.MAX_SAFE_INTEGER;
6057
+ if (typeof activePanelMaximumWidth === 'number') {
6058
+ return activePanelMaximumWidth;
6059
+ }
6060
+ return super.__maximumWidth();
6055
6061
  }
6056
6062
  get maximumHeight() {
6057
6063
  var _a;
6058
6064
  const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
6059
- return typeof activePanelMaximumHeight === 'number'
6060
- ? activePanelMaximumHeight
6061
- : Number.MAX_SAFE_INTEGER;
6065
+ if (typeof activePanelMaximumHeight === 'number') {
6066
+ return activePanelMaximumHeight;
6067
+ }
6068
+ return super.__maximumHeight();
6062
6069
  }
6063
6070
  get panels() {
6064
6071
  return this._model.panels;
@@ -6172,12 +6179,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6172
6179
  return this.group.api.getWindow();
6173
6180
  }
6174
6181
  moveTo(options) {
6175
- var _a;
6182
+ var _a, _b;
6176
6183
  this.accessor.moveGroupOrPanel({
6177
6184
  from: { groupId: this._group.id, panelId: this.panel.id },
6178
6185
  to: {
6179
- group: options.group,
6180
- position: (_a = options.position) !== null && _a !== void 0 ? _a : 'center',
6186
+ group: (_a = options.group) !== null && _a !== void 0 ? _a : this._group,
6187
+ position: options.group
6188
+ ? (_b = options.position) !== null && _b !== void 0 ? _b : 'center'
6189
+ : 'center',
6181
6190
  index: options.index,
6182
6191
  },
6183
6192
  });
@@ -6396,7 +6405,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6396
6405
  svg.setAttributeNS(null, 'viewBox', params.viewbox);
6397
6406
  svg.setAttributeNS(null, 'aria-hidden', 'false');
6398
6407
  svg.setAttributeNS(null, 'focusable', 'false');
6399
- svg.classList.add('dockview-svg');
6408
+ svg.classList.add('dv-svg');
6400
6409
  const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
6401
6410
  path.setAttributeNS(null, 'd', params.path);
6402
6411
  svg.appendChild(path);
@@ -6567,19 +6576,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6567
6576
  constructor() {
6568
6577
  super();
6569
6578
  this._element = document.createElement('div');
6570
- this._element.className = 'watermark';
6579
+ this._element.className = 'dv-watermark';
6571
6580
  const title = document.createElement('div');
6572
- title.className = 'watermark-title';
6581
+ title.className = 'dv-watermark-title';
6573
6582
  const emptySpace = document.createElement('span');
6574
6583
  emptySpace.style.flexGrow = '1';
6575
6584
  const content = document.createElement('div');
6576
- content.className = 'watermark-content';
6585
+ content.className = 'dv-watermark-content';
6577
6586
  this._element.appendChild(title);
6578
6587
  this._element.appendChild(content);
6579
6588
  const actionsContainer = document.createElement('div');
6580
- actionsContainer.className = 'actions-container';
6589
+ actionsContainer.className = 'dv-actions-container';
6581
6590
  const closeAnchor = document.createElement('div');
6582
- closeAnchor.className = 'close-action';
6591
+ closeAnchor.className = 'dv-close-action';
6583
6592
  closeAnchor.appendChild(createCloseButton());
6584
6593
  actionsContainer.appendChild(closeAnchor);
6585
6594
  title.appendChild(emptySpace);
@@ -6599,7 +6608,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6599
6608
  }
6600
6609
  render() {
6601
6610
  const isOneGroup = !!(this._api && this._api.size <= 1);
6602
- toggleClass(this.element, 'has-actions', isOneGroup);
6611
+ toggleClass(this.element, 'dv-has-actions', isOneGroup);
6603
6612
  }
6604
6613
  }
6605
6614
 
@@ -7210,7 +7219,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7210
7219
  window: this._window.value,
7211
7220
  });
7212
7221
  this._window.disposable.dispose();
7213
- this._window.value.close();
7214
7222
  this._window = null;
7215
7223
  this._onDidClose.fire();
7216
7224
  }
@@ -7242,7 +7250,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7242
7250
  }
7243
7251
  const disposable = new CompositeDisposable();
7244
7252
  this._window = { value: externalWindow, disposable };
7245
- disposable.addDisposables(addDisposableWindowListener(window, 'beforeunload', () => {
7253
+ disposable.addDisposables(exports.DockviewDisposable.from(() => {
7254
+ externalWindow.close();
7255
+ }), addDisposableWindowListener(window, 'beforeunload', () => {
7246
7256
  /**
7247
7257
  * before the main window closes we should close this popup too
7248
7258
  * to be good citizens
@@ -7259,7 +7269,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7259
7269
  id: this.target,
7260
7270
  window: externalWindow,
7261
7271
  });
7262
- return new Promise((resolve) => {
7272
+ return new Promise((resolve, reject) => {
7263
7273
  externalWindow.addEventListener('unload', (e) => {
7264
7274
  // if page fails to load before unloading
7265
7275
  // this.close();
@@ -7268,21 +7278,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7268
7278
  /**
7269
7279
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
7270
7280
  */
7271
- const externalDocument = externalWindow.document;
7272
- externalDocument.title = document.title;
7273
- externalDocument.body.appendChild(container);
7274
- addStyles(externalDocument, window.document.styleSheets);
7275
- /**
7276
- * beforeunload must be registered after load for reasons I could not determine
7277
- * otherwise the beforeunload event will not fire when the window is closed
7278
- */
7279
- addDisposableWindowListener(externalWindow, 'beforeunload', () => {
7281
+ try {
7282
+ const externalDocument = externalWindow.document;
7283
+ externalDocument.title = document.title;
7284
+ externalDocument.body.appendChild(container);
7285
+ addStyles(externalDocument, window.document.styleSheets);
7280
7286
  /**
7281
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
7287
+ * beforeunload must be registered after load for reasons I could not determine
7288
+ * otherwise the beforeunload event will not fire when the window is closed
7282
7289
  */
7283
- this.close();
7284
- });
7285
- resolve(container);
7290
+ addDisposableWindowListener(externalWindow, 'beforeunload', () => {
7291
+ /**
7292
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
7293
+ */
7294
+ this.close();
7295
+ });
7296
+ resolve(container);
7297
+ }
7298
+ catch (err) {
7299
+ // only except this is the DOM isn't setup. e.g. in a in correctly configured test
7300
+ reject(err);
7301
+ }
7286
7302
  });
7287
7303
  });
7288
7304
  });
@@ -7535,9 +7551,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7535
7551
  }
7536
7552
  const box = getBox();
7537
7553
  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();
7538
- if (itemToPopout.api.location.type === 'grid') {
7539
- itemToPopout.api.setVisible(false);
7540
- }
7541
7554
  const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
7542
7555
  theme !== null && theme !== void 0 ? theme : '', {
7543
7556
  url: (_c = options === null || options === void 0 ? void 0 : options.popoutUrl) !== null && _c !== void 0 ? _c : '/popout.html',
@@ -7556,11 +7569,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7556
7569
  .then((popoutContainer) => {
7557
7570
  var _a;
7558
7571
  if (_window.isDisposed) {
7559
- return;
7572
+ return false;
7560
7573
  }
7561
7574
  if (popoutContainer === null) {
7562
7575
  popoutWindowDisposable.dispose();
7563
- return;
7576
+ return false;
7564
7577
  }
7565
7578
  const gready = document.createElement('div');
7566
7579
  gready.className = 'dv-overlay-render-container';
@@ -7569,30 +7582,40 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7569
7582
  ? itemToPopout.group
7570
7583
  : itemToPopout;
7571
7584
  const referenceLocation = itemToPopout.api.location.type;
7572
- const group = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) !== null && _a !== void 0 ? _a : this.createGroup({ id: groupId });
7585
+ /**
7586
+ * The group that is being added doesn't already exist within the DOM, the most likely occurance
7587
+ * of this case is when being called from the `fromJSON(...)` method
7588
+ */
7589
+ const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
7590
+ const group = !isGroupAddedToDom
7591
+ ? referenceGroup
7592
+ : (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) !== null && _a !== void 0 ? _a : this.createGroup({ id: groupId });
7573
7593
  group.model.renderContainer = overlayRenderContainer;
7574
- if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGroup)) {
7594
+ group.layout(_window.window.innerWidth, _window.window.innerHeight);
7595
+ if (!this._groups.has(group.api.id)) {
7575
7596
  this._onDidAddGroup.fire(group);
7576
7597
  }
7577
- if (itemToPopout instanceof DockviewPanel) {
7578
- this.movingLock(() => {
7579
- const panel = referenceGroup.model.removePanel(itemToPopout);
7580
- group.model.openPanel(panel);
7581
- });
7582
- }
7583
- else {
7584
- this.movingLock(() => moveGroupWithoutDestroying({
7585
- from: referenceGroup,
7586
- to: group,
7587
- }));
7588
- switch (referenceLocation) {
7589
- case 'grid':
7590
- referenceGroup.api.setVisible(false);
7591
- break;
7592
- case 'floating':
7593
- case 'popout':
7594
- this.removeGroup(referenceGroup);
7595
- break;
7598
+ if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGroup) && isGroupAddedToDom) {
7599
+ if (itemToPopout instanceof DockviewPanel) {
7600
+ this.movingLock(() => {
7601
+ const panel = referenceGroup.model.removePanel(itemToPopout);
7602
+ group.model.openPanel(panel);
7603
+ });
7604
+ }
7605
+ else {
7606
+ this.movingLock(() => moveGroupWithoutDestroying({
7607
+ from: referenceGroup,
7608
+ to: group,
7609
+ }));
7610
+ switch (referenceLocation) {
7611
+ case 'grid':
7612
+ referenceGroup.api.setVisible(false);
7613
+ break;
7614
+ case 'floating':
7615
+ case 'popout':
7616
+ this.removeGroup(referenceGroup);
7617
+ break;
7618
+ }
7596
7619
  }
7597
7620
  }
7598
7621
  popoutContainer.classList.add('dv-dockview');
@@ -7603,6 +7626,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7603
7626
  type: 'popout',
7604
7627
  getWindow: () => _window.window,
7605
7628
  };
7629
+ if (isGroupAddedToDom &&
7630
+ itemToPopout.api.location.type === 'grid') {
7631
+ itemToPopout.api.setVisible(false);
7632
+ }
7606
7633
  this.doSetGroupAndPanelActive(group);
7607
7634
  popoutWindowDisposable.addDisposables(group.api.onDidActiveChange((event) => {
7608
7635
  var _a;
@@ -7617,9 +7644,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7617
7644
  const value = {
7618
7645
  window: _window,
7619
7646
  popoutGroup: group,
7620
- referenceGroup: this.getPanel(referenceGroup.id)
7621
- ? referenceGroup.id
7622
- : undefined,
7647
+ referenceGroup: !isGroupAddedToDom
7648
+ ? undefined
7649
+ : referenceGroup
7650
+ ? this.getPanel(referenceGroup.id)
7651
+ ? referenceGroup.id
7652
+ : undefined
7653
+ : undefined,
7623
7654
  disposable: {
7624
7655
  dispose: () => {
7625
7656
  popoutWindowDisposable.dispose();
@@ -7634,9 +7665,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7634
7665
  * window dimensions
7635
7666
  */
7636
7667
  addDisposableWindowListener(_window.window, 'resize', () => {
7637
- group.layout(window.innerWidth, window.innerHeight);
7668
+ group.layout(_window.window.innerWidth, _window.window.innerHeight);
7638
7669
  }), overlayRenderContainer, exports.DockviewDisposable.from(() => {
7639
- if (this.getPanel(referenceGroup.id)) {
7670
+ if (isGroupAddedToDom &&
7671
+ this.getPanel(referenceGroup.id)) {
7640
7672
  this.movingLock(() => moveGroupWithoutDestroying({
7641
7673
  from: group,
7642
7674
  to: referenceGroup,
@@ -7651,21 +7683,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7651
7683
  }
7652
7684
  }
7653
7685
  else if (this.getPanel(group.id)) {
7654
- const removedGroup = this.doRemoveGroup(group, {
7686
+ this.doRemoveGroup(group, {
7655
7687
  skipDispose: true,
7656
7688
  skipActive: true,
7689
+ skipPopoutReturn: true,
7657
7690
  });
7691
+ const removedGroup = group;
7658
7692
  removedGroup.model.renderContainer =
7659
7693
  this.overlayRenderContainer;
7660
7694
  removedGroup.model.location = { type: 'grid' };
7661
7695
  returnedGroup = removedGroup;
7696
+ this.doAddGroup(removedGroup, [0]);
7697
+ this.doSetGroupAndPanelActive(removedGroup);
7662
7698
  }
7663
7699
  }));
7664
7700
  this._popoutGroups.push(value);
7665
7701
  this.updateWatermark();
7702
+ return true;
7666
7703
  })
7667
7704
  .catch((err) => {
7668
7705
  console.error('dockview: failed to create popout window', err);
7706
+ return false;
7669
7707
  });
7670
7708
  }
7671
7709
  addFloatingGroup(item, options) {
@@ -7769,7 +7807,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7769
7807
  : (_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'
7770
7808
  ? undefined
7771
7809
  : (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
7772
- const el = group.element.querySelector('.void-container');
7810
+ const el = group.element.querySelector('.dv-void-container');
7773
7811
  if (!el) {
7774
7812
  throw new Error('failed to find drag handle');
7775
7813
  }
@@ -8052,7 +8090,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8052
8090
  this.addPopoutGroup((_c = (gridReferenceGroup
8053
8091
  ? this.getPanel(gridReferenceGroup)
8054
8092
  : undefined)) !== null && _c !== void 0 ? _c : group, {
8055
- skipRemoveGroup: true,
8056
8093
  position: position !== null && position !== void 0 ? position : undefined,
8057
8094
  overridePopoutGroup: gridReferenceGroup
8058
8095
  ? group
@@ -8070,6 +8107,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8070
8107
  }
8071
8108
  }
8072
8109
  catch (err) {
8110
+ console.error('dockview: failed to deserialize layout. Reverting changes', err);
8073
8111
  /**
8074
8112
  * Takes all the successfully created groups and remove all of their panels.
8075
8113
  */
@@ -8137,11 +8175,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8137
8175
  width: options.initialWidth,
8138
8176
  height: options.initialHeight,
8139
8177
  };
8178
+ let index;
8140
8179
  if (options.position) {
8141
8180
  if (isPanelOptionsWithPanel(options.position)) {
8142
8181
  const referencePanel = typeof options.position.referencePanel === 'string'
8143
8182
  ? this.getGroupPanel(options.position.referencePanel)
8144
8183
  : options.position.referencePanel;
8184
+ index = options.position.index;
8145
8185
  if (!referencePanel) {
8146
8186
  throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
8147
8187
  }
@@ -8152,6 +8192,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8152
8192
  typeof options.position.referenceGroup === 'string'
8153
8193
  ? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
8154
8194
  : options.position.referenceGroup;
8195
+ index = options.position.index;
8155
8196
  if (!referenceGroup) {
8156
8197
  throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
8157
8198
  }
@@ -8162,6 +8203,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8162
8203
  group.model.openPanel(panel, {
8163
8204
  skipSetActive: options.inactive,
8164
8205
  skipSetGroupActive: options.inactive,
8206
+ index,
8165
8207
  });
8166
8208
  if (!options.inactive) {
8167
8209
  this.doSetGroupAndPanelActive(group);
@@ -8191,6 +8233,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8191
8233
  group.model.openPanel(panel, {
8192
8234
  skipSetActive: options.inactive,
8193
8235
  skipSetGroupActive: options.inactive,
8236
+ index,
8194
8237
  });
8195
8238
  }
8196
8239
  else if (referenceGroup.api.location.type === 'floating' ||
@@ -8199,6 +8242,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8199
8242
  referenceGroup.model.openPanel(panel, {
8200
8243
  skipSetActive: options.inactive,
8201
8244
  skipSetGroupActive: options.inactive,
8245
+ index,
8202
8246
  });
8203
8247
  referenceGroup.api.setSize({
8204
8248
  width: initial === null || initial === void 0 ? void 0 : initial.width,
@@ -8219,6 +8263,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8219
8263
  group.model.openPanel(panel, {
8220
8264
  skipSetActive: options.inactive,
8221
8265
  skipSetGroupActive: options.inactive,
8266
+ index,
8222
8267
  });
8223
8268
  if (!options.inactive) {
8224
8269
  this.doSetGroupAndPanelActive(group);
@@ -8237,6 +8282,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8237
8282
  group.model.openPanel(panel, {
8238
8283
  skipSetActive: options.inactive,
8239
8284
  skipSetGroupActive: options.inactive,
8285
+ index,
8240
8286
  });
8241
8287
  }
8242
8288
  else {
@@ -8247,6 +8293,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8247
8293
  group.model.openPanel(panel, {
8248
8294
  skipSetActive: options.inactive,
8249
8295
  skipSetGroupActive: options.inactive,
8296
+ index,
8250
8297
  });
8251
8298
  if (!options.inactive) {
8252
8299
  this.doSetGroupAndPanelActive(group);
@@ -8787,6 +8834,31 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8787
8834
  }
8788
8835
  }
8789
8836
 
8837
+ function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
8838
+ const Component = typeof componentName === 'string'
8839
+ ? components[componentName]
8840
+ : undefined;
8841
+ const FrameworkComponent = typeof componentName === 'string'
8842
+ ? frameworkComponents[componentName]
8843
+ : undefined;
8844
+ if (Component && FrameworkComponent) {
8845
+ throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
8846
+ }
8847
+ if (FrameworkComponent) {
8848
+ if (!createFrameworkComponent) {
8849
+ throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
8850
+ }
8851
+ return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
8852
+ }
8853
+ if (!Component) {
8854
+ if (fallback) {
8855
+ return fallback();
8856
+ }
8857
+ throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
8858
+ }
8859
+ return new Component(id, componentName);
8860
+ }
8861
+
8790
8862
  class GridviewComponent extends BaseGrid {
8791
8863
  get orientation() {
8792
8864
  return this.gridview.orientation;
@@ -9335,12 +9407,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9335
9407
  this._expandedIcon = createExpandMoreButton();
9336
9408
  this._collapsedIcon = createChevronRightButton();
9337
9409
  this.disposable = new MutableDisposable();
9338
- this.apiRef = { api: null };
9410
+ this.apiRef = {
9411
+ api: null,
9412
+ };
9339
9413
  this._element = document.createElement('div');
9340
- this.element.className = 'default-header';
9414
+ this.element.className = 'dv-default-header';
9341
9415
  this._content = document.createElement('span');
9342
9416
  this._expander = document.createElement('div');
9343
- this._expander.className = 'dockview-pane-header-icon';
9417
+ this._expander.className = 'dv-pane-header-icon';
9344
9418
  this.element.appendChild(this._expander);
9345
9419
  this.element.appendChild(this._content);
9346
9420
  this.addDisposables(addDisposableListener(this._element, 'click', () => {
@@ -10197,22 +10271,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10197
10271
  disposable.dispose();
10198
10272
  };
10199
10273
  }, [props.onDidDrop]);
10200
- React.useEffect(() => {
10201
- if (!dockviewRef.current) {
10202
- return () => {
10203
- // noop
10204
- };
10205
- }
10206
- const disposable = dockviewRef.current.onUnhandledDragOverEvent((event) => {
10207
- var _a;
10208
- if ((_a = props.showDndOverlay) === null || _a === void 0 ? void 0 : _a.call(props, event)) {
10209
- event.accept();
10210
- }
10211
- });
10212
- return () => {
10213
- disposable.dispose();
10214
- };
10215
- }, [props.showDndOverlay]);
10216
10274
  React.useEffect(() => {
10217
10275
  if (!dockviewRef.current) {
10218
10276
  return () => {
@@ -10630,7 +10688,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10630
10688
  exports.GridviewComponent = GridviewComponent;
10631
10689
  exports.GridviewPanel = GridviewPanel;
10632
10690
  exports.GridviewReact = GridviewReact;
10633
- exports.LocalSelectionTransfer = LocalSelectionTransfer;
10634
10691
  exports.PROPERTY_KEYS = PROPERTY_KEYS;
10635
10692
  exports.PaneFramework = PaneFramework;
10636
10693
  exports.PaneTransfer = PaneTransfer;
@@ -10649,7 +10706,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10649
10706
  exports.SplitviewReact = SplitviewReact;
10650
10707
  exports.Tab = Tab;
10651
10708
  exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
10652
- exports.createComponent = createComponent;
10653
10709
  exports.createDockview = createDockview;
10654
10710
  exports.createGridview = createGridview;
10655
10711
  exports.createPaneview = createPaneview;