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