dockview 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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 1.10.0
3
+ * @version 1.10.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -1501,6 +1501,9 @@ class Paneview extends CompositeDisposable {
1501
1501
  this._onDidChange.fire();
1502
1502
  }));
1503
1503
  }
1504
+ setViewVisible(index, visible) {
1505
+ this.splitview.setViewVisible(index, visible);
1506
+ }
1504
1507
  addPane(pane, size, index = this.splitview.length, skipLayout = false) {
1505
1508
  const disposable = pane.onDidChangeExpansionState(() => {
1506
1509
  this.setupAnimation();
@@ -3005,19 +3008,27 @@ class DockviewApi {
3005
3008
  return this.component.onWillDrop;
3006
3009
  }
3007
3010
  /**
3011
+ * Invoked before an overlay is shown indicating a drop target.
3008
3012
  *
3013
+ * Calling `event.preventDefault()` will prevent the overlay being shown and prevent
3014
+ * the any subsequent drop event.
3009
3015
  */
3010
3016
  get onWillShowOverlay() {
3011
3017
  return this.component.onWillShowOverlay;
3012
3018
  }
3013
3019
  /**
3014
- * Invoked before a group is dragged. Exposed for custom Drag'n'Drop functionality.
3020
+ * Invoked before a group is dragged.
3021
+ *
3022
+ * Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
3023
+ *
3015
3024
  */
3016
3025
  get onWillDragGroup() {
3017
3026
  return this.component.onWillDragGroup;
3018
3027
  }
3019
3028
  /**
3020
- * Invoked before a panel is dragged. Exposed for custom Drag'n'Drop functionality.
3029
+ * Invoked before a panel is dragged.
3030
+ *
3031
+ * Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
3021
3032
  */
3022
3033
  get onWillDragPanel() {
3023
3034
  return this.component.onWillDragPanel;
@@ -3561,7 +3572,7 @@ class ContentContainer extends CompositeDisposable {
3561
3572
  data.groupId === this.group.id;
3562
3573
  return !groupHasOnePanelAndIsActiveDragElement;
3563
3574
  }
3564
- return this.group.canDisplayOverlay(event, position, 'panel');
3575
+ return this.group.canDisplayOverlay(event, position, 'content');
3565
3576
  },
3566
3577
  });
3567
3578
  this.addDisposables(this.dropTarget);
@@ -3884,7 +3895,7 @@ class VoidContainer extends CompositeDisposable {
3884
3895
  // don't show the overlay if the tab being dragged is the last panel of this group
3885
3896
  return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
3886
3897
  }
3887
- return group.model.canDisplayOverlay(event, position, 'panel');
3898
+ return group.model.canDisplayOverlay(event, position, 'header_space');
3888
3899
  },
3889
3900
  });
3890
3901
  this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
@@ -4277,6 +4288,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
4277
4288
  this._width = 0;
4278
4289
  this._height = 0;
4279
4290
  this._panels = [];
4291
+ this._panelDisposables = new Map();
4280
4292
  this._onMove = new Emitter();
4281
4293
  this.onMove = this._onMove.event;
4282
4294
  this._onDidDrop = new Emitter();
@@ -4291,6 +4303,10 @@ class DockviewGroupPanelModel extends CompositeDisposable {
4291
4303
  this.onGroupDragStart = this._onGroupDragStart.event;
4292
4304
  this._onDidAddPanel = new Emitter();
4293
4305
  this.onDidAddPanel = this._onDidAddPanel.event;
4306
+ this._onDidPanelTitleChange = new Emitter();
4307
+ this.onDidPanelTitleChange = this._onDidPanelTitleChange.event;
4308
+ this._onDidPanelParametersChange = new Emitter();
4309
+ this.onDidPanelParametersChange = this._onDidPanelParametersChange.event;
4294
4310
  this._onDidRemovePanel = new Emitter();
4295
4311
  this.onDidRemovePanel = this._onDidRemovePanel.event;
4296
4312
  this._onDidActivePanelChange = new Emitter();
@@ -4579,6 +4595,11 @@ class DockviewGroupPanelModel extends CompositeDisposable {
4579
4595
  if (this.mostRecentlyUsed.includes(panel)) {
4580
4596
  this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(panel), 1);
4581
4597
  }
4598
+ const disposable = this._panelDisposables.get(panel.id);
4599
+ if (disposable) {
4600
+ disposable.dispose();
4601
+ this._panelDisposables.delete(panel.id);
4602
+ }
4582
4603
  this._onDidRemovePanel.fire({ panel });
4583
4604
  }
4584
4605
  doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
@@ -4596,6 +4617,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
4596
4617
  }
4597
4618
  this.updateMru(panel);
4598
4619
  this.panels.splice(index, 0, panel);
4620
+ this._panelDisposables.set(panel.id, new CompositeDisposable(panel.api.onDidTitleChange((event) => this._onDidPanelTitleChange.fire(event)), panel.api.onDidParametersChange((event) => this._onDidPanelParametersChange.fire(event))));
4599
4621
  this._onDidAddPanel.fire({ panel });
4600
4622
  }
4601
4623
  doSetActivePanel(panel) {
@@ -5013,24 +5035,22 @@ class PanelApiImpl extends CompositeDisposable {
5013
5035
  get isVisible() {
5014
5036
  return this._isVisible;
5015
5037
  }
5016
- get isHidden() {
5017
- return this._isHidden;
5018
- }
5019
5038
  get width() {
5020
5039
  return this._width;
5021
5040
  }
5022
5041
  get height() {
5023
5042
  return this._height;
5024
5043
  }
5025
- constructor(id) {
5044
+ constructor(id, component) {
5026
5045
  super();
5027
5046
  this.id = id;
5047
+ this.component = component;
5028
5048
  this._isFocused = false;
5029
5049
  this._isActive = false;
5030
5050
  this._isVisible = true;
5031
- this._isHidden = false;
5032
5051
  this._width = 0;
5033
5052
  this._height = 0;
5053
+ this._parameters = {};
5034
5054
  this.panelUpdatesDisposable = new MutableDisposable();
5035
5055
  this._onDidDimensionChange = new Emitter();
5036
5056
  this.onDidDimensionsChange = this._onDidDimensionChange.event;
@@ -5042,49 +5062,51 @@ class PanelApiImpl extends CompositeDisposable {
5042
5062
  //
5043
5063
  this._onDidVisibilityChange = new Emitter();
5044
5064
  this.onDidVisibilityChange = this._onDidVisibilityChange.event;
5045
- this._onDidHiddenChange = new Emitter();
5046
- this.onDidHiddenChange = this._onDidHiddenChange.event;
5065
+ this._onWillVisibilityChange = new Emitter();
5066
+ this.onWillVisibilityChange = this._onWillVisibilityChange.event;
5047
5067
  this._onDidActiveChange = new Emitter();
5048
5068
  this.onDidActiveChange = this._onDidActiveChange.event;
5049
5069
  this._onActiveChange = new Emitter();
5050
5070
  this.onActiveChange = this._onActiveChange.event;
5051
- this._onUpdateParameters = new Emitter();
5052
- this.onUpdateParameters = this._onUpdateParameters.event;
5071
+ this._onDidParametersChange = new Emitter();
5072
+ this.onDidParametersChange = this._onDidParametersChange.event;
5053
5073
  this.addDisposables(this.onDidFocusChange((event) => {
5054
5074
  this._isFocused = event.isFocused;
5055
5075
  }), this.onDidActiveChange((event) => {
5056
5076
  this._isActive = event.isActive;
5057
5077
  }), this.onDidVisibilityChange((event) => {
5058
5078
  this._isVisible = event.isVisible;
5059
- }), this.onDidHiddenChange((event) => {
5060
- this._isHidden = event.isHidden;
5061
5079
  }), this.onDidDimensionsChange((event) => {
5062
5080
  this._width = event.width;
5063
5081
  this._height = event.height;
5064
- }), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onUpdateParameters, this._onWillFocus, this._onDidHiddenChange, this._onUpdateParameters);
5082
+ }), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onWillFocus, this._onWillVisibilityChange, this._onDidParametersChange);
5083
+ }
5084
+ getParameters() {
5085
+ return this._parameters;
5065
5086
  }
5066
5087
  initialize(panel) {
5067
- this.panelUpdatesDisposable.value = this._onUpdateParameters.event((parameters) => {
5088
+ this.panelUpdatesDisposable.value = this._onDidParametersChange.event((parameters) => {
5089
+ this._parameters = parameters;
5068
5090
  panel.update({
5069
5091
  params: parameters,
5070
5092
  });
5071
5093
  });
5072
5094
  }
5073
- setHidden(isHidden) {
5074
- this._onDidHiddenChange.fire({ isHidden });
5095
+ setVisible(isVisible) {
5096
+ this._onWillVisibilityChange.fire({ isVisible });
5075
5097
  }
5076
5098
  setActive() {
5077
5099
  this._onActiveChange.fire();
5078
5100
  }
5079
5101
  updateParameters(parameters) {
5080
- this._onUpdateParameters.fire(parameters);
5102
+ this._onDidParametersChange.fire(parameters);
5081
5103
  }
5082
5104
  }
5083
5105
 
5084
5106
  class SplitviewPanelApiImpl extends PanelApiImpl {
5085
5107
  //
5086
- constructor(id) {
5087
- super(id);
5108
+ constructor(id, component) {
5109
+ super(id, component);
5088
5110
  this._onDidConstraintsChangeInternal = new Emitter();
5089
5111
  this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
5090
5112
  //
@@ -5109,8 +5131,8 @@ class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
5109
5131
  set pane(pane) {
5110
5132
  this._pane = pane;
5111
5133
  }
5112
- constructor(id) {
5113
- super(id);
5134
+ constructor(id, component) {
5135
+ super(id, component);
5114
5136
  this._onDidExpansionChange = new Emitter({
5115
5137
  replay: true,
5116
5138
  });
@@ -5269,7 +5291,7 @@ class PaneviewPanel extends BasePanelView {
5269
5291
  this.header.style.display = value ? '' : 'none';
5270
5292
  }
5271
5293
  constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
5272
- super(id, component, new PaneviewPanelApiImpl(id));
5294
+ super(id, component, new PaneviewPanelApiImpl(id, component));
5273
5295
  this.headerComponent = headerComponent;
5274
5296
  this._onDidChangeExpansionState = new Emitter({ replay: true });
5275
5297
  this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
@@ -5289,7 +5311,11 @@ class PaneviewPanel extends BasePanelView {
5289
5311
  this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
5290
5312
  this._orientation = orientation;
5291
5313
  this.element.classList.add('pane');
5292
- this.addDisposables(this.api.onDidSizeChange((event) => {
5314
+ this.addDisposables(this.api.onWillVisibilityChange((event) => {
5315
+ const { isVisible } = event;
5316
+ const { accessor } = this._params;
5317
+ accessor.setVisible(this, isVisible);
5318
+ }), this.api.onDidSizeChange((event) => {
5293
5319
  this._onDidChange.fire({ size: event.size });
5294
5320
  }), addDisposableListener(this.element, 'mouseenter', (ev) => {
5295
5321
  this.api._onMouseEnter.fire(ev);
@@ -5496,8 +5522,8 @@ class DraggablePaneviewPanel extends PaneviewPanel {
5496
5522
  }
5497
5523
 
5498
5524
  class GridviewPanelApiImpl extends PanelApiImpl {
5499
- constructor(id, panel) {
5500
- super(id);
5525
+ constructor(id, component, panel) {
5526
+ super(id, component);
5501
5527
  this._onDidConstraintsChangeInternal = new Emitter();
5502
5528
  this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
5503
5529
  this._onDidConstraintsChange = new Emitter();
@@ -5568,7 +5594,7 @@ class GridviewPanel extends BasePanelView {
5568
5594
  return this.api.isActive;
5569
5595
  }
5570
5596
  constructor(id, component, options, api) {
5571
- super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id));
5597
+ super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id, component));
5572
5598
  this._evaluatedMinimumWidth = 0;
5573
5599
  this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
5574
5600
  this._evaluatedMinimumHeight = 0;
@@ -5593,10 +5619,10 @@ class GridviewPanel extends BasePanelView {
5593
5619
  this._maximumHeight = options.maximumHeight;
5594
5620
  }
5595
5621
  this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
5596
- this.addDisposables(this.api.onDidHiddenChange((event) => {
5597
- const { isHidden } = event;
5622
+ this.addDisposables(this.api.onWillVisibilityChange((event) => {
5623
+ const { isVisible } = event;
5598
5624
  const { accessor } = this._params;
5599
- accessor.setVisible(this, !isHidden);
5625
+ accessor.setVisible(this, isVisible);
5600
5626
  }), this.api.onActiveChange(() => {
5601
5627
  const { accessor } = this._params;
5602
5628
  accessor.doSetGroupActive(this);
@@ -5676,7 +5702,7 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
5676
5702
  return this._group.model.location;
5677
5703
  }
5678
5704
  constructor(id, accessor) {
5679
- super(id);
5705
+ super(id, '__dockviewgroup__');
5680
5706
  this.accessor = accessor;
5681
5707
  this._onDidLocationChange = new Emitter();
5682
5708
  this.onDidLocationChange = this._onDidLocationChange.event;
@@ -5837,32 +5863,11 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
5837
5863
  return this.panel.renderer;
5838
5864
  }
5839
5865
  set group(value) {
5840
- const isOldGroupActive = this.isGroupActive;
5866
+ const oldGroup = this._group;
5841
5867
  if (this._group !== value) {
5842
5868
  this._group = value;
5843
5869
  this._onDidGroupChange.fire({});
5844
- let _trackGroupActive = isOldGroupActive; // prevent duplicate events with same state
5845
- this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidLocationChange((event) => {
5846
- if (this.group !== this.panel.group) {
5847
- return;
5848
- }
5849
- this._onDidLocationChange.fire(event);
5850
- }), this.group.api.onDidActiveChange(() => {
5851
- if (this.group !== this.panel.group) {
5852
- return;
5853
- }
5854
- if (_trackGroupActive !== this.isGroupActive) {
5855
- _trackGroupActive = this.isGroupActive;
5856
- this._onDidActiveGroupChange.fire({
5857
- isActive: this.isGroupActive,
5858
- });
5859
- }
5860
- }));
5861
- // if (this.isGroupActive !== isOldGroupActive) {
5862
- // this._onDidActiveGroupChange.fire({
5863
- // isActive: this.isGroupActive,
5864
- // });
5865
- // }
5870
+ this.setupGroupEventListeners(oldGroup);
5866
5871
  this._onDidLocationChange.fire({
5867
5872
  location: this.group.api.location,
5868
5873
  });
@@ -5871,8 +5876,11 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
5871
5876
  get group() {
5872
5877
  return this._group;
5873
5878
  }
5874
- constructor(panel, group, accessor) {
5875
- super(panel.id);
5879
+ get tabComponent() {
5880
+ return this._tabComponent;
5881
+ }
5882
+ constructor(panel, group, accessor, component, tabComponent) {
5883
+ super(panel.id, component);
5876
5884
  this.panel = panel;
5877
5885
  this.accessor = accessor;
5878
5886
  this._onDidTitleChange = new Emitter();
@@ -5886,8 +5894,10 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
5886
5894
  this._onDidLocationChange = new Emitter();
5887
5895
  this.onDidLocationChange = this._onDidLocationChange.event;
5888
5896
  this.groupEventsDisposable = new MutableDisposable();
5897
+ this._tabComponent = tabComponent;
5889
5898
  this.initialize(panel);
5890
5899
  this._group = group;
5900
+ this.setupGroupEventListeners();
5891
5901
  this.addDisposables(this.groupEventsDisposable, this._onDidRendererChange, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange, this._onDidLocationChange);
5892
5902
  }
5893
5903
  getWindow() {
@@ -5922,6 +5932,35 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
5922
5932
  exitMaximized() {
5923
5933
  this.group.api.exitMaximized();
5924
5934
  }
5935
+ setupGroupEventListeners(previousGroup) {
5936
+ var _a;
5937
+ let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
5938
+ this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
5939
+ if (!event.isVisible && this.isVisible) {
5940
+ this._onDidVisibilityChange.fire(event);
5941
+ }
5942
+ else if (event.isVisible &&
5943
+ !this.isVisible &&
5944
+ this.group.model.isPanelActive(this.panel)) {
5945
+ this._onDidVisibilityChange.fire(event);
5946
+ }
5947
+ }), this.group.api.onDidLocationChange((event) => {
5948
+ if (this.group !== this.panel.group) {
5949
+ return;
5950
+ }
5951
+ this._onDidLocationChange.fire(event);
5952
+ }), this.group.api.onDidActiveChange(() => {
5953
+ if (this.group !== this.panel.group) {
5954
+ return;
5955
+ }
5956
+ if (_trackGroupActive !== this.isGroupActive) {
5957
+ _trackGroupActive = this.isGroupActive;
5958
+ this._onDidActiveGroupChange.fire({
5959
+ isActive: this.isGroupActive,
5960
+ });
5961
+ }
5962
+ }));
5963
+ }
5925
5964
  }
5926
5965
 
5927
5966
  class DockviewPanel extends CompositeDisposable {
@@ -5938,7 +5977,7 @@ class DockviewPanel extends CompositeDisposable {
5938
5977
  var _a;
5939
5978
  return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
5940
5979
  }
5941
- constructor(id, accessor, containerApi, group, view, options) {
5980
+ constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
5942
5981
  super();
5943
5982
  this.id = id;
5944
5983
  this.accessor = accessor;
@@ -5946,7 +5985,7 @@ class DockviewPanel extends CompositeDisposable {
5946
5985
  this.view = view;
5947
5986
  this._renderer = options.renderer;
5948
5987
  this._group = group;
5949
- this.api = new DockviewPanelApiImpl(this, this._group, accessor);
5988
+ this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
5950
5989
  this.addDisposables(this.api.onActiveChange(() => {
5951
5990
  accessor.setActivePanel(this);
5952
5991
  }), this.api.onDidSizeChange((event) => {
@@ -6241,7 +6280,7 @@ class DefaultDockviewDeserialzier {
6241
6280
  ? (_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id
6242
6281
  : panelData.tabComponent;
6243
6282
  const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
6244
- const panel = new DockviewPanel(panelId, this.accessor, new DockviewApi(this.accessor), group, view, {
6283
+ const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
6245
6284
  renderer: panelData.renderer,
6246
6285
  });
6247
6286
  panel.init({
@@ -7079,7 +7118,15 @@ class DockviewComponent extends BaseGrid {
7079
7118
  acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
7080
7119
  overlayModel: (_b = this.options.rootOverlayModel) !== null && _b !== void 0 ? _b : DEFAULT_ROOT_OVERLAY_MODEL,
7081
7120
  });
7082
- this.addDisposables(this._rootDropTarget.onDrop((event) => {
7121
+ this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
7122
+ if (this.gridview.length > 0 && event.position === 'center') {
7123
+ // option only available when no panels in primary grid
7124
+ return;
7125
+ }
7126
+ this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
7127
+ kind: 'edge',
7128
+ }));
7129
+ }), this._rootDropTarget.onDrop((event) => {
7083
7130
  var _a;
7084
7131
  const willDropEvent = new DockviewWillDropEvent({
7085
7132
  nativeEvent: event.nativeEvent,
@@ -7088,7 +7135,7 @@ class DockviewComponent extends BaseGrid {
7088
7135
  api: this._api,
7089
7136
  group: undefined,
7090
7137
  getData: getPanelData,
7091
- kind: 'content',
7138
+ kind: 'edge',
7092
7139
  });
7093
7140
  this._onWillDrop.fire(willDropEvent);
7094
7141
  if (willDropEvent.defaultPrevented) {
@@ -7144,7 +7191,7 @@ class DockviewComponent extends BaseGrid {
7144
7191
  const box = getBox();
7145
7192
  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;
7146
7193
  if (itemToPopout.api.location.type === 'grid') {
7147
- itemToPopout.api.setHidden(true);
7194
+ itemToPopout.api.setVisible(false);
7148
7195
  }
7149
7196
  const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
7150
7197
  theme !== null && theme !== void 0 ? theme : '', {
@@ -7195,7 +7242,7 @@ class DockviewComponent extends BaseGrid {
7195
7242
  }));
7196
7243
  switch (referenceLocation) {
7197
7244
  case 'grid':
7198
- referenceGroup.api.setHidden(true);
7245
+ referenceGroup.api.setVisible(false);
7199
7246
  break;
7200
7247
  case 'floating':
7201
7248
  case 'popout':
@@ -7249,8 +7296,8 @@ class DockviewComponent extends BaseGrid {
7249
7296
  from: group,
7250
7297
  to: referenceGroup,
7251
7298
  }));
7252
- if (referenceGroup.api.isHidden) {
7253
- referenceGroup.api.setHidden(false);
7299
+ if (!referenceGroup.api.isVisible) {
7300
+ referenceGroup.api.setVisible(true);
7254
7301
  }
7255
7302
  if (this.getPanel(group.id)) {
7256
7303
  this.doRemoveGroup(group, {
@@ -7823,7 +7870,7 @@ class DockviewComponent extends BaseGrid {
7823
7870
  }
7824
7871
  updateWatermark() {
7825
7872
  var _a, _b;
7826
- if (this.groups.filter((x) => x.api.location.type === 'grid' && !x.api.isHidden).length === 0) {
7873
+ if (this.groups.filter((x) => x.api.location.type === 'grid' && x.api.isVisible).length === 0) {
7827
7874
  if (!this.watermark) {
7828
7875
  this.watermark = this.createWatermarkComponent();
7829
7876
  this.watermark.init({
@@ -8220,6 +8267,8 @@ class DockviewComponent extends BaseGrid {
8220
8267
  if (this._onDidActivePanelChange.value !== event.panel) {
8221
8268
  this._onDidActivePanelChange.fire(event.panel);
8222
8269
  }
8270
+ }), exports.DockviewEvent.any(view.model.onDidPanelTitleChange, view.model.onDidPanelParametersChange)(() => {
8271
+ this._bufferOnDidLayoutChange.fire();
8223
8272
  }));
8224
8273
  this._groups.set(view.id, { value: view, disposable });
8225
8274
  }
@@ -8232,7 +8281,7 @@ class DockviewComponent extends BaseGrid {
8232
8281
  const contentComponent = options.component;
8233
8282
  const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
8234
8283
  const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
8235
- const panel = new DockviewPanel(options.id, this, this._api, group, view, { renderer: options.renderer });
8284
+ const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, { renderer: options.renderer });
8236
8285
  panel.init({
8237
8286
  title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
8238
8287
  params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
@@ -8606,19 +8655,19 @@ class SplitviewComponent extends Resizable {
8606
8655
  const index = this.panels.indexOf(panel);
8607
8656
  this.splitview.setViewVisible(index, visible);
8608
8657
  }
8609
- setActive(view, skipFocus) {
8610
- this._activePanel = view;
8658
+ setActive(panel, skipFocus) {
8659
+ this._activePanel = panel;
8611
8660
  this.panels
8612
- .filter((v) => v !== view)
8661
+ .filter((v) => v !== panel)
8613
8662
  .forEach((v) => {
8614
8663
  v.api._onDidActiveChange.fire({ isActive: false });
8615
8664
  if (!skipFocus) {
8616
8665
  v.focus();
8617
8666
  }
8618
8667
  });
8619
- view.api._onDidActiveChange.fire({ isActive: true });
8668
+ panel.api._onDidActiveChange.fire({ isActive: true });
8620
8669
  if (!skipFocus) {
8621
- view.focus();
8670
+ panel.focus();
8622
8671
  }
8623
8672
  }
8624
8673
  removePanel(panel, sizing) {
@@ -8917,6 +8966,10 @@ class PaneviewComponent extends Resizable {
8917
8966
  });
8918
8967
  this.addDisposables(this._disposable);
8919
8968
  }
8969
+ setVisible(panel, visible) {
8970
+ const index = this.panels.indexOf(panel);
8971
+ this.paneview.setViewVisible(index, visible);
8972
+ }
8920
8973
  focus() {
8921
8974
  //noop
8922
8975
  }
@@ -8963,6 +9016,7 @@ class PaneviewComponent extends Resizable {
8963
9016
  isExpanded: options.isExpanded,
8964
9017
  title: options.title,
8965
9018
  containerApi: new PaneviewApi(this),
9019
+ accessor: this,
8966
9020
  });
8967
9021
  this.paneview.addPane(view, size, index);
8968
9022
  view.orientation = this.paneview.orientation;
@@ -9062,6 +9116,7 @@ class PaneviewComponent extends Resizable {
9062
9116
  title: data.title,
9063
9117
  isExpanded: !!view.expanded,
9064
9118
  containerApi: new PaneviewApi(this),
9119
+ accessor: this,
9065
9120
  });
9066
9121
  panel.orientation = this.paneview.orientation;
9067
9122
  });
@@ -9141,7 +9196,7 @@ class SplitviewPanel extends BasePanelView {
9141
9196
  return this._snap;
9142
9197
  }
9143
9198
  constructor(id, componentName) {
9144
- super(id, componentName, new SplitviewPanelApiImpl(id));
9199
+ super(id, componentName, new SplitviewPanelApiImpl(id, componentName));
9145
9200
  this._evaluatedMinimumSize = 0;
9146
9201
  this._evaluatedMaximumSize = Number.POSITIVE_INFINITY;
9147
9202
  this._minimumSize = 0;
@@ -9150,10 +9205,10 @@ class SplitviewPanel extends BasePanelView {
9150
9205
  this._onDidChange = new Emitter();
9151
9206
  this.onDidChange = this._onDidChange.event;
9152
9207
  this.api.initialize(this);
9153
- this.addDisposables(this._onDidChange, this.api.onDidHiddenChange((event) => {
9154
- const { isHidden } = event;
9208
+ this.addDisposables(this._onDidChange, this.api.onWillVisibilityChange((event) => {
9209
+ const { isVisible } = event;
9155
9210
  const { accessor } = this._params;
9156
- accessor.setVisible(this, !isHidden);
9211
+ accessor.setVisible(this, isVisible);
9157
9212
  }), this.api.onActiveChange(() => {
9158
9213
  const { accessor } = this._params;
9159
9214
  accessor.setActive(this);