dockview-core 6.6.1 → 7.0.3
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/README.md +8 -1
- package/dist/cjs/api/component.api.d.ts +42 -21
- package/dist/cjs/api/component.api.js +111 -20
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +23 -8
- package/dist/cjs/api/dockviewGroupPanelApi.js +24 -1
- package/dist/cjs/api/dockviewPanelApi.d.ts +4 -3
- package/dist/cjs/api/dockviewPanelApi.js +8 -0
- package/dist/cjs/dnd/dropTargetAnchorContainer.js +1 -2
- package/dist/cjs/dnd/droptarget.d.ts +8 -0
- package/dist/cjs/dnd/droptarget.js +28 -0
- package/dist/cjs/dnd/pointer/longPress.js +1 -1
- package/dist/cjs/dnd/pointer/pointerDragController.js +9 -7
- package/dist/cjs/dnd/pointer/pointerDragSource.js +4 -2
- package/dist/cjs/dockview/accessibilityMessages.d.ts +32 -0
- package/dist/cjs/dockview/accessibilityMessages.js +51 -0
- package/dist/cjs/dockview/allModules.d.ts +8 -0
- package/dist/cjs/dockview/allModules.js +25 -0
- package/dist/cjs/dockview/components/panel/content.d.ts +2 -0
- package/dist/cjs/dockview/components/panel/content.js +41 -10
- package/dist/cjs/dockview/components/popupService.js +1 -1
- package/dist/cjs/dockview/components/tab/tab.js +35 -7
- package/dist/cjs/dockview/components/titlebar/floatingTitleBar.d.ts +34 -0
- package/dist/cjs/dockview/components/titlebar/floatingTitleBar.js +95 -0
- package/dist/cjs/dockview/components/titlebar/groupDragSource.d.ts +51 -0
- package/dist/cjs/dockview/components/titlebar/groupDragSource.js +218 -0
- package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.d.ts +2 -1
- package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.js +36 -30
- package/dist/cjs/dockview/components/titlebar/tabGroups.d.ts +27 -5
- package/dist/cjs/dockview/components/titlebar/tabGroups.js +104 -53
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +12 -0
- package/dist/cjs/dockview/components/titlebar/tabs.js +121 -25
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +4 -0
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +13 -3
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +1 -4
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +32 -156
- package/dist/cjs/dockview/dndCapabilities.js +3 -3
- package/dist/cjs/dockview/dockviewComponent.d.ts +304 -49
- package/dist/cjs/dockview/dockviewComponent.js +1839 -1075
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.js +39 -3
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +1 -2
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +36 -14
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +151 -125
- package/dist/cjs/dockview/dockviewPanel.d.ts +2 -2
- package/dist/cjs/dockview/dockviewPanel.js +4 -5
- package/dist/cjs/dockview/dockviewShell.d.ts +29 -7
- package/dist/cjs/dockview/dockviewShell.js +94 -36
- package/dist/cjs/dockview/edgeGroupService.d.ts +38 -0
- package/dist/cjs/dockview/edgeGroupService.js +128 -0
- package/dist/cjs/dockview/floatingGroupService.d.ts +37 -0
- package/dist/cjs/dockview/floatingGroupService.js +231 -0
- package/dist/cjs/dockview/headerActionsService.d.ts +32 -0
- package/dist/cjs/dockview/headerActionsService.js +149 -0
- package/dist/cjs/dockview/liveRegionService.d.ts +53 -0
- package/dist/cjs/dockview/liveRegionService.js +185 -0
- package/dist/cjs/dockview/moduleContracts.d.ts +119 -0
- package/dist/cjs/dockview/moduleContracts.js +2 -0
- package/dist/cjs/dockview/modules.d.ts +110 -0
- package/dist/cjs/dockview/modules.js +304 -0
- package/dist/cjs/dockview/options.d.ts +159 -6
- package/dist/cjs/dockview/options.js +8 -1
- package/dist/cjs/dockview/popoutWindowService.d.ts +95 -0
- package/dist/cjs/dockview/popoutWindowService.js +261 -0
- package/dist/cjs/dockview/rootDropTargetService.d.ts +35 -0
- package/dist/cjs/dockview/rootDropTargetService.js +87 -0
- package/dist/cjs/dockview/strictEventsSequencing.js +6 -6
- package/dist/cjs/dockview/tabGroup.js +3 -3
- package/dist/cjs/dockview/tabGroupAccent.js +1 -3
- package/dist/cjs/dockview/watermarkService.d.ts +30 -0
- package/dist/cjs/dockview/watermarkService.js +61 -0
- package/dist/cjs/dom.js +1 -1
- package/dist/cjs/events.js +1 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/cjs/gridview/baseComponentGridview.js +6 -10
- package/dist/cjs/gridview/branchNode.js +13 -17
- package/dist/cjs/gridview/gridview.js +8 -8
- package/dist/cjs/gridview/gridviewComponent.d.ts +3 -3
- package/dist/cjs/gridview/gridviewComponent.js +1 -6
- package/dist/cjs/gridview/gridviewPanel.d.ts +1 -1
- package/dist/cjs/index.d.ts +11 -4
- package/dist/cjs/index.js +14 -1
- package/dist/cjs/overlay/overlay.d.ts +43 -1
- package/dist/cjs/overlay/overlay.js +82 -36
- package/dist/cjs/overlay/overlayRenderContainer.js +3 -4
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +5 -5
- package/dist/cjs/paneview/paneviewComponent.d.ts +3 -3
- package/dist/cjs/paneview/paneviewComponent.js +7 -11
- package/dist/cjs/popoutWindow.js +4 -4
- package/dist/cjs/scrollbar.d.ts +1 -1
- package/dist/cjs/scrollbar.js +7 -6
- package/dist/cjs/splitview/splitview.d.ts +1 -1
- package/dist/cjs/splitview/splitview.js +21 -20
- package/dist/cjs/splitview/viewItem.js +1 -1
- package/dist/dockview-core.js +3548 -1544
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +3547 -1543
- package/dist/esm/api/component.api.d.ts +42 -21
- package/dist/esm/api/component.api.js +63 -18
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +23 -8
- package/dist/esm/api/dockviewGroupPanelApi.js +20 -1
- package/dist/esm/api/dockviewPanelApi.d.ts +4 -3
- package/dist/esm/api/dockviewPanelApi.js +7 -0
- package/dist/esm/dnd/dropTargetAnchorContainer.js +1 -2
- package/dist/esm/dnd/droptarget.d.ts +8 -0
- package/dist/esm/dnd/droptarget.js +28 -0
- package/dist/esm/dnd/pointer/longPress.js +1 -1
- package/dist/esm/dnd/pointer/pointerDragController.js +9 -7
- package/dist/esm/dnd/pointer/pointerDragSource.js +4 -2
- package/dist/esm/dockview/accessibilityMessages.d.ts +32 -0
- package/dist/esm/dockview/accessibilityMessages.js +30 -0
- package/dist/esm/dockview/allModules.d.ts +8 -0
- package/dist/esm/dockview/allModules.js +22 -0
- package/dist/esm/dockview/components/panel/content.d.ts +2 -0
- package/dist/esm/dockview/components/panel/content.js +42 -11
- package/dist/esm/dockview/components/popupService.js +1 -1
- package/dist/esm/dockview/components/tab/tab.js +35 -7
- package/dist/esm/dockview/components/titlebar/floatingTitleBar.d.ts +34 -0
- package/dist/esm/dockview/components/titlebar/floatingTitleBar.js +65 -0
- package/dist/esm/dockview/components/titlebar/groupDragSource.d.ts +51 -0
- package/dist/esm/dockview/components/titlebar/groupDragSource.js +178 -0
- package/dist/esm/dockview/components/titlebar/tabGroupIndicator.d.ts +2 -1
- package/dist/esm/dockview/components/titlebar/tabGroupIndicator.js +36 -30
- package/dist/esm/dockview/components/titlebar/tabGroups.d.ts +27 -5
- package/dist/esm/dockview/components/titlebar/tabGroups.js +91 -41
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +12 -0
- package/dist/esm/dockview/components/titlebar/tabs.js +119 -26
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +4 -0
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +8 -2
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +1 -4
- package/dist/esm/dockview/components/titlebar/voidContainer.js +34 -146
- package/dist/esm/dockview/dndCapabilities.js +3 -3
- package/dist/esm/dockview/dockviewComponent.d.ts +304 -49
- package/dist/esm/dockview/dockviewComponent.js +1459 -772
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
- package/dist/esm/dockview/dockviewFloatingGroupPanel.js +35 -3
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +1 -2
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +36 -14
- package/dist/esm/dockview/dockviewGroupPanelModel.js +127 -117
- package/dist/esm/dockview/dockviewPanel.d.ts +2 -2
- package/dist/esm/dockview/dockviewPanel.js +1 -2
- package/dist/esm/dockview/dockviewShell.d.ts +29 -7
- package/dist/esm/dockview/dockviewShell.js +89 -37
- package/dist/esm/dockview/edgeGroupService.d.ts +38 -0
- package/dist/esm/dockview/edgeGroupService.js +63 -0
- package/dist/esm/dockview/floatingGroupService.d.ts +37 -0
- package/dist/esm/dockview/floatingGroupService.js +150 -0
- package/dist/esm/dockview/headerActionsService.d.ts +32 -0
- package/dist/esm/dockview/headerActionsService.js +86 -0
- package/dist/esm/dockview/liveRegionService.d.ts +53 -0
- package/dist/esm/dockview/liveRegionService.js +159 -0
- package/dist/esm/dockview/moduleContracts.d.ts +119 -0
- package/dist/esm/dockview/moduleContracts.js +1 -0
- package/dist/esm/dockview/modules.d.ts +110 -0
- package/dist/esm/dockview/modules.js +170 -0
- package/dist/esm/dockview/options.d.ts +159 -6
- package/dist/esm/dockview/options.js +8 -1
- package/dist/esm/dockview/popoutWindowService.d.ts +95 -0
- package/dist/esm/dockview/popoutWindowService.js +175 -0
- package/dist/esm/dockview/rootDropTargetService.d.ts +35 -0
- package/dist/esm/dockview/rootDropTargetService.js +82 -0
- package/dist/esm/dockview/strictEventsSequencing.js +6 -6
- package/dist/esm/dockview/tabGroup.js +3 -3
- package/dist/esm/dockview/tabGroupAccent.js +1 -3
- package/dist/esm/dockview/watermarkService.d.ts +30 -0
- package/dist/esm/dockview/watermarkService.js +56 -0
- package/dist/esm/dom.js +1 -1
- package/dist/esm/events.js +1 -1
- package/dist/esm/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/esm/gridview/baseComponentGridview.js +5 -10
- package/dist/esm/gridview/branchNode.js +13 -15
- package/dist/esm/gridview/gridview.js +8 -8
- package/dist/esm/gridview/gridviewComponent.d.ts +3 -3
- package/dist/esm/gridview/gridviewComponent.js +1 -6
- package/dist/esm/gridview/gridviewPanel.d.ts +1 -1
- package/dist/esm/index.d.ts +11 -4
- package/dist/esm/index.js +4 -0
- package/dist/esm/overlay/overlay.d.ts +43 -1
- package/dist/esm/overlay/overlay.js +78 -36
- package/dist/esm/overlay/overlayRenderContainer.js +3 -4
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +5 -5
- package/dist/esm/paneview/paneviewComponent.d.ts +3 -3
- package/dist/esm/paneview/paneviewComponent.js +7 -11
- package/dist/esm/popoutWindow.js +4 -4
- package/dist/esm/scrollbar.d.ts +1 -1
- package/dist/esm/scrollbar.js +7 -6
- package/dist/esm/splitview/splitview.d.ts +1 -1
- package/dist/esm/splitview/splitview.js +21 -20
- package/dist/esm/splitview/viewItem.js +1 -1
- package/dist/package/main.cjs.js +3550 -1546
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +3538 -1545
- package/dist/styles/dockview.css +283 -21
- package/package.json +10 -1
- package/dist/cjs/dockview/contextMenu.d.ts +0 -10
- package/dist/cjs/dockview/contextMenu.js +0 -313
- package/dist/esm/dockview/contextMenu.d.ts +0 -10
- package/dist/esm/dockview/contextMenu.js +0 -228
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o), r, ar = [], e;
|
|
17
|
+
try {
|
|
18
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
+
}
|
|
20
|
+
catch (error) { e = { error: error }; }
|
|
21
|
+
finally {
|
|
22
|
+
try {
|
|
23
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
+
}
|
|
25
|
+
finally { if (e) throw e.error; }
|
|
26
|
+
}
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
30
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
31
|
+
if (ar || !(i in from)) {
|
|
32
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
33
|
+
ar[i] = from[i];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
37
|
+
};
|
|
38
|
+
var __values = (this && this.__values) || function(o) {
|
|
39
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
+
if (m) return m.call(o);
|
|
41
|
+
if (o && typeof o.length === "number") return {
|
|
42
|
+
next: function () {
|
|
43
|
+
if (o && i >= o.length) o = void 0;
|
|
44
|
+
return { value: o && o[i++], done: !o };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.PopoutWindowModule = exports.PopoutWindowService = void 0;
|
|
51
|
+
var events_1 = require("../events");
|
|
52
|
+
var array_1 = require("../array");
|
|
53
|
+
var modules_1 = require("./modules");
|
|
54
|
+
var PopoutWindowService = /** @class */ (function () {
|
|
55
|
+
function PopoutWindowService(host) {
|
|
56
|
+
this._entries = [];
|
|
57
|
+
this._popupServices = new Map();
|
|
58
|
+
this._restorationCleanups = new Set();
|
|
59
|
+
this._restorationPromise = Promise.resolve();
|
|
60
|
+
this._onDidRemove = new events_1.Emitter();
|
|
61
|
+
this.onDidRemove = this._onDidRemove.event;
|
|
62
|
+
this._host = host;
|
|
63
|
+
}
|
|
64
|
+
Object.defineProperty(PopoutWindowService.prototype, "entries", {
|
|
65
|
+
get: function () {
|
|
66
|
+
return this._entries;
|
|
67
|
+
},
|
|
68
|
+
enumerable: false,
|
|
69
|
+
configurable: true
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(PopoutWindowService.prototype, "restorationPromise", {
|
|
72
|
+
get: function () {
|
|
73
|
+
return this._restorationPromise;
|
|
74
|
+
},
|
|
75
|
+
enumerable: false,
|
|
76
|
+
configurable: true
|
|
77
|
+
});
|
|
78
|
+
PopoutWindowService.prototype.add = function (entry) {
|
|
79
|
+
this._entries.push(entry);
|
|
80
|
+
};
|
|
81
|
+
PopoutWindowService.prototype.remove = function (entry) {
|
|
82
|
+
// Fire only on a genuine removal, and not while the host component is
|
|
83
|
+
// tearing down (consumers don't want popout-removed events during
|
|
84
|
+
// dispose).
|
|
85
|
+
if ((0, array_1.remove)(this._entries, entry) && !this._host.isDisposed) {
|
|
86
|
+
this._onDidRemove.fire(entry);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
PopoutWindowService.prototype.findByGroup = function (group) {
|
|
90
|
+
// A popout window may host several groups in a nested gridview, so
|
|
91
|
+
// match by membership (DOM containment) rather than only the anchor.
|
|
92
|
+
return this._entries.find(function (entry) {
|
|
93
|
+
return entry.popoutGroup === group ||
|
|
94
|
+
entry.gridview.element.contains(group.element);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
PopoutWindowService.prototype.findReferenceGroupId = function (group) {
|
|
98
|
+
var _a;
|
|
99
|
+
return (_a = this._entries.find(function (entry) { return entry.popoutGroup === group; })) === null || _a === void 0 ? void 0 : _a.referenceGroup;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* The popout window's innerWidth/innerHeight are often 0/stale until it has
|
|
103
|
+
* painted, and the nested gridview lays its children out to the size passed
|
|
104
|
+
* to layout() (a plain group fills via CSS instead). To stop content
|
|
105
|
+
* rendering into a zero box until a manual resize — and to avoid the race a
|
|
106
|
+
* fixed number of animation frames had — observe the gridview element with
|
|
107
|
+
* a ResizeObserver created in the POPOUT window's OWN realm. A parent-realm
|
|
108
|
+
* observer fires unreliably across the window boundary; a same-realm one
|
|
109
|
+
* fires reliably, including the initial observation once the window is
|
|
110
|
+
* sized.
|
|
111
|
+
*
|
|
112
|
+
* @returns a disposable that disconnects the observer, or `undefined` when
|
|
113
|
+
* the popout realm has no ResizeObserver (e.g. jsdom).
|
|
114
|
+
*/
|
|
115
|
+
PopoutWindowService.prototype.observeGridviewSize = function (popoutWindow, gridview, overlayRenderContainer) {
|
|
116
|
+
var _this = this;
|
|
117
|
+
var _a;
|
|
118
|
+
var PopoutResizeObserver = (_a = popoutWindow.window) === null || _a === void 0 ? void 0 : _a.ResizeObserver;
|
|
119
|
+
if (!PopoutResizeObserver) {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
var lastWidth = -1;
|
|
123
|
+
var lastHeight = -1;
|
|
124
|
+
var relayout = function () {
|
|
125
|
+
var win = popoutWindow.window;
|
|
126
|
+
if (_this._host.isDisposed || !win || win.closed) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
var width = Math.round(gridview.element.clientWidth);
|
|
130
|
+
var height = Math.round(gridview.element.clientHeight);
|
|
131
|
+
if (width === lastWidth && height === lastHeight) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
lastWidth = width;
|
|
135
|
+
lastHeight = height;
|
|
136
|
+
if (width > 0 && height > 0) {
|
|
137
|
+
gridview.layout(width, height);
|
|
138
|
+
}
|
|
139
|
+
overlayRenderContainer.updateAllPositions();
|
|
140
|
+
};
|
|
141
|
+
var observer = new PopoutResizeObserver(function () {
|
|
142
|
+
var _a;
|
|
143
|
+
// Defer out of the observer callback into the popout's own frame to
|
|
144
|
+
// size against the settled layout and to avoid resize-loop warnings.
|
|
145
|
+
var raf = (_a = popoutWindow.window) === null || _a === void 0 ? void 0 : _a.requestAnimationFrame;
|
|
146
|
+
if (raf) {
|
|
147
|
+
raf.call(popoutWindow.window, relayout);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
relayout();
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
observer.observe(gridview.element);
|
|
154
|
+
return { dispose: function () { return observer.disconnect(); } };
|
|
155
|
+
};
|
|
156
|
+
PopoutWindowService.prototype.getPopupService = function (groupId) {
|
|
157
|
+
return this._popupServices.get(groupId);
|
|
158
|
+
};
|
|
159
|
+
PopoutWindowService.prototype.setPopupService = function (groupId, service) {
|
|
160
|
+
this._popupServices.set(groupId, service);
|
|
161
|
+
};
|
|
162
|
+
PopoutWindowService.prototype.deletePopupService = function (groupId) {
|
|
163
|
+
this._popupServices.delete(groupId);
|
|
164
|
+
};
|
|
165
|
+
PopoutWindowService.prototype.scheduleRestoration = function (delayMs, work, onCancel) {
|
|
166
|
+
var _this = this;
|
|
167
|
+
return new Promise(function (resolve) {
|
|
168
|
+
var cleanup = function () {
|
|
169
|
+
_this._restorationCleanups.delete(cleanup);
|
|
170
|
+
clearTimeout(handle);
|
|
171
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
172
|
+
resolve();
|
|
173
|
+
};
|
|
174
|
+
var handle = setTimeout(function () {
|
|
175
|
+
_this._restorationCleanups.delete(cleanup);
|
|
176
|
+
// Guard against the component being disposed before this
|
|
177
|
+
// timer fires. Under React StrictMode the component is
|
|
178
|
+
// mounted -> disposed -> remounted, and without this guard
|
|
179
|
+
// the first instance's queued restoration would open a
|
|
180
|
+
// second popout window. See issue #851.
|
|
181
|
+
if (_this._host.isDisposed) {
|
|
182
|
+
resolve();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
work();
|
|
186
|
+
resolve();
|
|
187
|
+
}, delayMs);
|
|
188
|
+
_this._restorationCleanups.add(cleanup);
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
PopoutWindowService.prototype.finishRestoration = function (promises) {
|
|
192
|
+
this._restorationPromise = Promise.all(promises).then(function () { return void 0; });
|
|
193
|
+
};
|
|
194
|
+
PopoutWindowService.prototype.cancelPendingRestorations = function () {
|
|
195
|
+
var e_1, _a;
|
|
196
|
+
try {
|
|
197
|
+
for (var _b = __values(__spreadArray([], __read(this._restorationCleanups), false)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
198
|
+
var cleanup = _c.value;
|
|
199
|
+
cleanup();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
203
|
+
finally {
|
|
204
|
+
try {
|
|
205
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
206
|
+
}
|
|
207
|
+
finally { if (e_1) throw e_1.error; }
|
|
208
|
+
}
|
|
209
|
+
this._restorationCleanups.clear();
|
|
210
|
+
};
|
|
211
|
+
PopoutWindowService.prototype.serialize = function () {
|
|
212
|
+
return this._entries.map(function (entry) {
|
|
213
|
+
var grid = entry.gridview.serialize();
|
|
214
|
+
var root = grid.root;
|
|
215
|
+
var url = entry.popoutGroup.api.location.type === 'popout'
|
|
216
|
+
? entry.popoutGroup.api.location.popoutUrl
|
|
217
|
+
: undefined;
|
|
218
|
+
var base = {
|
|
219
|
+
gridReferenceGroup: entry.referenceGroup,
|
|
220
|
+
position: entry.window.dimensions(),
|
|
221
|
+
url: url,
|
|
222
|
+
};
|
|
223
|
+
// Single-group window keeps the legacy `data` shape so layouts
|
|
224
|
+
// round-trip byte-stably and older readers keep working.
|
|
225
|
+
if (root.type === 'branch' &&
|
|
226
|
+
root.data.length === 1 &&
|
|
227
|
+
root.data[0].type === 'leaf') {
|
|
228
|
+
return __assign(__assign({}, base), { data: root.data[0].data });
|
|
229
|
+
}
|
|
230
|
+
return __assign(__assign({}, base), { grid: grid });
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
PopoutWindowService.prototype.disposeAll = function () {
|
|
234
|
+
var e_2, _a;
|
|
235
|
+
try {
|
|
236
|
+
for (var _b = __values(__spreadArray([], __read(this._entries), false)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
237
|
+
var entry = _c.value;
|
|
238
|
+
entry.disposable.dispose();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
242
|
+
finally {
|
|
243
|
+
try {
|
|
244
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
245
|
+
}
|
|
246
|
+
finally { if (e_2) throw e_2.error; }
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
PopoutWindowService.prototype.dispose = function () {
|
|
250
|
+
this.cancelPendingRestorations();
|
|
251
|
+
this.disposeAll();
|
|
252
|
+
this._onDidRemove.dispose();
|
|
253
|
+
};
|
|
254
|
+
return PopoutWindowService;
|
|
255
|
+
}());
|
|
256
|
+
exports.PopoutWindowService = PopoutWindowService;
|
|
257
|
+
exports.PopoutWindowModule = (0, modules_1.defineModule)({
|
|
258
|
+
name: 'PopoutWindow',
|
|
259
|
+
serviceKey: 'popoutWindowService',
|
|
260
|
+
create: function (host) { return new PopoutWindowService(host); },
|
|
261
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IDisposable } from '../lifecycle';
|
|
2
|
+
import { Event } from '../events';
|
|
3
|
+
import { DroptargetEvent, DropTargetTargetModel, Position, WillShowOverlayEvent } from '../dnd/droptarget';
|
|
4
|
+
import { DockviewComponentOptions } from './options';
|
|
5
|
+
export interface IRootDropTargetHost {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly element: HTMLElement;
|
|
8
|
+
readonly options: DockviewComponentOptions;
|
|
9
|
+
isGridEmpty(): boolean;
|
|
10
|
+
rootDropTargetOverrideTarget(): DropTargetTargetModel | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Build, fire, and return the verdict for an unhandled-drag-over event.
|
|
13
|
+
* Implemented on the component side so the service stays free of
|
|
14
|
+
* circular imports with the event class declared in dockviewComponent.
|
|
15
|
+
*/
|
|
16
|
+
dispatchUnhandledDragOver(nativeEvent: DragEvent | PointerEvent, position: Position): boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IRootDropTargetService extends IDisposable {
|
|
19
|
+
/** Merged stream from both DnD backends. */
|
|
20
|
+
readonly onWillShowOverlay: Event<WillShowOverlayEvent>;
|
|
21
|
+
/** Merged stream from both DnD backends. */
|
|
22
|
+
readonly onDrop: Event<DroptargetEvent>;
|
|
23
|
+
/** Apply changed options (dndEdges). */
|
|
24
|
+
setOptions(options: Partial<DockviewComponentOptions>): void;
|
|
25
|
+
}
|
|
26
|
+
export declare class RootDropTargetService implements IRootDropTargetService {
|
|
27
|
+
private readonly _html5Target;
|
|
28
|
+
private readonly _pointerTarget;
|
|
29
|
+
readonly onWillShowOverlay: Event<WillShowOverlayEvent>;
|
|
30
|
+
readonly onDrop: Event<DroptargetEvent>;
|
|
31
|
+
constructor(host: IRootDropTargetHost);
|
|
32
|
+
setOptions(options: Partial<DockviewComponentOptions>): void;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
export declare const RootDropTargetModule: import("./modules").DockviewModule<IRootDropTargetHost>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RootDropTargetModule = exports.RootDropTargetService = void 0;
|
|
4
|
+
var events_1 = require("../events");
|
|
5
|
+
var backend_1 = require("../dnd/backend");
|
|
6
|
+
var dataTransfer_1 = require("../dnd/dataTransfer");
|
|
7
|
+
var modules_1 = require("./modules");
|
|
8
|
+
var DEFAULT_ROOT_OVERLAY_MODEL = {
|
|
9
|
+
activationSize: { type: 'pixels', value: 10 },
|
|
10
|
+
size: { type: 'pixels', value: 20 },
|
|
11
|
+
};
|
|
12
|
+
var RootDropTargetService = /** @class */ (function () {
|
|
13
|
+
function RootDropTargetService(host) {
|
|
14
|
+
var canDisplayOverlay = function (event, position) {
|
|
15
|
+
var data = (0, dataTransfer_1.getPanelData)();
|
|
16
|
+
if (data) {
|
|
17
|
+
if (data.viewId !== host.id) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (position === 'center') {
|
|
21
|
+
// center drop target only allowed if no panels in primary
|
|
22
|
+
// grid; floating panels are allowed
|
|
23
|
+
return host.isGridEmpty();
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
if (position === 'center' && !host.isGridEmpty()) {
|
|
28
|
+
// for external events only show the four-corner drag overlays,
|
|
29
|
+
// disable center so external drag events can fall through to
|
|
30
|
+
// the group and panel drop target handlers
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return host.dispatchUnhandledDragOver(event, position);
|
|
34
|
+
};
|
|
35
|
+
var overlayModel = typeof host.options.dndEdges === 'object' &&
|
|
36
|
+
host.options.dndEdges !== null
|
|
37
|
+
? host.options.dndEdges
|
|
38
|
+
: DEFAULT_ROOT_OVERLAY_MODEL;
|
|
39
|
+
this._html5Target = backend_1.html5Backend.createDropTarget(host.element, {
|
|
40
|
+
className: 'dv-drop-target-edge',
|
|
41
|
+
canDisplayOverlay: canDisplayOverlay,
|
|
42
|
+
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
43
|
+
overlayModel: overlayModel,
|
|
44
|
+
getOverrideTarget: function () { return host.rootDropTargetOverrideTarget(); },
|
|
45
|
+
});
|
|
46
|
+
this._pointerTarget = backend_1.pointerBackend.createDropTarget(host.element, {
|
|
47
|
+
className: 'dv-drop-target-edge',
|
|
48
|
+
canDisplayOverlay: canDisplayOverlay,
|
|
49
|
+
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
50
|
+
overlayModel: overlayModel,
|
|
51
|
+
getOverrideTarget: function () { return host.rootDropTargetOverrideTarget(); },
|
|
52
|
+
});
|
|
53
|
+
this.onWillShowOverlay = events_1.Event.any(this._html5Target.onWillShowOverlay, this._pointerTarget.onWillShowOverlay);
|
|
54
|
+
this.onDrop = events_1.Event.any(this._html5Target.onDrop, this._pointerTarget.onDrop);
|
|
55
|
+
// Apply initial-state options now that the targets exist; setOptions
|
|
56
|
+
// handles dndEdges (disable + overlay model) and late changes.
|
|
57
|
+
this.setOptions(host.options);
|
|
58
|
+
}
|
|
59
|
+
RootDropTargetService.prototype.setOptions = function (options) {
|
|
60
|
+
if ('dndEdges' in options) {
|
|
61
|
+
var disabled = typeof options.dndEdges === 'boolean' &&
|
|
62
|
+
options.dndEdges === false;
|
|
63
|
+
this._html5Target.disabled = disabled;
|
|
64
|
+
this._pointerTarget.disabled = disabled;
|
|
65
|
+
if (typeof options.dndEdges === 'object' &&
|
|
66
|
+
options.dndEdges !== null) {
|
|
67
|
+
this._html5Target.setOverlayModel(options.dndEdges);
|
|
68
|
+
this._pointerTarget.setOverlayModel(options.dndEdges);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this._html5Target.setOverlayModel(DEFAULT_ROOT_OVERLAY_MODEL);
|
|
72
|
+
this._pointerTarget.setOverlayModel(DEFAULT_ROOT_OVERLAY_MODEL);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
RootDropTargetService.prototype.dispose = function () {
|
|
77
|
+
this._html5Target.dispose();
|
|
78
|
+
this._pointerTarget.dispose();
|
|
79
|
+
};
|
|
80
|
+
return RootDropTargetService;
|
|
81
|
+
}());
|
|
82
|
+
exports.RootDropTargetService = RootDropTargetService;
|
|
83
|
+
exports.RootDropTargetModule = (0, modules_1.defineModule)({
|
|
84
|
+
name: 'RootDropTarget',
|
|
85
|
+
serviceKey: 'rootDropTargetService',
|
|
86
|
+
create: function (host) { return new RootDropTargetService(host); },
|
|
87
|
+
});
|
|
@@ -36,11 +36,11 @@ var StrictEventsSequencing = /** @class */ (function (_super) {
|
|
|
36
36
|
panels.add(panel.api.id);
|
|
37
37
|
}
|
|
38
38
|
}), this.accessor.onDidRemovePanel(function (panel) {
|
|
39
|
-
if (
|
|
40
|
-
|
|
39
|
+
if (panels.has(panel.api.id)) {
|
|
40
|
+
panels.delete(panel.api.id);
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
|
|
43
|
+
throw new Error("dockview: Invalid event sequence. [onDidRemovePanel] called for panel ".concat(panel.api.id, " but panel does not exists"));
|
|
44
44
|
}
|
|
45
45
|
}), this.accessor.onDidAddGroup(function (group) {
|
|
46
46
|
if (groups.has(group.api.id)) {
|
|
@@ -50,11 +50,11 @@ var StrictEventsSequencing = /** @class */ (function (_super) {
|
|
|
50
50
|
groups.add(group.api.id);
|
|
51
51
|
}
|
|
52
52
|
}), this.accessor.onDidRemoveGroup(function (group) {
|
|
53
|
-
if (
|
|
54
|
-
|
|
53
|
+
if (groups.has(group.api.id)) {
|
|
54
|
+
groups.delete(group.api.id);
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
|
-
|
|
57
|
+
throw new Error("dockview: Invalid event sequence. [onDidRemoveGroup] called for group ".concat(group.api.id, " but group does not exists"));
|
|
58
58
|
}
|
|
59
59
|
}));
|
|
60
60
|
};
|
|
@@ -147,9 +147,9 @@ var TabGroup = /** @class */ (function (_super) {
|
|
|
147
147
|
if (this._panelIds.includes(panelId)) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
var insertIndex = index
|
|
151
|
-
?
|
|
152
|
-
: this._panelIds.length;
|
|
150
|
+
var insertIndex = index === undefined
|
|
151
|
+
? this._panelIds.length
|
|
152
|
+
: Math.max(0, Math.min(index, this._panelIds.length));
|
|
153
153
|
this._panelIds.splice(insertIndex, 0, panelId);
|
|
154
154
|
this._onDidPanelChange.fire({ panelId: panelId, type: 'add' });
|
|
155
155
|
};
|
|
@@ -99,9 +99,7 @@ var _fallbackPalette;
|
|
|
99
99
|
* palette through.
|
|
100
100
|
*/
|
|
101
101
|
function getFallbackPalette() {
|
|
102
|
-
|
|
103
|
-
_fallbackPalette = new TabGroupColorPalette(exports.DEFAULT_TAB_GROUP_COLORS, true);
|
|
104
|
-
}
|
|
102
|
+
_fallbackPalette !== null && _fallbackPalette !== void 0 ? _fallbackPalette : (_fallbackPalette = new TabGroupColorPalette(exports.DEFAULT_TAB_GROUP_COLORS, true));
|
|
105
103
|
return _fallbackPalette;
|
|
106
104
|
}
|
|
107
105
|
/**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IDisposable } from '../lifecycle';
|
|
2
|
+
import { Event } from '../events';
|
|
3
|
+
import { IWatermarkRenderer } from './types';
|
|
4
|
+
import { DockviewApi } from '../api/component.api';
|
|
5
|
+
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
6
|
+
export interface IWatermarkHost {
|
|
7
|
+
readonly api: DockviewApi;
|
|
8
|
+
readonly mountElement: HTMLElement;
|
|
9
|
+
createWatermarkComponent(): IWatermarkRenderer;
|
|
10
|
+
hasVisibleGridGroup(): boolean;
|
|
11
|
+
readonly onDidAdd: Event<DockviewGroupPanel>;
|
|
12
|
+
readonly onDidRemove: Event<DockviewGroupPanel>;
|
|
13
|
+
readonly onDidViewVisibilityChangeMicroTaskQueue: Event<unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface IWatermarkService extends IDisposable {
|
|
16
|
+
/** Mount or unmount the watermark based on current grid state. */
|
|
17
|
+
update(): void;
|
|
18
|
+
/** Tear down the current watermark and re-evaluate. Used when the watermark factory option changes. */
|
|
19
|
+
refresh(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class WatermarkService implements IWatermarkService {
|
|
22
|
+
private readonly _host;
|
|
23
|
+
private _watermark;
|
|
24
|
+
constructor(host: IWatermarkHost);
|
|
25
|
+
update(): void;
|
|
26
|
+
refresh(): void;
|
|
27
|
+
private _unmount;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare const WatermarkModule: import("./modules").DockviewModule<IWatermarkHost>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WatermarkModule = exports.WatermarkService = void 0;
|
|
4
|
+
var lifecycle_1 = require("../lifecycle");
|
|
5
|
+
var dom_1 = require("../dom");
|
|
6
|
+
var events_1 = require("../events");
|
|
7
|
+
var modules_1 = require("./modules");
|
|
8
|
+
var WatermarkService = /** @class */ (function () {
|
|
9
|
+
function WatermarkService(host) {
|
|
10
|
+
this._watermark = null;
|
|
11
|
+
this._host = host;
|
|
12
|
+
}
|
|
13
|
+
WatermarkService.prototype.update = function () {
|
|
14
|
+
if (this._host.hasVisibleGridGroup()) {
|
|
15
|
+
this._unmount();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (this._watermark) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this._watermark = this._host.createWatermarkComponent();
|
|
22
|
+
this._watermark.init({ containerApi: this._host.api });
|
|
23
|
+
var container = document.createElement('div');
|
|
24
|
+
container.className = 'dv-watermark-container';
|
|
25
|
+
(0, dom_1.addTestId)(container, 'watermark-component');
|
|
26
|
+
container.appendChild(this._watermark.element);
|
|
27
|
+
this._host.mountElement.appendChild(container);
|
|
28
|
+
};
|
|
29
|
+
WatermarkService.prototype.refresh = function () {
|
|
30
|
+
this._unmount();
|
|
31
|
+
this.update();
|
|
32
|
+
};
|
|
33
|
+
WatermarkService.prototype._unmount = function () {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
if (!this._watermark) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this._watermark.element.parentElement.remove();
|
|
39
|
+
(_b = (_a = this._watermark).dispose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
40
|
+
this._watermark = null;
|
|
41
|
+
};
|
|
42
|
+
WatermarkService.prototype.dispose = function () {
|
|
43
|
+
this._unmount();
|
|
44
|
+
};
|
|
45
|
+
return WatermarkService;
|
|
46
|
+
}());
|
|
47
|
+
exports.WatermarkService = WatermarkService;
|
|
48
|
+
exports.WatermarkModule = (0, modules_1.defineModule)({
|
|
49
|
+
name: 'Watermark',
|
|
50
|
+
serviceKey: 'watermarkService',
|
|
51
|
+
create: function (host) { return new WatermarkService(host); },
|
|
52
|
+
init: function (host, service) {
|
|
53
|
+
// Initial evaluation reflects the watermark state at construction time.
|
|
54
|
+
service.update();
|
|
55
|
+
return new lifecycle_1.CompositeDisposable(events_1.Event.any(host.onDidAdd, host.onDidRemove)(function () {
|
|
56
|
+
service.update();
|
|
57
|
+
}), host.onDidViewVisibilityChangeMicroTaskQueue(function () {
|
|
58
|
+
service.update();
|
|
59
|
+
}));
|
|
60
|
+
},
|
|
61
|
+
});
|
package/dist/cjs/dom.js
CHANGED
|
@@ -179,7 +179,7 @@ var FocusTracker = /** @class */ (function (_super) {
|
|
|
179
179
|
var onBlur = function () {
|
|
180
180
|
if (hasFocus) {
|
|
181
181
|
loosingFocus = true;
|
|
182
|
-
|
|
182
|
+
globalThis.setTimeout(function () {
|
|
183
183
|
if (loosingFocus) {
|
|
184
184
|
loosingFocus = false;
|
|
185
185
|
hasFocus = false;
|
package/dist/cjs/events.js
CHANGED
|
@@ -95,7 +95,7 @@ var Stacktrace = /** @class */ (function () {
|
|
|
95
95
|
}
|
|
96
96
|
Stacktrace.create = function () {
|
|
97
97
|
var _a;
|
|
98
|
-
return new Stacktrace((_a = new Error().stack) !== null && _a !== void 0 ? _a : '');
|
|
98
|
+
return new Stacktrace((_a = new Error('listener stacktrace').stack) !== null && _a !== void 0 ? _a : '');
|
|
99
99
|
};
|
|
100
100
|
Stacktrace.prototype.print = function () {
|
|
101
101
|
console.warn('dockview: stacktrace', this.value);
|
|
@@ -95,7 +95,7 @@ export declare abstract class BaseGrid<T extends IGridPanelView> extends Resizab
|
|
|
95
95
|
isMaximizedGroup(panel: T): boolean;
|
|
96
96
|
exitMaximizedGroup(): void;
|
|
97
97
|
hasMaximizedGroup(): boolean;
|
|
98
|
-
protected doAddGroup(group: T, location?: number[], size?: number): void;
|
|
98
|
+
protected doAddGroup(group: T, location?: number[], size?: number, gridview?: Gridview): void;
|
|
99
99
|
protected doRemoveGroup(group: T, options?: {
|
|
100
100
|
skipActive?: boolean;
|
|
101
101
|
skipDispose?: boolean;
|
|
@@ -90,8 +90,7 @@ var BaseGrid = /** @class */ (function (_super) {
|
|
|
90
90
|
}), _this.onDidViewVisibilityChangeMicroTaskQueue(function () {
|
|
91
91
|
_this.forceRelayout();
|
|
92
92
|
}), lifecycle_1.Disposable.from(function () {
|
|
93
|
-
|
|
94
|
-
(_a = _this.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(_this.element);
|
|
93
|
+
_this.element.remove();
|
|
95
94
|
}), _this.gridview.onDidChange(function () {
|
|
96
95
|
_this._bufferOnDidLayoutChange.fire();
|
|
97
96
|
}), events_1.Event.any(_this.onDidAdd, _this.onDidRemove, _this.onDidActiveChange)(function () {
|
|
@@ -223,9 +222,10 @@ var BaseGrid = /** @class */ (function (_super) {
|
|
|
223
222
|
BaseGrid.prototype.hasMaximizedGroup = function () {
|
|
224
223
|
return this.gridview.hasMaximizedView();
|
|
225
224
|
};
|
|
226
|
-
BaseGrid.prototype.doAddGroup = function (group, location, size) {
|
|
225
|
+
BaseGrid.prototype.doAddGroup = function (group, location, size, gridview) {
|
|
227
226
|
if (location === void 0) { location = [0]; }
|
|
228
|
-
|
|
227
|
+
if (gridview === void 0) { gridview = this.gridview; }
|
|
228
|
+
gridview.addView(group, size !== null && size !== void 0 ? size : splitview_1.Sizing.Distribute, location);
|
|
229
229
|
this._onDidAdd.fire(group);
|
|
230
230
|
};
|
|
231
231
|
BaseGrid.prototype.doRemoveGroup = function (group, options) {
|
|
@@ -268,9 +268,7 @@ var BaseGrid = /** @class */ (function (_super) {
|
|
|
268
268
|
};
|
|
269
269
|
BaseGrid.prototype.moveToNext = function (options) {
|
|
270
270
|
var _a;
|
|
271
|
-
|
|
272
|
-
options = {};
|
|
273
|
-
}
|
|
271
|
+
options !== null && options !== void 0 ? options : (options = {});
|
|
274
272
|
if (!options.group) {
|
|
275
273
|
if (!this.activeGroup) {
|
|
276
274
|
return;
|
|
@@ -283,9 +281,7 @@ var BaseGrid = /** @class */ (function (_super) {
|
|
|
283
281
|
};
|
|
284
282
|
BaseGrid.prototype.moveToPrevious = function (options) {
|
|
285
283
|
var _a;
|
|
286
|
-
|
|
287
|
-
options = {};
|
|
288
|
-
}
|
|
284
|
+
options !== null && options !== void 0 ? options : (options = {});
|
|
289
285
|
if (!options.group) {
|
|
290
286
|
if (!this.activeGroup) {
|
|
291
287
|
return;
|
|
@@ -66,16 +66,7 @@ var BranchNode = /** @class */ (function (_super) {
|
|
|
66
66
|
_this._size = size;
|
|
67
67
|
_this.element = document.createElement('div');
|
|
68
68
|
_this.element.className = 'dv-branch-node';
|
|
69
|
-
if (
|
|
70
|
-
_this.splitview = new splitview_1.Splitview(_this.element, {
|
|
71
|
-
orientation: _this.orientation,
|
|
72
|
-
proportionalLayout: proportionalLayout,
|
|
73
|
-
styles: styles,
|
|
74
|
-
margin: margin,
|
|
75
|
-
});
|
|
76
|
-
_this.splitview.layout(_this.size, _this.orthogonalSize);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
69
|
+
if (childDescriptors) {
|
|
79
70
|
var descriptor = {
|
|
80
71
|
views: childDescriptors.map(function (childDescriptor) {
|
|
81
72
|
return {
|
|
@@ -98,6 +89,15 @@ var BranchNode = /** @class */ (function (_super) {
|
|
|
98
89
|
margin: margin,
|
|
99
90
|
});
|
|
100
91
|
}
|
|
92
|
+
else {
|
|
93
|
+
_this.splitview = new splitview_1.Splitview(_this.element, {
|
|
94
|
+
orientation: _this.orientation,
|
|
95
|
+
proportionalLayout: proportionalLayout,
|
|
96
|
+
styles: styles,
|
|
97
|
+
margin: margin,
|
|
98
|
+
});
|
|
99
|
+
_this.splitview.layout(_this.size, _this.orthogonalSize);
|
|
100
|
+
}
|
|
101
101
|
_this.disabled = disabled;
|
|
102
102
|
_this.addDisposables(_this._onDidChange, _this._onDidVisibilityChange, _this.splitview.onDidSashEnd(function () {
|
|
103
103
|
_this._onDidChange.fire({});
|
|
@@ -218,15 +218,11 @@ var BranchNode = /** @class */ (function (_super) {
|
|
|
218
218
|
if (this.children.length === 0) {
|
|
219
219
|
return splitview_1.LayoutPriority.Normal;
|
|
220
220
|
}
|
|
221
|
-
var priorities = this.children.map(function (c) {
|
|
222
|
-
|
|
223
|
-
? splitview_1.LayoutPriority.Normal
|
|
224
|
-
: c.priority;
|
|
225
|
-
});
|
|
226
|
-
if (priorities.some(function (p) { return p === splitview_1.LayoutPriority.High; })) {
|
|
221
|
+
var priorities = new Set(this.children.map(function (c) { var _a; return (_a = c.priority) !== null && _a !== void 0 ? _a : splitview_1.LayoutPriority.Normal; }));
|
|
222
|
+
if (priorities.has(splitview_1.LayoutPriority.High)) {
|
|
227
223
|
return splitview_1.LayoutPriority.High;
|
|
228
224
|
}
|
|
229
|
-
else if (priorities.
|
|
225
|
+
else if (priorities.has(splitview_1.LayoutPriority.Low)) {
|
|
230
226
|
return splitview_1.LayoutPriority.Low;
|
|
231
227
|
}
|
|
232
228
|
return splitview_1.LayoutPriority.Normal;
|