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
package/dist/dockview-core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
*/
|
|
@@ -21,7 +21,9 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/dnd/dataTransfer.ts
|
|
23
23
|
var _LocalSelectionTransfer;
|
|
24
|
-
var TransferObject = class {
|
|
24
|
+
var TransferObject = class {
|
|
25
|
+
constructor() {}
|
|
26
|
+
};
|
|
25
27
|
var PanelTransfer = class extends TransferObject {
|
|
26
28
|
constructor(viewId, groupId, panelId, tabGroupId) {
|
|
27
29
|
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) {
|
|
@@ -545,8 +558,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
545
558
|
let previousScreenX = window.screenX;
|
|
546
559
|
let previousScreenY = window.screenY;
|
|
547
560
|
let timeout;
|
|
561
|
+
let rafHandle = 0;
|
|
562
|
+
let stopped = false;
|
|
548
563
|
const checkMovement = () => {
|
|
549
|
-
if (window.closed) return;
|
|
564
|
+
if (stopped || window.closed) return;
|
|
550
565
|
const currentScreenX = window.screenX;
|
|
551
566
|
const currentScreenY = window.screenY;
|
|
552
567
|
if (currentScreenX !== previousScreenX || currentScreenY !== previousScreenY) {
|
|
@@ -557,9 +572,18 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
557
572
|
previousScreenX = currentScreenX;
|
|
558
573
|
previousScreenY = currentScreenY;
|
|
559
574
|
}
|
|
560
|
-
requestAnimationFrame(checkMovement);
|
|
575
|
+
rafHandle = requestAnimationFrame(checkMovement);
|
|
561
576
|
};
|
|
562
577
|
checkMovement();
|
|
578
|
+
const disposeEmitter = emitter.dispose.bind(emitter);
|
|
579
|
+
emitter.dispose = () => {
|
|
580
|
+
if (!stopped) {
|
|
581
|
+
stopped = true;
|
|
582
|
+
cancelAnimationFrame(rafHandle);
|
|
583
|
+
clearTimeout(timeout);
|
|
584
|
+
}
|
|
585
|
+
disposeEmitter();
|
|
586
|
+
};
|
|
563
587
|
return emitter;
|
|
564
588
|
}
|
|
565
589
|
function onDidWindowResizeEnd(element, cb) {
|
|
@@ -695,6 +719,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
695
719
|
set size(size) {
|
|
696
720
|
this._size = size;
|
|
697
721
|
}
|
|
722
|
+
setContainerGeometry(prop, value) {
|
|
723
|
+
if (this._appliedStyles[prop] === value) return;
|
|
724
|
+
this._appliedStyles[prop] = value;
|
|
725
|
+
this.container.style[prop] = value;
|
|
726
|
+
}
|
|
698
727
|
get size() {
|
|
699
728
|
return this._size;
|
|
700
729
|
}
|
|
@@ -730,6 +759,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
730
759
|
this.view = view;
|
|
731
760
|
this.disposable = disposable;
|
|
732
761
|
this._cachedVisibleSize = void 0;
|
|
762
|
+
this._appliedStyles = {};
|
|
733
763
|
if (typeof size === "number") {
|
|
734
764
|
this._size = size;
|
|
735
765
|
this._cachedVisibleSize = void 0;
|
|
@@ -778,6 +808,16 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
778
808
|
LayoutPriority["Normal"] = "normal";
|
|
779
809
|
return LayoutPriority;
|
|
780
810
|
}({});
|
|
811
|
+
function setSashPosition(sash, left, top) {
|
|
812
|
+
if (sash.appliedLeft !== left) {
|
|
813
|
+
sash.appliedLeft = left;
|
|
814
|
+
sash.container.style.left = left;
|
|
815
|
+
}
|
|
816
|
+
if (sash.appliedTop !== top) {
|
|
817
|
+
sash.appliedTop = top;
|
|
818
|
+
sash.container.style.top = top;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
781
821
|
let Sizing;
|
|
782
822
|
(function(_Sizing) {
|
|
783
823
|
_Sizing.Distribute = { type: "distribute" };
|
|
@@ -896,10 +936,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
896
936
|
pushToEnd(upIndexes, i);
|
|
897
937
|
pushToEnd(downIndexes, i);
|
|
898
938
|
}
|
|
899
|
-
const upItems = upIndexes.map((i) => this.viewItems[i]);
|
|
900
|
-
const upSizes = upIndexes.map((i) => sizes[i]);
|
|
901
|
-
const downItems = downIndexes.map((i) => this.viewItems[i]);
|
|
902
|
-
const downSizes = downIndexes.map((i) => sizes[i]);
|
|
903
939
|
const minDeltaUp = upIndexes.reduce((_, i) => _ + this.viewItems[i].minimumSize - sizes[i], 0);
|
|
904
940
|
const maxDeltaUp = upIndexes.reduce((_, i) => _ + this.viewItems[i].maximumSize - sizes[i], 0);
|
|
905
941
|
const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((_, i) => _ + sizes[i] - this.viewItems[i].minimumSize, 0);
|
|
@@ -923,19 +959,21 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
923
959
|
const tentativeDelta = clamp(delta, minDelta, maxDelta);
|
|
924
960
|
let actualDelta = 0;
|
|
925
961
|
let deltaUp = tentativeDelta;
|
|
926
|
-
for (
|
|
927
|
-
const item =
|
|
928
|
-
const
|
|
929
|
-
const
|
|
962
|
+
for (const upIndex of upIndexes) {
|
|
963
|
+
const item = this.viewItems[upIndex];
|
|
964
|
+
const priorSize = sizes[upIndex];
|
|
965
|
+
const size = clamp(priorSize + deltaUp, item.minimumSize, item.maximumSize);
|
|
966
|
+
const viewDelta = size - priorSize;
|
|
930
967
|
actualDelta += viewDelta;
|
|
931
968
|
deltaUp -= viewDelta;
|
|
932
969
|
item.size = size;
|
|
933
970
|
}
|
|
934
971
|
let deltaDown = actualDelta;
|
|
935
|
-
for (
|
|
936
|
-
const item =
|
|
937
|
-
const
|
|
938
|
-
const
|
|
972
|
+
for (const downIndex of downIndexes) {
|
|
973
|
+
const item = this.viewItems[downIndex];
|
|
974
|
+
const priorSize = sizes[downIndex];
|
|
975
|
+
const size = clamp(priorSize - deltaDown, item.minimumSize, item.maximumSize);
|
|
976
|
+
const viewDelta = size - priorSize;
|
|
939
977
|
deltaDown += viewDelta;
|
|
940
978
|
item.size = size;
|
|
941
979
|
}
|
|
@@ -1183,13 +1221,22 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1183
1221
|
this.saveProportions();
|
|
1184
1222
|
}
|
|
1185
1223
|
distributeEmptySpace(lowPriorityIndex) {
|
|
1186
|
-
|
|
1224
|
+
let contentSize = 0;
|
|
1225
|
+
for (const item of this.viewItems) contentSize += item.size;
|
|
1187
1226
|
let emptyDelta = this.size - contentSize;
|
|
1227
|
+
if (emptyDelta === 0) return;
|
|
1188
1228
|
const indexes = range(this.viewItems.length - 1, -1);
|
|
1189
|
-
|
|
1190
|
-
const
|
|
1191
|
-
|
|
1192
|
-
|
|
1229
|
+
let hasPriority = false;
|
|
1230
|
+
for (const item of this.viewItems) if (item.priority === "low" || item.priority === "high") {
|
|
1231
|
+
hasPriority = true;
|
|
1232
|
+
break;
|
|
1233
|
+
}
|
|
1234
|
+
if (hasPriority) {
|
|
1235
|
+
const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "low");
|
|
1236
|
+
const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === "high");
|
|
1237
|
+
for (const index of highPriorityIndexes) pushToStart(indexes, index);
|
|
1238
|
+
for (const index of lowPriorityIndexes) pushToEnd(indexes, index);
|
|
1239
|
+
}
|
|
1193
1240
|
if (typeof lowPriorityIndex === "number") pushToEnd(indexes, lowPriorityIndex);
|
|
1194
1241
|
for (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) {
|
|
1195
1242
|
const item = this.viewItems[indexes[i]];
|
|
@@ -1212,49 +1259,45 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1212
1259
|
* For each view `i` the offet must be adjusted by `m * i/(n - 1)`.
|
|
1213
1260
|
*/
|
|
1214
1261
|
layoutViews() {
|
|
1215
|
-
|
|
1262
|
+
let contentSize = 0;
|
|
1263
|
+
let visibleViewCount = 0;
|
|
1264
|
+
for (const item of this.viewItems) {
|
|
1265
|
+
contentSize += item.size;
|
|
1266
|
+
if (item.visible) visibleViewCount++;
|
|
1267
|
+
}
|
|
1268
|
+
this._contentSize = contentSize;
|
|
1216
1269
|
this.updateSashEnablement();
|
|
1217
1270
|
if (this.viewItems.length === 0) return;
|
|
1218
|
-
const
|
|
1219
|
-
const
|
|
1220
|
-
const marginReducedSize = this.margin * sashCount / Math.max(1, visibleViewItems.length);
|
|
1271
|
+
const sashCount = Math.max(0, visibleViewCount - 1);
|
|
1272
|
+
const marginReducedSize = this.margin * sashCount / Math.max(1, visibleViewCount);
|
|
1221
1273
|
let totalLeftOffset = 0;
|
|
1222
1274
|
const viewLeftOffsets = [];
|
|
1223
1275
|
const sashWidth = 4;
|
|
1224
|
-
|
|
1225
|
-
const flag = viewItem.visible ? 1 : 0;
|
|
1226
|
-
if (i === 0) arr.push(flag);
|
|
1227
|
-
else arr.push(arr[i - 1] + flag);
|
|
1228
|
-
return arr;
|
|
1229
|
-
}, []);
|
|
1276
|
+
let runningVisiblePanelCount = 0;
|
|
1230
1277
|
this.viewItems.forEach((view, i) => {
|
|
1231
1278
|
totalLeftOffset += this.viewItems[i].size;
|
|
1232
1279
|
viewLeftOffsets.push(totalLeftOffset);
|
|
1280
|
+
runningVisiblePanelCount += view.visible ? 1 : 0;
|
|
1233
1281
|
const size = view.visible ? view.size - marginReducedSize : 0;
|
|
1234
|
-
const visiblePanelsBeforeThisView = Math.max(0, runningVisiblePanelCount
|
|
1282
|
+
const visiblePanelsBeforeThisView = Math.max(0, runningVisiblePanelCount - 1);
|
|
1235
1283
|
const offset = i === 0 || visiblePanelsBeforeThisView === 0 ? 0 : viewLeftOffsets[i - 1] + visiblePanelsBeforeThisView / sashCount * marginReducedSize;
|
|
1236
1284
|
if (i < this.viewItems.length - 1) {
|
|
1237
1285
|
const newSize = view.visible ? offset + size - sashWidth / 2 + this.margin / 2 : offset;
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
}
|
|
1242
|
-
if (this._orientation === "VERTICAL") {
|
|
1243
|
-
this.sashes[i].container.style.left = `0px`;
|
|
1244
|
-
this.sashes[i].container.style.top = `${newSize}px`;
|
|
1245
|
-
}
|
|
1286
|
+
const sash = this.sashes[i];
|
|
1287
|
+
if (this._orientation === "HORIZONTAL") setSashPosition(sash, `${newSize}px`, `0px`);
|
|
1288
|
+
if (this._orientation === "VERTICAL") setSashPosition(sash, `0px`, `${newSize}px`);
|
|
1246
1289
|
}
|
|
1247
1290
|
if (this._orientation === "HORIZONTAL") {
|
|
1248
|
-
view.
|
|
1249
|
-
view.
|
|
1250
|
-
view.
|
|
1251
|
-
view.
|
|
1291
|
+
view.setContainerGeometry("width", `${size}px`);
|
|
1292
|
+
view.setContainerGeometry("left", `${offset}px`);
|
|
1293
|
+
view.setContainerGeometry("top", "");
|
|
1294
|
+
view.setContainerGeometry("height", "");
|
|
1252
1295
|
}
|
|
1253
1296
|
if (this._orientation === "VERTICAL") {
|
|
1254
|
-
view.
|
|
1255
|
-
view.
|
|
1256
|
-
view.
|
|
1257
|
-
view.
|
|
1297
|
+
view.setContainerGeometry("height", `${size}px`);
|
|
1298
|
+
view.setContainerGeometry("top", `${offset}px`);
|
|
1299
|
+
view.setContainerGeometry("width", "");
|
|
1300
|
+
view.setContainerGeometry("left", "");
|
|
1258
1301
|
}
|
|
1259
1302
|
view.view.layout(view.size - marginReducedSize, this._orthogonalSize);
|
|
1260
1303
|
});
|
|
@@ -1272,6 +1315,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1272
1315
|
}
|
|
1273
1316
|
}
|
|
1274
1317
|
updateSashEnablement() {
|
|
1318
|
+
if (this.sashes.length === 0) return;
|
|
1275
1319
|
let previous = false;
|
|
1276
1320
|
const collapsesDown = this.viewItems.map((i) => previous = i.size - i.minimumSize > 0 || previous);
|
|
1277
1321
|
previous = false;
|
|
@@ -1578,10 +1622,20 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1578
1622
|
return this.orientation === "HORIZONTAL" ? this.orthogonalSize : this.size;
|
|
1579
1623
|
}
|
|
1580
1624
|
get minimumSize() {
|
|
1581
|
-
|
|
1625
|
+
if (this._cachedMinimumSize === void 0) {
|
|
1626
|
+
let value = 0;
|
|
1627
|
+
for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.max(value, this.children[index].minimumOrthogonalSize);
|
|
1628
|
+
this._cachedMinimumSize = value;
|
|
1629
|
+
}
|
|
1630
|
+
return this._cachedMinimumSize;
|
|
1582
1631
|
}
|
|
1583
1632
|
get maximumSize() {
|
|
1584
|
-
|
|
1633
|
+
if (this._cachedMaximumSize === void 0) {
|
|
1634
|
+
let value = Number.POSITIVE_INFINITY;
|
|
1635
|
+
for (let index = 0; index < this.children.length; index++) if (this.splitview.isViewVisible(index)) value = Math.min(value, this.children[index].maximumOrthogonalSize);
|
|
1636
|
+
this._cachedMaximumSize = value;
|
|
1637
|
+
}
|
|
1638
|
+
return this._cachedMaximumSize;
|
|
1585
1639
|
}
|
|
1586
1640
|
get minimumOrthogonalSize() {
|
|
1587
1641
|
return this.splitview.minimumSize;
|
|
@@ -1608,15 +1662,29 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1608
1662
|
return this.orientation === "HORIZONTAL" ? this.maximumSize : this.maximumOrthogonalSize;
|
|
1609
1663
|
}
|
|
1610
1664
|
get priority() {
|
|
1665
|
+
var _this$_cachedPriority;
|
|
1666
|
+
(_this$_cachedPriority = this._cachedPriority) !== null && _this$_cachedPriority !== void 0 || (this._cachedPriority = this.computePriority());
|
|
1667
|
+
return this._cachedPriority;
|
|
1668
|
+
}
|
|
1669
|
+
computePriority() {
|
|
1611
1670
|
if (this.children.length === 0) return "normal";
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1671
|
+
let hasHigh = false;
|
|
1672
|
+
let hasLow = false;
|
|
1673
|
+
for (const child of this.children) {
|
|
1674
|
+
var _child$priority;
|
|
1675
|
+
const priority = (_child$priority = child.priority) !== null && _child$priority !== void 0 ? _child$priority : "normal";
|
|
1676
|
+
if (priority === "high") hasHigh = true;
|
|
1677
|
+
else if (priority === "low") hasLow = true;
|
|
1678
|
+
}
|
|
1679
|
+
if (hasHigh) return "high";
|
|
1680
|
+
else if (hasLow) return "low";
|
|
1618
1681
|
return "normal";
|
|
1619
1682
|
}
|
|
1683
|
+
invalidateCachedSizes() {
|
|
1684
|
+
this._cachedMinimumSize = void 0;
|
|
1685
|
+
this._cachedMaximumSize = void 0;
|
|
1686
|
+
this._cachedPriority = void 0;
|
|
1687
|
+
}
|
|
1620
1688
|
get disabled() {
|
|
1621
1689
|
return this.splitview.disabled;
|
|
1622
1690
|
}
|
|
@@ -1692,6 +1760,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1692
1760
|
if (this.splitview.isViewVisible(index) === visible) return;
|
|
1693
1761
|
const wereAllChildrenHidden = this.splitview.contentSize === 0;
|
|
1694
1762
|
this.splitview.setViewVisible(index, visible);
|
|
1763
|
+
this.invalidateCachedSizes();
|
|
1695
1764
|
const areAllChildrenHidden = this.splitview.contentSize === 0;
|
|
1696
1765
|
if (visible && wereAllChildrenHidden || !visible && areAllChildrenHidden) this._onDidVisibilityChange.fire({ visible });
|
|
1697
1766
|
}
|
|
@@ -1740,12 +1809,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1740
1809
|
return child;
|
|
1741
1810
|
}
|
|
1742
1811
|
setupChildrenEvents() {
|
|
1812
|
+
this.invalidateCachedSizes();
|
|
1743
1813
|
this._childrenDisposable.dispose();
|
|
1744
1814
|
this._childrenDisposable = new CompositeDisposable(Event.any(...this.children.map((c) => c.onDidChange))((e) => {
|
|
1745
1815
|
/**
|
|
1746
1816
|
* indicate a change has occured to allows any re-rendering but don't bubble
|
|
1747
1817
|
* event because that was specific to this branch
|
|
1748
1818
|
*/
|
|
1819
|
+
this.invalidateCachedSizes();
|
|
1749
1820
|
this._onDidChange.fire({ size: e.orthogonalSize });
|
|
1750
1821
|
}), ...this.children.map((c, i) => {
|
|
1751
1822
|
if (c instanceof BranchNode) return c.onDidVisibilityChange(({ visible }) => {
|
|
@@ -3422,7 +3493,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3422
3493
|
* Add a group and return the created object.
|
|
3423
3494
|
*/
|
|
3424
3495
|
addGroup(options) {
|
|
3425
|
-
return this.component.addGroup(options);
|
|
3496
|
+
return this.component.withOrigin("api", () => this.component.addGroup(options));
|
|
3426
3497
|
}
|
|
3427
3498
|
/**
|
|
3428
3499
|
* Close all groups and panels.
|
|
@@ -3560,13 +3631,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3560
3631
|
this.activatePrevious(options);
|
|
3561
3632
|
}
|
|
3562
3633
|
maximizeGroup(panel) {
|
|
3563
|
-
this.component.maximizeGroup(panel.group);
|
|
3634
|
+
this.component.withOrigin("api", () => this.component.maximizeGroup(panel.group));
|
|
3564
3635
|
}
|
|
3565
3636
|
hasMaximizedGroup() {
|
|
3566
3637
|
return this.component.hasMaximizedGroup();
|
|
3567
3638
|
}
|
|
3568
3639
|
exitMaximizedGroup() {
|
|
3569
|
-
this.component.exitMaximizedGroup();
|
|
3640
|
+
this.component.withOrigin("api", () => this.component.exitMaximizedGroup());
|
|
3570
3641
|
}
|
|
3571
3642
|
get onDidMaximizedGroupChange() {
|
|
3572
3643
|
return this.component.onDidMaximizedGroupChange;
|
|
@@ -5521,9 +5592,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
5521
5592
|
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);
|
|
5522
5593
|
if (((_this$panel = this.panel) === null || _this$panel === void 0 ? void 0 : _this$panel.view.content.element.parentElement) === this._element) {
|
|
5523
5594
|
var _this$panel$view$cont, _this$panel$view$cont2;
|
|
5524
|
-
/**
|
|
5525
|
-
* If the currently attached panel is mounted directly to the content then remove it
|
|
5526
|
-
*/
|
|
5527
5595
|
this.panel.view.content.element.remove();
|
|
5528
5596
|
(_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);
|
|
5529
5597
|
}
|
|
@@ -6264,7 +6332,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
6264
6332
|
this.element.appendChild(this._scrollbar);
|
|
6265
6333
|
this.addDisposables(addDisposableListener(this.element, "wheel", (event) => {
|
|
6266
6334
|
this._scrollOffset += event.deltaY * Scrollbar.MouseWheelSpeed;
|
|
6267
|
-
this.
|
|
6335
|
+
this.scheduleStyleUpdate();
|
|
6268
6336
|
}), addDisposableListener(this._scrollbar, "pointerdown", (event) => {
|
|
6269
6337
|
var _this$_scrollbar$owne;
|
|
6270
6338
|
event.preventDefault();
|
|
@@ -6276,7 +6344,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
6276
6344
|
const delta = this._orientation === "horizontal" ? event.clientX - originalClient : event.clientY - originalClient;
|
|
6277
6345
|
const p = (this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight) / (this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight);
|
|
6278
6346
|
this._scrollOffset = originalScrollOffset + delta / p;
|
|
6279
|
-
this.
|
|
6347
|
+
this.scheduleStyleUpdate();
|
|
6280
6348
|
};
|
|
6281
6349
|
const onEnd = () => {
|
|
6282
6350
|
toggleClass(this.element, "dv-scrollable-scrolling", false);
|
|
@@ -6288,10 +6356,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
6288
6356
|
doc.addEventListener("pointerup", onEnd);
|
|
6289
6357
|
doc.addEventListener("pointercancel", onEnd);
|
|
6290
6358
|
}), addDisposableListener(this.element, "scroll", () => {
|
|
6291
|
-
this.
|
|
6359
|
+
this.scheduleStyleUpdate();
|
|
6292
6360
|
}), addDisposableListener(this.scrollableElement, "scroll", () => {
|
|
6293
6361
|
this._scrollOffset = this._orientation === "horizontal" ? this.scrollableElement.scrollLeft : this.scrollableElement.scrollTop;
|
|
6294
|
-
this.
|
|
6362
|
+
this.scheduleStyleUpdate();
|
|
6295
6363
|
}), watchElementResize(this.element, () => {
|
|
6296
6364
|
toggleClass(this.element, "dv-scrollable-resizing", true);
|
|
6297
6365
|
if (this._animationTimer) clearTimeout(this._animationTimer);
|
|
@@ -6299,9 +6367,29 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
6299
6367
|
clearTimeout(this._animationTimer);
|
|
6300
6368
|
toggleClass(this.element, "dv-scrollable-resizing", false);
|
|
6301
6369
|
}, 500);
|
|
6302
|
-
this.
|
|
6370
|
+
this.scheduleStyleUpdate();
|
|
6371
|
+
}), Disposable.from(() => {
|
|
6372
|
+
if (this._pendingStyleFrame !== void 0) {
|
|
6373
|
+
cancelAnimationFrame(this._pendingStyleFrame);
|
|
6374
|
+
this._pendingStyleFrame = void 0;
|
|
6375
|
+
}
|
|
6303
6376
|
}));
|
|
6304
6377
|
}
|
|
6378
|
+
/**
|
|
6379
|
+
* Coalesce the scrollbar restyle to one pass per animation frame. The
|
|
6380
|
+
* wheel / scroll / pointermove handlers can each fire many times per frame,
|
|
6381
|
+
* and `calculateScrollbarStyles` both reads layout (`clientWidth`/
|
|
6382
|
+
* `scrollWidth`) and writes styles + `scrollLeft`/`scrollTop`; running it
|
|
6383
|
+
* synchronously per event caused repeated read→write→read reflow. Batching
|
|
6384
|
+
* to a frame keeps a burst of events to a single measure+write.
|
|
6385
|
+
*/
|
|
6386
|
+
scheduleStyleUpdate() {
|
|
6387
|
+
if (this._pendingStyleFrame !== void 0) return;
|
|
6388
|
+
this._pendingStyleFrame = requestAnimationFrame(() => {
|
|
6389
|
+
this._pendingStyleFrame = void 0;
|
|
6390
|
+
this.calculateScrollbarStyles();
|
|
6391
|
+
});
|
|
6392
|
+
}
|
|
6305
6393
|
calculateScrollbarStyles() {
|
|
6306
6394
|
const clientSize = this._orientation === "horizontal" ? this.element.clientWidth : this.element.clientHeight;
|
|
6307
6395
|
const scrollSize = this._orientation === "horizontal" ? this.scrollableElement.scrollWidth : this.scrollableElement.scrollHeight;
|
|
@@ -8762,8 +8850,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
8762
8850
|
}, true), addDisposableListener(this._tabsList, "dragend", () => {
|
|
8763
8851
|
this._reorder.resetDragAnimation();
|
|
8764
8852
|
}), addDisposableListener(this._tabsList, "drop", (event) => {
|
|
8765
|
-
var _this$accessor$option, _this$group$model$dro;
|
|
8766
|
-
if (
|
|
8853
|
+
var _this$_animState3, _this$accessor$option, _this$group$model$dro;
|
|
8854
|
+
if (((_this$_animState3 = this._animState) === null || _this$_animState3 === void 0 ? void 0 : _this$_animState3.currentInsertionIndex) == null) return;
|
|
8767
8855
|
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;
|
|
8768
8856
|
event.stopPropagation();
|
|
8769
8857
|
event.preventDefault();
|
|
@@ -8968,7 +9056,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
8968
9056
|
};
|
|
8969
9057
|
this._pendingCollapse = true;
|
|
8970
9058
|
requestAnimationFrame(() => {
|
|
8971
|
-
var _this$
|
|
9059
|
+
var _this$_animState4, _this$_animState4$cur;
|
|
8972
9060
|
this._pendingCollapse = false;
|
|
8973
9061
|
if (!this._animState) return;
|
|
8974
9062
|
if (!this._tabsList.classList.contains("dv-tabs-container--wrap")) {
|
|
@@ -8976,7 +9064,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
8976
9064
|
toggleClass(tab.element, "dv-tab--dragging", true);
|
|
8977
9065
|
tab.element.offsetHeight;
|
|
8978
9066
|
}
|
|
8979
|
-
(_this$
|
|
9067
|
+
(_this$_animState4$cur = (_this$_animState4 = this._animState).currentInsertionIndex) !== null && _this$_animState4$cur !== void 0 || (_this$_animState4.currentInsertionIndex = sourceIndex);
|
|
8980
9068
|
this.applyDragOverTransforms(true);
|
|
8981
9069
|
tab.element.style.removeProperty("transition");
|
|
8982
9070
|
});
|
|
@@ -9065,8 +9153,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
9065
9153
|
}
|
|
9066
9154
|
}
|
|
9067
9155
|
delete(id) {
|
|
9068
|
-
var _this$
|
|
9069
|
-
if (((_this$
|
|
9156
|
+
var _this$_animState5;
|
|
9157
|
+
if (((_this$_animState5 = this._animState) === null || _this$_animState5 === void 0 ? void 0 : _this$_animState5.sourceTabId) === id) {
|
|
9070
9158
|
this.resetTabTransforms();
|
|
9071
9159
|
this._animState = null;
|
|
9072
9160
|
}
|
|
@@ -9183,7 +9271,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
9183
9271
|
const groupPanelIds = new Set(tabGroup.panelIds);
|
|
9184
9272
|
this._pendingCollapse = true;
|
|
9185
9273
|
requestAnimationFrame(() => {
|
|
9186
|
-
var _this$
|
|
9274
|
+
var _this$_animState6, _this$_animState6$cur;
|
|
9187
9275
|
this._pendingCollapse = false;
|
|
9188
9276
|
if (!this._animState) return;
|
|
9189
9277
|
for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) {
|
|
@@ -9198,7 +9286,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
9198
9286
|
this._tabsList.offsetHeight;
|
|
9199
9287
|
const underline = this._tabGroupManager.groupUnderlines.get(tabGroup.id);
|
|
9200
9288
|
if (underline) underline.style.display = "none";
|
|
9201
|
-
(_this$
|
|
9289
|
+
(_this$_animState6$cur = (_this$_animState6 = this._animState).currentInsertionIndex) !== null && _this$_animState6$cur !== void 0 || (_this$_animState6.currentInsertionIndex = firstIdx);
|
|
9202
9290
|
this.applyDragOverTransforms(true);
|
|
9203
9291
|
for (const t of this._tabs) if (groupPanelIds.has(t.value.panel.id)) t.value.element.style.removeProperty("transition");
|
|
9204
9292
|
if (chipEntry) chipEntry.chip.element.style.removeProperty("transition");
|
|
@@ -9933,6 +10021,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
9933
10021
|
set headerPosition(value) {
|
|
9934
10022
|
var _this$_activePanel;
|
|
9935
10023
|
this._headerPosition = value;
|
|
10024
|
+
this.invalidateHeaderSize();
|
|
9936
10025
|
removeClasses(this.container, "dv-groupview-header-top", "dv-groupview-header-bottom", "dv-groupview-header-left", "dv-groupview-header-right");
|
|
9937
10026
|
addClasses(this.container, `dv-groupview-header-${value}`);
|
|
9938
10027
|
const direction = value === "top" || value === "bottom" ? "horizontal" : "vertical";
|
|
@@ -10074,7 +10163,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10074
10163
|
this.header.hidden = !!options.hideHeader;
|
|
10075
10164
|
this.locked = (_options$locked = options.locked) !== null && _options$locked !== void 0 ? _options$locked : false;
|
|
10076
10165
|
this.headerPosition = (_options$headerPositi = options.headerPosition) !== null && _options$headerPositi !== void 0 ? _options$headerPositi : accessor.defaultHeaderPosition;
|
|
10077
|
-
this.addDisposables(
|
|
10166
|
+
this.addDisposables(watchElementResize(this.tabsContainer.element, () => {
|
|
10167
|
+
if (this.isDisposed) return;
|
|
10168
|
+
const size = this.measureHeaderSize();
|
|
10169
|
+
if (size !== this._cachedHeaderSize) {
|
|
10170
|
+
this._cachedHeaderSize = size;
|
|
10171
|
+
this.layout(this._width, this._height);
|
|
10172
|
+
}
|
|
10173
|
+
}), this._onDidPanelTitleChange.event(() => this.updateAccessibleLabel()), this._onTabDragStart, this._onGroupDragStart, this._onWillShowOverlay, this.tabsContainer.onTabDragStart((event) => {
|
|
10078
10174
|
this._onTabDragStart.fire(event);
|
|
10079
10175
|
}), this.tabsContainer.onGroupDragStart((event) => {
|
|
10080
10176
|
this._onGroupDragStart.fire(event);
|
|
@@ -10531,16 +10627,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10531
10627
|
(_this$_activePanel3 = this._activePanel) === null || _this$_activePanel3 === void 0 || _this$_activePanel3.focus();
|
|
10532
10628
|
}
|
|
10533
10629
|
openPanel(panel, options = {}) {
|
|
10534
|
-
/**
|
|
10535
|
-
* set the panel group
|
|
10536
|
-
* add the panel
|
|
10537
|
-
* check if group active
|
|
10538
|
-
* check if panel active
|
|
10539
|
-
*/
|
|
10540
10630
|
if (typeof options.index !== "number" || options.index > this.panels.length) options.index = this.panels.length;
|
|
10541
10631
|
const skipSetActive = !!options.skipSetActive;
|
|
10542
10632
|
panel.updateParentGroup(this.groupPanel, { skipSetActive: options.skipSetActive });
|
|
10543
10633
|
this.doAddPanel(panel, options.index, { skipSetActive });
|
|
10634
|
+
this.invalidateHeaderSize();
|
|
10544
10635
|
if (this._activePanel === panel) {
|
|
10545
10636
|
this.contentContainer.renderPanel(panel, { asActive: true });
|
|
10546
10637
|
return;
|
|
@@ -10603,6 +10694,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10603
10694
|
* changing) down to the content + active panel.
|
|
10604
10695
|
*/
|
|
10605
10696
|
relayout() {
|
|
10697
|
+
this.invalidateHeaderSize();
|
|
10606
10698
|
this.layout(this._width, this._height);
|
|
10607
10699
|
}
|
|
10608
10700
|
/**
|
|
@@ -10612,17 +10704,32 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10612
10704
|
* width); a hidden header has `display:none` so its `offset*` is 0 and
|
|
10613
10705
|
* nothing is subtracted.
|
|
10614
10706
|
*/
|
|
10615
|
-
|
|
10707
|
+
/**
|
|
10708
|
+
* Measure the header's extent along its occupied axis. This is the single
|
|
10709
|
+
* forced-reflow read; it now runs only on a cache miss (first layout after
|
|
10710
|
+
* a header change) and inside the header's ResizeObserver — not on every
|
|
10711
|
+
* layout frame.
|
|
10712
|
+
*/
|
|
10713
|
+
measureHeaderSize() {
|
|
10616
10714
|
const headerEl = this.tabsContainer.element;
|
|
10715
|
+
return this.headerPosition === "top" || this.headerPosition === "bottom" ? headerEl.offsetHeight : headerEl.offsetWidth;
|
|
10716
|
+
}
|
|
10717
|
+
invalidateHeaderSize() {
|
|
10718
|
+
this._cachedHeaderSize = void 0;
|
|
10719
|
+
}
|
|
10720
|
+
contentDimensions() {
|
|
10721
|
+
var _this$_cachedHeaderSi;
|
|
10617
10722
|
const horizontal = this.headerPosition === "top" || this.headerPosition === "bottom";
|
|
10723
|
+
const headerSize = (_this$_cachedHeaderSi = this._cachedHeaderSize) !== null && _this$_cachedHeaderSi !== void 0 ? _this$_cachedHeaderSi : this._cachedHeaderSize = this.measureHeaderSize();
|
|
10618
10724
|
return {
|
|
10619
|
-
width: horizontal ? this._width : Math.max(0, this._width -
|
|
10620
|
-
height: horizontal ? Math.max(0, this._height -
|
|
10725
|
+
width: horizontal ? this._width : Math.max(0, this._width - headerSize),
|
|
10726
|
+
height: horizontal ? Math.max(0, this._height - headerSize) : this._height
|
|
10621
10727
|
};
|
|
10622
10728
|
}
|
|
10623
10729
|
_removePanel(panel, options) {
|
|
10624
10730
|
const isActivePanel = this._activePanel === panel;
|
|
10625
10731
|
this.doRemovePanel(panel);
|
|
10732
|
+
this.invalidateHeaderSize();
|
|
10626
10733
|
if (isActivePanel && this.panels.length > 0) {
|
|
10627
10734
|
const nextPanel = this.mostRecentlyUsed[0];
|
|
10628
10735
|
this.openPanel(nextPanel, {
|
|
@@ -10948,6 +11055,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10948
11055
|
if (typeof event.minimumHeight === "number" || typeof event.minimumHeight === "function") this._minimumHeight = event.minimumHeight;
|
|
10949
11056
|
if (typeof event.maximumWidth === "number" || typeof event.maximumWidth === "function") this._maximumWidth = event.maximumWidth;
|
|
10950
11057
|
if (typeof event.maximumHeight === "number" || typeof event.maximumHeight === "function") this._maximumHeight = event.maximumHeight;
|
|
11058
|
+
this._onDidChange.fire(void 0);
|
|
10951
11059
|
}), this.api.onDidSizeChange((event) => {
|
|
10952
11060
|
this._onDidChange.fire({
|
|
10953
11061
|
height: event.height,
|
|
@@ -11067,20 +11175,22 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
11067
11175
|
return this._group.model.headerPosition;
|
|
11068
11176
|
}
|
|
11069
11177
|
moveTo(options) {
|
|
11070
|
-
var _options$group, _options$position, _options$skipSetActiv, _options$position2;
|
|
11071
11178
|
if (!this._group) throw new Error(NOT_INITIALIZED_MESSAGE);
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11179
|
+
this.accessor.withOrigin("api", () => {
|
|
11180
|
+
var _options$group, _options$position, _options$skipSetActiv, _options$position2;
|
|
11181
|
+
const group = (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this.accessor.addGroup({
|
|
11182
|
+
direction: positionToDirection((_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "right"),
|
|
11183
|
+
skipSetActive: (_options$skipSetActiv = options.skipSetActive) !== null && _options$skipSetActiv !== void 0 ? _options$skipSetActiv : false
|
|
11184
|
+
});
|
|
11185
|
+
this.accessor.moveGroupOrPanel({
|
|
11186
|
+
from: { groupId: this._group.id },
|
|
11187
|
+
to: {
|
|
11188
|
+
group,
|
|
11189
|
+
position: options.group ? (_options$position2 = options.position) !== null && _options$position2 !== void 0 ? _options$position2 : "center" : "center",
|
|
11190
|
+
index: options.index
|
|
11191
|
+
},
|
|
11192
|
+
skipSetActive: options.skipSetActive
|
|
11193
|
+
});
|
|
11084
11194
|
});
|
|
11085
11195
|
}
|
|
11086
11196
|
maximize() {
|
|
@@ -11429,18 +11539,20 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
11429
11539
|
this.accessor.withOrigin("api", () => super.setActive());
|
|
11430
11540
|
}
|
|
11431
11541
|
moveTo(options) {
|
|
11432
|
-
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11542
|
+
this.accessor.withOrigin("api", () => {
|
|
11543
|
+
var _options$group, _options$position;
|
|
11544
|
+
return this.accessor.moveGroupOrPanel({
|
|
11545
|
+
from: {
|
|
11546
|
+
groupId: this._group.id,
|
|
11547
|
+
panelId: this.panel.id
|
|
11548
|
+
},
|
|
11549
|
+
to: {
|
|
11550
|
+
group: (_options$group = options.group) !== null && _options$group !== void 0 ? _options$group : this._group,
|
|
11551
|
+
position: options.group ? (_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : "center" : "center",
|
|
11552
|
+
index: options.index
|
|
11553
|
+
},
|
|
11554
|
+
skipSetActive: options.skipSetActive
|
|
11555
|
+
});
|
|
11444
11556
|
});
|
|
11445
11557
|
}
|
|
11446
11558
|
setTitle(title) {
|
|
@@ -12550,12 +12662,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
12550
12662
|
moduleName: "ContextMenu",
|
|
12551
12663
|
when: (o) => o.getTabGroupChipContextMenuItems != null
|
|
12552
12664
|
},
|
|
12553
|
-
{
|
|
12554
|
-
optionKey: "createContextMenuItemComponent",
|
|
12555
|
-
reason: "createContextMenuItemComponent",
|
|
12556
|
-
moduleName: "ContextMenu",
|
|
12557
|
-
when: (o) => o.createContextMenuItemComponent != null
|
|
12558
|
-
},
|
|
12559
12665
|
{
|
|
12560
12666
|
optionKey: "dndCompass",
|
|
12561
12667
|
reason: "dndCompass",
|
|
@@ -13284,7 +13390,18 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
13284
13390
|
prev = next;
|
|
13285
13391
|
const panel = group.activePanel;
|
|
13286
13392
|
if (!panel) return;
|
|
13287
|
-
|
|
13393
|
+
let kind;
|
|
13394
|
+
switch (next) {
|
|
13395
|
+
case "floating":
|
|
13396
|
+
kind = "float";
|
|
13397
|
+
break;
|
|
13398
|
+
case "popout":
|
|
13399
|
+
kind = "popout";
|
|
13400
|
+
break;
|
|
13401
|
+
default:
|
|
13402
|
+
kind = "dock";
|
|
13403
|
+
break;
|
|
13404
|
+
}
|
|
13288
13405
|
this._announce(panel, kind);
|
|
13289
13406
|
});
|
|
13290
13407
|
this._locationSubs.set(group.id, sub);
|
|
@@ -13336,29 +13453,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
13336
13453
|
|
|
13337
13454
|
//#endregion
|
|
13338
13455
|
//#region src/dockview/advancedDnDService.ts
|
|
13339
|
-
/** Cursor offset of the group drag ghost
|
|
13456
|
+
/** Cursor offset of the group drag ghost. */
|
|
13340
13457
|
const GROUP_DRAG_GHOST_OFFSET_X = 30;
|
|
13341
13458
|
const GROUP_DRAG_GHOST_OFFSET_Y = -10;
|
|
13342
13459
|
/**
|
|
13343
|
-
* The narrow surface the {@link AdvancedDnDService} needs from the host
|
|
13344
|
-
* (the `DockviewComponent`).
|
|
13345
|
-
*
|
|
13346
|
-
* The `onWill*` emitters stay on the component so the public event shape is
|
|
13347
|
-
* unchanged whether or not this module is registered; the service is only the
|
|
13348
|
-
* dispatch point those fires are routed through. Engine policy (e.g. the
|
|
13349
|
-
* `disableDnd` guard) stays on the component, ahead of the dispatch.
|
|
13350
|
-
*/
|
|
13351
|
-
/**
|
|
13352
13460
|
* Owns the dispatch of the advanced drag-and-drop hooks: `onWillDragPanel`,
|
|
13353
|
-
* `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay
|
|
13354
|
-
*
|
|
13355
|
-
*
|
|
13356
|
-
* emitters; the customisation surface it gates (custom drop overlays, custom
|
|
13357
|
-
* group drag ghosts, hook veto/transform behaviour) is currently inlined in
|
|
13358
|
-
* core and is extracted into this service in later phases. Routing the
|
|
13359
|
-
* dispatch through a module slot is what lets that customisation layer move
|
|
13360
|
-
* into a separately-distributed package in a future major version without
|
|
13361
|
-
* changing the public event surface.
|
|
13461
|
+
* `onWillDragGroup`, `onWillDrop` and `onWillShowOverlay`, forwarding each to
|
|
13462
|
+
* the host's emitters so the public event shape is unchanged whether or not
|
|
13463
|
+
* this module is registered.
|
|
13362
13464
|
*
|
|
13363
13465
|
* The service holds no drag state of its own. The gesture is driven by the
|
|
13364
13466
|
* DnD backends, and the per-group subscriptions live on the component's group
|
|
@@ -13484,7 +13586,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
13484
13586
|
//#region src/overlay/overlayRenderContainer.ts
|
|
13485
13587
|
var PositionCache = class {
|
|
13486
13588
|
constructor() {
|
|
13487
|
-
this.cache = /* @__PURE__ */ new
|
|
13589
|
+
this.cache = /* @__PURE__ */ new WeakMap();
|
|
13488
13590
|
this.currentFrameId = 0;
|
|
13489
13591
|
this.rafId = null;
|
|
13490
13592
|
}
|
|
@@ -15153,7 +15255,22 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
15153
15255
|
const rect = candidate.element.getBoundingClientRect();
|
|
15154
15256
|
const dx = rect.left + rect.width / 2 - fromX;
|
|
15155
15257
|
const dy = rect.top + rect.height / 2 - fromY;
|
|
15156
|
-
|
|
15258
|
+
let inDirection;
|
|
15259
|
+
switch (direction) {
|
|
15260
|
+
case "left":
|
|
15261
|
+
inDirection = dx < 0 && Math.abs(dx) >= Math.abs(dy);
|
|
15262
|
+
break;
|
|
15263
|
+
case "right":
|
|
15264
|
+
inDirection = dx > 0 && Math.abs(dx) >= Math.abs(dy);
|
|
15265
|
+
break;
|
|
15266
|
+
case "up":
|
|
15267
|
+
inDirection = dy < 0 && Math.abs(dy) >= Math.abs(dx);
|
|
15268
|
+
break;
|
|
15269
|
+
default:
|
|
15270
|
+
inDirection = dy > 0 && Math.abs(dy) >= Math.abs(dx);
|
|
15271
|
+
break;
|
|
15272
|
+
}
|
|
15273
|
+
if (!inDirection) continue;
|
|
15157
15274
|
const distance = dx * dx + dy * dy;
|
|
15158
15275
|
if (distance < bestDistance) {
|
|
15159
15276
|
bestDistance = distance;
|
|
@@ -16001,11 +16118,15 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16001
16118
|
/**
|
|
16002
16119
|
* Reveal (create-or-fill) the edge group at `position` and move the dragged
|
|
16003
16120
|
* item described by `data` into it. A newly created edge group is created
|
|
16004
|
-
* collapsed
|
|
16005
|
-
* later emptied
|
|
16006
|
-
*
|
|
16007
|
-
*
|
|
16008
|
-
*
|
|
16121
|
+
* collapsed, flagged `autoReveal` so it tears down to zero footprint when
|
|
16122
|
+
* later emptied, and takes its auto-hide state from `options.autoHide`. If an
|
|
16123
|
+
* edge group already exists there it is reused: the panel is added to its
|
|
16124
|
+
* tabs and its collapsed/toggled *and auto-hide* state are left as-is (never
|
|
16125
|
+
* re-created; `addEdgeGroup` throws on a duplicate position). This keeps a
|
|
16126
|
+
* drag-reveal from silently converting a static edge group into an
|
|
16127
|
+
* auto-hiding one; to change an existing group's auto-hide, call
|
|
16128
|
+
* `api.getEdgeGroup(position)?.setAutoHide(...)` directly. No-op if the
|
|
16129
|
+
* EdgeGroup module is absent.
|
|
16009
16130
|
*
|
|
16010
16131
|
* This is the primitive behind the dock-to-edge groups: the two-band
|
|
16011
16132
|
* drag-reveal affordance routes its outer-band drops here.
|
|
@@ -16024,7 +16145,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16024
16145
|
collapsed: true
|
|
16025
16146
|
});
|
|
16026
16147
|
group = service.get(position);
|
|
16027
|
-
}
|
|
16148
|
+
}
|
|
16028
16149
|
if (!group) return;
|
|
16029
16150
|
this.moveGroupOrPanel({
|
|
16030
16151
|
from: {
|
|
@@ -16555,6 +16676,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16555
16676
|
height: options.initialHeight
|
|
16556
16677
|
};
|
|
16557
16678
|
let index;
|
|
16679
|
+
const shouldSkipSetActive = (group) => !!options.inactive && group.model.size > 0;
|
|
16558
16680
|
if (options.position) if (isPanelOptionsWithPanel(options.position)) {
|
|
16559
16681
|
const referencePanel = typeof options.position.referencePanel === "string" ? this.getGroupPanel(options.position.referencePanel) : options.position.referencePanel;
|
|
16560
16682
|
index = options.position.index;
|
|
@@ -16577,7 +16699,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16577
16699
|
const group = this.orthogonalize(directionToPosition(options.position.direction));
|
|
16578
16700
|
const panel = this.createPanel(options, group);
|
|
16579
16701
|
group.model.openPanel(panel, {
|
|
16580
|
-
skipSetActive:
|
|
16702
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16581
16703
|
skipSetGroupActive: options.inactive,
|
|
16582
16704
|
index
|
|
16583
16705
|
});
|
|
@@ -16604,14 +16726,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16604
16726
|
}));
|
|
16605
16727
|
panel = this.createPanel(options, group);
|
|
16606
16728
|
group.model.openPanel(panel, {
|
|
16607
|
-
skipSetActive:
|
|
16729
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16608
16730
|
skipSetGroupActive: options.inactive,
|
|
16609
16731
|
index
|
|
16610
16732
|
});
|
|
16611
16733
|
} else if (referenceGroup.api.location.type === "floating" || referenceGroup.api.location.type === "edge" || target === "center") {
|
|
16612
16734
|
panel = this.createPanel(options, referenceGroup);
|
|
16613
16735
|
referenceGroup.model.openPanel(panel, {
|
|
16614
|
-
skipSetActive:
|
|
16736
|
+
skipSetActive: shouldSkipSetActive(referenceGroup),
|
|
16615
16737
|
skipSetGroupActive: options.inactive,
|
|
16616
16738
|
index
|
|
16617
16739
|
});
|
|
@@ -16626,7 +16748,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16626
16748
|
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);
|
|
16627
16749
|
panel = this.createPanel(options, group);
|
|
16628
16750
|
group.model.openPanel(panel, {
|
|
16629
|
-
skipSetActive:
|
|
16751
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16630
16752
|
skipSetGroupActive: options.inactive,
|
|
16631
16753
|
index
|
|
16632
16754
|
});
|
|
@@ -16643,7 +16765,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16643
16765
|
}));
|
|
16644
16766
|
panel = this.createPanel(options, group);
|
|
16645
16767
|
group.model.openPanel(panel, {
|
|
16646
|
-
skipSetActive:
|
|
16768
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16647
16769
|
skipSetGroupActive: options.inactive,
|
|
16648
16770
|
index
|
|
16649
16771
|
});
|
|
@@ -16651,7 +16773,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16651
16773
|
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);
|
|
16652
16774
|
panel = this.createPanel(options, group);
|
|
16653
16775
|
group.model.openPanel(panel, {
|
|
16654
|
-
skipSetActive:
|
|
16776
|
+
skipSetActive: shouldSkipSetActive(group),
|
|
16655
16777
|
skipSetGroupActive: options.inactive,
|
|
16656
16778
|
index
|
|
16657
16779
|
});
|