dockview 8.2.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dockview.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 8.
|
|
3
|
+
* @version 8.3.0
|
|
4
4
|
* @link https://github.com/dockview/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -22,7 +22,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
22
22
|
//#region ../dockview-core/dist/package/main.esm.mjs
|
|
23
23
|
/**
|
|
24
24
|
* dockview-core
|
|
25
|
-
* @version 8.
|
|
25
|
+
* @version 8.3.0
|
|
26
26
|
* @link https://github.com/dockview/dockview
|
|
27
27
|
* @license MIT
|
|
28
28
|
*/
|
|
@@ -1048,8 +1048,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
1048
1048
|
container.appendChild(view.element);
|
|
1049
1049
|
let viewSize;
|
|
1050
1050
|
if (typeof size === "number") viewSize = size;
|
|
1051
|
-
else if (size.type === "split")
|
|
1052
|
-
|
|
1051
|
+
else if (size.type === "split") {
|
|
1052
|
+
const splitTarget = this.viewItems[size.index];
|
|
1053
|
+
if (splitTarget) {
|
|
1054
|
+
const half = Math.floor(splitTarget.size / 2);
|
|
1055
|
+
viewSize = splitTarget.size - half;
|
|
1056
|
+
splitTarget.size = half;
|
|
1057
|
+
} else viewSize = this.getViewSize(size.index) / 2;
|
|
1058
|
+
} else if (size.type === "invisible") viewSize = { cachedVisibleSize: size.cachedVisibleSize };
|
|
1053
1059
|
else viewSize = view.minimumSize;
|
|
1054
1060
|
const disposable = view.onDidChange((newSize) => this.onDidChange(viewItem, newSize.size));
|
|
1055
1061
|
const viewItem = new ViewItem(container, view, viewSize, { dispose: () => {
|
|
@@ -5689,7 +5695,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
5689
5695
|
};
|
|
5690
5696
|
case "auto":
|
|
5691
5697
|
case void 0:
|
|
5692
|
-
default: return isCoarsePrimaryInput$
|
|
5698
|
+
default: return isCoarsePrimaryInput$2() ? {
|
|
5693
5699
|
html5: false,
|
|
5694
5700
|
pointer: true,
|
|
5695
5701
|
pointerHandlesMouse: true
|
|
@@ -5700,7 +5706,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
5700
5706
|
};
|
|
5701
5707
|
}
|
|
5702
5708
|
}
|
|
5703
|
-
function isCoarsePrimaryInput$
|
|
5709
|
+
function isCoarsePrimaryInput$2() {
|
|
5704
5710
|
if (globalThis.window === void 0 || !globalThis.matchMedia) return false;
|
|
5705
5711
|
const coarse = globalThis.matchMedia("(pointer: coarse)").matches;
|
|
5706
5712
|
const fine = globalThis.matchMedia("(pointer: fine)").matches;
|
|
@@ -7821,11 +7827,28 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
7821
7827
|
if (this._voidContainer && related && (related === this._voidContainer || this._voidContainer.contains(related))) return;
|
|
7822
7828
|
this.resetTabTransforms();
|
|
7823
7829
|
if (this._animState.sourceIndex === -1) {
|
|
7824
|
-
|
|
7825
|
-
(_this$group$model$dro2 = this.group.model.dropTargetContainer) === null || _this$group$model$dro2 === void 0 || (_this$group$model$dro2 = _this$group$model$dro2.model) === null || _this$group$model$dro2 === void 0 || _this$group$model$dro2.clear();
|
|
7830
|
+
this.clearHeaderAnchorOverlay();
|
|
7826
7831
|
this._animState = null;
|
|
7827
7832
|
} else this._animState.currentInsertionIndex = null;
|
|
7828
7833
|
}
|
|
7834
|
+
/**
|
|
7835
|
+
* Clear the anchored overlay only when this header is what rendered it.
|
|
7836
|
+
* The container is shared with the group's content drop target, which
|
|
7837
|
+
* renders into it on the same frame the cursor leaves the strip: the
|
|
7838
|
+
* pointer backend calls `handleDragOver` on the new target before the
|
|
7839
|
+
* global `onDragMove` that reaches us (#1612).
|
|
7840
|
+
*/
|
|
7841
|
+
clearHeaderAnchorOverlay() {
|
|
7842
|
+
var _container$model;
|
|
7843
|
+
const container = this.group.model.dropTargetContainer;
|
|
7844
|
+
const outline = container === null || container === void 0 ? void 0 : container.renderedOutline;
|
|
7845
|
+
if (outline && ![
|
|
7846
|
+
this._tabsList,
|
|
7847
|
+
this._voidContainer,
|
|
7848
|
+
this._extendedDropZone
|
|
7849
|
+
].some((scope) => scope === null || scope === void 0 ? void 0 : scope.contains(outline))) return;
|
|
7850
|
+
container === null || container === void 0 || (_container$model = container.model) === null || _container$model === void 0 || _container$model.clear();
|
|
7851
|
+
}
|
|
7829
7852
|
handleDragOver(event) {
|
|
7830
7853
|
var _this$accessor$option2;
|
|
7831
7854
|
if (!this._animState) return;
|
|
@@ -12198,7 +12221,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
12198
12221
|
"AdvancedOverflow",
|
|
12199
12222
|
"AutoEdgeGroup",
|
|
12200
12223
|
"AutoHideEdgeGroup",
|
|
12201
|
-
"ContextMenu",
|
|
12202
12224
|
"DndCompass",
|
|
12203
12225
|
"KeyboardDocking",
|
|
12204
12226
|
"KeyboardNavigation",
|
|
@@ -12280,8 +12302,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
12280
12302
|
* case: calling `undo()` having never set the option at all.
|
|
12281
12303
|
*
|
|
12282
12304
|
* Interaction handlers are queries in this sense too: a right-click reaching an
|
|
12283
|
-
* absent
|
|
12284
|
-
*
|
|
12305
|
+
* absent module means the app never asked for that feature, so it stays silent
|
|
12306
|
+
* (`?.`) and the browser's own behaviour applies. Options are where intent is
|
|
12285
12307
|
* declared; see `optionsModules.ts`.
|
|
12286
12308
|
*/
|
|
12287
12309
|
function assertModule(service, moduleName, context) {
|
|
@@ -12358,10 +12380,9 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
12358
12380
|
*
|
|
12359
12381
|
* This is the "declared intent" diagnostic. It fires when the user asks for a
|
|
12360
12382
|
* feature via options, at construction and on every `updateOptions`. It
|
|
12361
|
-
* deliberately does *not* fire on user interaction:
|
|
12362
|
-
*
|
|
12363
|
-
*
|
|
12364
|
-
* app never wanted.
|
|
12383
|
+
* deliberately does *not* fire on user interaction: an interaction reaching an
|
|
12384
|
+
* absent module stays silent, because the `?.` service-slot call sites can't
|
|
12385
|
+
* tell a missing module from a feature the app never wanted.
|
|
12365
12386
|
*
|
|
12366
12387
|
* Rules are a flat list rather than a `Record<keyof DockviewOptions, ...>`
|
|
12367
12388
|
* because dockview's options are nested and value-gated: `overflow.mode:
|
|
@@ -12457,18 +12478,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
12457
12478
|
moduleName: "AutoEdgeGroup",
|
|
12458
12479
|
when: (o) => isAnyEdgeGroupEnabled(o.dockToEdgeGroups)
|
|
12459
12480
|
},
|
|
12460
|
-
{
|
|
12461
|
-
optionKey: "getTabContextMenuItems",
|
|
12462
|
-
reason: "getTabContextMenuItems",
|
|
12463
|
-
moduleName: "ContextMenu",
|
|
12464
|
-
when: (o) => o.getTabContextMenuItems != null
|
|
12465
|
-
},
|
|
12466
|
-
{
|
|
12467
|
-
optionKey: "getTabGroupChipContextMenuItems",
|
|
12468
|
-
reason: "getTabGroupChipContextMenuItems",
|
|
12469
|
-
moduleName: "ContextMenu",
|
|
12470
|
-
when: (o) => o.getTabGroupChipContextMenuItems != null
|
|
12471
|
-
},
|
|
12472
12481
|
{
|
|
12473
12482
|
optionKey: "dndCompass",
|
|
12474
12483
|
reason: "dndCompass",
|
|
@@ -13335,6 +13344,267 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
13335
13344
|
} });
|
|
13336
13345
|
}
|
|
13337
13346
|
});
|
|
13347
|
+
function popoverZIndexFor(target, group) {
|
|
13348
|
+
var _group$api, _group$api$isPeeking;
|
|
13349
|
+
if ((_group$api = group.api) === null || _group$api === void 0 || (_group$api$isPeeking = _group$api.isPeeking) === null || _group$api$isPeeking === void 0 ? void 0 : _group$api$isPeeking.call(_group$api)) return "calc(var(--dv-overlay-z-index, 999) + 100)";
|
|
13350
|
+
if (!(target instanceof HTMLElement)) return;
|
|
13351
|
+
const relativeParent = findRelativeZIndexParent(target);
|
|
13352
|
+
return (relativeParent === null || relativeParent === void 0 ? void 0 : relativeParent.style.zIndex) ? `calc(${relativeParent.style.zIndex} * 2)` : void 0;
|
|
13353
|
+
}
|
|
13354
|
+
let _nextId = 0;
|
|
13355
|
+
const nextContextMenuItemId = () => `dv-ctx-menu-item-${_nextId++}`;
|
|
13356
|
+
function isItemConfig(item) {
|
|
13357
|
+
return typeof item === "object";
|
|
13358
|
+
}
|
|
13359
|
+
function buildItem(label, close, action, disabled) {
|
|
13360
|
+
const el = document.createElement("div");
|
|
13361
|
+
el.className = "dv-context-menu-item";
|
|
13362
|
+
el.setAttribute("role", "menuitem");
|
|
13363
|
+
if (disabled) {
|
|
13364
|
+
el.classList.add("dv-context-menu-item--disabled");
|
|
13365
|
+
el.setAttribute("aria-disabled", "true");
|
|
13366
|
+
}
|
|
13367
|
+
el.textContent = label;
|
|
13368
|
+
if (!disabled) el.addEventListener("click", () => {
|
|
13369
|
+
action();
|
|
13370
|
+
close();
|
|
13371
|
+
});
|
|
13372
|
+
return el;
|
|
13373
|
+
}
|
|
13374
|
+
function buildSeparator() {
|
|
13375
|
+
const el = document.createElement("div");
|
|
13376
|
+
el.className = "dv-context-menu-separator";
|
|
13377
|
+
el.setAttribute("role", "separator");
|
|
13378
|
+
return el;
|
|
13379
|
+
}
|
|
13380
|
+
function isCoarsePrimaryInput$1() {
|
|
13381
|
+
if (globalThis.window === void 0 || !globalThis.matchMedia) return false;
|
|
13382
|
+
const coarse = globalThis.matchMedia("(pointer: coarse)").matches;
|
|
13383
|
+
const fine = globalThis.matchMedia("(pointer: fine)").matches;
|
|
13384
|
+
return coarse && !fine;
|
|
13385
|
+
}
|
|
13386
|
+
function buildRenameInput(tabGroup) {
|
|
13387
|
+
const wrapper = document.createElement("div");
|
|
13388
|
+
wrapper.className = "dv-context-menu-rename";
|
|
13389
|
+
const input = document.createElement("input");
|
|
13390
|
+
input.className = "dv-context-menu-rename-input";
|
|
13391
|
+
input.type = "text";
|
|
13392
|
+
input.placeholder = "Name This Group";
|
|
13393
|
+
input.value = tabGroup.label;
|
|
13394
|
+
input.addEventListener("input", () => {
|
|
13395
|
+
tabGroup.setLabel(input.value);
|
|
13396
|
+
});
|
|
13397
|
+
input.addEventListener("keydown", (e) => {
|
|
13398
|
+
if (e.key !== "Escape" && e.key !== "Enter") e.stopPropagation();
|
|
13399
|
+
});
|
|
13400
|
+
input.addEventListener("click", (e) => {
|
|
13401
|
+
e.stopPropagation();
|
|
13402
|
+
});
|
|
13403
|
+
wrapper.appendChild(input);
|
|
13404
|
+
if (!isCoarsePrimaryInput$1()) requestAnimationFrame(() => {
|
|
13405
|
+
input.focus();
|
|
13406
|
+
input.select();
|
|
13407
|
+
});
|
|
13408
|
+
return wrapper;
|
|
13409
|
+
}
|
|
13410
|
+
function buildColorPicker(tabGroup, palette) {
|
|
13411
|
+
const wrapper = document.createElement("div");
|
|
13412
|
+
wrapper.className = "dv-context-menu-color-picker";
|
|
13413
|
+
if (!palette.enabled) return wrapper;
|
|
13414
|
+
for (const entry of palette.entries()) {
|
|
13415
|
+
const swatch = document.createElement("div");
|
|
13416
|
+
swatch.className = "dv-context-menu-color-swatch";
|
|
13417
|
+
swatch.style.setProperty("--dv-tab-group-color", entry.value);
|
|
13418
|
+
if (entry.label) swatch.title = entry.label;
|
|
13419
|
+
if (tabGroup.color === entry.id) swatch.classList.add("dv-context-menu-color-swatch--selected");
|
|
13420
|
+
swatch.addEventListener("click", () => {
|
|
13421
|
+
tabGroup.setColor(entry.id);
|
|
13422
|
+
});
|
|
13423
|
+
wrapper.appendChild(swatch);
|
|
13424
|
+
}
|
|
13425
|
+
return wrapper;
|
|
13426
|
+
}
|
|
13427
|
+
var ContextMenuController = class {
|
|
13428
|
+
constructor(accessor) {
|
|
13429
|
+
this.accessor = accessor;
|
|
13430
|
+
}
|
|
13431
|
+
/**
|
|
13432
|
+
* A single maximize/restore toggle whose label and behaviour track the
|
|
13433
|
+
* group's live state: it reads *Restore* + calls `exitMaximized` when the
|
|
13434
|
+
* group is maximized, otherwise *Maximize* + `maximize`. Only grid groups
|
|
13435
|
+
* can be maximized, so the item is disabled for floating / popout panels
|
|
13436
|
+
* that are not already maximized.
|
|
13437
|
+
*/
|
|
13438
|
+
buildMaximizeItem(panel, close) {
|
|
13439
|
+
const isMaximized = panel.api.isMaximized();
|
|
13440
|
+
return buildItem(isMaximized ? "Restore" : "Maximize", close, isMaximized ? () => panel.api.exitMaximized() : () => panel.api.maximize(), !isMaximized && panel.api.location.type !== "grid");
|
|
13441
|
+
}
|
|
13442
|
+
/**
|
|
13443
|
+
* A single collapse/expand toggle whose label tracks the tab group's live
|
|
13444
|
+
* state: *Expand* when the group is already collapsed, otherwise *Collapse*.
|
|
13445
|
+
*/
|
|
13446
|
+
buildCollapseItem(tabGroup, close) {
|
|
13447
|
+
return buildItem(tabGroup.collapsed ? "Expand" : "Collapse", close, () => tabGroup.toggle());
|
|
13448
|
+
}
|
|
13449
|
+
/**
|
|
13450
|
+
* Whether to auto-inject the built-in Pin/Unpin item at the top of the tab
|
|
13451
|
+
* menu. True only when the PinnedTabs module is registered, pinning is
|
|
13452
|
+
* enabled, and the app has not opted out via `pinnedTabs.contextMenuItem:
|
|
13453
|
+
* false` (the item is on by default). This keeps pinning reachable from the
|
|
13454
|
+
* menu without the app having to return `'pin'` from
|
|
13455
|
+
* `getTabContextMenuItems` itself.
|
|
13456
|
+
*/
|
|
13457
|
+
_shouldInjectPin() {
|
|
13458
|
+
const pinnedTabs = this.accessor.options.pinnedTabs;
|
|
13459
|
+
return !!this.accessor.pinnedTabsService && !!(pinnedTabs === null || pinnedTabs === void 0 ? void 0 : pinnedTabs.enabled) && pinnedTabs.contextMenuItem !== false;
|
|
13460
|
+
}
|
|
13461
|
+
/**
|
|
13462
|
+
* The tab menu items: the app's own items (if any) with the built-in
|
|
13463
|
+
* `'pin'` item prepended when {@link _shouldInjectPin} applies, so the app
|
|
13464
|
+
* keeps full control of its list, and pinning is added without disturbing
|
|
13465
|
+
* it. Reuses the existing `'pin'` token rendering below.
|
|
13466
|
+
*/
|
|
13467
|
+
_resolveTabItems(panel, group, event) {
|
|
13468
|
+
var _this$accessor$option, _this$accessor$option2, _this$accessor$option3;
|
|
13469
|
+
const appItems = (_this$accessor$option = (_this$accessor$option2 = (_this$accessor$option3 = this.accessor.options).getTabContextMenuItems) === null || _this$accessor$option2 === void 0 ? void 0 : _this$accessor$option2.call(_this$accessor$option3, {
|
|
13470
|
+
panel,
|
|
13471
|
+
group,
|
|
13472
|
+
api: this.accessor.api,
|
|
13473
|
+
event
|
|
13474
|
+
})) !== null && _this$accessor$option !== void 0 ? _this$accessor$option : [];
|
|
13475
|
+
return this._shouldInjectPin() ? ["pin", ...appItems] : appItems;
|
|
13476
|
+
}
|
|
13477
|
+
/**
|
|
13478
|
+
* Render a custom `component` menu item and append it to `menuEl`. Builds
|
|
13479
|
+
* the framework renderer via the host's `createContextMenuItemComponent`
|
|
13480
|
+
* factory and initialises it. Shared by the tab menu and the chip menu,
|
|
13481
|
+
* which differ only in `identity`: the tab menu passes the `panel`, the chip
|
|
13482
|
+
* menu passes the `tabGroup`. No-op when no renderer could be created (no
|
|
13483
|
+
* factory configured, or the factory declined the component).
|
|
13484
|
+
*/
|
|
13485
|
+
appendComponentItem(menuEl, item, identity, group, close) {
|
|
13486
|
+
var _this$accessor$option4, _this$accessor$option5;
|
|
13487
|
+
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, {
|
|
13488
|
+
id: nextContextMenuItemId(),
|
|
13489
|
+
component: item.component
|
|
13490
|
+
});
|
|
13491
|
+
if (!renderer) return;
|
|
13492
|
+
renderer.init(_objectSpread2(_objectSpread2({}, identity), {}, {
|
|
13493
|
+
group,
|
|
13494
|
+
api: this.accessor.api,
|
|
13495
|
+
close,
|
|
13496
|
+
componentProps: item.componentProps
|
|
13497
|
+
}));
|
|
13498
|
+
menuEl.appendChild(renderer.element);
|
|
13499
|
+
}
|
|
13500
|
+
/**
|
|
13501
|
+
* The element for one built-in tab item, or `undefined` for a token this
|
|
13502
|
+
* version doesn't know (an app on a newer typings version, or plain JS):
|
|
13503
|
+
* an unrecognised token renders nothing rather than throwing.
|
|
13504
|
+
*/
|
|
13505
|
+
buildBuiltInTabItem(item, panel, group, close) {
|
|
13506
|
+
switch (item) {
|
|
13507
|
+
case "separator": return buildSeparator();
|
|
13508
|
+
case "close": return buildItem("Close", close, () => panel.api.close());
|
|
13509
|
+
case "closeOthers": return buildItem("Close Others", close, () => {
|
|
13510
|
+
group.panels.filter((p) => p !== panel).forEach((p) => p.api.close());
|
|
13511
|
+
});
|
|
13512
|
+
case "closeAll": return buildItem("Close All", close, () => {
|
|
13513
|
+
[...group.panels].forEach((p) => p.api.close());
|
|
13514
|
+
});
|
|
13515
|
+
case "closeLeft": {
|
|
13516
|
+
const index = group.panels.indexOf(panel);
|
|
13517
|
+
return buildItem("Close to the Left", close, () => {
|
|
13518
|
+
group.panels.filter((_, i) => i < index).forEach((p) => p.api.close());
|
|
13519
|
+
}, index <= 0);
|
|
13520
|
+
}
|
|
13521
|
+
case "closeRight": {
|
|
13522
|
+
const index = group.panels.indexOf(panel);
|
|
13523
|
+
return buildItem("Close to the Right", close, () => {
|
|
13524
|
+
group.panels.filter((_, i) => i > index).forEach((p) => p.api.close());
|
|
13525
|
+
}, index === -1 || index >= group.panels.length - 1);
|
|
13526
|
+
}
|
|
13527
|
+
case "maximize": return this.buildMaximizeItem(panel, close);
|
|
13528
|
+
case "float": return buildItem("Float", close, () => this.accessor.api.addFloatingGroup(panel), panel.api.location.type === "floating");
|
|
13529
|
+
case "popout": return buildItem("Open in New Window", close, () => {
|
|
13530
|
+
this.accessor.api.addPopoutGroup(panel);
|
|
13531
|
+
}, panel.api.location.type === "popout");
|
|
13532
|
+
case "pin": return buildItem(panel.api.isPinned ? "Unpin tab" : "Pin tab", close, () => panel.api.setPinned(!panel.api.isPinned));
|
|
13533
|
+
default: return;
|
|
13534
|
+
}
|
|
13535
|
+
}
|
|
13536
|
+
/**
|
|
13537
|
+
* Append one app-supplied item. A raw `element` is used as-is, a
|
|
13538
|
+
* `component` goes through the framework renderer, and a `label` builds the
|
|
13539
|
+
* default row; an item carrying none of the three renders nothing. Shared
|
|
13540
|
+
* by both menus, which differ only in `identity`.
|
|
13541
|
+
*/
|
|
13542
|
+
appendConfigItem(menuEl, item, identity, group, close) {
|
|
13543
|
+
if (item.element) menuEl.appendChild(item.element);
|
|
13544
|
+
else if (item.component) this.appendComponentItem(menuEl, item, identity, group, close);
|
|
13545
|
+
else if (item.label) menuEl.appendChild(buildItem(item.label, close, () => {
|
|
13546
|
+
var _item$action;
|
|
13547
|
+
return (_item$action = item.action) === null || _item$action === void 0 ? void 0 : _item$action.call(item);
|
|
13548
|
+
}, item.disabled));
|
|
13549
|
+
}
|
|
13550
|
+
show(panel, group, event) {
|
|
13551
|
+
const items = this._resolveTabItems(panel, group, event);
|
|
13552
|
+
if (items.length === 0) return;
|
|
13553
|
+
event.preventDefault();
|
|
13554
|
+
const popupService = this.accessor.getPopupServiceForGroup(group);
|
|
13555
|
+
const close = () => popupService.close();
|
|
13556
|
+
const menuEl = document.createElement("div");
|
|
13557
|
+
menuEl.className = "dv-context-menu";
|
|
13558
|
+
menuEl.setAttribute("role", "menu");
|
|
13559
|
+
for (const item of items) {
|
|
13560
|
+
if (isItemConfig(item)) {
|
|
13561
|
+
this.appendConfigItem(menuEl, item, { panel }, group, close);
|
|
13562
|
+
continue;
|
|
13563
|
+
}
|
|
13564
|
+
const el = this.buildBuiltInTabItem(item, panel, group, close);
|
|
13565
|
+
if (el) menuEl.appendChild(el);
|
|
13566
|
+
}
|
|
13567
|
+
popupService.openPopover(menuEl, {
|
|
13568
|
+
x: event.clientX,
|
|
13569
|
+
y: event.clientY,
|
|
13570
|
+
zIndex: popoverZIndexFor(event.target, group)
|
|
13571
|
+
});
|
|
13572
|
+
}
|
|
13573
|
+
showForChip(tabGroup, group, event) {
|
|
13574
|
+
if (!this.accessor.options.getTabGroupChipContextMenuItems) return;
|
|
13575
|
+
const items = this.accessor.options.getTabGroupChipContextMenuItems({
|
|
13576
|
+
tabGroup,
|
|
13577
|
+
group,
|
|
13578
|
+
api: this.accessor.api,
|
|
13579
|
+
event
|
|
13580
|
+
});
|
|
13581
|
+
if (items.length === 0) return;
|
|
13582
|
+
event.preventDefault();
|
|
13583
|
+
const popupService = this.accessor.getPopupServiceForGroup(group);
|
|
13584
|
+
const close = () => popupService.close();
|
|
13585
|
+
const menuEl = document.createElement("div");
|
|
13586
|
+
menuEl.className = "dv-context-menu";
|
|
13587
|
+
menuEl.setAttribute("role", "menu");
|
|
13588
|
+
for (const item of items) if (item === "separator") menuEl.appendChild(buildSeparator());
|
|
13589
|
+
else if (item === "rename") menuEl.appendChild(buildRenameInput(tabGroup));
|
|
13590
|
+
else if (item === "colorPicker") menuEl.appendChild(buildColorPicker(tabGroup, this.accessor.tabGroupColorPalette));
|
|
13591
|
+
else if (item === "collapse") menuEl.appendChild(this.buildCollapseItem(tabGroup, close));
|
|
13592
|
+
else if (item === "close") menuEl.appendChild(buildItem("Close All", close, () => {
|
|
13593
|
+
group.panels.filter((p) => tabGroup.containsPanel(p.id)).forEach((p) => p.api.close());
|
|
13594
|
+
}));
|
|
13595
|
+
else if (isItemConfig(item)) this.appendConfigItem(menuEl, item, { tabGroup }, group, close);
|
|
13596
|
+
popupService.openPopover(menuEl, {
|
|
13597
|
+
x: event.clientX,
|
|
13598
|
+
y: event.clientY,
|
|
13599
|
+
zIndex: popoverZIndexFor(event.target, group)
|
|
13600
|
+
});
|
|
13601
|
+
}
|
|
13602
|
+
};
|
|
13603
|
+
const ContextMenuModule = defineModule({
|
|
13604
|
+
name: "ContextMenu",
|
|
13605
|
+
serviceKey: "contextMenuService",
|
|
13606
|
+
create: (host) => new ContextMenuController(host)
|
|
13607
|
+
});
|
|
13338
13608
|
/**
|
|
13339
13609
|
* Internal list of the built-in modules that ship with the core. Registered
|
|
13340
13610
|
* automatically by DockviewComponent at construction time; not exported from
|
|
@@ -13350,7 +13620,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
13350
13620
|
HeaderActionsModule,
|
|
13351
13621
|
LiveRegionModule,
|
|
13352
13622
|
AdvancedDnDModule,
|
|
13353
|
-
TabGroupChipsModule
|
|
13623
|
+
TabGroupChipsModule,
|
|
13624
|
+
ContextMenuModule
|
|
13354
13625
|
];
|
|
13355
13626
|
var PositionCache = class {
|
|
13356
13627
|
constructor() {
|
|
@@ -14021,6 +14292,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14021
14292
|
}
|
|
14022
14293
|
};
|
|
14023
14294
|
var DropTargetAnchorContainer = class extends CompositeDisposable {
|
|
14295
|
+
/**
|
|
14296
|
+
* The element the live overlay was rendered for, `undefined` when nothing
|
|
14297
|
+
* is showing. The container is shared by every drop target, so a caller
|
|
14298
|
+
* tearing down only its own overlay must check this before `clear()`.
|
|
14299
|
+
*/
|
|
14300
|
+
get renderedOutline() {
|
|
14301
|
+
return this._model ? this._outline : void 0;
|
|
14302
|
+
}
|
|
14024
14303
|
get disabled() {
|
|
14025
14304
|
return this._disabled;
|
|
14026
14305
|
}
|
|
@@ -14322,6 +14601,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14322
14601
|
const index = position === "top" ? this._topIndex : this._bottomIndex;
|
|
14323
14602
|
if (index !== void 0) this._splitview.resizeView(index, size);
|
|
14324
14603
|
}
|
|
14604
|
+
/** The inner splitview's primary-axis (height) extent; zero until laid out. */
|
|
14605
|
+
get axisSize() {
|
|
14606
|
+
return this._splitview.size;
|
|
14607
|
+
}
|
|
14325
14608
|
updateMargin(gap) {
|
|
14326
14609
|
this._splitview.margin = gap;
|
|
14327
14610
|
}
|
|
@@ -14334,6 +14617,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14334
14617
|
constructor(container, dockviewElement, layoutGrid, gap = 0, defaultCollapsedSize = 35) {
|
|
14335
14618
|
this._disposables = new CompositeDisposable();
|
|
14336
14619
|
this._viewConfigs = /* @__PURE__ */ new Map();
|
|
14620
|
+
this._pendingSizes = /* @__PURE__ */ new Map();
|
|
14337
14621
|
this._currentWidth = 0;
|
|
14338
14622
|
this._currentHeight = 0;
|
|
14339
14623
|
this._gap = gap;
|
|
@@ -14424,11 +14708,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14424
14708
|
break;
|
|
14425
14709
|
}
|
|
14426
14710
|
this._disposables.addDisposables(view);
|
|
14711
|
+
if (!view.isCollapsed && !this._canResize(position)) this._pendingSizes.set(position, initialSize);
|
|
14427
14712
|
this.updateTheme(this._gap, this._defaultCollapsedSize);
|
|
14428
14713
|
return view;
|
|
14429
14714
|
}
|
|
14430
14715
|
layout(width, height) {
|
|
14431
14716
|
this._outerSplitview.layout(width, height);
|
|
14717
|
+
this._flushPendingSizes();
|
|
14432
14718
|
}
|
|
14433
14719
|
/**
|
|
14434
14720
|
* Called when the active theme changes. Updates splitview margins and
|
|
@@ -14492,6 +14778,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14492
14778
|
this._disposables.removeDisposable(view);
|
|
14493
14779
|
view.dispose();
|
|
14494
14780
|
this._viewConfigs.delete(position);
|
|
14781
|
+
this._pendingSizes.delete(position);
|
|
14495
14782
|
this.updateTheme(this._gap, this._defaultCollapsedSize);
|
|
14496
14783
|
}
|
|
14497
14784
|
hasEdgeGroup(position) {
|
|
@@ -14515,6 +14802,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14515
14802
|
this._middleColumn.setViewVisible(position, visible);
|
|
14516
14803
|
break;
|
|
14517
14804
|
}
|
|
14805
|
+
if (visible) this._flushPendingSizes();
|
|
14518
14806
|
}
|
|
14519
14807
|
isEdgeGroupVisible(position) {
|
|
14520
14808
|
switch (position) {
|
|
@@ -14532,20 +14820,63 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14532
14820
|
const view = this._getView(position);
|
|
14533
14821
|
if (!view) return;
|
|
14534
14822
|
view.setCollapsed(collapsed);
|
|
14535
|
-
|
|
14823
|
+
if (collapsed) {
|
|
14824
|
+
this._pendingSizes.delete(position);
|
|
14825
|
+
this._resizeView(position, view.collapsedSize);
|
|
14826
|
+
} else this.resizeEdgeGroup(position, view.lastExpandedSize);
|
|
14827
|
+
}
|
|
14828
|
+
/**
|
|
14829
|
+
* Resize the edge group at `position` along its primary axis (width for
|
|
14830
|
+
* `left`/`right`, height for `top`/`bottom`), clamped by the group's
|
|
14831
|
+
* constraints and the space available. Where `groupApi.setSize` lands.
|
|
14832
|
+
*
|
|
14833
|
+
* The size becomes the group's expanded size, so a collapsed group keeps
|
|
14834
|
+
* its strip and takes it on expand, and it survives a `toJSON` round-trip.
|
|
14835
|
+
*/
|
|
14836
|
+
resizeEdgeGroup(position, size) {
|
|
14837
|
+
const view = this._getView(position);
|
|
14838
|
+
if (!view || !Number.isFinite(size)) return;
|
|
14839
|
+
const target = Math.round(size);
|
|
14840
|
+
if (target <= 0) return;
|
|
14841
|
+
view.restoreExpandedSize(target);
|
|
14842
|
+
if (view.isCollapsed) {
|
|
14843
|
+
this._pendingSizes.delete(position);
|
|
14844
|
+
return;
|
|
14845
|
+
}
|
|
14846
|
+
if (this._canResize(position)) {
|
|
14847
|
+
this._pendingSizes.delete(position);
|
|
14848
|
+
this._resizeView(position, target);
|
|
14849
|
+
} else this._pendingSizes.set(position, target);
|
|
14850
|
+
}
|
|
14851
|
+
/** A resize lands only on a visible view (a hidden one is pinned to zero)
|
|
14852
|
+
* whose splitview has extent to distribute. */
|
|
14853
|
+
_canResize(position) {
|
|
14854
|
+
if (!this.isEdgeGroupVisible(position)) return false;
|
|
14855
|
+
return (position === "left" || position === "right" ? this._outerSplitview.size : this._middleColumn.axisSize) > 0;
|
|
14856
|
+
}
|
|
14857
|
+
_resizeView(position, size) {
|
|
14536
14858
|
switch (position) {
|
|
14537
14859
|
case "left":
|
|
14538
|
-
if (this._leftIndex !== void 0) this._outerSplitview.resizeView(this._leftIndex,
|
|
14860
|
+
if (this._leftIndex !== void 0) this._outerSplitview.resizeView(this._leftIndex, size);
|
|
14539
14861
|
break;
|
|
14540
14862
|
case "right":
|
|
14541
|
-
if (this._rightIndex !== void 0) this._outerSplitview.resizeView(this._rightIndex,
|
|
14863
|
+
if (this._rightIndex !== void 0) this._outerSplitview.resizeView(this._rightIndex, size);
|
|
14542
14864
|
break;
|
|
14543
14865
|
case "top":
|
|
14544
14866
|
case "bottom":
|
|
14545
|
-
this._middleColumn.resizeView(position,
|
|
14867
|
+
this._middleColumn.resizeView(position, size);
|
|
14546
14868
|
break;
|
|
14547
14869
|
}
|
|
14548
14870
|
}
|
|
14871
|
+
_flushPendingSizes() {
|
|
14872
|
+
if (this._pendingSizes.size === 0) return;
|
|
14873
|
+
for (const [position, size] of this._pendingSizes) {
|
|
14874
|
+
const view = this._getView(position);
|
|
14875
|
+
if (!view || view.isCollapsed || !this._canResize(position)) continue;
|
|
14876
|
+
this._pendingSizes.delete(position);
|
|
14877
|
+
this._resizeView(position, size);
|
|
14878
|
+
}
|
|
14879
|
+
}
|
|
14549
14880
|
isEdgeGroupCollapsed(position) {
|
|
14550
14881
|
var _this$_getView$isColl, _this$_getView;
|
|
14551
14882
|
return (_this$_getView$isColl = (_this$_getView = this._getView(position)) === null || _this$_getView === void 0 ? void 0 : _this$_getView.isCollapsed) !== null && _this$_getView$isColl !== void 0 ? _this$_getView$isColl : false;
|
|
@@ -14571,15 +14902,17 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14571
14902
|
maximumSize: Number.isFinite(view.configuredMaximumSize) ? view.configuredMaximumSize : void 0,
|
|
14572
14903
|
collapsedSize: view.configuredCollapsedSize
|
|
14573
14904
|
});
|
|
14574
|
-
const expandedSize = (view, isVisible, liveSize, cachedVisibleSize) => {
|
|
14905
|
+
const expandedSize = (view, position, isVisible, liveSize, cachedVisibleSize) => {
|
|
14575
14906
|
if (view.isCollapsed) return view.lastExpandedSize;
|
|
14907
|
+
const pending = this._pendingSizes.get(position);
|
|
14908
|
+
if (pending !== void 0) return pending;
|
|
14576
14909
|
if (!isVisible) return cachedVisibleSize !== null && cachedVisibleSize !== void 0 ? cachedVisibleSize : view.lastExpandedSize;
|
|
14577
14910
|
return liveSize;
|
|
14578
14911
|
};
|
|
14579
14912
|
if (this._leftView && this._leftIndex !== void 0) {
|
|
14580
14913
|
const visible = this._outerSplitview.isViewVisible(this._leftIndex);
|
|
14581
14914
|
edgeGroups.left = _objectSpread2({
|
|
14582
|
-
size: expandedSize(this._leftView, visible, this._outerSplitview.getViewSize(this._leftIndex), this._outerSplitview.getViewCachedVisibleSize(this._leftIndex)),
|
|
14915
|
+
size: expandedSize(this._leftView, "left", visible, this._outerSplitview.getViewSize(this._leftIndex), this._outerSplitview.getViewCachedVisibleSize(this._leftIndex)),
|
|
14583
14916
|
visible,
|
|
14584
14917
|
collapsed: this._leftView.isCollapsed || void 0
|
|
14585
14918
|
}, constraints(this._leftView));
|
|
@@ -14587,7 +14920,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14587
14920
|
if (this._rightView && this._rightIndex !== void 0) {
|
|
14588
14921
|
const visible = this._outerSplitview.isViewVisible(this._rightIndex);
|
|
14589
14922
|
edgeGroups.right = _objectSpread2({
|
|
14590
|
-
size: expandedSize(this._rightView, visible, this._outerSplitview.getViewSize(this._rightIndex), this._outerSplitview.getViewCachedVisibleSize(this._rightIndex)),
|
|
14923
|
+
size: expandedSize(this._rightView, "right", visible, this._outerSplitview.getViewSize(this._rightIndex), this._outerSplitview.getViewCachedVisibleSize(this._rightIndex)),
|
|
14591
14924
|
visible,
|
|
14592
14925
|
collapsed: this._rightView.isCollapsed || void 0
|
|
14593
14926
|
}, constraints(this._rightView));
|
|
@@ -14595,7 +14928,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14595
14928
|
if (this._topView) {
|
|
14596
14929
|
const visible = this._middleColumn.isViewVisible("top");
|
|
14597
14930
|
edgeGroups.top = _objectSpread2({
|
|
14598
|
-
size: expandedSize(this._topView, visible, this._middleColumn.getViewSize("top"), this._middleColumn.getViewCachedVisibleSize("top")),
|
|
14931
|
+
size: expandedSize(this._topView, "top", visible, this._middleColumn.getViewSize("top"), this._middleColumn.getViewCachedVisibleSize("top")),
|
|
14599
14932
|
visible,
|
|
14600
14933
|
collapsed: this._topView.isCollapsed || void 0
|
|
14601
14934
|
}, constraints(this._topView));
|
|
@@ -14603,7 +14936,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14603
14936
|
if (this._bottomView) {
|
|
14604
14937
|
const visible = this._middleColumn.isViewVisible("bottom");
|
|
14605
14938
|
edgeGroups.bottom = _objectSpread2({
|
|
14606
|
-
size: expandedSize(this._bottomView, visible, this._middleColumn.getViewSize("bottom"), this._middleColumn.getViewCachedVisibleSize("bottom")),
|
|
14939
|
+
size: expandedSize(this._bottomView, "bottom", visible, this._middleColumn.getViewSize("bottom"), this._middleColumn.getViewCachedVisibleSize("bottom")),
|
|
14607
14940
|
visible,
|
|
14608
14941
|
collapsed: this._bottomView.isCollapsed || void 0
|
|
14609
14942
|
}, constraints(this._bottomView));
|
|
@@ -14611,33 +14944,23 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
14611
14944
|
return edgeGroups;
|
|
14612
14945
|
}
|
|
14613
14946
|
fromJSON(data) {
|
|
14614
|
-
|
|
14615
|
-
|
|
14616
|
-
|
|
14617
|
-
|
|
14618
|
-
|
|
14619
|
-
|
|
14620
|
-
|
|
14621
|
-
|
|
14622
|
-
|
|
14623
|
-
(
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
if (
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
|
|
14631
|
-
(_this$_topView3 = this._topView) === null || _this$_topView3 === void 0 || _this$_topView3.setCollapsed((_data$top$collapsed = data.top.collapsed) !== null && _data$top$collapsed !== void 0 ? _data$top$collapsed : false);
|
|
14632
|
-
this._middleColumn.resizeView("top", data.top.collapsed ? (_this$_topView$collap = (_this$_topView4 = this._topView) === null || _this$_topView4 === void 0 ? void 0 : _this$_topView4.collapsedSize) !== null && _this$_topView$collap !== void 0 ? _this$_topView$collap : data.top.size : data.top.size);
|
|
14633
|
-
if (!data.top.visible) this._middleColumn.setViewVisible("top", false);
|
|
14634
|
-
}
|
|
14635
|
-
if (data.bottom) {
|
|
14636
|
-
var _this$_bottomView2, _this$_bottomView3, _data$bottom$collapse, _this$_bottomView$col, _this$_bottomView4;
|
|
14637
|
-
(_this$_bottomView2 = this._bottomView) === null || _this$_bottomView2 === void 0 || _this$_bottomView2.restoreExpandedSize(data.bottom.size);
|
|
14638
|
-
(_this$_bottomView3 = this._bottomView) === null || _this$_bottomView3 === void 0 || _this$_bottomView3.setCollapsed((_data$bottom$collapse = data.bottom.collapsed) !== null && _data$bottom$collapse !== void 0 ? _data$bottom$collapse : false);
|
|
14639
|
-
this._middleColumn.resizeView("bottom", data.bottom.collapsed ? (_this$_bottomView$col = (_this$_bottomView4 = this._bottomView) === null || _this$_bottomView4 === void 0 ? void 0 : _this$_bottomView4.collapsedSize) !== null && _this$_bottomView$col !== void 0 ? _this$_bottomView$col : data.bottom.size : data.bottom.size);
|
|
14640
|
-
if (!data.bottom.visible) this._middleColumn.setViewVisible("bottom", false);
|
|
14947
|
+
for (const position of [
|
|
14948
|
+
"left",
|
|
14949
|
+
"right",
|
|
14950
|
+
"top",
|
|
14951
|
+
"bottom"
|
|
14952
|
+
]) {
|
|
14953
|
+
var _state$collapsed;
|
|
14954
|
+
const state = data[position];
|
|
14955
|
+
const view = this._getView(position);
|
|
14956
|
+
if (!state || !view) continue;
|
|
14957
|
+
view.restoreExpandedSize(state.size);
|
|
14958
|
+
view.setCollapsed((_state$collapsed = state.collapsed) !== null && _state$collapsed !== void 0 ? _state$collapsed : false);
|
|
14959
|
+
if (state.collapsed) {
|
|
14960
|
+
this._pendingSizes.delete(position);
|
|
14961
|
+
this._resizeView(position, view.collapsedSize);
|
|
14962
|
+
} else this.resizeEdgeGroup(position, state.size);
|
|
14963
|
+
this.setEdgeGroupVisible(position, !!state.visible);
|
|
14641
14964
|
}
|
|
14642
14965
|
}
|
|
14643
14966
|
dispose() {
|
|
@@ -16019,6 +16342,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16019
16342
|
position
|
|
16020
16343
|
};
|
|
16021
16344
|
group.model.headerPosition = position;
|
|
16345
|
+
const resizeDisposable = group.onDidChange((event) => {
|
|
16346
|
+
var _this$_shellManager3;
|
|
16347
|
+
if (!event) return;
|
|
16348
|
+
const size = position === "left" || position === "right" ? event.width : event.height;
|
|
16349
|
+
if (typeof size !== "number") return;
|
|
16350
|
+
(_this$_shellManager3 = this._shellManager) === null || _this$_shellManager3 === void 0 || _this$_shellManager3.resizeEdgeGroup(position, size);
|
|
16351
|
+
});
|
|
16022
16352
|
const autoCollapseDisposable = group.model.onDidRemovePanel(() => {
|
|
16023
16353
|
if (!group.model.isEmpty) return;
|
|
16024
16354
|
if (service.isAutoReveal(group)) queueMicrotask(() => {
|
|
@@ -16027,7 +16357,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16027
16357
|
});
|
|
16028
16358
|
else this.setEdgeGroupCollapsed(group, true);
|
|
16029
16359
|
});
|
|
16030
|
-
service.add(position, group, autoCollapseDisposable);
|
|
16360
|
+
service.add(position, group, new CompositeDisposable(autoCollapseDisposable, resizeDisposable));
|
|
16031
16361
|
if (options.autoHide !== void 0) service.setAutoHide(group, options.autoHide);
|
|
16032
16362
|
if (options.autoReveal !== void 0) service.setAutoReveal(group, options.autoReveal);
|
|
16033
16363
|
this._onDidAddGroup.fire(group);
|
|
@@ -16122,8 +16452,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
16122
16452
|
}
|
|
16123
16453
|
/** The size an edge group expands to (pre-collapse); sizes the peek. */
|
|
16124
16454
|
getEdgeGroupExpandedSize(position) {
|
|
16125
|
-
var _this$_shellManager$g, _this$
|
|
16126
|
-
return (_this$_shellManager$g = (_this$
|
|
16455
|
+
var _this$_shellManager$g, _this$_shellManager4;
|
|
16456
|
+
return (_this$_shellManager$g = (_this$_shellManager4 = this._shellManager) === null || _this$_shellManager4 === void 0 ? void 0 : _this$_shellManager4.getEdgeGroupExpandedSize(position)) !== null && _this$_shellManager$g !== void 0 ? _this$_shellManager$g : 0;
|
|
16127
16457
|
}
|
|
16128
16458
|
/** Reposition a single `renderer:'always'` panel's overlay over its
|
|
16129
16459
|
* reference container, optionally forcing it visible (the auto-hide peek
|
|
@@ -17284,7 +17614,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17284
17614
|
}));
|
|
17285
17615
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
17286
17616
|
const updatedTargetLocation = getRelativeLocation(destinationGridview.orientation, getGridLocation(destinationGroup.element), destinationTarget);
|
|
17287
|
-
const newGroup = this.createGroupAtLocation(updatedTargetLocation,
|
|
17617
|
+
const newGroup = this.createGroupAtLocation(updatedTargetLocation, this.dropSizing(getGridLocation(destinationGroup.element)), void 0, destinationGridview);
|
|
17288
17618
|
this.movingLock(() => newGroup.model.openPanel(removedPanel, { skipSetActive: true }));
|
|
17289
17619
|
this.doSetGroupAndPanelActive(newGroup);
|
|
17290
17620
|
this.fireDidMovePanel(this.getGroupPanel(sourceItemId), sourceGroup);
|
|
@@ -17301,7 +17631,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17301
17631
|
skipSetActiveGroup: true
|
|
17302
17632
|
}));
|
|
17303
17633
|
if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
17304
|
-
const newGroup = this.createGroupAtLocation(targetLocation,
|
|
17634
|
+
const newGroup = this.createGroupAtLocation(targetLocation, this.dropSizing(referenceLocation), void 0, destinationGridview);
|
|
17305
17635
|
this.movingLock(() => newGroup.model.openPanel(removedPanel, { skipSetGroupActive: true }));
|
|
17306
17636
|
this.doSetGroupAndPanelActive(newGroup);
|
|
17307
17637
|
this.fireDidMovePanel(removedPanel, sourceGroup);
|
|
@@ -17313,7 +17643,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17313
17643
|
}));
|
|
17314
17644
|
const updatedReferenceLocation = getGridLocation(destinationGroup.element);
|
|
17315
17645
|
const location = getRelativeLocation(destinationGridview.orientation, updatedReferenceLocation, destinationTarget);
|
|
17316
|
-
this.movingLock(() => this.doAddGroup(targetGroup, location,
|
|
17646
|
+
this.movingLock(() => this.doAddGroup(targetGroup, location, this.dropSizing(updatedReferenceLocation), destinationGridview));
|
|
17317
17647
|
this.setGroupLocationForRoot(targetGroup, destinationGridview);
|
|
17318
17648
|
this.doSetGroupAndPanelActive(targetGroup);
|
|
17319
17649
|
this.fireDidMovePanel(this.getGroupPanel(sourceItemId), sourceGroup);
|
|
@@ -17328,7 +17658,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17328
17658
|
}));
|
|
17329
17659
|
if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
|
|
17330
17660
|
const dropLocation = getRelativeLocation(destinationGridview.orientation, referenceLocation, destinationTarget);
|
|
17331
|
-
const group = this.createGroupAtLocation(dropLocation,
|
|
17661
|
+
const group = this.createGroupAtLocation(dropLocation, this.dropSizing(referenceLocation), void 0, destinationGridview);
|
|
17332
17662
|
this.movingLock(() => group.model.openPanel(removedPanel, { skipSetGroupActive: true }));
|
|
17333
17663
|
this.doSetGroupAndPanelActive(group);
|
|
17334
17664
|
this.fireDidMovePanel(removedPanel, sourceGroup);
|
|
@@ -17372,7 +17702,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17372
17702
|
if (!destinationTarget || destinationTarget === "center" || !referenceLocation) targetGroup = destinationGroup;
|
|
17373
17703
|
else {
|
|
17374
17704
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
|
|
17375
|
-
targetGroup = this.createGroupAtLocation(dropLocation);
|
|
17705
|
+
targetGroup = this.createGroupAtLocation(dropLocation, this.dropSizing(referenceLocation));
|
|
17376
17706
|
}
|
|
17377
17707
|
if (!options.keepEmptyGroups && sourceGroup.model.size === 0 && sourceGroup !== targetGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
17378
17708
|
addPanelsToGroup(targetGroup);
|
|
@@ -17423,6 +17753,21 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17423
17753
|
if (options.skipSetActive !== true) this.doSetGroupAndPanelActive(to);
|
|
17424
17754
|
else if (!this.activePanel) this.doSetGroupAndPanelActive(to);
|
|
17425
17755
|
} else {
|
|
17756
|
+
const isReorderWithinBranch = (() => {
|
|
17757
|
+
if (from.api.location.type === "edge" || to.api.location.type === "edge") return false;
|
|
17758
|
+
const root = this.getGridviewForGroup(from);
|
|
17759
|
+
if (root !== this.getGridviewForGroup(to)) return false;
|
|
17760
|
+
let fromLocation;
|
|
17761
|
+
let toLocation;
|
|
17762
|
+
try {
|
|
17763
|
+
fromLocation = getGridLocation(from.element);
|
|
17764
|
+
toLocation = getGridLocation(to.element);
|
|
17765
|
+
} catch (_unused) {
|
|
17766
|
+
return false;
|
|
17767
|
+
}
|
|
17768
|
+
if (fromLocation.length === 0 || toLocation.length === 0) return false;
|
|
17769
|
+
return sequenceEquals(tail(fromLocation)[0], tail(toLocation)[0]) && getLocationOrientation(root.orientation, toLocation) === getDirectionOrientation(target);
|
|
17770
|
+
})();
|
|
17426
17771
|
if (from.api.location.type === "edge") {
|
|
17427
17772
|
/**
|
|
17428
17773
|
* Edge groups are permanent structural elements and must
|
|
@@ -17488,13 +17833,10 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17488
17833
|
const referenceLocation = getGridLocation(to.element);
|
|
17489
17834
|
const dropLocation = getRelativeLocation(destGridview.orientation, referenceLocation, target);
|
|
17490
17835
|
let size;
|
|
17491
|
-
|
|
17492
|
-
|
|
17493
|
-
|
|
17494
|
-
|
|
17495
|
-
case "HORIZONTAL":
|
|
17496
|
-
size = referenceLocation.length % 2 == 0 ? from.api.height : from.api.width;
|
|
17497
|
-
break;
|
|
17836
|
+
if (isReorderWithinBranch) size = getDirectionOrientation(target) === "HORIZONTAL" ? from.api.width : from.api.height;
|
|
17837
|
+
else {
|
|
17838
|
+
var _referenceLocation;
|
|
17839
|
+
size = Sizing.Split((_referenceLocation = referenceLocation[referenceLocation.length - 1]) !== null && _referenceLocation !== void 0 ? _referenceLocation : 0);
|
|
17498
17840
|
}
|
|
17499
17841
|
destGridview.addView(source, size, dropLocation);
|
|
17500
17842
|
this.setGroupLocationForRoot(source, destGridview);
|
|
@@ -17619,6 +17961,16 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17619
17961
|
});
|
|
17620
17962
|
return panel;
|
|
17621
17963
|
}
|
|
17964
|
+
/**
|
|
17965
|
+
* Sizing for a group created by a drop next to `referenceLocation`: half
|
|
17966
|
+
* of the group the overlay was drawn over, leaving its siblings alone, so
|
|
17967
|
+
* the panel lands in the region the overlay indicated (#1612). Gridview
|
|
17968
|
+
* rewrites the index to 0 when a cross-axis drop wraps the reference in a
|
|
17969
|
+
* new branch, so one value serves both paths.
|
|
17970
|
+
*/
|
|
17971
|
+
dropSizing(referenceLocation) {
|
|
17972
|
+
return Sizing.Split(referenceLocation.length === 0 ? 0 : referenceLocation[referenceLocation.length - 1]);
|
|
17973
|
+
}
|
|
17622
17974
|
createGroupAtLocation(location, size, options, gridview = this.gridview) {
|
|
17623
17975
|
const group = this.createGroup(options);
|
|
17624
17976
|
this.doAddGroup(group, location, size, gridview);
|
|
@@ -17678,22 +18030,22 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
17678
18030
|
return location.length % 2 == 1 ? rootOrientation : orthogonal(rootOrientation);
|
|
17679
18031
|
}
|
|
17680
18032
|
updateTheme() {
|
|
17681
|
-
var _this$_options$theme, _this$_shellThemeClas, _theme$gap, _this$_popoutWindowSe23, _this$_popoutWindowSe24, _this$
|
|
18033
|
+
var _this$_options$theme, _this$_shellThemeClas, _theme$gap, _this$_popoutWindowSe23, _this$_popoutWindowSe24, _this$_shellManager5, _theme$edgeGroupColla, _theme$tabGroupIndica;
|
|
17682
18034
|
const theme = (_this$_options$theme = this._options.theme) !== null && _this$_options$theme !== void 0 ? _this$_options$theme : themeAbyss;
|
|
17683
18035
|
(_this$_shellThemeClas = this._shellThemeClassnames) === null || _this$_shellThemeClas === void 0 || _this$_shellThemeClas.setClassNames(theme.className);
|
|
17684
18036
|
const gap = (_theme$gap = theme.gap) !== null && _theme$gap !== void 0 ? _theme$gap : 0;
|
|
17685
18037
|
this.gridview.margin = gap;
|
|
17686
18038
|
for (const floating of this.floatingGroups) floating.gridview.margin = gap;
|
|
17687
18039
|
for (const entry of (_this$_popoutWindowSe23 = (_this$_popoutWindowSe24 = this._popoutWindowService) === null || _this$_popoutWindowSe24 === void 0 ? void 0 : _this$_popoutWindowSe24.entries) !== null && _this$_popoutWindowSe23 !== void 0 ? _this$_popoutWindowSe23 : []) entry.gridview.margin = gap;
|
|
17688
|
-
(_this$
|
|
18040
|
+
(_this$_shellManager5 = this._shellManager) === null || _this$_shellManager5 === void 0 || _this$_shellManager5.updateTheme(gap, (_theme$edgeGroupColla = theme.edgeGroupCollapsedSize) !== null && _theme$edgeGroupColla !== void 0 ? _theme$edgeGroupColla : 35);
|
|
17689
18041
|
if (theme.dndOverlayBorder === void 0) {
|
|
17690
|
-
var _this$
|
|
18042
|
+
var _this$_shellManager6;
|
|
17691
18043
|
this.element.style.removeProperty("--dv-drag-over-border");
|
|
17692
|
-
(_this$
|
|
18044
|
+
(_this$_shellManager6 = this._shellManager) === null || _this$_shellManager6 === void 0 || _this$_shellManager6.element.style.removeProperty("--dv-drag-over-border");
|
|
17693
18045
|
} else {
|
|
17694
|
-
var _this$
|
|
18046
|
+
var _this$_shellManager7;
|
|
17695
18047
|
this.element.style.setProperty("--dv-drag-over-border", theme.dndOverlayBorder);
|
|
17696
|
-
(_this$
|
|
18048
|
+
(_this$_shellManager7 = this._shellManager) === null || _this$_shellManager7 === void 0 || _this$_shellManager7.element.style.setProperty("--dv-drag-over-border", theme.dndOverlayBorder);
|
|
17697
18049
|
}
|
|
17698
18050
|
switch (theme.dndOverlayMounting) {
|
|
17699
18051
|
case "absolute":
|
|
@@ -18578,6 +18930,8 @@ exports.AdvancedDnDModule = AdvancedDnDModule;
|
|
|
18578
18930
|
exports.AdvancedDnDService = AdvancedDnDService;
|
|
18579
18931
|
exports.BaseGrid = BaseGrid;
|
|
18580
18932
|
exports.ContentContainer = ContentContainer;
|
|
18933
|
+
exports.ContextMenuController = ContextMenuController;
|
|
18934
|
+
exports.ContextMenuModule = ContextMenuModule;
|
|
18581
18935
|
exports.DEFAULT_TAB_GROUP_COLORS = DEFAULT_TAB_GROUP_COLORS;
|
|
18582
18936
|
exports.DefaultDockviewDeserialzier = DefaultDockviewDeserialzier;
|
|
18583
18937
|
exports.DefaultTab = DefaultTab;
|