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