dockview 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/component.api.d.ts +1 -3
- package/dist/cjs/api/component.api.js +0 -14
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +1 -1
- package/dist/cjs/dnd/abstractDragHandler.js +1 -2
- package/dist/cjs/dnd/abstractDragHandler.js.map +1 -1
- package/dist/cjs/dockview/deserializer.js.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +5 -3
- package/dist/cjs/dockview/dockviewComponent.js +45 -38
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +1 -0
- package/dist/cjs/dockview/dockviewGroupPanel.js +8 -0
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +3 -20
- package/dist/cjs/gridview/baseComponentGridview.js +9 -43
- package/dist/cjs/gridview/baseComponentGridview.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 +1 -0
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.js +0 -1
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/gridview/leafNode.js +1 -1
- package/dist/cjs/gridview/leafNode.js.map +1 -1
- package/dist/cjs/groupview/groupPanel.d.ts +1 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +8 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/paneview/paneview.js +3 -2
- package/dist/cjs/paneview/paneview.js.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +1 -0
- package/dist/cjs/paneview/paneviewComponent.js +4 -0
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/react/dockview/components.js +5 -1
- package/dist/cjs/react/dockview/components.js.map +1 -1
- package/dist/cjs/react/dockview/dockview.js +14 -1
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/gridview/gridview.js +9 -2
- package/dist/cjs/react/gridview/gridview.js.map +1 -1
- package/dist/cjs/react/index.js +5 -1
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/react/paneview/paneview.js +5 -1
- package/dist/cjs/react/paneview/paneview.js.map +1 -1
- package/dist/cjs/react/react.js +5 -1
- package/dist/cjs/react/react.js.map +1 -1
- package/dist/cjs/react/splitview/splitview.js +8 -2
- package/dist/cjs/react/splitview/splitview.js.map +1 -1
- package/dist/cjs/splitview/core/splitview.js +1 -1
- package/dist/cjs/splitview/core/splitview.js.map +1 -1
- package/dist/cjs/splitview/splitviewComponent.js +1 -0
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/dockview.amd.js +168 -207
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.noStyle.js +167 -206
- package/dist/dockview.cjs.js +168 -207
- package/dist/dockview.esm.js +168 -201
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.js +168 -207
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.noStyle.js +167 -206
- package/dist/esm/api/component.api.d.ts +1 -3
- package/dist/esm/api/component.api.js +0 -6
- package/dist/esm/dnd/abstractDragHandler.d.ts +1 -1
- package/dist/esm/dnd/abstractDragHandler.js +1 -2
- package/dist/esm/dockview/dockviewComponent.d.ts +5 -3
- package/dist/esm/dockview/dockviewComponent.js +20 -36
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +1 -0
- package/dist/esm/dockview/dockviewGroupPanel.js +4 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +3 -20
- package/dist/esm/gridview/baseComponentGridview.js +9 -43
- package/dist/esm/gridview/branchNode.js +1 -1
- package/dist/esm/gridview/gridview.js +1 -0
- package/dist/esm/gridview/gridviewComponent.js +1 -2
- package/dist/esm/groupview/groupPanel.d.ts +1 -0
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -2
- package/dist/esm/paneview/paneview.js +1 -1
- package/dist/esm/paneview/paneviewComponent.d.ts +1 -0
- package/dist/esm/paneview/paneviewComponent.js +4 -0
- package/dist/esm/react/dockview/dockview.js +9 -0
- package/dist/esm/react/gridview/gridview.js +4 -1
- package/dist/esm/react/splitview/splitview.js +3 -1
- package/dist/esm/splitview/core/splitview.js +1 -1
- package/dist/esm/splitview/splitviewComponent.js +1 -0
- package/dist/styles/dockview.css +9 -8
- package/package.json +11 -11
package/dist/dockview.noStyle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 1.
|
|
3
|
+
* @version 1.2.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -31,6 +31,76 @@
|
|
|
31
31
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
32
32
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
33
33
|
|
|
34
|
+
class TransferObject {
|
|
35
|
+
constructor() {
|
|
36
|
+
//
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
class PanelTransfer extends TransferObject {
|
|
40
|
+
constructor(viewId, groupId, panelId) {
|
|
41
|
+
super();
|
|
42
|
+
this.viewId = viewId;
|
|
43
|
+
this.groupId = groupId;
|
|
44
|
+
this.panelId = panelId;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
class PaneTransfer extends TransferObject {
|
|
48
|
+
constructor(viewId, paneId) {
|
|
49
|
+
super();
|
|
50
|
+
this.viewId = viewId;
|
|
51
|
+
this.paneId = paneId;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
56
|
+
*/
|
|
57
|
+
class LocalSelectionTransfer {
|
|
58
|
+
constructor() {
|
|
59
|
+
// protect against external instantiation
|
|
60
|
+
}
|
|
61
|
+
static getInstance() {
|
|
62
|
+
return LocalSelectionTransfer.INSTANCE;
|
|
63
|
+
}
|
|
64
|
+
hasData(proto) {
|
|
65
|
+
return proto && proto === this.proto;
|
|
66
|
+
}
|
|
67
|
+
clearData(proto) {
|
|
68
|
+
if (this.hasData(proto)) {
|
|
69
|
+
this.proto = undefined;
|
|
70
|
+
this.data = undefined;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
getData(proto) {
|
|
74
|
+
if (this.hasData(proto)) {
|
|
75
|
+
return this.data;
|
|
76
|
+
}
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
setData(data, proto) {
|
|
80
|
+
if (proto) {
|
|
81
|
+
this.data = data;
|
|
82
|
+
this.proto = proto;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
LocalSelectionTransfer.INSTANCE = new LocalSelectionTransfer();
|
|
87
|
+
function getPanelData() {
|
|
88
|
+
const panelTransfer = LocalSelectionTransfer.getInstance();
|
|
89
|
+
const isPanelEvent = panelTransfer.hasData(PanelTransfer.prototype);
|
|
90
|
+
if (!isPanelEvent) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
return panelTransfer.getData(PanelTransfer.prototype)[0];
|
|
94
|
+
}
|
|
95
|
+
function getPaneData() {
|
|
96
|
+
const paneTransfer = LocalSelectionTransfer.getInstance();
|
|
97
|
+
const isPanelEvent = paneTransfer.hasData(PaneTransfer.prototype);
|
|
98
|
+
if (!isPanelEvent) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
return paneTransfer.getData(PaneTransfer.prototype)[0];
|
|
102
|
+
}
|
|
103
|
+
|
|
34
104
|
exports.Event = void 0;
|
|
35
105
|
(function (Event) {
|
|
36
106
|
Event.any = (...children) => {
|
|
@@ -120,116 +190,6 @@
|
|
|
120
190
|
}
|
|
121
191
|
}
|
|
122
192
|
|
|
123
|
-
exports.Disposable = void 0;
|
|
124
|
-
(function (Disposable) {
|
|
125
|
-
Disposable.NONE = {
|
|
126
|
-
dispose: () => {
|
|
127
|
-
// noop
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
})(exports.Disposable || (exports.Disposable = {}));
|
|
131
|
-
class CompositeDisposable {
|
|
132
|
-
constructor(...args) {
|
|
133
|
-
this.disposables = args;
|
|
134
|
-
}
|
|
135
|
-
static from(...args) {
|
|
136
|
-
return new CompositeDisposable(...args);
|
|
137
|
-
}
|
|
138
|
-
addDisposables(...args) {
|
|
139
|
-
args.forEach((arg) => this.disposables.push(arg));
|
|
140
|
-
}
|
|
141
|
-
dispose() {
|
|
142
|
-
this.disposables.forEach((arg) => arg.dispose());
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
class MutableDisposable {
|
|
146
|
-
constructor() {
|
|
147
|
-
this._disposable = exports.Disposable.NONE;
|
|
148
|
-
}
|
|
149
|
-
set value(disposable) {
|
|
150
|
-
if (this._disposable) {
|
|
151
|
-
this._disposable.dispose();
|
|
152
|
-
}
|
|
153
|
-
this._disposable = disposable;
|
|
154
|
-
}
|
|
155
|
-
dispose() {
|
|
156
|
-
if (this._disposable) {
|
|
157
|
-
this._disposable.dispose();
|
|
158
|
-
this._disposable = exports.Disposable.NONE;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
class TransferObject {
|
|
164
|
-
constructor() {
|
|
165
|
-
//
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
class PanelTransfer extends TransferObject {
|
|
169
|
-
constructor(viewId, groupId, panelId) {
|
|
170
|
-
super();
|
|
171
|
-
this.viewId = viewId;
|
|
172
|
-
this.groupId = groupId;
|
|
173
|
-
this.panelId = panelId;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
class PaneTransfer extends TransferObject {
|
|
177
|
-
constructor(viewId, paneId) {
|
|
178
|
-
super();
|
|
179
|
-
this.viewId = viewId;
|
|
180
|
-
this.paneId = paneId;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* A singleton to store transfer data during drag & drop operations that are only valid within the application.
|
|
185
|
-
*/
|
|
186
|
-
class LocalSelectionTransfer {
|
|
187
|
-
constructor() {
|
|
188
|
-
// protect against external instantiation
|
|
189
|
-
}
|
|
190
|
-
static getInstance() {
|
|
191
|
-
return LocalSelectionTransfer.INSTANCE;
|
|
192
|
-
}
|
|
193
|
-
hasData(proto) {
|
|
194
|
-
return proto && proto === this.proto;
|
|
195
|
-
}
|
|
196
|
-
clearData(proto) {
|
|
197
|
-
if (this.hasData(proto)) {
|
|
198
|
-
this.proto = undefined;
|
|
199
|
-
this.data = undefined;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
getData(proto) {
|
|
203
|
-
if (this.hasData(proto)) {
|
|
204
|
-
return this.data;
|
|
205
|
-
}
|
|
206
|
-
return undefined;
|
|
207
|
-
}
|
|
208
|
-
setData(data, proto) {
|
|
209
|
-
if (proto) {
|
|
210
|
-
this.data = data;
|
|
211
|
-
this.proto = proto;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
LocalSelectionTransfer.INSTANCE = new LocalSelectionTransfer();
|
|
216
|
-
function getPanelData() {
|
|
217
|
-
const panelTransfer = LocalSelectionTransfer.getInstance();
|
|
218
|
-
const isPanelEvent = panelTransfer.hasData(PanelTransfer.prototype);
|
|
219
|
-
if (!isPanelEvent) {
|
|
220
|
-
return undefined;
|
|
221
|
-
}
|
|
222
|
-
return panelTransfer.getData(PanelTransfer.prototype)[0];
|
|
223
|
-
}
|
|
224
|
-
function getPaneData() {
|
|
225
|
-
const paneTransfer = LocalSelectionTransfer.getInstance();
|
|
226
|
-
const isPanelEvent = paneTransfer.hasData(PaneTransfer.prototype);
|
|
227
|
-
if (!isPanelEvent) {
|
|
228
|
-
return undefined;
|
|
229
|
-
}
|
|
230
|
-
return paneTransfer.getData(PaneTransfer.prototype)[0];
|
|
231
|
-
}
|
|
232
|
-
|
|
233
193
|
class SplitviewApi {
|
|
234
194
|
constructor(component) {
|
|
235
195
|
this.component = component;
|
|
@@ -390,9 +350,6 @@
|
|
|
390
350
|
get height() {
|
|
391
351
|
return this.component.height;
|
|
392
352
|
}
|
|
393
|
-
get onGridEvent() {
|
|
394
|
-
return this.component.onGridEvent;
|
|
395
|
-
}
|
|
396
353
|
get onDidLayoutChange() {
|
|
397
354
|
return this.component.onDidLayoutChange;
|
|
398
355
|
}
|
|
@@ -482,9 +439,6 @@
|
|
|
482
439
|
get totalPanels() {
|
|
483
440
|
return this.component.totalPanels;
|
|
484
441
|
}
|
|
485
|
-
get onGridEvent() {
|
|
486
|
-
return this.component.onGridEvent;
|
|
487
|
-
}
|
|
488
442
|
get onDidActiveGroupChange() {
|
|
489
443
|
return this.component.onDidActiveGroupChange;
|
|
490
444
|
}
|
|
@@ -568,6 +522,46 @@
|
|
|
568
522
|
}
|
|
569
523
|
}
|
|
570
524
|
|
|
525
|
+
var Disposable;
|
|
526
|
+
(function (Disposable) {
|
|
527
|
+
Disposable.NONE = {
|
|
528
|
+
dispose: () => {
|
|
529
|
+
// noop
|
|
530
|
+
},
|
|
531
|
+
};
|
|
532
|
+
})(Disposable || (Disposable = {}));
|
|
533
|
+
class CompositeDisposable {
|
|
534
|
+
constructor(...args) {
|
|
535
|
+
this.disposables = args;
|
|
536
|
+
}
|
|
537
|
+
static from(...args) {
|
|
538
|
+
return new CompositeDisposable(...args);
|
|
539
|
+
}
|
|
540
|
+
addDisposables(...args) {
|
|
541
|
+
args.forEach((arg) => this.disposables.push(arg));
|
|
542
|
+
}
|
|
543
|
+
dispose() {
|
|
544
|
+
this.disposables.forEach((arg) => arg.dispose());
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
class MutableDisposable {
|
|
548
|
+
constructor() {
|
|
549
|
+
this._disposable = Disposable.NONE;
|
|
550
|
+
}
|
|
551
|
+
set value(disposable) {
|
|
552
|
+
if (this._disposable) {
|
|
553
|
+
this._disposable.dispose();
|
|
554
|
+
}
|
|
555
|
+
this._disposable = disposable;
|
|
556
|
+
}
|
|
557
|
+
dispose() {
|
|
558
|
+
if (this._disposable) {
|
|
559
|
+
this._disposable.dispose();
|
|
560
|
+
this._disposable = Disposable.NONE;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
571
565
|
function watchElementResize(element, cb) {
|
|
572
566
|
const observer = new ResizeObserver((entires) => {
|
|
573
567
|
const firstEntry = entires[0];
|
|
@@ -1513,13 +1507,13 @@
|
|
|
1513
1507
|
this._onDidSashEnd.dispose();
|
|
1514
1508
|
this._onDidAddView.dispose();
|
|
1515
1509
|
this._onDidRemoveView.dispose();
|
|
1516
|
-
this.element.remove();
|
|
1517
1510
|
for (let i = 0; i < this.element.children.length; i++) {
|
|
1518
1511
|
if (this.element.children.item(i) === this.element) {
|
|
1519
1512
|
this.element.removeChild(this.element);
|
|
1520
1513
|
break;
|
|
1521
1514
|
}
|
|
1522
1515
|
}
|
|
1516
|
+
this.element.remove();
|
|
1523
1517
|
}
|
|
1524
1518
|
}
|
|
1525
1519
|
|
|
@@ -1648,7 +1642,6 @@
|
|
|
1648
1642
|
}
|
|
1649
1643
|
dispose() {
|
|
1650
1644
|
super.dispose();
|
|
1651
|
-
this.splitview.dispose();
|
|
1652
1645
|
if (this.animationTimer) {
|
|
1653
1646
|
clearTimeout(this.animationTimer);
|
|
1654
1647
|
this.animationTimer = undefined;
|
|
@@ -1657,6 +1650,7 @@
|
|
|
1657
1650
|
paneItem.disposable.dispose();
|
|
1658
1651
|
});
|
|
1659
1652
|
this.paneItems = [];
|
|
1653
|
+
this.splitview.dispose();
|
|
1660
1654
|
this.element.remove();
|
|
1661
1655
|
}
|
|
1662
1656
|
}
|
|
@@ -1975,7 +1969,7 @@
|
|
|
1975
1969
|
this.children = [];
|
|
1976
1970
|
this._onDidChange = new Emitter();
|
|
1977
1971
|
this.onDidChange = this._onDidChange.event;
|
|
1978
|
-
this._childrenDisposable =
|
|
1972
|
+
this._childrenDisposable = Disposable.NONE;
|
|
1979
1973
|
this._orthogonalSize = orthogonalSize;
|
|
1980
1974
|
this._size = size;
|
|
1981
1975
|
this.element = document.createElement('div');
|
|
@@ -2000,7 +1994,7 @@
|
|
|
2000
1994
|
: true,
|
|
2001
1995
|
};
|
|
2002
1996
|
}),
|
|
2003
|
-
size: this.
|
|
1997
|
+
size: this.size,
|
|
2004
1998
|
};
|
|
2005
1999
|
this.children = childDescriptors.map((c) => c.node);
|
|
2006
2000
|
this.splitview = new Splitview(this.element, {
|
|
@@ -2321,6 +2315,7 @@
|
|
|
2321
2315
|
this.disposable.dispose();
|
|
2322
2316
|
this._onDidChange.dispose();
|
|
2323
2317
|
this.root.dispose();
|
|
2318
|
+
this.element.remove();
|
|
2324
2319
|
}
|
|
2325
2320
|
clear() {
|
|
2326
2321
|
const orientation = this.root.orientation;
|
|
@@ -3351,19 +3346,6 @@
|
|
|
3351
3346
|
}
|
|
3352
3347
|
}
|
|
3353
3348
|
|
|
3354
|
-
exports.GroupChangeKind = void 0;
|
|
3355
|
-
(function (GroupChangeKind) {
|
|
3356
|
-
GroupChangeKind["ADD_PANEL"] = "ADD_PANEL";
|
|
3357
|
-
GroupChangeKind["REMOVE_PANEL"] = "REMOVE_PANEL";
|
|
3358
|
-
GroupChangeKind["PANEL_ACTIVE"] = "PANEL_ACTIVE";
|
|
3359
|
-
//
|
|
3360
|
-
GroupChangeKind["GROUP_ACTIVE"] = "GROUP_ACTIVE";
|
|
3361
|
-
GroupChangeKind["ADD_GROUP"] = "ADD_GROUP";
|
|
3362
|
-
GroupChangeKind["REMOVE_GROUP"] = "REMOVE_GROUP";
|
|
3363
|
-
//
|
|
3364
|
-
GroupChangeKind["LAYOUT_FROM_JSON"] = "LAYOUT_FROM_JSON";
|
|
3365
|
-
GroupChangeKind["LAYOUT"] = "LAYOUT";
|
|
3366
|
-
})(exports.GroupChangeKind || (exports.GroupChangeKind = {}));
|
|
3367
3349
|
const nextLayoutId = sequentialNumberGenerator();
|
|
3368
3350
|
function toTarget(direction) {
|
|
3369
3351
|
switch (direction) {
|
|
@@ -3386,9 +3368,6 @@
|
|
|
3386
3368
|
this._element = _element;
|
|
3387
3369
|
this._id = nextLayoutId.next();
|
|
3388
3370
|
this._groups = new Map();
|
|
3389
|
-
//
|
|
3390
|
-
this._onGridEvent = new Emitter();
|
|
3391
|
-
this.onGridEvent = this._onGridEvent.event;
|
|
3392
3371
|
this._onDidLayoutChange = new Emitter();
|
|
3393
3372
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
3394
3373
|
this._onDidRemoveGroup = new Emitter();
|
|
@@ -3397,30 +3376,18 @@
|
|
|
3397
3376
|
this.onDidAddGroup = this._onDidAddGroup.event;
|
|
3398
3377
|
this._onDidActiveGroupChange = new Emitter();
|
|
3399
3378
|
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
3379
|
+
this._bufferOnDidLayoutChange = new TickDelayedEvent();
|
|
3400
3380
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation);
|
|
3401
3381
|
this.element.appendChild(this.gridview.element);
|
|
3402
3382
|
this.layout(0, 0, true); // set some elements height/widths
|
|
3403
3383
|
this.addDisposables(this.gridview.onDidChange(() => {
|
|
3404
|
-
this.
|
|
3384
|
+
this._onDidLayoutChange.fire();
|
|
3405
3385
|
}));
|
|
3406
|
-
this.addDisposables((() => {
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
exports.GroupChangeKind.REMOVE_GROUP,
|
|
3412
|
-
exports.GroupChangeKind.ADD_PANEL,
|
|
3413
|
-
exports.GroupChangeKind.REMOVE_PANEL,
|
|
3414
|
-
exports.GroupChangeKind.GROUP_ACTIVE,
|
|
3415
|
-
exports.GroupChangeKind.PANEL_ACTIVE,
|
|
3416
|
-
exports.GroupChangeKind.LAYOUT,
|
|
3417
|
-
].includes(event.kind)) {
|
|
3418
|
-
tickDelayedEvent.fire();
|
|
3419
|
-
}
|
|
3420
|
-
}), tickDelayedEvent.onEvent(() => {
|
|
3421
|
-
this._onDidLayoutChange.fire();
|
|
3422
|
-
}), tickDelayedEvent);
|
|
3423
|
-
})());
|
|
3386
|
+
this.addDisposables(exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
|
|
3387
|
+
this._bufferOnDidLayoutChange.fire();
|
|
3388
|
+
}), this._bufferOnDidLayoutChange.onEvent(() => {
|
|
3389
|
+
this._onDidLayoutChange.fire();
|
|
3390
|
+
}), this._bufferOnDidLayoutChange);
|
|
3424
3391
|
}
|
|
3425
3392
|
get id() {
|
|
3426
3393
|
return this._id;
|
|
@@ -3457,14 +3424,13 @@
|
|
|
3457
3424
|
}
|
|
3458
3425
|
setVisible(panel, visible) {
|
|
3459
3426
|
this.gridview.setViewVisible(getGridLocation(panel.element), visible);
|
|
3460
|
-
this.
|
|
3427
|
+
this._onDidLayoutChange.fire();
|
|
3461
3428
|
}
|
|
3462
3429
|
isVisible(panel) {
|
|
3463
3430
|
return this.gridview.isViewVisible(getGridLocation(panel.element));
|
|
3464
3431
|
}
|
|
3465
3432
|
doAddGroup(group, location = [0], size) {
|
|
3466
3433
|
this.gridview.addView(group, size !== null && size !== void 0 ? size : exports.Sizing.Distribute, location);
|
|
3467
|
-
this._onGridEvent.fire({ kind: exports.GroupChangeKind.ADD_GROUP });
|
|
3468
3434
|
this._onDidAddGroup.fire(group);
|
|
3469
3435
|
this.doSetGroupActive(group);
|
|
3470
3436
|
}
|
|
@@ -3478,7 +3444,6 @@
|
|
|
3478
3444
|
item.disposable.dispose();
|
|
3479
3445
|
this._groups.delete(group.id);
|
|
3480
3446
|
}
|
|
3481
|
-
this._onGridEvent.fire({ kind: exports.GroupChangeKind.REMOVE_GROUP });
|
|
3482
3447
|
this._onDidRemoveGroup.fire(group);
|
|
3483
3448
|
if (!(options === null || options === void 0 ? void 0 : options.skipActive) && this._activeGroup === group) {
|
|
3484
3449
|
const groups = Array.from(this._groups.values());
|
|
@@ -3507,9 +3472,6 @@
|
|
|
3507
3472
|
}
|
|
3508
3473
|
}
|
|
3509
3474
|
this._activeGroup = group;
|
|
3510
|
-
this._onGridEvent.fire({
|
|
3511
|
-
kind: exports.GroupChangeKind.GROUP_ACTIVE,
|
|
3512
|
-
});
|
|
3513
3475
|
this._onDidActiveGroupChange.fire(group);
|
|
3514
3476
|
}
|
|
3515
3477
|
removeGroup(group) {
|
|
@@ -3566,7 +3528,6 @@
|
|
|
3566
3528
|
}
|
|
3567
3529
|
dispose() {
|
|
3568
3530
|
super.dispose();
|
|
3569
|
-
this._onGridEvent.dispose();
|
|
3570
3531
|
this._onDidActiveGroupChange.dispose();
|
|
3571
3532
|
this._onDidAddGroup.dispose();
|
|
3572
3533
|
this._onDidRemoveGroup.dispose();
|
|
@@ -3748,6 +3709,10 @@
|
|
|
3748
3709
|
this.update({ params: { title } });
|
|
3749
3710
|
}));
|
|
3750
3711
|
}
|
|
3712
|
+
get params() {
|
|
3713
|
+
var _a;
|
|
3714
|
+
return (_a = this._params) === null || _a === void 0 ? void 0 : _a.params;
|
|
3715
|
+
}
|
|
3751
3716
|
get title() {
|
|
3752
3717
|
return this._title;
|
|
3753
3718
|
}
|
|
@@ -4424,7 +4389,9 @@
|
|
|
4424
4389
|
this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
|
|
4425
4390
|
this._onDidActivePanelChange = new Emitter();
|
|
4426
4391
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4427
|
-
this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop)
|
|
4392
|
+
this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
4393
|
+
this._bufferOnDidLayoutChange.fire();
|
|
4394
|
+
}));
|
|
4428
4395
|
this._options = options;
|
|
4429
4396
|
if (!this.options.components) {
|
|
4430
4397
|
this.options.components = {};
|
|
@@ -4558,11 +4525,12 @@
|
|
|
4558
4525
|
};
|
|
4559
4526
|
}
|
|
4560
4527
|
fromJSON(data) {
|
|
4528
|
+
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
4529
|
+
for (const group of groups) {
|
|
4530
|
+
// remove the group will automatically remove the panels
|
|
4531
|
+
this.removeGroup(group, true);
|
|
4532
|
+
}
|
|
4561
4533
|
this.gridview.clear();
|
|
4562
|
-
this.panels.forEach((panel) => {
|
|
4563
|
-
panel.dispose();
|
|
4564
|
-
});
|
|
4565
|
-
this._groups.clear();
|
|
4566
4534
|
if (!this.deserializer) {
|
|
4567
4535
|
throw new Error('invalid deserializer');
|
|
4568
4536
|
}
|
|
@@ -4586,7 +4554,6 @@
|
|
|
4586
4554
|
}
|
|
4587
4555
|
}
|
|
4588
4556
|
this.gridview.layout(this.width, this.height);
|
|
4589
|
-
this._onGridEvent.fire({ kind: exports.GroupChangeKind.LAYOUT_FROM_JSON });
|
|
4590
4557
|
this._onDidLayoutfromJSON.fire();
|
|
4591
4558
|
}
|
|
4592
4559
|
closeAllGroups() {
|
|
@@ -4636,13 +4603,13 @@
|
|
|
4636
4603
|
}
|
|
4637
4604
|
return panel;
|
|
4638
4605
|
}
|
|
4639
|
-
removePanel(panel) {
|
|
4606
|
+
removePanel(panel, options = { removeEmptyGroup: true }) {
|
|
4640
4607
|
const group = panel.group;
|
|
4641
4608
|
if (!group) {
|
|
4642
4609
|
throw new Error(`cannot remove panel ${panel.id}. it's missing a group.`);
|
|
4643
4610
|
}
|
|
4644
4611
|
group.model.removePanel(panel);
|
|
4645
|
-
if (group.model.size === 0) {
|
|
4612
|
+
if (group.model.size === 0 && options.removeEmptyGroup) {
|
|
4646
4613
|
this.removeGroup(group);
|
|
4647
4614
|
}
|
|
4648
4615
|
}
|
|
@@ -4674,16 +4641,14 @@
|
|
|
4674
4641
|
this.doAddGroup(group);
|
|
4675
4642
|
}
|
|
4676
4643
|
}
|
|
4677
|
-
removeGroup(group) {
|
|
4644
|
+
removeGroup(group, skipActive = false) {
|
|
4678
4645
|
const panels = [...group.model.panels]; // reassign since group panels will mutate
|
|
4679
|
-
|
|
4680
|
-
this.removePanel(panel
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
this._activeGroup = group;
|
|
4684
|
-
return;
|
|
4646
|
+
for (const panel of panels) {
|
|
4647
|
+
this.removePanel(panel, {
|
|
4648
|
+
removeEmptyGroup: false,
|
|
4649
|
+
});
|
|
4685
4650
|
}
|
|
4686
|
-
super.
|
|
4651
|
+
super.doRemoveGroup(group, { skipActive });
|
|
4687
4652
|
}
|
|
4688
4653
|
moveGroupOrPanel(referenceGroup, groupId, itemId, target, index) {
|
|
4689
4654
|
var _a;
|
|
@@ -4738,15 +4703,11 @@
|
|
|
4738
4703
|
}
|
|
4739
4704
|
}
|
|
4740
4705
|
doSetGroupActive(group, skipFocus) {
|
|
4741
|
-
var _a, _b
|
|
4706
|
+
var _a, _b;
|
|
4742
4707
|
const isGroupAlreadyFocused = this._activeGroup === group;
|
|
4743
4708
|
super.doSetGroupActive(group, skipFocus);
|
|
4744
4709
|
if (!isGroupAlreadyFocused && ((_a = this._activeGroup) === null || _a === void 0 ? void 0 : _a.model.activePanel)) {
|
|
4745
|
-
this.
|
|
4746
|
-
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4747
|
-
panel: (_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel,
|
|
4748
|
-
});
|
|
4749
|
-
this._onDidActivePanelChange.fire((_c = this._activeGroup) === null || _c === void 0 ? void 0 : _c.model.activePanel);
|
|
4710
|
+
this._onDidActivePanelChange.fire((_b = this._activeGroup) === null || _b === void 0 ? void 0 : _b.model.activePanel);
|
|
4750
4711
|
}
|
|
4751
4712
|
}
|
|
4752
4713
|
createGroup(options) {
|
|
@@ -4777,28 +4738,16 @@
|
|
|
4777
4738
|
}), view.model.onDidGroupChange((event) => {
|
|
4778
4739
|
switch (event.kind) {
|
|
4779
4740
|
case exports.GroupChangeKind2.ADD_PANEL:
|
|
4780
|
-
this._onGridEvent.fire({
|
|
4781
|
-
kind: exports.GroupChangeKind.ADD_PANEL,
|
|
4782
|
-
panel: event.panel,
|
|
4783
|
-
});
|
|
4784
4741
|
if (event.panel) {
|
|
4785
4742
|
this._onDidAddPanel.fire(event.panel);
|
|
4786
4743
|
}
|
|
4787
4744
|
break;
|
|
4788
4745
|
case exports.GroupChangeKind2.REMOVE_PANEL:
|
|
4789
|
-
this._onGridEvent.fire({
|
|
4790
|
-
kind: exports.GroupChangeKind.REMOVE_PANEL,
|
|
4791
|
-
panel: event.panel,
|
|
4792
|
-
});
|
|
4793
4746
|
if (event.panel) {
|
|
4794
4747
|
this._onDidRemovePanel.fire(event.panel);
|
|
4795
4748
|
}
|
|
4796
4749
|
break;
|
|
4797
4750
|
case exports.GroupChangeKind2.PANEL_ACTIVE:
|
|
4798
|
-
this._onGridEvent.fire({
|
|
4799
|
-
kind: exports.GroupChangeKind.PANEL_ACTIVE,
|
|
4800
|
-
panel: event.panel,
|
|
4801
|
-
});
|
|
4802
4751
|
this._onDidActivePanelChange.fire(event.panel);
|
|
4803
4752
|
break;
|
|
4804
4753
|
}
|
|
@@ -4969,7 +4918,6 @@
|
|
|
4969
4918
|
this.doSetGroupActive(panel);
|
|
4970
4919
|
}
|
|
4971
4920
|
}
|
|
4972
|
-
this._onGridEvent.fire({ kind: exports.GroupChangeKind.LAYOUT_FROM_JSON });
|
|
4973
4921
|
this._onDidLayoutfromJSON.fire();
|
|
4974
4922
|
}
|
|
4975
4923
|
movePanel(panel, options) {
|
|
@@ -5330,6 +5278,7 @@
|
|
|
5330
5278
|
value.dispose();
|
|
5331
5279
|
});
|
|
5332
5280
|
this.panels.clear();
|
|
5281
|
+
this.splitview.dispose();
|
|
5333
5282
|
super.dispose();
|
|
5334
5283
|
}
|
|
5335
5284
|
}
|
|
@@ -5919,6 +5868,10 @@
|
|
|
5919
5868
|
queue.forEach((f) => f());
|
|
5920
5869
|
}
|
|
5921
5870
|
}
|
|
5871
|
+
dispose() {
|
|
5872
|
+
super.dispose();
|
|
5873
|
+
this.paneview.dispose();
|
|
5874
|
+
}
|
|
5922
5875
|
}
|
|
5923
5876
|
|
|
5924
5877
|
class SplitviewPanel extends BasePanelView {
|
|
@@ -6412,6 +6365,7 @@
|
|
|
6412
6365
|
return () => {
|
|
6413
6366
|
disposable.dispose();
|
|
6414
6367
|
dockview.dispose();
|
|
6368
|
+
element.remove();
|
|
6415
6369
|
};
|
|
6416
6370
|
}, []);
|
|
6417
6371
|
React__namespace.useEffect(() => {
|
|
@@ -6422,6 +6376,14 @@
|
|
|
6422
6376
|
frameworkComponents: props.components,
|
|
6423
6377
|
});
|
|
6424
6378
|
}, [props.components]);
|
|
6379
|
+
React__namespace.useEffect(() => {
|
|
6380
|
+
if (!dockviewRef.current) {
|
|
6381
|
+
return;
|
|
6382
|
+
}
|
|
6383
|
+
dockviewRef.current.updateOptions({
|
|
6384
|
+
watermarkFrameworkComponent: props.watermarkComponent,
|
|
6385
|
+
});
|
|
6386
|
+
}, [props.watermarkComponent]);
|
|
6425
6387
|
React__namespace.useEffect(() => {
|
|
6426
6388
|
if (!dockviewRef.current) {
|
|
6427
6389
|
return;
|
|
@@ -6557,7 +6519,9 @@
|
|
|
6557
6519
|
});
|
|
6558
6520
|
},
|
|
6559
6521
|
},
|
|
6560
|
-
proportionalLayout: props.proportionalLayout
|
|
6522
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
6523
|
+
? props.proportionalLayout
|
|
6524
|
+
: true,
|
|
6561
6525
|
styles: props.hideBorders
|
|
6562
6526
|
? { separatorBorder: 'transparent' }
|
|
6563
6527
|
: undefined,
|
|
@@ -6625,7 +6589,9 @@
|
|
|
6625
6589
|
var _a;
|
|
6626
6590
|
const element = document.createElement('div');
|
|
6627
6591
|
const gridview = new GridviewComponent(element, {
|
|
6628
|
-
proportionalLayout:
|
|
6592
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
6593
|
+
? props.proportionalLayout
|
|
6594
|
+
: true,
|
|
6629
6595
|
orientation: props.orientation,
|
|
6630
6596
|
frameworkComponents: props.components,
|
|
6631
6597
|
frameworkComponentFactory: {
|
|
@@ -6648,6 +6614,7 @@
|
|
|
6648
6614
|
gridviewRef.current = gridview;
|
|
6649
6615
|
return () => {
|
|
6650
6616
|
gridview.dispose();
|
|
6617
|
+
element.remove();
|
|
6651
6618
|
};
|
|
6652
6619
|
}, []);
|
|
6653
6620
|
React__namespace.useEffect(() => {
|
|
@@ -6784,13 +6751,11 @@
|
|
|
6784
6751
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
6785
6752
|
|
|
6786
6753
|
exports.BaseGrid = BaseGrid;
|
|
6787
|
-
exports.CompositeDisposable = CompositeDisposable;
|
|
6788
6754
|
exports.ContentContainer = ContentContainer;
|
|
6789
6755
|
exports.DockviewApi = DockviewApi;
|
|
6790
6756
|
exports.DockviewComponent = DockviewComponent;
|
|
6791
6757
|
exports.DockviewComponents = DockviewComponents;
|
|
6792
6758
|
exports.DockviewReact = DockviewReact;
|
|
6793
|
-
exports.Emitter = Emitter;
|
|
6794
6759
|
exports.Gridview = Gridview;
|
|
6795
6760
|
exports.GridviewApi = GridviewApi;
|
|
6796
6761
|
exports.GridviewComponent = GridviewComponent;
|
|
@@ -6798,7 +6763,6 @@
|
|
|
6798
6763
|
exports.GridviewReact = GridviewReact;
|
|
6799
6764
|
exports.Groupview = Groupview;
|
|
6800
6765
|
exports.LocalSelectionTransfer = LocalSelectionTransfer;
|
|
6801
|
-
exports.MutableDisposable = MutableDisposable;
|
|
6802
6766
|
exports.PaneFramework = PaneFramework;
|
|
6803
6767
|
exports.PaneTransfer = PaneTransfer;
|
|
6804
6768
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -6817,9 +6781,6 @@
|
|
|
6817
6781
|
exports.SplitviewPanel = SplitviewPanel;
|
|
6818
6782
|
exports.SplitviewReact = SplitviewReact;
|
|
6819
6783
|
exports.Tab = Tab$1;
|
|
6820
|
-
exports.TickDelayedEvent = TickDelayedEvent;
|
|
6821
|
-
exports.addDisposableListener = addDisposableListener;
|
|
6822
|
-
exports.addDisposableWindowListener = addDisposableWindowListener;
|
|
6823
6784
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
6824
6785
|
exports.getGridLocation = getGridLocation;
|
|
6825
6786
|
exports.getLocationOrientation = getLocationOrientation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDockviewComponent, SerializedDockview } from '../dockview/dockviewComponent';
|
|
2
2
|
import { AddGroupOptions, AddPanelOptions, MovementOptions } from '../dockview/options';
|
|
3
|
-
import { Direction
|
|
3
|
+
import { Direction } from '../gridview/baseComponentGridview';
|
|
4
4
|
import { AddComponentOptions, IGridviewComponent, SerializedGridview } from '../gridview/gridviewComponent';
|
|
5
5
|
import { IGridviewPanel } from '../gridview/gridviewPanel';
|
|
6
6
|
import { IGroupPanel } from '../groupview/groupPanel';
|
|
@@ -77,7 +77,6 @@ export declare class GridviewApi implements CommonApi {
|
|
|
77
77
|
get maximumWidth(): number;
|
|
78
78
|
get width(): number;
|
|
79
79
|
get height(): number;
|
|
80
|
-
get onGridEvent(): Event<GroupChangeEvent>;
|
|
81
80
|
get onDidLayoutChange(): Event<void>;
|
|
82
81
|
get onDidAddGroup(): Event<IGridviewPanel>;
|
|
83
82
|
get onDidRemoveGroup(): Event<IGridviewPanel>;
|
|
@@ -114,7 +113,6 @@ export declare class DockviewApi implements CommonApi {
|
|
|
114
113
|
get maximumWidth(): number;
|
|
115
114
|
get size(): number;
|
|
116
115
|
get totalPanels(): number;
|
|
117
|
-
get onGridEvent(): Event<GroupChangeEvent>;
|
|
118
116
|
get onDidActiveGroupChange(): Event<IGroupviewPanel | undefined>;
|
|
119
117
|
get onDidAddGroup(): Event<IGroupviewPanel>;
|
|
120
118
|
get onDidRemoveGroup(): Event<IGroupviewPanel>;
|