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
|
*/
|
|
@@ -331,21 +331,29 @@ var OverflowObserver = class extends CompositeDisposable {
|
|
|
331
331
|
}
|
|
332
332
|
};
|
|
333
333
|
function watchElementResize(element, cb) {
|
|
334
|
+
const pendingFrames = /* @__PURE__ */ new Set();
|
|
334
335
|
const observer = new ResizeObserver((entires) => {
|
|
335
336
|
/**
|
|
336
337
|
* Fast browser window resize produces Error: ResizeObserver loop limit exceeded.
|
|
337
338
|
* The error isn't visible in browser console, doesn't affect functionality, but degrades performance.
|
|
338
339
|
* See https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded/58701523#58701523
|
|
339
340
|
*/
|
|
340
|
-
|
|
341
|
+
let ran = false;
|
|
342
|
+
let frame;
|
|
343
|
+
frame = requestAnimationFrame(() => {
|
|
344
|
+
ran = true;
|
|
345
|
+
if (frame !== void 0) pendingFrames.delete(frame);
|
|
341
346
|
const firstEntry = entires[0];
|
|
342
347
|
cb(firstEntry);
|
|
343
348
|
});
|
|
349
|
+
if (!ran) pendingFrames.add(frame);
|
|
344
350
|
});
|
|
345
351
|
observer.observe(element);
|
|
346
352
|
return { dispose: () => {
|
|
347
353
|
observer.unobserve(element);
|
|
348
354
|
observer.disconnect();
|
|
355
|
+
for (const frame of pendingFrames) cancelAnimationFrame(frame);
|
|
356
|
+
pendingFrames.clear();
|
|
349
357
|
} };
|
|
350
358
|
}
|
|
351
359
|
const removeClasses = (element, ...classes) => {
|
|
@@ -10214,16 +10222,21 @@ var TabsContainer = class extends CompositeDisposable {
|
|
|
10214
10222
|
y: event.clientY,
|
|
10215
10223
|
zIndex: (relativeParent === null || relativeParent === void 0 ? void 0 : relativeParent.style.zIndex) ? `calc(${relativeParent.style.zIndex} * 2)` : void 0
|
|
10216
10224
|
};
|
|
10217
|
-
const context = this.createOverflowRenderContext(root, anchor);
|
|
10225
|
+
const { context, rowRenderers } = this.createOverflowRenderContext(root, anchor);
|
|
10218
10226
|
const advancedOverflow = this.accessor.advancedOverflowService;
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
+
try {
|
|
10228
|
+
if (advancedOverflow) advancedOverflow.renderOverflow({
|
|
10229
|
+
group: this.group,
|
|
10230
|
+
overflowTabs: [...this._overflowTabs],
|
|
10231
|
+
overflowTabGroups: [...this._overflowTabGroups],
|
|
10232
|
+
pinnedOverflowTabs: [...this._overflowPinnedTabs],
|
|
10233
|
+
context
|
|
10234
|
+
});
|
|
10235
|
+
else context.open(this.renderFreeOverflowList(context));
|
|
10236
|
+
} catch (err) {
|
|
10237
|
+
rowRenderers.dispose();
|
|
10238
|
+
throw err;
|
|
10239
|
+
}
|
|
10227
10240
|
}));
|
|
10228
10241
|
}
|
|
10229
10242
|
/**
|
|
@@ -10244,6 +10257,7 @@ var TabsContainer = class extends CompositeDisposable {
|
|
|
10244
10257
|
if (overflowGroupSet.has(tg.id)) for (const pid of tg.panelIds) panelToGroup.set(pid, tg);
|
|
10245
10258
|
}
|
|
10246
10259
|
const popup = () => this.accessor.getPopupServiceForGroup(this.group);
|
|
10260
|
+
const rowRenderers = new CompositeDisposable();
|
|
10247
10261
|
const buildGroupHeader = (tg) => {
|
|
10248
10262
|
const groupHeader = document.createElement("div");
|
|
10249
10263
|
groupHeader.className = "dv-tabs-overflow-group-header";
|
|
@@ -10273,69 +10287,87 @@ var TabsContainer = class extends CompositeDisposable {
|
|
|
10273
10287
|
return groupHeader;
|
|
10274
10288
|
};
|
|
10275
10289
|
return {
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
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
|
-
block: "nearest",
|
|
10312
|
-
inline: "nearest"
|
|
10290
|
+
context: {
|
|
10291
|
+
overflowGroupIdForPanel: (panelId) => {
|
|
10292
|
+
var _panelToGroup$get;
|
|
10293
|
+
return (_panelToGroup$get = panelToGroup.get(panelId)) === null || _panelToGroup$get === void 0 ? void 0 : _panelToGroup$get.id;
|
|
10294
|
+
},
|
|
10295
|
+
buildGroupHeader: (tabGroupId) => {
|
|
10296
|
+
const tg = groupById.get(tabGroupId);
|
|
10297
|
+
if (!tg || !overflowGroupSet.has(tg.id)) return;
|
|
10298
|
+
return buildGroupHeader(tg);
|
|
10299
|
+
},
|
|
10300
|
+
buildPinnedHeader: () => {
|
|
10301
|
+
const header = document.createElement("div");
|
|
10302
|
+
header.className = "dv-tabs-overflow-group-header dv-tabs-overflow-pinned-header";
|
|
10303
|
+
const glyph = createPinButton();
|
|
10304
|
+
glyph.classList.add("dv-tabs-overflow-pinned-icon");
|
|
10305
|
+
header.appendChild(glyph);
|
|
10306
|
+
const labelSpan = document.createElement("span");
|
|
10307
|
+
labelSpan.className = "dv-tabs-overflow-group-label";
|
|
10308
|
+
labelSpan.textContent = "Pinned";
|
|
10309
|
+
header.appendChild(labelSpan);
|
|
10310
|
+
return header;
|
|
10311
|
+
},
|
|
10312
|
+
buildRow: (panelId) => {
|
|
10313
|
+
const panel = this.group.panels.find((p) => p.id === panelId);
|
|
10314
|
+
if (!panel) return;
|
|
10315
|
+
const tab = this.tabs.tabs.find((t) => t.panel.id === panelId);
|
|
10316
|
+
const tg = panelToGroup.get(panelId);
|
|
10317
|
+
const tabComponent = panel.view.createTabRenderer("headerOverflow");
|
|
10318
|
+
let rowDisposed = false;
|
|
10319
|
+
const disposeRow = Disposable.from(() => {
|
|
10320
|
+
if (!rowDisposed) {
|
|
10321
|
+
var _tabComponent$dispose;
|
|
10322
|
+
rowDisposed = true;
|
|
10323
|
+
(_tabComponent$dispose = tabComponent.dispose) === null || _tabComponent$dispose === void 0 || _tabComponent$dispose.call(tabComponent);
|
|
10324
|
+
}
|
|
10313
10325
|
});
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
+
if (rowRenderers.isDisposed) disposeRow.dispose();
|
|
10327
|
+
else rowRenderers.addDisposables(disposeRow);
|
|
10328
|
+
const child = tabComponent.element;
|
|
10329
|
+
const wrapper = document.createElement("div");
|
|
10330
|
+
toggleClass(wrapper, "dv-tab", true);
|
|
10331
|
+
toggleClass(wrapper, "dv-active-tab", panel.api.isActive);
|
|
10332
|
+
toggleClass(wrapper, "dv-inactive-tab", !panel.api.isActive);
|
|
10333
|
+
if (tg) toggleClass(wrapper, "dv-tab--grouped", true);
|
|
10334
|
+
const doActivate = () => {
|
|
10335
|
+
if (tg === null || tg === void 0 ? void 0 : tg.collapsed) tg.expand();
|
|
10336
|
+
tab === null || tab === void 0 || tab.element.scrollIntoView({
|
|
10337
|
+
block: "nearest",
|
|
10338
|
+
inline: "nearest"
|
|
10339
|
+
});
|
|
10340
|
+
this.accessor.withOrigin("user", () => panel.api.setActive());
|
|
10341
|
+
};
|
|
10342
|
+
wrapper.addEventListener("click", (event) => {
|
|
10326
10343
|
popup().close();
|
|
10344
|
+
if (event.defaultPrevented) return;
|
|
10327
10345
|
doActivate();
|
|
10328
|
-
}
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10346
|
+
});
|
|
10347
|
+
wrapper.appendChild(child);
|
|
10348
|
+
return {
|
|
10349
|
+
element: wrapper,
|
|
10350
|
+
panel,
|
|
10351
|
+
activate: () => {
|
|
10352
|
+
popup().close();
|
|
10353
|
+
doActivate();
|
|
10354
|
+
},
|
|
10355
|
+
dispose: () => {
|
|
10356
|
+
rowRenderers.removeDisposable(disposeRow);
|
|
10357
|
+
disposeRow.dispose();
|
|
10358
|
+
}
|
|
10359
|
+
};
|
|
10360
|
+
},
|
|
10361
|
+
open: (body) => {
|
|
10362
|
+
popup().openPopover(body, anchor, { onClose: () => rowRenderers.dispose() });
|
|
10363
|
+
},
|
|
10364
|
+
close: () => popup().close(),
|
|
10365
|
+
focusTrigger: () => {
|
|
10366
|
+
root.tabIndex = -1;
|
|
10367
|
+
root.focus();
|
|
10368
|
+
}
|
|
10333
10369
|
},
|
|
10334
|
-
|
|
10335
|
-
focusTrigger: () => {
|
|
10336
|
-
root.tabIndex = -1;
|
|
10337
|
-
root.focus();
|
|
10338
|
-
}
|
|
10370
|
+
rowRenderers
|
|
10339
10371
|
};
|
|
10340
10372
|
}
|
|
10341
10373
|
/**
|
|
@@ -11252,6 +11284,7 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
|
|
|
11252
11284
|
this.tabsContainer.setRightActionsElement(element);
|
|
11253
11285
|
}
|
|
11254
11286
|
setActive(isGroupActive, force = false) {
|
|
11287
|
+
if (this.isDisposed) return;
|
|
11255
11288
|
if (!force && this.isActive === isGroupActive) return;
|
|
11256
11289
|
this._isGroupActive = isGroupActive;
|
|
11257
11290
|
toggleClass(this.container, "dv-active-group", isGroupActive);
|
|
@@ -14296,13 +14329,14 @@ var ContextMenuController = class {
|
|
|
14296
14329
|
* menu passes the `tabGroup`. No-op when no renderer could be created (no
|
|
14297
14330
|
* factory configured, or the factory declined the component).
|
|
14298
14331
|
*/
|
|
14299
|
-
appendComponentItem(menuEl, item, identity, group, close) {
|
|
14332
|
+
appendComponentItem(menuEl, item, identity, group, close, renderers) {
|
|
14300
14333
|
var _this$accessor$option4, _this$accessor$option5;
|
|
14301
14334
|
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, {
|
|
14302
14335
|
id: nextContextMenuItemId(),
|
|
14303
14336
|
component: item.component
|
|
14304
14337
|
});
|
|
14305
14338
|
if (!renderer) return;
|
|
14339
|
+
renderers.addDisposables(renderer);
|
|
14306
14340
|
renderer.init(_objectSpread2(_objectSpread2({}, identity), {}, {
|
|
14307
14341
|
group,
|
|
14308
14342
|
api: this.accessor.api,
|
|
@@ -14353,9 +14387,9 @@ var ContextMenuController = class {
|
|
|
14353
14387
|
* default row; an item carrying none of the three renders nothing. Shared
|
|
14354
14388
|
* by both menus, which differ only in `identity`.
|
|
14355
14389
|
*/
|
|
14356
|
-
appendConfigItem(menuEl, item, identity, group, close) {
|
|
14390
|
+
appendConfigItem(menuEl, item, identity, group, close, renderers) {
|
|
14357
14391
|
if (item.element) menuEl.appendChild(item.element);
|
|
14358
|
-
else if (item.component) this.appendComponentItem(menuEl, item, identity, group, close);
|
|
14392
|
+
else if (item.component) this.appendComponentItem(menuEl, item, identity, group, close, renderers);
|
|
14359
14393
|
else if (item.label) menuEl.appendChild(buildItem(item.label, close, () => {
|
|
14360
14394
|
var _item$action;
|
|
14361
14395
|
return (_item$action = item.action) === null || _item$action === void 0 ? void 0 : _item$action.call(item);
|
|
@@ -14367,22 +14401,28 @@ var ContextMenuController = class {
|
|
|
14367
14401
|
event.preventDefault();
|
|
14368
14402
|
const popupService = this.accessor.getPopupServiceForGroup(group);
|
|
14369
14403
|
const close = () => popupService.close();
|
|
14404
|
+
const renderers = new CompositeDisposable();
|
|
14370
14405
|
const menuEl = document.createElement("div");
|
|
14371
14406
|
menuEl.className = "dv-context-menu";
|
|
14372
14407
|
menuEl.setAttribute("role", "menu");
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
|
|
14408
|
+
try {
|
|
14409
|
+
for (const item of items) {
|
|
14410
|
+
if (isItemConfig(item)) {
|
|
14411
|
+
this.appendConfigItem(menuEl, item, { panel }, group, close, renderers);
|
|
14412
|
+
continue;
|
|
14413
|
+
}
|
|
14414
|
+
const el = this.buildBuiltInTabItem(item, panel, group, close);
|
|
14415
|
+
if (el) menuEl.appendChild(el);
|
|
14377
14416
|
}
|
|
14378
|
-
|
|
14379
|
-
|
|
14417
|
+
} catch (err) {
|
|
14418
|
+
renderers.dispose();
|
|
14419
|
+
throw err;
|
|
14380
14420
|
}
|
|
14381
14421
|
popupService.openPopover(menuEl, {
|
|
14382
14422
|
x: event.clientX,
|
|
14383
14423
|
y: event.clientY,
|
|
14384
14424
|
zIndex: popoverZIndexFor(event.target, group)
|
|
14385
|
-
});
|
|
14425
|
+
}, { onClose: () => renderers.dispose() });
|
|
14386
14426
|
}
|
|
14387
14427
|
showForChip(tabGroup, group, event) {
|
|
14388
14428
|
if (!this.accessor.options.getTabGroupChipContextMenuItems) return;
|
|
@@ -14396,22 +14436,28 @@ var ContextMenuController = class {
|
|
|
14396
14436
|
event.preventDefault();
|
|
14397
14437
|
const popupService = this.accessor.getPopupServiceForGroup(group);
|
|
14398
14438
|
const close = () => popupService.close();
|
|
14439
|
+
const renderers = new CompositeDisposable();
|
|
14399
14440
|
const menuEl = document.createElement("div");
|
|
14400
14441
|
menuEl.className = "dv-context-menu";
|
|
14401
14442
|
menuEl.setAttribute("role", "menu");
|
|
14402
|
-
|
|
14403
|
-
|
|
14404
|
-
|
|
14405
|
-
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
|
|
14409
|
-
|
|
14443
|
+
try {
|
|
14444
|
+
for (const item of items) if (item === "separator") menuEl.appendChild(buildSeparator());
|
|
14445
|
+
else if (item === "rename") menuEl.appendChild(buildRenameInput(tabGroup));
|
|
14446
|
+
else if (item === "colorPicker") menuEl.appendChild(buildColorPicker(tabGroup, this.accessor.tabGroupColorPalette));
|
|
14447
|
+
else if (item === "collapse") menuEl.appendChild(this.buildCollapseItem(tabGroup, close));
|
|
14448
|
+
else if (item === "close") menuEl.appendChild(buildItem("Close All", close, () => {
|
|
14449
|
+
group.panels.filter((p) => tabGroup.containsPanel(p.id)).forEach((p) => p.api.close());
|
|
14450
|
+
}));
|
|
14451
|
+
else if (isItemConfig(item)) this.appendConfigItem(menuEl, item, { tabGroup }, group, close, renderers);
|
|
14452
|
+
} catch (err) {
|
|
14453
|
+
renderers.dispose();
|
|
14454
|
+
throw err;
|
|
14455
|
+
}
|
|
14410
14456
|
popupService.openPopover(menuEl, {
|
|
14411
14457
|
x: event.clientX,
|
|
14412
14458
|
y: event.clientY,
|
|
14413
14459
|
zIndex: popoverZIndexFor(event.target, group)
|
|
14414
|
-
});
|
|
14460
|
+
}, { onClose: () => renderers.dispose() });
|
|
14415
14461
|
}
|
|
14416
14462
|
};
|
|
14417
14463
|
const ContextMenuModule = defineModule({
|
|
@@ -14701,6 +14747,7 @@ var OverlayRenderContainer = class extends CompositeDisposable {
|
|
|
14701
14747
|
const observerDisposable = new MutableDisposable();
|
|
14702
14748
|
const correctLayerPosition = () => {
|
|
14703
14749
|
if (panel.api.location.type === "floating") queueMicrotask(() => {
|
|
14750
|
+
if (disposable.isDisposed) return;
|
|
14704
14751
|
const floatingGroup = this.accessor.getFloatingWindowForGroup(panel.api.group);
|
|
14705
14752
|
if (!floatingGroup) return;
|
|
14706
14753
|
const element = floatingGroup.overlay.element;
|
|
@@ -14935,7 +14982,7 @@ var PopupService = class extends CompositeDisposable {
|
|
|
14935
14982
|
newRoot.prepend(this._element);
|
|
14936
14983
|
this._root = newRoot;
|
|
14937
14984
|
}
|
|
14938
|
-
openPopover(element, position) {
|
|
14985
|
+
openPopover(element, position, options) {
|
|
14939
14986
|
var _position$zIndex;
|
|
14940
14987
|
this.close();
|
|
14941
14988
|
const wrapper = this._window.document.createElement("div");
|
|
@@ -14950,14 +14997,14 @@ var PopupService = class extends CompositeDisposable {
|
|
|
14950
14997
|
this._element.appendChild(wrapper);
|
|
14951
14998
|
this._active = wrapper;
|
|
14952
14999
|
const POINTERDOWN_GRACE_MS = 200;
|
|
14953
|
-
this._activeDisposable.value = createDismissableLayer({
|
|
15000
|
+
this._activeDisposable.value = new CompositeDisposable(createDismissableLayer({
|
|
14954
15001
|
window: this._window,
|
|
14955
15002
|
onDismiss: () => this.close(),
|
|
14956
15003
|
elements: () => this._active ? [this._active] : [],
|
|
14957
15004
|
keys: ["Enter"],
|
|
14958
15005
|
pointerDownGraceMs: POINTERDOWN_GRACE_MS,
|
|
14959
15006
|
resize: true
|
|
14960
|
-
});
|
|
15007
|
+
}), (options === null || options === void 0 ? void 0 : options.onClose) ? Disposable.from(options.onClose) : Disposable.NONE);
|
|
14961
15008
|
this._window.requestAnimationFrame(() => {
|
|
14962
15009
|
shiftAbsoluteElementIntoView(wrapper, this._root);
|
|
14963
15010
|
});
|
|
@@ -16269,7 +16316,9 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16269
16316
|
this._onWillDrop = new Emitter();
|
|
16270
16317
|
this.onWillDrop = this._onWillDrop.event;
|
|
16271
16318
|
this._mutationDepth = 0;
|
|
16319
|
+
this._syncMutationDepth = 0;
|
|
16272
16320
|
this._pendingLocationChanges = /* @__PURE__ */ new Map();
|
|
16321
|
+
this._openingPopoutWindows = /* @__PURE__ */ new Set();
|
|
16273
16322
|
this._origin = "user";
|
|
16274
16323
|
this._originDepth = 0;
|
|
16275
16324
|
this._onWillMutateLayout = new Emitter();
|
|
@@ -16353,6 +16402,10 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16353
16402
|
});
|
|
16354
16403
|
}));
|
|
16355
16404
|
this.popupService = new PopupService(this.element);
|
|
16405
|
+
this.addDisposables(this.popupService, Disposable.from(() => {
|
|
16406
|
+
for (const opening of this._openingPopoutWindows) opening.dispose();
|
|
16407
|
+
this._openingPopoutWindows.clear();
|
|
16408
|
+
}));
|
|
16356
16409
|
this._api = new DockviewApi(this);
|
|
16357
16410
|
this.disableResizing = true;
|
|
16358
16411
|
this.element.remove();
|
|
@@ -16501,9 +16554,15 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16501
16554
|
const popoutWindowDisposable = new CompositeDisposable(_window, _window.onDidClose(() => {
|
|
16502
16555
|
popoutWindowDisposable.dispose();
|
|
16503
16556
|
}));
|
|
16557
|
+
this._openingPopoutWindows.add(popoutWindowDisposable);
|
|
16504
16558
|
const openError = getPopoutUrlError(popoutUrl);
|
|
16505
16559
|
return (openError ? Promise.resolve(null) : _window.open()).then((popoutContainer) => {
|
|
16506
16560
|
var _options$referenceGro, _options$overridePopo4;
|
|
16561
|
+
this._openingPopoutWindows.delete(popoutWindowDisposable);
|
|
16562
|
+
if (this.isDisposed) {
|
|
16563
|
+
popoutWindowDisposable.dispose();
|
|
16564
|
+
return false;
|
|
16565
|
+
}
|
|
16507
16566
|
if (_window.isDisposed) {
|
|
16508
16567
|
const failure = _window.failure;
|
|
16509
16568
|
if (failure && !this.isDisposed) {
|
|
@@ -16697,6 +16756,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
16697
16756
|
for (const { panel, from } of movedPanels) this.fireDidMovePanel(panel, from);
|
|
16698
16757
|
return true;
|
|
16699
16758
|
}).catch((err) => {
|
|
16759
|
+
this._openingPopoutWindows.delete(popoutWindowDisposable);
|
|
16700
16760
|
console.error("dockview: failed to create popout.", err);
|
|
16701
16761
|
return false;
|
|
16702
16762
|
});
|
|
@@ -17236,6 +17296,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
17236
17296
|
group.dispose();
|
|
17237
17297
|
this._groups.delete(group.id);
|
|
17238
17298
|
this._onDidRemoveGroup.fire(group);
|
|
17299
|
+
this.activateFallbackGroupIfRemoved(group);
|
|
17239
17300
|
});
|
|
17240
17301
|
}
|
|
17241
17302
|
setEdgeGroupCollapsed(group, collapsed) {
|
|
@@ -17432,6 +17493,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
17432
17493
|
const record = this._groups.get(temporaryGroup.api.id);
|
|
17433
17494
|
this._groups.delete(temporaryGroup.api.id);
|
|
17434
17495
|
temporaryGroupDisposables.push(Disposable.from(() => {
|
|
17496
|
+
var _this$headerActionsSe2;
|
|
17435
17497
|
/**
|
|
17436
17498
|
* Reclaim the group's own resources, never its panels.
|
|
17437
17499
|
* Staging is driven by the ids in `data.panels` while
|
|
@@ -17449,6 +17511,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
17449
17511
|
for (const panel of temporaryGroup.panels.slice()) temporaryGroup.model.removePanel(panel);
|
|
17450
17512
|
});
|
|
17451
17513
|
record === null || record === void 0 || record.disposable.dispose();
|
|
17514
|
+
(_this$headerActionsSe2 = this.headerActionsService) === null || _this$headerActionsSe2 === void 0 || _this$headerActionsSe2.disposeGroup(temporaryGroup);
|
|
17452
17515
|
temporaryGroup.dispose();
|
|
17453
17516
|
}));
|
|
17454
17517
|
return temporaryGroup;
|
|
@@ -18113,9 +18176,12 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18113
18176
|
*/
|
|
18114
18177
|
mutation(kind, func) {
|
|
18115
18178
|
const close = this.openMutation(kind);
|
|
18179
|
+
this._syncMutationDepth++;
|
|
18116
18180
|
try {
|
|
18117
18181
|
return func();
|
|
18118
18182
|
} finally {
|
|
18183
|
+
this._syncMutationDepth--;
|
|
18184
|
+
if (this._syncMutationDepth === 0) this.releaseDisposedActiveGroup();
|
|
18119
18185
|
close();
|
|
18120
18186
|
}
|
|
18121
18187
|
}
|
|
@@ -18162,6 +18228,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18162
18228
|
return () => {
|
|
18163
18229
|
this._mutationDepth--;
|
|
18164
18230
|
if (this._mutationDepth === 0) {
|
|
18231
|
+
this.releaseDisposedActiveGroup();
|
|
18165
18232
|
this.flushLocationChanges();
|
|
18166
18233
|
this._onDidMutateLayout.fire({
|
|
18167
18234
|
kind,
|
|
@@ -18170,6 +18237,11 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18170
18237
|
}
|
|
18171
18238
|
};
|
|
18172
18239
|
}
|
|
18240
|
+
/** Covers removals with `skipActive` that disposed the active group. */
|
|
18241
|
+
releaseDisposedActiveGroup() {
|
|
18242
|
+
var _this$_activeGroup;
|
|
18243
|
+
if (!this.isDisposed && ((_this$_activeGroup = this._activeGroup) === null || _this$_activeGroup === void 0 ? void 0 : _this$_activeGroup.model.isDisposed)) this.activateFallbackGroupIfRemoved(this._activeGroup);
|
|
18244
|
+
}
|
|
18173
18245
|
/**
|
|
18174
18246
|
* Coalesce a panel's `onDidLocationChange` to the end of the enclosing
|
|
18175
18247
|
* transaction, or fire it immediately when no transaction is in flight.
|
|
@@ -18307,7 +18379,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18307
18379
|
skipSetActiveGroup: true
|
|
18308
18380
|
}));
|
|
18309
18381
|
if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
18310
|
-
if (!options.keepEmptyGroups && sourceGroup.model.size === 0) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18382
|
+
if (!options.keepEmptyGroups && sourceGroup.model.size === 0 && sourceGroup !== destinationGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18311
18383
|
const isDestinationGroupEmpty = destinationGroup.model.size === 0;
|
|
18312
18384
|
this.movingLock(() => {
|
|
18313
18385
|
var _options$skipSetActiv;
|
|
@@ -18472,6 +18544,7 @@ var DockviewComponent = class extends BaseGrid {
|
|
|
18472
18544
|
const from = options.from.group;
|
|
18473
18545
|
const to = options.to.group;
|
|
18474
18546
|
const target = options.to.position;
|
|
18547
|
+
if (target === "center" && from === to) return;
|
|
18475
18548
|
let source = from;
|
|
18476
18549
|
let mergedPanels;
|
|
18477
18550
|
if (target === "center") {
|
|
@@ -19503,6 +19576,7 @@ var PaneviewComponent = class extends Resizable {
|
|
|
19503
19576
|
const queue = [];
|
|
19504
19577
|
const width = this.width;
|
|
19505
19578
|
const height = this.height;
|
|
19579
|
+
this.paneview.dispose();
|
|
19506
19580
|
this.paneview = new Paneview(this.element, {
|
|
19507
19581
|
orientation: "VERTICAL",
|
|
19508
19582
|
descriptor: {
|
|
@@ -19566,7 +19640,11 @@ var PaneviewComponent = class extends Resizable {
|
|
|
19566
19640
|
clear() {
|
|
19567
19641
|
for (const [_, value] of this._viewDisposables.entries()) value.dispose();
|
|
19568
19642
|
this._viewDisposables.clear();
|
|
19643
|
+
const width = this.width;
|
|
19644
|
+
const height = this.height;
|
|
19569
19645
|
this.paneview.dispose();
|
|
19646
|
+
this.paneview = new Paneview(this.element, { orientation: "VERTICAL" });
|
|
19647
|
+
this.layout(width, height);
|
|
19570
19648
|
}
|
|
19571
19649
|
doAddPanel(panel) {
|
|
19572
19650
|
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|