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