dockview-core 1.16.0 → 1.17.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 (84) hide show
  1. package/dist/cjs/api/component.api.d.ts +6 -4
  2. package/dist/cjs/dnd/groupDragHandler.js +1 -1
  3. package/dist/cjs/dockview/components/tab/defaultTab.js +2 -2
  4. package/dist/cjs/dockview/components/tab/tab.js +1 -1
  5. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +2 -2
  6. package/dist/cjs/dockview/components/watermark/watermark.d.ts +0 -7
  7. package/dist/cjs/dockview/components/watermark/watermark.js +3 -18
  8. package/dist/cjs/dockview/deserializer.js +4 -0
  9. package/dist/cjs/dockview/dockviewComponent.d.ts +2 -0
  10. package/dist/cjs/dockview/dockviewComponent.js +77 -58
  11. package/dist/cjs/dockview/dockviewGroupPanel.d.ts +4 -0
  12. package/dist/cjs/dockview/dockviewGroupPanel.js +49 -2
  13. package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +4 -0
  14. package/dist/cjs/dockview/dockviewGroupPanelModel.js +0 -1
  15. package/dist/cjs/dockview/dockviewPanel.d.ts +14 -1
  16. package/dist/cjs/dockview/dockviewPanel.js +36 -0
  17. package/dist/cjs/dockview/options.d.ts +16 -9
  18. package/dist/cjs/dockview/types.d.ts +5 -2
  19. package/dist/cjs/dom.d.ts +7 -0
  20. package/dist/cjs/dom.js +63 -1
  21. package/dist/cjs/gridview/baseComponentGridview.d.ts +3 -2
  22. package/dist/cjs/gridview/baseComponentGridview.js +30 -5
  23. package/dist/cjs/gridview/gridviewComponent.d.ts +2 -3
  24. package/dist/cjs/gridview/gridviewComponent.js +2 -2
  25. package/dist/cjs/gridview/gridviewPanel.d.ts +6 -0
  26. package/dist/cjs/overlay/overlay.js +6 -6
  27. package/dist/cjs/paneview/paneviewComponent.d.ts +1 -0
  28. package/dist/cjs/paneview/paneviewComponent.js +11 -3
  29. package/dist/cjs/splitview/splitviewComponent.d.ts +4 -4
  30. package/dist/cjs/splitview/splitviewComponent.js +13 -7
  31. package/dist/dockview-core.amd.js +231 -103
  32. package/dist/dockview-core.amd.js.map +1 -1
  33. package/dist/dockview-core.amd.min.js +2 -2
  34. package/dist/dockview-core.amd.min.js.map +1 -1
  35. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  36. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  37. package/dist/dockview-core.amd.noStyle.js +230 -102
  38. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  39. package/dist/dockview-core.cjs.js +231 -103
  40. package/dist/dockview-core.cjs.js.map +1 -1
  41. package/dist/dockview-core.esm.js +231 -103
  42. package/dist/dockview-core.esm.js.map +1 -1
  43. package/dist/dockview-core.esm.min.js +2 -2
  44. package/dist/dockview-core.esm.min.js.map +1 -1
  45. package/dist/dockview-core.js +231 -103
  46. package/dist/dockview-core.js.map +1 -1
  47. package/dist/dockview-core.min.js +2 -2
  48. package/dist/dockview-core.min.js.map +1 -1
  49. package/dist/dockview-core.min.noStyle.js +2 -2
  50. package/dist/dockview-core.min.noStyle.js.map +1 -1
  51. package/dist/dockview-core.noStyle.js +230 -102
  52. package/dist/dockview-core.noStyle.js.map +1 -1
  53. package/dist/esm/api/component.api.d.ts +6 -4
  54. package/dist/esm/dnd/groupDragHandler.js +1 -1
  55. package/dist/esm/dockview/components/tab/defaultTab.js +2 -2
  56. package/dist/esm/dockview/components/tab/tab.js +1 -1
  57. package/dist/esm/dockview/components/titlebar/tabsContainer.js +2 -2
  58. package/dist/esm/dockview/components/watermark/watermark.d.ts +0 -7
  59. package/dist/esm/dockview/components/watermark/watermark.js +3 -18
  60. package/dist/esm/dockview/deserializer.js +4 -0
  61. package/dist/esm/dockview/dockviewComponent.d.ts +2 -0
  62. package/dist/esm/dockview/dockviewComponent.js +76 -54
  63. package/dist/esm/dockview/dockviewGroupPanel.d.ts +4 -0
  64. package/dist/esm/dockview/dockviewGroupPanel.js +33 -2
  65. package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +4 -0
  66. package/dist/esm/dockview/dockviewGroupPanelModel.js +0 -1
  67. package/dist/esm/dockview/dockviewPanel.d.ts +14 -1
  68. package/dist/esm/dockview/dockviewPanel.js +20 -0
  69. package/dist/esm/dockview/options.d.ts +16 -9
  70. package/dist/esm/dockview/types.d.ts +5 -2
  71. package/dist/esm/dom.d.ts +7 -0
  72. package/dist/esm/dom.js +36 -0
  73. package/dist/esm/gridview/baseComponentGridview.d.ts +3 -2
  74. package/dist/esm/gridview/baseComponentGridview.js +30 -5
  75. package/dist/esm/gridview/gridviewComponent.d.ts +2 -3
  76. package/dist/esm/gridview/gridviewComponent.js +2 -2
  77. package/dist/esm/gridview/gridviewPanel.d.ts +6 -0
  78. package/dist/esm/overlay/overlay.js +6 -6
  79. package/dist/esm/paneview/paneviewComponent.d.ts +1 -0
  80. package/dist/esm/paneview/paneviewComponent.js +11 -3
  81. package/dist/esm/splitview/splitviewComponent.d.ts +4 -4
  82. package/dist/esm/splitview/splitviewComponent.js +13 -7
  83. package/dist/styles/dockview.css +1 -1
  84. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 1.16.0
3
+ * @version 1.17.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -551,6 +551,42 @@ define(['exports'], (function (exports) { 'use strict';
551
551
  },
552
552
  };
553
553
  }
554
+ function getDockviewTheme(element) {
555
+ function toClassList(element) {
556
+ const list = [];
557
+ for (let i = 0; i < element.classList.length; i++) {
558
+ list.push(element.classList.item(i));
559
+ }
560
+ return list;
561
+ }
562
+ let theme = undefined;
563
+ let parent = element;
564
+ while (parent !== null) {
565
+ theme = toClassList(parent).find((cls) => cls.startsWith('dockview-theme-'));
566
+ if (typeof theme === 'string') {
567
+ break;
568
+ }
569
+ parent = parent.parentElement;
570
+ }
571
+ return theme;
572
+ }
573
+ class Classnames {
574
+ constructor(element) {
575
+ this.element = element;
576
+ this._classNames = [];
577
+ }
578
+ setClassNames(classNames) {
579
+ for (const className of this._classNames) {
580
+ toggleClass(this.element, className, false);
581
+ }
582
+ this._classNames = classNames
583
+ .split(' ')
584
+ .filter((v) => v.trim().length > 0);
585
+ for (const className of this._classNames) {
586
+ toggleClass(this.element, className, true);
587
+ }
588
+ }
589
+ }
554
590
 
555
591
  function tail(arr) {
556
592
  if (arr.length === 0) {
@@ -2670,7 +2706,8 @@ define(['exports'], (function (exports) { 'use strict';
2670
2706
  set locked(value) {
2671
2707
  this.gridview.locked = value;
2672
2708
  }
2673
- constructor(options) {
2709
+ constructor(parentElement, options) {
2710
+ var _a;
2674
2711
  super(document.createElement('div'), options.disableAutoResizing);
2675
2712
  this._id = nextLayoutId$1.next();
2676
2713
  this._groups = new Map();
@@ -2686,10 +2723,9 @@ define(['exports'], (function (exports) { 'use strict';
2686
2723
  this.onDidViewVisibilityChangeMicroTaskQueue = this._onDidViewVisibilityChangeMicroTaskQueue.onEvent;
2687
2724
  this.element.style.height = '100%';
2688
2725
  this.element.style.width = '100%';
2689
- if (typeof options.className === 'string') {
2690
- this.element.classList.add(options.className);
2691
- }
2692
- options.parentElement.appendChild(this.element);
2726
+ this._classNames = new Classnames(this.element);
2727
+ this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
2728
+ parentElement.appendChild(this.element);
2693
2729
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2694
2730
  this.gridview.locked = !!options.locked;
2695
2731
  this.element.appendChild(this.gridview.element);
@@ -2712,6 +2748,25 @@ define(['exports'], (function (exports) { 'use strict';
2712
2748
  isVisible(panel) {
2713
2749
  return this.gridview.isViewVisible(getGridLocation(panel.element));
2714
2750
  }
2751
+ updateOptions(options) {
2752
+ var _a, _b, _c, _d;
2753
+ if (typeof options.proportionalLayout === 'boolean') ;
2754
+ if (options.orientation) {
2755
+ this.gridview.orientation = options.orientation;
2756
+ }
2757
+ if ('disableResizing' in options) {
2758
+ this.disableResizing = (_a = options.disableAutoResizing) !== null && _a !== void 0 ? _a : false;
2759
+ }
2760
+ if ('locked' in options) {
2761
+ this.locked = (_b = options.locked) !== null && _b !== void 0 ? _b : false;
2762
+ }
2763
+ if ('margin' in options) {
2764
+ this.gridview.margin = (_c = options.margin) !== null && _c !== void 0 ? _c : 0;
2765
+ }
2766
+ if ('className' in options) {
2767
+ this._classNames.setClassNames((_d = options.className) !== null && _d !== void 0 ? _d : '');
2768
+ }
2769
+ }
2715
2770
  maximizeGroup(panel) {
2716
2771
  this.gridview.maximizeView(panel);
2717
2772
  this.doSetGroupActive(panel);
@@ -4635,7 +4690,7 @@ define(['exports'], (function (exports) { 'use strict';
4635
4690
  this.onWillShowOverlay = this.dropTarget.onWillShowOverlay;
4636
4691
  this.addDisposables(this._onChanged, this._onDropped, this._onDragStart, dragHandler.onDragStart((event) => {
4637
4692
  this._onDragStart.fire(event);
4638
- }), dragHandler, addDisposableListener(this._element, 'mousedown', (event) => {
4693
+ }), dragHandler, addDisposableListener(this._element, 'pointerdown', (event) => {
4639
4694
  if (event.defaultPrevented) {
4640
4695
  return;
4641
4696
  }
@@ -4677,7 +4732,7 @@ define(['exports'], (function (exports) { 'use strict';
4677
4732
  this.accessor = accessor;
4678
4733
  this.group = group;
4679
4734
  this.panelTransfer = LocalSelectionTransfer.getInstance();
4680
- this.addDisposables(addDisposableListener(element, 'mousedown', (e) => {
4735
+ this.addDisposables(addDisposableListener(element, 'pointerdown', (e) => {
4681
4736
  if (e.shiftKey) {
4682
4737
  /**
4683
4738
  * You cannot call e.preventDefault() because that will prevent drag events from firing
@@ -4896,7 +4951,7 @@ define(['exports'], (function (exports) { 'use strict';
4896
4951
  group: this.group,
4897
4952
  getData: getPanelData,
4898
4953
  }));
4899
- }), addDisposableListener(this.voidContainer.element, 'mousedown', (event) => {
4954
+ }), addDisposableListener(this.voidContainer.element, 'pointerdown', (event) => {
4900
4955
  const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
4901
4956
  if (isFloatingGroupsEnabled &&
4902
4957
  event.shiftKey &&
@@ -4910,7 +4965,7 @@ define(['exports'], (function (exports) { 'use strict';
4910
4965
  inDragMode: true,
4911
4966
  });
4912
4967
  }
4913
- }), addDisposableListener(this.tabContainer, 'mousedown', (event) => {
4968
+ }), addDisposableListener(this.tabContainer, 'pointerdown', (event) => {
4914
4969
  if (event.defaultPrevented) {
4915
4970
  return;
4916
4971
  }
@@ -5615,7 +5670,6 @@ define(['exports'], (function (exports) { 'use strict';
5615
5670
  });
5616
5671
  this.tabsContainer.hide();
5617
5672
  this.contentContainer.element.appendChild(this.watermark.element);
5618
- this.watermark.updateParentGroup(this.groupPanel, true);
5619
5673
  }
5620
5674
  if (!this.isEmpty && this.watermark) {
5621
5675
  this.watermark.element.remove();
@@ -5978,6 +6032,34 @@ define(['exports'], (function (exports) { 'use strict';
5978
6032
  const MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH = 100;
5979
6033
  const MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
5980
6034
  class DockviewGroupPanel extends GridviewPanel {
6035
+ get minimumWidth() {
6036
+ var _a;
6037
+ 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
+ }
6042
+ get minimumHeight() {
6043
+ var _a;
6044
+ 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;
6048
+ }
6049
+ get maximumWidth() {
6050
+ var _a;
6051
+ 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;
6055
+ }
6056
+ get maximumHeight() {
6057
+ var _a;
6058
+ 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;
6062
+ }
5981
6063
  get panels() {
5982
6064
  return this._model.panels;
5983
6065
  }
@@ -6000,9 +6082,12 @@ define(['exports'], (function (exports) { 'use strict';
6000
6082
  return this._model.header;
6001
6083
  }
6002
6084
  constructor(accessor, id, options) {
6085
+ var _a, _b, _c, _d, _e, _f;
6003
6086
  super(id, 'groupview_default', {
6004
- minimumHeight: MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
6005
- minimumWidth: MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6087
+ minimumHeight: (_b = (_a = options.constraints) === null || _a === void 0 ? void 0 : _a.minimumHeight) !== null && _b !== void 0 ? _b : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
6088
+ minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.maximumHeight) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6089
+ maximumHeight: (_e = options.constraints) === null || _e === void 0 ? void 0 : _e.maximumHeight,
6090
+ maximumWidth: (_f = options.constraints) === null || _f === void 0 ? void 0 : _f.maximumWidth,
6006
6091
  }, new DockviewGroupPanelApiImpl(id, accessor));
6007
6092
  this.api.initialize(this); // cannot use 'this' after after 'super' call
6008
6093
  this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
@@ -6158,6 +6243,18 @@ define(['exports'], (function (exports) { 'use strict';
6158
6243
  var _a;
6159
6244
  return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
6160
6245
  }
6246
+ get minimumWidth() {
6247
+ return this._minimumWidth;
6248
+ }
6249
+ get minimumHeight() {
6250
+ return this._minimumHeight;
6251
+ }
6252
+ get maximumWidth() {
6253
+ return this._maximumWidth;
6254
+ }
6255
+ get maximumHeight() {
6256
+ return this._maximumHeight;
6257
+ }
6161
6258
  constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
6162
6259
  super();
6163
6260
  this.id = id;
@@ -6166,6 +6263,10 @@ define(['exports'], (function (exports) { 'use strict';
6166
6263
  this.view = view;
6167
6264
  this._renderer = options.renderer;
6168
6265
  this._group = group;
6266
+ this._minimumWidth = options.minimumWidth;
6267
+ this._minimumHeight = options.minimumHeight;
6268
+ this._maximumWidth = options.maximumWidth;
6269
+ this._maximumHeight = options.maximumHeight;
6169
6270
  this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
6170
6271
  this.addDisposables(this.api.onActiveChange(() => {
6171
6272
  accessor.setActivePanel(this);
@@ -6202,6 +6303,10 @@ define(['exports'], (function (exports) { 'use strict';
6202
6303
  : undefined,
6203
6304
  title: this.title,
6204
6305
  renderer: this._renderer,
6306
+ minimumHeight: this._minimumHeight,
6307
+ maximumHeight: this._maximumHeight,
6308
+ minimumWidth: this._minimumWidth,
6309
+ maximumWidth: this._maximumWidth,
6205
6310
  };
6206
6311
  }
6207
6312
  setTitle(title) {
@@ -6331,7 +6436,7 @@ define(['exports'], (function (exports) { 'use strict';
6331
6436
  this.action.appendChild(createCloseButton());
6332
6437
  this._element.appendChild(this._content);
6333
6438
  this._element.appendChild(this.action);
6334
- this.addDisposables(addDisposableListener(this.action, 'mousedown', (ev) => {
6439
+ this.addDisposables(addDisposableListener(this.action, 'pointerdown', (ev) => {
6335
6440
  ev.preventDefault();
6336
6441
  }));
6337
6442
  this.render();
@@ -6341,7 +6446,7 @@ define(['exports'], (function (exports) { 'use strict';
6341
6446
  this.addDisposables(params.api.onDidTitleChange((event) => {
6342
6447
  this._title = event.title;
6343
6448
  this.render();
6344
- }), addDisposableListener(this.action, 'mousedown', (ev) => {
6449
+ }), addDisposableListener(this.action, 'pointerdown', (ev) => {
6345
6450
  ev.preventDefault();
6346
6451
  }), addDisposableListener(this.action, 'click', (ev) => {
6347
6452
  if (ev.defaultPrevented) {
@@ -6442,6 +6547,10 @@ define(['exports'], (function (exports) { 'use strict';
6442
6547
  const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
6443
6548
  const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
6444
6549
  renderer: panelData.renderer,
6550
+ minimumWidth: panelData.minimumWidth,
6551
+ minimumHeight: panelData.minimumHeight,
6552
+ maximumWidth: panelData.maximumWidth,
6553
+ maximumHeight: panelData.maximumHeight,
6445
6554
  });
6446
6555
  panel.init({
6447
6556
  title: title !== null && title !== void 0 ? title : panelId,
@@ -6475,34 +6584,19 @@ define(['exports'], (function (exports) { 'use strict';
6475
6584
  actionsContainer.appendChild(closeAnchor);
6476
6585
  title.appendChild(emptySpace);
6477
6586
  title.appendChild(actionsContainer);
6478
- this.addDisposables(addDisposableListener(closeAnchor, 'click', (ev) => {
6587
+ this.addDisposables(addDisposableListener(closeAnchor, 'click', (event) => {
6479
6588
  var _a;
6480
- ev.preventDefault();
6589
+ event.preventDefault();
6481
6590
  if (this._group) {
6482
6591
  (_a = this._api) === null || _a === void 0 ? void 0 : _a.removeGroup(this._group);
6483
6592
  }
6484
6593
  }));
6485
6594
  }
6486
- update(_event) {
6487
- // noop
6488
- }
6489
- focus() {
6490
- // noop
6491
- }
6492
- layout(_width, _height) {
6493
- // noop
6494
- }
6495
6595
  init(_params) {
6496
6596
  this._api = _params.containerApi;
6597
+ this._group = _params.group;
6497
6598
  this.render();
6498
6599
  }
6499
- updateParentGroup(group, _visible) {
6500
- this._group = group;
6501
- this.render();
6502
- }
6503
- dispose() {
6504
- super.dispose();
6505
- }
6506
6600
  render() {
6507
6601
  const isOneGroup = !!(this._api && this._api.size <= 1);
6508
6602
  toggleClass(this.element, 'has-actions', isOneGroup);
@@ -6661,7 +6755,7 @@ define(['exports'], (function (exports) { 'use strict';
6661
6755
  dispose: () => {
6662
6756
  iframes.release();
6663
6757
  },
6664
- }, addDisposableWindowListener(window, 'mousemove', (e) => {
6758
+ }, addDisposableWindowListener(window, 'pointermove', (e) => {
6665
6759
  const containerRect = this.options.container.getBoundingClientRect();
6666
6760
  const x = e.clientX - containerRect.left;
6667
6761
  const y = e.clientY - containerRect.top;
@@ -6704,7 +6798,7 @@ define(['exports'], (function (exports) { 'use strict';
6704
6798
  this._onDidChangeEnd.fire();
6705
6799
  }));
6706
6800
  };
6707
- this.addDisposables(move, addDisposableListener(dragTarget, 'mousedown', (event) => {
6801
+ this.addDisposables(move, addDisposableListener(dragTarget, 'pointerdown', (event) => {
6708
6802
  if (event.defaultPrevented) {
6709
6803
  event.preventDefault();
6710
6804
  return;
@@ -6715,7 +6809,7 @@ define(['exports'], (function (exports) { 'use strict';
6715
6809
  return;
6716
6810
  }
6717
6811
  track();
6718
- }), addDisposableListener(this.options.content, 'mousedown', (event) => {
6812
+ }), addDisposableListener(this.options.content, 'pointerdown', (event) => {
6719
6813
  if (event.defaultPrevented) {
6720
6814
  return;
6721
6815
  }
@@ -6727,7 +6821,7 @@ define(['exports'], (function (exports) { 'use strict';
6727
6821
  if (event.shiftKey) {
6728
6822
  track();
6729
6823
  }
6730
- }), addDisposableListener(this.options.content, 'mousedown', () => {
6824
+ }), addDisposableListener(this.options.content, 'pointerdown', () => {
6731
6825
  arialLevelTracker.push(this._element);
6732
6826
  }, true));
6733
6827
  if (options.inDragMode) {
@@ -6739,11 +6833,11 @@ define(['exports'], (function (exports) { 'use strict';
6739
6833
  resizeHandleElement.className = `dv-resize-handle-${direction}`;
6740
6834
  this._element.appendChild(resizeHandleElement);
6741
6835
  const move = new MutableDisposable();
6742
- this.addDisposables(move, addDisposableListener(resizeHandleElement, 'mousedown', (e) => {
6836
+ this.addDisposables(move, addDisposableListener(resizeHandleElement, 'pointerdown', (e) => {
6743
6837
  e.preventDefault();
6744
6838
  let startPosition = null;
6745
6839
  const iframes = disableIframePointEvents();
6746
- move.value = new CompositeDisposable(addDisposableWindowListener(window, 'mousemove', (e) => {
6840
+ move.value = new CompositeDisposable(addDisposableWindowListener(window, 'pointermove', (e) => {
6747
6841
  const containerRect = this.options.container.getBoundingClientRect();
6748
6842
  const overlayRect = this._element.getBoundingClientRect();
6749
6843
  const y = e.clientY - containerRect.top;
@@ -7248,25 +7342,6 @@ define(['exports'], (function (exports) { 'use strict';
7248
7342
  });
7249
7343
  });
7250
7344
  }
7251
- function getDockviewTheme(element) {
7252
- function toClassList(element) {
7253
- const list = [];
7254
- for (let i = 0; i < element.classList.length; i++) {
7255
- list.push(element.classList.item(i));
7256
- }
7257
- return list;
7258
- }
7259
- let theme = undefined;
7260
- let parent = element;
7261
- while (parent !== null) {
7262
- theme = toClassList(parent).find((cls) => cls.startsWith('dockview-theme-'));
7263
- if (typeof theme === 'string') {
7264
- break;
7265
- }
7266
- parent = parent.parentElement;
7267
- }
7268
- return theme;
7269
- }
7270
7345
  class DockviewComponent extends BaseGrid {
7271
7346
  get orientation() {
7272
7347
  return this.gridview.orientation;
@@ -7302,13 +7377,12 @@ define(['exports'], (function (exports) { 'use strict';
7302
7377
  }
7303
7378
  constructor(parentElement, options) {
7304
7379
  var _a;
7305
- super({
7380
+ super(parentElement, {
7306
7381
  proportionalLayout: true,
7307
7382
  orientation: exports.Orientation.HORIZONTAL,
7308
7383
  styles: options.hideBorders
7309
7384
  ? { separatorBorder: 'transparent' }
7310
7385
  : undefined,
7311
- parentElement: parentElement,
7312
7386
  disableAutoResizing: options.disableAutoResizing,
7313
7387
  locked: options.locked,
7314
7388
  margin: options.gap,
@@ -7348,9 +7422,6 @@ define(['exports'], (function (exports) { 'use strict';
7348
7422
  this._onDidActiveGroupChange = new Emitter();
7349
7423
  this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
7350
7424
  this._moving = false;
7351
- // const gready = document.createElement('div');
7352
- // gready.className = 'dv-overlay-render-container';
7353
- // this.gridview.element.appendChild(gready);
7354
7425
  this.overlayRenderContainer = new OverlayRenderContainer(this.gridview.element, this);
7355
7426
  toggleClass(this.gridview.element, 'dv-dockview', true);
7356
7427
  toggleClass(this.element, 'dv-debug', !!options.debug);
@@ -7799,15 +7870,11 @@ define(['exports'], (function (exports) { 'use strict';
7799
7870
  }
7800
7871
  }
7801
7872
  updateOptions(options) {
7802
- var _a, _b;
7803
- const changed_floatingGroupBounds = 'floatingGroupBounds' in options &&
7804
- options.floatingGroupBounds !== this.options.floatingGroupBounds;
7805
- const changed_rootOverlayOptions = 'rootOverlayModel' in options &&
7806
- options.rootOverlayModel !== this.options.rootOverlayModel;
7807
- this._options = Object.assign(Object.assign({}, this.options), options);
7808
- if (changed_floatingGroupBounds) {
7873
+ var _a, _b, _c, _d;
7874
+ super.updateOptions(options);
7875
+ if ('floatingGroupBounds' in options) {
7809
7876
  for (const group of this._floatingGroups) {
7810
- switch (this.options.floatingGroupBounds) {
7877
+ switch (options.floatingGroupBounds) {
7811
7878
  case 'boundedWithinViewport':
7812
7879
  group.overlay.minimumInViewportHeight = undefined;
7813
7880
  group.overlay.minimumInViewportWidth = undefined;
@@ -7820,25 +7887,20 @@ define(['exports'], (function (exports) { 'use strict';
7820
7887
  break;
7821
7888
  default:
7822
7889
  group.overlay.minimumInViewportHeight =
7823
- (_a = this.options.floatingGroupBounds) === null || _a === void 0 ? void 0 : _a.minimumHeightWithinViewport;
7890
+ (_a = options.floatingGroupBounds) === null || _a === void 0 ? void 0 : _a.minimumHeightWithinViewport;
7824
7891
  group.overlay.minimumInViewportWidth =
7825
- (_b = this.options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport;
7892
+ (_b = options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport;
7826
7893
  }
7827
7894
  group.overlay.setBounds();
7828
7895
  }
7829
7896
  }
7830
- if (changed_rootOverlayOptions) {
7831
- this._rootDropTarget.setOverlayModel(options.rootOverlayModel);
7897
+ if ('rootOverlayModel' in options) {
7898
+ this._rootDropTarget.setOverlayModel((_c = options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL);
7832
7899
  }
7833
- if (
7834
- // if explicitly set as `undefined`
7835
- 'gap' in options &&
7836
- options.gap === undefined) {
7837
- this.gridview.margin = 0;
7838
- }
7839
- if (typeof options.gap === 'number') {
7840
- this.gridview.margin = options.gap;
7900
+ if ('gap' in options) {
7901
+ this.gridview.margin = (_d = options.gap) !== null && _d !== void 0 ? _d : 0;
7841
7902
  }
7903
+ this._options = Object.assign(Object.assign({}, this.options), options);
7842
7904
  this.layout(this.gridview.width, this.gridview.height, true);
7843
7905
  }
7844
7906
  layout(width, height, forceResize) {
@@ -8095,6 +8157,10 @@ define(['exports'], (function (exports) { 'use strict';
8095
8157
  if (options.position && options.floating) {
8096
8158
  throw new Error('you can only provide one of: position, floating as arguments to .addPanel(...)');
8097
8159
  }
8160
+ const initial = {
8161
+ width: options.initialWidth,
8162
+ height: options.initialHeight,
8163
+ };
8098
8164
  if (options.position) {
8099
8165
  if (isPanelOptionsWithPanel(options.position)) {
8100
8166
  const referencePanel = typeof options.position.referencePanel === 'string'
@@ -8124,6 +8190,10 @@ define(['exports'], (function (exports) { 'use strict';
8124
8190
  if (!options.inactive) {
8125
8191
  this.doSetGroupAndPanelActive(group);
8126
8192
  }
8193
+ group.api.setSize({
8194
+ height: initial === null || initial === void 0 ? void 0 : initial.height,
8195
+ width: initial === null || initial === void 0 ? void 0 : initial.width,
8196
+ });
8127
8197
  return panel;
8128
8198
  }
8129
8199
  }
@@ -8154,6 +8224,10 @@ define(['exports'], (function (exports) { 'use strict';
8154
8224
  skipSetActive: options.inactive,
8155
8225
  skipSetGroupActive: options.inactive,
8156
8226
  });
8227
+ referenceGroup.api.setSize({
8228
+ width: initial === null || initial === void 0 ? void 0 : initial.width,
8229
+ height: initial === null || initial === void 0 ? void 0 : initial.height,
8230
+ });
8157
8231
  if (!options.inactive) {
8158
8232
  this.doSetGroupAndPanelActive(referenceGroup);
8159
8233
  }
@@ -8161,7 +8235,10 @@ define(['exports'], (function (exports) { 'use strict';
8161
8235
  else {
8162
8236
  const location = getGridLocation(referenceGroup.element);
8163
8237
  const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
8164
- const group = this.createGroupAtLocation(relativeLocation);
8238
+ const group = this.createGroupAtLocation(relativeLocation, this.orientationAtLocation(relativeLocation) ===
8239
+ exports.Orientation.VERTICAL
8240
+ ? initial === null || initial === void 0 ? void 0 : initial.height
8241
+ : initial === null || initial === void 0 ? void 0 : initial.width);
8165
8242
  panel = this.createPanel(options, group);
8166
8243
  group.model.openPanel(panel, {
8167
8244
  skipSetActive: options.inactive,
@@ -8187,7 +8264,9 @@ define(['exports'], (function (exports) { 'use strict';
8187
8264
  });
8188
8265
  }
8189
8266
  else {
8190
- const group = this.createGroupAtLocation();
8267
+ const group = this.createGroupAtLocation([0], this.gridview.orientation === exports.Orientation.VERTICAL
8268
+ ? initial === null || initial === void 0 ? void 0 : initial.height
8269
+ : initial === null || initial === void 0 ? void 0 : initial.width);
8191
8270
  panel = this.createPanel(options, group);
8192
8271
  group.model.openPanel(panel, {
8193
8272
  skipSetActive: options.inactive,
@@ -8281,7 +8360,11 @@ define(['exports'], (function (exports) { 'use strict';
8281
8360
  const location = getGridLocation(referenceGroup.element);
8282
8361
  const relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
8283
8362
  const group = this.createGroup(options);
8284
- this.doAddGroup(group, relativeLocation);
8363
+ const size = this.getLocationOrientation(relativeLocation) ===
8364
+ exports.Orientation.VERTICAL
8365
+ ? options.initialHeight
8366
+ : options.initialWidth;
8367
+ this.doAddGroup(group, relativeLocation, size);
8285
8368
  if (!options.skipSetActive) {
8286
8369
  this.doSetGroupAndPanelActive(group);
8287
8370
  }
@@ -8294,6 +8377,12 @@ define(['exports'], (function (exports) { 'use strict';
8294
8377
  return group;
8295
8378
  }
8296
8379
  }
8380
+ getLocationOrientation(location) {
8381
+ return location.length % 2 == 0 &&
8382
+ this.gridview.orientation === exports.Orientation.HORIZONTAL
8383
+ ? exports.Orientation.HORIZONTAL
8384
+ : exports.Orientation.VERTICAL;
8385
+ }
8297
8386
  removeGroup(group, options) {
8298
8387
  this.doRemoveGroup(group, options);
8299
8388
  }
@@ -8565,7 +8654,22 @@ define(['exports'], (function (exports) { 'use strict';
8565
8654
  }
8566
8655
  const referenceLocation = getGridLocation(to.element);
8567
8656
  const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
8568
- this.gridview.addView(from, exports.Sizing.Distribute, dropLocation);
8657
+ let size;
8658
+ switch (this.gridview.orientation) {
8659
+ case exports.Orientation.VERTICAL:
8660
+ size =
8661
+ referenceLocation.length % 2 == 0
8662
+ ? from.api.width
8663
+ : from.api.height;
8664
+ break;
8665
+ case exports.Orientation.HORIZONTAL:
8666
+ size =
8667
+ referenceLocation.length % 2 == 0
8668
+ ? from.api.height
8669
+ : from.api.width;
8670
+ break;
8671
+ }
8672
+ this.gridview.addView(from, size, dropLocation);
8569
8673
  }
8570
8674
  from.panels.forEach((panel) => {
8571
8675
  this._onDidMovePanel.fire({ panel, from });
@@ -8677,22 +8781,34 @@ define(['exports'], (function (exports) { 'use strict';
8677
8781
  const contentComponent = options.component;
8678
8782
  const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
8679
8783
  const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
8680
- const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, { renderer: options.renderer });
8784
+ const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, {
8785
+ renderer: options.renderer,
8786
+ minimumWidth: options.minimumWidth,
8787
+ minimumHeight: options.minimumHeight,
8788
+ maximumWidth: options.maximumWidth,
8789
+ maximumHeight: options.maximumHeight,
8790
+ });
8681
8791
  panel.init({
8682
8792
  title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
8683
8793
  params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
8684
8794
  });
8685
8795
  return panel;
8686
8796
  }
8687
- createGroupAtLocation(location = [0]) {
8797
+ createGroupAtLocation(location, size) {
8688
8798
  const group = this.createGroup();
8689
- this.doAddGroup(group, location);
8799
+ this.doAddGroup(group, location, size);
8690
8800
  return group;
8691
8801
  }
8692
8802
  findGroup(panel) {
8693
8803
  var _a;
8694
8804
  return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
8695
8805
  }
8806
+ orientationAtLocation(location) {
8807
+ const rootOrientation = this.gridview.orientation;
8808
+ return location.length % 2 == 1
8809
+ ? rootOrientation
8810
+ : orthogonal(rootOrientation);
8811
+ }
8696
8812
  }
8697
8813
 
8698
8814
  class GridviewComponent extends BaseGrid {
@@ -8712,8 +8828,7 @@ define(['exports'], (function (exports) { 'use strict';
8712
8828
  this._deserializer = value;
8713
8829
  }
8714
8830
  constructor(parentElement, options) {
8715
- super({
8716
- parentElement: parentElement,
8831
+ super(parentElement, {
8717
8832
  proportionalLayout: options.proportionalLayout,
8718
8833
  orientation: options.orientation,
8719
8834
  styles: options.styles,
@@ -8744,6 +8859,7 @@ define(['exports'], (function (exports) { 'use strict';
8744
8859
  }
8745
8860
  }
8746
8861
  updateOptions(options) {
8862
+ super.updateOptions(options);
8747
8863
  const hasOrientationChanged = typeof options.orientation === 'string' &&
8748
8864
  this.gridview.orientation !== options.orientation;
8749
8865
  this._options = Object.assign(Object.assign({}, this.options), options);
@@ -9011,6 +9127,7 @@ define(['exports'], (function (exports) { 'use strict';
9011
9127
  : this.splitview.orthogonalSize;
9012
9128
  }
9013
9129
  constructor(parentElement, options) {
9130
+ var _a;
9014
9131
  super(parentElement, options.disableAutoResizing);
9015
9132
  this._splitviewChangeDisposable = new MutableDisposable();
9016
9133
  this._panels = new Map();
@@ -9022,9 +9139,8 @@ define(['exports'], (function (exports) { 'use strict';
9022
9139
  this.onDidRemoveView = this._onDidRemoveView.event;
9023
9140
  this._onDidLayoutChange = new Emitter();
9024
9141
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9025
- if (typeof options.className === 'string') {
9026
- this.element.classList.add(options.className);
9027
- }
9142
+ this._classNames = new Classnames(this.element);
9143
+ this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9028
9144
  this._options = options;
9029
9145
  if (!options.components) {
9030
9146
  options.components = {};
@@ -9036,12 +9152,17 @@ define(['exports'], (function (exports) { 'use strict';
9036
9152
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
9037
9153
  }
9038
9154
  updateOptions(options) {
9039
- const hasOrientationChanged = typeof options.orientation === 'string' &&
9040
- this.options.orientation !== options.orientation;
9041
- this._options = Object.assign(Object.assign({}, this.options), options);
9042
- if (hasOrientationChanged) {
9155
+ var _a, _b;
9156
+ if ('className' in options) {
9157
+ this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9158
+ }
9159
+ if ('disableResizing' in options) {
9160
+ this.disableResizing = (_b = options.disableAutoResizing) !== null && _b !== void 0 ? _b : false;
9161
+ }
9162
+ if (typeof options.orientation === 'string') {
9043
9163
  this.splitview.orientation = options.orientation;
9044
9164
  }
9165
+ this._options = Object.assign(Object.assign({}, this.options), options);
9045
9166
  this.splitview.layout(this.splitview.size, this.splitview.orthogonalSize);
9046
9167
  }
9047
9168
  focus() {
@@ -9338,6 +9459,7 @@ define(['exports'], (function (exports) { 'use strict';
9338
9459
  return this._options;
9339
9460
  }
9340
9461
  constructor(parentElement, options) {
9462
+ var _a;
9341
9463
  super(parentElement, options.disableAutoResizing);
9342
9464
  this._id = nextLayoutId.next();
9343
9465
  this._disposable = new MutableDisposable();
@@ -9352,10 +9474,9 @@ define(['exports'], (function (exports) { 'use strict';
9352
9474
  this.onDidAddView = this._onDidAddView.event;
9353
9475
  this._onDidRemoveView = new Emitter();
9354
9476
  this.onDidRemoveView = this._onDidRemoveView.event;
9355
- if (typeof options.className === 'string') {
9356
- this.element.classList.add(options.className);
9357
- }
9358
9477
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
9478
+ this._classNames = new Classnames(this.element);
9479
+ this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9359
9480
  this._options = options;
9360
9481
  if (!options.components) {
9361
9482
  options.components = {};
@@ -9377,6 +9498,13 @@ define(['exports'], (function (exports) { 'use strict';
9377
9498
  //noop
9378
9499
  }
9379
9500
  updateOptions(options) {
9501
+ var _a, _b;
9502
+ if ('className' in options) {
9503
+ this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9504
+ }
9505
+ if ('disableResizing' in options) {
9506
+ this.disableResizing = (_b = options.disableAutoResizing) !== null && _b !== void 0 ? _b : false;
9507
+ }
9380
9508
  this._options = Object.assign(Object.assign({}, this.options), options);
9381
9509
  }
9382
9510
  addPanel(options) {