dockview-core 1.10.0 → 1.10.2

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 (91) hide show
  1. package/dist/cjs/api/component.api.d.ts +10 -2
  2. package/dist/cjs/api/component.api.js +10 -2
  3. package/dist/cjs/api/dockviewGroupPanelApi.js +1 -1
  4. package/dist/cjs/api/dockviewPanelApi.d.ts +5 -1
  5. package/dist/cjs/api/dockviewPanelApi.js +43 -26
  6. package/dist/cjs/api/gridviewPanelApi.d.ts +1 -1
  7. package/dist/cjs/api/gridviewPanelApi.js +2 -2
  8. package/dist/cjs/api/panelApi.d.ts +12 -16
  9. package/dist/cjs/api/panelApi.js +17 -20
  10. package/dist/cjs/api/paneviewPanelApi.d.ts +1 -1
  11. package/dist/cjs/api/paneviewPanelApi.js +2 -2
  12. package/dist/cjs/api/splitviewPanelApi.d.ts +1 -1
  13. package/dist/cjs/api/splitviewPanelApi.js +2 -2
  14. package/dist/cjs/dockview/components/panel/content.js +1 -1
  15. package/dist/cjs/dockview/components/titlebar/voidContainer.js +1 -1
  16. package/dist/cjs/dockview/deserializer.js +1 -1
  17. package/dist/cjs/dockview/dockviewComponent.js +18 -8
  18. package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +10 -5
  19. package/dist/cjs/dockview/dockviewGroupPanelModel.js +16 -0
  20. package/dist/cjs/dockview/dockviewPanel.d.ts +1 -1
  21. package/dist/cjs/dockview/dockviewPanel.js +2 -2
  22. package/dist/cjs/dockview/options.d.ts +3 -3
  23. package/dist/cjs/dockview/types.d.ts +0 -1
  24. package/dist/cjs/gridview/gridviewPanel.js +4 -4
  25. package/dist/cjs/lifecycle.d.ts +1 -1
  26. package/dist/cjs/paneview/paneview.d.ts +1 -0
  27. package/dist/cjs/paneview/paneview.js +3 -0
  28. package/dist/cjs/paneview/paneviewComponent.d.ts +2 -0
  29. package/dist/cjs/paneview/paneviewComponent.js +6 -0
  30. package/dist/cjs/paneview/paneviewPanel.d.ts +2 -0
  31. package/dist/cjs/paneview/paneviewPanel.js +6 -2
  32. package/dist/cjs/splitview/splitviewComponent.d.ts +1 -1
  33. package/dist/cjs/splitview/splitviewComponent.js +5 -5
  34. package/dist/cjs/splitview/splitviewPanel.js +4 -4
  35. package/dist/dockview-core.amd.js +134 -79
  36. package/dist/dockview-core.amd.js.map +1 -1
  37. package/dist/dockview-core.amd.min.js +2 -2
  38. package/dist/dockview-core.amd.min.js.map +1 -1
  39. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  40. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  41. package/dist/dockview-core.amd.noStyle.js +134 -79
  42. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  43. package/dist/dockview-core.cjs.js +134 -79
  44. package/dist/dockview-core.cjs.js.map +1 -1
  45. package/dist/dockview-core.esm.js +134 -79
  46. package/dist/dockview-core.esm.js.map +1 -1
  47. package/dist/dockview-core.esm.min.js +2 -2
  48. package/dist/dockview-core.esm.min.js.map +1 -1
  49. package/dist/dockview-core.js +134 -79
  50. package/dist/dockview-core.js.map +1 -1
  51. package/dist/dockview-core.min.js +2 -2
  52. package/dist/dockview-core.min.js.map +1 -1
  53. package/dist/dockview-core.min.noStyle.js +2 -2
  54. package/dist/dockview-core.min.noStyle.js.map +1 -1
  55. package/dist/dockview-core.noStyle.js +134 -79
  56. package/dist/dockview-core.noStyle.js.map +1 -1
  57. package/dist/esm/api/component.api.d.ts +10 -2
  58. package/dist/esm/api/component.api.js +10 -2
  59. package/dist/esm/api/dockviewGroupPanelApi.js +1 -1
  60. package/dist/esm/api/dockviewPanelApi.d.ts +5 -1
  61. package/dist/esm/api/dockviewPanelApi.js +38 -25
  62. package/dist/esm/api/gridviewPanelApi.d.ts +1 -1
  63. package/dist/esm/api/gridviewPanelApi.js +2 -2
  64. package/dist/esm/api/panelApi.d.ts +12 -16
  65. package/dist/esm/api/panelApi.js +16 -16
  66. package/dist/esm/api/paneviewPanelApi.d.ts +1 -1
  67. package/dist/esm/api/paneviewPanelApi.js +2 -2
  68. package/dist/esm/api/splitviewPanelApi.d.ts +1 -1
  69. package/dist/esm/api/splitviewPanelApi.js +2 -2
  70. package/dist/esm/dockview/components/panel/content.js +1 -1
  71. package/dist/esm/dockview/components/titlebar/voidContainer.js +1 -1
  72. package/dist/esm/dockview/deserializer.js +1 -1
  73. package/dist/esm/dockview/dockviewComponent.js +19 -9
  74. package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +10 -5
  75. package/dist/esm/dockview/dockviewGroupPanelModel.js +11 -0
  76. package/dist/esm/dockview/dockviewPanel.d.ts +1 -1
  77. package/dist/esm/dockview/dockviewPanel.js +2 -2
  78. package/dist/esm/dockview/options.d.ts +3 -3
  79. package/dist/esm/dockview/types.d.ts +0 -1
  80. package/dist/esm/gridview/gridviewPanel.js +4 -4
  81. package/dist/esm/lifecycle.d.ts +1 -1
  82. package/dist/esm/paneview/paneview.d.ts +1 -0
  83. package/dist/esm/paneview/paneview.js +3 -0
  84. package/dist/esm/paneview/paneviewComponent.d.ts +2 -0
  85. package/dist/esm/paneview/paneviewComponent.js +6 -0
  86. package/dist/esm/paneview/paneviewPanel.d.ts +2 -0
  87. package/dist/esm/paneview/paneviewPanel.js +6 -2
  88. package/dist/esm/splitview/splitviewComponent.d.ts +1 -1
  89. package/dist/esm/splitview/splitviewComponent.js +5 -5
  90. package/dist/esm/splitview/splitviewPanel.js +4 -4
  91. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 1.10.0
3
+ * @version 1.10.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -1452,6 +1452,9 @@
1452
1452
  this._onDidChange.fire();
1453
1453
  }));
1454
1454
  }
1455
+ setViewVisible(index, visible) {
1456
+ this.splitview.setViewVisible(index, visible);
1457
+ }
1455
1458
  addPane(pane, size, index = this.splitview.length, skipLayout = false) {
1456
1459
  const disposable = pane.onDidChangeExpansionState(() => {
1457
1460
  this.setupAnimation();
@@ -2956,19 +2959,27 @@
2956
2959
  return this.component.onWillDrop;
2957
2960
  }
2958
2961
  /**
2962
+ * Invoked before an overlay is shown indicating a drop target.
2959
2963
  *
2964
+ * Calling `event.preventDefault()` will prevent the overlay being shown and prevent
2965
+ * the any subsequent drop event.
2960
2966
  */
2961
2967
  get onWillShowOverlay() {
2962
2968
  return this.component.onWillShowOverlay;
2963
2969
  }
2964
2970
  /**
2965
- * Invoked before a group is dragged. Exposed for custom Drag'n'Drop functionality.
2971
+ * Invoked before a group is dragged.
2972
+ *
2973
+ * Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
2974
+ *
2966
2975
  */
2967
2976
  get onWillDragGroup() {
2968
2977
  return this.component.onWillDragGroup;
2969
2978
  }
2970
2979
  /**
2971
- * Invoked before a panel is dragged. Exposed for custom Drag'n'Drop functionality.
2980
+ * Invoked before a panel is dragged.
2981
+ *
2982
+ * Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
2972
2983
  */
2973
2984
  get onWillDragPanel() {
2974
2985
  return this.component.onWillDragPanel;
@@ -3512,7 +3523,7 @@
3512
3523
  data.groupId === this.group.id;
3513
3524
  return !groupHasOnePanelAndIsActiveDragElement;
3514
3525
  }
3515
- return this.group.canDisplayOverlay(event, position, 'panel');
3526
+ return this.group.canDisplayOverlay(event, position, 'content');
3516
3527
  },
3517
3528
  });
3518
3529
  this.addDisposables(this.dropTarget);
@@ -3835,7 +3846,7 @@
3835
3846
  // don't show the overlay if the tab being dragged is the last panel of this group
3836
3847
  return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
3837
3848
  }
3838
- return group.model.canDisplayOverlay(event, position, 'panel');
3849
+ return group.model.canDisplayOverlay(event, position, 'header_space');
3839
3850
  },
3840
3851
  });
3841
3852
  this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
@@ -4228,6 +4239,7 @@
4228
4239
  this._width = 0;
4229
4240
  this._height = 0;
4230
4241
  this._panels = [];
4242
+ this._panelDisposables = new Map();
4231
4243
  this._onMove = new Emitter();
4232
4244
  this.onMove = this._onMove.event;
4233
4245
  this._onDidDrop = new Emitter();
@@ -4242,6 +4254,10 @@
4242
4254
  this.onGroupDragStart = this._onGroupDragStart.event;
4243
4255
  this._onDidAddPanel = new Emitter();
4244
4256
  this.onDidAddPanel = this._onDidAddPanel.event;
4257
+ this._onDidPanelTitleChange = new Emitter();
4258
+ this.onDidPanelTitleChange = this._onDidPanelTitleChange.event;
4259
+ this._onDidPanelParametersChange = new Emitter();
4260
+ this.onDidPanelParametersChange = this._onDidPanelParametersChange.event;
4245
4261
  this._onDidRemovePanel = new Emitter();
4246
4262
  this.onDidRemovePanel = this._onDidRemovePanel.event;
4247
4263
  this._onDidActivePanelChange = new Emitter();
@@ -4530,6 +4546,11 @@
4530
4546
  if (this.mostRecentlyUsed.includes(panel)) {
4531
4547
  this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(panel), 1);
4532
4548
  }
4549
+ const disposable = this._panelDisposables.get(panel.id);
4550
+ if (disposable) {
4551
+ disposable.dispose();
4552
+ this._panelDisposables.delete(panel.id);
4553
+ }
4533
4554
  this._onDidRemovePanel.fire({ panel });
4534
4555
  }
4535
4556
  doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
@@ -4547,6 +4568,7 @@
4547
4568
  }
4548
4569
  this.updateMru(panel);
4549
4570
  this.panels.splice(index, 0, panel);
4571
+ this._panelDisposables.set(panel.id, new CompositeDisposable(panel.api.onDidTitleChange((event) => this._onDidPanelTitleChange.fire(event)), panel.api.onDidParametersChange((event) => this._onDidPanelParametersChange.fire(event))));
4550
4572
  this._onDidAddPanel.fire({ panel });
4551
4573
  }
4552
4574
  doSetActivePanel(panel) {
@@ -4964,24 +4986,22 @@
4964
4986
  get isVisible() {
4965
4987
  return this._isVisible;
4966
4988
  }
4967
- get isHidden() {
4968
- return this._isHidden;
4969
- }
4970
4989
  get width() {
4971
4990
  return this._width;
4972
4991
  }
4973
4992
  get height() {
4974
4993
  return this._height;
4975
4994
  }
4976
- constructor(id) {
4995
+ constructor(id, component) {
4977
4996
  super();
4978
4997
  this.id = id;
4998
+ this.component = component;
4979
4999
  this._isFocused = false;
4980
5000
  this._isActive = false;
4981
5001
  this._isVisible = true;
4982
- this._isHidden = false;
4983
5002
  this._width = 0;
4984
5003
  this._height = 0;
5004
+ this._parameters = {};
4985
5005
  this.panelUpdatesDisposable = new MutableDisposable();
4986
5006
  this._onDidDimensionChange = new Emitter();
4987
5007
  this.onDidDimensionsChange = this._onDidDimensionChange.event;
@@ -4993,49 +5013,51 @@
4993
5013
  //
4994
5014
  this._onDidVisibilityChange = new Emitter();
4995
5015
  this.onDidVisibilityChange = this._onDidVisibilityChange.event;
4996
- this._onDidHiddenChange = new Emitter();
4997
- this.onDidHiddenChange = this._onDidHiddenChange.event;
5016
+ this._onWillVisibilityChange = new Emitter();
5017
+ this.onWillVisibilityChange = this._onWillVisibilityChange.event;
4998
5018
  this._onDidActiveChange = new Emitter();
4999
5019
  this.onDidActiveChange = this._onDidActiveChange.event;
5000
5020
  this._onActiveChange = new Emitter();
5001
5021
  this.onActiveChange = this._onActiveChange.event;
5002
- this._onUpdateParameters = new Emitter();
5003
- this.onUpdateParameters = this._onUpdateParameters.event;
5022
+ this._onDidParametersChange = new Emitter();
5023
+ this.onDidParametersChange = this._onDidParametersChange.event;
5004
5024
  this.addDisposables(this.onDidFocusChange((event) => {
5005
5025
  this._isFocused = event.isFocused;
5006
5026
  }), this.onDidActiveChange((event) => {
5007
5027
  this._isActive = event.isActive;
5008
5028
  }), this.onDidVisibilityChange((event) => {
5009
5029
  this._isVisible = event.isVisible;
5010
- }), this.onDidHiddenChange((event) => {
5011
- this._isHidden = event.isHidden;
5012
5030
  }), this.onDidDimensionsChange((event) => {
5013
5031
  this._width = event.width;
5014
5032
  this._height = event.height;
5015
- }), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onUpdateParameters, this._onWillFocus, this._onDidHiddenChange, this._onUpdateParameters);
5033
+ }), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onWillFocus, this._onWillVisibilityChange, this._onDidParametersChange);
5034
+ }
5035
+ getParameters() {
5036
+ return this._parameters;
5016
5037
  }
5017
5038
  initialize(panel) {
5018
- this.panelUpdatesDisposable.value = this._onUpdateParameters.event((parameters) => {
5039
+ this.panelUpdatesDisposable.value = this._onDidParametersChange.event((parameters) => {
5040
+ this._parameters = parameters;
5019
5041
  panel.update({
5020
5042
  params: parameters,
5021
5043
  });
5022
5044
  });
5023
5045
  }
5024
- setHidden(isHidden) {
5025
- this._onDidHiddenChange.fire({ isHidden });
5046
+ setVisible(isVisible) {
5047
+ this._onWillVisibilityChange.fire({ isVisible });
5026
5048
  }
5027
5049
  setActive() {
5028
5050
  this._onActiveChange.fire();
5029
5051
  }
5030
5052
  updateParameters(parameters) {
5031
- this._onUpdateParameters.fire(parameters);
5053
+ this._onDidParametersChange.fire(parameters);
5032
5054
  }
5033
5055
  }
5034
5056
 
5035
5057
  class SplitviewPanelApiImpl extends PanelApiImpl {
5036
5058
  //
5037
- constructor(id) {
5038
- super(id);
5059
+ constructor(id, component) {
5060
+ super(id, component);
5039
5061
  this._onDidConstraintsChangeInternal = new Emitter();
5040
5062
  this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
5041
5063
  //
@@ -5060,8 +5082,8 @@
5060
5082
  set pane(pane) {
5061
5083
  this._pane = pane;
5062
5084
  }
5063
- constructor(id) {
5064
- super(id);
5085
+ constructor(id, component) {
5086
+ super(id, component);
5065
5087
  this._onDidExpansionChange = new Emitter({
5066
5088
  replay: true,
5067
5089
  });
@@ -5220,7 +5242,7 @@
5220
5242
  this.header.style.display = value ? '' : 'none';
5221
5243
  }
5222
5244
  constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
5223
- super(id, component, new PaneviewPanelApiImpl(id));
5245
+ super(id, component, new PaneviewPanelApiImpl(id, component));
5224
5246
  this.headerComponent = headerComponent;
5225
5247
  this._onDidChangeExpansionState = new Emitter({ replay: true });
5226
5248
  this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
@@ -5240,7 +5262,11 @@
5240
5262
  this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
5241
5263
  this._orientation = orientation;
5242
5264
  this.element.classList.add('pane');
5243
- this.addDisposables(this.api.onDidSizeChange((event) => {
5265
+ this.addDisposables(this.api.onWillVisibilityChange((event) => {
5266
+ const { isVisible } = event;
5267
+ const { accessor } = this._params;
5268
+ accessor.setVisible(this, isVisible);
5269
+ }), this.api.onDidSizeChange((event) => {
5244
5270
  this._onDidChange.fire({ size: event.size });
5245
5271
  }), addDisposableListener(this.element, 'mouseenter', (ev) => {
5246
5272
  this.api._onMouseEnter.fire(ev);
@@ -5447,8 +5473,8 @@
5447
5473
  }
5448
5474
 
5449
5475
  class GridviewPanelApiImpl extends PanelApiImpl {
5450
- constructor(id, panel) {
5451
- super(id);
5476
+ constructor(id, component, panel) {
5477
+ super(id, component);
5452
5478
  this._onDidConstraintsChangeInternal = new Emitter();
5453
5479
  this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
5454
5480
  this._onDidConstraintsChange = new Emitter();
@@ -5519,7 +5545,7 @@
5519
5545
  return this.api.isActive;
5520
5546
  }
5521
5547
  constructor(id, component, options, api) {
5522
- super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id));
5548
+ super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id, component));
5523
5549
  this._evaluatedMinimumWidth = 0;
5524
5550
  this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
5525
5551
  this._evaluatedMinimumHeight = 0;
@@ -5544,10 +5570,10 @@
5544
5570
  this._maximumHeight = options.maximumHeight;
5545
5571
  }
5546
5572
  this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
5547
- this.addDisposables(this.api.onDidHiddenChange((event) => {
5548
- const { isHidden } = event;
5573
+ this.addDisposables(this.api.onWillVisibilityChange((event) => {
5574
+ const { isVisible } = event;
5549
5575
  const { accessor } = this._params;
5550
- accessor.setVisible(this, !isHidden);
5576
+ accessor.setVisible(this, isVisible);
5551
5577
  }), this.api.onActiveChange(() => {
5552
5578
  const { accessor } = this._params;
5553
5579
  accessor.doSetGroupActive(this);
@@ -5627,7 +5653,7 @@
5627
5653
  return this._group.model.location;
5628
5654
  }
5629
5655
  constructor(id, accessor) {
5630
- super(id);
5656
+ super(id, '__dockviewgroup__');
5631
5657
  this.accessor = accessor;
5632
5658
  this._onDidLocationChange = new Emitter();
5633
5659
  this.onDidLocationChange = this._onDidLocationChange.event;
@@ -5788,32 +5814,11 @@
5788
5814
  return this.panel.renderer;
5789
5815
  }
5790
5816
  set group(value) {
5791
- const isOldGroupActive = this.isGroupActive;
5817
+ const oldGroup = this._group;
5792
5818
  if (this._group !== value) {
5793
5819
  this._group = value;
5794
5820
  this._onDidGroupChange.fire({});
5795
- let _trackGroupActive = isOldGroupActive; // prevent duplicate events with same state
5796
- this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidLocationChange((event) => {
5797
- if (this.group !== this.panel.group) {
5798
- return;
5799
- }
5800
- this._onDidLocationChange.fire(event);
5801
- }), this.group.api.onDidActiveChange(() => {
5802
- if (this.group !== this.panel.group) {
5803
- return;
5804
- }
5805
- if (_trackGroupActive !== this.isGroupActive) {
5806
- _trackGroupActive = this.isGroupActive;
5807
- this._onDidActiveGroupChange.fire({
5808
- isActive: this.isGroupActive,
5809
- });
5810
- }
5811
- }));
5812
- // if (this.isGroupActive !== isOldGroupActive) {
5813
- // this._onDidActiveGroupChange.fire({
5814
- // isActive: this.isGroupActive,
5815
- // });
5816
- // }
5821
+ this.setupGroupEventListeners(oldGroup);
5817
5822
  this._onDidLocationChange.fire({
5818
5823
  location: this.group.api.location,
5819
5824
  });
@@ -5822,8 +5827,11 @@
5822
5827
  get group() {
5823
5828
  return this._group;
5824
5829
  }
5825
- constructor(panel, group, accessor) {
5826
- super(panel.id);
5830
+ get tabComponent() {
5831
+ return this._tabComponent;
5832
+ }
5833
+ constructor(panel, group, accessor, component, tabComponent) {
5834
+ super(panel.id, component);
5827
5835
  this.panel = panel;
5828
5836
  this.accessor = accessor;
5829
5837
  this._onDidTitleChange = new Emitter();
@@ -5837,8 +5845,10 @@
5837
5845
  this._onDidLocationChange = new Emitter();
5838
5846
  this.onDidLocationChange = this._onDidLocationChange.event;
5839
5847
  this.groupEventsDisposable = new MutableDisposable();
5848
+ this._tabComponent = tabComponent;
5840
5849
  this.initialize(panel);
5841
5850
  this._group = group;
5851
+ this.setupGroupEventListeners();
5842
5852
  this.addDisposables(this.groupEventsDisposable, this._onDidRendererChange, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange, this._onDidLocationChange);
5843
5853
  }
5844
5854
  getWindow() {
@@ -5873,6 +5883,35 @@
5873
5883
  exitMaximized() {
5874
5884
  this.group.api.exitMaximized();
5875
5885
  }
5886
+ setupGroupEventListeners(previousGroup) {
5887
+ var _a;
5888
+ let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
5889
+ this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
5890
+ if (!event.isVisible && this.isVisible) {
5891
+ this._onDidVisibilityChange.fire(event);
5892
+ }
5893
+ else if (event.isVisible &&
5894
+ !this.isVisible &&
5895
+ this.group.model.isPanelActive(this.panel)) {
5896
+ this._onDidVisibilityChange.fire(event);
5897
+ }
5898
+ }), this.group.api.onDidLocationChange((event) => {
5899
+ if (this.group !== this.panel.group) {
5900
+ return;
5901
+ }
5902
+ this._onDidLocationChange.fire(event);
5903
+ }), this.group.api.onDidActiveChange(() => {
5904
+ if (this.group !== this.panel.group) {
5905
+ return;
5906
+ }
5907
+ if (_trackGroupActive !== this.isGroupActive) {
5908
+ _trackGroupActive = this.isGroupActive;
5909
+ this._onDidActiveGroupChange.fire({
5910
+ isActive: this.isGroupActive,
5911
+ });
5912
+ }
5913
+ }));
5914
+ }
5876
5915
  }
5877
5916
 
5878
5917
  class DockviewPanel extends CompositeDisposable {
@@ -5889,7 +5928,7 @@
5889
5928
  var _a;
5890
5929
  return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
5891
5930
  }
5892
- constructor(id, accessor, containerApi, group, view, options) {
5931
+ constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
5893
5932
  super();
5894
5933
  this.id = id;
5895
5934
  this.accessor = accessor;
@@ -5897,7 +5936,7 @@
5897
5936
  this.view = view;
5898
5937
  this._renderer = options.renderer;
5899
5938
  this._group = group;
5900
- this.api = new DockviewPanelApiImpl(this, this._group, accessor);
5939
+ this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
5901
5940
  this.addDisposables(this.api.onActiveChange(() => {
5902
5941
  accessor.setActivePanel(this);
5903
5942
  }), this.api.onDidSizeChange((event) => {
@@ -6192,7 +6231,7 @@
6192
6231
  ? (_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id
6193
6232
  : panelData.tabComponent;
6194
6233
  const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
6195
- const panel = new DockviewPanel(panelId, this.accessor, new DockviewApi(this.accessor), group, view, {
6234
+ const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
6196
6235
  renderer: panelData.renderer,
6197
6236
  });
6198
6237
  panel.init({
@@ -7053,7 +7092,15 @@
7053
7092
  acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
7054
7093
  overlayModel: (_b = this.options.rootOverlayModel) !== null && _b !== void 0 ? _b : DEFAULT_ROOT_OVERLAY_MODEL,
7055
7094
  });
7056
- this.addDisposables(this._rootDropTarget.onDrop((event) => {
7095
+ this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
7096
+ if (this.gridview.length > 0 && event.position === 'center') {
7097
+ // option only available when no panels in primary grid
7098
+ return;
7099
+ }
7100
+ this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
7101
+ kind: 'edge',
7102
+ }));
7103
+ }), this._rootDropTarget.onDrop((event) => {
7057
7104
  var _a;
7058
7105
  const willDropEvent = new DockviewWillDropEvent({
7059
7106
  nativeEvent: event.nativeEvent,
@@ -7062,7 +7109,7 @@
7062
7109
  api: this._api,
7063
7110
  group: undefined,
7064
7111
  getData: getPanelData,
7065
- kind: 'content',
7112
+ kind: 'edge',
7066
7113
  });
7067
7114
  this._onWillDrop.fire(willDropEvent);
7068
7115
  if (willDropEvent.defaultPrevented) {
@@ -7118,7 +7165,7 @@
7118
7165
  const box = getBox();
7119
7166
  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(); //item.id;
7120
7167
  if (itemToPopout.api.location.type === 'grid') {
7121
- itemToPopout.api.setHidden(true);
7168
+ itemToPopout.api.setVisible(false);
7122
7169
  }
7123
7170
  const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
7124
7171
  theme !== null && theme !== void 0 ? theme : '', {
@@ -7169,7 +7216,7 @@
7169
7216
  }));
7170
7217
  switch (referenceLocation) {
7171
7218
  case 'grid':
7172
- referenceGroup.api.setHidden(true);
7219
+ referenceGroup.api.setVisible(false);
7173
7220
  break;
7174
7221
  case 'floating':
7175
7222
  case 'popout':
@@ -7223,8 +7270,8 @@
7223
7270
  from: group,
7224
7271
  to: referenceGroup,
7225
7272
  }));
7226
- if (referenceGroup.api.isHidden) {
7227
- referenceGroup.api.setHidden(false);
7273
+ if (!referenceGroup.api.isVisible) {
7274
+ referenceGroup.api.setVisible(true);
7228
7275
  }
7229
7276
  if (this.getPanel(group.id)) {
7230
7277
  this.doRemoveGroup(group, {
@@ -7797,7 +7844,7 @@
7797
7844
  }
7798
7845
  updateWatermark() {
7799
7846
  var _a, _b;
7800
- if (this.groups.filter((x) => x.api.location.type === 'grid' && !x.api.isHidden).length === 0) {
7847
+ if (this.groups.filter((x) => x.api.location.type === 'grid' && x.api.isVisible).length === 0) {
7801
7848
  if (!this.watermark) {
7802
7849
  this.watermark = this.createWatermarkComponent();
7803
7850
  this.watermark.init({
@@ -8194,6 +8241,8 @@
8194
8241
  if (this._onDidActivePanelChange.value !== event.panel) {
8195
8242
  this._onDidActivePanelChange.fire(event.panel);
8196
8243
  }
8244
+ }), exports.DockviewEvent.any(view.model.onDidPanelTitleChange, view.model.onDidPanelParametersChange)(() => {
8245
+ this._bufferOnDidLayoutChange.fire();
8197
8246
  }));
8198
8247
  this._groups.set(view.id, { value: view, disposable });
8199
8248
  }
@@ -8206,7 +8255,7 @@
8206
8255
  const contentComponent = options.component;
8207
8256
  const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
8208
8257
  const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
8209
- const panel = new DockviewPanel(options.id, this, this._api, group, view, { renderer: options.renderer });
8258
+ const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, { renderer: options.renderer });
8210
8259
  panel.init({
8211
8260
  title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
8212
8261
  params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
@@ -8580,19 +8629,19 @@
8580
8629
  const index = this.panels.indexOf(panel);
8581
8630
  this.splitview.setViewVisible(index, visible);
8582
8631
  }
8583
- setActive(view, skipFocus) {
8584
- this._activePanel = view;
8632
+ setActive(panel, skipFocus) {
8633
+ this._activePanel = panel;
8585
8634
  this.panels
8586
- .filter((v) => v !== view)
8635
+ .filter((v) => v !== panel)
8587
8636
  .forEach((v) => {
8588
8637
  v.api._onDidActiveChange.fire({ isActive: false });
8589
8638
  if (!skipFocus) {
8590
8639
  v.focus();
8591
8640
  }
8592
8641
  });
8593
- view.api._onDidActiveChange.fire({ isActive: true });
8642
+ panel.api._onDidActiveChange.fire({ isActive: true });
8594
8643
  if (!skipFocus) {
8595
- view.focus();
8644
+ panel.focus();
8596
8645
  }
8597
8646
  }
8598
8647
  removePanel(panel, sizing) {
@@ -8891,6 +8940,10 @@
8891
8940
  });
8892
8941
  this.addDisposables(this._disposable);
8893
8942
  }
8943
+ setVisible(panel, visible) {
8944
+ const index = this.panels.indexOf(panel);
8945
+ this.paneview.setViewVisible(index, visible);
8946
+ }
8894
8947
  focus() {
8895
8948
  //noop
8896
8949
  }
@@ -8937,6 +8990,7 @@
8937
8990
  isExpanded: options.isExpanded,
8938
8991
  title: options.title,
8939
8992
  containerApi: new PaneviewApi(this),
8993
+ accessor: this,
8940
8994
  });
8941
8995
  this.paneview.addPane(view, size, index);
8942
8996
  view.orientation = this.paneview.orientation;
@@ -9036,6 +9090,7 @@
9036
9090
  title: data.title,
9037
9091
  isExpanded: !!view.expanded,
9038
9092
  containerApi: new PaneviewApi(this),
9093
+ accessor: this,
9039
9094
  });
9040
9095
  panel.orientation = this.paneview.orientation;
9041
9096
  });
@@ -9115,7 +9170,7 @@
9115
9170
  return this._snap;
9116
9171
  }
9117
9172
  constructor(id, componentName) {
9118
- super(id, componentName, new SplitviewPanelApiImpl(id));
9173
+ super(id, componentName, new SplitviewPanelApiImpl(id, componentName));
9119
9174
  this._evaluatedMinimumSize = 0;
9120
9175
  this._evaluatedMaximumSize = Number.POSITIVE_INFINITY;
9121
9176
  this._minimumSize = 0;
@@ -9124,10 +9179,10 @@
9124
9179
  this._onDidChange = new Emitter();
9125
9180
  this.onDidChange = this._onDidChange.event;
9126
9181
  this.api.initialize(this);
9127
- this.addDisposables(this._onDidChange, this.api.onDidHiddenChange((event) => {
9128
- const { isHidden } = event;
9182
+ this.addDisposables(this._onDidChange, this.api.onWillVisibilityChange((event) => {
9183
+ const { isVisible } = event;
9129
9184
  const { accessor } = this._params;
9130
- accessor.setVisible(this, !isHidden);
9185
+ accessor.setVisible(this, isVisible);
9131
9186
  }), this.api.onActiveChange(() => {
9132
9187
  const { accessor } = this._params;
9133
9188
  accessor.setActive(this);