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
|
@@ -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
|
*/
|
|
@@ -1478,6 +1478,9 @@ class Paneview extends CompositeDisposable {
|
|
|
1478
1478
|
this._onDidChange.fire();
|
|
1479
1479
|
}));
|
|
1480
1480
|
}
|
|
1481
|
+
setViewVisible(index, visible) {
|
|
1482
|
+
this.splitview.setViewVisible(index, visible);
|
|
1483
|
+
}
|
|
1481
1484
|
addPane(pane, size, index = this.splitview.length, skipLayout = false) {
|
|
1482
1485
|
const disposable = pane.onDidChangeExpansionState(() => {
|
|
1483
1486
|
this.setupAnimation();
|
|
@@ -2982,19 +2985,27 @@ class DockviewApi {
|
|
|
2982
2985
|
return this.component.onWillDrop;
|
|
2983
2986
|
}
|
|
2984
2987
|
/**
|
|
2988
|
+
* Invoked before an overlay is shown indicating a drop target.
|
|
2985
2989
|
*
|
|
2990
|
+
* Calling `event.preventDefault()` will prevent the overlay being shown and prevent
|
|
2991
|
+
* the any subsequent drop event.
|
|
2986
2992
|
*/
|
|
2987
2993
|
get onWillShowOverlay() {
|
|
2988
2994
|
return this.component.onWillShowOverlay;
|
|
2989
2995
|
}
|
|
2990
2996
|
/**
|
|
2991
|
-
* Invoked before a group is dragged.
|
|
2997
|
+
* Invoked before a group is dragged.
|
|
2998
|
+
*
|
|
2999
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the group drag starting.
|
|
3000
|
+
*
|
|
2992
3001
|
*/
|
|
2993
3002
|
get onWillDragGroup() {
|
|
2994
3003
|
return this.component.onWillDragGroup;
|
|
2995
3004
|
}
|
|
2996
3005
|
/**
|
|
2997
|
-
* Invoked before a panel is dragged.
|
|
3006
|
+
* Invoked before a panel is dragged.
|
|
3007
|
+
*
|
|
3008
|
+
* Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
|
|
2998
3009
|
*/
|
|
2999
3010
|
get onWillDragPanel() {
|
|
3000
3011
|
return this.component.onWillDragPanel;
|
|
@@ -3538,7 +3549,7 @@ class ContentContainer extends CompositeDisposable {
|
|
|
3538
3549
|
data.groupId === this.group.id;
|
|
3539
3550
|
return !groupHasOnePanelAndIsActiveDragElement;
|
|
3540
3551
|
}
|
|
3541
|
-
return this.group.canDisplayOverlay(event, position, '
|
|
3552
|
+
return this.group.canDisplayOverlay(event, position, 'content');
|
|
3542
3553
|
},
|
|
3543
3554
|
});
|
|
3544
3555
|
this.addDisposables(this.dropTarget);
|
|
@@ -3861,7 +3872,7 @@ class VoidContainer extends CompositeDisposable {
|
|
|
3861
3872
|
// don't show the overlay if the tab being dragged is the last panel of this group
|
|
3862
3873
|
return ((_a = last(this.group.panels)) === null || _a === void 0 ? void 0 : _a.id) !== data.panelId;
|
|
3863
3874
|
}
|
|
3864
|
-
return group.model.canDisplayOverlay(event, position, '
|
|
3875
|
+
return group.model.canDisplayOverlay(event, position, 'header_space');
|
|
3865
3876
|
},
|
|
3866
3877
|
});
|
|
3867
3878
|
this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
|
|
@@ -4254,6 +4265,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
4254
4265
|
this._width = 0;
|
|
4255
4266
|
this._height = 0;
|
|
4256
4267
|
this._panels = [];
|
|
4268
|
+
this._panelDisposables = new Map();
|
|
4257
4269
|
this._onMove = new Emitter();
|
|
4258
4270
|
this.onMove = this._onMove.event;
|
|
4259
4271
|
this._onDidDrop = new Emitter();
|
|
@@ -4268,6 +4280,10 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
4268
4280
|
this.onGroupDragStart = this._onGroupDragStart.event;
|
|
4269
4281
|
this._onDidAddPanel = new Emitter();
|
|
4270
4282
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4283
|
+
this._onDidPanelTitleChange = new Emitter();
|
|
4284
|
+
this.onDidPanelTitleChange = this._onDidPanelTitleChange.event;
|
|
4285
|
+
this._onDidPanelParametersChange = new Emitter();
|
|
4286
|
+
this.onDidPanelParametersChange = this._onDidPanelParametersChange.event;
|
|
4271
4287
|
this._onDidRemovePanel = new Emitter();
|
|
4272
4288
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4273
4289
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -4556,6 +4572,11 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
4556
4572
|
if (this.mostRecentlyUsed.includes(panel)) {
|
|
4557
4573
|
this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(panel), 1);
|
|
4558
4574
|
}
|
|
4575
|
+
const disposable = this._panelDisposables.get(panel.id);
|
|
4576
|
+
if (disposable) {
|
|
4577
|
+
disposable.dispose();
|
|
4578
|
+
this._panelDisposables.delete(panel.id);
|
|
4579
|
+
}
|
|
4559
4580
|
this._onDidRemovePanel.fire({ panel });
|
|
4560
4581
|
}
|
|
4561
4582
|
doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
|
|
@@ -4573,6 +4594,7 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
4573
4594
|
}
|
|
4574
4595
|
this.updateMru(panel);
|
|
4575
4596
|
this.panels.splice(index, 0, panel);
|
|
4597
|
+
this._panelDisposables.set(panel.id, new CompositeDisposable(panel.api.onDidTitleChange((event) => this._onDidPanelTitleChange.fire(event)), panel.api.onDidParametersChange((event) => this._onDidPanelParametersChange.fire(event))));
|
|
4576
4598
|
this._onDidAddPanel.fire({ panel });
|
|
4577
4599
|
}
|
|
4578
4600
|
doSetActivePanel(panel) {
|
|
@@ -4990,24 +5012,22 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
4990
5012
|
get isVisible() {
|
|
4991
5013
|
return this._isVisible;
|
|
4992
5014
|
}
|
|
4993
|
-
get isHidden() {
|
|
4994
|
-
return this._isHidden;
|
|
4995
|
-
}
|
|
4996
5015
|
get width() {
|
|
4997
5016
|
return this._width;
|
|
4998
5017
|
}
|
|
4999
5018
|
get height() {
|
|
5000
5019
|
return this._height;
|
|
5001
5020
|
}
|
|
5002
|
-
constructor(id) {
|
|
5021
|
+
constructor(id, component) {
|
|
5003
5022
|
super();
|
|
5004
5023
|
this.id = id;
|
|
5024
|
+
this.component = component;
|
|
5005
5025
|
this._isFocused = false;
|
|
5006
5026
|
this._isActive = false;
|
|
5007
5027
|
this._isVisible = true;
|
|
5008
|
-
this._isHidden = false;
|
|
5009
5028
|
this._width = 0;
|
|
5010
5029
|
this._height = 0;
|
|
5030
|
+
this._parameters = {};
|
|
5011
5031
|
this.panelUpdatesDisposable = new MutableDisposable();
|
|
5012
5032
|
this._onDidDimensionChange = new Emitter();
|
|
5013
5033
|
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
@@ -5019,49 +5039,51 @@ class PanelApiImpl extends CompositeDisposable {
|
|
|
5019
5039
|
//
|
|
5020
5040
|
this._onDidVisibilityChange = new Emitter();
|
|
5021
5041
|
this.onDidVisibilityChange = this._onDidVisibilityChange.event;
|
|
5022
|
-
this.
|
|
5023
|
-
this.
|
|
5042
|
+
this._onWillVisibilityChange = new Emitter();
|
|
5043
|
+
this.onWillVisibilityChange = this._onWillVisibilityChange.event;
|
|
5024
5044
|
this._onDidActiveChange = new Emitter();
|
|
5025
5045
|
this.onDidActiveChange = this._onDidActiveChange.event;
|
|
5026
5046
|
this._onActiveChange = new Emitter();
|
|
5027
5047
|
this.onActiveChange = this._onActiveChange.event;
|
|
5028
|
-
this.
|
|
5029
|
-
this.
|
|
5048
|
+
this._onDidParametersChange = new Emitter();
|
|
5049
|
+
this.onDidParametersChange = this._onDidParametersChange.event;
|
|
5030
5050
|
this.addDisposables(this.onDidFocusChange((event) => {
|
|
5031
5051
|
this._isFocused = event.isFocused;
|
|
5032
5052
|
}), this.onDidActiveChange((event) => {
|
|
5033
5053
|
this._isActive = event.isActive;
|
|
5034
5054
|
}), this.onDidVisibilityChange((event) => {
|
|
5035
5055
|
this._isVisible = event.isVisible;
|
|
5036
|
-
}), this.onDidHiddenChange((event) => {
|
|
5037
|
-
this._isHidden = event.isHidden;
|
|
5038
5056
|
}), this.onDidDimensionsChange((event) => {
|
|
5039
5057
|
this._width = event.width;
|
|
5040
5058
|
this._height = event.height;
|
|
5041
|
-
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this.
|
|
5059
|
+
}), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onWillFocus, this._onWillVisibilityChange, this._onDidParametersChange);
|
|
5060
|
+
}
|
|
5061
|
+
getParameters() {
|
|
5062
|
+
return this._parameters;
|
|
5042
5063
|
}
|
|
5043
5064
|
initialize(panel) {
|
|
5044
|
-
this.panelUpdatesDisposable.value = this.
|
|
5065
|
+
this.panelUpdatesDisposable.value = this._onDidParametersChange.event((parameters) => {
|
|
5066
|
+
this._parameters = parameters;
|
|
5045
5067
|
panel.update({
|
|
5046
5068
|
params: parameters,
|
|
5047
5069
|
});
|
|
5048
5070
|
});
|
|
5049
5071
|
}
|
|
5050
|
-
|
|
5051
|
-
this.
|
|
5072
|
+
setVisible(isVisible) {
|
|
5073
|
+
this._onWillVisibilityChange.fire({ isVisible });
|
|
5052
5074
|
}
|
|
5053
5075
|
setActive() {
|
|
5054
5076
|
this._onActiveChange.fire();
|
|
5055
5077
|
}
|
|
5056
5078
|
updateParameters(parameters) {
|
|
5057
|
-
this.
|
|
5079
|
+
this._onDidParametersChange.fire(parameters);
|
|
5058
5080
|
}
|
|
5059
5081
|
}
|
|
5060
5082
|
|
|
5061
5083
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
5062
5084
|
//
|
|
5063
|
-
constructor(id) {
|
|
5064
|
-
super(id);
|
|
5085
|
+
constructor(id, component) {
|
|
5086
|
+
super(id, component);
|
|
5065
5087
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
5066
5088
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
5067
5089
|
//
|
|
@@ -5086,8 +5108,8 @@ class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
|
5086
5108
|
set pane(pane) {
|
|
5087
5109
|
this._pane = pane;
|
|
5088
5110
|
}
|
|
5089
|
-
constructor(id) {
|
|
5090
|
-
super(id);
|
|
5111
|
+
constructor(id, component) {
|
|
5112
|
+
super(id, component);
|
|
5091
5113
|
this._onDidExpansionChange = new Emitter({
|
|
5092
5114
|
replay: true,
|
|
5093
5115
|
});
|
|
@@ -5246,7 +5268,7 @@ class PaneviewPanel extends BasePanelView {
|
|
|
5246
5268
|
this.header.style.display = value ? '' : 'none';
|
|
5247
5269
|
}
|
|
5248
5270
|
constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
|
|
5249
|
-
super(id, component, new PaneviewPanelApiImpl(id));
|
|
5271
|
+
super(id, component, new PaneviewPanelApiImpl(id, component));
|
|
5250
5272
|
this.headerComponent = headerComponent;
|
|
5251
5273
|
this._onDidChangeExpansionState = new Emitter({ replay: true });
|
|
5252
5274
|
this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
|
|
@@ -5266,7 +5288,11 @@ class PaneviewPanel extends BasePanelView {
|
|
|
5266
5288
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
5267
5289
|
this._orientation = orientation;
|
|
5268
5290
|
this.element.classList.add('pane');
|
|
5269
|
-
this.addDisposables(this.api.
|
|
5291
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
5292
|
+
const { isVisible } = event;
|
|
5293
|
+
const { accessor } = this._params;
|
|
5294
|
+
accessor.setVisible(this, isVisible);
|
|
5295
|
+
}), this.api.onDidSizeChange((event) => {
|
|
5270
5296
|
this._onDidChange.fire({ size: event.size });
|
|
5271
5297
|
}), addDisposableListener(this.element, 'mouseenter', (ev) => {
|
|
5272
5298
|
this.api._onMouseEnter.fire(ev);
|
|
@@ -5473,8 +5499,8 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
5473
5499
|
}
|
|
5474
5500
|
|
|
5475
5501
|
class GridviewPanelApiImpl extends PanelApiImpl {
|
|
5476
|
-
constructor(id, panel) {
|
|
5477
|
-
super(id);
|
|
5502
|
+
constructor(id, component, panel) {
|
|
5503
|
+
super(id, component);
|
|
5478
5504
|
this._onDidConstraintsChangeInternal = new Emitter();
|
|
5479
5505
|
this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
|
|
5480
5506
|
this._onDidConstraintsChange = new Emitter();
|
|
@@ -5545,7 +5571,7 @@ class GridviewPanel extends BasePanelView {
|
|
|
5545
5571
|
return this.api.isActive;
|
|
5546
5572
|
}
|
|
5547
5573
|
constructor(id, component, options, api) {
|
|
5548
|
-
super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id));
|
|
5574
|
+
super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id, component));
|
|
5549
5575
|
this._evaluatedMinimumWidth = 0;
|
|
5550
5576
|
this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
|
|
5551
5577
|
this._evaluatedMinimumHeight = 0;
|
|
@@ -5570,10 +5596,10 @@ class GridviewPanel extends BasePanelView {
|
|
|
5570
5596
|
this._maximumHeight = options.maximumHeight;
|
|
5571
5597
|
}
|
|
5572
5598
|
this.api.initialize(this); // TODO: required to by-pass 'super before this' requirement
|
|
5573
|
-
this.addDisposables(this.api.
|
|
5574
|
-
const {
|
|
5599
|
+
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
5600
|
+
const { isVisible } = event;
|
|
5575
5601
|
const { accessor } = this._params;
|
|
5576
|
-
accessor.setVisible(this,
|
|
5602
|
+
accessor.setVisible(this, isVisible);
|
|
5577
5603
|
}), this.api.onActiveChange(() => {
|
|
5578
5604
|
const { accessor } = this._params;
|
|
5579
5605
|
accessor.doSetGroupActive(this);
|
|
@@ -5653,7 +5679,7 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5653
5679
|
return this._group.model.location;
|
|
5654
5680
|
}
|
|
5655
5681
|
constructor(id, accessor) {
|
|
5656
|
-
super(id);
|
|
5682
|
+
super(id, '__dockviewgroup__');
|
|
5657
5683
|
this.accessor = accessor;
|
|
5658
5684
|
this._onDidLocationChange = new Emitter();
|
|
5659
5685
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
@@ -5814,32 +5840,11 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5814
5840
|
return this.panel.renderer;
|
|
5815
5841
|
}
|
|
5816
5842
|
set group(value) {
|
|
5817
|
-
const
|
|
5843
|
+
const oldGroup = this._group;
|
|
5818
5844
|
if (this._group !== value) {
|
|
5819
5845
|
this._group = value;
|
|
5820
5846
|
this._onDidGroupChange.fire({});
|
|
5821
|
-
|
|
5822
|
-
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidLocationChange((event) => {
|
|
5823
|
-
if (this.group !== this.panel.group) {
|
|
5824
|
-
return;
|
|
5825
|
-
}
|
|
5826
|
-
this._onDidLocationChange.fire(event);
|
|
5827
|
-
}), this.group.api.onDidActiveChange(() => {
|
|
5828
|
-
if (this.group !== this.panel.group) {
|
|
5829
|
-
return;
|
|
5830
|
-
}
|
|
5831
|
-
if (_trackGroupActive !== this.isGroupActive) {
|
|
5832
|
-
_trackGroupActive = this.isGroupActive;
|
|
5833
|
-
this._onDidActiveGroupChange.fire({
|
|
5834
|
-
isActive: this.isGroupActive,
|
|
5835
|
-
});
|
|
5836
|
-
}
|
|
5837
|
-
}));
|
|
5838
|
-
// if (this.isGroupActive !== isOldGroupActive) {
|
|
5839
|
-
// this._onDidActiveGroupChange.fire({
|
|
5840
|
-
// isActive: this.isGroupActive,
|
|
5841
|
-
// });
|
|
5842
|
-
// }
|
|
5847
|
+
this.setupGroupEventListeners(oldGroup);
|
|
5843
5848
|
this._onDidLocationChange.fire({
|
|
5844
5849
|
location: this.group.api.location,
|
|
5845
5850
|
});
|
|
@@ -5848,8 +5853,11 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5848
5853
|
get group() {
|
|
5849
5854
|
return this._group;
|
|
5850
5855
|
}
|
|
5851
|
-
|
|
5852
|
-
|
|
5856
|
+
get tabComponent() {
|
|
5857
|
+
return this._tabComponent;
|
|
5858
|
+
}
|
|
5859
|
+
constructor(panel, group, accessor, component, tabComponent) {
|
|
5860
|
+
super(panel.id, component);
|
|
5853
5861
|
this.panel = panel;
|
|
5854
5862
|
this.accessor = accessor;
|
|
5855
5863
|
this._onDidTitleChange = new Emitter();
|
|
@@ -5863,8 +5871,10 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5863
5871
|
this._onDidLocationChange = new Emitter();
|
|
5864
5872
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
5865
5873
|
this.groupEventsDisposable = new MutableDisposable();
|
|
5874
|
+
this._tabComponent = tabComponent;
|
|
5866
5875
|
this.initialize(panel);
|
|
5867
5876
|
this._group = group;
|
|
5877
|
+
this.setupGroupEventListeners();
|
|
5868
5878
|
this.addDisposables(this.groupEventsDisposable, this._onDidRendererChange, this._onDidTitleChange, this._onDidGroupChange, this._onDidActiveGroupChange, this._onDidLocationChange);
|
|
5869
5879
|
}
|
|
5870
5880
|
getWindow() {
|
|
@@ -5899,6 +5909,35 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
5899
5909
|
exitMaximized() {
|
|
5900
5910
|
this.group.api.exitMaximized();
|
|
5901
5911
|
}
|
|
5912
|
+
setupGroupEventListeners(previousGroup) {
|
|
5913
|
+
var _a;
|
|
5914
|
+
let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
5915
|
+
this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
|
|
5916
|
+
if (!event.isVisible && this.isVisible) {
|
|
5917
|
+
this._onDidVisibilityChange.fire(event);
|
|
5918
|
+
}
|
|
5919
|
+
else if (event.isVisible &&
|
|
5920
|
+
!this.isVisible &&
|
|
5921
|
+
this.group.model.isPanelActive(this.panel)) {
|
|
5922
|
+
this._onDidVisibilityChange.fire(event);
|
|
5923
|
+
}
|
|
5924
|
+
}), this.group.api.onDidLocationChange((event) => {
|
|
5925
|
+
if (this.group !== this.panel.group) {
|
|
5926
|
+
return;
|
|
5927
|
+
}
|
|
5928
|
+
this._onDidLocationChange.fire(event);
|
|
5929
|
+
}), this.group.api.onDidActiveChange(() => {
|
|
5930
|
+
if (this.group !== this.panel.group) {
|
|
5931
|
+
return;
|
|
5932
|
+
}
|
|
5933
|
+
if (_trackGroupActive !== this.isGroupActive) {
|
|
5934
|
+
_trackGroupActive = this.isGroupActive;
|
|
5935
|
+
this._onDidActiveGroupChange.fire({
|
|
5936
|
+
isActive: this.isGroupActive,
|
|
5937
|
+
});
|
|
5938
|
+
}
|
|
5939
|
+
}));
|
|
5940
|
+
}
|
|
5902
5941
|
}
|
|
5903
5942
|
|
|
5904
5943
|
class DockviewPanel extends CompositeDisposable {
|
|
@@ -5915,7 +5954,7 @@ class DockviewPanel extends CompositeDisposable {
|
|
|
5915
5954
|
var _a;
|
|
5916
5955
|
return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
|
|
5917
5956
|
}
|
|
5918
|
-
constructor(id, accessor, containerApi, group, view, options) {
|
|
5957
|
+
constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
|
|
5919
5958
|
super();
|
|
5920
5959
|
this.id = id;
|
|
5921
5960
|
this.accessor = accessor;
|
|
@@ -5923,7 +5962,7 @@ class DockviewPanel extends CompositeDisposable {
|
|
|
5923
5962
|
this.view = view;
|
|
5924
5963
|
this._renderer = options.renderer;
|
|
5925
5964
|
this._group = group;
|
|
5926
|
-
this.api = new DockviewPanelApiImpl(this, this._group, accessor);
|
|
5965
|
+
this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
|
|
5927
5966
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
5928
5967
|
accessor.setActivePanel(this);
|
|
5929
5968
|
}), this.api.onDidSizeChange((event) => {
|
|
@@ -6218,7 +6257,7 @@ class DefaultDockviewDeserialzier {
|
|
|
6218
6257
|
? (_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id
|
|
6219
6258
|
: panelData.tabComponent;
|
|
6220
6259
|
const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
|
|
6221
|
-
const panel = new DockviewPanel(panelId, this.accessor, new DockviewApi(this.accessor), group, view, {
|
|
6260
|
+
const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
|
|
6222
6261
|
renderer: panelData.renderer,
|
|
6223
6262
|
});
|
|
6224
6263
|
panel.init({
|
|
@@ -7079,7 +7118,15 @@ class DockviewComponent extends BaseGrid {
|
|
|
7079
7118
|
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
7080
7119
|
overlayModel: (_b = this.options.rootOverlayModel) !== null && _b !== void 0 ? _b : DEFAULT_ROOT_OVERLAY_MODEL,
|
|
7081
7120
|
});
|
|
7082
|
-
this.addDisposables(this._rootDropTarget.
|
|
7121
|
+
this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
|
|
7122
|
+
if (this.gridview.length > 0 && event.position === 'center') {
|
|
7123
|
+
// option only available when no panels in primary grid
|
|
7124
|
+
return;
|
|
7125
|
+
}
|
|
7126
|
+
this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
|
|
7127
|
+
kind: 'edge',
|
|
7128
|
+
}));
|
|
7129
|
+
}), this._rootDropTarget.onDrop((event) => {
|
|
7083
7130
|
var _a;
|
|
7084
7131
|
const willDropEvent = new DockviewWillDropEvent({
|
|
7085
7132
|
nativeEvent: event.nativeEvent,
|
|
@@ -7088,7 +7135,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
7088
7135
|
api: this._api,
|
|
7089
7136
|
group: undefined,
|
|
7090
7137
|
getData: getPanelData,
|
|
7091
|
-
kind: '
|
|
7138
|
+
kind: 'edge',
|
|
7092
7139
|
});
|
|
7093
7140
|
this._onWillDrop.fire(willDropEvent);
|
|
7094
7141
|
if (willDropEvent.defaultPrevented) {
|
|
@@ -7144,7 +7191,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
7144
7191
|
const box = getBox();
|
|
7145
7192
|
const groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId(); //item.id;
|
|
7146
7193
|
if (itemToPopout.api.location.type === 'grid') {
|
|
7147
|
-
itemToPopout.api.
|
|
7194
|
+
itemToPopout.api.setVisible(false);
|
|
7148
7195
|
}
|
|
7149
7196
|
const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
|
|
7150
7197
|
theme !== null && theme !== void 0 ? theme : '', {
|
|
@@ -7195,7 +7242,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
7195
7242
|
}));
|
|
7196
7243
|
switch (referenceLocation) {
|
|
7197
7244
|
case 'grid':
|
|
7198
|
-
referenceGroup.api.
|
|
7245
|
+
referenceGroup.api.setVisible(false);
|
|
7199
7246
|
break;
|
|
7200
7247
|
case 'floating':
|
|
7201
7248
|
case 'popout':
|
|
@@ -7249,8 +7296,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
7249
7296
|
from: group,
|
|
7250
7297
|
to: referenceGroup,
|
|
7251
7298
|
}));
|
|
7252
|
-
if (referenceGroup.api.
|
|
7253
|
-
referenceGroup.api.
|
|
7299
|
+
if (!referenceGroup.api.isVisible) {
|
|
7300
|
+
referenceGroup.api.setVisible(true);
|
|
7254
7301
|
}
|
|
7255
7302
|
if (this.getPanel(group.id)) {
|
|
7256
7303
|
this.doRemoveGroup(group, {
|
|
@@ -7823,7 +7870,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
7823
7870
|
}
|
|
7824
7871
|
updateWatermark() {
|
|
7825
7872
|
var _a, _b;
|
|
7826
|
-
if (this.groups.filter((x) => x.api.location.type === 'grid' &&
|
|
7873
|
+
if (this.groups.filter((x) => x.api.location.type === 'grid' && x.api.isVisible).length === 0) {
|
|
7827
7874
|
if (!this.watermark) {
|
|
7828
7875
|
this.watermark = this.createWatermarkComponent();
|
|
7829
7876
|
this.watermark.init({
|
|
@@ -8220,6 +8267,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
8220
8267
|
if (this._onDidActivePanelChange.value !== event.panel) {
|
|
8221
8268
|
this._onDidActivePanelChange.fire(event.panel);
|
|
8222
8269
|
}
|
|
8270
|
+
}), exports.DockviewEvent.any(view.model.onDidPanelTitleChange, view.model.onDidPanelParametersChange)(() => {
|
|
8271
|
+
this._bufferOnDidLayoutChange.fire();
|
|
8223
8272
|
}));
|
|
8224
8273
|
this._groups.set(view.id, { value: view, disposable });
|
|
8225
8274
|
}
|
|
@@ -8232,7 +8281,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8232
8281
|
const contentComponent = options.component;
|
|
8233
8282
|
const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
|
|
8234
8283
|
const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
|
|
8235
|
-
const panel = new DockviewPanel(options.id, this, this._api, group, view, { renderer: options.renderer });
|
|
8284
|
+
const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, { renderer: options.renderer });
|
|
8236
8285
|
panel.init({
|
|
8237
8286
|
title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
|
|
8238
8287
|
params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
|
|
@@ -8606,19 +8655,19 @@ class SplitviewComponent extends Resizable {
|
|
|
8606
8655
|
const index = this.panels.indexOf(panel);
|
|
8607
8656
|
this.splitview.setViewVisible(index, visible);
|
|
8608
8657
|
}
|
|
8609
|
-
setActive(
|
|
8610
|
-
this._activePanel =
|
|
8658
|
+
setActive(panel, skipFocus) {
|
|
8659
|
+
this._activePanel = panel;
|
|
8611
8660
|
this.panels
|
|
8612
|
-
.filter((v) => v !==
|
|
8661
|
+
.filter((v) => v !== panel)
|
|
8613
8662
|
.forEach((v) => {
|
|
8614
8663
|
v.api._onDidActiveChange.fire({ isActive: false });
|
|
8615
8664
|
if (!skipFocus) {
|
|
8616
8665
|
v.focus();
|
|
8617
8666
|
}
|
|
8618
8667
|
});
|
|
8619
|
-
|
|
8668
|
+
panel.api._onDidActiveChange.fire({ isActive: true });
|
|
8620
8669
|
if (!skipFocus) {
|
|
8621
|
-
|
|
8670
|
+
panel.focus();
|
|
8622
8671
|
}
|
|
8623
8672
|
}
|
|
8624
8673
|
removePanel(panel, sizing) {
|
|
@@ -8917,6 +8966,10 @@ class PaneviewComponent extends Resizable {
|
|
|
8917
8966
|
});
|
|
8918
8967
|
this.addDisposables(this._disposable);
|
|
8919
8968
|
}
|
|
8969
|
+
setVisible(panel, visible) {
|
|
8970
|
+
const index = this.panels.indexOf(panel);
|
|
8971
|
+
this.paneview.setViewVisible(index, visible);
|
|
8972
|
+
}
|
|
8920
8973
|
focus() {
|
|
8921
8974
|
//noop
|
|
8922
8975
|
}
|
|
@@ -8963,6 +9016,7 @@ class PaneviewComponent extends Resizable {
|
|
|
8963
9016
|
isExpanded: options.isExpanded,
|
|
8964
9017
|
title: options.title,
|
|
8965
9018
|
containerApi: new PaneviewApi(this),
|
|
9019
|
+
accessor: this,
|
|
8966
9020
|
});
|
|
8967
9021
|
this.paneview.addPane(view, size, index);
|
|
8968
9022
|
view.orientation = this.paneview.orientation;
|
|
@@ -9062,6 +9116,7 @@ class PaneviewComponent extends Resizable {
|
|
|
9062
9116
|
title: data.title,
|
|
9063
9117
|
isExpanded: !!view.expanded,
|
|
9064
9118
|
containerApi: new PaneviewApi(this),
|
|
9119
|
+
accessor: this,
|
|
9065
9120
|
});
|
|
9066
9121
|
panel.orientation = this.paneview.orientation;
|
|
9067
9122
|
});
|
|
@@ -9141,7 +9196,7 @@ class SplitviewPanel extends BasePanelView {
|
|
|
9141
9196
|
return this._snap;
|
|
9142
9197
|
}
|
|
9143
9198
|
constructor(id, componentName) {
|
|
9144
|
-
super(id, componentName, new SplitviewPanelApiImpl(id));
|
|
9199
|
+
super(id, componentName, new SplitviewPanelApiImpl(id, componentName));
|
|
9145
9200
|
this._evaluatedMinimumSize = 0;
|
|
9146
9201
|
this._evaluatedMaximumSize = Number.POSITIVE_INFINITY;
|
|
9147
9202
|
this._minimumSize = 0;
|
|
@@ -9150,10 +9205,10 @@ class SplitviewPanel extends BasePanelView {
|
|
|
9150
9205
|
this._onDidChange = new Emitter();
|
|
9151
9206
|
this.onDidChange = this._onDidChange.event;
|
|
9152
9207
|
this.api.initialize(this);
|
|
9153
|
-
this.addDisposables(this._onDidChange, this.api.
|
|
9154
|
-
const {
|
|
9208
|
+
this.addDisposables(this._onDidChange, this.api.onWillVisibilityChange((event) => {
|
|
9209
|
+
const { isVisible } = event;
|
|
9155
9210
|
const { accessor } = this._params;
|
|
9156
|
-
accessor.setVisible(this,
|
|
9211
|
+
accessor.setVisible(this, isVisible);
|
|
9157
9212
|
}), this.api.onActiveChange(() => {
|
|
9158
9213
|
const { accessor } = this._params;
|
|
9159
9214
|
accessor.setActive(this);
|