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.amd.js +134 -79
- package/dist/dockview.amd.js.map +1 -1
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.js.map +1 -1
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.min.noStyle.js.map +1 -1
- package/dist/dockview.amd.noStyle.js +134 -79
- package/dist/dockview.amd.noStyle.js.map +1 -1
- package/dist/dockview.cjs.js +134 -79
- package/dist/dockview.cjs.js.map +1 -1
- package/dist/dockview.esm.js +134 -79
- package/dist/dockview.esm.js.map +1 -1
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.esm.min.js.map +1 -1
- package/dist/dockview.js +134 -79
- package/dist/dockview.js.map +1 -1
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.js.map +1 -1
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.min.noStyle.js.map +1 -1
- package/dist/dockview.noStyle.js +134 -79
- package/dist/dockview.noStyle.js.map +1 -1
- package/package.json +2 -2
package/dist/dockview.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 1.10.
|
|
3
|
+
* @version 1.10.2
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -1479,6 +1479,9 @@ class Paneview extends CompositeDisposable {
|
|
|
1479
1479
|
this._onDidChange.fire();
|
|
1480
1480
|
}));
|
|
1481
1481
|
}
|
|
1482
|
+
setViewVisible(index, visible) {
|
|
1483
|
+
this.splitview.setViewVisible(index, visible);
|
|
1484
|
+
}
|
|
1482
1485
|
addPane(pane, size, index = this.splitview.length, skipLayout = false) {
|
|
1483
1486
|
const disposable = pane.onDidChangeExpansionState(() => {
|
|
1484
1487
|
this.setupAnimation();
|
|
@@ -2983,19 +2986,27 @@ class DockviewApi {
|
|
|
2983
2986
|
return this.component.onWillDrop;
|
|
2984
2987
|
}
|
|
2985
2988
|
/**
|
|
2989
|
+
* Invoked before an overlay is shown indicating a drop target.
|
|
2986
2990
|
*
|
|
2991
|
+
* Calling `event.preventDefault()` will prevent the overlay being shown and prevent
|
|
2992
|
+
* the any subsequent drop event.
|
|
2987
2993
|
*/
|
|
2988
2994
|
get onWillShowOverlay() {
|
|
2989
2995
|
return this.component.onWillShowOverlay;
|
|
2990
2996
|
}
|
|
2991
2997
|
/**
|
|
2992
|
-
* Invoked before a group is dragged.
|
|
2998
|
+
* Invoked before a group is dragged.
|
|
2999
|
+
*
|
|
3000
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
|
|
3001
|
+
*
|
|
2993
3002
|
*/
|
|
2994
3003
|
get onWillDragGroup() {
|
|
2995
3004
|
return this.component.onWillDragGroup;
|
|
2996
3005
|
}
|
|
2997
3006
|
/**
|
|
2998
|
-
* Invoked before a panel is dragged.
|
|
3007
|
+
* Invoked before a panel is dragged.
|
|
3008
|
+
*
|
|
3009
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
|
|
2999
3010
|
*/
|
|
3000
3011
|
get onWillDragPanel() {
|
|
3001
3012
|
return this.component.onWillDragPanel;
|
|
@@ -3539,7 +3550,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
3539
3550
|
data.groupId === this.group.id;
|
|
3540
3551
|
return !groupHasOnePanelAndIsActiveDragElement;
|
|
3541
3552
|
}
|
|
3542
|
-
return this.group.canDisplayOverlay(event, position, '
|
|
3553
|
+
return this.group.canDisplayOverlay(event, position, 'content');
|
|
3543
3554
|
},
|
|
3544
3555
|
});
|
|
3545
3556
|
this.addDisposables(this.dropTarget);
|
|
@@ -3862,7 +3873,7 @@ class VoidContainer extends CompositeDisposable {
|
|
|
3862
3873
|
// don't show the overlay if the tab being dragged is the last panel of this group
|
|
3863
3874
|
return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
|
|
3864
3875
|
}
|
|
3865
|
-
return group.model.canDisplayOverlay(event, position, '
|
|
3876
|
+
return group.model.canDisplayOverlay(event, position, 'header_space');
|
|
3866
3877
|
},
|
|
3867
3878
|
});
|
|
3868
3879
|
this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
|
|
@@ -4255,6 +4266,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
4255
4266
|
this._width = 0;
|
|
4256
4267
|
this._height = 0;
|
|
4257
4268
|
this._panels = [];
|
|
4269
|
+
this._panelDisposables = new Map();
|
|
4258
4270
|
this._onMove = new Emitter();
|
|
4259
4271
|
this.onMove = this._onMove.event;
|
|
4260
4272
|
this._onDidDrop = new Emitter();
|
|
@@ -4269,6 +4281,10 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
4269
4281
|
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
4270
4282
|
this._onDidAddPanel = new Emitter();
|
|
4271
4283
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4284
|
+
this._onDidPanelTitleChange = new Emitter();
|
|
4285
|
+
this.onDidPanelTitleChange = this._onDidPanelTitleChange.event;
|
|
4286
|
+
this._onDidPanelParametersChange = new Emitter();
|
|
4287
|
+
this.onDidPanelParametersChange = this._onDidPanelParametersChange.event;
|
|
4272
4288
|
this._onDidRemovePanel = new Emitter();
|
|
4273
4289
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4274
4290
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -4557,6 +4573,11 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
4557
4573
|
if (this.mostRecentlyUsed.includes(panel)) {
|
|
4558
4574
|
this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(panel), 1);
|
|
4559
4575
|
}
|
|
4576
|
+
const disposable = this._panelDisposables.get(panel.id);
|
|
4577
|
+
if (disposable) {
|
|
4578
|
+
disposable.dispose();
|
|
4579
|
+
this._panelDisposables.delete(panel.id);
|
|
4580
|
+
}
|
|
4560
4581
|
this._onDidRemovePanel.fire({ panel });
|
|
4561
4582
|
}
|
|
4562
4583
|
doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
|
|
@@ -4574,6 +4595,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
4574
4595
|
}
|
|
4575
4596
|
this.updateMru(panel);
|
|
4576
4597
|
this.panels.splice(index, 0, panel);
|
|
4598
|
+
this._panelDisposables.set(panel.id, new CompositeDisposable(panel.api.onDidTitleChange((event) => this._onDidPanelTitleChange.fire(event)), panel.api.onDidParametersChange((event) => this._onDidPanelParametersChange.fire(event))));
|
|
4577
4599
|
this._onDidAddPanel.fire({ panel });
|
|
4578
4600
|
}
|
|
4579
4601
|
doSetActivePanel(panel) {
|
|
@@ -4991,24 +5013,22 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
4991
5013
|
get isVisible() {
|
|
4992
5014
|
return this._isVisible;
|
|
4993
5015
|
}
|
|
4994
|
-
get isHidden() {
|
|
4995
|
-
return this._isHidden;
|
|
4996
|
-
}
|
|
4997
5016
|
get width() {
|
|
4998
5017
|
return this._width;
|
|
4999
5018
|
}
|
|
5000
5019
|
get height() {
|
|
5001
5020
|
return this._height;
|
|
5002
5021
|
}
|
|
5003
|
-
constructor(id) {
|
|
5022
|
+
constructor(id, component) {
|
|
5004
5023
|
super();
|
|
5005
5024
|
this.id = id;
|
|
5025
|
+
this.component = component;
|
|
5006
5026
|
this._isFocused = false;
|
|
5007
5027
|
this._isActive = false;
|
|
5008
5028
|
this._isVisible = true;
|
|
5009
|
-
this._isHidden = false;
|
|
5010
5029
|
this._width = 0;
|
|
5011
5030
|
this._height = 0;
|
|
5031
|
+
this._parameters = {};
|
|
5012
5032
|
this.panelUpdatesDisposable = new MutableDisposable();
|
|
5013
5033
|
this._onDidDimensionChange = new Emitter();
|
|
5014
5034
|
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
@@ -5020,49 +5040,51 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
5020
5040
|
//
|
|
5021
5041
|
this._onDidVisibilityChange = new Emitter();
|
|
5022
5042
|
this.onDidVisibilityChange = this._onDidVisibilityChange.event;
|
|
5023
|
-
this.
|
|
5024
|
-
this.
|
|
5043
|
+
this._onWillVisibilityChange = new Emitter();
|
|
5044
|
+
this.onWillVisibilityChange = this._onWillVisibilityChange.event;
|
|
5025
5045
|
this._onDidActiveChange = new Emitter();
|
|
5026
5046
|
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
5027
5047
|
this._onActiveChange = new Emitter();
|
|
5028
5048
|
this.onActiveChange = this._onActiveChange.event;
|
|
5029
|
-
this.
|
|
5030
|
-
this.
|
|
5049
|
+
this._onDidParametersChange = new Emitter();
|
|
5050
|
+
this.onDidParametersChange = this._onDidParametersChange.event;
|
|
5031
5051
|
this.addDisposables(this.onDidFocusChange((event) => {
|
|
5032
5052
|
this._isFocused = event.isFocused;
|
|
5033
5053
|
}), this.onDidActiveChange((event) => {
|
|
5034
5054
|
this._isActive = event.isActive;
|
|
5035
5055
|
}), this.onDidVisibilityChange((event) => {
|
|
5036
5056
|
this._isVisible = event.isVisible;
|
|
5037
|
-
}), this.onDidHiddenChange((event) => {
|
|
5038
|
-
this._isHidden = event.isHidden;
|
|
5039
5057
|
}), this.onDidDimensionsChange((event) => {
|
|
5040
5058
|
this._width = event.width;
|
|
5041
5059
|
this._height = event.height;
|
|
5042
|
-
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this.
|
|
5060
|
+
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onWillFocus, this._onWillVisibilityChange, this._onDidParametersChange);
|
|
5061
|
+
}
|
|
5062
|
+
getParameters() {
|
|
5063
|
+
return this._parameters;
|
|
5043
5064
|
}
|
|
5044
5065
|
initialize(panel) {
|
|
5045
|
-
this.panelUpdatesDisposable.value = this.
|
|
5066
|
+
this.panelUpdatesDisposable.value = this._onDidParametersChange.event((parameters) => {
|
|
5067
|
+
this._parameters = parameters;
|
|
5046
5068
|
panel.update({
|
|
5047
5069
|
params: parameters,
|
|
5048
5070
|
});
|
|
5049
5071
|
});
|
|
5050
5072
|
}
|
|
5051
|
-
|
|
5052
|
-
this.
|
|
5073
|
+
setVisible(isVisible) {
|
|
5074
|
+
this._onWillVisibilityChange.fire({ isVisible });
|
|
5053
5075
|
}
|
|
5054
5076
|
setActive() {
|
|
5055
5077
|
this._onActiveChange.fire();
|
|
5056
5078
|
}
|
|
5057
5079
|
updateParameters(parameters) {
|
|
5058
|
-
this.
|
|
5080
|
+
this._onDidParametersChange.fire(parameters);
|
|
5059
5081
|
}
|
|
5060
5082
|
}
|
|
5061
5083
|
|
|
5062
5084
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
5063
5085
|
//
|
|
5064
|
-
constructor(id) {
|
|
5065
|
-
super(id);
|
|
5086
|
+
constructor(id, component) {
|
|
5087
|
+
super(id, component);
|
|
5066
5088
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
5067
5089
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
5068
5090
|
//
|
|
@@ -5087,8 +5109,8 @@ class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
|
5087
5109
|
set pane(pane) {
|
|
5088
5110
|
this._pane = pane;
|
|
5089
5111
|
}
|
|
5090
|
-
constructor(id) {
|
|
5091
|
-
super(id);
|
|
5112
|
+
constructor(id, component) {
|
|
5113
|
+
super(id, component);
|
|
5092
5114
|
this._onDidExpansionChange = new Emitter({
|
|
5093
5115
|
replay: true,
|
|
5094
5116
|
});
|
|
@@ -5247,7 +5269,7 @@ class PaneviewPanel extends BasePanelView {
|
|
|
5247
5269
|
this.header.style.display = value ? '' : 'none';
|
|
5248
5270
|
}
|
|
5249
5271
|
constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
|
|
5250
|
-
super(id, component, new PaneviewPanelApiImpl(id));
|
|
5272
|
+
super(id, component, new PaneviewPanelApiImpl(id, component));
|
|
5251
5273
|
this.headerComponent = headerComponent;
|
|
5252
5274
|
this._onDidChangeExpansionState = new Emitter({ replay: true });
|
|
5253
5275
|
this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
|
|
@@ -5267,7 +5289,11 @@ class PaneviewPanel extends BasePanelView {
|
|
|
5267
5289
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
5268
5290
|
this._orientation = orientation;
|
|
5269
5291
|
this.element.classList.add('pane');
|
|
5270
|
-
this.addDisposables(this.api.
|
|
5292
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
5293
|
+
const { isVisible } = event;
|
|
5294
|
+
const { accessor } = this._params;
|
|
5295
|
+
accessor.setVisible(this, isVisible);
|
|
5296
|
+
}), this.api.onDidSizeChange((event) => {
|
|
5271
5297
|
this._onDidChange.fire({ size: event.size });
|
|
5272
5298
|
}), addDisposableListener(this.element, 'mouseenter', (ev) => {
|
|
5273
5299
|
this.api._onMouseEnter.fire(ev);
|
|
@@ -5474,8 +5500,8 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
5474
5500
|
}
|
|
5475
5501
|
|
|
5476
5502
|
class GridviewPanelApiImpl extends PanelApiImpl {
|
|
5477
|
-
constructor(id, panel) {
|
|
5478
|
-
super(id);
|
|
5503
|
+
constructor(id, component, panel) {
|
|
5504
|
+
super(id, component);
|
|
5479
5505
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
5480
5506
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
5481
5507
|
this._onDidConstraintsChange = new Emitter();
|
|
@@ -5546,7 +5572,7 @@ class GridviewPanel extends BasePanelView {
|
|
|
5546
5572
|
return this.api.isActive;
|
|
5547
5573
|
}
|
|
5548
5574
|
constructor(id, component, options, api) {
|
|
5549
|
-
super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id));
|
|
5575
|
+
super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id, component));
|
|
5550
5576
|
this._evaluatedMinimumWidth = 0;
|
|
5551
5577
|
this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
|
|
5552
5578
|
this._evaluatedMinimumHeight = 0;
|
|
@@ -5571,10 +5597,10 @@ class GridviewPanel extends BasePanelView {
|
|
|
5571
5597
|
this._maximumHeight = options.maximumHeight;
|
|
5572
5598
|
}
|
|
5573
5599
|
this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
|
|
5574
|
-
this.addDisposables(this.api.
|
|
5575
|
-
const {
|
|
5600
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
5601
|
+
const { isVisible } = event;
|
|
5576
5602
|
const { accessor } = this._params;
|
|
5577
|
-
accessor.setVisible(this,
|
|
5603
|
+
accessor.setVisible(this, isVisible);
|
|
5578
5604
|
}), this.api.onActiveChange(() => {
|
|
5579
5605
|
const { accessor } = this._params;
|
|
5580
5606
|
accessor.doSetGroupActive(this);
|
|
@@ -5654,7 +5680,7 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5654
5680
|
return this._group.model.location;
|
|
5655
5681
|
}
|
|
5656
5682
|
constructor(id, accessor) {
|
|
5657
|
-
super(id);
|
|
5683
|
+
super(id, '__dockviewgroup__');
|
|
5658
5684
|
this.accessor = accessor;
|
|
5659
5685
|
this._onDidLocationChange = new Emitter();
|
|
5660
5686
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
@@ -5815,32 +5841,11 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5815
5841
|
return this.panel.renderer;
|
|
5816
5842
|
}
|
|
5817
5843
|
set group(value) {
|
|
5818
|
-
const
|
|
5844
|
+
const oldGroup = this._group;
|
|
5819
5845
|
if (this._group !== value) {
|
|
5820
5846
|
this._group = value;
|
|
5821
5847
|
this._onDidGroupChange.fire({});
|
|
5822
|
-
|
|
5823
|
-
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidLocationChange((event) => {
|
|
5824
|
-
if (this.group !== this.panel.group) {
|
|
5825
|
-
return;
|
|
5826
|
-
}
|
|
5827
|
-
this._onDidLocationChange.fire(event);
|
|
5828
|
-
}), this.group.api.onDidActiveChange(() => {
|
|
5829
|
-
if (this.group !== this.panel.group) {
|
|
5830
|
-
return;
|
|
5831
|
-
}
|
|
5832
|
-
if (_trackGroupActive !== this.isGroupActive) {
|
|
5833
|
-
_trackGroupActive = this.isGroupActive;
|
|
5834
|
-
this._onDidActiveGroupChange.fire({
|
|
5835
|
-
isActive: this.isGroupActive,
|
|
5836
|
-
});
|
|
5837
|
-
}
|
|
5838
|
-
}));
|
|
5839
|
-
// if (this.isGroupActive !== isOldGroupActive) {
|
|
5840
|
-
// this._onDidActiveGroupChange.fire({
|
|
5841
|
-
// isActive: this.isGroupActive,
|
|
5842
|
-
// });
|
|
5843
|
-
// }
|
|
5848
|
+
this.setupGroupEventListeners(oldGroup);
|
|
5844
5849
|
this._onDidLocationChange.fire({
|
|
5845
5850
|
location: this.group.api.location,
|
|
5846
5851
|
});
|
|
@@ -5849,8 +5854,11 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5849
5854
|
get group() {
|
|
5850
5855
|
return this._group;
|
|
5851
5856
|
}
|
|
5852
|
-
|
|
5853
|
-
|
|
5857
|
+
get tabComponent() {
|
|
5858
|
+
return this._tabComponent;
|
|
5859
|
+
}
|
|
5860
|
+
constructor(panel, group, accessor, component, tabComponent) {
|
|
5861
|
+
super(panel.id, component);
|
|
5854
5862
|
this.panel = panel;
|
|
5855
5863
|
this.accessor = accessor;
|
|
5856
5864
|
this._onDidTitleChange = new Emitter();
|
|
@@ -5864,8 +5872,10 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5864
5872
|
this._onDidLocationChange = new Emitter();
|
|
5865
5873
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
5866
5874
|
this.groupEventsDisposable = new MutableDisposable();
|
|
5875
|
+
this._tabComponent = tabComponent;
|
|
5867
5876
|
this.initialize(panel);
|
|
5868
5877
|
this._group = group;
|
|
5878
|
+
this.setupGroupEventListeners();
|
|
5869
5879
|
this.addDisposables(this.groupEventsDisposable, this._onDidRendererChange, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange, this._onDidLocationChange);
|
|
5870
5880
|
}
|
|
5871
5881
|
getWindow() {
|
|
@@ -5900,6 +5910,35 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5900
5910
|
exitMaximized() {
|
|
5901
5911
|
this.group.api.exitMaximized();
|
|
5902
5912
|
}
|
|
5913
|
+
setupGroupEventListeners(previousGroup) {
|
|
5914
|
+
var _a;
|
|
5915
|
+
let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
5916
|
+
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
|
|
5917
|
+
if (!event.isVisible && this.isVisible) {
|
|
5918
|
+
this._onDidVisibilityChange.fire(event);
|
|
5919
|
+
}
|
|
5920
|
+
else if (event.isVisible &&
|
|
5921
|
+
!this.isVisible &&
|
|
5922
|
+
this.group.model.isPanelActive(this.panel)) {
|
|
5923
|
+
this._onDidVisibilityChange.fire(event);
|
|
5924
|
+
}
|
|
5925
|
+
}), this.group.api.onDidLocationChange((event) => {
|
|
5926
|
+
if (this.group !== this.panel.group) {
|
|
5927
|
+
return;
|
|
5928
|
+
}
|
|
5929
|
+
this._onDidLocationChange.fire(event);
|
|
5930
|
+
}), this.group.api.onDidActiveChange(() => {
|
|
5931
|
+
if (this.group !== this.panel.group) {
|
|
5932
|
+
return;
|
|
5933
|
+
}
|
|
5934
|
+
if (_trackGroupActive !== this.isGroupActive) {
|
|
5935
|
+
_trackGroupActive = this.isGroupActive;
|
|
5936
|
+
this._onDidActiveGroupChange.fire({
|
|
5937
|
+
isActive: this.isGroupActive,
|
|
5938
|
+
});
|
|
5939
|
+
}
|
|
5940
|
+
}));
|
|
5941
|
+
}
|
|
5903
5942
|
}
|
|
5904
5943
|
|
|
5905
5944
|
class DockviewPanel extends CompositeDisposable {
|
|
@@ -5916,7 +5955,7 @@ class DockviewPanel extends CompositeDisposable {
|
|
|
5916
5955
|
var _a;
|
|
5917
5956
|
return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
|
|
5918
5957
|
}
|
|
5919
|
-
constructor(id, accessor, containerApi, group, view, options) {
|
|
5958
|
+
constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
|
|
5920
5959
|
super();
|
|
5921
5960
|
this.id = id;
|
|
5922
5961
|
this.accessor = accessor;
|
|
@@ -5924,7 +5963,7 @@ class DockviewPanel extends CompositeDisposable {
|
|
|
5924
5963
|
this.view = view;
|
|
5925
5964
|
this._renderer = options.renderer;
|
|
5926
5965
|
this._group = group;
|
|
5927
|
-
this.api = new DockviewPanelApiImpl(this, this._group, accessor);
|
|
5966
|
+
this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
|
|
5928
5967
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
5929
5968
|
accessor.setActivePanel(this);
|
|
5930
5969
|
}), this.api.onDidSizeChange((event) => {
|
|
@@ -6219,7 +6258,7 @@ class DefaultDockviewDeserialzier {
|
|
|
6219
6258
|
? (_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id
|
|
6220
6259
|
: panelData.tabComponent;
|
|
6221
6260
|
const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
|
|
6222
|
-
const panel = new DockviewPanel(panelId, this.accessor, new DockviewApi(this.accessor), group, view, {
|
|
6261
|
+
const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
|
|
6223
6262
|
renderer: panelData.renderer,
|
|
6224
6263
|
});
|
|
6225
6264
|
panel.init({
|
|
@@ -7057,7 +7096,15 @@ class DockviewComponent extends BaseGrid {
|
|
|
7057
7096
|
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
7058
7097
|
overlayModel: (_b = this.options.rootOverlayModel) !== null && _b !== void 0 ? _b : DEFAULT_ROOT_OVERLAY_MODEL,
|
|
7059
7098
|
});
|
|
7060
|
-
this.addDisposables(this._rootDropTarget.
|
|
7099
|
+
this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
|
|
7100
|
+
if (this.gridview.length > 0 && event.position === 'center') {
|
|
7101
|
+
// option only available when no panels in primary grid
|
|
7102
|
+
return;
|
|
7103
|
+
}
|
|
7104
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
7105
|
+
kind: 'edge',
|
|
7106
|
+
}));
|
|
7107
|
+
}), this._rootDropTarget.onDrop((event) => {
|
|
7061
7108
|
var _a;
|
|
7062
7109
|
const willDropEvent = new DockviewWillDropEvent({
|
|
7063
7110
|
nativeEvent: event.nativeEvent,
|
|
@@ -7066,7 +7113,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
7066
7113
|
api: this._api,
|
|
7067
7114
|
group: undefined,
|
|
7068
7115
|
getData: getPanelData,
|
|
7069
|
-
kind: '
|
|
7116
|
+
kind: 'edge',
|
|
7070
7117
|
});
|
|
7071
7118
|
this._onWillDrop.fire(willDropEvent);
|
|
7072
7119
|
if (willDropEvent.defaultPrevented) {
|
|
@@ -7122,7 +7169,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
7122
7169
|
const box = getBox();
|
|
7123
7170
|
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;
|
|
7124
7171
|
if (itemToPopout.api.location.type === 'grid') {
|
|
7125
|
-
itemToPopout.api.
|
|
7172
|
+
itemToPopout.api.setVisible(false);
|
|
7126
7173
|
}
|
|
7127
7174
|
const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
|
|
7128
7175
|
theme !== null && theme !== void 0 ? theme : '', {
|
|
@@ -7173,7 +7220,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
7173
7220
|
}));
|
|
7174
7221
|
switch (referenceLocation) {
|
|
7175
7222
|
case 'grid':
|
|
7176
|
-
referenceGroup.api.
|
|
7223
|
+
referenceGroup.api.setVisible(false);
|
|
7177
7224
|
break;
|
|
7178
7225
|
case 'floating':
|
|
7179
7226
|
case 'popout':
|
|
@@ -7227,8 +7274,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
7227
7274
|
from: group,
|
|
7228
7275
|
to: referenceGroup,
|
|
7229
7276
|
}));
|
|
7230
|
-
if (referenceGroup.api.
|
|
7231
|
-
referenceGroup.api.
|
|
7277
|
+
if (!referenceGroup.api.isVisible) {
|
|
7278
|
+
referenceGroup.api.setVisible(true);
|
|
7232
7279
|
}
|
|
7233
7280
|
if (this.getPanel(group.id)) {
|
|
7234
7281
|
this.doRemoveGroup(group, {
|
|
@@ -7801,7 +7848,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
7801
7848
|
}
|
|
7802
7849
|
updateWatermark() {
|
|
7803
7850
|
var _a, _b;
|
|
7804
|
-
if (this.groups.filter((x) => x.api.location.type === 'grid' &&
|
|
7851
|
+
if (this.groups.filter((x) => x.api.location.type === 'grid' && x.api.isVisible).length === 0) {
|
|
7805
7852
|
if (!this.watermark) {
|
|
7806
7853
|
this.watermark = this.createWatermarkComponent();
|
|
7807
7854
|
this.watermark.init({
|
|
@@ -8198,6 +8245,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
8198
8245
|
if (this._onDidActivePanelChange.value !== event.panel) {
|
|
8199
8246
|
this._onDidActivePanelChange.fire(event.panel);
|
|
8200
8247
|
}
|
|
8248
|
+
}), Event.any(view.model.onDidPanelTitleChange, view.model.onDidPanelParametersChange)(() => {
|
|
8249
|
+
this._bufferOnDidLayoutChange.fire();
|
|
8201
8250
|
}));
|
|
8202
8251
|
this._groups.set(view.id, { value: view, disposable });
|
|
8203
8252
|
}
|
|
@@ -8210,7 +8259,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8210
8259
|
const contentComponent = options.component;
|
|
8211
8260
|
const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
|
|
8212
8261
|
const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
|
|
8213
|
-
const panel = new DockviewPanel(options.id, this, this._api, group, view, { renderer: options.renderer });
|
|
8262
|
+
const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, { renderer: options.renderer });
|
|
8214
8263
|
panel.init({
|
|
8215
8264
|
title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
|
|
8216
8265
|
params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
|
|
@@ -8584,19 +8633,19 @@ class SplitviewComponent extends Resizable {
|
|
|
8584
8633
|
const index = this.panels.indexOf(panel);
|
|
8585
8634
|
this.splitview.setViewVisible(index, visible);
|
|
8586
8635
|
}
|
|
8587
|
-
setActive(
|
|
8588
|
-
this._activePanel =
|
|
8636
|
+
setActive(panel, skipFocus) {
|
|
8637
|
+
this._activePanel = panel;
|
|
8589
8638
|
this.panels
|
|
8590
|
-
.filter((v) => v !==
|
|
8639
|
+
.filter((v) => v !== panel)
|
|
8591
8640
|
.forEach((v) => {
|
|
8592
8641
|
v.api._onDidActiveChange.fire({ isActive: false });
|
|
8593
8642
|
if (!skipFocus) {
|
|
8594
8643
|
v.focus();
|
|
8595
8644
|
}
|
|
8596
8645
|
});
|
|
8597
|
-
|
|
8646
|
+
panel.api._onDidActiveChange.fire({ isActive: true });
|
|
8598
8647
|
if (!skipFocus) {
|
|
8599
|
-
|
|
8648
|
+
panel.focus();
|
|
8600
8649
|
}
|
|
8601
8650
|
}
|
|
8602
8651
|
removePanel(panel, sizing) {
|
|
@@ -8895,6 +8944,10 @@ class PaneviewComponent extends Resizable {
|
|
|
8895
8944
|
});
|
|
8896
8945
|
this.addDisposables(this._disposable);
|
|
8897
8946
|
}
|
|
8947
|
+
setVisible(panel, visible) {
|
|
8948
|
+
const index = this.panels.indexOf(panel);
|
|
8949
|
+
this.paneview.setViewVisible(index, visible);
|
|
8950
|
+
}
|
|
8898
8951
|
focus() {
|
|
8899
8952
|
//noop
|
|
8900
8953
|
}
|
|
@@ -8941,6 +8994,7 @@ class PaneviewComponent extends Resizable {
|
|
|
8941
8994
|
isExpanded: options.isExpanded,
|
|
8942
8995
|
title: options.title,
|
|
8943
8996
|
containerApi: new PaneviewApi(this),
|
|
8997
|
+
accessor: this,
|
|
8944
8998
|
});
|
|
8945
8999
|
this.paneview.addPane(view, size, index);
|
|
8946
9000
|
view.orientation = this.paneview.orientation;
|
|
@@ -9040,6 +9094,7 @@ class PaneviewComponent extends Resizable {
|
|
|
9040
9094
|
title: data.title,
|
|
9041
9095
|
isExpanded: !!view.expanded,
|
|
9042
9096
|
containerApi: new PaneviewApi(this),
|
|
9097
|
+
accessor: this,
|
|
9043
9098
|
});
|
|
9044
9099
|
panel.orientation = this.paneview.orientation;
|
|
9045
9100
|
});
|
|
@@ -9119,7 +9174,7 @@ class SplitviewPanel extends BasePanelView {
|
|
|
9119
9174
|
return this._snap;
|
|
9120
9175
|
}
|
|
9121
9176
|
constructor(id, componentName) {
|
|
9122
|
-
super(id, componentName, new SplitviewPanelApiImpl(id));
|
|
9177
|
+
super(id, componentName, new SplitviewPanelApiImpl(id, componentName));
|
|
9123
9178
|
this._evaluatedMinimumSize = 0;
|
|
9124
9179
|
this._evaluatedMaximumSize = Number.POSITIVE_INFINITY;
|
|
9125
9180
|
this._minimumSize = 0;
|
|
@@ -9128,10 +9183,10 @@ class SplitviewPanel extends BasePanelView {
|
|
|
9128
9183
|
this._onDidChange = new Emitter();
|
|
9129
9184
|
this.onDidChange = this._onDidChange.event;
|
|
9130
9185
|
this.api.initialize(this);
|
|
9131
|
-
this.addDisposables(this._onDidChange, this.api.
|
|
9132
|
-
const {
|
|
9186
|
+
this.addDisposables(this._onDidChange, this.api.onWillVisibilityChange((event) => {
|
|
9187
|
+
const { isVisible } = event;
|
|
9133
9188
|
const { accessor } = this._params;
|
|
9134
|
-
accessor.setVisible(this,
|
|
9189
|
+
accessor.setVisible(this, isVisible);
|
|
9135
9190
|
}), this.api.onActiveChange(() => {
|
|
9136
9191
|
const { accessor } = this._params;
|
|
9137
9192
|
accessor.setActive(this);
|