dockview 1.0.3 → 1.1.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/README.md +243 -186
- package/dist/cjs/api/component.api.d.ts +28 -19
- package/dist/cjs/api/component.api.js +104 -33
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/api/gridviewPanelApi.js +1 -0
- package/dist/cjs/api/gridviewPanelApi.js.map +1 -1
- package/dist/cjs/api/groupPanelApi.d.ts +11 -14
- package/dist/cjs/api/groupPanelApi.js +19 -17
- package/dist/cjs/api/groupPanelApi.js.map +1 -1
- package/dist/cjs/api/panelApi.d.ts +0 -25
- package/dist/cjs/api/panelApi.js +1 -20
- package/dist/cjs/api/panelApi.js.map +1 -1
- package/dist/cjs/api/paneviewPanelApi.js +1 -0
- package/dist/cjs/api/paneviewPanelApi.js.map +1 -1
- package/dist/cjs/api/splitviewPanelApi.d.ts +0 -1
- package/dist/cjs/api/splitviewPanelApi.js +1 -5
- package/dist/cjs/api/splitviewPanelApi.js.map +1 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +3 -3
- package/dist/cjs/dnd/abstractDragHandler.js +15 -14
- package/dist/cjs/dnd/abstractDragHandler.js.map +1 -1
- package/dist/cjs/dnd/dataTransfer.d.ts +0 -25
- package/dist/cjs/dnd/dataTransfer.js +1 -45
- package/dist/cjs/dnd/dataTransfer.js.map +1 -1
- package/dist/cjs/dnd/dnd.d.ts +1 -14
- package/dist/cjs/dnd/dnd.js +1 -79
- package/dist/cjs/dnd/dnd.js.map +1 -1
- package/dist/cjs/dnd/droptarget.d.ts +3 -0
- package/dist/cjs/dnd/droptarget.js +69 -45
- package/dist/cjs/dnd/droptarget.js.map +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +0 -1
- package/dist/cjs/dockview/components/tab/defaultTab.js +0 -8
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +27 -19
- package/dist/cjs/dockview/dockviewComponent.js +67 -178
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +2 -5
- package/dist/cjs/dockview/dockviewGroupPanel.js +2 -31
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/cjs/dockview/options.d.ts +2 -1
- package/dist/cjs/events.js +25 -4
- package/dist/cjs/events.js.map +1 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +9 -0
- package/dist/cjs/gridview/baseComponentGridview.js +14 -2
- package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.d.ts +5 -8
- package/dist/cjs/gridview/basePanelView.js +14 -8
- package/dist/cjs/gridview/basePanelView.js.map +1 -1
- package/dist/cjs/gridview/branchNode.js +1 -1
- package/dist/cjs/gridview/branchNode.js.map +1 -1
- package/dist/cjs/gridview/gridview.js +19 -17
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +4 -0
- package/dist/cjs/gridview/gridviewComponent.js +5 -0
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +0 -1
- package/dist/cjs/gridview/gridviewPanel.js +3 -6
- package/dist/cjs/gridview/gridviewPanel.js.map +1 -1
- package/dist/cjs/gridview/leafNode.js +1 -0
- package/dist/cjs/gridview/leafNode.js.map +1 -1
- package/dist/cjs/groupview/groupPanel.d.ts +0 -7
- package/dist/cjs/groupview/groupview.d.ts +15 -8
- package/dist/cjs/groupview/groupview.js +36 -123
- package/dist/cjs/groupview/groupview.js.map +1 -1
- package/dist/cjs/groupview/groupviewPanel.d.ts +5 -2
- package/dist/cjs/groupview/groupviewPanel.js.map +1 -1
- package/dist/cjs/groupview/panel/content.js +1 -0
- package/dist/cjs/groupview/panel/content.js.map +1 -1
- package/dist/cjs/groupview/tab.d.ts +10 -13
- package/dist/cjs/groupview/tab.js +22 -80
- package/dist/cjs/groupview/tab.js.map +1 -1
- package/dist/cjs/groupview/titlebar/tabsContainer.js +4 -6
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/lifecycle.js +2 -1
- package/dist/cjs/lifecycle.js.map +1 -1
- package/dist/cjs/panel/types.d.ts +0 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +31 -28
- package/dist/cjs/paneview/draggablePaneviewPanel.js.map +1 -1
- package/dist/cjs/paneview/paneview.js +1 -1
- package/dist/cjs/paneview/paneview.js.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +0 -3
- package/dist/cjs/paneview/paneviewComponent.js +1 -0
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/paneview/paneviewPanel.js +1 -1
- package/dist/cjs/paneview/paneviewPanel.js.map +1 -1
- package/dist/cjs/react/deserializer.js +1 -3
- package/dist/cjs/react/deserializer.js.map +1 -1
- package/dist/cjs/react/dockview/dockview.d.ts +9 -9
- package/dist/cjs/react/dockview/dockview.js +14 -1
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/dockview/reactContentPart.js +4 -4
- package/dist/cjs/react/dockview/reactContentPart.js.map +1 -1
- package/dist/cjs/react/dockview/reactHeaderPart.js +1 -0
- package/dist/cjs/react/dockview/reactHeaderPart.js.map +1 -1
- package/dist/cjs/react/dockview/reactWatermarkPart.d.ts +1 -2
- package/dist/cjs/react/dockview/reactWatermarkPart.js +1 -2
- package/dist/cjs/react/dockview/reactWatermarkPart.js.map +1 -1
- package/dist/cjs/react/gridview/view.js +2 -2
- package/dist/cjs/react/gridview/view.js.map +1 -1
- package/dist/cjs/react/index.d.ts +1 -0
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/react/react.js +1 -2
- package/dist/cjs/react/react.js.map +1 -1
- package/dist/cjs/react/splitview/view.js +2 -2
- package/dist/cjs/react/splitview/view.js.map +1 -1
- package/dist/cjs/splitview/splitviewComponent.d.ts +0 -3
- package/dist/cjs/splitview/splitviewComponent.js +1 -1
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/cjs/splitview/splitviewPanel.d.ts +1 -6
- package/dist/cjs/splitview/splitviewPanel.js +5 -3
- package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
- package/dist/dockview.amd.js +394 -532
- package/dist/dockview.amd.min.js +2 -16
- package/dist/dockview.amd.min.noStyle.js +2 -16
- package/dist/dockview.amd.noStyle.js +393 -531
- package/dist/dockview.cjs.js +394 -532
- package/dist/dockview.esm.js +395 -528
- package/dist/dockview.esm.min.js +2 -16
- package/dist/dockview.js +394 -532
- package/dist/dockview.min.js +2 -16
- package/dist/dockview.min.noStyle.js +2 -16
- package/dist/dockview.noStyle.js +393 -531
- package/dist/esm/api/component.api.d.ts +28 -19
- package/dist/esm/api/component.api.js +48 -21
- package/dist/esm/api/gridviewPanelApi.js +1 -0
- package/dist/esm/api/groupPanelApi.d.ts +11 -14
- package/dist/esm/api/groupPanelApi.js +18 -13
- package/dist/esm/api/panelApi.d.ts +0 -25
- package/dist/esm/api/panelApi.js +1 -20
- package/dist/esm/api/paneviewPanelApi.js +1 -0
- package/dist/esm/api/splitviewPanelApi.d.ts +0 -1
- package/dist/esm/api/splitviewPanelApi.js +1 -5
- package/dist/esm/dnd/abstractDragHandler.d.ts +3 -3
- package/dist/esm/dnd/abstractDragHandler.js +9 -8
- package/dist/esm/dnd/dataTransfer.d.ts +0 -25
- package/dist/esm/dnd/dataTransfer.js +0 -40
- package/dist/esm/dnd/dnd.d.ts +1 -14
- package/dist/esm/dnd/dnd.js +1 -69
- package/dist/esm/dnd/droptarget.d.ts +3 -0
- package/dist/esm/dnd/droptarget.js +69 -45
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +0 -1
- package/dist/esm/dockview/components/tab/defaultTab.js +1 -9
- package/dist/esm/dockview/dockviewComponent.d.ts +27 -19
- package/dist/esm/dockview/dockviewComponent.js +54 -118
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +2 -5
- package/dist/esm/dockview/dockviewGroupPanel.js +2 -30
- package/dist/esm/dockview/options.d.ts +2 -1
- package/dist/esm/events.js +2 -3
- package/dist/esm/gridview/baseComponentGridview.d.ts +9 -0
- package/dist/esm/gridview/baseComponentGridview.js +14 -2
- package/dist/esm/gridview/basePanelView.d.ts +5 -8
- package/dist/esm/gridview/basePanelView.js +10 -8
- package/dist/esm/gridview/branchNode.js +1 -1
- package/dist/esm/gridview/gridview.js +16 -15
- package/dist/esm/gridview/gridviewComponent.d.ts +4 -0
- package/dist/esm/gridview/gridviewComponent.js +5 -0
- package/dist/esm/gridview/gridviewPanel.d.ts +0 -1
- package/dist/esm/gridview/gridviewPanel.js +3 -6
- package/dist/esm/gridview/leafNode.js +1 -0
- package/dist/esm/groupview/groupPanel.d.ts +0 -7
- package/dist/esm/groupview/groupview.d.ts +15 -8
- package/dist/esm/groupview/groupview.js +22 -56
- package/dist/esm/groupview/groupviewPanel.d.ts +5 -2
- package/dist/esm/groupview/panel/content.js +1 -0
- package/dist/esm/groupview/tab.d.ts +10 -13
- package/dist/esm/groupview/tab.js +17 -24
- package/dist/esm/groupview/titlebar/tabsContainer.js +4 -6
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/lifecycle.js +2 -1
- package/dist/esm/panel/types.d.ts +0 -2
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +31 -28
- package/dist/esm/paneview/paneview.js +1 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +0 -3
- package/dist/esm/paneview/paneviewComponent.js +1 -0
- package/dist/esm/paneview/paneviewPanel.js +1 -1
- package/dist/esm/react/deserializer.js +1 -3
- package/dist/esm/react/dockview/dockview.d.ts +9 -9
- package/dist/esm/react/dockview/dockview.js +15 -2
- package/dist/esm/react/dockview/reactContentPart.js +4 -4
- package/dist/esm/react/dockview/reactHeaderPart.js +1 -0
- package/dist/esm/react/dockview/reactWatermarkPart.d.ts +1 -2
- package/dist/esm/react/dockview/reactWatermarkPart.js +1 -2
- package/dist/esm/react/gridview/view.js +2 -2
- package/dist/esm/react/index.d.ts +1 -0
- package/dist/esm/react/react.js +1 -2
- package/dist/esm/react/splitview/view.js +2 -2
- package/dist/esm/splitview/splitviewComponent.d.ts +0 -3
- package/dist/esm/splitview/splitviewComponent.js +1 -1
- package/dist/esm/splitview/splitviewPanel.d.ts +1 -6
- package/dist/esm/splitview/splitviewPanel.js +5 -3
- package/dist/styles/dockview.css +5 -9
- package/package.json +2 -2
- package/dist/cjs/functions.d.ts +0 -1
- package/dist/cjs/functions.js +0 -42
- package/dist/cjs/functions.js.map +0 -1
- package/dist/cjs/groupview/panel/hostedPanel.d.ts +0 -22
- package/dist/cjs/groupview/panel/hostedPanel.js +0 -57
- package/dist/cjs/groupview/panel/hostedPanel.js.map +0 -1
- package/dist/cjs/json.d.ts +0 -1
- package/dist/cjs/json.js +0 -14
- package/dist/cjs/json.js.map +0 -1
- package/dist/esm/functions.d.ts +0 -1
- package/dist/esm/functions.js +0 -8
- package/dist/esm/groupview/panel/hostedPanel.d.ts +0 -22
- package/dist/esm/groupview/panel/hostedPanel.js +0 -43
- package/dist/esm/json.d.ts +0 -1
- package/dist/esm/json.js +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -57,7 +57,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
57
57
|
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) && this._last !== undefined) {
|
|
58
58
|
listener(this._last);
|
|
59
59
|
}
|
|
60
|
-
this._listeners.length === 0;
|
|
61
60
|
this._listeners.push(listener);
|
|
62
61
|
return {
|
|
63
62
|
dispose: () => {
|
|
@@ -73,9 +72,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
73
72
|
}
|
|
74
73
|
fire(e) {
|
|
75
74
|
this._last = e;
|
|
76
|
-
this._listeners
|
|
75
|
+
for (const listener of this._listeners) {
|
|
77
76
|
listener(e);
|
|
78
|
-
}
|
|
77
|
+
}
|
|
79
78
|
}
|
|
80
79
|
dispose() {
|
|
81
80
|
this._listeners = [];
|
|
@@ -133,7 +132,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
133
132
|
return new CompositeDisposable(...args);
|
|
134
133
|
}
|
|
135
134
|
addDisposables(...args) {
|
|
136
|
-
args
|
|
135
|
+
args.forEach((arg) => this.disposables.push(arg));
|
|
137
136
|
}
|
|
138
137
|
dispose() {
|
|
139
138
|
this.disposables.forEach((arg) => arg.dispose());
|
|
@@ -152,20 +151,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
152
151
|
dispose() {
|
|
153
152
|
if (this._disposable) {
|
|
154
153
|
this._disposable.dispose();
|
|
154
|
+
this._disposable = exports.Disposable.NONE;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
function tryParseJSON(text, reviver) {
|
|
160
|
-
try {
|
|
161
|
-
return JSON.parse(text, reviver);
|
|
162
|
-
}
|
|
163
|
-
catch (err) {
|
|
164
|
-
console.warn('failed to parse JSON');
|
|
165
|
-
return undefined;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
159
|
class TransferObject {
|
|
170
160
|
constructor() {
|
|
171
161
|
//
|
|
@@ -186,45 +176,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
186
176
|
this.paneId = paneId;
|
|
187
177
|
}
|
|
188
178
|
}
|
|
189
|
-
const DATA_KEY = 'splitview/transfer';
|
|
190
|
-
const isPanelTransferEvent = (event) => {
|
|
191
|
-
if (!event.dataTransfer) {
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
return event.dataTransfer.types.includes(DATA_KEY);
|
|
195
|
-
};
|
|
196
|
-
exports.DragType = void 0;
|
|
197
|
-
(function (DragType) {
|
|
198
|
-
DragType["DOCKVIEW_TAB"] = "dockview_tab";
|
|
199
|
-
DragType["EXTERNAL"] = "external_group_drag";
|
|
200
|
-
})(exports.DragType || (exports.DragType = {}));
|
|
201
|
-
/**
|
|
202
|
-
* Determine whether this data belong to that of an event that was started by
|
|
203
|
-
* dragging a tab component
|
|
204
|
-
*/
|
|
205
|
-
const isTabDragEvent = (data) => {
|
|
206
|
-
return data.type === exports.DragType.DOCKVIEW_TAB;
|
|
207
|
-
};
|
|
208
|
-
/**
|
|
209
|
-
* Determine whether this data belong to that of an event that was started by
|
|
210
|
-
* a custom drag-enable component
|
|
211
|
-
*/
|
|
212
|
-
const isCustomDragEvent = (data) => {
|
|
213
|
-
return data.type === exports.DragType.EXTERNAL;
|
|
214
|
-
};
|
|
215
|
-
const extractData = (event) => {
|
|
216
|
-
if (!event.dataTransfer) {
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
const data = tryParseJSON(event.dataTransfer.getData(DATA_KEY));
|
|
220
|
-
if (!data) {
|
|
221
|
-
console.warn(`[dragEvent] ${DATA_KEY} data is missing`);
|
|
222
|
-
}
|
|
223
|
-
if (typeof data.type !== 'string') {
|
|
224
|
-
console.warn(`[dragEvent] invalid type ${data.type}`);
|
|
225
|
-
}
|
|
226
|
-
return data;
|
|
227
|
-
};
|
|
228
179
|
/**
|
|
229
180
|
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
230
181
|
*/
|
|
@@ -294,6 +245,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
294
245
|
get length() {
|
|
295
246
|
return this.component.length;
|
|
296
247
|
}
|
|
248
|
+
get orientation() {
|
|
249
|
+
return this.component.orientation;
|
|
250
|
+
}
|
|
297
251
|
get onDidLayoutChange() {
|
|
298
252
|
return this.component.onDidLayoutChange;
|
|
299
253
|
}
|
|
@@ -303,9 +257,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
303
257
|
get onDidRemoveView() {
|
|
304
258
|
return this.component.onDidRemoveView;
|
|
305
259
|
}
|
|
306
|
-
get orientation() {
|
|
307
|
-
return this.component.orientation;
|
|
308
|
-
}
|
|
309
260
|
updateOptions(options) {
|
|
310
261
|
this.component.updateOptions(options);
|
|
311
262
|
}
|
|
@@ -350,18 +301,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
350
301
|
constructor(component) {
|
|
351
302
|
this.component = component;
|
|
352
303
|
}
|
|
353
|
-
get width() {
|
|
354
|
-
return this.component.width;
|
|
355
|
-
}
|
|
356
|
-
get height() {
|
|
357
|
-
return this.component.height;
|
|
358
|
-
}
|
|
359
304
|
get minimumSize() {
|
|
360
305
|
return this.component.minimumSize;
|
|
361
306
|
}
|
|
362
307
|
get maximumSize() {
|
|
363
308
|
return this.component.maximumSize;
|
|
364
309
|
}
|
|
310
|
+
get height() {
|
|
311
|
+
return this.component.height;
|
|
312
|
+
}
|
|
313
|
+
get width() {
|
|
314
|
+
return this.component.width;
|
|
315
|
+
}
|
|
365
316
|
get onDidLayoutChange() {
|
|
366
317
|
return this.component.onDidLayoutChange;
|
|
367
318
|
}
|
|
@@ -417,12 +368,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
417
368
|
constructor(component) {
|
|
418
369
|
this.component = component;
|
|
419
370
|
}
|
|
420
|
-
get width() {
|
|
421
|
-
return this.component.width;
|
|
422
|
-
}
|
|
423
|
-
get height() {
|
|
424
|
-
return this.component.height;
|
|
425
|
-
}
|
|
426
371
|
get minimumHeight() {
|
|
427
372
|
return this.component.minimumHeight;
|
|
428
373
|
}
|
|
@@ -435,12 +380,30 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
435
380
|
get maximumWidth() {
|
|
436
381
|
return this.component.maximumWidth;
|
|
437
382
|
}
|
|
383
|
+
get width() {
|
|
384
|
+
return this.component.width;
|
|
385
|
+
}
|
|
386
|
+
get height() {
|
|
387
|
+
return this.component.height;
|
|
388
|
+
}
|
|
438
389
|
get onGridEvent() {
|
|
439
390
|
return this.component.onGridEvent;
|
|
440
391
|
}
|
|
441
392
|
get onDidLayoutChange() {
|
|
442
393
|
return this.component.onDidLayoutChange;
|
|
443
394
|
}
|
|
395
|
+
get onDidAddGroup() {
|
|
396
|
+
return this.component.onDidAddGroup;
|
|
397
|
+
}
|
|
398
|
+
get onDidRemoveGroup() {
|
|
399
|
+
return this.component.onDidRemoveGroup;
|
|
400
|
+
}
|
|
401
|
+
get onDidActiveGroupChange() {
|
|
402
|
+
return this.component.onDidActiveGroupChange;
|
|
403
|
+
}
|
|
404
|
+
get onDidLayoutFromJSON() {
|
|
405
|
+
return this.component.onDidLayoutFromJSON;
|
|
406
|
+
}
|
|
444
407
|
get panels() {
|
|
445
408
|
return this.component.groups;
|
|
446
409
|
}
|
|
@@ -518,6 +481,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
518
481
|
get onGridEvent() {
|
|
519
482
|
return this.component.onGridEvent;
|
|
520
483
|
}
|
|
484
|
+
get onDidActiveGroupChange() {
|
|
485
|
+
return this.component.onDidActiveGroupChange;
|
|
486
|
+
}
|
|
487
|
+
get onDidAddGroup() {
|
|
488
|
+
return this.component.onDidAddGroup;
|
|
489
|
+
}
|
|
490
|
+
get onDidRemoveGroup() {
|
|
491
|
+
return this.component.onDidRemoveGroup;
|
|
492
|
+
}
|
|
493
|
+
get onDidActivePanelChange() {
|
|
494
|
+
return this.component.onDidActivePanelChange;
|
|
495
|
+
}
|
|
496
|
+
get onDidAddPanel() {
|
|
497
|
+
return this.component.onDidAddPanel;
|
|
498
|
+
}
|
|
499
|
+
get onDidRemovePanel() {
|
|
500
|
+
return this.component.onDidRemovePanel;
|
|
501
|
+
}
|
|
502
|
+
get onDidLayoutfromJSON() {
|
|
503
|
+
return this.component.onDidLayoutfromJSON;
|
|
504
|
+
}
|
|
521
505
|
get onDidLayoutChange() {
|
|
522
506
|
return this.component.onDidLayoutChange;
|
|
523
507
|
}
|
|
@@ -545,18 +529,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
545
529
|
getPanel(id) {
|
|
546
530
|
return this.component.getGroupPanel(id);
|
|
547
531
|
}
|
|
548
|
-
setActivePanel(panel) {
|
|
549
|
-
this.component.setActivePanel(panel);
|
|
550
|
-
}
|
|
551
532
|
layout(width, height, force = false) {
|
|
552
533
|
this.component.layout(width, height, force);
|
|
553
534
|
}
|
|
554
535
|
addPanel(options) {
|
|
555
536
|
return this.component.addPanel(options);
|
|
556
537
|
}
|
|
557
|
-
removePanel(panel) {
|
|
558
|
-
this.component.removePanel(panel);
|
|
559
|
-
}
|
|
560
538
|
addEmptyGroup(options) {
|
|
561
539
|
this.component.addEmptyGroup(options);
|
|
562
540
|
}
|
|
@@ -1576,7 +1554,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1576
1554
|
this.paneItems.push(paneItem);
|
|
1577
1555
|
pane.orthogonalSize = this.splitview.orthogonalSize;
|
|
1578
1556
|
});
|
|
1579
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
1557
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
1580
1558
|
this._onDidChange.fire(undefined);
|
|
1581
1559
|
}), this.splitview.onDidAddView(() => {
|
|
1582
1560
|
this._onDidChange.fire();
|
|
@@ -1737,7 +1715,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1737
1715
|
this.options = options;
|
|
1738
1716
|
this._onDrop = new Emitter();
|
|
1739
1717
|
this.onDrop = this._onDrop.event;
|
|
1740
|
-
this.addDisposables(new DragAndDropObserver(this.element, {
|
|
1718
|
+
this.addDisposables(this._onDrop, new DragAndDropObserver(this.element, {
|
|
1741
1719
|
onDragEnter: (e) => undefined,
|
|
1742
1720
|
onDragOver: (e) => {
|
|
1743
1721
|
if (isBooleanValue(this.options.canDisplayOverlay)) {
|
|
@@ -1773,51 +1751,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1773
1751
|
const y = e.offsetY;
|
|
1774
1752
|
const xp = (100 * x) / width;
|
|
1775
1753
|
const yp = (100 * y) / height;
|
|
1776
|
-
|
|
1777
|
-
let isLeft = false;
|
|
1778
|
-
let isTop = false;
|
|
1779
|
-
let isBottom = false;
|
|
1780
|
-
switch (this.options.validOverlays) {
|
|
1781
|
-
case 'all':
|
|
1782
|
-
isRight = xp > 80;
|
|
1783
|
-
isLeft = xp < 20;
|
|
1784
|
-
isTop = !isRight && !isLeft && yp < 20;
|
|
1785
|
-
isBottom = !isRight && !isLeft && yp > 80;
|
|
1786
|
-
break;
|
|
1787
|
-
case 'vertical':
|
|
1788
|
-
isTop = yp < 50;
|
|
1789
|
-
isBottom = yp >= 50;
|
|
1790
|
-
break;
|
|
1791
|
-
case 'horizontal':
|
|
1792
|
-
isLeft = xp < 50;
|
|
1793
|
-
isRight = xp >= 50;
|
|
1794
|
-
break;
|
|
1795
|
-
}
|
|
1754
|
+
const quadrant = this.calculateQuadrant(this.options.validOverlays, xp, yp);
|
|
1796
1755
|
const isSmallX = width < 100;
|
|
1797
1756
|
const isSmallY = height < 100;
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1801
|
-
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1802
|
-
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1803
|
-
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1804
|
-
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1805
|
-
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1806
|
-
if (isRight) {
|
|
1807
|
-
this._state = exports.Position.Right;
|
|
1808
|
-
}
|
|
1809
|
-
else if (isLeft) {
|
|
1810
|
-
this._state = exports.Position.Left;
|
|
1811
|
-
}
|
|
1812
|
-
else if (isTop) {
|
|
1813
|
-
this._state = exports.Position.Top;
|
|
1814
|
-
}
|
|
1815
|
-
else if (isBottom) {
|
|
1816
|
-
this._state = exports.Position.Bottom;
|
|
1817
|
-
}
|
|
1818
|
-
else {
|
|
1819
|
-
this._state = exports.Position.Center;
|
|
1820
|
-
}
|
|
1757
|
+
this.toggleClasses(quadrant, isSmallX, isSmallY);
|
|
1758
|
+
this.setState(quadrant);
|
|
1821
1759
|
},
|
|
1822
1760
|
onDragLeave: (e) => {
|
|
1823
1761
|
this.removeDropTarget();
|
|
@@ -1846,9 +1784,73 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1846
1784
|
this.options.canDisplayOverlay = value;
|
|
1847
1785
|
}
|
|
1848
1786
|
dispose() {
|
|
1849
|
-
this._onDrop.dispose();
|
|
1850
1787
|
this.removeDropTarget();
|
|
1851
1788
|
}
|
|
1789
|
+
toggleClasses(quadrant, isSmallX, isSmallY) {
|
|
1790
|
+
if (!this.overlay) {
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
const isLeft = quadrant === 'left';
|
|
1794
|
+
const isRight = quadrant === 'right';
|
|
1795
|
+
const isTop = quadrant === 'top';
|
|
1796
|
+
const isBottom = quadrant === 'bottom';
|
|
1797
|
+
toggleClass(this.overlay, 'right', !isSmallX && isRight);
|
|
1798
|
+
toggleClass(this.overlay, 'left', !isSmallX && isLeft);
|
|
1799
|
+
toggleClass(this.overlay, 'top', !isSmallY && isTop);
|
|
1800
|
+
toggleClass(this.overlay, 'bottom', !isSmallY && isBottom);
|
|
1801
|
+
toggleClass(this.overlay, 'small-right', isSmallX && isRight);
|
|
1802
|
+
toggleClass(this.overlay, 'small-left', isSmallX && isLeft);
|
|
1803
|
+
toggleClass(this.overlay, 'small-top', isSmallY && isTop);
|
|
1804
|
+
toggleClass(this.overlay, 'small-bottom', isSmallY && isBottom);
|
|
1805
|
+
}
|
|
1806
|
+
setState(quadrant) {
|
|
1807
|
+
switch (quadrant) {
|
|
1808
|
+
case 'top':
|
|
1809
|
+
this._state = exports.Position.Top;
|
|
1810
|
+
break;
|
|
1811
|
+
case 'left':
|
|
1812
|
+
this._state = exports.Position.Left;
|
|
1813
|
+
break;
|
|
1814
|
+
case 'bottom':
|
|
1815
|
+
this._state = exports.Position.Bottom;
|
|
1816
|
+
break;
|
|
1817
|
+
case 'right':
|
|
1818
|
+
this._state = exports.Position.Right;
|
|
1819
|
+
break;
|
|
1820
|
+
default:
|
|
1821
|
+
this._state = exports.Position.Center;
|
|
1822
|
+
break;
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
calculateQuadrant(overlayType, xp, yp) {
|
|
1826
|
+
switch (overlayType) {
|
|
1827
|
+
case 'all':
|
|
1828
|
+
if (xp < 20) {
|
|
1829
|
+
return 'left';
|
|
1830
|
+
}
|
|
1831
|
+
if (xp > 80) {
|
|
1832
|
+
return 'right';
|
|
1833
|
+
}
|
|
1834
|
+
if (yp < 20) {
|
|
1835
|
+
return 'top';
|
|
1836
|
+
}
|
|
1837
|
+
if (yp > 80) {
|
|
1838
|
+
return 'bottom';
|
|
1839
|
+
}
|
|
1840
|
+
break;
|
|
1841
|
+
case 'vertical':
|
|
1842
|
+
if (yp < 50) {
|
|
1843
|
+
return 'top';
|
|
1844
|
+
}
|
|
1845
|
+
return 'bottom';
|
|
1846
|
+
case 'horizontal':
|
|
1847
|
+
if (xp < 50) {
|
|
1848
|
+
return 'left';
|
|
1849
|
+
}
|
|
1850
|
+
return 'right';
|
|
1851
|
+
}
|
|
1852
|
+
return null;
|
|
1853
|
+
}
|
|
1852
1854
|
removeDropTarget() {
|
|
1853
1855
|
if (this.target) {
|
|
1854
1856
|
this._state = undefined;
|
|
@@ -1951,6 +1953,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1951
1953
|
this.view.layout(this.width, this.height);
|
|
1952
1954
|
}
|
|
1953
1955
|
dispose() {
|
|
1956
|
+
this._onDidChange.dispose();
|
|
1954
1957
|
this._disposable.dispose();
|
|
1955
1958
|
}
|
|
1956
1959
|
}
|
|
@@ -2002,7 +2005,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2002
2005
|
proportionalLayout,
|
|
2003
2006
|
});
|
|
2004
2007
|
}
|
|
2005
|
-
this.addDisposables(this.splitview.onDidSashEnd(() => {
|
|
2008
|
+
this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
|
|
2006
2009
|
this._onDidChange.fire(undefined);
|
|
2007
2010
|
}));
|
|
2008
2011
|
this.setupChildrenEvents();
|
|
@@ -2174,6 +2177,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2174
2177
|
* Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
|
|
2175
2178
|
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
|
2176
2179
|
*--------------------------------------------------------------------------------------------*/
|
|
2180
|
+
function findLeaf(candiateNode, last) {
|
|
2181
|
+
if (candiateNode instanceof LeafNode) {
|
|
2182
|
+
return candiateNode;
|
|
2183
|
+
}
|
|
2184
|
+
if (candiateNode instanceof BranchNode) {
|
|
2185
|
+
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2186
|
+
}
|
|
2187
|
+
throw new Error('invalid node');
|
|
2188
|
+
}
|
|
2177
2189
|
function flipNode(node, size, orthogonalSize) {
|
|
2178
2190
|
if (node instanceof BranchNode) {
|
|
2179
2191
|
const result = new BranchNode(orthogonal(node.orientation), node.proportionalLayout, node.styles, size, orthogonalSize);
|
|
@@ -2312,13 +2324,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2312
2324
|
}
|
|
2313
2325
|
deserialize(json, deserializer) {
|
|
2314
2326
|
const orientation = json.orientation;
|
|
2315
|
-
const height = json.height;
|
|
2327
|
+
const height = orientation === exports.Orientation.VERTICAL ? json.height : json.width;
|
|
2316
2328
|
this._deserialize(json.root, orientation, deserializer, height);
|
|
2317
2329
|
}
|
|
2318
2330
|
_deserialize(root, orientation, deserializer, orthogonalSize) {
|
|
2319
|
-
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize);
|
|
2331
|
+
this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize, true);
|
|
2320
2332
|
}
|
|
2321
|
-
_deserializeNode(node, orientation, deserializer, orthogonalSize) {
|
|
2333
|
+
_deserializeNode(node, orientation, deserializer, orthogonalSize, isRoot = false) {
|
|
2322
2334
|
let result;
|
|
2323
2335
|
if (node.type === 'branch') {
|
|
2324
2336
|
const serializedChildren = node.data;
|
|
@@ -2328,7 +2340,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2328
2340
|
visible: serializedChild.visible,
|
|
2329
2341
|
};
|
|
2330
2342
|
});
|
|
2331
|
-
|
|
2343
|
+
// HORIZONTAL => height=orthogonalsize width=size
|
|
2344
|
+
// VERTICAL => height=size width=orthogonalsize
|
|
2345
|
+
result = new BranchNode(orientation, this.proportionalLayout, this.styles, isRoot ? orthogonalSize : node.size, isRoot ? node.size : orthogonalSize, children);
|
|
2332
2346
|
}
|
|
2333
2347
|
else {
|
|
2334
2348
|
result = new LeafNode(deserializer.fromJSON(node), orientation, orthogonalSize, node.size);
|
|
@@ -2389,15 +2403,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2389
2403
|
if (!(node instanceof LeafNode)) {
|
|
2390
2404
|
throw new Error('invalid location');
|
|
2391
2405
|
}
|
|
2392
|
-
const findLeaf = (candiateNode, last) => {
|
|
2393
|
-
if (candiateNode instanceof LeafNode) {
|
|
2394
|
-
return candiateNode;
|
|
2395
|
-
}
|
|
2396
|
-
if (candiateNode instanceof BranchNode) {
|
|
2397
|
-
return findLeaf(candiateNode.children[last ? candiateNode.children.length - 1 : 0], last);
|
|
2398
|
-
}
|
|
2399
|
-
throw new Error('invalid node');
|
|
2400
|
-
};
|
|
2401
2406
|
for (let i = path.length - 1; i > -1; i--) {
|
|
2402
2407
|
const n = path[i];
|
|
2403
2408
|
const l = location[i] || 0;
|
|
@@ -2499,9 +2504,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2499
2504
|
if (parent.children.length > 1) {
|
|
2500
2505
|
return node.view;
|
|
2501
2506
|
}
|
|
2507
|
+
const sibling = parent.children[0];
|
|
2502
2508
|
if (pathToParent.length === 0) {
|
|
2503
2509
|
// parent is root
|
|
2504
|
-
const sibling = parent.children[0];
|
|
2505
2510
|
if (sibling instanceof LeafNode) {
|
|
2506
2511
|
return node.view;
|
|
2507
2512
|
}
|
|
@@ -2512,7 +2517,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2512
2517
|
}
|
|
2513
2518
|
const [grandParent, ..._] = [...pathToParent].reverse();
|
|
2514
2519
|
const [parentIndex, ...__] = [...rest].reverse();
|
|
2515
|
-
const sibling = parent.children[0];
|
|
2516
2520
|
const isSiblingVisible = parent.isChildVisible(0);
|
|
2517
2521
|
parent.removeChild(0, sizing);
|
|
2518
2522
|
const sizes = grandParent.children.map((size, i) => grandParent.getChildSize(i));
|
|
@@ -2559,31 +2563,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2559
2563
|
}
|
|
2560
2564
|
}
|
|
2561
2565
|
|
|
2562
|
-
/*! *****************************************************************************
|
|
2563
|
-
Copyright (c) Microsoft Corporation.
|
|
2564
|
-
|
|
2565
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2566
|
-
purpose with or without fee is hereby granted.
|
|
2567
|
-
|
|
2568
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2569
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2570
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2571
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2572
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2573
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2574
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2575
|
-
***************************************************************************** */
|
|
2576
|
-
|
|
2577
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2578
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2579
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2580
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2581
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2582
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2583
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2584
|
-
});
|
|
2585
|
-
}
|
|
2586
|
-
|
|
2587
2566
|
class ContentContainer extends CompositeDisposable {
|
|
2588
2567
|
constructor() {
|
|
2589
2568
|
super();
|
|
@@ -2595,6 +2574,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2595
2574
|
this._element = document.createElement('div');
|
|
2596
2575
|
this._element.className = 'content-container';
|
|
2597
2576
|
this._element.tabIndex = -1;
|
|
2577
|
+
this.addDisposables(this._onDidFocus, this._onDidBlur);
|
|
2598
2578
|
// for hosted containers
|
|
2599
2579
|
// 1) register a drop target on the host
|
|
2600
2580
|
// 2) register window dragStart events to disable pointer events
|
|
@@ -2661,6 +2641,41 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2661
2641
|
DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
|
|
2662
2642
|
})(DockviewDropTargets || (DockviewDropTargets = {}));
|
|
2663
2643
|
|
|
2644
|
+
class DragHandler extends CompositeDisposable {
|
|
2645
|
+
constructor(el) {
|
|
2646
|
+
super();
|
|
2647
|
+
this.el = el;
|
|
2648
|
+
this.disposable = new MutableDisposable();
|
|
2649
|
+
this._onDragStart = new Emitter();
|
|
2650
|
+
this.onDragStart = this._onDragStart.event;
|
|
2651
|
+
this.iframes = [];
|
|
2652
|
+
this.configure();
|
|
2653
|
+
}
|
|
2654
|
+
configure() {
|
|
2655
|
+
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
2656
|
+
this.iframes = [
|
|
2657
|
+
...getElementsByTagName('iframe'),
|
|
2658
|
+
...getElementsByTagName('webview'),
|
|
2659
|
+
];
|
|
2660
|
+
for (const iframe of this.iframes) {
|
|
2661
|
+
iframe.style.pointerEvents = 'none';
|
|
2662
|
+
}
|
|
2663
|
+
this.el.classList.add('dragged');
|
|
2664
|
+
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
2665
|
+
this.disposable.value = this.getData();
|
|
2666
|
+
if (event.dataTransfer) {
|
|
2667
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
2668
|
+
}
|
|
2669
|
+
}), addDisposableListener(this.el, 'dragend', (ev) => {
|
|
2670
|
+
for (const iframe of this.iframes) {
|
|
2671
|
+
iframe.style.pointerEvents = 'auto';
|
|
2672
|
+
}
|
|
2673
|
+
this.iframes = [];
|
|
2674
|
+
this.disposable.dispose();
|
|
2675
|
+
}));
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2664
2679
|
exports.MouseEventKind = void 0;
|
|
2665
2680
|
(function (MouseEventKind) {
|
|
2666
2681
|
MouseEventKind["CLICK"] = "CLICK";
|
|
@@ -2670,42 +2685,34 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2670
2685
|
constructor(panelId, accessor, group) {
|
|
2671
2686
|
super();
|
|
2672
2687
|
this.panelId = panelId;
|
|
2673
|
-
this.accessor = accessor;
|
|
2674
2688
|
this.group = group;
|
|
2675
2689
|
this._onChanged = new Emitter();
|
|
2676
2690
|
this.onChanged = this._onChanged.event;
|
|
2677
2691
|
this._onDropped = new Emitter();
|
|
2678
2692
|
this.onDrop = this._onDropped.event;
|
|
2679
|
-
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2680
|
-
this.iframes = [];
|
|
2681
2693
|
this.addDisposables(this._onChanged, this._onDropped);
|
|
2682
2694
|
this._element = document.createElement('div');
|
|
2683
2695
|
this._element.className = 'tab';
|
|
2684
2696
|
this._element.tabIndex = 0;
|
|
2685
2697
|
this._element.draggable = true;
|
|
2686
|
-
this.addDisposables(
|
|
2687
|
-
|
|
2688
|
-
...
|
|
2689
|
-
|
|
2690
|
-
];
|
|
2691
|
-
for (const iframe of this.iframes) {
|
|
2692
|
-
iframe.style.pointerEvents = 'none';
|
|
2698
|
+
this.addDisposables(new (class Handler extends DragHandler {
|
|
2699
|
+
constructor() {
|
|
2700
|
+
super(...arguments);
|
|
2701
|
+
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
2693
2702
|
}
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2703
|
+
getData() {
|
|
2704
|
+
this.panelTransfer.setData([new PanelTransfer(accessor.id, group.id, panelId)], PanelTransfer.prototype);
|
|
2705
|
+
return {
|
|
2706
|
+
dispose: () => {
|
|
2707
|
+
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
2708
|
+
},
|
|
2709
|
+
};
|
|
2701
2710
|
}
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
iframe.style.pointerEvents = 'auto';
|
|
2711
|
+
dispose() {
|
|
2712
|
+
//
|
|
2705
2713
|
}
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
}), addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2714
|
+
})(this._element));
|
|
2715
|
+
this.addDisposables(addDisposableListener(this._element, 'mousedown', (event) => {
|
|
2709
2716
|
if (event.defaultPrevented) {
|
|
2710
2717
|
return;
|
|
2711
2718
|
}
|
|
@@ -2907,12 +2914,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2907
2914
|
if (!isLeftClick || event.event.defaultPrevented) {
|
|
2908
2915
|
return;
|
|
2909
2916
|
}
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
});
|
|
2915
|
-
break;
|
|
2917
|
+
if (event.kind === exports.MouseEventKind.CLICK) {
|
|
2918
|
+
this.group.model.openPanel(panel, {
|
|
2919
|
+
skipFocus: alreadyFocused,
|
|
2920
|
+
});
|
|
2916
2921
|
}
|
|
2917
2922
|
}), tabToAdd.onDrop((event) => {
|
|
2918
2923
|
this._onDrop.fire({
|
|
@@ -2941,7 +2946,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2941
2946
|
GroupChangeKind2["ADD_PANEL"] = "ADD_PANEL";
|
|
2942
2947
|
GroupChangeKind2["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
2943
2948
|
GroupChangeKind2["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
2944
|
-
GroupChangeKind2["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
2945
2949
|
})(exports.GroupChangeKind2 || (exports.GroupChangeKind2 = {}));
|
|
2946
2950
|
class Groupview extends CompositeDisposable {
|
|
2947
2951
|
constructor(container, accessor, id, options, parent) {
|
|
@@ -2962,15 +2966,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2962
2966
|
this.onMove = this._onMove.event;
|
|
2963
2967
|
this._onDidGroupChange = new Emitter();
|
|
2964
2968
|
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
2965
|
-
this.
|
|
2966
|
-
|
|
2967
|
-
return false;
|
|
2968
|
-
}
|
|
2969
|
-
this.doClose(panel);
|
|
2970
|
-
return true;
|
|
2971
|
-
});
|
|
2969
|
+
this._onDidDrop = new Emitter();
|
|
2970
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
2972
2971
|
this.container.classList.add('groupview');
|
|
2973
|
-
this.addDisposables(this._onMove, this._onDidGroupChange);
|
|
2972
|
+
this.addDisposables(this._onMove, this._onDidGroupChange, this._onDidChange, this._onDidDrop);
|
|
2974
2973
|
this.tabsContainer = new TabsContainer(this.accessor, this.parent, {
|
|
2975
2974
|
tabHeight: options.tabHeight,
|
|
2976
2975
|
});
|
|
@@ -3127,6 +3126,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3127
3126
|
options.index > this.panels.length) {
|
|
3128
3127
|
options.index = this.panels.length;
|
|
3129
3128
|
}
|
|
3129
|
+
// ensure the group is updated before we fire any events
|
|
3130
|
+
panel.updateParentGroup(this.parent, true);
|
|
3130
3131
|
if (this._activePanel === panel) {
|
|
3131
3132
|
this.accessor.doSetGroupActive(this.parent);
|
|
3132
3133
|
return;
|
|
@@ -3147,43 +3148,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3147
3148
|
return this._removePanel(panelToRemove);
|
|
3148
3149
|
}
|
|
3149
3150
|
closeAllPanels() {
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
const
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
if (this._activePanel && index > -1) {
|
|
3156
|
-
if (this.panels.indexOf(this._activePanel) < 0) {
|
|
3157
|
-
console.warn('active panel not tracked');
|
|
3158
|
-
}
|
|
3159
|
-
const canClose = !((_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.close) || (yield this._activePanel.close());
|
|
3160
|
-
if (!canClose) {
|
|
3161
|
-
return false;
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
for (let i = 0; i < this.panels.length; i++) {
|
|
3165
|
-
if (i === index) {
|
|
3166
|
-
continue;
|
|
3167
|
-
}
|
|
3168
|
-
const panel = this.panels[i];
|
|
3169
|
-
this.openPanel(panel);
|
|
3170
|
-
if (panel.close) {
|
|
3171
|
-
const canClose = yield panel.close();
|
|
3172
|
-
if (!canClose) {
|
|
3173
|
-
return false;
|
|
3174
|
-
}
|
|
3175
|
-
}
|
|
3176
|
-
}
|
|
3177
|
-
if (this.panels.length > 0) {
|
|
3178
|
-
// take a copy since we will be edting the array as we iterate through
|
|
3179
|
-
const arrPanelCpy = [...this.panels];
|
|
3180
|
-
yield Promise.all(arrPanelCpy.map((p) => this.doClose(p)));
|
|
3151
|
+
if (this.panels.length > 0) {
|
|
3152
|
+
// take a copy since we will be edting the array as we iterate through
|
|
3153
|
+
const arrPanelCpy = [...this.panels];
|
|
3154
|
+
for (const panel of arrPanelCpy) {
|
|
3155
|
+
this.doClose(panel);
|
|
3181
3156
|
}
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3157
|
+
}
|
|
3158
|
+
else {
|
|
3159
|
+
this.accessor.removeGroup(this.parent);
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
closePanel(panel) {
|
|
3163
|
+
this.doClose(panel);
|
|
3187
3164
|
}
|
|
3188
3165
|
doClose(panel) {
|
|
3189
3166
|
this.accessor.removePanel(panel);
|
|
@@ -3326,8 +3303,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3326
3303
|
this.tabsContainer.show();
|
|
3327
3304
|
}
|
|
3328
3305
|
}
|
|
3329
|
-
canDisplayOverlay(
|
|
3306
|
+
canDisplayOverlay(event, target) {
|
|
3330
3307
|
// custom overlay handler
|
|
3308
|
+
if (this.accessor.options.showDndOverlay) {
|
|
3309
|
+
return this.accessor.options.showDndOverlay(event, target);
|
|
3310
|
+
}
|
|
3331
3311
|
return false;
|
|
3332
3312
|
}
|
|
3333
3313
|
handleDropEvent(event, position, index) {
|
|
@@ -3352,6 +3332,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3352
3332
|
index,
|
|
3353
3333
|
});
|
|
3354
3334
|
}
|
|
3335
|
+
else {
|
|
3336
|
+
this._onDidDrop.fire({ nativeEvent: event, position, index });
|
|
3337
|
+
}
|
|
3355
3338
|
}
|
|
3356
3339
|
dispose() {
|
|
3357
3340
|
for (const panel of this.panels) {
|
|
@@ -3404,10 +3387,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3404
3387
|
this.onGridEvent = this._onGridEvent.event;
|
|
3405
3388
|
this._onDidLayoutChange = new Emitter();
|
|
3406
3389
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
3390
|
+
this._onDidRemoveGroup = new Emitter();
|
|
3391
|
+
this.onDidRemoveGroup = this._onDidRemoveGroup.event;
|
|
3392
|
+
this._onDidAddGroup = new Emitter();
|
|
3393
|
+
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
3394
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3395
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3407
3396
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
3408
3397
|
this.element.appendChild(this.gridview.element);
|
|
3409
|
-
|
|
3410
|
-
this.layout(0, 0, true);
|
|
3398
|
+
this.layout(0, 0, true); // set some elements height/widths
|
|
3411
3399
|
this.addDisposables(this.gridview.onDidChange(() => {
|
|
3412
3400
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.LAYOUT });
|
|
3413
3401
|
}));
|
|
@@ -3473,6 +3461,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3473
3461
|
doAddGroup(group, location = [0], size) {
|
|
3474
3462
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : exports.Sizing.Distribute, location);
|
|
3475
3463
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.ADD_GROUP });
|
|
3464
|
+
this._onDidAddGroup.fire(group);
|
|
3476
3465
|
this.doSetGroupActive(group);
|
|
3477
3466
|
}
|
|
3478
3467
|
doRemoveGroup(group, options) {
|
|
@@ -3486,6 +3475,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3486
3475
|
this._groups.delete(group.id);
|
|
3487
3476
|
}
|
|
3488
3477
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.REMOVE_GROUP });
|
|
3478
|
+
this._onDidRemoveGroup.fire(group);
|
|
3489
3479
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
3490
3480
|
const groups = Array.from(this._groups.values());
|
|
3491
3481
|
this.doSetGroupActive(groups.length > 0 ? groups[0].value : undefined);
|
|
@@ -3516,6 +3506,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3516
3506
|
this._onGridEvent.fire({
|
|
3517
3507
|
kind: exports.GroupChangeKind.GROUP_ACTIVE,
|
|
3518
3508
|
});
|
|
3509
|
+
this._onDidActiveGroupChange.fire(group);
|
|
3519
3510
|
}
|
|
3520
3511
|
removeGroup(group) {
|
|
3521
3512
|
this.doRemoveGroup(group);
|
|
@@ -3572,6 +3563,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3572
3563
|
dispose() {
|
|
3573
3564
|
super.dispose();
|
|
3574
3565
|
this._onGridEvent.dispose();
|
|
3566
|
+
this._onDidActiveGroupChange.dispose();
|
|
3567
|
+
this._onDidAddGroup.dispose();
|
|
3568
|
+
this._onDidRemoveGroup.dispose();
|
|
3569
|
+
this._onDidLayoutChange.dispose();
|
|
3575
3570
|
this.gridview.dispose();
|
|
3576
3571
|
}
|
|
3577
3572
|
}
|
|
@@ -3583,15 +3578,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3583
3578
|
constructor(id) {
|
|
3584
3579
|
super();
|
|
3585
3580
|
this.id = id;
|
|
3586
|
-
this._state = {};
|
|
3587
3581
|
this._isFocused = false;
|
|
3588
3582
|
this._isActive = false;
|
|
3589
3583
|
this._isVisible = true;
|
|
3590
3584
|
this._width = 0;
|
|
3591
3585
|
this._height = 0;
|
|
3592
|
-
this._onDidStateChange = new Emitter();
|
|
3593
|
-
this.onDidStateChange = this._onDidStateChange.event;
|
|
3594
|
-
//
|
|
3595
3586
|
this._onDidPanelDimensionChange = new Emitter({
|
|
3596
3587
|
replay: true,
|
|
3597
3588
|
});
|
|
@@ -3620,7 +3611,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3620
3611
|
//
|
|
3621
3612
|
this._onActiveChange = new Emitter();
|
|
3622
3613
|
this.onActiveChange = this._onActiveChange.event;
|
|
3623
|
-
this.addDisposables(this.
|
|
3614
|
+
this.addDisposables(this._onDidPanelDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3624
3615
|
this._isFocused = event.isFocused;
|
|
3625
3616
|
}), this.onDidActiveChange((event) => {
|
|
3626
3617
|
this._isActive = event.isActive;
|
|
@@ -3653,21 +3644,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3653
3644
|
setActive() {
|
|
3654
3645
|
this._onActiveChange.fire();
|
|
3655
3646
|
}
|
|
3656
|
-
setState(key, value) {
|
|
3657
|
-
if (typeof key === 'object') {
|
|
3658
|
-
this._state = key;
|
|
3659
|
-
}
|
|
3660
|
-
else if (typeof value !== undefined) {
|
|
3661
|
-
this._state[key] = value;
|
|
3662
|
-
}
|
|
3663
|
-
this._onDidStateChange.fire(undefined);
|
|
3664
|
-
}
|
|
3665
|
-
getState() {
|
|
3666
|
-
return this._state;
|
|
3667
|
-
}
|
|
3668
|
-
getStateKey(key) {
|
|
3669
|
-
return this._state[key];
|
|
3670
|
-
}
|
|
3671
3647
|
dispose() {
|
|
3672
3648
|
super.dispose();
|
|
3673
3649
|
}
|
|
@@ -3687,6 +3663,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3687
3663
|
//
|
|
3688
3664
|
this._onDidSizeChange = new Emitter();
|
|
3689
3665
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
3666
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
3690
3667
|
}
|
|
3691
3668
|
setConstraints(value) {
|
|
3692
3669
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -3700,19 +3677,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3700
3677
|
constructor(panel, group) {
|
|
3701
3678
|
super(panel.id);
|
|
3702
3679
|
this.panel = panel;
|
|
3703
|
-
this._onDidDirtyChange = new Emitter();
|
|
3704
|
-
this.onDidDirtyChange = this._onDidDirtyChange.event;
|
|
3705
3680
|
this._onDidTitleChange = new Emitter();
|
|
3706
3681
|
this.onDidTitleChange = this._onDidTitleChange.event;
|
|
3707
3682
|
this._titleChanged = new Emitter();
|
|
3708
3683
|
this.titleChanged = this._titleChanged.event;
|
|
3709
3684
|
this._suppressClosableChanged = new Emitter();
|
|
3710
3685
|
this.suppressClosableChanged = this._suppressClosableChanged.event;
|
|
3711
|
-
this.
|
|
3712
|
-
this.
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3686
|
+
this._onDidActiveGroupChange = new Emitter();
|
|
3687
|
+
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3688
|
+
this._onDidGroupChange = new Emitter();
|
|
3689
|
+
this.onDidGroupChange = this._onDidGroupChange.event;
|
|
3690
|
+
this.disposable = new MutableDisposable();
|
|
3691
|
+
this.group = group;
|
|
3692
|
+
this.addDisposables(this.disposable, this._onDidTitleChange, this._titleChanged, this._suppressClosableChanged, this._onDidGroupChange, this._onDidActiveGroupChange);
|
|
3716
3693
|
}
|
|
3717
3694
|
get title() {
|
|
3718
3695
|
return this.panel.title;
|
|
@@ -3725,7 +3702,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3725
3702
|
return !!((_a = this.group) === null || _a === void 0 ? void 0 : _a.isActive);
|
|
3726
3703
|
}
|
|
3727
3704
|
set group(value) {
|
|
3705
|
+
const isOldGroupActive = this.isGroupActive;
|
|
3728
3706
|
this._group = value;
|
|
3707
|
+
this._onDidGroupChange.fire();
|
|
3708
|
+
if (this._group) {
|
|
3709
|
+
this.disposable.value = this._group.api.onDidActiveChange(() => {
|
|
3710
|
+
this._onDidActiveGroupChange.fire();
|
|
3711
|
+
});
|
|
3712
|
+
if (this.isGroupActive !== isOldGroupActive) {
|
|
3713
|
+
this._onDidActiveGroupChange.fire();
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3729
3716
|
}
|
|
3730
3717
|
get group() {
|
|
3731
3718
|
return this._group;
|
|
@@ -3739,16 +3726,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3739
3726
|
}
|
|
3740
3727
|
return this.group.model.closePanel(this.panel);
|
|
3741
3728
|
}
|
|
3742
|
-
interceptOnCloseAction(interceptor) {
|
|
3743
|
-
this._interceptor = interceptor;
|
|
3744
|
-
}
|
|
3745
|
-
dispose() {
|
|
3746
|
-
super.dispose();
|
|
3747
|
-
}
|
|
3748
3729
|
}
|
|
3749
3730
|
|
|
3750
3731
|
class DockviewGroupPanel extends CompositeDisposable {
|
|
3751
|
-
constructor(id, containerApi) {
|
|
3732
|
+
constructor(id, accessor, containerApi) {
|
|
3752
3733
|
super();
|
|
3753
3734
|
this.id = id;
|
|
3754
3735
|
this.containerApi = containerApi;
|
|
@@ -3756,9 +3737,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3756
3737
|
this._suppressClosable = false;
|
|
3757
3738
|
this._title = '';
|
|
3758
3739
|
this.api = new DockviewPanelApiImpl(this, this._group);
|
|
3759
|
-
this.onDidStateChange = this.api.onDidStateChange;
|
|
3760
3740
|
this.addDisposables(this.api.onActiveChange(() => {
|
|
3761
|
-
|
|
3741
|
+
accessor.setActivePanel(this);
|
|
3762
3742
|
}), this.api.onDidTitleChange((event) => {
|
|
3763
3743
|
const title = event.title;
|
|
3764
3744
|
this.update({ params: { title } });
|
|
@@ -3782,32 +3762,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3782
3762
|
this._view = params.view;
|
|
3783
3763
|
this.setTitle(params.title);
|
|
3784
3764
|
this.setSuppressClosable(params.suppressClosable || false);
|
|
3785
|
-
if (params.state) {
|
|
3786
|
-
this.api.setState(params.state);
|
|
3787
|
-
}
|
|
3788
3765
|
(_a = this.view) === null || _a === void 0 ? void 0 : _a.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
|
|
3789
3766
|
}
|
|
3790
3767
|
focus() {
|
|
3791
3768
|
this.api._onFocusEvent.fire();
|
|
3792
3769
|
}
|
|
3793
|
-
setDirty(isDirty) {
|
|
3794
|
-
this.api._onDidDirtyChange.fire(isDirty);
|
|
3795
|
-
}
|
|
3796
|
-
close() {
|
|
3797
|
-
if (this.api.tryClose) {
|
|
3798
|
-
return this.api.tryClose();
|
|
3799
|
-
}
|
|
3800
|
-
return Promise.resolve(true);
|
|
3801
|
-
}
|
|
3802
3770
|
toJSON() {
|
|
3803
|
-
const state = this.api.getState();
|
|
3804
3771
|
return {
|
|
3805
3772
|
id: this.id,
|
|
3806
3773
|
view: this.view.toJSON(),
|
|
3807
3774
|
params: Object.keys(this._params || {}).length > 0
|
|
3808
3775
|
? this._params
|
|
3809
3776
|
: undefined,
|
|
3810
|
-
state: state && Object.keys(state).length > 0 ? state : undefined,
|
|
3811
3777
|
suppressClosable: this.suppressClosable || undefined,
|
|
3812
3778
|
title: this.title,
|
|
3813
3779
|
};
|
|
@@ -3852,18 +3818,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3852
3818
|
var _a;
|
|
3853
3819
|
this._group = group;
|
|
3854
3820
|
this.api.group = group;
|
|
3855
|
-
this.mutableDisposable.value = this._group.model.onDidGroupChange((ev) => {
|
|
3856
|
-
var _a;
|
|
3857
|
-
if (ev.kind === exports.GroupChangeKind2.GROUP_ACTIVE) {
|
|
3858
|
-
const isVisible = !!((_a = this._group) === null || _a === void 0 ? void 0 : _a.model.isPanelActive(this));
|
|
3859
|
-
this.api._onDidActiveChange.fire({
|
|
3860
|
-
isActive: isGroupActive && isVisible,
|
|
3861
|
-
});
|
|
3862
|
-
this.api._onDidVisibilityChange.fire({
|
|
3863
|
-
isVisible,
|
|
3864
|
-
});
|
|
3865
|
-
}
|
|
3866
|
-
});
|
|
3867
3821
|
const isPanelVisible = this._group.model.isPanelActive(this);
|
|
3868
3822
|
this.api._onDidActiveChange.fire({
|
|
3869
3823
|
isActive: isGroupActive && isPanelVisible,
|
|
@@ -3973,15 +3927,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3973
3927
|
}
|
|
3974
3928
|
}
|
|
3975
3929
|
|
|
3976
|
-
function debounce(cb, wait) {
|
|
3977
|
-
let timeout;
|
|
3978
|
-
const callable = (...args) => {
|
|
3979
|
-
clearTimeout(timeout);
|
|
3980
|
-
timeout = setTimeout(() => cb(...args), wait);
|
|
3981
|
-
};
|
|
3982
|
-
return callable;
|
|
3983
|
-
}
|
|
3984
|
-
|
|
3985
3930
|
class DefaultDeserializer {
|
|
3986
3931
|
constructor(layout, panelDeserializer) {
|
|
3987
3932
|
this.layout = layout;
|
|
@@ -4082,9 +4027,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4082
4027
|
this._isGroupActive = false;
|
|
4083
4028
|
//
|
|
4084
4029
|
this.params = {};
|
|
4085
|
-
//
|
|
4086
|
-
this.isDirtyDisposable = new MutableDisposable();
|
|
4087
|
-
this.addDisposables(this.isDirtyDisposable);
|
|
4088
4030
|
this._element = document.createElement('div');
|
|
4089
4031
|
this._element.className = 'default-tab';
|
|
4090
4032
|
//
|
|
@@ -4129,10 +4071,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4129
4071
|
init(params) {
|
|
4130
4072
|
this.params = params;
|
|
4131
4073
|
this._content.textContent = params.title;
|
|
4132
|
-
this.isDirtyDisposable.value = this.params.api.onDidDirtyChange((event) => {
|
|
4133
|
-
const isDirty = event;
|
|
4134
|
-
toggleClass(this.action, 'dirty', isDirty);
|
|
4135
|
-
});
|
|
4136
4074
|
if (!this.params.suppressClosable) {
|
|
4137
4075
|
addDisposableListener(this.action, 'click', (ev) => {
|
|
4138
4076
|
ev.preventDefault(); //
|
|
@@ -4186,6 +4124,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4186
4124
|
get height() {
|
|
4187
4125
|
return this._height;
|
|
4188
4126
|
}
|
|
4127
|
+
get params() {
|
|
4128
|
+
var _a;
|
|
4129
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
4130
|
+
}
|
|
4189
4131
|
focus() {
|
|
4190
4132
|
this.api._onFocusEvent.fire();
|
|
4191
4133
|
}
|
|
@@ -4194,29 +4136,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4194
4136
|
this._height = height;
|
|
4195
4137
|
this.api._onDidPanelDimensionChange.fire({ width, height });
|
|
4196
4138
|
if (this.part) {
|
|
4197
|
-
if (this.
|
|
4198
|
-
this.part.update(this.
|
|
4139
|
+
if (this._params) {
|
|
4140
|
+
this.part.update(this._params.params);
|
|
4199
4141
|
}
|
|
4200
4142
|
}
|
|
4201
4143
|
}
|
|
4202
4144
|
init(parameters) {
|
|
4203
|
-
this.
|
|
4145
|
+
this._params = parameters;
|
|
4204
4146
|
this.part = this.getComponent();
|
|
4205
4147
|
}
|
|
4206
4148
|
update(event) {
|
|
4207
4149
|
var _a, _b;
|
|
4208
|
-
this.
|
|
4209
|
-
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this.
|
|
4150
|
+
this._params = Object.assign(Object.assign({}, this._params), { params: Object.assign(Object.assign({}, (_a = this._params) === null || _a === void 0 ? void 0 : _a.params), event.params) });
|
|
4151
|
+
(_b = this.part) === null || _b === void 0 ? void 0 : _b.update({ params: this._params.params });
|
|
4210
4152
|
}
|
|
4211
4153
|
toJSON() {
|
|
4212
4154
|
var _a, _b;
|
|
4213
|
-
const
|
|
4214
|
-
const params = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4155
|
+
const params = (_b = (_a = this._params) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
|
|
4215
4156
|
return {
|
|
4216
4157
|
id: this.id,
|
|
4217
4158
|
component: this.component,
|
|
4218
4159
|
params: Object.keys(params).length > 0 ? params : undefined,
|
|
4219
|
-
state: Object.keys(state).length === 0 ? undefined : state,
|
|
4220
4160
|
};
|
|
4221
4161
|
}
|
|
4222
4162
|
dispose() {
|
|
@@ -4239,12 +4179,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4239
4179
|
this._snap = false;
|
|
4240
4180
|
this._onDidChange = new Emitter();
|
|
4241
4181
|
this.onDidChange = this._onDidChange.event;
|
|
4242
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
4182
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4243
4183
|
const { isVisible } = event;
|
|
4244
|
-
const { containerApi } = this.
|
|
4184
|
+
const { containerApi } = this._params;
|
|
4245
4185
|
containerApi.setVisible(this, isVisible);
|
|
4246
4186
|
}), this.api.onActiveChange(() => {
|
|
4247
|
-
const { containerApi } = this.
|
|
4187
|
+
const { containerApi } = this._params;
|
|
4248
4188
|
containerApi.setActive(this);
|
|
4249
4189
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4250
4190
|
if (typeof event.minimumWidth === 'number' ||
|
|
@@ -4359,9 +4299,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4359
4299
|
const minimum = (value) => (value <= 0 ? undefined : value);
|
|
4360
4300
|
return Object.assign(Object.assign({}, state), { minimumHeight: minimum(this.minimumHeight), maximumHeight: maximum(this.maximumHeight), minimumWidth: minimum(this.minimumWidth), maximumWidth: maximum(this.maximumWidth), snap: this.snap, priority: this.priority });
|
|
4361
4301
|
}
|
|
4362
|
-
dispose() {
|
|
4363
|
-
super.dispose();
|
|
4364
|
-
}
|
|
4365
4302
|
}
|
|
4366
4303
|
|
|
4367
4304
|
class GroupviewPanel extends GridviewPanel {
|
|
@@ -4468,15 +4405,22 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4468
4405
|
orientation: options.orientation || exports.Orientation.HORIZONTAL,
|
|
4469
4406
|
styles: options.styles,
|
|
4470
4407
|
});
|
|
4471
|
-
this._panels = new Map();
|
|
4472
|
-
this.dirtyPanels = new Set();
|
|
4473
|
-
this.debouncedDeque = debounce(this.syncConfigs.bind(this), 5000);
|
|
4474
4408
|
// events
|
|
4475
4409
|
this._onTabInteractionEvent = new Emitter();
|
|
4476
4410
|
this.onTabInteractionEvent = this._onTabInteractionEvent.event;
|
|
4477
4411
|
this._onTabContextMenu = new Emitter();
|
|
4478
4412
|
this.onTabContextMenu = this._onTabContextMenu.event;
|
|
4479
|
-
this.
|
|
4413
|
+
this._onDidDrop = new Emitter();
|
|
4414
|
+
this.onDidDrop = this._onDidDrop.event;
|
|
4415
|
+
this._onDidRemovePanel = new Emitter();
|
|
4416
|
+
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4417
|
+
this._onDidAddPanel = new Emitter();
|
|
4418
|
+
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4419
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4420
|
+
this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
|
|
4421
|
+
this._onDidActivePanelChange = new Emitter();
|
|
4422
|
+
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4423
|
+
this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop);
|
|
4480
4424
|
this._options = options;
|
|
4481
4425
|
if (!this.options.components) {
|
|
4482
4426
|
this.options.components = {};
|
|
@@ -4497,10 +4441,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4497
4441
|
this._api = new DockviewApi(this);
|
|
4498
4442
|
}
|
|
4499
4443
|
get totalPanels() {
|
|
4500
|
-
return this.
|
|
4444
|
+
return this.panels.length;
|
|
4501
4445
|
}
|
|
4502
4446
|
get panels() {
|
|
4503
|
-
return
|
|
4447
|
+
return this.groups.flatMap((group) => group.model.panels);
|
|
4504
4448
|
}
|
|
4505
4449
|
get deserializer() {
|
|
4506
4450
|
return this._deserializer;
|
|
@@ -4530,10 +4474,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4530
4474
|
updateOptions(options) {
|
|
4531
4475
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
4532
4476
|
this.options.orientation !== options.orientation;
|
|
4533
|
-
// TODO support style update
|
|
4534
|
-
// const hasStylesChanged =
|
|
4535
|
-
// typeof options.styles === 'object' &&
|
|
4536
|
-
// this.options.styles !== options.styles;
|
|
4537
4477
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
4538
4478
|
if (hasOrientationChanged) {
|
|
4539
4479
|
this.gridview.orientation = options.orientation;
|
|
@@ -4545,8 +4485,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4545
4485
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4546
4486
|
}
|
|
4547
4487
|
getGroupPanel(id) {
|
|
4548
|
-
|
|
4549
|
-
return (_a = this._panels.get(id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
4488
|
+
return this.panels.find((panel) => panel.id === id);
|
|
4550
4489
|
}
|
|
4551
4490
|
setActivePanel(panel) {
|
|
4552
4491
|
if (!panel.group) {
|
|
@@ -4595,24 +4534,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4595
4534
|
this.doSetGroupActive(next);
|
|
4596
4535
|
}
|
|
4597
4536
|
}
|
|
4598
|
-
registerPanel(panel) {
|
|
4599
|
-
if (this._panels.has(panel.id)) {
|
|
4600
|
-
throw new Error(`panel ${panel.id} already exists`);
|
|
4601
|
-
}
|
|
4602
|
-
const disposable = new CompositeDisposable(panel.onDidStateChange(() => this.addDirtyPanel(panel)));
|
|
4603
|
-
this._panels.set(panel.id, { value: panel, disposable });
|
|
4604
|
-
}
|
|
4605
|
-
unregisterPanel(panel) {
|
|
4606
|
-
if (!this._panels.has(panel.id)) {
|
|
4607
|
-
throw new Error(`panel ${panel.id} doesn't exist`);
|
|
4608
|
-
}
|
|
4609
|
-
const item = this._panels.get(panel.id);
|
|
4610
|
-
if (item) {
|
|
4611
|
-
item.disposable.dispose();
|
|
4612
|
-
item.value.dispose();
|
|
4613
|
-
}
|
|
4614
|
-
this._panels.delete(panel.id);
|
|
4615
|
-
}
|
|
4616
4537
|
/**
|
|
4617
4538
|
* Serialize the current state of the layout
|
|
4618
4539
|
*
|
|
@@ -4620,12 +4541,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4620
4541
|
*/
|
|
4621
4542
|
toJSON() {
|
|
4622
4543
|
var _a;
|
|
4623
|
-
this.syncConfigs();
|
|
4624
4544
|
const data = this.gridview.serialize();
|
|
4625
|
-
const panels =
|
|
4626
|
-
|
|
4627
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4628
|
-
}
|
|
4545
|
+
const panels = this.panels.reduce((collection, panel) => {
|
|
4546
|
+
collection[panel.id] = panel.toJSON();
|
|
4629
4547
|
return collection;
|
|
4630
4548
|
}, {});
|
|
4631
4549
|
return {
|
|
@@ -4637,11 +4555,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4637
4555
|
}
|
|
4638
4556
|
fromJSON(data) {
|
|
4639
4557
|
this.gridview.clear();
|
|
4640
|
-
this.
|
|
4641
|
-
panel.
|
|
4642
|
-
panel.value.dispose();
|
|
4558
|
+
this.panels.forEach((panel) => {
|
|
4559
|
+
panel.dispose();
|
|
4643
4560
|
});
|
|
4644
|
-
this._panels.clear();
|
|
4645
4561
|
this._groups.clear();
|
|
4646
4562
|
if (!this.deserializer) {
|
|
4647
4563
|
throw new Error('invalid deserializer');
|
|
@@ -4656,9 +4572,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4656
4572
|
this.gridview.deserialize(grid, new DefaultDeserializer(this, {
|
|
4657
4573
|
createPanel: (id) => {
|
|
4658
4574
|
const panelData = panels[id];
|
|
4659
|
-
|
|
4660
|
-
this.registerPanel(panel);
|
|
4661
|
-
return panel;
|
|
4575
|
+
return this.deserializer.fromJSON(panelData);
|
|
4662
4576
|
},
|
|
4663
4577
|
}));
|
|
4664
4578
|
if (typeof activeGroup === 'string') {
|
|
@@ -4669,30 +4583,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4669
4583
|
}
|
|
4670
4584
|
this.gridview.layout(this.width, this.height);
|
|
4671
4585
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.LAYOUT_FROM_JSON });
|
|
4586
|
+
this._onDidLayoutfromJSON.fire();
|
|
4672
4587
|
}
|
|
4673
4588
|
closeAllGroups() {
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
if (!didCloseAll) {
|
|
4679
|
-
return false;
|
|
4680
|
-
}
|
|
4681
|
-
}
|
|
4682
|
-
return true;
|
|
4683
|
-
});
|
|
4589
|
+
for (const entry of this._groups.entries()) {
|
|
4590
|
+
const [_, group] = entry;
|
|
4591
|
+
group.value.model.closeAllPanels();
|
|
4592
|
+
}
|
|
4684
4593
|
}
|
|
4685
4594
|
fireMouseEvent(event) {
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
}
|
|
4695
|
-
break;
|
|
4595
|
+
if (event.kind === exports.MouseEventKind.CONTEXT_MENU) {
|
|
4596
|
+
if (event.tab && event.panel) {
|
|
4597
|
+
this._onTabContextMenu.fire({
|
|
4598
|
+
event: event.event,
|
|
4599
|
+
api: this._api,
|
|
4600
|
+
panel: event.panel,
|
|
4601
|
+
});
|
|
4602
|
+
}
|
|
4696
4603
|
}
|
|
4697
4604
|
}
|
|
4698
4605
|
addPanel(options) {
|
|
@@ -4726,7 +4633,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4726
4633
|
return panel;
|
|
4727
4634
|
}
|
|
4728
4635
|
removePanel(panel) {
|
|
4729
|
-
this.unregisterPanel(panel);
|
|
4730
4636
|
const group = panel.group;
|
|
4731
4637
|
if (!group) {
|
|
4732
4638
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
@@ -4745,10 +4651,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4745
4651
|
: {}, (_a = this.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.watermark);
|
|
4746
4652
|
}
|
|
4747
4653
|
addEmptyGroup(options) {
|
|
4748
|
-
var _a;
|
|
4749
4654
|
const group = this.createGroup();
|
|
4750
4655
|
if (options) {
|
|
4751
|
-
const referencePanel =
|
|
4656
|
+
const referencePanel = this.panels.find((panel) => panel.id === options.referencePanel);
|
|
4752
4657
|
if (!referencePanel) {
|
|
4753
4658
|
throw new Error(`reference panel ${options.referencePanel} does not exist`);
|
|
4754
4659
|
}
|
|
@@ -4777,13 +4682,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4777
4682
|
super.removeGroup(group);
|
|
4778
4683
|
}
|
|
4779
4684
|
moveGroupOrPanel(referenceGroup, groupId, itemId, target, index) {
|
|
4780
|
-
var _a
|
|
4685
|
+
var _a;
|
|
4781
4686
|
const sourceGroup = groupId
|
|
4782
4687
|
? (_a = this._groups.get(groupId)) === null || _a === void 0 ? void 0 : _a.value
|
|
4783
4688
|
: undefined;
|
|
4784
4689
|
if (!target || target === exports.Position.Center) {
|
|
4785
4690
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4786
|
-
|
|
4691
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4787
4692
|
if (!groupItem) {
|
|
4788
4693
|
throw new Error(`No panel with id ${itemId}`);
|
|
4789
4694
|
}
|
|
@@ -4819,7 +4724,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4819
4724
|
}
|
|
4820
4725
|
else {
|
|
4821
4726
|
const groupItem = (sourceGroup === null || sourceGroup === void 0 ? void 0 : sourceGroup.model.removePanel(itemId)) ||
|
|
4822
|
-
|
|
4727
|
+
this.panels.find((panel) => panel.id === itemId);
|
|
4823
4728
|
if (!groupItem) {
|
|
4824
4729
|
throw new Error(`No panel with id ${itemId}`);
|
|
4825
4730
|
}
|
|
@@ -4829,7 +4734,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4829
4734
|
}
|
|
4830
4735
|
}
|
|
4831
4736
|
doSetGroupActive(group, skipFocus) {
|
|
4832
|
-
var _a, _b;
|
|
4737
|
+
var _a, _b, _c;
|
|
4833
4738
|
const isGroupAlreadyFocused = this._activeGroup === group;
|
|
4834
4739
|
super.doSetGroupActive(group, skipFocus);
|
|
4835
4740
|
if (!isGroupAlreadyFocused && ((_a = this._activeGroup) === null || _a === void 0 ? void 0 : _a.model.activePanel)) {
|
|
@@ -4837,6 +4742,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4837
4742
|
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4838
4743
|
panel: (_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel,
|
|
4839
4744
|
});
|
|
4745
|
+
this._onDidActivePanelChange.fire((_c = this._activeGroup) === null || _c === void 0 ? void 0 : _c.model.activePanel);
|
|
4840
4746
|
}
|
|
4841
4747
|
}
|
|
4842
4748
|
createGroup(options) {
|
|
@@ -4862,6 +4768,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4862
4768
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4863
4769
|
const { groupId, itemId, target, index } = event;
|
|
4864
4770
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
4771
|
+
}), view.model.onDidDrop((event) => {
|
|
4772
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
|
|
4865
4773
|
}), view.model.onDidGroupChange((event) => {
|
|
4866
4774
|
switch (event.kind) {
|
|
4867
4775
|
case exports.GroupChangeKind2.ADD_PANEL:
|
|
@@ -4869,24 +4777,25 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4869
4777
|
kind: exports.GroupChangeKind.ADD_PANEL,
|
|
4870
4778
|
panel: event.panel,
|
|
4871
4779
|
});
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
kind: exports.GroupChangeKind.GROUP_ACTIVE,
|
|
4876
|
-
panel: event.panel,
|
|
4877
|
-
});
|
|
4780
|
+
if (event.panel) {
|
|
4781
|
+
this._onDidAddPanel.fire(event.panel);
|
|
4782
|
+
}
|
|
4878
4783
|
break;
|
|
4879
4784
|
case exports.GroupChangeKind2.REMOVE_PANEL:
|
|
4880
4785
|
this._onGridEvent.fire({
|
|
4881
4786
|
kind: exports.GroupChangeKind.REMOVE_PANEL,
|
|
4882
4787
|
panel: event.panel,
|
|
4883
4788
|
});
|
|
4789
|
+
if (event.panel) {
|
|
4790
|
+
this._onDidRemovePanel.fire(event.panel);
|
|
4791
|
+
}
|
|
4884
4792
|
break;
|
|
4885
4793
|
case exports.GroupChangeKind2.PANEL_ACTIVE:
|
|
4886
4794
|
this._onGridEvent.fire({
|
|
4887
4795
|
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4888
4796
|
panel: event.panel,
|
|
4889
4797
|
});
|
|
4798
|
+
this._onDidActivePanelChange.fire(event.panel);
|
|
4890
4799
|
break;
|
|
4891
4800
|
}
|
|
4892
4801
|
}));
|
|
@@ -4900,44 +4809,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4900
4809
|
}
|
|
4901
4810
|
return view;
|
|
4902
4811
|
}
|
|
4903
|
-
dispose() {
|
|
4904
|
-
super.dispose();
|
|
4905
|
-
this._onGridEvent.dispose();
|
|
4906
|
-
}
|
|
4907
|
-
/**
|
|
4908
|
-
* Ensure the local copy of the layout state is up-to-date
|
|
4909
|
-
*/
|
|
4910
|
-
syncConfigs() {
|
|
4911
|
-
const dirtyPanels = Array.from(this.dirtyPanels);
|
|
4912
|
-
if (dirtyPanels.length === 0) ;
|
|
4913
|
-
this.dirtyPanels.clear();
|
|
4914
|
-
const partialPanelState = dirtyPanels
|
|
4915
|
-
.map((panel) => this._panels.get(panel.id))
|
|
4916
|
-
.filter((_) => !!_)
|
|
4917
|
-
.reduce((collection, panel) => {
|
|
4918
|
-
collection[panel.value.id] = panel.value.toJSON();
|
|
4919
|
-
return collection;
|
|
4920
|
-
}, {});
|
|
4921
|
-
this.panelState = Object.assign(Object.assign({}, this.panelState), partialPanelState);
|
|
4922
|
-
dirtyPanels
|
|
4923
|
-
.filter((p) => this._panels.has(p.id))
|
|
4924
|
-
.forEach((panel) => {
|
|
4925
|
-
panel.setDirty(false);
|
|
4926
|
-
});
|
|
4927
|
-
}
|
|
4928
4812
|
_addPanel(options) {
|
|
4929
4813
|
const view = new DefaultGroupPanelView({
|
|
4930
4814
|
content: this.createContentComponent(options.id, options.component),
|
|
4931
4815
|
tab: this.createTabComponent(options.id, options.tabComponent),
|
|
4932
4816
|
});
|
|
4933
|
-
const panel = new DockviewGroupPanel(options.id, this._api);
|
|
4817
|
+
const panel = new DockviewGroupPanel(options.id, this, this._api);
|
|
4934
4818
|
panel.init({
|
|
4935
4819
|
view,
|
|
4936
4820
|
title: options.title || options.id,
|
|
4937
4821
|
suppressClosable: options === null || options === void 0 ? void 0 : options.suppressClosable,
|
|
4938
4822
|
params: (options === null || options === void 0 ? void 0 : options.params) || {},
|
|
4939
4823
|
});
|
|
4940
|
-
this.registerPanel(panel);
|
|
4941
4824
|
return panel;
|
|
4942
4825
|
}
|
|
4943
4826
|
createContentComponent(id, componentName) {
|
|
@@ -4957,10 +4840,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4957
4840
|
var _a;
|
|
4958
4841
|
return (_a = Array.from(this._groups.values()).find((group) => group.value.model.containsPanel(panel))) === null || _a === void 0 ? void 0 : _a.value;
|
|
4959
4842
|
}
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
this.
|
|
4843
|
+
dispose() {
|
|
4844
|
+
super.dispose();
|
|
4845
|
+
this._onDidActivePanelChange.dispose();
|
|
4846
|
+
this._onDidAddPanel.dispose();
|
|
4847
|
+
this._onDidRemovePanel.dispose();
|
|
4848
|
+
this._onDidLayoutfromJSON.dispose();
|
|
4964
4849
|
}
|
|
4965
4850
|
}
|
|
4966
4851
|
|
|
@@ -4971,6 +4856,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4971
4856
|
orientation: options.orientation,
|
|
4972
4857
|
styles: options.styles,
|
|
4973
4858
|
});
|
|
4859
|
+
this._onDidLayoutfromJSON = new Emitter();
|
|
4860
|
+
this.onDidLayoutFromJSON = this._onDidLayoutfromJSON.event;
|
|
4974
4861
|
this._options = options;
|
|
4975
4862
|
if (!this.options.components) {
|
|
4976
4863
|
this.options.components = {};
|
|
@@ -5079,6 +4966,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5079
4966
|
}
|
|
5080
4967
|
}
|
|
5081
4968
|
this._onGridEvent.fire({ kind: exports.GroupChangeKind.LAYOUT_FROM_JSON });
|
|
4969
|
+
this._onDidLayoutfromJSON.fire();
|
|
5082
4970
|
}
|
|
5083
4971
|
movePanel(panel, options) {
|
|
5084
4972
|
var _a;
|
|
@@ -5193,6 +5081,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5193
5081
|
}
|
|
5194
5082
|
dispose() {
|
|
5195
5083
|
super.dispose();
|
|
5084
|
+
this._onDidLayoutfromJSON.dispose();
|
|
5196
5085
|
}
|
|
5197
5086
|
}
|
|
5198
5087
|
|
|
@@ -5219,7 +5108,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5219
5108
|
options.frameworkComponents = {};
|
|
5220
5109
|
}
|
|
5221
5110
|
this.splitview = new Splitview(this.element, options);
|
|
5222
|
-
this.addDisposables(this._disposable);
|
|
5111
|
+
this.addDisposables(this._disposable, this._onDidAddView, this._onDidRemoveView, this._onDidLayoutChange);
|
|
5223
5112
|
}
|
|
5224
5113
|
get options() {
|
|
5225
5114
|
return this._options;
|
|
@@ -5441,41 +5330,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5441
5330
|
}
|
|
5442
5331
|
}
|
|
5443
5332
|
|
|
5444
|
-
class DragHandler extends CompositeDisposable {
|
|
5445
|
-
constructor(el) {
|
|
5446
|
-
super();
|
|
5447
|
-
this.el = el;
|
|
5448
|
-
this.iframes = [];
|
|
5449
|
-
this._onDragStart = new Emitter();
|
|
5450
|
-
this.onDragStart = this._onDragStart.event;
|
|
5451
|
-
this.configure();
|
|
5452
|
-
}
|
|
5453
|
-
configure() {
|
|
5454
|
-
this.addDisposables(addDisposableListener(this.el, 'dragstart', (event) => {
|
|
5455
|
-
var _a;
|
|
5456
|
-
this.iframes = [
|
|
5457
|
-
...getElementsByTagName('iframe'),
|
|
5458
|
-
...getElementsByTagName('webview'),
|
|
5459
|
-
];
|
|
5460
|
-
for (const iframe of this.iframes) {
|
|
5461
|
-
iframe.style.pointerEvents = 'none';
|
|
5462
|
-
}
|
|
5463
|
-
this.el.classList.add('dragged');
|
|
5464
|
-
setTimeout(() => this.el.classList.remove('dragged'), 0);
|
|
5465
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5466
|
-
this.disposable = this.getData();
|
|
5467
|
-
}), addDisposableListener(this.el, 'dragend', (ev) => {
|
|
5468
|
-
var _a;
|
|
5469
|
-
for (const iframe of this.iframes) {
|
|
5470
|
-
iframe.style.pointerEvents = 'auto';
|
|
5471
|
-
}
|
|
5472
|
-
this.iframes = [];
|
|
5473
|
-
(_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5474
|
-
this.disposable = undefined;
|
|
5475
|
-
}));
|
|
5476
|
-
}
|
|
5477
|
-
}
|
|
5478
|
-
|
|
5479
5333
|
class SplitviewPanelApiImpl extends PanelApiImpl {
|
|
5480
5334
|
//
|
|
5481
5335
|
constructor(id) {
|
|
@@ -5490,6 +5344,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5490
5344
|
//
|
|
5491
5345
|
this._onDidSizeChange = new Emitter();
|
|
5492
5346
|
this.onDidSizeChange = this._onDidSizeChange.event;
|
|
5347
|
+
this.addDisposables(this._onDidConstraintsChangeInternal, this._onDidConstraintsChange, this._onDidSizeChange);
|
|
5493
5348
|
}
|
|
5494
5349
|
setConstraints(value) {
|
|
5495
5350
|
this._onDidConstraintsChangeInternal.fire(value);
|
|
@@ -5497,11 +5352,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5497
5352
|
setSize(event) {
|
|
5498
5353
|
this._onDidSizeChange.fire(event);
|
|
5499
5354
|
}
|
|
5500
|
-
dispose() {
|
|
5501
|
-
super.dispose();
|
|
5502
|
-
this._onDidConstraintsChange.dispose();
|
|
5503
|
-
this._onDidSizeChange.dispose();
|
|
5504
|
-
}
|
|
5505
5355
|
}
|
|
5506
5356
|
|
|
5507
5357
|
class PaneviewPanelApiImpl extends SplitviewPanelApiImpl {
|
|
@@ -5515,6 +5365,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5515
5365
|
this.onMouseEnter = this._onMouseEnter.event;
|
|
5516
5366
|
this._onMouseLeave = new Emitter({});
|
|
5517
5367
|
this.onMouseLeave = this._onMouseLeave.event;
|
|
5368
|
+
this.addDisposables(this._onDidExpansionChange, this._onMouseEnter, this._onMouseLeave);
|
|
5518
5369
|
}
|
|
5519
5370
|
set pane(pane) {
|
|
5520
5371
|
this._pane = pane;
|
|
@@ -5683,7 +5534,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5683
5534
|
}
|
|
5684
5535
|
}
|
|
5685
5536
|
toJSON() {
|
|
5686
|
-
const params = this.
|
|
5537
|
+
const params = this._params;
|
|
5687
5538
|
return Object.assign(Object.assign({}, super.toJSON()), { headerComponent: this.headerComponent, title: params.title });
|
|
5688
5539
|
}
|
|
5689
5540
|
renderOnce() {
|
|
@@ -5752,36 +5603,39 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5752
5603
|
},
|
|
5753
5604
|
});
|
|
5754
5605
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
5755
|
-
|
|
5756
|
-
if (!data) {
|
|
5757
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5758
|
-
return;
|
|
5759
|
-
}
|
|
5760
|
-
const containerApi = this.params
|
|
5761
|
-
.containerApi;
|
|
5762
|
-
const panelId = data.paneId;
|
|
5763
|
-
const existingPanel = containerApi.getPanel(panelId);
|
|
5764
|
-
if (!existingPanel) {
|
|
5765
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5766
|
-
return;
|
|
5767
|
-
}
|
|
5768
|
-
const allPanels = containerApi.getPanels();
|
|
5769
|
-
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5770
|
-
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5771
|
-
if (event.position === exports.Position.Left ||
|
|
5772
|
-
event.position === exports.Position.Top) {
|
|
5773
|
-
toIndex = Math.max(0, toIndex - 1);
|
|
5774
|
-
}
|
|
5775
|
-
if (event.position === exports.Position.Right ||
|
|
5776
|
-
event.position === exports.Position.Bottom) {
|
|
5777
|
-
if (fromIndex > toIndex) {
|
|
5778
|
-
toIndex++;
|
|
5779
|
-
}
|
|
5780
|
-
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5781
|
-
}
|
|
5782
|
-
containerApi.movePanel(fromIndex, toIndex);
|
|
5606
|
+
this.onDrop(event);
|
|
5783
5607
|
}));
|
|
5784
5608
|
}
|
|
5609
|
+
onDrop(event) {
|
|
5610
|
+
const data = getPaneData();
|
|
5611
|
+
if (!data) {
|
|
5612
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5613
|
+
return;
|
|
5614
|
+
}
|
|
5615
|
+
const containerApi = this._params
|
|
5616
|
+
.containerApi;
|
|
5617
|
+
const panelId = data.paneId;
|
|
5618
|
+
const existingPanel = containerApi.getPanel(panelId);
|
|
5619
|
+
if (!existingPanel) {
|
|
5620
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
|
|
5621
|
+
return;
|
|
5622
|
+
}
|
|
5623
|
+
const allPanels = containerApi.getPanels();
|
|
5624
|
+
const fromIndex = allPanels.indexOf(existingPanel);
|
|
5625
|
+
let toIndex = containerApi.getPanels().indexOf(this);
|
|
5626
|
+
if (event.position === exports.Position.Left ||
|
|
5627
|
+
event.position === exports.Position.Top) {
|
|
5628
|
+
toIndex = Math.max(0, toIndex - 1);
|
|
5629
|
+
}
|
|
5630
|
+
if (event.position === exports.Position.Right ||
|
|
5631
|
+
event.position === exports.Position.Bottom) {
|
|
5632
|
+
if (fromIndex > toIndex) {
|
|
5633
|
+
toIndex++;
|
|
5634
|
+
}
|
|
5635
|
+
toIndex = Math.min(allPanels.length - 1, toIndex);
|
|
5636
|
+
}
|
|
5637
|
+
containerApi.movePanel(fromIndex, toIndex);
|
|
5638
|
+
}
|
|
5785
5639
|
}
|
|
5786
5640
|
|
|
5787
5641
|
class DefaultHeader extends CompositeDisposable {
|
|
@@ -5845,6 +5699,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5845
5699
|
this.onDidAddView = this._onDidAddView.event;
|
|
5846
5700
|
this._onDidRemoveView = new Emitter();
|
|
5847
5701
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
5702
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
|
|
5848
5703
|
this._options = options;
|
|
5849
5704
|
if (!options.components) {
|
|
5850
5705
|
options.components = {};
|
|
@@ -6072,12 +5927,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6072
5927
|
this._snap = false;
|
|
6073
5928
|
this._onDidChange = new Emitter();
|
|
6074
5929
|
this.onDidChange = this._onDidChange.event;
|
|
6075
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
5930
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
6076
5931
|
const { isVisible } = event;
|
|
6077
|
-
const { containerApi } = this
|
|
5932
|
+
const { containerApi } = this
|
|
5933
|
+
._params;
|
|
6078
5934
|
containerApi.setVisible(this, isVisible);
|
|
6079
5935
|
}), this.api.onActiveChange(() => {
|
|
6080
|
-
const { containerApi } = this
|
|
5936
|
+
const { containerApi } = this
|
|
5937
|
+
._params;
|
|
6081
5938
|
containerApi.setActive(this);
|
|
6082
5939
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
6083
5940
|
if (typeof event.minimumSize === 'number' ||
|
|
@@ -6220,14 +6077,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6220
6077
|
if (this.disposed) {
|
|
6221
6078
|
throw new Error('invalid operation: resource is already disposed');
|
|
6222
6079
|
}
|
|
6223
|
-
// TODO use a better check for isReactFunctionalComponent
|
|
6224
6080
|
if (typeof this.component !== 'function') {
|
|
6225
6081
|
/**
|
|
6226
6082
|
* we know this isn't a React.FunctionComponent so throw an error here.
|
|
6227
6083
|
* if we do not intercept this the React library will throw a very obsure error
|
|
6228
6084
|
* for the same reason, at least at this point we will emit a sensible stacktrace.
|
|
6229
6085
|
*/
|
|
6230
|
-
throw new Error('
|
|
6086
|
+
throw new Error('Invalid Operation. dockview only supports React Functional Components.');
|
|
6231
6087
|
}
|
|
6232
6088
|
const bridgeComponent = React__namespace.createElement(React__namespace.forwardRef(ReactComponentBridge), {
|
|
6233
6089
|
component: this
|
|
@@ -6291,16 +6147,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6291
6147
|
this._onDidBlur = new Emitter();
|
|
6292
6148
|
this.onDidBlur = this._onDidBlur.event;
|
|
6293
6149
|
this._element = document.createElement('div');
|
|
6294
|
-
this._element.
|
|
6295
|
-
this._element.style.width = '100%';
|
|
6150
|
+
this._element.className = 'dockview-react-part';
|
|
6296
6151
|
// this.hostedContainer = new HostedContainer({
|
|
6297
6152
|
// id,
|
|
6298
6153
|
// });
|
|
6299
6154
|
// this.hostedContainer.onDidFocus(() => this._onDidFocus.fire());
|
|
6300
6155
|
// this.hostedContainer.onDidBlur(() => this._onDidBlur.fire());
|
|
6301
6156
|
this._actionsElement = document.createElement('div');
|
|
6302
|
-
this._actionsElement.
|
|
6303
|
-
this._actionsElement.style.width = '100%';
|
|
6157
|
+
this._actionsElement.className = 'dockview-react-part';
|
|
6304
6158
|
}
|
|
6305
6159
|
get element() {
|
|
6306
6160
|
return this._element;
|
|
@@ -6348,6 +6202,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6348
6202
|
}
|
|
6349
6203
|
dispose() {
|
|
6350
6204
|
var _a, _b;
|
|
6205
|
+
this._onDidFocus.dispose();
|
|
6206
|
+
this._onDidBlur.dispose();
|
|
6351
6207
|
(_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
6352
6208
|
// this.hostedContainer?.dispose();
|
|
6353
6209
|
(_b = this.actionsPart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
@@ -6360,6 +6216,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6360
6216
|
this.component = component;
|
|
6361
6217
|
this.reactPortalStore = reactPortalStore;
|
|
6362
6218
|
this._element = document.createElement('div');
|
|
6219
|
+
this._element.className = 'dockview-react-part';
|
|
6363
6220
|
}
|
|
6364
6221
|
get element() {
|
|
6365
6222
|
return this._element;
|
|
@@ -6404,7 +6261,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6404
6261
|
const panelId = panelData.id;
|
|
6405
6262
|
const params = panelData.params;
|
|
6406
6263
|
const title = panelData.title;
|
|
6407
|
-
const state = panelData.state;
|
|
6408
6264
|
const suppressClosable = panelData.suppressClosable;
|
|
6409
6265
|
const viewData = panelData.view;
|
|
6410
6266
|
const view = new DefaultGroupPanelView({
|
|
@@ -6413,13 +6269,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6413
6269
|
? createComponent(viewData.tab.id, viewData.tab.id, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab)
|
|
6414
6270
|
: new DefaultTab(),
|
|
6415
6271
|
});
|
|
6416
|
-
const panel = new DockviewGroupPanel(panelId, new DockviewApi(this.layout));
|
|
6272
|
+
const panel = new DockviewGroupPanel(panelId, this.layout, new DockviewApi(this.layout));
|
|
6417
6273
|
panel.init({
|
|
6418
6274
|
view,
|
|
6419
6275
|
title,
|
|
6420
6276
|
suppressClosable,
|
|
6421
6277
|
params: params || {},
|
|
6422
|
-
state: state || {},
|
|
6423
6278
|
});
|
|
6424
6279
|
return panel;
|
|
6425
6280
|
}
|
|
@@ -6434,8 +6289,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6434
6289
|
value: undefined,
|
|
6435
6290
|
};
|
|
6436
6291
|
this._element = document.createElement('div');
|
|
6437
|
-
this._element.
|
|
6438
|
-
this._element.style.width = '100%';
|
|
6292
|
+
this._element.className = 'dockview-react-part';
|
|
6439
6293
|
}
|
|
6440
6294
|
get element() {
|
|
6441
6295
|
return this._element;
|
|
@@ -6533,12 +6387,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6533
6387
|
frameworkTabComponents: props.tabComponents,
|
|
6534
6388
|
tabHeight: props.tabHeight,
|
|
6535
6389
|
debug: props.debug,
|
|
6536
|
-
enableExternalDragEvents: props.enableExternalDragEvents,
|
|
6537
6390
|
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6538
6391
|
styles: props.hideBorders
|
|
6539
6392
|
? { separatorBorder: 'transparent' }
|
|
6540
6393
|
: undefined,
|
|
6541
6394
|
});
|
|
6395
|
+
const disposable = dockview.onDidDrop((event) => {
|
|
6396
|
+
if (props.onDidDrop) {
|
|
6397
|
+
props.onDidDrop(event);
|
|
6398
|
+
}
|
|
6399
|
+
});
|
|
6542
6400
|
(_a = domRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(dockview.element);
|
|
6543
6401
|
dockview.deserializer = new ReactPanelDeserialzier(dockview);
|
|
6544
6402
|
const { clientWidth, clientHeight } = domRef.current;
|
|
@@ -6548,6 +6406,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6548
6406
|
}
|
|
6549
6407
|
dockviewRef.current = dockview;
|
|
6550
6408
|
return () => {
|
|
6409
|
+
disposable.dispose();
|
|
6551
6410
|
dockview.dispose();
|
|
6552
6411
|
};
|
|
6553
6412
|
}, []);
|
|
@@ -6559,6 +6418,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6559
6418
|
frameworkComponents: props.components,
|
|
6560
6419
|
});
|
|
6561
6420
|
}, [props.components]);
|
|
6421
|
+
React__namespace.useEffect(() => {
|
|
6422
|
+
if (!dockviewRef.current) {
|
|
6423
|
+
return;
|
|
6424
|
+
}
|
|
6425
|
+
dockviewRef.current.updateOptions({
|
|
6426
|
+
showDndOverlay: props.showDndOverlay,
|
|
6427
|
+
});
|
|
6428
|
+
}, [props.showDndOverlay]);
|
|
6562
6429
|
React__namespace.useEffect(() => {
|
|
6563
6430
|
if (!dockviewRef.current) {
|
|
6564
6431
|
return;
|
|
@@ -6647,9 +6514,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6647
6514
|
getComponent() {
|
|
6648
6515
|
var _a;
|
|
6649
6516
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6650
|
-
params: ((_a = this.
|
|
6517
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6651
6518
|
api: this.api,
|
|
6652
|
-
containerApi: this.
|
|
6519
|
+
containerApi: this._params
|
|
6653
6520
|
.containerApi,
|
|
6654
6521
|
});
|
|
6655
6522
|
}
|
|
@@ -6722,9 +6589,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6722
6589
|
getComponent() {
|
|
6723
6590
|
var _a;
|
|
6724
6591
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6725
|
-
params: ((_a = this.
|
|
6592
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6726
6593
|
api: this.api,
|
|
6727
|
-
containerApi: this.
|
|
6594
|
+
containerApi: this._params
|
|
6728
6595
|
.containerApi,
|
|
6729
6596
|
});
|
|
6730
6597
|
}
|
|
@@ -6915,7 +6782,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6915
6782
|
exports.BaseGrid = BaseGrid;
|
|
6916
6783
|
exports.CompositeDisposable = CompositeDisposable;
|
|
6917
6784
|
exports.ContentContainer = ContentContainer;
|
|
6918
|
-
exports.DATA_KEY = DATA_KEY;
|
|
6919
6785
|
exports.DockviewApi = DockviewApi;
|
|
6920
6786
|
exports.DockviewComponent = DockviewComponent;
|
|
6921
6787
|
exports.DockviewComponents = DockviewComponents;
|
|
@@ -6950,7 +6816,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6950
6816
|
exports.TickDelayedEvent = TickDelayedEvent;
|
|
6951
6817
|
exports.addDisposableListener = addDisposableListener;
|
|
6952
6818
|
exports.addDisposableWindowListener = addDisposableWindowListener;
|
|
6953
|
-
exports.extractData = extractData;
|
|
6954
6819
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
6955
6820
|
exports.getGridLocation = getGridLocation;
|
|
6956
6821
|
exports.getLocationOrientation = getLocationOrientation;
|
|
@@ -6958,11 +6823,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6958
6823
|
exports.getPanelData = getPanelData;
|
|
6959
6824
|
exports.getRelativeLocation = getRelativeLocation;
|
|
6960
6825
|
exports.indexInParent = indexInParent;
|
|
6961
|
-
exports.isCustomDragEvent = isCustomDragEvent;
|
|
6962
6826
|
exports.isGridBranchNode = isGridBranchNode;
|
|
6963
|
-
exports.isPanelTransferEvent = isPanelTransferEvent;
|
|
6964
6827
|
exports.isReactElement = isReactElement;
|
|
6965
|
-
exports.isTabDragEvent = isTabDragEvent;
|
|
6966
6828
|
exports.orthogonal = orthogonal;
|
|
6967
6829
|
exports.toTarget = toTarget;
|
|
6968
6830
|
exports.usePortalsLifecycle = usePortalsLifecycle;
|