dockview-core 8.0.0 → 8.1.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/dnd/dataTransfer.d.ts +1 -0
- package/dist/cjs/dockview/advancedDnDService.d.ts +3 -18
- package/dist/cjs/dockview/dockviewComponent.d.ts +9 -5
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +24 -0
- package/dist/cjs/dockview/moduleContracts.d.ts +5 -0
- package/dist/cjs/dockview/options.d.ts +0 -1
- package/dist/cjs/dockview/tabGroup.d.ts +3 -0
- package/dist/cjs/events.d.ts +1 -1
- package/dist/cjs/gridview/branchNode.d.ts +16 -0
- package/dist/cjs/scrollbar.d.ts +10 -0
- package/dist/cjs/splitview/viewItem.d.ts +10 -0
- package/dist/dockview-core.js +276 -154
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.noStyle.js +276 -154
- package/dist/package/main.cjs.js +276 -154
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +276 -154
- package/package.json +1 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 8.
|
|
3
|
+
* @version 8.1.0
|
|
4
4
|
* @link https://github.com/dockview/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
7
|
//#region src/dnd/dataTransfer.ts
|
|
8
8
|
var _LocalSelectionTransfer;
|
|
9
|
-
var TransferObject = class {
|
|
9
|
+
var TransferObject = class {
|
|
10
|
+
constructor() {}
|
|
11
|
+
};
|
|
10
12
|
var PanelTransfer = class extends TransferObject {
|
|
11
13
|
constructor(viewId, groupId, panelId, tabGroupId) {
|
|
12
14
|
super();
|
|
@@ -199,7 +201,6 @@ var Emitter = class Emitter {
|
|
|
199
201
|
this.options = options;
|
|
200
202
|
this._listeners = [];
|
|
201
203
|
this._disposed = false;
|
|
202
|
-
this._pauseTokens = /* @__PURE__ */ new Set();
|
|
203
204
|
}
|
|
204
205
|
get event() {
|
|
205
206
|
if (!this._event) {
|
|
@@ -220,14 +221,26 @@ var Emitter = class Emitter {
|
|
|
220
221
|
}
|
|
221
222
|
fire(e) {
|
|
222
223
|
var _this$options2;
|
|
223
|
-
if (this._pauseTokens.size > 0) return;
|
|
224
|
+
if (this._pauseTokens !== void 0 && this._pauseTokens.size > 0) return;
|
|
224
225
|
if ((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.replay) this._last = e;
|
|
225
|
-
|
|
226
|
+
const listeners = this._listeners;
|
|
227
|
+
const length = listeners.length;
|
|
228
|
+
if (length === 0) return;
|
|
229
|
+
if (length === 1) {
|
|
230
|
+
listeners[0].callback(e);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
for (const listener of listeners.slice()) listener.callback(e);
|
|
226
234
|
}
|
|
227
235
|
pause() {
|
|
236
|
+
var _this$_pauseTokens;
|
|
228
237
|
const token = {};
|
|
238
|
+
(_this$_pauseTokens = this._pauseTokens) !== null && _this$_pauseTokens !== void 0 || (this._pauseTokens = /* @__PURE__ */ new Set());
|
|
229
239
|
this._pauseTokens.add(token);
|
|
230
|
-
return Disposable.from(() =>
|
|
240
|
+
return Disposable.from(() => {
|
|
241
|
+
var _this$_pauseTokens2;
|
|
242
|
+
return (_this$_pauseTokens2 = this._pauseTokens) === null || _this$_pauseTokens2 === void 0 ? void 0 : _this$_pauseTokens2.delete(token);
|
|
243
|
+
});
|
|
231
244
|
}
|
|
232
245
|
dispose() {
|
|
233
246
|
if (!this._disposed) {
|
|
@@ -530,8 +543,10 @@ function onDidWindowMoveEnd(window) {
|
|
|
530
543
|
let previousScreenX = window.screenX;
|
|
531
544
|
let previousScreenY = window.screenY;
|
|
532
545
|
let timeout;
|
|
546
|
+
let rafHandle = 0;
|
|
547
|
+
let stopped = false;
|
|
533
548
|
const checkMovement = () => {
|
|
534
|
-
if (window.closed) return;
|
|
549
|
+
if (stopped || window.closed) return;
|
|
535
550
|
const currentScreenX = window.screenX;
|
|
536
551
|
const currentScreenY = window.screenY;
|
|
537
552
|
if (currentScreenX !== previousScreenX || currentScreenY !== previousScreenY) {
|
|
@@ -542,9 +557,18 @@ function onDidWindowMoveEnd(window) {
|
|
|
542
557
|
previousScreenX = currentScreenX;
|
|
543
558
|
previousScreenY = currentScreenY;
|
|
544
559
|
}
|
|
545
|
-
requestAnimationFrame(checkMovement);
|
|
560
|
+
rafHandle = requestAnimationFrame(checkMovement);
|
|
546
561
|
};
|
|
547
562
|
checkMovement();
|
|
563
|
+
const disposeEmitter = emitter.dispose.bind(emitter);
|
|
564
|
+
emitter.dispose = () => {
|
|
565
|
+
if (!stopped) {
|
|
566
|
+
stopped = true;
|
|
567
|
+
cancelAnimationFrame(rafHandle);
|
|
568
|
+
clearTimeout(timeout);
|
|
569
|
+
}
|
|
570
|
+
disposeEmitter();
|
|
571
|
+
};
|
|
548
572
|
return emitter;
|
|
549
573
|
}
|
|
550
574
|
function onDidWindowResizeEnd(element, cb) {
|
|
@@ -680,6 +704,11 @@ var ViewItem = class {
|
|
|
680
704
|
set size(size) {
|
|
681
705
|
this._size = size;
|
|
682
706
|
}
|
|
707
|
+
setContainerGeometry(prop, value) {
|
|
708
|
+
if (this._appliedStyles[prop] === value) return;
|
|
709
|
+
this._appliedStyles[prop] = value;
|
|
710
|
+
this.container.style[prop] = value;
|
|
711
|
+
}
|
|
683
712
|
get size() {
|
|
684
713
|
return this._size;
|
|
685
714
|
}
|
|
@@ -715,6 +744,7 @@ var ViewItem = class {
|
|
|
715
744
|
this.view = view;
|
|
716
745
|
this.disposable = disposable;
|
|
717
746
|
this._cachedVisibleSize = void 0;
|
|
747
|
+
this._appliedStyles = {};
|
|
718
748
|
if (typeof size === "number") {
|
|
719
749
|
this._size = size;
|
|
720
750
|
this._cachedVisibleSize = void 0;
|
|
@@ -763,6 +793,16 @@ let LayoutPriority = /* @__PURE__ */ function(LayoutPriority) {
|
|
|
763
793
|
LayoutPriority["Normal"] = "normal";
|
|
764
794
|
return LayoutPriority;
|
|
765
795
|
}({});
|
|
796
|
+
function setSashPosition(sash, left, top) {
|
|
797
|
+
if (sash.appliedLeft !== left) {
|
|
798
|
+
sash.appliedLeft = left;
|
|
799
|
+
sash.container.style.left = left;
|
|
800
|
+
}
|
|
801
|
+
if (sash.appliedTop !== top) {
|
|
802
|
+
sash.appliedTop = top;
|
|
803
|
+
sash.container.style.top = top;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
766
806
|
let Sizing;
|
|
767
807
|
(function(_Sizing) {
|
|
768
808
|
_Sizing.Distribute = { type: "distribute" };
|
|
@@ -881,10 +921,6 @@ var Splitview = class {
|
|
|
881
921
|
pushToEnd(upIndexes, i);
|
|
882
922
|
pushToEnd(downIndexes, i);
|
|
883
923
|
}
|
|
884
|
-
const upItems = upIndexes.map((i) => this.viewItems[i]);
|
|
885
|
-
const upSizes = upIndexes.map((i) => sizes[i]);
|
|
886
|
-
const downItems = downIndexes.map((i) => this.viewItems[i]);
|
|
887
|
-
const downSizes = downIndexes.map((i) => sizes[i]);
|
|
888
924
|
const minDeltaUp = upIndexes.reduce((_, i) => _ + this.viewItems[i].minimumSize - sizes[i], 0);
|
|
889
925
|
const maxDeltaUp = upIndexes.reduce((_, i) => _ + this.viewItems[i].maximumSize - sizes[i], 0);
|
|
890
926
|
const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((_, i) => _ + sizes[i] - this.viewItems[i].minimumSize, 0);
|
|
@@ -908,19 +944,21 @@ var Splitview = class {
|
|
|
908
944
|
const tentativeDelta = clamp(delta, minDelta, maxDelta);
|
|
909
945
|
let actualDelta = 0;
|
|
910
946
|
let deltaUp = tentativeDelta;
|
|
911
|
-
for (
|
|
912
|
-
const item =
|
|
913
|
-
const
|
|
914
|
-
const
|
|
947
|
+
for (const upIndex of upIndexes) {
|
|
948
|
+
const item = this.viewItems[upIndex];
|
|
949
|
+
const priorSize = sizes[upIndex];
|
|
950
|
+
const size = clamp(priorSize + deltaUp, item.minimumSize, item.maximumSize);
|
|
951
|
+
const viewDelta = size - priorSize;
|
|
915
952
|
actualDelta += viewDelta;
|
|
916
953
|
deltaUp -= viewDelta;
|
|
917
954
|
item.size = size;
|
|
918
955
|
}
|
|
919
956
|
let deltaDown = actualDelta;
|
|
920
|
-
for (
|
|
921
|
-
const item =
|
|
922
|
-
const
|
|
923
|
-
const
|
|
957
|
+
for (const downIndex of downIndexes) {
|
|
958
|
+
const item = this.viewItems[downIndex];
|
|
959
|
+
const priorSize = sizes[downIndex];
|
|
960
|
+
const size = clamp(priorSize - deltaDown, item.minimumSize, item.maximumSize);
|
|
961
|
+
const viewDelta = size - priorSize;
|
|
924
962
|
deltaDown += viewDelta;
|
|
925
963
|
item.size = size;
|
|
926
964
|
}
|
|
@@ -1168,13 +1206,22 @@ var Splitview = class {
|
|
|
1168
1206
|
this.saveProportions();
|
|
1169
1207
|
}
|
|
1170
1208
|
distributeEmptySpace(lowPriorityIndex) {
|
|
1171
|
-
|
|
1209
|
+
let contentSize = 0;
|
|
1210
|
+
for (const item of this.viewItems) contentSize += item.size;
|
|
1172
1211
|
let emptyDelta = this.size - contentSize;
|
|
1212
|
+
if (emptyDelta === 0) return;
|
|
1173
1213
|
const indexes = range(this.viewItems.length - 1, -1);
|
|
1174
|
-
|
|
1175
|
-
const
|
|
1176
|
-
|
|
1177
|
-
|
|
1214
|
+
let hasPriority = false;
|
|
1215
|
+
for (const item of this.viewItems) if (item.priority === "low" || item.priority === "high") {
|
|
1216
|
+
hasPriority = true;
|
|
1217
|
+
break;
|
|
1218
|
+
}
|
|
1219
|
+
if (hasPriority) {
|
|
1220
|
+
const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "low");
|
|
1221
|
+
const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "high");
|
|
1222
|
+
for (const index of highPriorityIndexes) pushToStart(indexes, index);
|
|
1223
|
+
for (const index of lowPriorityIndexes) pushToEnd(indexes, index);
|
|
1224
|
+
}
|
|
1178
1225
|
if (typeof lowPriorityIndex === "number") pushToEnd(indexes, lowPriorityIndex);
|
|
1179
1226
|
for (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) {
|
|
1180
1227
|
const item = this.viewItems[indexes[i]];
|
|
@@ -1197,49 +1244,45 @@ var Splitview = class {
|
|
|
1197
1244
|
* For each view `i` the offet must be adjusted by `m * i/(n - 1)`.
|
|
1198
1245
|
*/
|
|
1199
1246
|
layoutViews() {
|
|
1200
|
-
|
|
1247
|
+
let contentSize = 0;
|
|
1248
|
+
let visibleViewCount = 0;
|
|
1249
|
+
for (const item of this.viewItems) {
|
|
1250
|
+
contentSize += item.size;
|
|
1251
|
+
if (item.visible) visibleViewCount++;
|
|
1252
|
+
}
|
|
1253
|
+
this._contentSize = contentSize;
|
|
1201
1254
|
this.updateSashEnablement();
|
|
1202
1255
|
if (this.viewItems.length === 0) return;
|
|
1203
|
-
const
|
|
1204
|
-
const
|
|
1205
|
-
const marginReducedSize = this.margin * sashCount / Math.max(1, visibleViewItems.length);
|
|
1256
|
+
const sashCount = Math.max(0, visibleViewCount - 1);
|
|
1257
|
+
const marginReducedSize = this.margin * sashCount / Math.max(1, visibleViewCount);
|
|
1206
1258
|
let totalLeftOffset = 0;
|
|
1207
1259
|
const viewLeftOffsets = [];
|
|
1208
1260
|
const sashWidth = 4;
|
|
1209
|
-
|
|
1210
|
-
const flag = viewItem.visible ? 1 : 0;
|
|
1211
|
-
if (i === 0) arr.push(flag);
|
|
1212
|
-
else arr.push(arr[i - 1] + flag);
|
|
1213
|
-
return arr;
|
|
1214
|
-
}, []);
|
|
1261
|
+
let runningVisiblePanelCount = 0;
|
|
1215
1262
|
this.viewItems.forEach((view, i) => {
|
|
1216
1263
|
totalLeftOffset += this.viewItems[i].size;
|
|
1217
1264
|
viewLeftOffsets.push(totalLeftOffset);
|
|
1265
|
+
runningVisiblePanelCount += view.visible ? 1 : 0;
|
|
1218
1266
|
const size = view.visible ? view.size - marginReducedSize : 0;
|
|
1219
|
-
const visiblePanelsBeforeThisView = Math.max(0, runningVisiblePanelCount
|
|
1267
|
+
const visiblePanelsBeforeThisView = Math.max(0, runningVisiblePanelCount - 1);
|
|
1220
1268
|
const offset = i === 0 || visiblePanelsBeforeThisView === 0 ? 0 : viewLeftOffsets[i - 1] + visiblePanelsBeforeThisView / sashCount * marginReducedSize;
|
|
1221
1269
|
if (i < this.viewItems.length - 1) {
|
|
1222
1270
|
const newSize = view.visible ? offset + size - sashWidth / 2 + this.margin / 2 : offset;
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
}
|
|
1227
|
-
if (this._orientation === "VERTICAL") {
|
|
1228
|
-
this.sashes[i].container.style.left = `0px`;
|
|
1229
|
-
this.sashes[i].container.style.top = `${newSize}px`;
|
|
1230
|
-
}
|
|
1271
|
+
const sash = this.sashes[i];
|
|
1272
|
+
if (this._orientation === "HORIZONTAL") setSashPosition(sash, `${newSize}px`, `0px`);
|
|
1273
|
+
if (this._orientation === "VERTICAL") setSashPosition(sash, `0px`, `${newSize}px`);
|
|
1231
1274
|
}
|
|
1232
1275
|
if (this._orientation === "HORIZONTAL") {
|
|
1233
|
-
view.
|
|
1234
|
-
view.
|
|
1235
|
-
view.
|
|
1236
|
-
view.
|
|
1276
|
+
view.setContainerGeometry("width", `${size}px`);
|
|
1277
|
+
view.setContainerGeometry("left", `${offset}px`);
|
|
1278
|
+
view.setContainerGeometry("top", "");
|
|
1279
|
+
view.setContainerGeometry("height", "");
|
|
1237
1280
|
}
|
|
1238
1281
|
if (this._orientation === "VERTICAL") {
|
|
1239
|
-
view.
|
|
1240
|
-
view.
|
|
1241
|
-
view.
|
|
1242
|
-
view.
|
|
1282
|
+
view.setContainerGeometry("height", `${size}px`);
|
|
1283
|
+
view.setContainerGeometry("top", `${offset}px`);
|
|
1284
|
+
view.setContainerGeometry("width", "");
|
|
1285
|
+
view.setContainerGeometry("left", "");
|
|
1243
1286
|
}
|
|
1244
1287
|
view.view.layout(view.size - marginReducedSize, this._orthogonalSize);
|
|
1245
1288
|
});
|
|
@@ -1257,6 +1300,7 @@ var Splitview = class {
|
|
|
1257
1300
|
}
|
|
1258
1301
|
}
|
|
1259
1302
|
updateSashEnablement() {
|
|
1303
|
+
if (this.sashes.length === 0) return;
|
|
1260
1304
|
let previous = false;
|
|
1261
1305
|
const collapsesDown = this.viewItems.map((i) => previous = i.size - i.minimumSize > 0 || previous);
|
|
1262
1306
|
previous = false;
|
|
@@ -1563,10 +1607,20 @@ var BranchNode = class BranchNode extends CompositeDisposable {
|
|
|
1563
1607
|
return this.orientation === "HORIZONTAL" ? this.orthogonalSize : this.size;
|
|
1564
1608
|
}
|
|
1565
1609
|
get minimumSize() {
|
|
1566
|
-
|
|
1610
|
+
if (this._cachedMinimumSize === void 0) {
|
|
1611
|
+
let value = 0;
|
|
1612
|
+
for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.max(value, this.children[index].minimumOrthogonalSize);
|
|
1613
|
+
this._cachedMinimumSize = value;
|
|
1614
|
+
}
|
|
1615
|
+
return this._cachedMinimumSize;
|
|
1567
1616
|
}
|
|
1568
1617
|
get maximumSize() {
|
|
1569
|
-
|
|
1618
|
+
if (this._cachedMaximumSize === void 0) {
|
|
1619
|
+
let value = Number.POSITIVE_INFINITY;
|
|
1620
|
+
for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.min(value, this.children[index].maximumOrthogonalSize);
|
|
1621
|
+
this._cachedMaximumSize = value;
|
|
1622
|
+
}
|
|
1623
|
+
return this._cachedMaximumSize;
|
|
1570
1624
|
}
|
|
1571
1625
|
get minimumOrthogonalSize() {
|
|
1572
1626
|
return this.splitview.minimumSize;
|
|
@@ -1593,15 +1647,29 @@ var BranchNode = class BranchNode extends CompositeDisposable {
|
|
|
1593
1647
|
return this.orientation === "HORIZONTAL" ? this.maximumSize : this.maximumOrthogonalSize;
|
|
1594
1648
|
}
|
|
1595
1649
|
get priority() {
|
|
1650
|
+
var _this$_cachedPriority;
|
|
1651
|
+
(_this$_cachedPriority = this._cachedPriority) !== null && _this$_cachedPriority !== void 0 || (this._cachedPriority = this.computePriority());
|
|
1652
|
+
return this._cachedPriority;
|
|
1653
|
+
}
|
|
1654
|
+
computePriority() {
|
|
1596
1655
|
if (this.children.length === 0) return "normal";
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1656
|
+
let hasHigh = false;
|
|
1657
|
+
let hasLow = false;
|
|
1658
|
+
for (const child of this.children) {
|
|
1659
|
+
var _child$priority;
|
|
1660
|
+
const priority = (_child$priority = child.priority) !== null && _child$priority !== void 0 ? _child$priority : "normal";
|
|
1661
|
+
if (priority === "high") hasHigh = true;
|
|
1662
|
+
else if (priority === "low") hasLow = true;
|
|
1663
|
+
}
|
|
1664
|
+
if (hasHigh) return "high";
|
|
1665
|
+
else if (hasLow) return "low";
|
|
1603
1666
|
return "normal";
|
|
1604
1667
|
}
|
|
1668
|
+
invalidateCachedSizes() {
|
|
1669
|
+
this._cachedMinimumSize = void 0;
|
|
1670
|
+
this._cachedMaximumSize = void 0;
|
|
1671
|
+
this._cachedPriority = void 0;
|
|
1672
|
+
}
|
|
1605
1673
|
get disabled() {
|
|
1606
1674
|
return this.splitview.disabled;
|
|
1607
1675
|
}
|
|
@@ -1677,6 +1745,7 @@ var BranchNode = class BranchNode extends CompositeDisposable {
|
|
|
1677
1745
|
if (this.splitview.isViewVisible(index) === visible) return;
|
|
1678
1746
|
const wereAllChildrenHidden = this.splitview.contentSize === 0;
|
|
1679
1747
|
this.splitview.setViewVisible(index, visible);
|
|
1748
|
+
this.invalidateCachedSizes();
|
|
1680
1749
|
const areAllChildrenHidden = this.splitview.contentSize === 0;
|
|
1681
1750
|
if (visible && wereAllChildrenHidden || !visible && areAllChildrenHidden) this._onDidVisibilityChange.fire({ visible });
|
|
1682
1751
|
}
|
|
@@ -1725,12 +1794,14 @@ var BranchNode = class BranchNode extends CompositeDisposable {
|
|
|
1725
1794
|
return child;
|
|
1726
1795
|
}
|
|
1727
1796
|
setupChildrenEvents() {
|
|
1797
|
+
this.invalidateCachedSizes();
|
|
1728
1798
|
this._childrenDisposable.dispose();
|
|
1729
1799
|
this._childrenDisposable = new CompositeDisposable(Event.any(...this.children.map((c) => c.onDidChange))((e) => {
|
|
1730
1800
|
/**
|
|
1731
1801
|
* indicate a change has occured to allows any re-rendering but don't bubble
|
|
1732
1802
|
* event because that was specific to this branch
|
|
1733
1803
|
*/
|
|
1804
|
+
this.invalidateCachedSizes();
|
|
1734
1805
|
this._onDidChange.fire({ size: e.orthogonalSize });
|
|
1735
1806
|
}), ...this.children.map((c, i) => {
|
|
1736
1807
|
if (c instanceof BranchNode) return c.onDidVisibilityChange(({ visible }) => {
|
|
@@ -3407,7 +3478,7 @@ var DockviewApi = class {
|
|
|
3407
3478
|
* Add a group and return the created object.
|
|
3408
3479
|
*/
|
|
3409
3480
|
addGroup(options) {
|
|
3410
|
-
return this.component.addGroup(options);
|
|
3481
|
+
return this.component.withOrigin("api", () => this.component.addGroup(options));
|
|
3411
3482
|
}
|
|
3412
3483
|
/**
|
|
3413
3484
|
* Close all groups and panels.
|
|
@@ -3545,13 +3616,13 @@ var DockviewApi = class {
|
|
|
3545
3616
|
this.activatePrevious(options);
|
|
3546
3617
|
}
|
|
3547
3618
|
maximizeGroup(panel) {
|
|
3548
|
-
this.component.maximizeGroup(panel.group);
|
|
3619
|
+
this.component.withOrigin("api", () => this.component.maximizeGroup(panel.group));
|
|
3549
3620
|
}
|
|
3550
3621
|
hasMaximizedGroup() {
|
|
3551
3622
|
return this.component.hasMaximizedGroup();
|
|
3552
3623
|
}
|
|
3553
3624
|
exitMaximizedGroup() {
|
|
3554
|
-
this.component.exitMaximizedGroup();
|
|
3625
|
+
this.component.withOrigin("api", () => this.component.exitMaximizedGroup());
|
|
3555
3626
|
}
|
|
3556
3627
|
get onDidMaximizedGroupChange() {
|
|
3557
3628
|
return this.component.onDidMaximizedGroupChange;
|
|
@@ -5506,9 +5577,6 @@ var ContentContainer = class extends CompositeDisposable {
|
|
|
5506
5577
|
const doRender = ((_options$asActive = options === null || options === void 0 ? void 0 : options.asActive) !== null && _options$asActive !== void 0 ? _options$asActive : true) || this.panel && this.group.isPanelActive(this.panel);
|
|
5507
5578
|
if (((_this$panel = this.panel) === null || _this$panel === void 0 ? void 0 : _this$panel.view.content.element.parentElement) === this._element) {
|
|
5508
5579
|
var _this$panel$view$cont, _this$panel$view$cont2;
|
|
5509
|
-
/**
|
|
5510
|
-
* If the currently attached panel is mounted directly to the content then remove it
|
|
5511
|
-
*/
|
|
5512
5580
|
this.panel.view.content.element.remove();
|
|
5513
5581
|
(_this$panel$view$cont = (_this$panel$view$cont2 = this.panel.view.content).onHide) === null || _this$panel$view$cont === void 0 || _this$panel$view$cont.call(_this$panel$view$cont2);
|
|
5514
5582
|
}
|
|
@@ -6249,7 +6317,7 @@ var Scrollbar = class Scrollbar extends CompositeDisposable {
|
|
|
6249
6317
|
this.element.appendChild(this._scrollbar);
|
|
6250
6318
|
this.addDisposables(addDisposableListener(this.element, "wheel", (event) => {
|
|
6251
6319
|
this._scrollOffset += event.deltaY * Scrollbar.MouseWheelSpeed;
|
|
6252
|
-
this.
|
|
6320
|
+
this.scheduleStyleUpdate();
|
|
6253
6321
|
}), addDisposableListener(this._scrollbar, "pointerdown", (event) => {
|
|
6254
6322
|
var _this$_scrollbar$owne;
|
|
6255
6323
|
event.preventDefault();
|
|
@@ -6261,7 +6329,7 @@ var Scrollbar = class Scrollbar extends CompositeDisposable {
|
|
|
6261
6329
|
const delta = this._orientation === "horizontal" ? event.clientX - originalClient : event.clientY - originalClient;
|
|
6262
6330
|
const p = (this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight) / (this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight);
|
|
6263
6331
|
this._scrollOffset = originalScrollOffset + delta / p;
|
|
6264
|
-
this.
|
|
6332
|
+
this.scheduleStyleUpdate();
|
|
6265
6333
|
};
|
|
6266
6334
|
const onEnd = () => {
|
|
6267
6335
|
toggleClass(this.element, "dv-scrollable-scrolling", false);
|
|
@@ -6273,10 +6341,10 @@ var Scrollbar = class Scrollbar extends CompositeDisposable {
|
|
|
6273
6341
|
doc.addEventListener("pointerup", onEnd);
|
|
6274
6342
|
doc.addEventListener("pointercancel", onEnd);
|
|
6275
6343
|
}), addDisposableListener(this.element, "scroll", () => {
|
|
6276
|
-
this.
|
|
6344
|
+
this.scheduleStyleUpdate();
|
|
6277
6345
|
}), addDisposableListener(this.scrollableElement, "scroll", () => {
|
|
6278
6346
|
this._scrollOffset = this._orientation === "horizontal" ? this.scrollableElement.scrollLeft : this.scrollableElement.scrollTop;
|
|
6279
|
-
this.
|
|
6347
|
+
this.scheduleStyleUpdate();
|
|
6280
6348
|
}), watchElementResize(this.element, () => {
|
|
6281
6349
|
toggleClass(this.element, "dv-scrollable-resizing", true);
|
|
6282
6350
|
if (this._animationTimer) clearTimeout(this._animationTimer);
|
|
@@ -6284,9 +6352,29 @@ var Scrollbar = class Scrollbar extends CompositeDisposable {
|
|
|
6284
6352
|
clearTimeout(this._animationTimer);
|
|
6285
6353
|
toggleClass(this.element, "dv-scrollable-resizing", false);
|
|
6286
6354
|
}, 500);
|
|
6287
|
-
this.
|
|
6355
|
+
this.scheduleStyleUpdate();
|
|
6356
|
+
}), Disposable.from(() => {
|
|
6357
|
+
if (this._pendingStyleFrame !== void 0) {
|
|
6358
|
+
cancelAnimationFrame(this._pendingStyleFrame);
|
|
6359
|
+
this._pendingStyleFrame = void 0;
|
|
6360
|
+
}
|
|
6288
6361
|
}));
|
|
6289
6362
|
}
|
|
6363
|
+
/**
|
|
6364
|
+
* Coalesce the scrollbar restyle to one pass per animation frame. The
|
|
6365
|
+
* wheel / scroll / pointermove handlers can each fire many times per frame,
|
|
6366
|
+
* and `calculateScrollbarStyles` both reads layout (`clientWidth`/
|
|
6367
|
+
* `scrollWidth`) and writes styles + `scrollLeft`/`scrollTop`; running it
|
|
6368
|
+
* synchronously per event caused repeated read→write→read reflow. Batching
|
|
6369
|
+
* to a frame keeps a burst of events to a single measure+write.
|
|
6370
|
+
*/
|
|
6371
|
+
scheduleStyleUpdate() {
|
|
6372
|
+
if (this._pendingStyleFrame !== void 0) return;
|
|
6373
|
+
this._pendingStyleFrame = requestAnimationFrame(() => {
|
|
6374
|
+
this._pendingStyleFrame = void 0;
|
|
6375
|
+
this.calculateScrollbarStyles();
|
|
6376
|
+
});
|
|
6377
|
+
}
|
|
6290
6378
|
calculateScrollbarStyles() {
|
|
6291
6379
|
const clientSize = this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight;
|
|
6292
6380
|
const scrollSize = this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight;
|
|
@@ -8747,8 +8835,8 @@ var Tabs = class extends CompositeDisposable {
|
|
|
8747
8835
|
}, true), addDisposableListener(this._tabsList, "dragend", () => {
|
|
8748
8836
|
this._reorder.resetDragAnimation();
|
|
8749
8837
|
}), addDisposableListener(this._tabsList, "drop", (event) => {
|
|
8750
|
-
var _this$accessor$option, _this$group$model$dro;
|
|
8751
|
-
if (
|
|
8838
|
+
var _this$_animState3, _this$accessor$option, _this$group$model$dro;
|
|
8839
|
+
if (((_this$_animState3 = this._animState) === null || _this$_animState3 === void 0 ? void 0 : _this$_animState3.currentInsertionIndex) == null) return;
|
|
8752
8840
|
if (((_this$accessor$option = this.accessor.options.theme) === null || _this$accessor$option === void 0 ? void 0 : _this$accessor$option.tabAnimation) !== "smooth" && !this._animState.sourceTabGroupId) return;
|
|
8753
8841
|
event.stopPropagation();
|
|
8754
8842
|
event.preventDefault();
|
|
@@ -8953,7 +9041,7 @@ var Tabs = class extends CompositeDisposable {
|
|
|
8953
9041
|
};
|
|
8954
9042
|
this._pendingCollapse = true;
|
|
8955
9043
|
requestAnimationFrame(() => {
|
|
8956
|
-
var _this$
|
|
9044
|
+
var _this$_animState4, _this$_animState4$cur;
|
|
8957
9045
|
this._pendingCollapse = false;
|
|
8958
9046
|
if (!this._animState) return;
|
|
8959
9047
|
if (!this._tabsList.classList.contains("dv-tabs-container--wrap")) {
|
|
@@ -8961,7 +9049,7 @@ var Tabs = class extends CompositeDisposable {
|
|
|
8961
9049
|
toggleClass(tab.element, "dv-tab--dragging", true);
|
|
8962
9050
|
tab.element.offsetHeight;
|
|
8963
9051
|
}
|
|
8964
|
-
(_this$
|
|
9052
|
+
(_this$_animState4$cur = (_this$_animState4 = this._animState).currentInsertionIndex) !== null && _this$_animState4$cur !== void 0 || (_this$_animState4.currentInsertionIndex = sourceIndex);
|
|
8965
9053
|
this.applyDragOverTransforms(true);
|
|
8966
9054
|
tab.element.style.removeProperty("transition");
|
|
8967
9055
|
});
|
|
@@ -9050,8 +9138,8 @@ var Tabs = class extends CompositeDisposable {
|
|
|
9050
9138
|
}
|
|
9051
9139
|
}
|
|
9052
9140
|
delete(id) {
|
|
9053
|
-
var _this$
|
|
9054
|
-
if (((_this$
|
|
9141
|
+
var _this$_animState5;
|
|
9142
|
+
if (((_this$_animState5 = this._animState) === null || _this$_animState5 === void 0 ? void 0 : _this$_animState5.sourceTabId) === id) {
|
|
9055
9143
|
this.resetTabTransforms();
|
|
9056
9144
|
this._animState = null;
|
|
9057
9145
|
}
|
|
@@ -9168,7 +9256,7 @@ var Tabs = class extends CompositeDisposable {
|
|
|
9168
9256
|
const groupPanelIds = new Set(tabGroup.panelIds);
|
|
9169
9257
|
this._pendingCollapse = true;
|
|
9170
9258
|
requestAnimationFrame(() => {
|
|
9171
|
-
var _this$
|
|
9259
|
+
var _this$_animState6, _this$_animState6$cur;
|
|
9172
9260
|
this._pendingCollapse = false;
|
|
9173
9261
|
if (!this._animState) return;
|
|
9174
9262
|
for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) {
|
|
@@ -9183,7 +9271,7 @@ var Tabs = class extends CompositeDisposable {
|
|
|
9183
9271
|
this._tabsList.offsetHeight;
|
|
9184
9272
|
const underline = this._tabGroupManager.groupUnderlines.get(tabGroup.id);
|
|
9185
9273
|
if (underline) underline.style.display = "none";
|
|
9186
|
-
(_this$
|
|
9274
|
+
(_this$_animState6$cur = (_this$_animState6 = this._animState).currentInsertionIndex) !== null && _this$_animState6$cur !== void 0 || (_this$_animState6.currentInsertionIndex = firstIdx);
|
|
9187
9275
|
this.applyDragOverTransforms(true);
|
|
9188
9276
|
for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) t.value.element.style.removeProperty("transition");
|
|
9189
9277
|
if (chipEntry) chipEntry.chip.element.style.removeProperty("transition");
|
|
@@ -9918,6 +10006,7 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
|
|
|
9918
10006
|
set headerPosition(value) {
|
|
9919
10007
|
var _this$_activePanel;
|
|
9920
10008
|
this._headerPosition = value;
|
|
10009
|
+
this.invalidateHeaderSize();
|
|
9921
10010
|
removeClasses(this.container, "dv-groupview-header-top", "dv-groupview-header-bottom", "dv-groupview-header-left", "dv-groupview-header-right");
|
|
9922
10011
|
addClasses(this.container, `dv-groupview-header-${value}`);
|
|
9923
10012
|
const direction = value === "top" || value === "bottom" ? "horizontal" : "vertical";
|
|
@@ -10059,7 +10148,14 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
|
|
|
10059
10148
|
this.header.hidden = !!options.hideHeader;
|
|
10060
10149
|
this.locked = (_options$locked = options.locked) !== null && _options$locked !== void 0 ? _options$locked : false;
|
|
10061
10150
|
this.headerPosition = (_options$headerPositi = options.headerPosition) !== null && _options$headerPositi !== void 0 ? _options$headerPositi : accessor.defaultHeaderPosition;
|
|
10062
|
-
this.addDisposables(
|
|
10151
|
+
this.addDisposables(watchElementResize(this.tabsContainer.element, () => {
|
|
10152
|
+
if (this.isDisposed) return;
|
|
10153
|
+
const size = this.measureHeaderSize();
|
|
10154
|
+
if (size !== this._cachedHeaderSize) {
|
|
10155
|
+
this._cachedHeaderSize = size;
|
|
10156
|
+
this.layout(this._width, this._height);
|
|
10157
|
+
}
|
|
10158
|
+
}), this._onDidPanelTitleChange.event(() => this.updateAccessibleLabel()), this._onTabDragStart, this._onGroupDragStart, this._onWillShowOverlay, this.tabsContainer.onTabDragStart((event) => {
|
|
10063
10159
|
this._onTabDragStart.fire(event);
|
|
10064
10160
|
}), this.tabsContainer.onGroupDragStart((event) => {
|
|
10065
10161
|
this._onGroupDragStart.fire(event);
|
|
@@ -10516,16 +10612,11 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
|
|
|
10516
10612
|
(_this$_activePanel3 = this._activePanel) === null || _this$_activePanel3 === void 0 || _this$_activePanel3.focus();
|
|
10517
10613
|
}
|
|
10518
10614
|
openPanel(panel, options = {}) {
|
|
10519
|
-
/**
|
|
10520
|
-
* set the panel group
|
|
10521
|
-
* add the panel
|
|
10522
|
-
* check if group active
|
|
10523
|
-
* check if panel active
|
|
10524
|
-
*/
|
|
10525
10615
|
if (typeof options.index !== "number" || options.index > this.panels.length) options.index = this.panels.length;
|
|
10526
10616
|
const skipSetActive = !!options.skipSetActive;
|
|
10527
10617
|
panel.updateParentGroup(this.groupPanel, { skipSetActive: options.skipSetActive });
|
|
10528
10618
|
this.doAddPanel(panel, options.index, { skipSetActive });
|
|
10619
|
+
this.invalidateHeaderSize();
|
|
10529
10620
|
if (this._activePanel === panel) {
|
|
10530
10621
|
this.contentContainer.renderPanel(panel, { asActive: true });
|
|
10531
10622
|
return;
|
|
@@ -10588,6 +10679,7 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
|
|
|
10588
10679
|
* changing) down to the content + active panel.
|
|
10589
10680
|
*/
|
|
10590
10681
|
relayout() {
|
|
10682
|
+
this.invalidateHeaderSize();
|
|
10591
10683
|
this.layout(this._width, this._height);
|
|
10592
10684
|
}
|
|
10593
10685
|
/**
|
|
@@ -10597,17 +10689,32 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
|
|
|
10597
10689
|
* width); a hidden header has `display:none` so its `offset*` is 0 and
|
|
10598
10690
|
* nothing is subtracted.
|
|
10599
10691
|
*/
|
|
10600
|
-
|
|
10692
|
+
/**
|
|
10693
|
+
* Measure the header's extent along its occupied axis. This is the single
|
|
10694
|
+
* forced-reflow read; it now runs only on a cache miss (first layout after
|
|
10695
|
+
* a header change) and inside the header's ResizeObserver — not on every
|
|
10696
|
+
* layout frame.
|
|
10697
|
+
*/
|
|
10698
|
+
measureHeaderSize() {
|
|
10601
10699
|
const headerEl = this.tabsContainer.element;
|
|
10700
|
+
return this.headerPosition === "top" || this.headerPosition === "bottom" ? headerEl.offsetHeight : headerEl.offsetWidth;
|
|
10701
|
+
}
|
|
10702
|
+
invalidateHeaderSize() {
|
|
10703
|
+
this._cachedHeaderSize = void 0;
|
|
10704
|
+
}
|
|
10705
|
+
contentDimensions() {
|
|
10706
|
+
var _this$_cachedHeaderSi;
|
|
10602
10707
|
const horizontal = this.headerPosition === "top" || this.headerPosition === "bottom";
|
|
10708
|
+
const headerSize = (_this$_cachedHeaderSi = this._cachedHeaderSize) !== null && _this$_cachedHeaderSi !== void 0 ? _this$_cachedHeaderSi : this._cachedHeaderSize = this.measureHeaderSize();
|
|
10603
10709
|
return {
|
|
10604
|
-
width: horizontal ? this._width : Math.max(0, this._width -
|
|
10605
|
-
height: horizontal ? Math.max(0, this._height -
|
|
10710
|
+
width: horizontal ? this._width : Math.max(0, this._width - headerSize),
|
|
10711
|
+
height: horizontal ? Math.max(0, this._height - headerSize) : this._height
|
|
10606
10712
|
};
|
|
10607
10713
|
}
|
|
10608
10714
|
_removePanel(panel, options) {
|
|
10609
10715
|
const isActivePanel = this._activePanel === panel;
|
|
10610
10716
|
this.doRemovePanel(panel);
|
|
10717
|
+
this.invalidateHeaderSize();
|
|
10611
10718
|
if (isActivePanel && this.panels.length > 0) {
|
|
10612
10719
|
const nextPanel = this.mostRecentlyUsed[0];
|
|
10613
10720
|
this.openPanel(nextPanel, {
|
|
@@ -10933,6 +11040,7 @@ var GridviewPanel = class extends BasePanelView {
|
|
|
10933
11040
|
if (typeof event.minimumHeight === "number" || typeof event.minimumHeight === "function") this._minimumHeight = event.minimumHeight;
|
|
10934
11041
|
if (typeof event.maximumWidth === "number" || typeof event.maximumWidth === "function") this._maximumWidth = event.maximumWidth;
|
|
10935
11042
|
if (typeof event.maximumHeight === "number" || typeof event.maximumHeight === "function") this._maximumHeight = event.maximumHeight;
|
|
11043
|
+
this._onDidChange.fire(void 0);
|
|
10936
11044
|
}), this.api.onDidSizeChange((event) => {
|
|
10937
11045
|
this._onDidChange.fire({
|
|
10938
11046
|
height: event.height,
|
|
@@ -11052,20 +11160,22 @@ var DockviewGroupPanelApiImpl = class extends GridviewPanelApiImpl {
|
|
|
11052
11160
|
return this._group.model.headerPosition;
|
|
11053
11161
|
}
|
|
11054
11162
|
moveTo(options) {
|
|
11055
|
-
var _options$group, _options$position, _options$skipSetActiv, _options$position2;
|
|
11056
11163
|
if (!this._group) throw new Error(NOT_INITIALIZED_MESSAGE);
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11164
|
+
this.accessor.withOrigin("api", () => {
|
|
11165
|
+
var _options$group, _options$position, _options$skipSetActiv, _options$position2;
|
|
11166
|
+
const group = (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this.accessor.addGroup({
|
|
11167
|
+
direction: positionToDirection((_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "right"),
|
|
11168
|
+
skipSetActive: (_options$skipSetActiv = options.skipSetActive) !== null && _options$skipSetActiv !== void 0 ? _options$skipSetActiv : false
|
|
11169
|
+
});
|
|
11170
|
+
this.accessor.moveGroupOrPanel({
|
|
11171
|
+
from: { groupId: this._group.id },
|
|
11172
|
+
to: {
|
|
11173
|
+
group,
|
|
11174
|
+
position: options.group ? (_options$position2 = options.position) !== null && _options$position2 !== void 0 ? _options$position2 : "center" : "center",
|
|
11175
|
+
index: options.index
|
|
11176
|
+
},
|
|
11177
|
+
skipSetActive: options.skipSetActive
|
|
11178
|
+
});
|
|
11069
11179
|
});
|
|
11070
11180
|
}
|
|
11071
11181
|
maximize() {
|
|
@@ -11414,18 +11524,20 @@ var DockviewPanelApiImpl = class extends GridviewPanelApiImpl {
|
|
|
11414
11524
|
this.accessor.withOrigin("api", () => super.setActive());
|
|
11415
11525
|
}
|
|
11416
11526
|
moveTo(options) {
|
|
11417
|
-
|
|
11418
|
-
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11527
|
+
this.accessor.withOrigin("api", () => {
|
|
11528
|
+
var _options$group, _options$position;
|
|
11529
|
+
return this.accessor.moveGroupOrPanel({
|
|
11530
|
+
from: {
|
|
11531
|
+
groupId: this._group.id,
|
|
11532
|
+
panelId: this.panel.id
|
|
11533
|
+
},
|
|
11534
|
+
to: {
|
|
11535
|
+
group: (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this._group,
|
|
11536
|
+
position: options.group ? (_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "center" : "center",
|
|
11537
|
+
index: options.index
|
|
11538
|
+
},
|
|
11539
|
+
skipSetActive: options.skipSetActive
|
|
11540
|
+
});
|
|
11429
11541
|
});
|
|
11430
11542
|
}
|
|
11431
11543
|
setTitle(title) {
|
|
@@ -12535,12 +12647,6 @@ const OPTION_MODULE_RULES = [
|
|
|
12535
12647
|
moduleName: "ContextMenu",
|
|
12536
12648
|
when: (o) => o.getTabGroupChipContextMenuItems != null
|
|
12537
12649
|
},
|
|
12538
|
-
{
|
|
12539
|
-
optionKey: "createContextMenuItemComponent",
|
|
12540
|
-
reason: "createContextMenuItemComponent",
|
|
12541
|
-
moduleName: "ContextMenu",
|
|
12542
|
-
when: (o) => o.createContextMenuItemComponent != null
|
|
12543
|
-
},
|
|
12544
12650
|
{
|
|
12545
12651
|
optionKey: "dndCompass",
|
|
12546
12652
|
reason: "dndCompass",
|
|
@@ -13269,7 +13375,18 @@ var LiveRegionService = class extends CompositeDisposable {
|
|
|
13269
13375
|
prev = next;
|
|
13270
13376
|
const panel = group.activePanel;
|
|
13271
13377
|
if (!panel) return;
|
|
13272
|
-
|
|
13378
|
+
let kind;
|
|
13379
|
+
switch (next) {
|
|
13380
|
+
case "floating":
|
|
13381
|
+
kind = "float";
|
|
13382
|
+
break;
|
|
13383
|
+
case "popout":
|
|
13384
|
+
kind = "popout";
|
|
13385
|
+
break;
|
|
13386
|
+
default:
|
|
13387
|
+
kind = "dock";
|
|
13388
|
+
break;
|
|
13389
|
+
}
|
|
13273
13390
|
this._announce(panel, kind);
|
|
13274
13391
|
});
|
|
13275
13392
|
this._locationSubs.set(group.id, sub);
|
|
@@ -13321,29 +13438,14 @@ const LiveRegionModule = defineModule({
|
|
|
13321
13438
|
|
|
13322
13439
|
//#endregion
|
|
13323
13440
|
//#region src/dockview/advancedDnDService.ts
|
|
13324
|
-
/** Cursor offset of the group drag ghost
|
|
13441
|
+
/** Cursor offset of the group drag ghost. */
|
|
13325
13442
|
const GROUP_DRAG_GHOST_OFFSET_X = 30;
|
|
13326
13443
|
const GROUP_DRAG_GHOST_OFFSET_Y = -10;
|
|
13327
13444
|
/**
|
|
13328
|
-
* The narrow surface the {@link AdvancedDnDService} needs from the host
|
|
13329
|
-
* (the `DockviewComponent`).
|
|
13330
|
-
*
|
|
13331
|
-
* The `onWill*` emitters stay on the component so the public event shape is
|
|
13332
|
-
* unchanged whether or not this module is registered; the service is only the
|
|
13333
|
-
* dispatch point those fires are routed through. Engine policy (e.g. the
|
|
13334
|
-
* `disableDnd` guard) stays on the component, ahead of the dispatch.
|
|
13335
|
-
*/
|
|
13336
|
-
/**
|
|
13337
13445
|
* Owns the dispatch of the advanced drag-and-drop hooks: `onWillDragPanel`,
|
|
13338
|
-
* `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay
|
|
13339
|
-
*
|
|
13340
|
-
*
|
|
13341
|
-
* emitters; the customisation surface it gates (custom drop overlays, custom
|
|
13342
|
-
* group drag ghosts, hook veto/transform behaviour) is currently inlined in
|
|
13343
|
-
* core and is extracted into this service in later phases. Routing the
|
|
13344
|
-
* dispatch through a module slot is what lets that customisation layer move
|
|
13345
|
-
* into a separately-distributed package in a future major version without
|
|
13346
|
-
* changing the public event surface.
|
|
13446
|
+
* `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay`, forwarding each to
|
|
13447
|
+
* the host's emitters so the public event shape is unchanged whether or not
|
|
13448
|
+
* this module is registered.
|
|
13347
13449
|
*
|
|
13348
13450
|
* The service holds no drag state of its own. The gesture is driven by the
|
|
13349
13451
|
* DnD backends, and the per-group subscriptions live on the component's group
|
|
@@ -13469,7 +13571,7 @@ const AllModules = [
|
|
|
13469
13571
|
//#region src/overlay/overlayRenderContainer.ts
|
|
13470
13572
|
var PositionCache = class {
|
|
13471
13573
|
constructor() {
|
|
13472
|
-
this.cache = /* @__PURE__ */ new
|
|
13574
|
+
this.cache = /* @__PURE__ */ new WeakMap();
|
|
13473
13575
|
this.currentFrameId = 0;
|
|
13474
13576
|
this.rafId = null;
|
|
13475
13577
|
}
|
|
@@ -15138,7 +15240,22 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
15138
15240
|
const rect = candidate.element.getBoundingClientRect();
|
|
15139
15241
|
const dx = rect.left + rect.width / 2 - fromX;
|
|
15140
15242
|
const dy = rect.top + rect.height / 2 - fromY;
|
|
15141
|
-
|
|
15243
|
+
let inDirection;
|
|
15244
|
+
switch (direction) {
|
|
15245
|
+
case "left":
|
|
15246
|
+
inDirection = dx < 0 && Math.abs(dx) >= Math.abs(dy);
|
|
15247
|
+
break;
|
|
15248
|
+
case "right":
|
|
15249
|
+
inDirection = dx > 0 && Math.abs(dx) >= Math.abs(dy);
|
|
15250
|
+
break;
|
|
15251
|
+
case "up":
|
|
15252
|
+
inDirection = dy < 0 && Math.abs(dy) >= Math.abs(dx);
|
|
15253
|
+
break;
|
|
15254
|
+
default:
|
|
15255
|
+
inDirection = dy > 0 && Math.abs(dy) >= Math.abs(dx);
|
|
15256
|
+
break;
|
|
15257
|
+
}
|
|
15258
|
+
if (!inDirection) continue;
|
|
15142
15259
|
const distance = dx * dx + dy * dy;
|
|
15143
15260
|
if (distance < bestDistance) {
|
|
15144
15261
|
bestDistance = distance;
|
|
@@ -15986,11 +16103,15 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
15986
16103
|
/**
|
|
15987
16104
|
* Reveal (create-or-fill) the edge group at `position` and move the dragged
|
|
15988
16105
|
* item described by `data` into it. A newly created edge group is created
|
|
15989
|
-
* collapsed
|
|
15990
|
-
* later emptied
|
|
15991
|
-
*
|
|
15992
|
-
*
|
|
15993
|
-
*
|
|
16106
|
+
* collapsed, flagged `autoReveal` so it tears down to zero footprint when
|
|
16107
|
+
* later emptied, and takes its auto-hide state from `options.autoHide`. If an
|
|
16108
|
+
* edge group already exists there it is reused: the panel is added to its
|
|
16109
|
+
* tabs and its collapsed/toggled *and auto-hide* state are left as-is (never
|
|
16110
|
+
* re-created; `addEdgeGroup` throws on a duplicate position). This keeps a
|
|
16111
|
+
* drag-reveal from silently converting a static edge group into an
|
|
16112
|
+
* auto-hiding one; to change an existing group's auto-hide, call
|
|
16113
|
+
* `api.getEdgeGroup(position)?.setAutoHide(...)` directly. No-op if the
|
|
16114
|
+
* EdgeGroup module is absent.
|
|
15994
16115
|
*
|
|
15995
16116
|
* This is the primitive behind the dock-to-edge groups: the two-band
|
|
15996
16117
|
* drag-reveal affordance routes its outer-band drops here.
|
|
@@ -16009,7 +16130,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16009
16130
|
collapsed: true
|
|
16010
16131
|
});
|
|
16011
16132
|
group = service.get(position);
|
|
16012
|
-
}
|
|
16133
|
+
}
|
|
16013
16134
|
if (!group) return;
|
|
16014
16135
|
this.moveGroupOrPanel({
|
|
16015
16136
|
from: {
|
|
@@ -16540,6 +16661,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16540
16661
|
height: options.initialHeight
|
|
16541
16662
|
};
|
|
16542
16663
|
let index;
|
|
16664
|
+
const shouldSkipSetActive = (group) => !!options.inactive && group.model.size > 0;
|
|
16543
16665
|
if (options.position) if (isPanelOptionsWithPanel(options.position)) {
|
|
16544
16666
|
const referencePanel = typeof options.position.referencePanel === "string" ? this.getGroupPanel(options.position.referencePanel) : options.position.referencePanel;
|
|
16545
16667
|
index = options.position.index;
|
|
@@ -16562,7 +16684,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16562
16684
|
const group = this.orthogonalize(directionToPosition(options.position.direction));
|
|
16563
16685
|
const panel = this.createPanel(options, group);
|
|
16564
16686
|
group.model.openPanel(panel, {
|
|
16565
|
-
skipSetActive:
|
|
16687
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16566
16688
|
skipSetGroupActive: options.inactive,
|
|
16567
16689
|
index
|
|
16568
16690
|
});
|
|
@@ -16589,14 +16711,14 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16589
16711
|
}));
|
|
16590
16712
|
panel = this.createPanel(options, group);
|
|
16591
16713
|
group.model.openPanel(panel, {
|
|
16592
|
-
skipSetActive:
|
|
16714
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16593
16715
|
skipSetGroupActive: options.inactive,
|
|
16594
16716
|
index
|
|
16595
16717
|
});
|
|
16596
16718
|
} else if (referenceGroup.api.location.type === "floating" || referenceGroup.api.location.type === "edge" || target === "center") {
|
|
16597
16719
|
panel = this.createPanel(options, referenceGroup);
|
|
16598
16720
|
referenceGroup.model.openPanel(panel, {
|
|
16599
|
-
skipSetActive:
|
|
16721
|
+
skipSetActive: shouldSkipSetActive(referenceGroup),
|
|
16600
16722
|
skipSetGroupActive: options.inactive,
|
|
16601
16723
|
index
|
|
16602
16724
|
});
|
|
@@ -16611,7 +16733,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16611
16733
|
const group = this.createGroupAtLocation(relativeLocation, this.orientationAtLocation(relativeLocation) === "VERTICAL" ? initial === null || initial === void 0 ? void 0 : initial.height : initial === null || initial === void 0 ? void 0 : initial.width);
|
|
16612
16734
|
panel = this.createPanel(options, group);
|
|
16613
16735
|
group.model.openPanel(panel, {
|
|
16614
|
-
skipSetActive:
|
|
16736
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16615
16737
|
skipSetGroupActive: options.inactive,
|
|
16616
16738
|
index
|
|
16617
16739
|
});
|
|
@@ -16628,7 +16750,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16628
16750
|
}));
|
|
16629
16751
|
panel = this.createPanel(options, group);
|
|
16630
16752
|
group.model.openPanel(panel, {
|
|
16631
|
-
skipSetActive:
|
|
16753
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16632
16754
|
skipSetGroupActive: options.inactive,
|
|
16633
16755
|
index
|
|
16634
16756
|
});
|
|
@@ -16636,7 +16758,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16636
16758
|
const group = this.createGroupAtLocation([0], this.gridview.orientation === "VERTICAL" ? initial === null || initial === void 0 ? void 0 : initial.height : initial === null || initial === void 0 ? void 0 : initial.width);
|
|
16637
16759
|
panel = this.createPanel(options, group);
|
|
16638
16760
|
group.model.openPanel(panel, {
|
|
16639
|
-
skipSetActive:
|
|
16761
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16640
16762
|
skipSetGroupActive: options.inactive,
|
|
16641
16763
|
index
|
|
16642
16764
|
});
|