dockview 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/dockview.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 8.
|
|
3
|
+
* @version 8.1.0
|
|
4
4
|
* @link https://github.com/dockview/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -22,12 +22,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
22
22
|
//#region ../dockview-core/dist/package/main.esm.mjs
|
|
23
23
|
/**
|
|
24
24
|
* dockview-core
|
|
25
|
-
* @version 8.
|
|
25
|
+
* @version 8.1.0
|
|
26
26
|
* @link https://github.com/dockview/dockview
|
|
27
27
|
* @license MIT
|
|
28
28
|
*/
|
|
29
29
|
var _LocalSelectionTransfer;
|
|
30
|
-
var TransferObject = class {
|
|
30
|
+
var TransferObject = class {
|
|
31
|
+
constructor() {}
|
|
32
|
+
};
|
|
31
33
|
var PanelTransfer = class extends TransferObject {
|
|
32
34
|
constructor(viewId, groupId, panelId, tabGroupId) {
|
|
33
35
|
super();
|
|
@@ -214,7 +216,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
214
216
|
this.options = options;
|
|
215
217
|
this._listeners = [];
|
|
216
218
|
this._disposed = false;
|
|
217
|
-
this._pauseTokens = /* @__PURE__ */ new Set();
|
|
218
219
|
}
|
|
219
220
|
get event() {
|
|
220
221
|
if (!this._event) {
|
|
@@ -235,14 +236,26 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
235
236
|
}
|
|
236
237
|
fire(e) {
|
|
237
238
|
var _this$options2;
|
|
238
|
-
if (this._pauseTokens.size > 0) return;
|
|
239
|
+
if (this._pauseTokens !== void 0 && this._pauseTokens.size > 0) return;
|
|
239
240
|
if ((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.replay) this._last = e;
|
|
240
|
-
|
|
241
|
+
const listeners = this._listeners;
|
|
242
|
+
const length = listeners.length;
|
|
243
|
+
if (length === 0) return;
|
|
244
|
+
if (length === 1) {
|
|
245
|
+
listeners[0].callback(e);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
for (const listener of listeners.slice()) listener.callback(e);
|
|
241
249
|
}
|
|
242
250
|
pause() {
|
|
251
|
+
var _this$_pauseTokens;
|
|
243
252
|
const token = {};
|
|
253
|
+
(_this$_pauseTokens = this._pauseTokens) !== null && _this$_pauseTokens !== void 0 || (this._pauseTokens = /* @__PURE__ */ new Set());
|
|
244
254
|
this._pauseTokens.add(token);
|
|
245
|
-
return Disposable.from(() =>
|
|
255
|
+
return Disposable.from(() => {
|
|
256
|
+
var _this$_pauseTokens2;
|
|
257
|
+
return (_this$_pauseTokens2 = this._pauseTokens) === null || _this$_pauseTokens2 === void 0 ? void 0 : _this$_pauseTokens2.delete(token);
|
|
258
|
+
});
|
|
246
259
|
}
|
|
247
260
|
dispose() {
|
|
248
261
|
if (!this._disposed) {
|
|
@@ -542,8 +555,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
542
555
|
let previousScreenX = window.screenX;
|
|
543
556
|
let previousScreenY = window.screenY;
|
|
544
557
|
let timeout;
|
|
558
|
+
let rafHandle = 0;
|
|
559
|
+
let stopped = false;
|
|
545
560
|
const checkMovement = () => {
|
|
546
|
-
if (window.closed) return;
|
|
561
|
+
if (stopped || window.closed) return;
|
|
547
562
|
const currentScreenX = window.screenX;
|
|
548
563
|
const currentScreenY = window.screenY;
|
|
549
564
|
if (currentScreenX !== previousScreenX || currentScreenY !== previousScreenY) {
|
|
@@ -554,9 +569,18 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
554
569
|
previousScreenX = currentScreenX;
|
|
555
570
|
previousScreenY = currentScreenY;
|
|
556
571
|
}
|
|
557
|
-
requestAnimationFrame(checkMovement);
|
|
572
|
+
rafHandle = requestAnimationFrame(checkMovement);
|
|
558
573
|
};
|
|
559
574
|
checkMovement();
|
|
575
|
+
const disposeEmitter = emitter.dispose.bind(emitter);
|
|
576
|
+
emitter.dispose = () => {
|
|
577
|
+
if (!stopped) {
|
|
578
|
+
stopped = true;
|
|
579
|
+
cancelAnimationFrame(rafHandle);
|
|
580
|
+
clearTimeout(timeout);
|
|
581
|
+
}
|
|
582
|
+
disposeEmitter();
|
|
583
|
+
};
|
|
560
584
|
return emitter;
|
|
561
585
|
}
|
|
562
586
|
function onDidWindowResizeEnd(element, cb) {
|
|
@@ -683,6 +707,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
683
707
|
set size(size) {
|
|
684
708
|
this._size = size;
|
|
685
709
|
}
|
|
710
|
+
setContainerGeometry(prop, value) {
|
|
711
|
+
if (this._appliedStyles[prop] === value) return;
|
|
712
|
+
this._appliedStyles[prop] = value;
|
|
713
|
+
this.container.style[prop] = value;
|
|
714
|
+
}
|
|
686
715
|
get size() {
|
|
687
716
|
return this._size;
|
|
688
717
|
}
|
|
@@ -718,6 +747,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
718
747
|
this.view = view;
|
|
719
748
|
this.disposable = disposable;
|
|
720
749
|
this._cachedVisibleSize = void 0;
|
|
750
|
+
this._appliedStyles = {};
|
|
721
751
|
if (typeof size === "number") {
|
|
722
752
|
this._size = size;
|
|
723
753
|
this._cachedVisibleSize = void 0;
|
|
@@ -763,6 +793,16 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
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 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
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 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
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 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
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 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
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 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
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;
|
|
@@ -1551,10 +1595,20 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1551
1595
|
return this.orientation === "HORIZONTAL" ? this.orthogonalSize : this.size;
|
|
1552
1596
|
}
|
|
1553
1597
|
get minimumSize() {
|
|
1554
|
-
|
|
1598
|
+
if (this._cachedMinimumSize === void 0) {
|
|
1599
|
+
let value = 0;
|
|
1600
|
+
for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.max(value, this.children[index].minimumOrthogonalSize);
|
|
1601
|
+
this._cachedMinimumSize = value;
|
|
1602
|
+
}
|
|
1603
|
+
return this._cachedMinimumSize;
|
|
1555
1604
|
}
|
|
1556
1605
|
get maximumSize() {
|
|
1557
|
-
|
|
1606
|
+
if (this._cachedMaximumSize === void 0) {
|
|
1607
|
+
let value = Number.POSITIVE_INFINITY;
|
|
1608
|
+
for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.min(value, this.children[index].maximumOrthogonalSize);
|
|
1609
|
+
this._cachedMaximumSize = value;
|
|
1610
|
+
}
|
|
1611
|
+
return this._cachedMaximumSize;
|
|
1558
1612
|
}
|
|
1559
1613
|
get minimumOrthogonalSize() {
|
|
1560
1614
|
return this.splitview.minimumSize;
|
|
@@ -1581,15 +1635,29 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1581
1635
|
return this.orientation === "HORIZONTAL" ? this.maximumSize : this.maximumOrthogonalSize;
|
|
1582
1636
|
}
|
|
1583
1637
|
get priority() {
|
|
1638
|
+
var _this$_cachedPriority;
|
|
1639
|
+
(_this$_cachedPriority = this._cachedPriority) !== null && _this$_cachedPriority !== void 0 || (this._cachedPriority = this.computePriority());
|
|
1640
|
+
return this._cachedPriority;
|
|
1641
|
+
}
|
|
1642
|
+
computePriority() {
|
|
1584
1643
|
if (this.children.length === 0) return "normal";
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1644
|
+
let hasHigh = false;
|
|
1645
|
+
let hasLow = false;
|
|
1646
|
+
for (const child of this.children) {
|
|
1647
|
+
var _child$priority;
|
|
1648
|
+
const priority = (_child$priority = child.priority) !== null && _child$priority !== void 0 ? _child$priority : "normal";
|
|
1649
|
+
if (priority === "high") hasHigh = true;
|
|
1650
|
+
else if (priority === "low") hasLow = true;
|
|
1651
|
+
}
|
|
1652
|
+
if (hasHigh) return "high";
|
|
1653
|
+
else if (hasLow) return "low";
|
|
1591
1654
|
return "normal";
|
|
1592
1655
|
}
|
|
1656
|
+
invalidateCachedSizes() {
|
|
1657
|
+
this._cachedMinimumSize = void 0;
|
|
1658
|
+
this._cachedMaximumSize = void 0;
|
|
1659
|
+
this._cachedPriority = void 0;
|
|
1660
|
+
}
|
|
1593
1661
|
get disabled() {
|
|
1594
1662
|
return this.splitview.disabled;
|
|
1595
1663
|
}
|
|
@@ -1665,6 +1733,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1665
1733
|
if (this.splitview.isViewVisible(index) === visible) return;
|
|
1666
1734
|
const wereAllChildrenHidden = this.splitview.contentSize === 0;
|
|
1667
1735
|
this.splitview.setViewVisible(index, visible);
|
|
1736
|
+
this.invalidateCachedSizes();
|
|
1668
1737
|
const areAllChildrenHidden = this.splitview.contentSize === 0;
|
|
1669
1738
|
if (visible && wereAllChildrenHidden || !visible && areAllChildrenHidden) this._onDidVisibilityChange.fire({ visible });
|
|
1670
1739
|
}
|
|
@@ -1713,12 +1782,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1713
1782
|
return child;
|
|
1714
1783
|
}
|
|
1715
1784
|
setupChildrenEvents() {
|
|
1785
|
+
this.invalidateCachedSizes();
|
|
1716
1786
|
this._childrenDisposable.dispose();
|
|
1717
1787
|
this._childrenDisposable = new CompositeDisposable(Event.any(...this.children.map((c) => c.onDidChange))((e) => {
|
|
1718
1788
|
/**
|
|
1719
1789
|
* indicate a change has occured to allows any re-rendering but don't bubble
|
|
1720
1790
|
* event because that was specific to this branch
|
|
1721
1791
|
*/
|
|
1792
|
+
this.invalidateCachedSizes();
|
|
1722
1793
|
this._onDidChange.fire({ size: e.orthogonalSize });
|
|
1723
1794
|
}), ...this.children.map((c, i) => {
|
|
1724
1795
|
if (c instanceof BranchNode) return c.onDidVisibilityChange(({ visible }) => {
|
|
@@ -3362,7 +3433,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3362
3433
|
* Add a group and return the created object.
|
|
3363
3434
|
*/
|
|
3364
3435
|
addGroup(options) {
|
|
3365
|
-
return this.component.addGroup(options);
|
|
3436
|
+
return this.component.withOrigin("api", () => this.component.addGroup(options));
|
|
3366
3437
|
}
|
|
3367
3438
|
/**
|
|
3368
3439
|
* Close all groups and panels.
|
|
@@ -3500,13 +3571,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3500
3571
|
this.activatePrevious(options);
|
|
3501
3572
|
}
|
|
3502
3573
|
maximizeGroup(panel) {
|
|
3503
|
-
this.component.maximizeGroup(panel.group);
|
|
3574
|
+
this.component.withOrigin("api", () => this.component.maximizeGroup(panel.group));
|
|
3504
3575
|
}
|
|
3505
3576
|
hasMaximizedGroup() {
|
|
3506
3577
|
return this.component.hasMaximizedGroup();
|
|
3507
3578
|
}
|
|
3508
3579
|
exitMaximizedGroup() {
|
|
3509
|
-
this.component.exitMaximizedGroup();
|
|
3580
|
+
this.component.withOrigin("api", () => this.component.exitMaximizedGroup());
|
|
3510
3581
|
}
|
|
3511
3582
|
get onDidMaximizedGroupChange() {
|
|
3512
3583
|
return this.component.onDidMaximizedGroupChange;
|
|
@@ -5410,9 +5481,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
5410
5481
|
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);
|
|
5411
5482
|
if (((_this$panel = this.panel) === null || _this$panel === void 0 ? void 0 : _this$panel.view.content.element.parentElement) === this._element) {
|
|
5412
5483
|
var _this$panel$view$cont, _this$panel$view$cont2;
|
|
5413
|
-
/**
|
|
5414
|
-
* If the currently attached panel is mounted directly to the content then remove it
|
|
5415
|
-
*/
|
|
5416
5484
|
this.panel.view.content.element.remove();
|
|
5417
5485
|
(_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);
|
|
5418
5486
|
}
|
|
@@ -6128,7 +6196,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
6128
6196
|
this.element.appendChild(this._scrollbar);
|
|
6129
6197
|
this.addDisposables(addDisposableListener(this.element, "wheel", (event) => {
|
|
6130
6198
|
this._scrollOffset += event.deltaY * Scrollbar.MouseWheelSpeed;
|
|
6131
|
-
this.
|
|
6199
|
+
this.scheduleStyleUpdate();
|
|
6132
6200
|
}), addDisposableListener(this._scrollbar, "pointerdown", (event) => {
|
|
6133
6201
|
var _this$_scrollbar$owne;
|
|
6134
6202
|
event.preventDefault();
|
|
@@ -6140,7 +6208,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
6140
6208
|
const delta = this._orientation === "horizontal" ? event.clientX - originalClient : event.clientY - originalClient;
|
|
6141
6209
|
const p = (this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight) / (this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight);
|
|
6142
6210
|
this._scrollOffset = originalScrollOffset + delta / p;
|
|
6143
|
-
this.
|
|
6211
|
+
this.scheduleStyleUpdate();
|
|
6144
6212
|
};
|
|
6145
6213
|
const onEnd = () => {
|
|
6146
6214
|
toggleClass(this.element, "dv-scrollable-scrolling", false);
|
|
@@ -6152,10 +6220,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
6152
6220
|
doc.addEventListener("pointerup", onEnd);
|
|
6153
6221
|
doc.addEventListener("pointercancel", onEnd);
|
|
6154
6222
|
}), addDisposableListener(this.element, "scroll", () => {
|
|
6155
|
-
this.
|
|
6223
|
+
this.scheduleStyleUpdate();
|
|
6156
6224
|
}), addDisposableListener(this.scrollableElement, "scroll", () => {
|
|
6157
6225
|
this._scrollOffset = this._orientation === "horizontal" ? this.scrollableElement.scrollLeft : this.scrollableElement.scrollTop;
|
|
6158
|
-
this.
|
|
6226
|
+
this.scheduleStyleUpdate();
|
|
6159
6227
|
}), watchElementResize(this.element, () => {
|
|
6160
6228
|
toggleClass(this.element, "dv-scrollable-resizing", true);
|
|
6161
6229
|
if (this._animationTimer) clearTimeout(this._animationTimer);
|
|
@@ -6163,9 +6231,29 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
6163
6231
|
clearTimeout(this._animationTimer);
|
|
6164
6232
|
toggleClass(this.element, "dv-scrollable-resizing", false);
|
|
6165
6233
|
}, 500);
|
|
6166
|
-
this.
|
|
6234
|
+
this.scheduleStyleUpdate();
|
|
6235
|
+
}), Disposable.from(() => {
|
|
6236
|
+
if (this._pendingStyleFrame !== void 0) {
|
|
6237
|
+
cancelAnimationFrame(this._pendingStyleFrame);
|
|
6238
|
+
this._pendingStyleFrame = void 0;
|
|
6239
|
+
}
|
|
6167
6240
|
}));
|
|
6168
6241
|
}
|
|
6242
|
+
/**
|
|
6243
|
+
* Coalesce the scrollbar restyle to one pass per animation frame. The
|
|
6244
|
+
* wheel / scroll / pointermove handlers can each fire many times per frame,
|
|
6245
|
+
* and `calculateScrollbarStyles` both reads layout (`clientWidth`/
|
|
6246
|
+
* `scrollWidth`) and writes styles + `scrollLeft`/`scrollTop`; running it
|
|
6247
|
+
* synchronously per event caused repeated read→write→read reflow. Batching
|
|
6248
|
+
* to a frame keeps a burst of events to a single measure+write.
|
|
6249
|
+
*/
|
|
6250
|
+
scheduleStyleUpdate() {
|
|
6251
|
+
if (this._pendingStyleFrame !== void 0) return;
|
|
6252
|
+
this._pendingStyleFrame = requestAnimationFrame(() => {
|
|
6253
|
+
this._pendingStyleFrame = void 0;
|
|
6254
|
+
this.calculateScrollbarStyles();
|
|
6255
|
+
});
|
|
6256
|
+
}
|
|
6169
6257
|
calculateScrollbarStyles() {
|
|
6170
6258
|
const clientSize = this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight;
|
|
6171
6259
|
const scrollSize = this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight;
|
|
@@ -8605,8 +8693,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
8605
8693
|
}, true), addDisposableListener(this._tabsList, "dragend", () => {
|
|
8606
8694
|
this._reorder.resetDragAnimation();
|
|
8607
8695
|
}), addDisposableListener(this._tabsList, "drop", (event) => {
|
|
8608
|
-
var _this$accessor$option, _this$group$model$dro;
|
|
8609
|
-
if (
|
|
8696
|
+
var _this$_animState3, _this$accessor$option, _this$group$model$dro;
|
|
8697
|
+
if (((_this$_animState3 = this._animState) === null || _this$_animState3 === void 0 ? void 0 : _this$_animState3.currentInsertionIndex) == null) return;
|
|
8610
8698
|
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;
|
|
8611
8699
|
event.stopPropagation();
|
|
8612
8700
|
event.preventDefault();
|
|
@@ -8811,7 +8899,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
8811
8899
|
};
|
|
8812
8900
|
this._pendingCollapse = true;
|
|
8813
8901
|
requestAnimationFrame(() => {
|
|
8814
|
-
var _this$
|
|
8902
|
+
var _this$_animState4, _this$_animState4$cur;
|
|
8815
8903
|
this._pendingCollapse = false;
|
|
8816
8904
|
if (!this._animState) return;
|
|
8817
8905
|
if (!this._tabsList.classList.contains("dv-tabs-container--wrap")) {
|
|
@@ -8819,7 +8907,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
8819
8907
|
toggleClass(tab.element, "dv-tab--dragging", true);
|
|
8820
8908
|
tab.element.offsetHeight;
|
|
8821
8909
|
}
|
|
8822
|
-
(_this$
|
|
8910
|
+
(_this$_animState4$cur = (_this$_animState4 = this._animState).currentInsertionIndex) !== null && _this$_animState4$cur !== void 0 || (_this$_animState4.currentInsertionIndex = sourceIndex);
|
|
8823
8911
|
this.applyDragOverTransforms(true);
|
|
8824
8912
|
tab.element.style.removeProperty("transition");
|
|
8825
8913
|
});
|
|
@@ -8908,8 +8996,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
8908
8996
|
}
|
|
8909
8997
|
}
|
|
8910
8998
|
delete(id) {
|
|
8911
|
-
var _this$
|
|
8912
|
-
if (((_this$
|
|
8999
|
+
var _this$_animState5;
|
|
9000
|
+
if (((_this$_animState5 = this._animState) === null || _this$_animState5 === void 0 ? void 0 : _this$_animState5.sourceTabId) === id) {
|
|
8913
9001
|
this.resetTabTransforms();
|
|
8914
9002
|
this._animState = null;
|
|
8915
9003
|
}
|
|
@@ -9026,7 +9114,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
9026
9114
|
const groupPanelIds = new Set(tabGroup.panelIds);
|
|
9027
9115
|
this._pendingCollapse = true;
|
|
9028
9116
|
requestAnimationFrame(() => {
|
|
9029
|
-
var _this$
|
|
9117
|
+
var _this$_animState6, _this$_animState6$cur;
|
|
9030
9118
|
this._pendingCollapse = false;
|
|
9031
9119
|
if (!this._animState) return;
|
|
9032
9120
|
for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) {
|
|
@@ -9041,7 +9129,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
9041
9129
|
this._tabsList.offsetHeight;
|
|
9042
9130
|
const underline = this._tabGroupManager.groupUnderlines.get(tabGroup.id);
|
|
9043
9131
|
if (underline) underline.style.display = "none";
|
|
9044
|
-
(_this$
|
|
9132
|
+
(_this$_animState6$cur = (_this$_animState6 = this._animState).currentInsertionIndex) !== null && _this$_animState6$cur !== void 0 || (_this$_animState6.currentInsertionIndex = firstIdx);
|
|
9045
9133
|
this.applyDragOverTransforms(true);
|
|
9046
9134
|
for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) t.value.element.style.removeProperty("transition");
|
|
9047
9135
|
if (chipEntry) chipEntry.chip.element.style.removeProperty("transition");
|
|
@@ -9764,6 +9852,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
9764
9852
|
set headerPosition(value) {
|
|
9765
9853
|
var _this$_activePanel;
|
|
9766
9854
|
this._headerPosition = value;
|
|
9855
|
+
this.invalidateHeaderSize();
|
|
9767
9856
|
removeClasses(this.container, "dv-groupview-header-top", "dv-groupview-header-bottom", "dv-groupview-header-left", "dv-groupview-header-right");
|
|
9768
9857
|
addClasses(this.container, `dv-groupview-header-${value}`);
|
|
9769
9858
|
const direction = value === "top" || value === "bottom" ? "horizontal" : "vertical";
|
|
@@ -9905,7 +9994,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
9905
9994
|
this.header.hidden = !!options.hideHeader;
|
|
9906
9995
|
this.locked = (_options$locked = options.locked) !== null && _options$locked !== void 0 ? _options$locked : false;
|
|
9907
9996
|
this.headerPosition = (_options$headerPositi = options.headerPosition) !== null && _options$headerPositi !== void 0 ? _options$headerPositi : accessor.defaultHeaderPosition;
|
|
9908
|
-
this.addDisposables(
|
|
9997
|
+
this.addDisposables(watchElementResize(this.tabsContainer.element, () => {
|
|
9998
|
+
if (this.isDisposed) return;
|
|
9999
|
+
const size = this.measureHeaderSize();
|
|
10000
|
+
if (size !== this._cachedHeaderSize) {
|
|
10001
|
+
this._cachedHeaderSize = size;
|
|
10002
|
+
this.layout(this._width, this._height);
|
|
10003
|
+
}
|
|
10004
|
+
}), this._onDidPanelTitleChange.event(() => this.updateAccessibleLabel()), this._onTabDragStart, this._onGroupDragStart, this._onWillShowOverlay, this.tabsContainer.onTabDragStart((event) => {
|
|
9909
10005
|
this._onTabDragStart.fire(event);
|
|
9910
10006
|
}), this.tabsContainer.onGroupDragStart((event) => {
|
|
9911
10007
|
this._onGroupDragStart.fire(event);
|
|
@@ -10362,16 +10458,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10362
10458
|
(_this$_activePanel3 = this._activePanel) === null || _this$_activePanel3 === void 0 || _this$_activePanel3.focus();
|
|
10363
10459
|
}
|
|
10364
10460
|
openPanel(panel, options = {}) {
|
|
10365
|
-
/**
|
|
10366
|
-
* set the panel group
|
|
10367
|
-
* add the panel
|
|
10368
|
-
* check if group active
|
|
10369
|
-
* check if panel active
|
|
10370
|
-
*/
|
|
10371
10461
|
if (typeof options.index !== "number" || options.index > this.panels.length) options.index = this.panels.length;
|
|
10372
10462
|
const skipSetActive = !!options.skipSetActive;
|
|
10373
10463
|
panel.updateParentGroup(this.groupPanel, { skipSetActive: options.skipSetActive });
|
|
10374
10464
|
this.doAddPanel(panel, options.index, { skipSetActive });
|
|
10465
|
+
this.invalidateHeaderSize();
|
|
10375
10466
|
if (this._activePanel === panel) {
|
|
10376
10467
|
this.contentContainer.renderPanel(panel, { asActive: true });
|
|
10377
10468
|
return;
|
|
@@ -10434,6 +10525,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10434
10525
|
* changing) down to the content + active panel.
|
|
10435
10526
|
*/
|
|
10436
10527
|
relayout() {
|
|
10528
|
+
this.invalidateHeaderSize();
|
|
10437
10529
|
this.layout(this._width, this._height);
|
|
10438
10530
|
}
|
|
10439
10531
|
/**
|
|
@@ -10443,17 +10535,32 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10443
10535
|
* width); a hidden header has `display:none` so its `offset*` is 0 and
|
|
10444
10536
|
* nothing is subtracted.
|
|
10445
10537
|
*/
|
|
10446
|
-
|
|
10538
|
+
/**
|
|
10539
|
+
* Measure the header's extent along its occupied axis. This is the single
|
|
10540
|
+
* forced-reflow read; it now runs only on a cache miss (first layout after
|
|
10541
|
+
* a header change) and inside the header's ResizeObserver — not on every
|
|
10542
|
+
* layout frame.
|
|
10543
|
+
*/
|
|
10544
|
+
measureHeaderSize() {
|
|
10447
10545
|
const headerEl = this.tabsContainer.element;
|
|
10546
|
+
return this.headerPosition === "top" || this.headerPosition === "bottom" ? headerEl.offsetHeight : headerEl.offsetWidth;
|
|
10547
|
+
}
|
|
10548
|
+
invalidateHeaderSize() {
|
|
10549
|
+
this._cachedHeaderSize = void 0;
|
|
10550
|
+
}
|
|
10551
|
+
contentDimensions() {
|
|
10552
|
+
var _this$_cachedHeaderSi;
|
|
10448
10553
|
const horizontal = this.headerPosition === "top" || this.headerPosition === "bottom";
|
|
10554
|
+
const headerSize = (_this$_cachedHeaderSi = this._cachedHeaderSize) !== null && _this$_cachedHeaderSi !== void 0 ? _this$_cachedHeaderSi : this._cachedHeaderSize = this.measureHeaderSize();
|
|
10449
10555
|
return {
|
|
10450
|
-
width: horizontal ? this._width : Math.max(0, this._width -
|
|
10451
|
-
height: horizontal ? Math.max(0, this._height -
|
|
10556
|
+
width: horizontal ? this._width : Math.max(0, this._width - headerSize),
|
|
10557
|
+
height: horizontal ? Math.max(0, this._height - headerSize) : this._height
|
|
10452
10558
|
};
|
|
10453
10559
|
}
|
|
10454
10560
|
_removePanel(panel, options) {
|
|
10455
10561
|
const isActivePanel = this._activePanel === panel;
|
|
10456
10562
|
this.doRemovePanel(panel);
|
|
10563
|
+
this.invalidateHeaderSize();
|
|
10457
10564
|
if (isActivePanel && this.panels.length > 0) {
|
|
10458
10565
|
const nextPanel = this.mostRecentlyUsed[0];
|
|
10459
10566
|
this.openPanel(nextPanel, {
|
|
@@ -10773,6 +10880,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10773
10880
|
if (typeof event.minimumHeight === "number" || typeof event.minimumHeight === "function") this._minimumHeight = event.minimumHeight;
|
|
10774
10881
|
if (typeof event.maximumWidth === "number" || typeof event.maximumWidth === "function") this._maximumWidth = event.maximumWidth;
|
|
10775
10882
|
if (typeof event.maximumHeight === "number" || typeof event.maximumHeight === "function") this._maximumHeight = event.maximumHeight;
|
|
10883
|
+
this._onDidChange.fire(void 0);
|
|
10776
10884
|
}), this.api.onDidSizeChange((event) => {
|
|
10777
10885
|
this._onDidChange.fire({
|
|
10778
10886
|
height: event.height,
|
|
@@ -10889,20 +10997,22 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10889
10997
|
return this._group.model.headerPosition;
|
|
10890
10998
|
}
|
|
10891
10999
|
moveTo(options) {
|
|
10892
|
-
var _options$group, _options$position, _options$skipSetActiv, _options$position2;
|
|
10893
11000
|
if (!this._group) throw new Error(NOT_INITIALIZED_MESSAGE);
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
11001
|
+
this.accessor.withOrigin("api", () => {
|
|
11002
|
+
var _options$group, _options$position, _options$skipSetActiv, _options$position2;
|
|
11003
|
+
const group = (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this.accessor.addGroup({
|
|
11004
|
+
direction: positionToDirection((_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "right"),
|
|
11005
|
+
skipSetActive: (_options$skipSetActiv = options.skipSetActive) !== null && _options$skipSetActiv !== void 0 ? _options$skipSetActiv : false
|
|
11006
|
+
});
|
|
11007
|
+
this.accessor.moveGroupOrPanel({
|
|
11008
|
+
from: { groupId: this._group.id },
|
|
11009
|
+
to: {
|
|
11010
|
+
group,
|
|
11011
|
+
position: options.group ? (_options$position2 = options.position) !== null && _options$position2 !== void 0 ? _options$position2 : "center" : "center",
|
|
11012
|
+
index: options.index
|
|
11013
|
+
},
|
|
11014
|
+
skipSetActive: options.skipSetActive
|
|
11015
|
+
});
|
|
10906
11016
|
});
|
|
10907
11017
|
}
|
|
10908
11018
|
maximize() {
|
|
@@ -11242,18 +11352,20 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
11242
11352
|
this.accessor.withOrigin("api", () => super.setActive());
|
|
11243
11353
|
}
|
|
11244
11354
|
moveTo(options) {
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11355
|
+
this.accessor.withOrigin("api", () => {
|
|
11356
|
+
var _options$group, _options$position;
|
|
11357
|
+
return this.accessor.moveGroupOrPanel({
|
|
11358
|
+
from: {
|
|
11359
|
+
groupId: this._group.id,
|
|
11360
|
+
panelId: this.panel.id
|
|
11361
|
+
},
|
|
11362
|
+
to: {
|
|
11363
|
+
group: (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this._group,
|
|
11364
|
+
position: options.group ? (_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "center" : "center",
|
|
11365
|
+
index: options.index
|
|
11366
|
+
},
|
|
11367
|
+
skipSetActive: options.skipSetActive
|
|
11368
|
+
});
|
|
11257
11369
|
});
|
|
11258
11370
|
}
|
|
11259
11371
|
setTitle(title) {
|
|
@@ -12336,12 +12448,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
12336
12448
|
moduleName: "ContextMenu",
|
|
12337
12449
|
when: (o) => o.getTabGroupChipContextMenuItems != null
|
|
12338
12450
|
},
|
|
12339
|
-
{
|
|
12340
|
-
optionKey: "createContextMenuItemComponent",
|
|
12341
|
-
reason: "createContextMenuItemComponent",
|
|
12342
|
-
moduleName: "ContextMenu",
|
|
12343
|
-
when: (o) => o.createContextMenuItemComponent != null
|
|
12344
|
-
},
|
|
12345
12451
|
{
|
|
12346
12452
|
optionKey: "dndCompass",
|
|
12347
12453
|
reason: "dndCompass",
|
|
@@ -13043,7 +13149,18 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
13043
13149
|
prev = next;
|
|
13044
13150
|
const panel = group.activePanel;
|
|
13045
13151
|
if (!panel) return;
|
|
13046
|
-
|
|
13152
|
+
let kind;
|
|
13153
|
+
switch (next) {
|
|
13154
|
+
case "floating":
|
|
13155
|
+
kind = "float";
|
|
13156
|
+
break;
|
|
13157
|
+
case "popout":
|
|
13158
|
+
kind = "popout";
|
|
13159
|
+
break;
|
|
13160
|
+
default:
|
|
13161
|
+
kind = "dock";
|
|
13162
|
+
break;
|
|
13163
|
+
}
|
|
13047
13164
|
this._announce(panel, kind);
|
|
13048
13165
|
});
|
|
13049
13166
|
this._locationSubs.set(group.id, sub);
|
|
@@ -13092,29 +13209,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
13092
13209
|
serviceKey: "liveRegionService",
|
|
13093
13210
|
create: (host) => new LiveRegionService(host)
|
|
13094
13211
|
});
|
|
13095
|
-
/** Cursor offset of the group drag ghost
|
|
13212
|
+
/** Cursor offset of the group drag ghost. */
|
|
13096
13213
|
const GROUP_DRAG_GHOST_OFFSET_X = 30;
|
|
13097
13214
|
const GROUP_DRAG_GHOST_OFFSET_Y = -10;
|
|
13098
13215
|
/**
|
|
13099
|
-
* The narrow surface the {@link AdvancedDnDService} needs from the host
|
|
13100
|
-
* (the `DockviewComponent`).
|
|
13101
|
-
*
|
|
13102
|
-
* The `onWill*` emitters stay on the component so the public event shape is
|
|
13103
|
-
* unchanged whether or not this module is registered; the service is only the
|
|
13104
|
-
* dispatch point those fires are routed through. Engine policy (e.g. the
|
|
13105
|
-
* `disableDnd` guard) stays on the component, ahead of the dispatch.
|
|
13106
|
-
*/
|
|
13107
|
-
/**
|
|
13108
13216
|
* Owns the dispatch of the advanced drag-and-drop hooks: `onWillDragPanel`,
|
|
13109
|
-
* `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay
|
|
13110
|
-
*
|
|
13111
|
-
*
|
|
13112
|
-
* emitters; the customisation surface it gates (custom drop overlays, custom
|
|
13113
|
-
* group drag ghosts, hook veto/transform behaviour) is currently inlined in
|
|
13114
|
-
* core and is extracted into this service in later phases. Routing the
|
|
13115
|
-
* dispatch through a module slot is what lets that customisation layer move
|
|
13116
|
-
* into a separately-distributed package in a future major version without
|
|
13117
|
-
* changing the public event surface.
|
|
13217
|
+
* `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay`, forwarding each to
|
|
13218
|
+
* the host's emitters so the public event shape is unchanged whether or not
|
|
13219
|
+
* this module is registered.
|
|
13118
13220
|
*
|
|
13119
13221
|
* The service holds no drag state of its own. The gesture is driven by the
|
|
13120
13222
|
* DnD backends, and the per-group subscriptions live on the component's group
|
|
@@ -13231,7 +13333,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
13231
13333
|
];
|
|
13232
13334
|
var PositionCache = class {
|
|
13233
13335
|
constructor() {
|
|
13234
|
-
this.cache = /* @__PURE__ */ new
|
|
13336
|
+
this.cache = /* @__PURE__ */ new WeakMap();
|
|
13235
13337
|
this.currentFrameId = 0;
|
|
13236
13338
|
this.rafId = null;
|
|
13237
13339
|
}
|
|
@@ -14876,7 +14978,22 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14876
14978
|
const rect = candidate.element.getBoundingClientRect();
|
|
14877
14979
|
const dx = rect.left + rect.width / 2 - fromX;
|
|
14878
14980
|
const dy = rect.top + rect.height / 2 - fromY;
|
|
14879
|
-
|
|
14981
|
+
let inDirection;
|
|
14982
|
+
switch (direction) {
|
|
14983
|
+
case "left":
|
|
14984
|
+
inDirection = dx < 0 && Math.abs(dx) >= Math.abs(dy);
|
|
14985
|
+
break;
|
|
14986
|
+
case "right":
|
|
14987
|
+
inDirection = dx > 0 && Math.abs(dx) >= Math.abs(dy);
|
|
14988
|
+
break;
|
|
14989
|
+
case "up":
|
|
14990
|
+
inDirection = dy < 0 && Math.abs(dy) >= Math.abs(dx);
|
|
14991
|
+
break;
|
|
14992
|
+
default:
|
|
14993
|
+
inDirection = dy > 0 && Math.abs(dy) >= Math.abs(dx);
|
|
14994
|
+
break;
|
|
14995
|
+
}
|
|
14996
|
+
if (!inDirection) continue;
|
|
14880
14997
|
const distance = dx * dx + dy * dy;
|
|
14881
14998
|
if (distance < bestDistance) {
|
|
14882
14999
|
bestDistance = distance;
|
|
@@ -15724,11 +15841,15 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
15724
15841
|
/**
|
|
15725
15842
|
* Reveal (create-or-fill) the edge group at `position` and move the dragged
|
|
15726
15843
|
* item described by `data` into it. A newly created edge group is created
|
|
15727
|
-
* collapsed
|
|
15728
|
-
* later emptied
|
|
15729
|
-
*
|
|
15730
|
-
*
|
|
15731
|
-
*
|
|
15844
|
+
* collapsed, flagged `autoReveal` so it tears down to zero footprint when
|
|
15845
|
+
* later emptied, and takes its auto-hide state from `options.autoHide`. If an
|
|
15846
|
+
* edge group already exists there it is reused: the panel is added to its
|
|
15847
|
+
* tabs and its collapsed/toggled *and auto-hide* state are left as-is (never
|
|
15848
|
+
* re-created; `addEdgeGroup` throws on a duplicate position). This keeps a
|
|
15849
|
+
* drag-reveal from silently converting a static edge group into an
|
|
15850
|
+
* auto-hiding one; to change an existing group's auto-hide, call
|
|
15851
|
+
* `api.getEdgeGroup(position)?.setAutoHide(...)` directly. No-op if the
|
|
15852
|
+
* EdgeGroup module is absent.
|
|
15732
15853
|
*
|
|
15733
15854
|
* This is the primitive behind the dock-to-edge groups: the two-band
|
|
15734
15855
|
* drag-reveal affordance routes its outer-band drops here.
|
|
@@ -15747,7 +15868,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
15747
15868
|
collapsed: true
|
|
15748
15869
|
});
|
|
15749
15870
|
group = service.get(position);
|
|
15750
|
-
}
|
|
15871
|
+
}
|
|
15751
15872
|
if (!group) return;
|
|
15752
15873
|
this.moveGroupOrPanel({
|
|
15753
15874
|
from: {
|
|
@@ -16278,6 +16399,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16278
16399
|
height: options.initialHeight
|
|
16279
16400
|
};
|
|
16280
16401
|
let index;
|
|
16402
|
+
const shouldSkipSetActive = (group) => !!options.inactive && group.model.size > 0;
|
|
16281
16403
|
if (options.position) if (isPanelOptionsWithPanel(options.position)) {
|
|
16282
16404
|
const referencePanel = typeof options.position.referencePanel === "string" ? this.getGroupPanel(options.position.referencePanel) : options.position.referencePanel;
|
|
16283
16405
|
index = options.position.index;
|
|
@@ -16300,7 +16422,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16300
16422
|
const group = this.orthogonalize(directionToPosition(options.position.direction));
|
|
16301
16423
|
const panel = this.createPanel(options, group);
|
|
16302
16424
|
group.model.openPanel(panel, {
|
|
16303
|
-
skipSetActive:
|
|
16425
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16304
16426
|
skipSetGroupActive: options.inactive,
|
|
16305
16427
|
index
|
|
16306
16428
|
});
|
|
@@ -16327,14 +16449,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16327
16449
|
}));
|
|
16328
16450
|
panel = this.createPanel(options, group);
|
|
16329
16451
|
group.model.openPanel(panel, {
|
|
16330
|
-
skipSetActive:
|
|
16452
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16331
16453
|
skipSetGroupActive: options.inactive,
|
|
16332
16454
|
index
|
|
16333
16455
|
});
|
|
16334
16456
|
} else if (referenceGroup.api.location.type === "floating" || referenceGroup.api.location.type === "edge" || target === "center") {
|
|
16335
16457
|
panel = this.createPanel(options, referenceGroup);
|
|
16336
16458
|
referenceGroup.model.openPanel(panel, {
|
|
16337
|
-
skipSetActive:
|
|
16459
|
+
skipSetActive: shouldSkipSetActive(referenceGroup),
|
|
16338
16460
|
skipSetGroupActive: options.inactive,
|
|
16339
16461
|
index
|
|
16340
16462
|
});
|
|
@@ -16349,7 +16471,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16349
16471
|
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);
|
|
16350
16472
|
panel = this.createPanel(options, group);
|
|
16351
16473
|
group.model.openPanel(panel, {
|
|
16352
|
-
skipSetActive:
|
|
16474
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16353
16475
|
skipSetGroupActive: options.inactive,
|
|
16354
16476
|
index
|
|
16355
16477
|
});
|
|
@@ -16366,7 +16488,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16366
16488
|
}));
|
|
16367
16489
|
panel = this.createPanel(options, group);
|
|
16368
16490
|
group.model.openPanel(panel, {
|
|
16369
|
-
skipSetActive:
|
|
16491
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16370
16492
|
skipSetGroupActive: options.inactive,
|
|
16371
16493
|
index
|
|
16372
16494
|
});
|
|
@@ -16374,7 +16496,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16374
16496
|
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);
|
|
16375
16497
|
panel = this.createPanel(options, group);
|
|
16376
16498
|
group.model.openPanel(panel, {
|
|
16377
|
-
skipSetActive:
|
|
16499
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16378
16500
|
skipSetGroupActive: options.inactive,
|
|
16379
16501
|
index
|
|
16380
16502
|
});
|