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
|
@@ -356,7 +356,9 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
356
356
|
private readonly _onWillDrop;
|
|
357
357
|
readonly onWillDrop: Event<DockviewWillDropEvent>;
|
|
358
358
|
private _mutationDepth;
|
|
359
|
+
private _syncMutationDepth;
|
|
359
360
|
private readonly _pendingLocationChanges;
|
|
361
|
+
private readonly _openingPopoutWindows;
|
|
360
362
|
private _origin;
|
|
361
363
|
private _originDepth;
|
|
362
364
|
private readonly _onWillMutateLayout;
|
|
@@ -901,6 +903,8 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
901
903
|
* therefore report as one, tagged with the kind of the last to finish.
|
|
902
904
|
*/
|
|
903
905
|
private openMutation;
|
|
906
|
+
/** Covers removals with `skipActive` that disposed the active group. */
|
|
907
|
+
private releaseDisposedActiveGroup;
|
|
904
908
|
/**
|
|
905
909
|
* Coalesce a panel's `onDidLocationChange` to the end of the enclosing
|
|
906
910
|
* transaction, or fire it immediately when no transaction is in flight.
|
|
@@ -523,6 +523,8 @@ export interface IOverflowRow {
|
|
|
523
523
|
* the keyboard controller (Enter).
|
|
524
524
|
*/
|
|
525
525
|
activate(): void;
|
|
526
|
+
/** Disposes the row's tab renderer. */
|
|
527
|
+
dispose(): void;
|
|
526
528
|
}
|
|
527
529
|
/**
|
|
528
530
|
* Core-provided builders handed to {@link IAdvancedOverflowService.renderOverflow}
|
package/dist/dockview-core.js
CHANGED
|
@@ -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
|
*/
|
|
@@ -346,21 +346,29 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
346
346
|
}
|
|
347
347
|
};
|
|
348
348
|
function watchElementResize(element, cb) {
|
|
349
|
+
const pendingFrames = /* @__PURE__ */ new Set();
|
|
349
350
|
const observer = new ResizeObserver((entires) => {
|
|
350
351
|
/**
|
|
351
352
|
* Fast browser window resize produces Error: ResizeObserver loop limit exceeded.
|
|
352
353
|
* The error isn't visible in browser console, doesn't affect functionality, but degrades performance.
|
|
353
354
|
* See https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded/58701523#58701523
|
|
354
355
|
*/
|
|
355
|
-
|
|
356
|
+
let ran = false;
|
|
357
|
+
let frame;
|
|
358
|
+
frame = requestAnimationFrame(() => {
|
|
359
|
+
ran = true;
|
|
360
|
+
if (frame !== void 0) pendingFrames.delete(frame);
|
|
356
361
|
const firstEntry = entires[0];
|
|
357
362
|
cb(firstEntry);
|
|
358
363
|
});
|
|
364
|
+
if (!ran) pendingFrames.add(frame);
|
|
359
365
|
});
|
|
360
366
|
observer.observe(element);
|
|
361
367
|
return { dispose: () => {
|
|
362
368
|
observer.unobserve(element);
|
|
363
369
|
observer.disconnect();
|
|
370
|
+
for (const frame of pendingFrames) cancelAnimationFrame(frame);
|
|
371
|
+
pendingFrames.clear();
|
|
364
372
|
} };
|
|
365
373
|
}
|
|
366
374
|
const removeClasses = (element, ...classes) => {
|
|
@@ -10229,16 +10237,21 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10229
10237
|
y: event.clientY,
|
|
10230
10238
|
zIndex: (relativeParent === null || relativeParent === void 0 ? void 0 : relativeParent.style.zIndex) ? `calc(${relativeParent.style.zIndex} * 2)` : void 0
|
|
10231
10239
|
};
|
|
10232
|
-
const context = this.createOverflowRenderContext(root, anchor);
|
|
10240
|
+
const { context, rowRenderers } = this.createOverflowRenderContext(root, anchor);
|
|
10233
10241
|
const advancedOverflow = this.accessor.advancedOverflowService;
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
+
try {
|
|
10243
|
+
if (advancedOverflow) advancedOverflow.renderOverflow({
|
|
10244
|
+
group: this.group,
|
|
10245
|
+
overflowTabs: [...this._overflowTabs],
|
|
10246
|
+
overflowTabGroups: [...this._overflowTabGroups],
|
|
10247
|
+
pinnedOverflowTabs: [...this._overflowPinnedTabs],
|
|
10248
|
+
context
|
|
10249
|
+
});
|
|
10250
|
+
else context.open(this.renderFreeOverflowList(context));
|
|
10251
|
+
} catch (err) {
|
|
10252
|
+
rowRenderers.dispose();
|
|
10253
|
+
throw err;
|
|
10254
|
+
}
|
|
10242
10255
|
}));
|
|
10243
10256
|
}
|
|
10244
10257
|
/**
|
|
@@ -10259,6 +10272,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10259
10272
|
if (overflowGroupSet.has(tg.id)) for (const pid of tg.panelIds) panelToGroup.set(pid, tg);
|
|
10260
10273
|
}
|
|
10261
10274
|
const popup = () => this.accessor.getPopupServiceForGroup(this.group);
|
|
10275
|
+
const rowRenderers = new CompositeDisposable();
|
|
10262
10276
|
const buildGroupHeader = (tg) => {
|
|
10263
10277
|
const groupHeader = document.createElement("div");
|
|
10264
10278
|
groupHeader.className = "dv-tabs-overflow-group-header";
|
|
@@ -10288,69 +10302,87 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
10288
10302
|
return groupHeader;
|
|
10289
10303
|
};
|
|
10290
10304
|
return {
|
|
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
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
block: "nearest",
|
|
10327
|
-
inline: "nearest"
|
|
10305
|
+
context: {
|
|
10306
|
+
overflowGroupIdForPanel: (panelId) => {
|
|
10307
|
+
var _panelToGroup$get;
|
|
10308
|
+
return (_panelToGroup$get = panelToGroup.get(panelId)) === null || _panelToGroup$get === void 0 ? void 0 : _panelToGroup$get.id;
|
|
10309
|
+
},
|
|
10310
|
+
buildGroupHeader: (tabGroupId) => {
|
|
10311
|
+
const tg = groupById.get(tabGroupId);
|
|
10312
|
+
if (!tg || !overflowGroupSet.has(tg.id)) return;
|
|
10313
|
+
return buildGroupHeader(tg);
|
|
10314
|
+
},
|
|
10315
|
+
buildPinnedHeader: () => {
|
|
10316
|
+
const header = document.createElement("div");
|
|
10317
|
+
header.className = "dv-tabs-overflow-group-header dv-tabs-overflow-pinned-header";
|
|
10318
|
+
const glyph = createPinButton();
|
|
10319
|
+
glyph.classList.add("dv-tabs-overflow-pinned-icon");
|
|
10320
|
+
header.appendChild(glyph);
|
|
10321
|
+
const labelSpan = document.createElement("span");
|
|
10322
|
+
labelSpan.className = "dv-tabs-overflow-group-label";
|
|
10323
|
+
labelSpan.textContent = "Pinned";
|
|
10324
|
+
header.appendChild(labelSpan);
|
|
10325
|
+
return header;
|
|
10326
|
+
},
|
|
10327
|
+
buildRow: (panelId) => {
|
|
10328
|
+
const panel = this.group.panels.find((p) => p.id === panelId);
|
|
10329
|
+
if (!panel) return;
|
|
10330
|
+
const tab = this.tabs.tabs.find((t) => t.panel.id === panelId);
|
|
10331
|
+
const tg = panelToGroup.get(panelId);
|
|
10332
|
+
const tabComponent = panel.view.createTabRenderer("headerOverflow");
|
|
10333
|
+
let rowDisposed = false;
|
|
10334
|
+
const disposeRow = Disposable.from(() => {
|
|
10335
|
+
if (!rowDisposed) {
|
|
10336
|
+
var _tabComponent$dispose;
|
|
10337
|
+
rowDisposed = true;
|
|
10338
|
+
(_tabComponent$dispose = tabComponent.dispose) === null || _tabComponent$dispose === void 0 || _tabComponent$dispose.call(tabComponent);
|
|
10339
|
+
}
|
|
10328
10340
|
});
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
+
if (rowRenderers.isDisposed) disposeRow.dispose();
|
|
10342
|
+
else rowRenderers.addDisposables(disposeRow);
|
|
10343
|
+
const child = tabComponent.element;
|
|
10344
|
+
const wrapper = document.createElement("div");
|
|
10345
|
+
toggleClass(wrapper, "dv-tab", true);
|
|
10346
|
+
toggleClass(wrapper, "dv-active-tab", panel.api.isActive);
|
|
10347
|
+
toggleClass(wrapper, "dv-inactive-tab", !panel.api.isActive);
|
|
10348
|
+
if (tg) toggleClass(wrapper, "dv-tab--grouped", true);
|
|
10349
|
+
const doActivate = () => {
|
|
10350
|
+
if (tg === null || tg === void 0 ? void 0 : tg.collapsed) tg.expand();
|
|
10351
|
+
tab === null || tab === void 0 || tab.element.scrollIntoView({
|
|
10352
|
+
block: "nearest",
|
|
10353
|
+
inline: "nearest"
|
|
10354
|
+
});
|
|
10355
|
+
this.accessor.withOrigin("user", () => panel.api.setActive());
|
|
10356
|
+
};
|
|
10357
|
+
wrapper.addEventListener("click", (event) => {
|
|
10341
10358
|
popup().close();
|
|
10359
|
+
if (event.defaultPrevented) return;
|
|
10342
10360
|
doActivate();
|
|
10343
|
-
}
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10361
|
+
});
|
|
10362
|
+
wrapper.appendChild(child);
|
|
10363
|
+
return {
|
|
10364
|
+
element: wrapper,
|
|
10365
|
+
panel,
|
|
10366
|
+
activate: () => {
|
|
10367
|
+
popup().close();
|
|
10368
|
+
doActivate();
|
|
10369
|
+
},
|
|
10370
|
+
dispose: () => {
|
|
10371
|
+
rowRenderers.removeDisposable(disposeRow);
|
|
10372
|
+
disposeRow.dispose();
|
|
10373
|
+
}
|
|
10374
|
+
};
|
|
10375
|
+
},
|
|
10376
|
+
open: (body) => {
|
|
10377
|
+
popup().openPopover(body, anchor, { onClose: () => rowRenderers.dispose() });
|
|
10378
|
+
},
|
|
10379
|
+
close: () => popup().close(),
|
|
10380
|
+
focusTrigger: () => {
|
|
10381
|
+
root.tabIndex = -1;
|
|
10382
|
+
root.focus();
|
|
10383
|
+
}
|
|
10348
10384
|
},
|
|
10349
|
-
|
|
10350
|
-
focusTrigger: () => {
|
|
10351
|
-
root.tabIndex = -1;
|
|
10352
|
-
root.focus();
|
|
10353
|
-
}
|
|
10385
|
+
rowRenderers
|
|
10354
10386
|
};
|
|
10355
10387
|
}
|
|
10356
10388
|
/**
|
|
@@ -11267,6 +11299,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
11267
11299
|
this.tabsContainer.setRightActionsElement(element);
|
|
11268
11300
|
}
|
|
11269
11301
|
setActive(isGroupActive, force = false) {
|
|
11302
|
+
if (this.isDisposed) return;
|
|
11270
11303
|
if (!force && this.isActive === isGroupActive) return;
|
|
11271
11304
|
this._isGroupActive = isGroupActive;
|
|
11272
11305
|
toggleClass(this.container, "dv-active-group", isGroupActive);
|
|
@@ -14311,13 +14344,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14311
14344
|
* menu passes the `tabGroup`. No-op when no renderer could be created (no
|
|
14312
14345
|
* factory configured, or the factory declined the component).
|
|
14313
14346
|
*/
|
|
14314
|
-
appendComponentItem(menuEl, item, identity, group, close) {
|
|
14347
|
+
appendComponentItem(menuEl, item, identity, group, close, renderers) {
|
|
14315
14348
|
var _this$accessor$option4, _this$accessor$option5;
|
|
14316
14349
|
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, {
|
|
14317
14350
|
id: nextContextMenuItemId(),
|
|
14318
14351
|
component: item.component
|
|
14319
14352
|
});
|
|
14320
14353
|
if (!renderer) return;
|
|
14354
|
+
renderers.addDisposables(renderer);
|
|
14321
14355
|
renderer.init(_objectSpread2(_objectSpread2({}, identity), {}, {
|
|
14322
14356
|
group,
|
|
14323
14357
|
api: this.accessor.api,
|
|
@@ -14368,9 +14402,9 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14368
14402
|
* default row; an item carrying none of the three renders nothing. Shared
|
|
14369
14403
|
* by both menus, which differ only in `identity`.
|
|
14370
14404
|
*/
|
|
14371
|
-
appendConfigItem(menuEl, item, identity, group, close) {
|
|
14405
|
+
appendConfigItem(menuEl, item, identity, group, close, renderers) {
|
|
14372
14406
|
if (item.element) menuEl.appendChild(item.element);
|
|
14373
|
-
else if (item.component) this.appendComponentItem(menuEl, item, identity, group, close);
|
|
14407
|
+
else if (item.component) this.appendComponentItem(menuEl, item, identity, group, close, renderers);
|
|
14374
14408
|
else if (item.label) menuEl.appendChild(buildItem(item.label, close, () => {
|
|
14375
14409
|
var _item$action;
|
|
14376
14410
|
return (_item$action = item.action) === null || _item$action === void 0 ? void 0 : _item$action.call(item);
|
|
@@ -14382,22 +14416,28 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14382
14416
|
event.preventDefault();
|
|
14383
14417
|
const popupService = this.accessor.getPopupServiceForGroup(group);
|
|
14384
14418
|
const close = () => popupService.close();
|
|
14419
|
+
const renderers = new CompositeDisposable();
|
|
14385
14420
|
const menuEl = document.createElement("div");
|
|
14386
14421
|
menuEl.className = "dv-context-menu";
|
|
14387
14422
|
menuEl.setAttribute("role", "menu");
|
|
14388
|
-
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14423
|
+
try {
|
|
14424
|
+
for (const item of items) {
|
|
14425
|
+
if (isItemConfig(item)) {
|
|
14426
|
+
this.appendConfigItem(menuEl, item, { panel }, group, close, renderers);
|
|
14427
|
+
continue;
|
|
14428
|
+
}
|
|
14429
|
+
const el = this.buildBuiltInTabItem(item, panel, group, close);
|
|
14430
|
+
if (el) menuEl.appendChild(el);
|
|
14392
14431
|
}
|
|
14393
|
-
|
|
14394
|
-
|
|
14432
|
+
} catch (err) {
|
|
14433
|
+
renderers.dispose();
|
|
14434
|
+
throw err;
|
|
14395
14435
|
}
|
|
14396
14436
|
popupService.openPopover(menuEl, {
|
|
14397
14437
|
x: event.clientX,
|
|
14398
14438
|
y: event.clientY,
|
|
14399
14439
|
zIndex: popoverZIndexFor(event.target, group)
|
|
14400
|
-
});
|
|
14440
|
+
}, { onClose: () => renderers.dispose() });
|
|
14401
14441
|
}
|
|
14402
14442
|
showForChip(tabGroup, group, event) {
|
|
14403
14443
|
if (!this.accessor.options.getTabGroupChipContextMenuItems) return;
|
|
@@ -14411,22 +14451,28 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14411
14451
|
event.preventDefault();
|
|
14412
14452
|
const popupService = this.accessor.getPopupServiceForGroup(group);
|
|
14413
14453
|
const close = () => popupService.close();
|
|
14454
|
+
const renderers = new CompositeDisposable();
|
|
14414
14455
|
const menuEl = document.createElement("div");
|
|
14415
14456
|
menuEl.className = "dv-context-menu";
|
|
14416
14457
|
menuEl.setAttribute("role", "menu");
|
|
14417
|
-
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
|
|
14421
|
-
|
|
14422
|
-
|
|
14423
|
-
|
|
14424
|
-
|
|
14458
|
+
try {
|
|
14459
|
+
for (const item of items) if (item === "separator") menuEl.appendChild(buildSeparator());
|
|
14460
|
+
else if (item === "rename") menuEl.appendChild(buildRenameInput(tabGroup));
|
|
14461
|
+
else if (item === "colorPicker") menuEl.appendChild(buildColorPicker(tabGroup, this.accessor.tabGroupColorPalette));
|
|
14462
|
+
else if (item === "collapse") menuEl.appendChild(this.buildCollapseItem(tabGroup, close));
|
|
14463
|
+
else if (item === "close") menuEl.appendChild(buildItem("Close All", close, () => {
|
|
14464
|
+
group.panels.filter((p) => tabGroup.containsPanel(p.id)).forEach((p) => p.api.close());
|
|
14465
|
+
}));
|
|
14466
|
+
else if (isItemConfig(item)) this.appendConfigItem(menuEl, item, { tabGroup }, group, close, renderers);
|
|
14467
|
+
} catch (err) {
|
|
14468
|
+
renderers.dispose();
|
|
14469
|
+
throw err;
|
|
14470
|
+
}
|
|
14425
14471
|
popupService.openPopover(menuEl, {
|
|
14426
14472
|
x: event.clientX,
|
|
14427
14473
|
y: event.clientY,
|
|
14428
14474
|
zIndex: popoverZIndexFor(event.target, group)
|
|
14429
|
-
});
|
|
14475
|
+
}, { onClose: () => renderers.dispose() });
|
|
14430
14476
|
}
|
|
14431
14477
|
};
|
|
14432
14478
|
const ContextMenuModule = defineModule({
|
|
@@ -14716,6 +14762,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14716
14762
|
const observerDisposable = new MutableDisposable();
|
|
14717
14763
|
const correctLayerPosition = () => {
|
|
14718
14764
|
if (panel.api.location.type === "floating") queueMicrotask(() => {
|
|
14765
|
+
if (disposable.isDisposed) return;
|
|
14719
14766
|
const floatingGroup = this.accessor.getFloatingWindowForGroup(panel.api.group);
|
|
14720
14767
|
if (!floatingGroup) return;
|
|
14721
14768
|
const element = floatingGroup.overlay.element;
|
|
@@ -14950,7 +14997,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14950
14997
|
newRoot.prepend(this._element);
|
|
14951
14998
|
this._root = newRoot;
|
|
14952
14999
|
}
|
|
14953
|
-
openPopover(element, position) {
|
|
15000
|
+
openPopover(element, position, options) {
|
|
14954
15001
|
var _position$zIndex;
|
|
14955
15002
|
this.close();
|
|
14956
15003
|
const wrapper = this._window.document.createElement("div");
|
|
@@ -14965,14 +15012,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14965
15012
|
this._element.appendChild(wrapper);
|
|
14966
15013
|
this._active = wrapper;
|
|
14967
15014
|
const POINTERDOWN_GRACE_MS = 200;
|
|
14968
|
-
this._activeDisposable.value = createDismissableLayer({
|
|
15015
|
+
this._activeDisposable.value = new CompositeDisposable(createDismissableLayer({
|
|
14969
15016
|
window: this._window,
|
|
14970
15017
|
onDismiss: () => this.close(),
|
|
14971
15018
|
elements: () => this._active ? [this._active] : [],
|
|
14972
15019
|
keys: ["Enter"],
|
|
14973
15020
|
pointerDownGraceMs: POINTERDOWN_GRACE_MS,
|
|
14974
15021
|
resize: true
|
|
14975
|
-
});
|
|
15022
|
+
}), (options === null || options === void 0 ? void 0 : options.onClose) ? Disposable.from(options.onClose) : Disposable.NONE);
|
|
14976
15023
|
this._window.requestAnimationFrame(() => {
|
|
14977
15024
|
shiftAbsoluteElementIntoView(wrapper, this._root);
|
|
14978
15025
|
});
|
|
@@ -16284,7 +16331,9 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16284
16331
|
this._onWillDrop = new Emitter();
|
|
16285
16332
|
this.onWillDrop = this._onWillDrop.event;
|
|
16286
16333
|
this._mutationDepth = 0;
|
|
16334
|
+
this._syncMutationDepth = 0;
|
|
16287
16335
|
this._pendingLocationChanges = /* @__PURE__ */ new Map();
|
|
16336
|
+
this._openingPopoutWindows = /* @__PURE__ */ new Set();
|
|
16288
16337
|
this._origin = "user";
|
|
16289
16338
|
this._originDepth = 0;
|
|
16290
16339
|
this._onWillMutateLayout = new Emitter();
|
|
@@ -16368,6 +16417,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16368
16417
|
});
|
|
16369
16418
|
}));
|
|
16370
16419
|
this.popupService = new PopupService(this.element);
|
|
16420
|
+
this.addDisposables(this.popupService, Disposable.from(() => {
|
|
16421
|
+
for (const opening of this._openingPopoutWindows) opening.dispose();
|
|
16422
|
+
this._openingPopoutWindows.clear();
|
|
16423
|
+
}));
|
|
16371
16424
|
this._api = new DockviewApi(this);
|
|
16372
16425
|
this.disableResizing = true;
|
|
16373
16426
|
this.element.remove();
|
|
@@ -16516,9 +16569,15 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16516
16569
|
const popoutWindowDisposable = new CompositeDisposable(_window, _window.onDidClose(() => {
|
|
16517
16570
|
popoutWindowDisposable.dispose();
|
|
16518
16571
|
}));
|
|
16572
|
+
this._openingPopoutWindows.add(popoutWindowDisposable);
|
|
16519
16573
|
const openError = getPopoutUrlError(popoutUrl);
|
|
16520
16574
|
return (openError ? Promise.resolve(null) : _window.open()).then((popoutContainer) => {
|
|
16521
16575
|
var _options$referenceGro, _options$overridePopo4;
|
|
16576
|
+
this._openingPopoutWindows.delete(popoutWindowDisposable);
|
|
16577
|
+
if (this.isDisposed) {
|
|
16578
|
+
popoutWindowDisposable.dispose();
|
|
16579
|
+
return false;
|
|
16580
|
+
}
|
|
16522
16581
|
if (_window.isDisposed) {
|
|
16523
16582
|
const failure = _window.failure;
|
|
16524
16583
|
if (failure && !this.isDisposed) {
|
|
@@ -16712,6 +16771,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16712
16771
|
for (const { panel, from } of movedPanels) this.fireDidMovePanel(panel, from);
|
|
16713
16772
|
return true;
|
|
16714
16773
|
}).catch((err) => {
|
|
16774
|
+
this._openingPopoutWindows.delete(popoutWindowDisposable);
|
|
16715
16775
|
console.error("dockview: failed to create popout.", err);
|
|
16716
16776
|
return false;
|
|
16717
16777
|
});
|
|
@@ -17251,6 +17311,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17251
17311
|
group.dispose();
|
|
17252
17312
|
this._groups.delete(group.id);
|
|
17253
17313
|
this._onDidRemoveGroup.fire(group);
|
|
17314
|
+
this.activateFallbackGroupIfRemoved(group);
|
|
17254
17315
|
});
|
|
17255
17316
|
}
|
|
17256
17317
|
setEdgeGroupCollapsed(group, collapsed) {
|
|
@@ -17447,6 +17508,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17447
17508
|
const record = this._groups.get(temporaryGroup.api.id);
|
|
17448
17509
|
this._groups.delete(temporaryGroup.api.id);
|
|
17449
17510
|
temporaryGroupDisposables.push(Disposable.from(() => {
|
|
17511
|
+
var _this$headerActionsSe2;
|
|
17450
17512
|
/**
|
|
17451
17513
|
* Reclaim the group's own resources, never its panels.
|
|
17452
17514
|
* Staging is driven by the ids in `data.panels` while
|
|
@@ -17464,6 +17526,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17464
17526
|
for (const panel of temporaryGroup.panels.slice()) temporaryGroup.model.removePanel(panel);
|
|
17465
17527
|
});
|
|
17466
17528
|
record === null || record === void 0 || record.disposable.dispose();
|
|
17529
|
+
(_this$headerActionsSe2 = this.headerActionsService) === null || _this$headerActionsSe2 === void 0 || _this$headerActionsSe2.disposeGroup(temporaryGroup);
|
|
17467
17530
|
temporaryGroup.dispose();
|
|
17468
17531
|
}));
|
|
17469
17532
|
return temporaryGroup;
|
|
@@ -18128,9 +18191,12 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18128
18191
|
*/
|
|
18129
18192
|
mutation(kind, func) {
|
|
18130
18193
|
const close = this.openMutation(kind);
|
|
18194
|
+
this._syncMutationDepth++;
|
|
18131
18195
|
try {
|
|
18132
18196
|
return func();
|
|
18133
18197
|
} finally {
|
|
18198
|
+
this._syncMutationDepth--;
|
|
18199
|
+
if (this._syncMutationDepth === 0) this.releaseDisposedActiveGroup();
|
|
18134
18200
|
close();
|
|
18135
18201
|
}
|
|
18136
18202
|
}
|
|
@@ -18177,6 +18243,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18177
18243
|
return () => {
|
|
18178
18244
|
this._mutationDepth--;
|
|
18179
18245
|
if (this._mutationDepth === 0) {
|
|
18246
|
+
this.releaseDisposedActiveGroup();
|
|
18180
18247
|
this.flushLocationChanges();
|
|
18181
18248
|
this._onDidMutateLayout.fire({
|
|
18182
18249
|
kind,
|
|
@@ -18185,6 +18252,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18185
18252
|
}
|
|
18186
18253
|
};
|
|
18187
18254
|
}
|
|
18255
|
+
/** Covers removals with `skipActive` that disposed the active group. */
|
|
18256
|
+
releaseDisposedActiveGroup() {
|
|
18257
|
+
var _this$_activeGroup;
|
|
18258
|
+
if (!this.isDisposed && ((_this$_activeGroup = this._activeGroup) === null || _this$_activeGroup === void 0 ? void 0 : _this$_activeGroup.model.isDisposed)) this.activateFallbackGroupIfRemoved(this._activeGroup);
|
|
18259
|
+
}
|
|
18188
18260
|
/**
|
|
18189
18261
|
* Coalesce a panel's `onDidLocationChange` to the end of the enclosing
|
|
18190
18262
|
* transaction, or fire it immediately when no transaction is in flight.
|
|
@@ -18322,7 +18394,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18322
18394
|
skipSetActiveGroup: true
|
|
18323
18395
|
}));
|
|
18324
18396
|
if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
18325
|
-
if (!options.keepEmptyGroups && sourceGroup.model.size === 0) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18397
|
+
if (!options.keepEmptyGroups && sourceGroup.model.size === 0 && sourceGroup !== destinationGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
18326
18398
|
const isDestinationGroupEmpty = destinationGroup.model.size === 0;
|
|
18327
18399
|
this.movingLock(() => {
|
|
18328
18400
|
var _options$skipSetActiv;
|
|
@@ -18487,6 +18559,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
18487
18559
|
const from = options.from.group;
|
|
18488
18560
|
const to = options.to.group;
|
|
18489
18561
|
const target = options.to.position;
|
|
18562
|
+
if (target === "center" && from === to) return;
|
|
18490
18563
|
let source = from;
|
|
18491
18564
|
let mergedPanels;
|
|
18492
18565
|
if (target === "center") {
|
|
@@ -19518,6 +19591,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
19518
19591
|
const queue = [];
|
|
19519
19592
|
const width = this.width;
|
|
19520
19593
|
const height = this.height;
|
|
19594
|
+
this.paneview.dispose();
|
|
19521
19595
|
this.paneview = new Paneview(this.element, {
|
|
19522
19596
|
orientation: "VERTICAL",
|
|
19523
19597
|
descriptor: {
|
|
@@ -19581,7 +19655,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
19581
19655
|
clear() {
|
|
19582
19656
|
for (const [_, value] of this._viewDisposables.entries()) value.dispose();
|
|
19583
19657
|
this._viewDisposables.clear();
|
|
19658
|
+
const width = this.width;
|
|
19659
|
+
const height = this.height;
|
|
19584
19660
|
this.paneview.dispose();
|
|
19661
|
+
this.paneview = new Paneview(this.element, { orientation: "VERTICAL" });
|
|
19662
|
+
this.layout(width, height);
|
|
19585
19663
|
}
|
|
19586
19664
|
doAddPanel(panel) {
|
|
19587
19665
|
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|