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
  */
@@ -1472,6 +1472,9 @@
1472
1472
  this._onDidChange.fire();
1473
1473
  }));
1474
1474
  }
1475
+ setViewVisible(index, visible) {
1476
+ this.splitview.setViewVisible(index, visible);
1477
+ }
1475
1478
  addPane(pane, size, index = this.splitview.length, skipLayout = false) {
1476
1479
  const disposable = pane.onDidChangeExpansionState(() => {
1477
1480
  this.setupAnimation();
@@ -2976,19 +2979,27 @@
2976
2979
  return this.component.onWillDrop;
2977
2980
  }
2978
2981
  /**
2982
+ * Invoked before an overlay is shown indicating a drop target.
2979
2983
  *
2984
+ * Calling `event.preventDefault()` will prevent the overlay being shown and prevent
2985
+ * the any subsequent drop event.
2980
2986
  */
2981
2987
  get onWillShowOverlay() {
2982
2988
  return this.component.onWillShowOverlay;
2983
2989
  }
2984
2990
  /**
2985
- * Invoked before a group is dragged. Exposed for custom Drag'n'Drop functionality.
2991
+ * Invoked before a group is dragged.
2992
+ *
2993
+ * Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
2994
+ *
2986
2995
  */
2987
2996
  get onWillDragGroup() {
2988
2997
  return this.component.onWillDragGroup;
2989
2998
  }
2990
2999
  /**
2991
- * Invoked before a panel is dragged. Exposed for custom Drag'n'Drop functionality.
3000
+ * Invoked before a panel is dragged.
3001
+ *
3002
+ * Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
2992
3003
  */
2993
3004
  get onWillDragPanel() {
2994
3005
  return this.component.onWillDragPanel;
@@ -3532,7 +3543,7 @@
3532
3543
  data.groupId === this.group.id;
3533
3544
  return !groupHasOnePanelAndIsActiveDragElement;
3534
3545
  }
3535
- return this.group.canDisplayOverlay(event, position, 'panel');
3546
+ return this.group.canDisplayOverlay(event, position, 'content');
3536
3547
  },
3537
3548
  });
3538
3549
  this.addDisposables(this.dropTarget);
@@ -3855,7 +3866,7 @@
3855
3866
  // don't show the overlay if the tab being dragged is the last panel of this group
3856
3867
  return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
3857
3868
  }
3858
- return group.model.canDisplayOverlay(event, position, 'panel');
3869
+ return group.model.canDisplayOverlay(event, position, 'header_space');
3859
3870
  },
3860
3871
  });
3861
3872
  this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
@@ -4248,6 +4259,7 @@
4248
4259
  this._width = 0;
4249
4260
  this._height = 0;
4250
4261
  this._panels = [];
4262
+ this._panelDisposables = new Map();
4251
4263
  this._onMove = new Emitter();
4252
4264
  this.onMove = this._onMove.event;
4253
4265
  this._onDidDrop = new Emitter();
@@ -4262,6 +4274,10 @@
4262
4274
  this.onGroupDragStart = this._onGroupDragStart.event;
4263
4275
  this._onDidAddPanel = new Emitter();
4264
4276
  this.onDidAddPanel = this._onDidAddPanel.event;
4277
+ this._onDidPanelTitleChange = new Emitter();
4278
+ this.onDidPanelTitleChange = this._onDidPanelTitleChange.event;
4279
+ this._onDidPanelParametersChange = new Emitter();
4280
+ this.onDidPanelParametersChange = this._onDidPanelParametersChange.event;
4265
4281
  this._onDidRemovePanel = new Emitter();
4266
4282
  this.onDidRemovePanel = this._onDidRemovePanel.event;
4267
4283
  this._onDidActivePanelChange = new Emitter();
@@ -4550,6 +4566,11 @@
4550
4566
  if (this.mostRecentlyUsed.includes(panel)) {
4551
4567
  this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(panel), 1);
4552
4568
  }
4569
+ const disposable = this._panelDisposables.get(panel.id);
4570
+ if (disposable) {
4571
+ disposable.dispose();
4572
+ this._panelDisposables.delete(panel.id);
4573
+ }
4553
4574
  this._onDidRemovePanel.fire({ panel });
4554
4575
  }
4555
4576
  doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
@@ -4567,6 +4588,7 @@
4567
4588
  }
4568
4589
  this.updateMru(panel);
4569
4590
  this.panels.splice(index, 0, panel);
4591
+ this._panelDisposables.set(panel.id, new CompositeDisposable(panel.api.onDidTitleChange((event) => this._onDidPanelTitleChange.fire(event)), panel.api.onDidParametersChange((event) => this._onDidPanelParametersChange.fire(event))));
4570
4592
  this._onDidAddPanel.fire({ panel });
4571
4593
  }
4572
4594
  doSetActivePanel(panel) {
@@ -4984,24 +5006,22 @@
4984
5006
  get isVisible() {
4985
5007
  return this._isVisible;
4986
5008
  }
4987
- get isHidden() {
4988
- return this._isHidden;
4989
- }
4990
5009
  get width() {
4991
5010
  return this._width;
4992
5011
  }
4993
5012
  get height() {
4994
5013
  return this._height;
4995
5014
  }
4996
- constructor(id) {
5015
+ constructor(id, component) {
4997
5016
  super();
4998
5017
  this.id = id;
5018
+ this.component = component;
4999
5019
  this._isFocused = false;
5000
5020
  this._isActive = false;
5001
5021
  this._isVisible = true;
5002
- this._isHidden = false;
5003
5022
  this._width = 0;
5004
5023
  this._height = 0;
5024
+ this._parameters = {};
5005
5025
  this.panelUpdatesDisposable = new MutableDisposable();
5006
5026
  this._onDidDimensionChange = new Emitter();
5007
5027
  this.onDidDimensionsChange = this._onDidDimensionChange.event;
@@ -5013,49 +5033,51 @@
5013
5033
  //
5014
5034
  this._onDidVisibilityChange = new Emitter();
5015
5035
  this.onDidVisibilityChange = this._onDidVisibilityChange.event;
5016
- this._onDidHiddenChange = new Emitter();
5017
- this.onDidHiddenChange = this._onDidHiddenChange.event;
5036
+ this._onWillVisibilityChange = new Emitter();
5037
+ this.onWillVisibilityChange = this._onWillVisibilityChange.event;
5018
5038
  this._onDidActiveChange = new Emitter();
5019
5039
  this.onDidActiveChange = this._onDidActiveChange.event;
5020
5040
  this._onActiveChange = new Emitter();
5021
5041
  this.onActiveChange = this._onActiveChange.event;
5022
- this._onUpdateParameters = new Emitter();
5023
- this.onUpdateParameters = this._onUpdateParameters.event;
5042
+ this._onDidParametersChange = new Emitter();
5043
+ this.onDidParametersChange = this._onDidParametersChange.event;
5024
5044
  this.addDisposables(this.onDidFocusChange((event) => {
5025
5045
  this._isFocused = event.isFocused;
5026
5046
  }), this.onDidActiveChange((event) => {
5027
5047
  this._isActive = event.isActive;
5028
5048
  }), this.onDidVisibilityChange((event) => {
5029
5049
  this._isVisible = event.isVisible;
5030
- }), this.onDidHiddenChange((event) => {
5031
- this._isHidden = event.isHidden;
5032
5050
  }), this.onDidDimensionsChange((event) => {
5033
5051
  this._width = event.width;
5034
5052
  this._height = event.height;
5035
- }), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onUpdateParameters, this._onWillFocus, this._onDidHiddenChange, this._onUpdateParameters);
5053
+ }), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onWillFocus, this._onWillVisibilityChange, this._onDidParametersChange);
5054
+ }
5055
+ getParameters() {
5056
+ return this._parameters;
5036
5057
  }
5037
5058
  initialize(panel) {
5038
- this.panelUpdatesDisposable.value = this._onUpdateParameters.event((parameters) => {
5059
+ this.panelUpdatesDisposable.value = this._onDidParametersChange.event((parameters) => {
5060
+ this._parameters = parameters;
5039
5061
  panel.update({
5040
5062
  params: parameters,
5041
5063
  });
5042
5064
  });
5043
5065
  }
5044
- setHidden(isHidden) {
5045
- this._onDidHiddenChange.fire({ isHidden });
5066
+ setVisible(isVisible) {
5067
+ this._onWillVisibilityChange.fire({ isVisible });
5046
5068
  }
5047
5069
  setActive() {
5048
5070
  this._onActiveChange.fire();
5049
5071
  }
5050
5072
  updateParameters(parameters) {
5051
- this._onUpdateParameters.fire(parameters);
5073
+ this._onDidParametersChange.fire(parameters);
5052
5074
  }
5053
5075
  }
5054
5076
 
5055
5077
  class SplitviewPanelApiImpl extends PanelApiImpl {
5056
5078
  //
5057
- constructor(id) {
5058
- super(id);
5079
+ constructor(id, component) {
5080
+ super(id, component);
5059
5081
  this._onDidConstraintsChangeInternal = new Emitter();
5060
5082
  this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
5061
5083
  //
@@ -5080,8 +5102,8 @@
5080
5102
  set pane(pane) {
5081
5103
  this._pane = pane;
5082
5104
  }
5083
- constructor(id) {
5084
- super(id);
5105
+ constructor(id, component) {
5106
+ super(id, component);
5085
5107
  this._onDidExpansionChange = new Emitter({
5086
5108
  replay: true,
5087
5109
  });
@@ -5240,7 +5262,7 @@
5240
5262
  this.header.style.display = value ? '' : 'none';
5241
5263
  }
5242
5264
  constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
5243
- super(id, component, new PaneviewPanelApiImpl(id));
5265
+ super(id, component, new PaneviewPanelApiImpl(id, component));
5244
5266
  this.headerComponent = headerComponent;
5245
5267
  this._onDidChangeExpansionState = new Emitter({ replay: true });
5246
5268
  this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
@@ -5260,7 +5282,11 @@
5260
5282
  this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
5261
5283
  this._orientation = orientation;
5262
5284
  this.element.classList.add('pane');
5263
- this.addDisposables(this.api.onDidSizeChange((event) => {
5285
+ this.addDisposables(this.api.onWillVisibilityChange((event) => {
5286
+ const { isVisible } = event;
5287
+ const { accessor } = this._params;
5288
+ accessor.setVisible(this, isVisible);
5289
+ }), this.api.onDidSizeChange((event) => {
5264
5290
  this._onDidChange.fire({ size: event.size });
5265
5291
  }), addDisposableListener(this.element, 'mouseenter', (ev) => {
5266
5292
  this.api._onMouseEnter.fire(ev);
@@ -5467,8 +5493,8 @@
5467
5493
  }
5468
5494
 
5469
5495
  class GridviewPanelApiImpl extends PanelApiImpl {
5470
- constructor(id, panel) {
5471
- super(id);
5496
+ constructor(id, component, panel) {
5497
+ super(id, component);
5472
5498
  this._onDidConstraintsChangeInternal = new Emitter();
5473
5499
  this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
5474
5500
  this._onDidConstraintsChange = new Emitter();
@@ -5539,7 +5565,7 @@
5539
5565
  return this.api.isActive;
5540
5566
  }
5541
5567
  constructor(id, component, options, api) {
5542
- super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id));
5568
+ super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id, component));
5543
5569
  this._evaluatedMinimumWidth = 0;
5544
5570
  this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
5545
5571
  this._evaluatedMinimumHeight = 0;
@@ -5564,10 +5590,10 @@
5564
5590
  this._maximumHeight = options.maximumHeight;
5565
5591
  }
5566
5592
  this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
5567
- this.addDisposables(this.api.onDidHiddenChange((event) => {
5568
- const { isHidden } = event;
5593
+ this.addDisposables(this.api.onWillVisibilityChange((event) => {
5594
+ const { isVisible } = event;
5569
5595
  const { accessor } = this._params;
5570
- accessor.setVisible(this, !isHidden);
5596
+ accessor.setVisible(this, isVisible);
5571
5597
  }), this.api.onActiveChange(() => {
5572
5598
  const { accessor } = this._params;
5573
5599
  accessor.doSetGroupActive(this);
@@ -5647,7 +5673,7 @@
5647
5673
  return this._group.model.location;
5648
5674
  }
5649
5675
  constructor(id, accessor) {
5650
- super(id);
5676
+ super(id, '__dockviewgroup__');
5651
5677
  this.accessor = accessor;
5652
5678
  this._onDidLocationChange = new Emitter();
5653
5679
  this.onDidLocationChange = this._onDidLocationChange.event;
@@ -5808,32 +5834,11 @@
5808
5834
  return this.panel.renderer;
5809
5835
  }
5810
5836
  set group(value) {
5811
- const isOldGroupActive = this.isGroupActive;
5837
+ const oldGroup = this._group;
5812
5838
  if (this._group !== value) {
5813
5839
  this._group = value;
5814
5840
  this._onDidGroupChange.fire({});
5815
- let _trackGroupActive = isOldGroupActive; // prevent duplicate events with same state
5816
- this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidLocationChange((event) => {
5817
- if (this.group !== this.panel.group) {
5818
- return;
5819
- }
5820
- this._onDidLocationChange.fire(event);
5821
- }), this.group.api.onDidActiveChange(() => {
5822
- if (this.group !== this.panel.group) {
5823
- return;
5824
- }
5825
- if (_trackGroupActive !== this.isGroupActive) {
5826
- _trackGroupActive = this.isGroupActive;
5827
- this._onDidActiveGroupChange.fire({
5828
- isActive: this.isGroupActive,
5829
- });
5830
- }
5831
- }));
5832
- // if (this.isGroupActive !== isOldGroupActive) {
5833
- // this._onDidActiveGroupChange.fire({
5834
- // isActive: this.isGroupActive,
5835
- // });
5836
- // }
5841
+ this.setupGroupEventListeners(oldGroup);
5837
5842
  this._onDidLocationChange.fire({
5838
5843
  location: this.group.api.location,
5839
5844
  });
@@ -5842,8 +5847,11 @@
5842
5847
  get group() {
5843
5848
  return this._group;
5844
5849
  }
5845
- constructor(panel, group, accessor) {
5846
- super(panel.id);
5850
+ get tabComponent() {
5851
+ return this._tabComponent;
5852
+ }
5853
+ constructor(panel, group, accessor, component, tabComponent) {
5854
+ super(panel.id, component);
5847
5855
  this.panel = panel;
5848
5856
  this.accessor = accessor;
5849
5857
  this._onDidTitleChange = new Emitter();
@@ -5857,8 +5865,10 @@
5857
5865
  this._onDidLocationChange = new Emitter();
5858
5866
  this.onDidLocationChange = this._onDidLocationChange.event;
5859
5867
  this.groupEventsDisposable = new MutableDisposable();
5868
+ this._tabComponent = tabComponent;
5860
5869
  this.initialize(panel);
5861
5870
  this._group = group;
5871
+ this.setupGroupEventListeners();
5862
5872
  this.addDisposables(this.groupEventsDisposable, this._onDidRendererChange, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange, this._onDidLocationChange);
5863
5873
  }
5864
5874
  getWindow() {
@@ -5893,6 +5903,35 @@
5893
5903
  exitMaximized() {
5894
5904
  this.group.api.exitMaximized();
5895
5905
  }
5906
+ setupGroupEventListeners(previousGroup) {
5907
+ var _a;
5908
+ let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
5909
+ this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
5910
+ if (!event.isVisible && this.isVisible) {
5911
+ this._onDidVisibilityChange.fire(event);
5912
+ }
5913
+ else if (event.isVisible &&
5914
+ !this.isVisible &&
5915
+ this.group.model.isPanelActive(this.panel)) {
5916
+ this._onDidVisibilityChange.fire(event);
5917
+ }
5918
+ }), this.group.api.onDidLocationChange((event) => {
5919
+ if (this.group !== this.panel.group) {
5920
+ return;
5921
+ }
5922
+ this._onDidLocationChange.fire(event);
5923
+ }), this.group.api.onDidActiveChange(() => {
5924
+ if (this.group !== this.panel.group) {
5925
+ return;
5926
+ }
5927
+ if (_trackGroupActive !== this.isGroupActive) {
5928
+ _trackGroupActive = this.isGroupActive;
5929
+ this._onDidActiveGroupChange.fire({
5930
+ isActive: this.isGroupActive,
5931
+ });
5932
+ }
5933
+ }));
5934
+ }
5896
5935
  }
5897
5936
 
5898
5937
  class DockviewPanel extends CompositeDisposable {
@@ -5909,7 +5948,7 @@
5909
5948
  var _a;
5910
5949
  return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
5911
5950
  }
5912
- constructor(id, accessor, containerApi, group, view, options) {
5951
+ constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
5913
5952
  super();
5914
5953
  this.id = id;
5915
5954
  this.accessor = accessor;
@@ -5917,7 +5956,7 @@
5917
5956
  this.view = view;
5918
5957
  this._renderer = options.renderer;
5919
5958
  this._group = group;
5920
- this.api = new DockviewPanelApiImpl(this, this._group, accessor);
5959
+ this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
5921
5960
  this.addDisposables(this.api.onActiveChange(() => {
5922
5961
  accessor.setActivePanel(this);
5923
5962
  }), this.api.onDidSizeChange((event) => {
@@ -6212,7 +6251,7 @@
6212
6251
  ? (_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id
6213
6252
  : panelData.tabComponent;
6214
6253
  const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
6215
- const panel = new DockviewPanel(panelId, this.accessor, new DockviewApi(this.accessor), group, view, {
6254
+ const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
6216
6255
  renderer: panelData.renderer,
6217
6256
  });
6218
6257
  panel.init({
@@ -7050,7 +7089,15 @@
7050
7089
  acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
7051
7090
  overlayModel: (_b = this.options.rootOverlayModel) !== null && _b !== void 0 ? _b : DEFAULT_ROOT_OVERLAY_MODEL,
7052
7091
  });
7053
- this.addDisposables(this._rootDropTarget.onDrop((event) => {
7092
+ this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
7093
+ if (this.gridview.length > 0 && event.position === 'center') {
7094
+ // option only available when no panels in primary grid
7095
+ return;
7096
+ }
7097
+ this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
7098
+ kind: 'edge',
7099
+ }));
7100
+ }), this._rootDropTarget.onDrop((event) => {
7054
7101
  var _a;
7055
7102
  const willDropEvent = new DockviewWillDropEvent({
7056
7103
  nativeEvent: event.nativeEvent,
@@ -7059,7 +7106,7 @@
7059
7106
  api: this._api,
7060
7107
  group: undefined,
7061
7108
  getData: getPanelData,
7062
- kind: 'content',
7109
+ kind: 'edge',
7063
7110
  });
7064
7111
  this._onWillDrop.fire(willDropEvent);
7065
7112
  if (willDropEvent.defaultPrevented) {
@@ -7115,7 +7162,7 @@
7115
7162
  const box = getBox();
7116
7163
  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;
7117
7164
  if (itemToPopout.api.location.type === 'grid') {
7118
- itemToPopout.api.setHidden(true);
7165
+ itemToPopout.api.setVisible(false);
7119
7166
  }
7120
7167
  const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
7121
7168
  theme !== null && theme !== void 0 ? theme : '', {
@@ -7166,7 +7213,7 @@
7166
7213
  }));
7167
7214
  switch (referenceLocation) {
7168
7215
  case 'grid':
7169
- referenceGroup.api.setHidden(true);
7216
+ referenceGroup.api.setVisible(false);
7170
7217
  break;
7171
7218
  case 'floating':
7172
7219
  case 'popout':
@@ -7220,8 +7267,8 @@
7220
7267
  from: group,
7221
7268
  to: referenceGroup,
7222
7269
  }));
7223
- if (referenceGroup.api.isHidden) {
7224
- referenceGroup.api.setHidden(false);
7270
+ if (!referenceGroup.api.isVisible) {
7271
+ referenceGroup.api.setVisible(true);
7225
7272
  }
7226
7273
  if (this.getPanel(group.id)) {
7227
7274
  this.doRemoveGroup(group, {
@@ -7794,7 +7841,7 @@
7794
7841
  }
7795
7842
  updateWatermark() {
7796
7843
  var _a, _b;
7797
- if (this.groups.filter((x) => x.api.location.type === 'grid' && !x.api.isHidden).length === 0) {
7844
+ if (this.groups.filter((x) => x.api.location.type === 'grid' && x.api.isVisible).length === 0) {
7798
7845
  if (!this.watermark) {
7799
7846
  this.watermark = this.createWatermarkComponent();
7800
7847
  this.watermark.init({
@@ -8191,6 +8238,8 @@
8191
8238
  if (this._onDidActivePanelChange.value !== event.panel) {
8192
8239
  this._onDidActivePanelChange.fire(event.panel);
8193
8240
  }
8241
+ }), exports.DockviewEvent.any(view.model.onDidPanelTitleChange, view.model.onDidPanelParametersChange)(() => {
8242
+ this._bufferOnDidLayoutChange.fire();
8194
8243
  }));
8195
8244
  this._groups.set(view.id, { value: view, disposable });
8196
8245
  }
@@ -8203,7 +8252,7 @@
8203
8252
  const contentComponent = options.component;
8204
8253
  const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
8205
8254
  const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
8206
- const panel = new DockviewPanel(options.id, this, this._api, group, view, { renderer: options.renderer });
8255
+ const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, { renderer: options.renderer });
8207
8256
  panel.init({
8208
8257
  title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
8209
8258
  params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
@@ -8577,19 +8626,19 @@
8577
8626
  const index = this.panels.indexOf(panel);
8578
8627
  this.splitview.setViewVisible(index, visible);
8579
8628
  }
8580
- setActive(view, skipFocus) {
8581
- this._activePanel = view;
8629
+ setActive(panel, skipFocus) {
8630
+ this._activePanel = panel;
8582
8631
  this.panels
8583
- .filter((v) => v !== view)
8632
+ .filter((v) => v !== panel)
8584
8633
  .forEach((v) => {
8585
8634
  v.api._onDidActiveChange.fire({ isActive: false });
8586
8635
  if (!skipFocus) {
8587
8636
  v.focus();
8588
8637
  }
8589
8638
  });
8590
- view.api._onDidActiveChange.fire({ isActive: true });
8639
+ panel.api._onDidActiveChange.fire({ isActive: true });
8591
8640
  if (!skipFocus) {
8592
- view.focus();
8641
+ panel.focus();
8593
8642
  }
8594
8643
  }
8595
8644
  removePanel(panel, sizing) {
@@ -8888,6 +8937,10 @@
8888
8937
  });
8889
8938
  this.addDisposables(this._disposable);
8890
8939
  }
8940
+ setVisible(panel, visible) {
8941
+ const index = this.panels.indexOf(panel);
8942
+ this.paneview.setViewVisible(index, visible);
8943
+ }
8891
8944
  focus() {
8892
8945
  //noop
8893
8946
  }
@@ -8934,6 +8987,7 @@
8934
8987
  isExpanded: options.isExpanded,
8935
8988
  title: options.title,
8936
8989
  containerApi: new PaneviewApi(this),
8990
+ accessor: this,
8937
8991
  });
8938
8992
  this.paneview.addPane(view, size, index);
8939
8993
  view.orientation = this.paneview.orientation;
@@ -9033,6 +9087,7 @@
9033
9087
  title: data.title,
9034
9088
  isExpanded: !!view.expanded,
9035
9089
  containerApi: new PaneviewApi(this),
9090
+ accessor: this,
9036
9091
  });
9037
9092
  panel.orientation = this.paneview.orientation;
9038
9093
  });
@@ -9112,7 +9167,7 @@
9112
9167
  return this._snap;
9113
9168
  }
9114
9169
  constructor(id, componentName) {
9115
- super(id, componentName, new SplitviewPanelApiImpl(id));
9170
+ super(id, componentName, new SplitviewPanelApiImpl(id, componentName));
9116
9171
  this._evaluatedMinimumSize = 0;
9117
9172
  this._evaluatedMaximumSize = Number.POSITIVE_INFINITY;
9118
9173
  this._minimumSize = 0;
@@ -9121,10 +9176,10 @@
9121
9176
  this._onDidChange = new Emitter();
9122
9177
  this.onDidChange = this._onDidChange.event;
9123
9178
  this.api.initialize(this);
9124
- this.addDisposables(this._onDidChange, this.api.onDidHiddenChange((event) => {
9125
- const { isHidden } = event;
9179
+ this.addDisposables(this._onDidChange, this.api.onWillVisibilityChange((event) => {
9180
+ const { isVisible } = event;
9126
9181
  const { accessor } = this._params;
9127
- accessor.setVisible(this, !isHidden);
9182
+ accessor.setVisible(this, isVisible);
9128
9183
  }), this.api.onActiveChange(() => {
9129
9184
  const { accessor } = this._params;
9130
9185
  accessor.setActive(this);