dockview-core 8.4.0 → 8.4.1
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/dockview/components/popupService.d.ts +2 -0
- package/dist/cjs/dockview/dockviewComponent.d.ts +4 -0
- package/dist/cjs/dockview/moduleContracts.d.ts +2 -0
- package/dist/dockview-core.js +171 -93
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.noStyle.js +171 -93
- package/dist/package/main.cjs.js +171 -93
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +171 -93
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 8.4.
|
|
3
|
+
* @version 8.4.1
|
|
4
4
|
* @link https://github.com/dockview/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -338,21 +338,29 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
338
338
|
}
|
|
339
339
|
};
|
|
340
340
|
function watchElementResize(element, cb) {
|
|
341
|
+
const pendingFrames = /* @__PURE__ */ new Set();
|
|
341
342
|
const observer = new ResizeObserver((entires) => {
|
|
342
343
|
/**
|
|
343
344
|
* Fast browser window resize produces Error: ResizeObserver loop limit exceeded.
|
|
344
345
|
* The error isn't visible in browser console, doesn't affect functionality, but degrades performance.
|
|
345
346
|
* See https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded/58701523#58701523
|
|
346
347
|
*/
|
|
347
|
-
|
|
348
|
+
let ran = false;
|
|
349
|
+
let frame;
|
|
350
|
+
frame = requestAnimationFrame(() => {
|
|
351
|
+
ran = true;
|
|
352
|
+
if (frame !== void 0) pendingFrames.delete(frame);
|
|
348
353
|
const firstEntry = entires[0];
|
|
349
354
|
cb(firstEntry);
|
|
350
355
|
});
|
|
356
|
+
if (!ran) pendingFrames.add(frame);
|
|
351
357
|
});
|
|
352
358
|
observer.observe(element);
|
|
353
359
|
return { dispose: () => {
|
|
354
360
|
observer.unobserve(element);
|
|
355
361
|
observer.disconnect();
|
|
362
|
+
for (const frame of pendingFrames) cancelAnimationFrame(frame);
|
|
363
|
+
pendingFrames.clear();
|
|
356
364
|
} };
|
|
357
365
|
}
|
|
358
366
|
const removeClasses = (element, ...classes) => {
|
|
@@ -10221,16 +10229,21 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10221
10229
|
y: event.clientY,
|
|
10222
10230
|
zIndex: (relativeParent === null || relativeParent === void 0 ? void 0 : relativeParent.style.zIndex) ? `calc(${relativeParent.style.zIndex} * 2)` : void 0
|
|
10223
10231
|
};
|
|
10224
|
-
const context = this.createOverflowRenderContext(root, anchor);
|
|
10232
|
+
const { context, rowRenderers } = this.createOverflowRenderContext(root, anchor);
|
|
10225
10233
|
const advancedOverflow = this.accessor.advancedOverflowService;
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
+
try {
|
|
10235
|
+
if (advancedOverflow) advancedOverflow.renderOverflow({
|
|
10236
|
+
group: this.group,
|
|
10237
|
+
overflowTabs: [...this._overflowTabs],
|
|
10238
|
+
overflowTabGroups: [...this._overflowTabGroups],
|
|
10239
|
+
pinnedOverflowTabs: [...this._overflowPinnedTabs],
|
|
10240
|
+
context
|
|
10241
|
+
});
|
|
10242
|
+
else context.open(this.renderFreeOverflowList(context));
|
|
10243
|
+
} catch (err) {
|
|
10244
|
+
rowRenderers.dispose();
|
|
10245
|
+
throw err;
|
|
10246
|
+
}
|
|
10234
10247
|
}));
|
|
10235
10248
|
}
|
|
10236
10249
|
/**
|
|
@@ -10251,6 +10264,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10251
10264
|
if (overflowGroupSet.has(tg.id)) for (const pid of tg.panelIds) panelToGroup.set(pid, tg);
|
|
10252
10265
|
}
|
|
10253
10266
|
const popup = () => this.accessor.getPopupServiceForGroup(this.group);
|
|
10267
|
+
const rowRenderers = new CompositeDisposable();
|
|
10254
10268
|
const buildGroupHeader = (tg) => {
|
|
10255
10269
|
const groupHeader = document.createElement("div");
|
|
10256
10270
|
groupHeader.className = "dv-tabs-overflow-group-header";
|
|
@@ -10280,69 +10294,87 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10280
10294
|
return groupHeader;
|
|
10281
10295
|
};
|
|
10282
10296
|
return {
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
block: "nearest",
|
|
10319
|
-
inline: "nearest"
|
|
10297
|
+
context: {
|
|
10298
|
+
overflowGroupIdForPanel: (panelId) => {
|
|
10299
|
+
var _panelToGroup$get;
|
|
10300
|
+
return (_panelToGroup$get = panelToGroup.get(panelId)) === null || _panelToGroup$get === void 0 ? void 0 : _panelToGroup$get.id;
|
|
10301
|
+
},
|
|
10302
|
+
buildGroupHeader: (tabGroupId) => {
|
|
10303
|
+
const tg = groupById.get(tabGroupId);
|
|
10304
|
+
if (!tg || !overflowGroupSet.has(tg.id)) return;
|
|
10305
|
+
return buildGroupHeader(tg);
|
|
10306
|
+
},
|
|
10307
|
+
buildPinnedHeader: () => {
|
|
10308
|
+
const header = document.createElement("div");
|
|
10309
|
+
header.className = "dv-tabs-overflow-group-header dv-tabs-overflow-pinned-header";
|
|
10310
|
+
const glyph = createPinButton();
|
|
10311
|
+
glyph.classList.add("dv-tabs-overflow-pinned-icon");
|
|
10312
|
+
header.appendChild(glyph);
|
|
10313
|
+
const labelSpan = document.createElement("span");
|
|
10314
|
+
labelSpan.className = "dv-tabs-overflow-group-label";
|
|
10315
|
+
labelSpan.textContent = "Pinned";
|
|
10316
|
+
header.appendChild(labelSpan);
|
|
10317
|
+
return header;
|
|
10318
|
+
},
|
|
10319
|
+
buildRow: (panelId) => {
|
|
10320
|
+
const panel = this.group.panels.find((p) => p.id === panelId);
|
|
10321
|
+
if (!panel) return;
|
|
10322
|
+
const tab = this.tabs.tabs.find((t) => t.panel.id === panelId);
|
|
10323
|
+
const tg = panelToGroup.get(panelId);
|
|
10324
|
+
const tabComponent = panel.view.createTabRenderer("headerOverflow");
|
|
10325
|
+
let rowDisposed = false;
|
|
10326
|
+
const disposeRow = Disposable.from(() => {
|
|
10327
|
+
if (!rowDisposed) {
|
|
10328
|
+
var _tabComponent$dispose;
|
|
10329
|
+
rowDisposed = true;
|
|
10330
|
+
(_tabComponent$dispose = tabComponent.dispose) === null || _tabComponent$dispose === void 0 || _tabComponent$dispose.call(tabComponent);
|
|
10331
|
+
}
|
|
10320
10332
|
});
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
+
if (rowRenderers.isDisposed) disposeRow.dispose();
|
|
10334
|
+
else rowRenderers.addDisposables(disposeRow);
|
|
10335
|
+
const child = tabComponent.element;
|
|
10336
|
+
const wrapper = document.createElement("div");
|
|
10337
|
+
toggleClass(wrapper, "dv-tab", true);
|
|
10338
|
+
toggleClass(wrapper, "dv-active-tab", panel.api.isActive);
|
|
10339
|
+
toggleClass(wrapper, "dv-inactive-tab", !panel.api.isActive);
|
|
10340
|
+
if (tg) toggleClass(wrapper, "dv-tab--grouped", true);
|
|
10341
|
+
const doActivate = () => {
|
|
10342
|
+
if (tg === null || tg === void 0 ? void 0 : tg.collapsed) tg.expand();
|
|
10343
|
+
tab === null || tab === void 0 || tab.element.scrollIntoView({
|
|
10344
|
+
block: "nearest",
|
|
10345
|
+
inline: "nearest"
|
|
10346
|
+
});
|
|
10347
|
+
this.accessor.withOrigin("user", () => panel.api.setActive());
|
|
10348
|
+
};
|
|
10349
|
+
wrapper.addEventListener("click", (event) => {
|
|
10333
10350
|
popup().close();
|
|
10351
|
+
if (event.defaultPrevented) return;
|
|
10334
10352
|
doActivate();
|
|
10335
|
-
}
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10353
|
+
});
|
|
10354
|
+
wrapper.appendChild(child);
|
|
10355
|
+
return {
|
|
10356
|
+
element: wrapper,
|
|
10357
|
+
panel,
|
|
10358
|
+
activate: () => {
|
|
10359
|
+
popup().close();
|
|
10360
|
+
doActivate();
|
|
10361
|
+
},
|
|
10362
|
+
dispose: () => {
|
|
10363
|
+
rowRenderers.removeDisposable(disposeRow);
|
|
10364
|
+
disposeRow.dispose();
|
|
10365
|
+
}
|
|
10366
|
+
};
|
|
10367
|
+
},
|
|
10368
|
+
open: (body) => {
|
|
10369
|
+
popup().openPopover(body, anchor, { onClose: () => rowRenderers.dispose() });
|
|
10370
|
+
},
|
|
10371
|
+
close: () => popup().close(),
|
|
10372
|
+
focusTrigger: () => {
|
|
10373
|
+
root.tabIndex = -1;
|
|
10374
|
+
root.focus();
|
|
10375
|
+
}
|
|
10340
10376
|
},
|
|
10341
|
-
|
|
10342
|
-
focusTrigger: () => {
|
|
10343
|
-
root.tabIndex = -1;
|
|
10344
|
-
root.focus();
|
|
10345
|
-
}
|
|
10377
|
+
rowRenderers
|
|
10346
10378
|
};
|
|
10347
10379
|
}
|
|
10348
10380
|
/**
|
|
@@ -11259,6 +11291,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
11259
11291
|
this.tabsContainer.setRightActionsElement(element);
|
|
11260
11292
|
}
|
|
11261
11293
|
setActive(isGroupActive, force = false) {
|
|
11294
|
+
if (this.isDisposed) return;
|
|
11262
11295
|
if (!force && this.isActive === isGroupActive) return;
|
|
11263
11296
|
this._isGroupActive = isGroupActive;
|
|
11264
11297
|
toggleClass(this.container, "dv-active-group", isGroupActive);
|
|
@@ -14303,13 +14336,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14303
14336
|
* menu passes the `tabGroup`. No-op when no renderer could be created (no
|
|
14304
14337
|
* factory configured, or the factory declined the component).
|
|
14305
14338
|
*/
|
|
14306
|
-
appendComponentItem(menuEl, item, identity, group, close) {
|
|
14339
|
+
appendComponentItem(menuEl, item, identity, group, close, renderers) {
|
|
14307
14340
|
var _this$accessor$option4, _this$accessor$option5;
|
|
14308
14341
|
const renderer = (_this$accessor$option4 = (_this$accessor$option5 = this.accessor.options).createContextMenuItemComponent) === null || _this$accessor$option4 === void 0 ? void 0 : _this$accessor$option4.call(_this$accessor$option5, {
|
|
14309
14342
|
id: nextContextMenuItemId(),
|
|
14310
14343
|
component: item.component
|
|
14311
14344
|
});
|
|
14312
14345
|
if (!renderer) return;
|
|
14346
|
+
renderers.addDisposables(renderer);
|
|
14313
14347
|
renderer.init(_objectSpread2(_objectSpread2({}, identity), {}, {
|
|
14314
14348
|
group,
|
|
14315
14349
|
api: this.accessor.api,
|
|
@@ -14360,9 +14394,9 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14360
14394
|
* default row; an item carrying none of the three renders nothing. Shared
|
|
14361
14395
|
* by both menus, which differ only in `identity`.
|
|
14362
14396
|
*/
|
|
14363
|
-
appendConfigItem(menuEl, item, identity, group, close) {
|
|
14397
|
+
appendConfigItem(menuEl, item, identity, group, close, renderers) {
|
|
14364
14398
|
if (item.element) menuEl.appendChild(item.element);
|
|
14365
|
-
else if (item.component) this.appendComponentItem(menuEl, item, identity, group, close);
|
|
14399
|
+
else if (item.component) this.appendComponentItem(menuEl, item, identity, group, close, renderers);
|
|
14366
14400
|
else if (item.label) menuEl.appendChild(buildItem(item.label, close, () => {
|
|
14367
14401
|
var _item$action;
|
|
14368
14402
|
return (_item$action = item.action) === null || _item$action === void 0 ? void 0 : _item$action.call(item);
|
|
@@ -14374,22 +14408,28 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14374
14408
|
event.preventDefault();
|
|
14375
14409
|
const popupService = this.accessor.getPopupServiceForGroup(group);
|
|
14376
14410
|
const close = () => popupService.close();
|
|
14411
|
+
const renderers = new CompositeDisposable();
|
|
14377
14412
|
const menuEl = document.createElement("div");
|
|
14378
14413
|
menuEl.className = "dv-context-menu";
|
|
14379
14414
|
menuEl.setAttribute("role", "menu");
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14415
|
+
try {
|
|
14416
|
+
for (const item of items) {
|
|
14417
|
+
if (isItemConfig(item)) {
|
|
14418
|
+
this.appendConfigItem(menuEl, item, { panel }, group, close, renderers);
|
|
14419
|
+
continue;
|
|
14420
|
+
}
|
|
14421
|
+
const el = this.buildBuiltInTabItem(item, panel, group, close);
|
|
14422
|
+
if (el) menuEl.appendChild(el);
|
|
14384
14423
|
}
|
|
14385
|
-
|
|
14386
|
-
|
|
14424
|
+
} catch (err) {
|
|
14425
|
+
renderers.dispose();
|
|
14426
|
+
throw err;
|
|
14387
14427
|
}
|
|
14388
14428
|
popupService.openPopover(menuEl, {
|
|
14389
14429
|
x: event.clientX,
|
|
14390
14430
|
y: event.clientY,
|
|
14391
14431
|
zIndex: popoverZIndexFor(event.target, group)
|
|
14392
|
-
});
|
|
14432
|
+
}, { onClose: () => renderers.dispose() });
|
|
14393
14433
|
}
|
|
14394
14434
|
showForChip(tabGroup, group, event) {
|
|
14395
14435
|
if (!this.accessor.options.getTabGroupChipContextMenuItems) return;
|
|
@@ -14403,22 +14443,28 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14403
14443
|
event.preventDefault();
|
|
14404
14444
|
const popupService = this.accessor.getPopupServiceForGroup(group);
|
|
14405
14445
|
const close = () => popupService.close();
|
|
14446
|
+
const renderers = new CompositeDisposable();
|
|
14406
14447
|
const menuEl = document.createElement("div");
|
|
14407
14448
|
menuEl.className = "dv-context-menu";
|
|
14408
14449
|
menuEl.setAttribute("role", "menu");
|
|
14409
|
-
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
|
|
14413
|
-
|
|
14414
|
-
|
|
14415
|
-
|
|
14416
|
-
|
|
14450
|
+
try {
|
|
14451
|
+
for (const item of items) if (item === "separator") menuEl.appendChild(buildSeparator());
|
|
14452
|
+
else if (item === "rename") menuEl.appendChild(buildRenameInput(tabGroup));
|
|
14453
|
+
else if (item === "colorPicker") menuEl.appendChild(buildColorPicker(tabGroup, this.accessor.tabGroupColorPalette));
|
|
14454
|
+
else if (item === "collapse") menuEl.appendChild(this.buildCollapseItem(tabGroup, close));
|
|
14455
|
+
else if (item === "close") menuEl.appendChild(buildItem("Close All", close, () => {
|
|
14456
|
+
group.panels.filter((p) => tabGroup.containsPanel(p.id)).forEach((p) => p.api.close());
|
|
14457
|
+
}));
|
|
14458
|
+
else if (isItemConfig(item)) this.appendConfigItem(menuEl, item, { tabGroup }, group, close, renderers);
|
|
14459
|
+
} catch (err) {
|
|
14460
|
+
renderers.dispose();
|
|
14461
|
+
throw err;
|
|
14462
|
+
}
|
|
14417
14463
|
popupService.openPopover(menuEl, {
|
|
14418
14464
|
x: event.clientX,
|
|
14419
14465
|
y: event.clientY,
|
|
14420
14466
|
zIndex: popoverZIndexFor(event.target, group)
|
|
14421
|
-
});
|
|
14467
|
+
}, { onClose: () => renderers.dispose() });
|
|
14422
14468
|
}
|
|
14423
14469
|
};
|
|
14424
14470
|
const ContextMenuModule = defineModule({
|
|
@@ -14708,6 +14754,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14708
14754
|
const observerDisposable = new MutableDisposable();
|
|
14709
14755
|
const correctLayerPosition = () => {
|
|
14710
14756
|
if (panel.api.location.type === "floating") queueMicrotask(() => {
|
|
14757
|
+
if (disposable.isDisposed) return;
|
|
14711
14758
|
const floatingGroup = this.accessor.getFloatingWindowForGroup(panel.api.group);
|
|
14712
14759
|
if (!floatingGroup) return;
|
|
14713
14760
|
const element = floatingGroup.overlay.element;
|
|
@@ -14942,7 +14989,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14942
14989
|
newRoot.prepend(this._element);
|
|
14943
14990
|
this._root = newRoot;
|
|
14944
14991
|
}
|
|
14945
|
-
openPopover(element, position) {
|
|
14992
|
+
openPopover(element, position, options) {
|
|
14946
14993
|
var _position$zIndex;
|
|
14947
14994
|
this.close();
|
|
14948
14995
|
const wrapper = this._window.document.createElement("div");
|
|
@@ -14957,14 +15004,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14957
15004
|
this._element.appendChild(wrapper);
|
|
14958
15005
|
this._active = wrapper;
|
|
14959
15006
|
const POINTERDOWN_GRACE_MS = 200;
|
|
14960
|
-
this._activeDisposable.value = createDismissableLayer({
|
|
15007
|
+
this._activeDisposable.value = new CompositeDisposable(createDismissableLayer({
|
|
14961
15008
|
window: this._window,
|
|
14962
15009
|
onDismiss: () => this.close(),
|
|
14963
15010
|
elements: () => this._active ? [this._active] : [],
|
|
14964
15011
|
keys: ["Enter"],
|
|
14965
15012
|
pointerDownGraceMs: POINTERDOWN_GRACE_MS,
|
|
14966
15013
|
resize: true
|
|
14967
|
-
});
|
|
15014
|
+
}), (options === null || options === void 0 ? void 0 : options.onClose) ? Disposable.from(options.onClose) : Disposable.NONE);
|
|
14968
15015
|
this._window.requestAnimationFrame(() => {
|
|
14969
15016
|
shiftAbsoluteElementIntoView(wrapper, this._root);
|
|
14970
15017
|
});
|
|
@@ -16276,7 +16323,9 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16276
16323
|
this._onWillDrop = new Emitter();
|
|
16277
16324
|
this.onWillDrop = this._onWillDrop.event;
|
|
16278
16325
|
this._mutationDepth = 0;
|
|
16326
|
+
this._syncMutationDepth = 0;
|
|
16279
16327
|
this._pendingLocationChanges = /* @__PURE__ */ new Map();
|
|
16328
|
+
this._openingPopoutWindows = /* @__PURE__ */ new Set();
|
|
16280
16329
|
this._origin = "user";
|
|
16281
16330
|
this._originDepth = 0;
|
|
16282
16331
|
this._onWillMutateLayout = new Emitter();
|
|
@@ -16360,6 +16409,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16360
16409
|
});
|
|
16361
16410
|
}));
|
|
16362
16411
|
this.popupService = new PopupService(this.element);
|
|
16412
|
+
this.addDisposables(this.popupService, Disposable.from(() => {
|
|
16413
|
+
for (const opening of this._openingPopoutWindows) opening.dispose();
|
|
16414
|
+
this._openingPopoutWindows.clear();
|
|
16415
|
+
}));
|
|
16363
16416
|
this._api = new DockviewApi(this);
|
|
16364
16417
|
this.disableResizing = true;
|
|
16365
16418
|
this.element.remove();
|
|
@@ -16508,9 +16561,15 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16508
16561
|
const popoutWindowDisposable = new CompositeDisposable(_window, _window.onDidClose(() => {
|
|
16509
16562
|
popoutWindowDisposable.dispose();
|
|
16510
16563
|
}));
|
|
16564
|
+
this._openingPopoutWindows.add(popoutWindowDisposable);
|
|
16511
16565
|
const openError = getPopoutUrlError(popoutUrl);
|
|
16512
16566
|
return (openError ? Promise.resolve(null) : _window.open()).then((popoutContainer) => {
|
|
16513
16567
|
var _options$referenceGro, _options$overridePopo4;
|
|
16568
|
+
this._openingPopoutWindows.delete(popoutWindowDisposable);
|
|
16569
|
+
if (this.isDisposed) {
|
|
16570
|
+
popoutWindowDisposable.dispose();
|
|
16571
|
+
return false;
|
|
16572
|
+
}
|
|
16514
16573
|
if (_window.isDisposed) {
|
|
16515
16574
|
const failure = _window.failure;
|
|
16516
16575
|
if (failure && !this.isDisposed) {
|
|
@@ -16704,6 +16763,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16704
16763
|
for (const { panel, from } of movedPanels) this.fireDidMovePanel(panel, from);
|
|
16705
16764
|
return true;
|
|
16706
16765
|
}).catch((err) => {
|
|
16766
|
+
this._openingPopoutWindows.delete(popoutWindowDisposable);
|
|
16707
16767
|
console.error("dockview: failed to create popout.", err);
|
|
16708
16768
|
return false;
|
|
16709
16769
|
});
|
|
@@ -17243,6 +17303,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17243
17303
|
group.dispose();
|
|
17244
17304
|
this._groups.delete(group.id);
|
|
17245
17305
|
this._onDidRemoveGroup.fire(group);
|
|
17306
|
+
this.activateFallbackGroupIfRemoved(group);
|
|
17246
17307
|
});
|
|
17247
17308
|
}
|
|
17248
17309
|
setEdgeGroupCollapsed(group, collapsed) {
|
|
@@ -17439,6 +17500,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17439
17500
|
const record = this._groups.get(temporaryGroup.api.id);
|
|
17440
17501
|
this._groups.delete(temporaryGroup.api.id);
|
|
17441
17502
|
temporaryGroupDisposables.push(Disposable.from(() => {
|
|
17503
|
+
var _this$headerActionsSe2;
|
|
17442
17504
|
/**
|
|
17443
17505
|
* Reclaim the group's own resources, never its panels.
|
|
17444
17506
|
* Staging is driven by the ids in `data.panels` while
|
|
@@ -17456,6 +17518,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17456
17518
|
for (const panel of temporaryGroup.panels.slice()) temporaryGroup.model.removePanel(panel);
|
|
17457
17519
|
});
|
|
17458
17520
|
record === null || record === void 0 || record.disposable.dispose();
|
|
17521
|
+
(_this$headerActionsSe2 = this.headerActionsService) === null || _this$headerActionsSe2 === void 0 || _this$headerActionsSe2.disposeGroup(temporaryGroup);
|
|
17459
17522
|
temporaryGroup.dispose();
|
|
17460
17523
|
}));
|
|
17461
17524
|
return temporaryGroup;
|
|
@@ -18120,9 +18183,12 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18120
18183
|
*/
|
|
18121
18184
|
mutation(kind, func) {
|
|
18122
18185
|
const close = this.openMutation(kind);
|
|
18186
|
+
this._syncMutationDepth++;
|
|
18123
18187
|
try {
|
|
18124
18188
|
return func();
|
|
18125
18189
|
} finally {
|
|
18190
|
+
this._syncMutationDepth--;
|
|
18191
|
+
if (this._syncMutationDepth === 0) this.releaseDisposedActiveGroup();
|
|
18126
18192
|
close();
|
|
18127
18193
|
}
|
|
18128
18194
|
}
|
|
@@ -18169,6 +18235,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18169
18235
|
return () => {
|
|
18170
18236
|
this._mutationDepth--;
|
|
18171
18237
|
if (this._mutationDepth === 0) {
|
|
18238
|
+
this.releaseDisposedActiveGroup();
|
|
18172
18239
|
this.flushLocationChanges();
|
|
18173
18240
|
this._onDidMutateLayout.fire({
|
|
18174
18241
|
kind,
|
|
@@ -18177,6 +18244,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18177
18244
|
}
|
|
18178
18245
|
};
|
|
18179
18246
|
}
|
|
18247
|
+
/** Covers removals with `skipActive` that disposed the active group. */
|
|
18248
|
+
releaseDisposedActiveGroup() {
|
|
18249
|
+
var _this$_activeGroup;
|
|
18250
|
+
if (!this.isDisposed && ((_this$_activeGroup = this._activeGroup) === null || _this$_activeGroup === void 0 ? void 0 : _this$_activeGroup.model.isDisposed)) this.activateFallbackGroupIfRemoved(this._activeGroup);
|
|
18251
|
+
}
|
|
18180
18252
|
/**
|
|
18181
18253
|
* Coalesce a panel's `onDidLocationChange` to the end of the enclosing
|
|
18182
18254
|
* transaction, or fire it immediately when no transaction is in flight.
|
|
@@ -18314,7 +18386,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18314
18386
|
skipSetActiveGroup: true
|
|
18315
18387
|
}));
|
|
18316
18388
|
if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
18317
|
-
if (!options.keepEmptyGroups && sourceGroup.model.size === 0) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18389
|
+
if (!options.keepEmptyGroups && sourceGroup.model.size === 0 && sourceGroup !== destinationGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18318
18390
|
const isDestinationGroupEmpty = destinationGroup.model.size === 0;
|
|
18319
18391
|
this.movingLock(() => {
|
|
18320
18392
|
var _options$skipSetActiv;
|
|
@@ -18479,6 +18551,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18479
18551
|
const from = options.from.group;
|
|
18480
18552
|
const to = options.to.group;
|
|
18481
18553
|
const target = options.to.position;
|
|
18554
|
+
if (target === "center" && from === to) return;
|
|
18482
18555
|
let source = from;
|
|
18483
18556
|
let mergedPanels;
|
|
18484
18557
|
if (target === "center") {
|
|
@@ -19510,6 +19583,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
19510
19583
|
const queue = [];
|
|
19511
19584
|
const width = this.width;
|
|
19512
19585
|
const height = this.height;
|
|
19586
|
+
this.paneview.dispose();
|
|
19513
19587
|
this.paneview = new Paneview(this.element, {
|
|
19514
19588
|
orientation: "VERTICAL",
|
|
19515
19589
|
descriptor: {
|
|
@@ -19573,7 +19647,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
19573
19647
|
clear() {
|
|
19574
19648
|
for (const [_, value] of this._viewDisposables.entries()) value.dispose();
|
|
19575
19649
|
this._viewDisposables.clear();
|
|
19650
|
+
const width = this.width;
|
|
19651
|
+
const height = this.height;
|
|
19576
19652
|
this.paneview.dispose();
|
|
19653
|
+
this.paneview = new Paneview(this.element, { orientation: "VERTICAL" });
|
|
19654
|
+
this.layout(width, height);
|
|
19577
19655
|
}
|
|
19578
19656
|
doAddPanel(panel) {
|
|
19579
19657
|
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|