dockview-core 8.5.0 → 8.6.0
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 +7 -1
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +2 -0
- package/dist/cjs/dockview/dockviewComponent.d.ts +16 -1
- package/dist/cjs/dockview/dockviewShell.d.ts +50 -11
- package/dist/cjs/dockview/options.d.ts +6 -0
- package/dist/cjs/splitview/splitview.d.ts +6 -0
- package/dist/dockview-core.js +239 -134
- package/dist/dockview-core.min.js +146 -2
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.noStyle.js +238 -133
- package/dist/package/main.cjs.js +238 -133
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +238 -133
- package/package.json +1 -1
package/dist/package/main.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 8.
|
|
3
|
+
* @version 8.6.0
|
|
4
4
|
* @link https://github.com/dockview/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -1145,8 +1145,9 @@ var ViewItem = class {
|
|
|
1145
1145
|
if (visible === this.visible) return;
|
|
1146
1146
|
if (visible) {
|
|
1147
1147
|
var _this$_cachedVisibleS;
|
|
1148
|
-
|
|
1148
|
+
const cachedVisibleSize = (_this$_cachedVisibleS = this._cachedVisibleSize) !== null && _this$_cachedVisibleS !== void 0 ? _this$_cachedVisibleS : 0;
|
|
1149
1149
|
this._cachedVisibleSize = void 0;
|
|
1150
|
+
this.size = clamp(cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize);
|
|
1150
1151
|
} else {
|
|
1151
1152
|
this._cachedVisibleSize = typeof size === "number" ? size : this.size;
|
|
1152
1153
|
this.size = 0;
|
|
@@ -1282,6 +1283,15 @@ var Splitview = class {
|
|
|
1282
1283
|
get margin() {
|
|
1283
1284
|
return this._margin;
|
|
1284
1285
|
}
|
|
1286
|
+
/**
|
|
1287
|
+
* The size each visible view gives up to the margins: `n` visible views
|
|
1288
|
+
* are separated by `n - 1` margins, spread evenly over the `n`.
|
|
1289
|
+
*/
|
|
1290
|
+
get marginShare() {
|
|
1291
|
+
let visibleViewCount = 0;
|
|
1292
|
+
for (const item of this.viewItems) if (item.visible) visibleViewCount++;
|
|
1293
|
+
return this.marginShareFor(visibleViewCount);
|
|
1294
|
+
}
|
|
1285
1295
|
set margin(value) {
|
|
1286
1296
|
this._margin = value;
|
|
1287
1297
|
toggleClass(this.element, "dv-splitview-has-margin", value !== 0);
|
|
@@ -1578,6 +1588,7 @@ var Splitview = class {
|
|
|
1578
1588
|
const previousSize = Math.max(this.size, this._contentSize);
|
|
1579
1589
|
this.size = size;
|
|
1580
1590
|
this.orthogonalSize = orthogonalSize;
|
|
1591
|
+
if (!this._proportions) this.saveProportions();
|
|
1581
1592
|
if (this.proportions) {
|
|
1582
1593
|
let total = 0;
|
|
1583
1594
|
for (let i = 0; i < this.viewItems.length; i++) {
|
|
@@ -1634,7 +1645,10 @@ var Splitview = class {
|
|
|
1634
1645
|
}
|
|
1635
1646
|
}
|
|
1636
1647
|
saveProportions() {
|
|
1637
|
-
if (this.proportionalLayout
|
|
1648
|
+
if (!this.proportionalLayout) return;
|
|
1649
|
+
let contentSize = 0;
|
|
1650
|
+
for (const item of this.viewItems) contentSize += item.size;
|
|
1651
|
+
if (contentSize > 0) this._proportions = this.viewItems.map((i) => i.visible ? i.size / contentSize : void 0);
|
|
1638
1652
|
}
|
|
1639
1653
|
/**
|
|
1640
1654
|
* Margin explain:
|
|
@@ -1656,7 +1670,7 @@ var Splitview = class {
|
|
|
1656
1670
|
this.updateSashEnablement();
|
|
1657
1671
|
if (this.viewItems.length === 0) return;
|
|
1658
1672
|
const sashCount = Math.max(0, visibleViewCount - 1);
|
|
1659
|
-
const marginReducedSize = this.
|
|
1673
|
+
const marginReducedSize = this.marginShareFor(visibleViewCount);
|
|
1660
1674
|
let totalLeftOffset = 0;
|
|
1661
1675
|
const viewLeftOffsets = [];
|
|
1662
1676
|
const sashWidth = 4;
|
|
@@ -1686,9 +1700,13 @@ var Splitview = class {
|
|
|
1686
1700
|
view.setContainerGeometry("width", "");
|
|
1687
1701
|
view.setContainerGeometry("left", "");
|
|
1688
1702
|
}
|
|
1689
|
-
view.view.layout(
|
|
1703
|
+
view.view.layout(size, this._orthogonalSize);
|
|
1690
1704
|
});
|
|
1691
1705
|
}
|
|
1706
|
+
marginShareFor(visibleViewCount) {
|
|
1707
|
+
const sashCount = Math.max(0, visibleViewCount - 1);
|
|
1708
|
+
return this._margin * sashCount / Math.max(1, visibleViewCount);
|
|
1709
|
+
}
|
|
1692
1710
|
findFirstSnapIndex(indexes) {
|
|
1693
1711
|
for (const index of indexes) {
|
|
1694
1712
|
const viewItem = this.viewItems[index];
|
|
@@ -3934,9 +3952,13 @@ var DockviewApi = class {
|
|
|
3934
3952
|
}
|
|
3935
3953
|
/**
|
|
3936
3954
|
* Remove a panel given the panel object.
|
|
3955
|
+
*
|
|
3956
|
+
* `removeEmptyGroup` overrides the `closeEmptyGroups` option for this
|
|
3957
|
+
* call: `false` keeps the group if the panel was its last one, `true`
|
|
3958
|
+
* removes it.
|
|
3937
3959
|
*/
|
|
3938
|
-
removePanel(panel) {
|
|
3939
|
-
this.component.withOrigin("api", () => this.component.removePanel(panel));
|
|
3960
|
+
removePanel(panel, options) {
|
|
3961
|
+
this.component.withOrigin("api", () => this.component.removePanel(panel, options));
|
|
3940
3962
|
}
|
|
3941
3963
|
/**
|
|
3942
3964
|
* Add a group and return the created object.
|
|
@@ -6990,6 +7012,7 @@ const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
|
6990
7012
|
dndStrategy: void 0,
|
|
6991
7013
|
className: void 0,
|
|
6992
7014
|
noPanelsOverlay: void 0,
|
|
7015
|
+
closeEmptyGroups: void 0,
|
|
6993
7016
|
dndEdges: void 0,
|
|
6994
7017
|
dropPositionResolver: void 0,
|
|
6995
7018
|
dndCompass: void 0,
|
|
@@ -11509,7 +11532,7 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
|
|
|
11509
11532
|
});
|
|
11510
11533
|
return;
|
|
11511
11534
|
}
|
|
11512
|
-
if (this.tabsContainer.indexOf(data.panelId) !== -1 && this.tabsContainer.size === 1) return;
|
|
11535
|
+
if (this.tabsContainer.indexOf(data.panelId) !== -1 && this.tabsContainer.size === 1 && this.accessor.options.closeEmptyGroups !== false) return;
|
|
11513
11536
|
const { groupId, panelId } = data;
|
|
11514
11537
|
if (this.id === groupId && !position) {
|
|
11515
11538
|
if (this.tabsContainer.indexOf(panelId) === index) return;
|
|
@@ -11759,6 +11782,7 @@ var DockviewGroupPanelApiImpl = class extends GridviewPanelApiImpl {
|
|
|
11759
11782
|
constructor(id, accessor) {
|
|
11760
11783
|
super(id, "__dockviewgroup__");
|
|
11761
11784
|
this.accessor = accessor;
|
|
11785
|
+
this._isApplyingSize = false;
|
|
11762
11786
|
this._onDidLocationChange = new Emitter();
|
|
11763
11787
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
11764
11788
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -11771,14 +11795,29 @@ var DockviewGroupPanelApiImpl = class extends GridviewPanelApiImpl {
|
|
|
11771
11795
|
this.onDidHeaderDirectionChange = this._onDidHeaderDirectionChange.event;
|
|
11772
11796
|
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidCollapsedChange, this._onDidPeekChange, this._onDidHeaderDirectionChange, this._onDidVisibilityChange.event((event) => {
|
|
11773
11797
|
if (event.isVisible && this._pendingSize) {
|
|
11774
|
-
|
|
11798
|
+
const pendingSize = this._pendingSize;
|
|
11775
11799
|
this._pendingSize = void 0;
|
|
11800
|
+
super.setSize(pendingSize);
|
|
11776
11801
|
}
|
|
11802
|
+
}), this.onDidDimensionsChange((event) => {
|
|
11803
|
+
var _this$_reportedSize, _this$_reportedSize2;
|
|
11804
|
+
const moved = event.width !== ((_this$_reportedSize = this._reportedSize) === null || _this$_reportedSize === void 0 ? void 0 : _this$_reportedSize.width) || event.height !== ((_this$_reportedSize2 = this._reportedSize) === null || _this$_reportedSize2 === void 0 ? void 0 : _this$_reportedSize2.height);
|
|
11805
|
+
this._reportedSize = {
|
|
11806
|
+
width: event.width,
|
|
11807
|
+
height: event.height
|
|
11808
|
+
};
|
|
11809
|
+
if (moved && this.isVisible && !this._isApplyingSize) this._pendingSize = void 0;
|
|
11777
11810
|
}));
|
|
11778
11811
|
}
|
|
11779
11812
|
setSize(event) {
|
|
11780
|
-
this._pendingSize = _objectSpread2({}, event);
|
|
11781
|
-
|
|
11813
|
+
if (typeof event.width === "number" || typeof event.height === "number") this._pendingSize = _objectSpread2({}, event);
|
|
11814
|
+
const wasApplyingSize = this._isApplyingSize;
|
|
11815
|
+
this._isApplyingSize = true;
|
|
11816
|
+
try {
|
|
11817
|
+
super.setSize(event);
|
|
11818
|
+
} finally {
|
|
11819
|
+
this._isApplyingSize = wasApplyingSize;
|
|
11820
|
+
}
|
|
11782
11821
|
}
|
|
11783
11822
|
close() {
|
|
11784
11823
|
if (!this._group) return;
|
|
@@ -15118,6 +15157,20 @@ var DropTargetAnchorContainer = class extends CompositeDisposable {
|
|
|
15118
15157
|
|
|
15119
15158
|
//#endregion
|
|
15120
15159
|
//#region src/dockview/dockviewShell.ts
|
|
15160
|
+
const EDGE_POSITIONS = [
|
|
15161
|
+
"left",
|
|
15162
|
+
"right",
|
|
15163
|
+
"top",
|
|
15164
|
+
"bottom"
|
|
15165
|
+
];
|
|
15166
|
+
function isHorizontal(position) {
|
|
15167
|
+
return position === "left" || position === "right";
|
|
15168
|
+
}
|
|
15169
|
+
/** A view outside a shell: no gap, and every layout is real. */
|
|
15170
|
+
const UNBOUNDED_AXIS = {
|
|
15171
|
+
marginShare: 0,
|
|
15172
|
+
size: Number.POSITIVE_INFINITY
|
|
15173
|
+
};
|
|
15121
15174
|
var EdgeGroupView = class {
|
|
15122
15175
|
/**
|
|
15123
15176
|
* The effective (pre-gap) collapsed size: the measured tab-strip size when
|
|
@@ -15129,7 +15182,7 @@ var EdgeGroupView = class {
|
|
|
15129
15182
|
}
|
|
15130
15183
|
get minimumSize() {
|
|
15131
15184
|
if (this._isCollapsed) return this.collapsedSize;
|
|
15132
|
-
return this._baseMinimumSize !== void 0 ? this._baseMinimumSize + this.
|
|
15185
|
+
return this._baseMinimumSize !== void 0 ? this._baseMinimumSize + this._axis.marginShare : this._effectiveBaseCollapsed + 50 + this._axis.marginShare;
|
|
15133
15186
|
}
|
|
15134
15187
|
get maximumSize() {
|
|
15135
15188
|
return this._isCollapsed ? this.collapsedSize : this._expandedMaximumSize;
|
|
@@ -15140,11 +15193,16 @@ var EdgeGroupView = class {
|
|
|
15140
15193
|
get isCollapsed() {
|
|
15141
15194
|
return this._isCollapsed;
|
|
15142
15195
|
}
|
|
15196
|
+
/** Includes the gap share, as expanding restores a slot size. */
|
|
15143
15197
|
get lastExpandedSize() {
|
|
15144
15198
|
return this._lastExpandedSize;
|
|
15145
15199
|
}
|
|
15200
|
+
/** Without the gap share. */
|
|
15201
|
+
get lastExpandedContentSize() {
|
|
15202
|
+
return this._lastExpandedSize - this._axis.marginShare;
|
|
15203
|
+
}
|
|
15146
15204
|
get collapsedSize() {
|
|
15147
|
-
return this._effectiveBaseCollapsed + this.
|
|
15205
|
+
return this._effectiveBaseCollapsed + this._axis.marginShare;
|
|
15148
15206
|
}
|
|
15149
15207
|
/** The user-configured (pre-gap) geometry constraints, for serialization.
|
|
15150
15208
|
* These are the raw values passed to `addEdgeGroup`, unlike the effective
|
|
@@ -15159,13 +15217,14 @@ var EdgeGroupView = class {
|
|
|
15159
15217
|
get configuredCollapsedSize() {
|
|
15160
15218
|
return this._baseCollapsedSize;
|
|
15161
15219
|
}
|
|
15162
|
-
constructor(options, group, orientation,
|
|
15220
|
+
constructor(options, group, orientation, axis = UNBOUNDED_AXIS) {
|
|
15163
15221
|
var _options$collapsedSiz, _options$maximumSize, _options$initialSize;
|
|
15164
15222
|
this._onDidChange = new Emitter();
|
|
15165
15223
|
this.onDidChange = this._onDidChange.event;
|
|
15166
15224
|
this.snap = false;
|
|
15167
15225
|
this.priority = "low";
|
|
15168
15226
|
this._isCollapsed = false;
|
|
15227
|
+
this._isVisible = true;
|
|
15169
15228
|
this._tabSizeDisposables = new CompositeDisposable();
|
|
15170
15229
|
this._group = group;
|
|
15171
15230
|
this._orientation = orientation;
|
|
@@ -15173,7 +15232,7 @@ var EdgeGroupView = class {
|
|
|
15173
15232
|
group.element.dataset.testid = `dv-edge-group-${options.id}`;
|
|
15174
15233
|
this._baseCollapsedSize = (_options$collapsedSiz = options.collapsedSize) !== null && _options$collapsedSiz !== void 0 ? _options$collapsedSiz : 35;
|
|
15175
15234
|
this._baseMinimumSize = options.minimumSize;
|
|
15176
|
-
this.
|
|
15235
|
+
this._axis = axis;
|
|
15177
15236
|
this._expandedMaximumSize = (_options$maximumSize = options.maximumSize) !== null && _options$maximumSize !== void 0 ? _options$maximumSize : Number.POSITIVE_INFINITY;
|
|
15178
15237
|
this._lastExpandedSize = (_options$initialSize = options.initialSize) !== null && _options$initialSize !== void 0 ? _options$initialSize : 200;
|
|
15179
15238
|
if (options.collapsed) {
|
|
@@ -15206,7 +15265,7 @@ var EdgeGroupView = class {
|
|
|
15206
15265
|
if (this._isCollapsed) this._onDidChange.fire({ size: this.collapsedSize });
|
|
15207
15266
|
}
|
|
15208
15267
|
layout(size, orthogonalSize) {
|
|
15209
|
-
if (!this._isCollapsed) this._lastExpandedSize = size;
|
|
15268
|
+
if (!this._isCollapsed && this._isVisible && this._axis.size > 0) this._lastExpandedSize = size + this._axis.marginShare;
|
|
15210
15269
|
if (this._orientation === "horizontal") this._group.layout(size, orthogonalSize);
|
|
15211
15270
|
else this._group.layout(orthogonalSize, size);
|
|
15212
15271
|
}
|
|
@@ -15215,25 +15274,25 @@ var EdgeGroupView = class {
|
|
|
15215
15274
|
this._isCollapsed = collapsed;
|
|
15216
15275
|
this._group.element.classList.toggle("dv-edge-collapsed", collapsed);
|
|
15217
15276
|
}
|
|
15218
|
-
setVisible(
|
|
15277
|
+
setVisible(visible) {
|
|
15278
|
+
this._isVisible = visible;
|
|
15279
|
+
}
|
|
15219
15280
|
/**
|
|
15220
|
-
*
|
|
15221
|
-
*
|
|
15222
|
-
*
|
|
15281
|
+
* Set the expanded size without triggering a layout: from serialized
|
|
15282
|
+
* state (before setCollapsed(true) during fromJSON, so that expanding
|
|
15283
|
+
* restores the right size) or from an explicit resize.
|
|
15223
15284
|
*/
|
|
15224
15285
|
restoreExpandedSize(size) {
|
|
15225
15286
|
this._lastExpandedSize = size;
|
|
15226
15287
|
}
|
|
15227
15288
|
/**
|
|
15228
|
-
* Apply a new base (pre-gap) collapsed size
|
|
15229
|
-
*
|
|
15230
|
-
*
|
|
15231
|
-
* measured tab size (if any) continues to win over the base collapsed size.
|
|
15289
|
+
* Apply a new base (pre-gap) collapsed size and base minimum size after a
|
|
15290
|
+
* theme change. Base values come from the original config. A live measured
|
|
15291
|
+
* tab size (if any) continues to win over the base collapsed size.
|
|
15232
15292
|
*/
|
|
15233
|
-
updateSizing(baseCollapsedSize, baseMinimumSize
|
|
15293
|
+
updateSizing(baseCollapsedSize, baseMinimumSize) {
|
|
15234
15294
|
this._baseCollapsedSize = baseCollapsedSize;
|
|
15235
15295
|
this._baseMinimumSize = baseMinimumSize;
|
|
15236
|
-
this._gapAdd = gapAdd;
|
|
15237
15296
|
}
|
|
15238
15297
|
dispose() {
|
|
15239
15298
|
this._tabSizeDisposables.dispose();
|
|
@@ -15335,13 +15394,20 @@ var MiddleColumnView = class {
|
|
|
15335
15394
|
const index = position === "top" ? this._topIndex : this._bottomIndex;
|
|
15336
15395
|
if (index !== void 0) this._splitview.resizeView(index, size);
|
|
15337
15396
|
}
|
|
15338
|
-
/** The inner splitview
|
|
15339
|
-
get
|
|
15340
|
-
return this._splitview
|
|
15397
|
+
/** The inner splitview, as the axis its edge views read. */
|
|
15398
|
+
get axis() {
|
|
15399
|
+
return this._splitview;
|
|
15341
15400
|
}
|
|
15342
15401
|
updateMargin(gap) {
|
|
15343
15402
|
this._splitview.margin = gap;
|
|
15344
15403
|
}
|
|
15404
|
+
/** Disables the sashes of the top/bottom edge groups. */
|
|
15405
|
+
get disabled() {
|
|
15406
|
+
return this._splitview.disabled;
|
|
15407
|
+
}
|
|
15408
|
+
set disabled(value) {
|
|
15409
|
+
this._splitview.disabled = value;
|
|
15410
|
+
}
|
|
15345
15411
|
dispose() {
|
|
15346
15412
|
this._onDidChange.dispose();
|
|
15347
15413
|
this._splitview.dispose();
|
|
@@ -15391,8 +15457,6 @@ var ShellManager = class {
|
|
|
15391
15457
|
const width = Math.round(entry.contentRect.width);
|
|
15392
15458
|
const height = Math.round(entry.contentRect.height);
|
|
15393
15459
|
if (width === this._currentWidth && height === this._currentHeight) return;
|
|
15394
|
-
this._currentWidth = width;
|
|
15395
|
-
this._currentHeight = height;
|
|
15396
15460
|
this.layout(width, height);
|
|
15397
15461
|
}), this._outerSplitview, this._middleColumn, centerView);
|
|
15398
15462
|
}
|
|
@@ -15400,6 +15464,18 @@ var ShellManager = class {
|
|
|
15400
15464
|
return this._shellElement;
|
|
15401
15465
|
}
|
|
15402
15466
|
/**
|
|
15467
|
+
* The dock's `locked` option. The edge groups are resized with the sashes
|
|
15468
|
+
* of the shell's own splitviews (left/right in the outer one, top/bottom
|
|
15469
|
+
* in the middle column), so locking disables both.
|
|
15470
|
+
*/
|
|
15471
|
+
get locked() {
|
|
15472
|
+
return this._outerSplitview.disabled;
|
|
15473
|
+
}
|
|
15474
|
+
set locked(value) {
|
|
15475
|
+
this._outerSplitview.disabled = value;
|
|
15476
|
+
this._middleColumn.disabled = value;
|
|
15477
|
+
}
|
|
15478
|
+
/**
|
|
15403
15479
|
* Add an edge group view at the given position. The view wraps the
|
|
15404
15480
|
* provided group element inside the shell's splitview layout.
|
|
15405
15481
|
* Throws if a group at this position is already registered.
|
|
@@ -15407,14 +15483,7 @@ var ShellManager = class {
|
|
|
15407
15483
|
addEdgeView(position, options, group) {
|
|
15408
15484
|
if (this.hasEdgeGroup(position)) throw new Error(`dockview: edge group already registered at position '${position}'`);
|
|
15409
15485
|
this._viewConfigs.set(position, options);
|
|
15410
|
-
const
|
|
15411
|
-
const innerN = 1 + (this._viewConfigs.has("top") ? 1 : 0) + (this._viewConfigs.has("bottom") ? 1 : 0);
|
|
15412
|
-
const outerGapAdd = outerN > 1 ? this._gap * (outerN - 1) / outerN : 0;
|
|
15413
|
-
const innerGapAdd = innerN > 1 ? this._gap * (innerN - 1) / innerN : 0;
|
|
15414
|
-
const isHorizontal = position === "left" || position === "right";
|
|
15415
|
-
const gapAdd = isHorizontal ? outerGapAdd : innerGapAdd;
|
|
15416
|
-
const orientation = isHorizontal ? "horizontal" : "vertical";
|
|
15417
|
-
const view = new EdgeGroupView(_objectSpread2({ collapsedSize: this._defaultCollapsedSize }, options), group, orientation, gapAdd);
|
|
15486
|
+
const view = new EdgeGroupView(_objectSpread2({ collapsedSize: this._defaultCollapsedSize }, options), group, isHorizontal(position) ? "horizontal" : "vertical", this._axisFor(position));
|
|
15418
15487
|
const initialSize = view.isCollapsed ? view.collapsedSize : view.lastExpandedSize;
|
|
15419
15488
|
switch (position) {
|
|
15420
15489
|
case "left":
|
|
@@ -15443,7 +15512,7 @@ var ShellManager = class {
|
|
|
15443
15512
|
}
|
|
15444
15513
|
this._disposables.addDisposables(view);
|
|
15445
15514
|
if (!view.isCollapsed && !this._canResize(position)) this._pendingSizes.set(position, initialSize);
|
|
15446
|
-
this.
|
|
15515
|
+
this._relayout();
|
|
15447
15516
|
return view;
|
|
15448
15517
|
}
|
|
15449
15518
|
/**
|
|
@@ -15465,6 +15534,8 @@ var ShellManager = class {
|
|
|
15465
15534
|
this.layout(width, height);
|
|
15466
15535
|
}
|
|
15467
15536
|
layout(width, height) {
|
|
15537
|
+
this._currentWidth = width;
|
|
15538
|
+
this._currentHeight = height;
|
|
15468
15539
|
this._outerSplitview.layout(width, height);
|
|
15469
15540
|
this._flushPendingSizes();
|
|
15470
15541
|
}
|
|
@@ -15474,34 +15545,50 @@ var ShellManager = class {
|
|
|
15474
15545
|
* and tab-strip dimensions.
|
|
15475
15546
|
*/
|
|
15476
15547
|
updateTheme(gap, defaultCollapsedSize) {
|
|
15477
|
-
var _this$_leftView, _this$_rightView, _this$_topView, _this$_bottomView;
|
|
15478
15548
|
this._gap = gap;
|
|
15479
15549
|
this._defaultCollapsedSize = defaultCollapsedSize;
|
|
15480
|
-
const outerN = 1 + (this._viewConfigs.has("left") ? 1 : 0) + (this._viewConfigs.has("right") ? 1 : 0);
|
|
15481
|
-
const innerN = 1 + (this._viewConfigs.has("top") ? 1 : 0) + (this._viewConfigs.has("bottom") ? 1 : 0);
|
|
15482
|
-
const outerGapAdd = outerN > 1 ? gap * (outerN - 1) / outerN : 0;
|
|
15483
|
-
const innerGapAdd = innerN > 1 ? gap * (innerN - 1) / innerN : 0;
|
|
15484
15550
|
this._outerSplitview.margin = gap;
|
|
15485
15551
|
this._middleColumn.updateMargin(gap);
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
|
|
15496
|
-
|
|
15497
|
-
|
|
15498
|
-
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
|
|
15552
|
+
this._applyThemeSizing();
|
|
15553
|
+
this._relayout();
|
|
15554
|
+
}
|
|
15555
|
+
/** Whether the other edge of `position`'s axis holds a view. */
|
|
15556
|
+
_hasSiblingOn(position) {
|
|
15557
|
+
return isHorizontal(position) ? this._leftView !== void 0 && this._rightView !== void 0 : this._topView !== void 0 && this._bottomView !== void 0;
|
|
15558
|
+
}
|
|
15559
|
+
/** The splitview `position`'s view sits in, as its edge axis. */
|
|
15560
|
+
_axisFor(position) {
|
|
15561
|
+
return isHorizontal(position) ? this._outerSplitview : this._middleColumn.axis;
|
|
15562
|
+
}
|
|
15563
|
+
/** Re-derive every edge view's base sizing from its original config and
|
|
15564
|
+
* the current defaults. */
|
|
15565
|
+
_applyThemeSizing() {
|
|
15566
|
+
for (const position of EDGE_POSITIONS) {
|
|
15567
|
+
const view = this._getView(position);
|
|
15568
|
+
const baseCfg = this._viewConfigs.get(position);
|
|
15569
|
+
if (view && baseCfg) {
|
|
15570
|
+
var _baseCfg$collapsedSiz;
|
|
15571
|
+
view.updateSizing((_baseCfg$collapsedSiz = baseCfg.collapsedSize) !== null && _baseCfg$collapsedSiz !== void 0 ? _baseCfg$collapsedSiz : this._defaultCollapsedSize, baseCfg.minimumSize);
|
|
15572
|
+
}
|
|
15573
|
+
}
|
|
15574
|
+
}
|
|
15575
|
+
/**
|
|
15576
|
+
* Lay the shell out again at its current size, once it has one. The
|
|
15577
|
+
* splitviews clamp every view to its current constraints, which is how a
|
|
15578
|
+
* collapsed strip or a group at its minimum follows a moved gap share.
|
|
15579
|
+
*/
|
|
15580
|
+
_relayout() {
|
|
15503
15581
|
if (this._currentWidth > 0 && this._currentHeight > 0) this.layout(this._currentWidth, this._currentHeight);
|
|
15504
15582
|
}
|
|
15583
|
+
/** The view's slot in its splitview: its laid-out size plus the gap share. */
|
|
15584
|
+
_slotSize(position) {
|
|
15585
|
+
switch (position) {
|
|
15586
|
+
case "left": return this._leftIndex === void 0 ? 0 : this._outerSplitview.getViewSize(this._leftIndex);
|
|
15587
|
+
case "right": return this._rightIndex === void 0 ? 0 : this._outerSplitview.getViewSize(this._rightIndex);
|
|
15588
|
+
case "top":
|
|
15589
|
+
case "bottom": return this._middleColumn.getViewSize(position);
|
|
15590
|
+
}
|
|
15591
|
+
}
|
|
15505
15592
|
removeEdgeView(position) {
|
|
15506
15593
|
const view = this._getView(position);
|
|
15507
15594
|
if (!view) return;
|
|
@@ -15531,7 +15618,7 @@ var ShellManager = class {
|
|
|
15531
15618
|
view.dispose();
|
|
15532
15619
|
this._viewConfigs.delete(position);
|
|
15533
15620
|
this._pendingSizes.delete(position);
|
|
15534
|
-
this.
|
|
15621
|
+
this._relayout();
|
|
15535
15622
|
}
|
|
15536
15623
|
hasEdgeGroup(position) {
|
|
15537
15624
|
switch (position) {
|
|
@@ -15542,6 +15629,7 @@ var ShellManager = class {
|
|
|
15542
15629
|
}
|
|
15543
15630
|
}
|
|
15544
15631
|
setEdgeGroupVisible(position, visible) {
|
|
15632
|
+
const changes = this._getView(position) !== void 0 && visible !== this.isEdgeGroupVisible(position);
|
|
15545
15633
|
switch (position) {
|
|
15546
15634
|
case "left":
|
|
15547
15635
|
if (this._leftIndex !== void 0) this._outerSplitview.setViewVisible(this._leftIndex, visible);
|
|
@@ -15554,6 +15642,7 @@ var ShellManager = class {
|
|
|
15554
15642
|
this._middleColumn.setViewVisible(position, visible);
|
|
15555
15643
|
break;
|
|
15556
15644
|
}
|
|
15645
|
+
if (changes && this._gap > 0 && this._hasSiblingOn(position)) this._relayout();
|
|
15557
15646
|
if (visible) this._flushPendingSizes();
|
|
15558
15647
|
}
|
|
15559
15648
|
isEdgeGroupVisible(position) {
|
|
@@ -15603,8 +15692,7 @@ var ShellManager = class {
|
|
|
15603
15692
|
/** A resize lands only on a visible view (a hidden one is pinned to zero)
|
|
15604
15693
|
* whose splitview has extent to distribute. */
|
|
15605
15694
|
_canResize(position) {
|
|
15606
|
-
|
|
15607
|
-
return (position === "left" || position === "right" ? this._outerSplitview.size : this._middleColumn.axisSize) > 0;
|
|
15695
|
+
return this.isEdgeGroupVisible(position) && this._axisFor(position).size > 0;
|
|
15608
15696
|
}
|
|
15609
15697
|
_resizeView(position, size) {
|
|
15610
15698
|
switch (position) {
|
|
@@ -15637,7 +15725,7 @@ var ShellManager = class {
|
|
|
15637
15725
|
* the auto-hide peek overlay. */
|
|
15638
15726
|
getEdgeGroupExpandedSize(position) {
|
|
15639
15727
|
var _this$_getView$lastEx, _this$_getView2;
|
|
15640
|
-
return (_this$_getView$lastEx = (_this$_getView2 = this._getView(position)) === null || _this$_getView2 === void 0 ? void 0 : _this$_getView2.
|
|
15728
|
+
return (_this$_getView$lastEx = (_this$_getView2 = this._getView(position)) === null || _this$_getView2 === void 0 ? void 0 : _this$_getView2.lastExpandedContentSize) !== null && _this$_getView$lastEx !== void 0 ? _this$_getView$lastEx : 0;
|
|
15641
15729
|
}
|
|
15642
15730
|
_getView(position) {
|
|
15643
15731
|
switch (position) {
|
|
@@ -15649,59 +15737,45 @@ var ShellManager = class {
|
|
|
15649
15737
|
}
|
|
15650
15738
|
toJSON() {
|
|
15651
15739
|
const edgeGroups = {};
|
|
15652
|
-
const
|
|
15653
|
-
|
|
15654
|
-
|
|
15655
|
-
|
|
15656
|
-
|
|
15657
|
-
|
|
15658
|
-
if (view.isCollapsed) return view.lastExpandedSize;
|
|
15659
|
-
const pending = this._pendingSizes.get(position);
|
|
15660
|
-
if (pending !== void 0) return pending;
|
|
15661
|
-
if (!isVisible) return cachedVisibleSize !== null && cachedVisibleSize !== void 0 ? cachedVisibleSize : view.lastExpandedSize;
|
|
15662
|
-
return liveSize;
|
|
15663
|
-
};
|
|
15664
|
-
if (this._leftView && this._leftIndex !== void 0) {
|
|
15665
|
-
const visible = this._outerSplitview.isViewVisible(this._leftIndex);
|
|
15666
|
-
edgeGroups.left = _objectSpread2({
|
|
15667
|
-
size: expandedSize(this._leftView, "left", visible, this._outerSplitview.getViewSize(this._leftIndex), this._outerSplitview.getViewCachedVisibleSize(this._leftIndex)),
|
|
15668
|
-
visible,
|
|
15669
|
-
collapsed: this._leftView.isCollapsed || void 0
|
|
15670
|
-
}, constraints(this._leftView));
|
|
15671
|
-
}
|
|
15672
|
-
if (this._rightView && this._rightIndex !== void 0) {
|
|
15673
|
-
const visible = this._outerSplitview.isViewVisible(this._rightIndex);
|
|
15674
|
-
edgeGroups.right = _objectSpread2({
|
|
15675
|
-
size: expandedSize(this._rightView, "right", visible, this._outerSplitview.getViewSize(this._rightIndex), this._outerSplitview.getViewCachedVisibleSize(this._rightIndex)),
|
|
15740
|
+
for (const position of EDGE_POSITIONS) {
|
|
15741
|
+
const view = this._getView(position);
|
|
15742
|
+
if (!view) continue;
|
|
15743
|
+
const visible = this.isEdgeGroupVisible(position);
|
|
15744
|
+
edgeGroups[position] = {
|
|
15745
|
+
size: this._expandedSize(view, position, visible),
|
|
15676
15746
|
visible,
|
|
15677
|
-
collapsed:
|
|
15678
|
-
|
|
15747
|
+
collapsed: view.isCollapsed || void 0,
|
|
15748
|
+
minimumSize: view.configuredMinimumSize,
|
|
15749
|
+
maximumSize: Number.isFinite(view.configuredMaximumSize) ? view.configuredMaximumSize : void 0,
|
|
15750
|
+
collapsedSize: view.configuredCollapsedSize
|
|
15751
|
+
};
|
|
15679
15752
|
}
|
|
15680
|
-
|
|
15681
|
-
|
|
15682
|
-
|
|
15683
|
-
|
|
15684
|
-
|
|
15685
|
-
|
|
15686
|
-
|
|
15753
|
+
return edgeGroups;
|
|
15754
|
+
}
|
|
15755
|
+
/** The size to restore the group to. An expanded-but-hidden group has a
|
|
15756
|
+
* slot of 0, so fall back to its cached visible size (then
|
|
15757
|
+
* lastExpandedSize); otherwise re-showing snaps to minimumSize. */
|
|
15758
|
+
_expandedSize(view, position, visible) {
|
|
15759
|
+
if (view.isCollapsed) return view.lastExpandedSize;
|
|
15760
|
+
const pending = this._pendingSizes.get(position);
|
|
15761
|
+
if (pending !== void 0) return pending;
|
|
15762
|
+
if (!visible) {
|
|
15763
|
+
var _this$_cachedVisibleS;
|
|
15764
|
+
return (_this$_cachedVisibleS = this._cachedVisibleSize(position)) !== null && _this$_cachedVisibleS !== void 0 ? _this$_cachedVisibleS : view.lastExpandedSize;
|
|
15687
15765
|
}
|
|
15688
|
-
|
|
15689
|
-
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15766
|
+
return this._slotSize(position);
|
|
15767
|
+
}
|
|
15768
|
+
/** The slot a hidden view had when it was last visible. */
|
|
15769
|
+
_cachedVisibleSize(position) {
|
|
15770
|
+
switch (position) {
|
|
15771
|
+
case "left": return this._leftIndex === void 0 ? void 0 : this._outerSplitview.getViewCachedVisibleSize(this._leftIndex);
|
|
15772
|
+
case "right": return this._rightIndex === void 0 ? void 0 : this._outerSplitview.getViewCachedVisibleSize(this._rightIndex);
|
|
15773
|
+
case "top":
|
|
15774
|
+
case "bottom": return this._middleColumn.getViewCachedVisibleSize(position);
|
|
15695
15775
|
}
|
|
15696
|
-
return edgeGroups;
|
|
15697
15776
|
}
|
|
15698
15777
|
fromJSON(data) {
|
|
15699
|
-
for (const position of
|
|
15700
|
-
"left",
|
|
15701
|
-
"right",
|
|
15702
|
-
"top",
|
|
15703
|
-
"bottom"
|
|
15704
|
-
]) {
|
|
15778
|
+
for (const position of EDGE_POSITIONS) {
|
|
15705
15779
|
var _state$collapsed;
|
|
15706
15780
|
const state = data[position];
|
|
15707
15781
|
const view = this._getView(position);
|
|
@@ -16412,6 +16486,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16412
16486
|
this.disableResizing = true;
|
|
16413
16487
|
this.element.remove();
|
|
16414
16488
|
this._shellManager = new ShellManager(container, this.element, (w, h) => this._layoutFromShell(w, h), (_options$theme$gap2 = (_options$theme2 = options.theme) === null || _options$theme2 === void 0 ? void 0 : _options$theme2.gap) !== null && _options$theme$gap2 !== void 0 ? _options$theme$gap2 : 0, (_options$theme3 = options.theme) === null || _options$theme3 === void 0 ? void 0 : _options$theme3.edgeGroupCollapsedSize);
|
|
16489
|
+
this._shellManager.locked = !!options.locked;
|
|
16415
16490
|
this.popupService.updateRoot(this._shellManager.element);
|
|
16416
16491
|
this._shellThemeClassnames = new Classnames(this._shellManager.element);
|
|
16417
16492
|
this.rootDropTargetContainer = new DropTargetAnchorContainer(this._shellManager.element, { disabled: true });
|
|
@@ -16520,7 +16595,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16520
16595
|
const service = assertModule(this._popoutWindowService, "PopoutWindow", "api.addPopoutGroup");
|
|
16521
16596
|
if (!service) return Promise.resolve(false);
|
|
16522
16597
|
if (itemToPopout instanceof DockviewGroupPanel && itemToPopout.model.location.type === "edge") return Promise.resolve(false);
|
|
16523
|
-
if (itemToPopout instanceof DockviewPanel && itemToPopout.group.size === 1) return this.addPopoutGroup(itemToPopout.group, options);
|
|
16598
|
+
if (itemToPopout instanceof DockviewPanel && itemToPopout.group.size === 1 && this.closeEmptyGroups) return this.addPopoutGroup(itemToPopout.group, options);
|
|
16524
16599
|
const theme = getDockviewTheme(this.gridview.element);
|
|
16525
16600
|
const element = this.element;
|
|
16526
16601
|
function getBox() {
|
|
@@ -16609,7 +16684,8 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16609
16684
|
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
|
|
16610
16685
|
group.model.renderContainer = overlayRenderContainer;
|
|
16611
16686
|
const popoutGridview = (_options$overridePopo4 = options === null || options === void 0 ? void 0 : options.overridePopoutGridview) !== null && _options$overridePopo4 !== void 0 ? _options$overridePopo4 : this.createNestedGridview();
|
|
16612
|
-
if (
|
|
16687
|
+
if (options === null || options === void 0 ? void 0 : options.overridePopoutGridview) popoutGridview.locked = this.gridview.locked;
|
|
16688
|
+
else popoutGridview.addView(group, Sizing.Distribute, [0]);
|
|
16613
16689
|
popoutGridview.element.style.width = "100%";
|
|
16614
16690
|
popoutGridview.element.style.height = "100%";
|
|
16615
16691
|
popoutGridview.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
@@ -17004,8 +17080,35 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
17004
17080
|
});
|
|
17005
17081
|
for (const { panel, from } of movedPanels) this.fireDidMovePanel(panel, from);
|
|
17006
17082
|
}
|
|
17083
|
+
/** The `closeEmptyGroups` option: remove a group once it empties. */
|
|
17084
|
+
get closeEmptyGroups() {
|
|
17085
|
+
return this.options.closeEmptyGroups !== false;
|
|
17086
|
+
}
|
|
17087
|
+
/** Whether a move leaves its emptied source group in place. */
|
|
17088
|
+
keepEmptyGroups(options) {
|
|
17089
|
+
var _options$keepEmptyGro;
|
|
17090
|
+
return (_options$keepEmptyGro = options.keepEmptyGroups) !== null && _options$keepEmptyGro !== void 0 ? _options$keepEmptyGro : !this.closeEmptyGroups;
|
|
17091
|
+
}
|
|
17007
17092
|
removeGroupIfEmpty(group) {
|
|
17008
|
-
if (group.model.size === 0) this.doRemoveGroup(group, { skipActive: true });
|
|
17093
|
+
if (group.model.size === 0 && this.closeEmptyGroups) this.doRemoveGroup(group, { skipActive: true });
|
|
17094
|
+
}
|
|
17095
|
+
/**
|
|
17096
|
+
* Locks the main grid, the shell whose splitviews host the edge groups,
|
|
17097
|
+
* and the nested gridviews of floating and popout windows. The base
|
|
17098
|
+
* setter stops at the main grid; `updateOptions` reaches this override.
|
|
17099
|
+
*/
|
|
17100
|
+
get locked() {
|
|
17101
|
+
return this.gridview.locked;
|
|
17102
|
+
}
|
|
17103
|
+
set locked(value) {
|
|
17104
|
+
this.gridview.locked = value;
|
|
17105
|
+
if (this._shellManager) this._shellManager.locked = value;
|
|
17106
|
+
for (const gridview of this.nestedGridviews()) gridview.locked = value;
|
|
17107
|
+
}
|
|
17108
|
+
/** The gridviews hosted by open floating and popout windows. */
|
|
17109
|
+
nestedGridviews() {
|
|
17110
|
+
var _this$_popoutWindowSe9, _this$_popoutWindowSe10;
|
|
17111
|
+
return [...this.floatingGroups.map((floating) => floating.gridview), ...((_this$_popoutWindowSe9 = (_this$_popoutWindowSe10 = this._popoutWindowService) === null || _this$_popoutWindowSe10 === void 0 ? void 0 : _this$_popoutWindowSe10.entries) !== null && _this$_popoutWindowSe9 !== void 0 ? _this$_popoutWindowSe9 : []).map((entry) => entry.gridview)];
|
|
17009
17112
|
}
|
|
17010
17113
|
/**
|
|
17011
17114
|
* Build an empty gridview configured to match the main grid's styling and
|
|
@@ -17014,7 +17117,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
17014
17117
|
*/
|
|
17015
17118
|
createNestedGridview(orientation = "HORIZONTAL") {
|
|
17016
17119
|
var _this$options$theme$g, _this$options$theme2;
|
|
17017
|
-
return new Gridview(this.gridview.proportionalLayout, this.options.hideBorders ? { separatorBorder: "transparent" } : void 0, orientation,
|
|
17120
|
+
return new Gridview(this.gridview.proportionalLayout, this.options.hideBorders ? { separatorBorder: "transparent" } : void 0, orientation, this.gridview.locked, (_this$options$theme$g = (_this$options$theme2 = this.options.theme) === null || _this$options$theme2 === void 0 ? void 0 : _this$options$theme2.gap) !== null && _this$options$theme$g !== void 0 ? _this$options$theme$g : 0);
|
|
17018
17121
|
}
|
|
17019
17122
|
/**
|
|
17020
17123
|
* Wrap a (populated) floating gridview in an overlay window: title bar /
|
|
@@ -17088,10 +17191,8 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
17088
17191
|
const newDndStrategy = this.options.dndStrategy;
|
|
17089
17192
|
if (oldDisableDnd !== newDisableDnd || oldDndStrategy !== newDndStrategy) this.updateDragAndDropState();
|
|
17090
17193
|
if ("proportionalLayout" in options) {
|
|
17091
|
-
var _this$_popoutWindowSe9, _this$_popoutWindowSe10;
|
|
17092
17194
|
const proportionalLayout = this.gridview.proportionalLayout;
|
|
17093
|
-
for (const
|
|
17094
|
-
for (const entry of (_this$_popoutWindowSe9 = (_this$_popoutWindowSe10 = this._popoutWindowService) === null || _this$_popoutWindowSe10 === void 0 ? void 0 : _this$_popoutWindowSe10.entries) !== null && _this$_popoutWindowSe9 !== void 0 ? _this$_popoutWindowSe9 : []) entry.gridview.proportionalLayout = proportionalLayout;
|
|
17195
|
+
for (const gridview of this.nestedGridviews()) gridview.proportionalLayout = proportionalLayout;
|
|
17095
17196
|
}
|
|
17096
17197
|
if ("theme" in options) this.updateTheme();
|
|
17097
17198
|
if ("createRightHeaderActionComponent" in options || "createLeftHeaderActionComponent" in options || "createPrefixHeaderActionComponent" in options) {
|
|
@@ -17160,7 +17261,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
17160
17261
|
const resizeDisposable = group.onDidChange((event) => {
|
|
17161
17262
|
var _this$_shellManager3;
|
|
17162
17263
|
if (!event) return;
|
|
17163
|
-
const size = position
|
|
17264
|
+
const size = isHorizontal(position) ? event.width : event.height;
|
|
17164
17265
|
if (typeof size !== "number") return;
|
|
17165
17266
|
(_this$_shellManager3 = this._shellManager) === null || _this$_shellManager3 === void 0 || _this$_shellManager3.resizeEdgeGroup(position, size);
|
|
17166
17267
|
});
|
|
@@ -17838,9 +17939,12 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
17838
17939
|
}
|
|
17839
17940
|
closeAllGroups() {
|
|
17840
17941
|
this.mutation("remove", () => {
|
|
17841
|
-
|
|
17842
|
-
|
|
17843
|
-
|
|
17942
|
+
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
17943
|
+
for (const group of groups) {
|
|
17944
|
+
if (!this._groups.has(group.id)) continue;
|
|
17945
|
+
group.model.closeAllPanels();
|
|
17946
|
+
const keepLast = this.options.noPanelsOverlay === "emptyGroup" && this._groups.size === 1;
|
|
17947
|
+
if (!this.closeEmptyGroups && !keepLast && this._groups.has(group.id) && group.model.size === 0) this.removeGroup(group, { skipActive: true });
|
|
17844
17948
|
}
|
|
17845
17949
|
});
|
|
17846
17950
|
}
|
|
@@ -17965,7 +18069,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
17965
18069
|
this.mutation("remove", () => {
|
|
17966
18070
|
var _options$removeEmptyG;
|
|
17967
18071
|
return this._doRemovePanel(panel, {
|
|
17968
|
-
removeEmptyGroup: (_options$removeEmptyG = options === null || options === void 0 ? void 0 : options.removeEmptyGroup) !== null && _options$removeEmptyG !== void 0 ? _options$removeEmptyG :
|
|
18072
|
+
removeEmptyGroup: (_options$removeEmptyG = options === null || options === void 0 ? void 0 : options.removeEmptyGroup) !== null && _options$removeEmptyG !== void 0 ? _options$removeEmptyG : this.closeEmptyGroups,
|
|
17969
18073
|
skipDispose: options === null || options === void 0 ? void 0 : options.skipDispose,
|
|
17970
18074
|
skipSetActiveGroup: options === null || options === void 0 ? void 0 : options.skipSetActiveGroup
|
|
17971
18075
|
});
|
|
@@ -18121,7 +18225,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18121
18225
|
if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
|
|
18122
18226
|
if (!(options === null || options === void 0 ? void 0 : options.skipPopoutAssociated)) {
|
|
18123
18227
|
const refGroup = selectedGroup.referenceGroup ? this.getPanel(selectedGroup.referenceGroup) : void 0;
|
|
18124
|
-
if ((refGroup === null || refGroup === void 0 ? void 0 : refGroup.panels.length) === 0) this.removeGroup(refGroup);
|
|
18228
|
+
if ((refGroup === null || refGroup === void 0 ? void 0 : refGroup.panels.length) === 0 && (this.closeEmptyGroups || !refGroup.api.isVisible)) this.removeGroup(refGroup);
|
|
18125
18229
|
}
|
|
18126
18230
|
selectedGroup.popoutGroup.dispose();
|
|
18127
18231
|
this._groups.delete(group.id);
|
|
@@ -18381,7 +18485,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18381
18485
|
skipSetActiveGroup: true
|
|
18382
18486
|
}));
|
|
18383
18487
|
if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
18384
|
-
if (!
|
|
18488
|
+
if (!this.keepEmptyGroups(options) && sourceGroup.model.size === 0 && sourceGroup !== destinationGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18385
18489
|
const isDestinationGroupEmpty = destinationGroup.model.size === 0;
|
|
18386
18490
|
this.movingLock(() => {
|
|
18387
18491
|
var _options$skipSetActiv;
|
|
@@ -18401,10 +18505,12 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18401
18505
|
const destinationGridview = this.getGridviewForGroup(destinationGroup);
|
|
18402
18506
|
const referenceLocation = getGridLocation(destinationGroup.element);
|
|
18403
18507
|
const targetLocation = getRelativeLocation(destinationGridview.orientation, referenceLocation, destinationTarget);
|
|
18404
|
-
if (sourceGroup.size < 2) {
|
|
18508
|
+
if (sourceGroup.size < 2 && !this.keepEmptyGroups(options)) {
|
|
18405
18509
|
/**
|
|
18406
18510
|
* If we are moving from a group which only has one panel left we will consider
|
|
18407
|
-
* moving the group itself rather than moving the panel into a newly created group
|
|
18511
|
+
* moving the group itself rather than moving the panel into a newly created group.
|
|
18512
|
+
* When empty groups are kept the group must stay where it is, so the panel is
|
|
18513
|
+
* moved into a newly created group like any other panel.
|
|
18408
18514
|
*/
|
|
18409
18515
|
const [targetParentLocation, to] = tail(targetLocation);
|
|
18410
18516
|
if (sourceGroup.api.location.type === "grid" && destinationGridview === this.gridview) {
|
|
@@ -18529,7 +18635,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18529
18635
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
18530
18636
|
targetGroup = this.createGroupAtLocation(dropLocation, this.dropSizing(referenceLocation));
|
|
18531
18637
|
}
|
|
18532
|
-
if (!
|
|
18638
|
+
if (!this.keepEmptyGroups(options) && sourceGroup.model.size === 0 && sourceGroup !== targetGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18533
18639
|
addPanelsToGroup(targetGroup);
|
|
18534
18640
|
}
|
|
18535
18641
|
moveGroup(options) {
|
|
@@ -18856,13 +18962,12 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18856
18962
|
return location.length % 2 == 1 ? rootOrientation : orthogonal(rootOrientation);
|
|
18857
18963
|
}
|
|
18858
18964
|
updateTheme() {
|
|
18859
|
-
var _this$_options$theme, _this$_shellThemeClas, _theme$gap, _this$
|
|
18965
|
+
var _this$_options$theme, _this$_shellThemeClas, _theme$gap, _this$_shellManager5, _theme$edgeGroupColla, _theme$tabGroupIndica;
|
|
18860
18966
|
const theme = (_this$_options$theme = this._options.theme) !== null && _this$_options$theme !== void 0 ? _this$_options$theme : themeAbyss;
|
|
18861
18967
|
(_this$_shellThemeClas = this._shellThemeClassnames) === null || _this$_shellThemeClas === void 0 || _this$_shellThemeClas.setClassNames(theme.className);
|
|
18862
18968
|
const gap = (_theme$gap = theme.gap) !== null && _theme$gap !== void 0 ? _theme$gap : 0;
|
|
18863
18969
|
this.gridview.margin = gap;
|
|
18864
|
-
for (const
|
|
18865
|
-
for (const entry of (_this$_popoutWindowSe25 = (_this$_popoutWindowSe26 = this._popoutWindowService) === null || _this$_popoutWindowSe26 === void 0 ? void 0 : _this$_popoutWindowSe26.entries) !== null && _this$_popoutWindowSe25 !== void 0 ? _this$_popoutWindowSe25 : []) entry.gridview.margin = gap;
|
|
18970
|
+
for (const gridview of this.nestedGridviews()) gridview.margin = gap;
|
|
18866
18971
|
(_this$_shellManager5 = this._shellManager) === null || _this$_shellManager5 === void 0 || _this$_shellManager5.updateTheme(gap, (_theme$edgeGroupColla = theme.edgeGroupCollapsedSize) !== null && _theme$edgeGroupColla !== void 0 ? _theme$edgeGroupColla : 35);
|
|
18867
18972
|
if (theme.dndOverlayBorder === void 0) {
|
|
18868
18973
|
var _this$_shellManager6;
|