dockview-core 1.10.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/component.api.d.ts +10 -2
- package/dist/cjs/api/component.api.js +10 -2
- package/dist/cjs/api/dockviewGroupPanelApi.js +1 -1
- package/dist/cjs/api/dockviewPanelApi.d.ts +5 -1
- package/dist/cjs/api/dockviewPanelApi.js +43 -26
- package/dist/cjs/api/gridviewPanelApi.d.ts +1 -1
- package/dist/cjs/api/gridviewPanelApi.js +2 -2
- package/dist/cjs/api/panelApi.d.ts +12 -16
- package/dist/cjs/api/panelApi.js +17 -20
- package/dist/cjs/api/paneviewPanelApi.d.ts +1 -1
- package/dist/cjs/api/paneviewPanelApi.js +2 -2
- package/dist/cjs/api/splitviewPanelApi.d.ts +1 -1
- package/dist/cjs/api/splitviewPanelApi.js +2 -2
- package/dist/cjs/dockview/components/panel/content.js +1 -1
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/cjs/dockview/deserializer.js +1 -1
- package/dist/cjs/dockview/dockviewComponent.js +18 -8
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +10 -5
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +16 -0
- package/dist/cjs/dockview/dockviewPanel.d.ts +1 -1
- package/dist/cjs/dockview/dockviewPanel.js +2 -2
- package/dist/cjs/dockview/options.d.ts +3 -3
- package/dist/cjs/dockview/types.d.ts +0 -1
- package/dist/cjs/gridview/gridviewPanel.js +4 -4
- package/dist/cjs/lifecycle.d.ts +1 -1
- package/dist/cjs/paneview/paneview.d.ts +1 -0
- package/dist/cjs/paneview/paneview.js +3 -0
- package/dist/cjs/paneview/paneviewComponent.d.ts +2 -0
- package/dist/cjs/paneview/paneviewComponent.js +6 -0
- package/dist/cjs/paneview/paneviewPanel.d.ts +2 -0
- package/dist/cjs/paneview/paneviewPanel.js +6 -2
- package/dist/cjs/splitview/splitviewComponent.d.ts +1 -1
- package/dist/cjs/splitview/splitviewComponent.js +5 -5
- package/dist/cjs/splitview/splitviewPanel.js +4 -4
- package/dist/dockview-core.amd.js +134 -79
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +134 -79
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +134 -79
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +134 -79
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +134 -79
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +134 -79
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +10 -2
- package/dist/esm/api/component.api.js +10 -2
- package/dist/esm/api/dockviewGroupPanelApi.js +1 -1
- package/dist/esm/api/dockviewPanelApi.d.ts +5 -1
- package/dist/esm/api/dockviewPanelApi.js +38 -25
- package/dist/esm/api/gridviewPanelApi.d.ts +1 -1
- package/dist/esm/api/gridviewPanelApi.js +2 -2
- package/dist/esm/api/panelApi.d.ts +12 -16
- package/dist/esm/api/panelApi.js +16 -16
- package/dist/esm/api/paneviewPanelApi.d.ts +1 -1
- package/dist/esm/api/paneviewPanelApi.js +2 -2
- package/dist/esm/api/splitviewPanelApi.d.ts +1 -1
- package/dist/esm/api/splitviewPanelApi.js +2 -2
- package/dist/esm/dockview/components/panel/content.js +1 -1
- package/dist/esm/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/esm/dockview/deserializer.js +1 -1
- package/dist/esm/dockview/dockviewComponent.js +19 -9
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +10 -5
- package/dist/esm/dockview/dockviewGroupPanelModel.js +11 -0
- package/dist/esm/dockview/dockviewPanel.d.ts +1 -1
- package/dist/esm/dockview/dockviewPanel.js +2 -2
- package/dist/esm/dockview/options.d.ts +3 -3
- package/dist/esm/dockview/types.d.ts +0 -1
- package/dist/esm/gridview/gridviewPanel.js +4 -4
- package/dist/esm/lifecycle.d.ts +1 -1
- package/dist/esm/paneview/paneview.d.ts +1 -0
- package/dist/esm/paneview/paneview.js +3 -0
- package/dist/esm/paneview/paneviewComponent.d.ts +2 -0
- package/dist/esm/paneview/paneviewComponent.js +6 -0
- package/dist/esm/paneview/paneviewPanel.d.ts +2 -0
- package/dist/esm/paneview/paneviewPanel.js +6 -2
- package/dist/esm/splitview/splitviewComponent.d.ts +1 -1
- package/dist/esm/splitview/splitviewComponent.js +5 -5
- package/dist/esm/splitview/splitviewPanel.js +4 -4
- package/package.json +1 -1
package/dist/dockview-core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 1.10.
|
|
3
|
+
* @version 1.10.2
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -1482,6 +1482,9 @@
|
|
|
1482
1482
|
this._onDidChange.fire();
|
|
1483
1483
|
}));
|
|
1484
1484
|
}
|
|
1485
|
+
setViewVisible(index, visible) {
|
|
1486
|
+
this.splitview.setViewVisible(index, visible);
|
|
1487
|
+
}
|
|
1485
1488
|
addPane(pane, size, index = this.splitview.length, skipLayout = false) {
|
|
1486
1489
|
const disposable = pane.onDidChangeExpansionState(() => {
|
|
1487
1490
|
this.setupAnimation();
|
|
@@ -2986,19 +2989,27 @@
|
|
|
2986
2989
|
return this.component.onWillDrop;
|
|
2987
2990
|
}
|
|
2988
2991
|
/**
|
|
2992
|
+
* Invoked before an overlay is shown indicating a drop target.
|
|
2989
2993
|
*
|
|
2994
|
+
* Calling `event.preventDefault()` will prevent the overlay being shown and prevent
|
|
2995
|
+
* the any subsequent drop event.
|
|
2990
2996
|
*/
|
|
2991
2997
|
get onWillShowOverlay() {
|
|
2992
2998
|
return this.component.onWillShowOverlay;
|
|
2993
2999
|
}
|
|
2994
3000
|
/**
|
|
2995
|
-
* Invoked before a group is dragged.
|
|
3001
|
+
* Invoked before a group is dragged.
|
|
3002
|
+
*
|
|
3003
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
|
|
3004
|
+
*
|
|
2996
3005
|
*/
|
|
2997
3006
|
get onWillDragGroup() {
|
|
2998
3007
|
return this.component.onWillDragGroup;
|
|
2999
3008
|
}
|
|
3000
3009
|
/**
|
|
3001
|
-
* Invoked before a panel is dragged.
|
|
3010
|
+
* Invoked before a panel is dragged.
|
|
3011
|
+
*
|
|
3012
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
|
|
3002
3013
|
*/
|
|
3003
3014
|
get onWillDragPanel() {
|
|
3004
3015
|
return this.component.onWillDragPanel;
|
|
@@ -3542,7 +3553,7 @@
|
|
|
3542
3553
|
data.groupId === this.group.id;
|
|
3543
3554
|
return !groupHasOnePanelAndIsActiveDragElement;
|
|
3544
3555
|
}
|
|
3545
|
-
return this.group.canDisplayOverlay(event, position, '
|
|
3556
|
+
return this.group.canDisplayOverlay(event, position, 'content');
|
|
3546
3557
|
},
|
|
3547
3558
|
});
|
|
3548
3559
|
this.addDisposables(this.dropTarget);
|
|
@@ -3865,7 +3876,7 @@
|
|
|
3865
3876
|
// don't show the overlay if the tab being dragged is the last panel of this group
|
|
3866
3877
|
return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
|
|
3867
3878
|
}
|
|
3868
|
-
return group.model.canDisplayOverlay(event, position, '
|
|
3879
|
+
return group.model.canDisplayOverlay(event, position, 'header_space');
|
|
3869
3880
|
},
|
|
3870
3881
|
});
|
|
3871
3882
|
this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
|
|
@@ -4258,6 +4269,7 @@
|
|
|
4258
4269
|
this._width = 0;
|
|
4259
4270
|
this._height = 0;
|
|
4260
4271
|
this._panels = [];
|
|
4272
|
+
this._panelDisposables = new Map();
|
|
4261
4273
|
this._onMove = new Emitter();
|
|
4262
4274
|
this.onMove = this._onMove.event;
|
|
4263
4275
|
this._onDidDrop = new Emitter();
|
|
@@ -4272,6 +4284,10 @@
|
|
|
4272
4284
|
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
4273
4285
|
this._onDidAddPanel = new Emitter();
|
|
4274
4286
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4287
|
+
this._onDidPanelTitleChange = new Emitter();
|
|
4288
|
+
this.onDidPanelTitleChange = this._onDidPanelTitleChange.event;
|
|
4289
|
+
this._onDidPanelParametersChange = new Emitter();
|
|
4290
|
+
this.onDidPanelParametersChange = this._onDidPanelParametersChange.event;
|
|
4275
4291
|
this._onDidRemovePanel = new Emitter();
|
|
4276
4292
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4277
4293
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -4560,6 +4576,11 @@
|
|
|
4560
4576
|
if (this.mostRecentlyUsed.includes(panel)) {
|
|
4561
4577
|
this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(panel), 1);
|
|
4562
4578
|
}
|
|
4579
|
+
const disposable = this._panelDisposables.get(panel.id);
|
|
4580
|
+
if (disposable) {
|
|
4581
|
+
disposable.dispose();
|
|
4582
|
+
this._panelDisposables.delete(panel.id);
|
|
4583
|
+
}
|
|
4563
4584
|
this._onDidRemovePanel.fire({ panel });
|
|
4564
4585
|
}
|
|
4565
4586
|
doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
|
|
@@ -4577,6 +4598,7 @@
|
|
|
4577
4598
|
}
|
|
4578
4599
|
this.updateMru(panel);
|
|
4579
4600
|
this.panels.splice(index, 0, panel);
|
|
4601
|
+
this._panelDisposables.set(panel.id, new CompositeDisposable(panel.api.onDidTitleChange((event) => this._onDidPanelTitleChange.fire(event)), panel.api.onDidParametersChange((event) => this._onDidPanelParametersChange.fire(event))));
|
|
4580
4602
|
this._onDidAddPanel.fire({ panel });
|
|
4581
4603
|
}
|
|
4582
4604
|
doSetActivePanel(panel) {
|
|
@@ -4994,24 +5016,22 @@
|
|
|
4994
5016
|
get isVisible() {
|
|
4995
5017
|
return this._isVisible;
|
|
4996
5018
|
}
|
|
4997
|
-
get isHidden() {
|
|
4998
|
-
return this._isHidden;
|
|
4999
|
-
}
|
|
5000
5019
|
get width() {
|
|
5001
5020
|
return this._width;
|
|
5002
5021
|
}
|
|
5003
5022
|
get height() {
|
|
5004
5023
|
return this._height;
|
|
5005
5024
|
}
|
|
5006
|
-
constructor(id) {
|
|
5025
|
+
constructor(id, component) {
|
|
5007
5026
|
super();
|
|
5008
5027
|
this.id = id;
|
|
5028
|
+
this.component = component;
|
|
5009
5029
|
this._isFocused = false;
|
|
5010
5030
|
this._isActive = false;
|
|
5011
5031
|
this._isVisible = true;
|
|
5012
|
-
this._isHidden = false;
|
|
5013
5032
|
this._width = 0;
|
|
5014
5033
|
this._height = 0;
|
|
5034
|
+
this._parameters = {};
|
|
5015
5035
|
this.panelUpdatesDisposable = new MutableDisposable();
|
|
5016
5036
|
this._onDidDimensionChange = new Emitter();
|
|
5017
5037
|
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
@@ -5023,49 +5043,51 @@
|
|
|
5023
5043
|
//
|
|
5024
5044
|
this._onDidVisibilityChange = new Emitter();
|
|
5025
5045
|
this.onDidVisibilityChange = this._onDidVisibilityChange.event;
|
|
5026
|
-
this.
|
|
5027
|
-
this.
|
|
5046
|
+
this._onWillVisibilityChange = new Emitter();
|
|
5047
|
+
this.onWillVisibilityChange = this._onWillVisibilityChange.event;
|
|
5028
5048
|
this._onDidActiveChange = new Emitter();
|
|
5029
5049
|
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
5030
5050
|
this._onActiveChange = new Emitter();
|
|
5031
5051
|
this.onActiveChange = this._onActiveChange.event;
|
|
5032
|
-
this.
|
|
5033
|
-
this.
|
|
5052
|
+
this._onDidParametersChange = new Emitter();
|
|
5053
|
+
this.onDidParametersChange = this._onDidParametersChange.event;
|
|
5034
5054
|
this.addDisposables(this.onDidFocusChange((event) => {
|
|
5035
5055
|
this._isFocused = event.isFocused;
|
|
5036
5056
|
}), this.onDidActiveChange((event) => {
|
|
5037
5057
|
this._isActive = event.isActive;
|
|
5038
5058
|
}), this.onDidVisibilityChange((event) => {
|
|
5039
5059
|
this._isVisible = event.isVisible;
|
|
5040
|
-
}), this.onDidHiddenChange((event) => {
|
|
5041
|
-
this._isHidden = event.isHidden;
|
|
5042
5060
|
}), this.onDidDimensionsChange((event) => {
|
|
5043
5061
|
this._width = event.width;
|
|
5044
5062
|
this._height = event.height;
|
|
5045
|
-
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this.
|
|
5063
|
+
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onWillFocus, this._onWillVisibilityChange, this._onDidParametersChange);
|
|
5064
|
+
}
|
|
5065
|
+
getParameters() {
|
|
5066
|
+
return this._parameters;
|
|
5046
5067
|
}
|
|
5047
5068
|
initialize(panel) {
|
|
5048
|
-
this.panelUpdatesDisposable.value = this.
|
|
5069
|
+
this.panelUpdatesDisposable.value = this._onDidParametersChange.event((parameters) => {
|
|
5070
|
+
this._parameters = parameters;
|
|
5049
5071
|
panel.update({
|
|
5050
5072
|
params: parameters,
|
|
5051
5073
|
});
|
|
5052
5074
|
});
|
|
5053
5075
|
}
|
|
5054
|
-
|
|
5055
|
-
this.
|
|
5076
|
+
setVisible(isVisible) {
|
|
5077
|
+
this._onWillVisibilityChange.fire({ isVisible });
|
|
5056
5078
|
}
|
|
5057
5079
|
setActive() {
|
|
5058
5080
|
this._onActiveChange.fire();
|
|
5059
5081
|
}
|
|
5060
5082
|
updateParameters(parameters) {
|
|
5061
|
-
this.
|
|
5083
|
+
this._onDidParametersChange.fire(parameters);
|
|
5062
5084
|
}
|
|
5063
5085
|
}
|
|
5064
5086
|
|
|
5065
5087
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
5066
5088
|
//
|
|
5067
|
-
constructor(id) {
|
|
5068
|
-
super(id);
|
|
5089
|
+
constructor(id, component) {
|
|
5090
|
+
super(id, component);
|
|
5069
5091
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
5070
5092
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
5071
5093
|
//
|
|
@@ -5090,8 +5112,8 @@
|
|
|
5090
5112
|
set pane(pane) {
|
|
5091
5113
|
this._pane = pane;
|
|
5092
5114
|
}
|
|
5093
|
-
constructor(id) {
|
|
5094
|
-
super(id);
|
|
5115
|
+
constructor(id, component) {
|
|
5116
|
+
super(id, component);
|
|
5095
5117
|
this._onDidExpansionChange = new Emitter({
|
|
5096
5118
|
replay: true,
|
|
5097
5119
|
});
|
|
@@ -5250,7 +5272,7 @@
|
|
|
5250
5272
|
this.header.style.display = value ? '' : 'none';
|
|
5251
5273
|
}
|
|
5252
5274
|
constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
|
|
5253
|
-
super(id, component, new PaneviewPanelApiImpl(id));
|
|
5275
|
+
super(id, component, new PaneviewPanelApiImpl(id, component));
|
|
5254
5276
|
this.headerComponent = headerComponent;
|
|
5255
5277
|
this._onDidChangeExpansionState = new Emitter({ replay: true });
|
|
5256
5278
|
this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
|
|
@@ -5270,7 +5292,11 @@
|
|
|
5270
5292
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
5271
5293
|
this._orientation = orientation;
|
|
5272
5294
|
this.element.classList.add('pane');
|
|
5273
|
-
this.addDisposables(this.api.
|
|
5295
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
5296
|
+
const { isVisible } = event;
|
|
5297
|
+
const { accessor } = this._params;
|
|
5298
|
+
accessor.setVisible(this, isVisible);
|
|
5299
|
+
}), this.api.onDidSizeChange((event) => {
|
|
5274
5300
|
this._onDidChange.fire({ size: event.size });
|
|
5275
5301
|
}), addDisposableListener(this.element, 'mouseenter', (ev) => {
|
|
5276
5302
|
this.api._onMouseEnter.fire(ev);
|
|
@@ -5477,8 +5503,8 @@
|
|
|
5477
5503
|
}
|
|
5478
5504
|
|
|
5479
5505
|
class GridviewPanelApiImpl extends PanelApiImpl {
|
|
5480
|
-
constructor(id, panel) {
|
|
5481
|
-
super(id);
|
|
5506
|
+
constructor(id, component, panel) {
|
|
5507
|
+
super(id, component);
|
|
5482
5508
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
5483
5509
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
5484
5510
|
this._onDidConstraintsChange = new Emitter();
|
|
@@ -5549,7 +5575,7 @@
|
|
|
5549
5575
|
return this.api.isActive;
|
|
5550
5576
|
}
|
|
5551
5577
|
constructor(id, component, options, api) {
|
|
5552
|
-
super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id));
|
|
5578
|
+
super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id, component));
|
|
5553
5579
|
this._evaluatedMinimumWidth = 0;
|
|
5554
5580
|
this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
|
|
5555
5581
|
this._evaluatedMinimumHeight = 0;
|
|
@@ -5574,10 +5600,10 @@
|
|
|
5574
5600
|
this._maximumHeight = options.maximumHeight;
|
|
5575
5601
|
}
|
|
5576
5602
|
this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
|
|
5577
|
-
this.addDisposables(this.api.
|
|
5578
|
-
const {
|
|
5603
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
5604
|
+
const { isVisible } = event;
|
|
5579
5605
|
const { accessor } = this._params;
|
|
5580
|
-
accessor.setVisible(this,
|
|
5606
|
+
accessor.setVisible(this, isVisible);
|
|
5581
5607
|
}), this.api.onActiveChange(() => {
|
|
5582
5608
|
const { accessor } = this._params;
|
|
5583
5609
|
accessor.doSetGroupActive(this);
|
|
@@ -5657,7 +5683,7 @@
|
|
|
5657
5683
|
return this._group.model.location;
|
|
5658
5684
|
}
|
|
5659
5685
|
constructor(id, accessor) {
|
|
5660
|
-
super(id);
|
|
5686
|
+
super(id, '__dockviewgroup__');
|
|
5661
5687
|
this.accessor = accessor;
|
|
5662
5688
|
this._onDidLocationChange = new Emitter();
|
|
5663
5689
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
@@ -5818,32 +5844,11 @@
|
|
|
5818
5844
|
return this.panel.renderer;
|
|
5819
5845
|
}
|
|
5820
5846
|
set group(value) {
|
|
5821
|
-
const
|
|
5847
|
+
const oldGroup = this._group;
|
|
5822
5848
|
if (this._group !== value) {
|
|
5823
5849
|
this._group = value;
|
|
5824
5850
|
this._onDidGroupChange.fire({});
|
|
5825
|
-
|
|
5826
|
-
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidLocationChange((event) => {
|
|
5827
|
-
if (this.group !== this.panel.group) {
|
|
5828
|
-
return;
|
|
5829
|
-
}
|
|
5830
|
-
this._onDidLocationChange.fire(event);
|
|
5831
|
-
}), this.group.api.onDidActiveChange(() => {
|
|
5832
|
-
if (this.group !== this.panel.group) {
|
|
5833
|
-
return;
|
|
5834
|
-
}
|
|
5835
|
-
if (_trackGroupActive !== this.isGroupActive) {
|
|
5836
|
-
_trackGroupActive = this.isGroupActive;
|
|
5837
|
-
this._onDidActiveGroupChange.fire({
|
|
5838
|
-
isActive: this.isGroupActive,
|
|
5839
|
-
});
|
|
5840
|
-
}
|
|
5841
|
-
}));
|
|
5842
|
-
// if (this.isGroupActive !== isOldGroupActive) {
|
|
5843
|
-
// this._onDidActiveGroupChange.fire({
|
|
5844
|
-
// isActive: this.isGroupActive,
|
|
5845
|
-
// });
|
|
5846
|
-
// }
|
|
5851
|
+
this.setupGroupEventListeners(oldGroup);
|
|
5847
5852
|
this._onDidLocationChange.fire({
|
|
5848
5853
|
location: this.group.api.location,
|
|
5849
5854
|
});
|
|
@@ -5852,8 +5857,11 @@
|
|
|
5852
5857
|
get group() {
|
|
5853
5858
|
return this._group;
|
|
5854
5859
|
}
|
|
5855
|
-
|
|
5856
|
-
|
|
5860
|
+
get tabComponent() {
|
|
5861
|
+
return this._tabComponent;
|
|
5862
|
+
}
|
|
5863
|
+
constructor(panel, group, accessor, component, tabComponent) {
|
|
5864
|
+
super(panel.id, component);
|
|
5857
5865
|
this.panel = panel;
|
|
5858
5866
|
this.accessor = accessor;
|
|
5859
5867
|
this._onDidTitleChange = new Emitter();
|
|
@@ -5867,8 +5875,10 @@
|
|
|
5867
5875
|
this._onDidLocationChange = new Emitter();
|
|
5868
5876
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
5869
5877
|
this.groupEventsDisposable = new MutableDisposable();
|
|
5878
|
+
this._tabComponent = tabComponent;
|
|
5870
5879
|
this.initialize(panel);
|
|
5871
5880
|
this._group = group;
|
|
5881
|
+
this.setupGroupEventListeners();
|
|
5872
5882
|
this.addDisposables(this.groupEventsDisposable, this._onDidRendererChange, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange, this._onDidLocationChange);
|
|
5873
5883
|
}
|
|
5874
5884
|
getWindow() {
|
|
@@ -5903,6 +5913,35 @@
|
|
|
5903
5913
|
exitMaximized() {
|
|
5904
5914
|
this.group.api.exitMaximized();
|
|
5905
5915
|
}
|
|
5916
|
+
setupGroupEventListeners(previousGroup) {
|
|
5917
|
+
var _a;
|
|
5918
|
+
let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
5919
|
+
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
|
|
5920
|
+
if (!event.isVisible && this.isVisible) {
|
|
5921
|
+
this._onDidVisibilityChange.fire(event);
|
|
5922
|
+
}
|
|
5923
|
+
else if (event.isVisible &&
|
|
5924
|
+
!this.isVisible &&
|
|
5925
|
+
this.group.model.isPanelActive(this.panel)) {
|
|
5926
|
+
this._onDidVisibilityChange.fire(event);
|
|
5927
|
+
}
|
|
5928
|
+
}), this.group.api.onDidLocationChange((event) => {
|
|
5929
|
+
if (this.group !== this.panel.group) {
|
|
5930
|
+
return;
|
|
5931
|
+
}
|
|
5932
|
+
this._onDidLocationChange.fire(event);
|
|
5933
|
+
}), this.group.api.onDidActiveChange(() => {
|
|
5934
|
+
if (this.group !== this.panel.group) {
|
|
5935
|
+
return;
|
|
5936
|
+
}
|
|
5937
|
+
if (_trackGroupActive !== this.isGroupActive) {
|
|
5938
|
+
_trackGroupActive = this.isGroupActive;
|
|
5939
|
+
this._onDidActiveGroupChange.fire({
|
|
5940
|
+
isActive: this.isGroupActive,
|
|
5941
|
+
});
|
|
5942
|
+
}
|
|
5943
|
+
}));
|
|
5944
|
+
}
|
|
5906
5945
|
}
|
|
5907
5946
|
|
|
5908
5947
|
class DockviewPanel extends CompositeDisposable {
|
|
@@ -5919,7 +5958,7 @@
|
|
|
5919
5958
|
var _a;
|
|
5920
5959
|
return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
|
|
5921
5960
|
}
|
|
5922
|
-
constructor(id, accessor, containerApi, group, view, options) {
|
|
5961
|
+
constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
|
|
5923
5962
|
super();
|
|
5924
5963
|
this.id = id;
|
|
5925
5964
|
this.accessor = accessor;
|
|
@@ -5927,7 +5966,7 @@
|
|
|
5927
5966
|
this.view = view;
|
|
5928
5967
|
this._renderer = options.renderer;
|
|
5929
5968
|
this._group = group;
|
|
5930
|
-
this.api = new DockviewPanelApiImpl(this, this._group, accessor);
|
|
5969
|
+
this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
|
|
5931
5970
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
5932
5971
|
accessor.setActivePanel(this);
|
|
5933
5972
|
}), this.api.onDidSizeChange((event) => {
|
|
@@ -6222,7 +6261,7 @@
|
|
|
6222
6261
|
? (_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id
|
|
6223
6262
|
: panelData.tabComponent;
|
|
6224
6263
|
const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
|
|
6225
|
-
const panel = new DockviewPanel(panelId, this.accessor, new DockviewApi(this.accessor), group, view, {
|
|
6264
|
+
const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
|
|
6226
6265
|
renderer: panelData.renderer,
|
|
6227
6266
|
});
|
|
6228
6267
|
panel.init({
|
|
@@ -7083,7 +7122,15 @@
|
|
|
7083
7122
|
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
7084
7123
|
overlayModel: (_b = this.options.rootOverlayModel) !== null && _b !== void 0 ? _b : DEFAULT_ROOT_OVERLAY_MODEL,
|
|
7085
7124
|
});
|
|
7086
|
-
this.addDisposables(this._rootDropTarget.
|
|
7125
|
+
this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
|
|
7126
|
+
if (this.gridview.length > 0 && event.position === 'center') {
|
|
7127
|
+
// option only available when no panels in primary grid
|
|
7128
|
+
return;
|
|
7129
|
+
}
|
|
7130
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
7131
|
+
kind: 'edge',
|
|
7132
|
+
}));
|
|
7133
|
+
}), this._rootDropTarget.onDrop((event) => {
|
|
7087
7134
|
var _a;
|
|
7088
7135
|
const willDropEvent = new DockviewWillDropEvent({
|
|
7089
7136
|
nativeEvent: event.nativeEvent,
|
|
@@ -7092,7 +7139,7 @@
|
|
|
7092
7139
|
api: this._api,
|
|
7093
7140
|
group: undefined,
|
|
7094
7141
|
getData: getPanelData,
|
|
7095
|
-
kind: '
|
|
7142
|
+
kind: 'edge',
|
|
7096
7143
|
});
|
|
7097
7144
|
this._onWillDrop.fire(willDropEvent);
|
|
7098
7145
|
if (willDropEvent.defaultPrevented) {
|
|
@@ -7148,7 +7195,7 @@
|
|
|
7148
7195
|
const box = getBox();
|
|
7149
7196
|
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;
|
|
7150
7197
|
if (itemToPopout.api.location.type === 'grid') {
|
|
7151
|
-
itemToPopout.api.
|
|
7198
|
+
itemToPopout.api.setVisible(false);
|
|
7152
7199
|
}
|
|
7153
7200
|
const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
|
|
7154
7201
|
theme !== null && theme !== void 0 ? theme : '', {
|
|
@@ -7199,7 +7246,7 @@
|
|
|
7199
7246
|
}));
|
|
7200
7247
|
switch (referenceLocation) {
|
|
7201
7248
|
case 'grid':
|
|
7202
|
-
referenceGroup.api.
|
|
7249
|
+
referenceGroup.api.setVisible(false);
|
|
7203
7250
|
break;
|
|
7204
7251
|
case 'floating':
|
|
7205
7252
|
case 'popout':
|
|
@@ -7253,8 +7300,8 @@
|
|
|
7253
7300
|
from: group,
|
|
7254
7301
|
to: referenceGroup,
|
|
7255
7302
|
}));
|
|
7256
|
-
if (referenceGroup.api.
|
|
7257
|
-
referenceGroup.api.
|
|
7303
|
+
if (!referenceGroup.api.isVisible) {
|
|
7304
|
+
referenceGroup.api.setVisible(true);
|
|
7258
7305
|
}
|
|
7259
7306
|
if (this.getPanel(group.id)) {
|
|
7260
7307
|
this.doRemoveGroup(group, {
|
|
@@ -7827,7 +7874,7 @@
|
|
|
7827
7874
|
}
|
|
7828
7875
|
updateWatermark() {
|
|
7829
7876
|
var _a, _b;
|
|
7830
|
-
if (this.groups.filter((x) => x.api.location.type === 'grid' &&
|
|
7877
|
+
if (this.groups.filter((x) => x.api.location.type === 'grid' && x.api.isVisible).length === 0) {
|
|
7831
7878
|
if (!this.watermark) {
|
|
7832
7879
|
this.watermark = this.createWatermarkComponent();
|
|
7833
7880
|
this.watermark.init({
|
|
@@ -8224,6 +8271,8 @@
|
|
|
8224
8271
|
if (this._onDidActivePanelChange.value !== event.panel) {
|
|
8225
8272
|
this._onDidActivePanelChange.fire(event.panel);
|
|
8226
8273
|
}
|
|
8274
|
+
}), exports.DockviewEvent.any(view.model.onDidPanelTitleChange, view.model.onDidPanelParametersChange)(() => {
|
|
8275
|
+
this._bufferOnDidLayoutChange.fire();
|
|
8227
8276
|
}));
|
|
8228
8277
|
this._groups.set(view.id, { value: view, disposable });
|
|
8229
8278
|
}
|
|
@@ -8236,7 +8285,7 @@
|
|
|
8236
8285
|
const contentComponent = options.component;
|
|
8237
8286
|
const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
|
|
8238
8287
|
const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
|
|
8239
|
-
const panel = new DockviewPanel(options.id, this, this._api, group, view, { renderer: options.renderer });
|
|
8288
|
+
const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, { renderer: options.renderer });
|
|
8240
8289
|
panel.init({
|
|
8241
8290
|
title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
|
|
8242
8291
|
params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
|
|
@@ -8610,19 +8659,19 @@
|
|
|
8610
8659
|
const index = this.panels.indexOf(panel);
|
|
8611
8660
|
this.splitview.setViewVisible(index, visible);
|
|
8612
8661
|
}
|
|
8613
|
-
setActive(
|
|
8614
|
-
this._activePanel =
|
|
8662
|
+
setActive(panel, skipFocus) {
|
|
8663
|
+
this._activePanel = panel;
|
|
8615
8664
|
this.panels
|
|
8616
|
-
.filter((v) => v !==
|
|
8665
|
+
.filter((v) => v !== panel)
|
|
8617
8666
|
.forEach((v) => {
|
|
8618
8667
|
v.api._onDidActiveChange.fire({ isActive: false });
|
|
8619
8668
|
if (!skipFocus) {
|
|
8620
8669
|
v.focus();
|
|
8621
8670
|
}
|
|
8622
8671
|
});
|
|
8623
|
-
|
|
8672
|
+
panel.api._onDidActiveChange.fire({ isActive: true });
|
|
8624
8673
|
if (!skipFocus) {
|
|
8625
|
-
|
|
8674
|
+
panel.focus();
|
|
8626
8675
|
}
|
|
8627
8676
|
}
|
|
8628
8677
|
removePanel(panel, sizing) {
|
|
@@ -8921,6 +8970,10 @@
|
|
|
8921
8970
|
});
|
|
8922
8971
|
this.addDisposables(this._disposable);
|
|
8923
8972
|
}
|
|
8973
|
+
setVisible(panel, visible) {
|
|
8974
|
+
const index = this.panels.indexOf(panel);
|
|
8975
|
+
this.paneview.setViewVisible(index, visible);
|
|
8976
|
+
}
|
|
8924
8977
|
focus() {
|
|
8925
8978
|
//noop
|
|
8926
8979
|
}
|
|
@@ -8967,6 +9020,7 @@
|
|
|
8967
9020
|
isExpanded: options.isExpanded,
|
|
8968
9021
|
title: options.title,
|
|
8969
9022
|
containerApi: new PaneviewApi(this),
|
|
9023
|
+
accessor: this,
|
|
8970
9024
|
});
|
|
8971
9025
|
this.paneview.addPane(view, size, index);
|
|
8972
9026
|
view.orientation = this.paneview.orientation;
|
|
@@ -9066,6 +9120,7 @@
|
|
|
9066
9120
|
title: data.title,
|
|
9067
9121
|
isExpanded: !!view.expanded,
|
|
9068
9122
|
containerApi: new PaneviewApi(this),
|
|
9123
|
+
accessor: this,
|
|
9069
9124
|
});
|
|
9070
9125
|
panel.orientation = this.paneview.orientation;
|
|
9071
9126
|
});
|
|
@@ -9145,7 +9200,7 @@
|
|
|
9145
9200
|
return this._snap;
|
|
9146
9201
|
}
|
|
9147
9202
|
constructor(id, componentName) {
|
|
9148
|
-
super(id, componentName, new SplitviewPanelApiImpl(id));
|
|
9203
|
+
super(id, componentName, new SplitviewPanelApiImpl(id, componentName));
|
|
9149
9204
|
this._evaluatedMinimumSize = 0;
|
|
9150
9205
|
this._evaluatedMaximumSize = Number.POSITIVE_INFINITY;
|
|
9151
9206
|
this._minimumSize = 0;
|
|
@@ -9154,10 +9209,10 @@
|
|
|
9154
9209
|
this._onDidChange = new Emitter();
|
|
9155
9210
|
this.onDidChange = this._onDidChange.event;
|
|
9156
9211
|
this.api.initialize(this);
|
|
9157
|
-
this.addDisposables(this._onDidChange, this.api.
|
|
9158
|
-
const {
|
|
9212
|
+
this.addDisposables(this._onDidChange, this.api.onWillVisibilityChange((event) => {
|
|
9213
|
+
const { isVisible } = event;
|
|
9159
9214
|
const { accessor } = this._params;
|
|
9160
|
-
accessor.setVisible(this,
|
|
9215
|
+
accessor.setVisible(this, isVisible);
|
|
9161
9216
|
}), this.api.onActiveChange(() => {
|
|
9162
9217
|
const { accessor } = this._params;
|
|
9163
9218
|
accessor.setActive(this);
|